Class PWAManifest
/app/<appID>/manifest-<lang>.webmanifest (or manifest.webmanifest for an application without languages, ruling PW-3) by the application directory (order V5-E, which calls this class).Every text and colour comes from the App (ModuleApp): name, description, colours (ruling AU-9 = T1-130: the former name, $descr and localized of .iiziPWA duplicated the App and already disagreed with it in apps\icu; the App wins). The .iiziPWA file (PWAProps) is the switch - absent, there is no manifest - and since CC-PUSH-PWA-PAGES Set I the owner of what the App does not have: the icons (PWAIcons, ruling PX-1), the categories (ruling PM-4: the iiziRun page's list, written as the W3C names of CATEGORIES) and the orientation (ORIENTATIONS). lang is the page's language and dir is rtl for a right-to-left language (ruling PM-1); screenshots lists the designer's files of the PWA folder (PWAScreenshots, ruling PM-2).
id and scope are /app/<appID>/ in every language, so switching the language never makes a second installation. start_url comes from getStartURL(String,String) alone, the one method ruling AU-1's fallback C would change.
A member without a value is omitted, never written empty. Members are written in a fixed order, so the same App gives the same bytes (the directory stamp hashes them).
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path of the application directory before the application ID.static final String[][]The W3C manifestcategorieswritten for each entry ofCATEGORY_NAMES(the W3C "Manifest App Categories" list: books, business, education, entertainment, finance, fitness, food, games, government, health, kids, lifestyle, magazines, medical, music, navigation, news, personalization, photo, politics, productivity, security, shopping, social, sports, travel, utilities, weather).static final String[]The category names of the iiziRun page (com.iizigo.runEditableProps0.properties,app_category), by the index.iiziPWAstores (PWAProps.CATEGORY_PROPNAME); the PWA page offers the same list (ruling PM-4).static final StringThebackground_colorwhen the App has neither an opaqueiconBGnor an opaquethemeColor:--iz-bgof the default family (IIZI), light.static final StringThetheme_colorwhen the App has no opaquethemeColor:--iz-bg2of the default family (IIZI), light, iniz/css/iiziThemes.css.static final StringThe display mode.static final StringThe file name of the one manifest of an application without languages: "manifest.webmanifest".static final StringThe media type of the manifest.static final String[]Theorientationvalues by the index.iiziPWAstores (PWAProps.ORIENTATION_PROPNAME): 0 writes no member.Method Summary
Modifier and TypeMethodDescriptionstatic StringGenerates the manifest of an application for a language.static Stringgenerate(ModuleApp app, PWAProps pwa, String appID, String lang, PWAIcons icons, List<PWAScreenshots.Shot> screenshots) Generates the manifest of an application for a language, with its screenshots.static StringGets thebackground_color, the splash background on Android: the App's opaqueiconBG, else its opaquethemeColor(a referenced colour resolved for the light scheme), elseDEFAULT_BACKGROUND_COLOR.static StringgetFileName(String lang) Gets the file name of the manifest for a language, relative to the application directory:manifest-<lang>.webmanifest, andFILE_NAME_NO_LANGUAGEfor an application without languages (ruling PW-3: nevermanifest-.webmanifest).static StringGets the scope of an application, which is also its manifestid.static StringgetStartURL(String appID, String lang) Gets the start URL of an application for a language.static StringgetThemeColor(ModuleApp app) Gets thetheme_color: the App's opaquethemeColor(a referenced colour resolved for the light scheme,PWAIcons.opaque(ModuleApp,GColor,String)), elseDEFAULT_THEME_COLOR.static booleanisInstallable(PWAProps pwa) Checks whether an application is installable: its.iiziPWAis present.static booleanisRightToLeft(String lang) Tests whether a language is written right to left (ruling PM-1: the manifest'sdirand the page's<html dir>): Arabic, Persian, Hebrew, Urdu, Yiddish and their aliases, asComponentOrientation.getOrientation(Locale)knows them.
Field Details
APP_PATH_PREFIX
The path of the application directory before the application ID.- See Also:
MEDIA_TYPE
DISPLAY
The display mode.standaloneis what P4-01 measured Push with on iPadOS; thedisplaymember of.iiziPWAis v5.1 (PR-3).- See Also:
DEFAULT_THEME_COLOR
Thetheme_colorwhen the App has no opaquethemeColor:--iz-bg2of the default family (IIZI), light, iniz/css/iiziThemes.css.- See Also:
DEFAULT_BACKGROUND_COLOR
Thebackground_colorwhen the App has neither an opaqueiconBGnor an opaquethemeColor:--iz-bgof the default family (IIZI), light.- See Also:
ORIENTATIONS
Theorientationvalues by the index.iiziPWAstores (PWAProps.ORIENTATION_PROPNAME): 0 writes no member.CATEGORY_NAMES
The category names of the iiziRun page (com.iizigo.runEditableProps0.properties,app_category), by the index.iiziPWAstores (PWAProps.CATEGORY_PROPNAME); the PWA page offers the same list (ruling PM-4). Index 0 is none.CATEGORIES
The W3C manifestcategorieswritten for each entry ofCATEGORY_NAMES(the W3C "Manifest App Categories" list: books, business, education, entertainment, finance, fitness, food, games, government, health, kids, lifestyle, magazines, medical, music, navigation, news, personalization, photo, politics, productivity, security, shopping, social, sports, travel, utilities, weather). Three iiziRun categories have no W3C name of their own and take the nearest: Developer Tools = utilities, Graphics invalid input: '&' Design = productivity, Video = entertainment.FILE_NAME_NO_LANGUAGE
The file name of the one manifest of an application without languages: "manifest.webmanifest".- See Also:
Method Details
getScope
getStartURL
Gets the start URL of an application for a language. This is the ONE place the entry URL of an installed application is formed: ruling AU-1's fallback C (?0:0&app=<appID>&lang=) would change this method and nothing else.- Parameters:
appID- The application ID, already validated by the caller.lang- The language code, ornullor empty for none.- Returns:
/app/<appID>/?lang=<lang>, or/app/<appID>/without a language.
getFileName
Gets the file name of the manifest for a language, relative to the application directory:manifest-<lang>.webmanifest, andFILE_NAME_NO_LANGUAGEfor an application without languages (ruling PW-3: nevermanifest-.webmanifest). The page's link (PWAHeadTags) and the route (AppDirectoryHandler) both use this name.- Parameters:
lang- The language code, null or empty for none.- Returns:
- The file name.
isInstallable
Checks whether an application is installable: its.iiziPWAis present. Presence is the whole test (AU-9).- Parameters:
pwa- The application's PWA properties, ornullwhen it has no.iiziPWA.- Returns:
truewhen installable.
generate
public static String generate(ModuleApp app, PWAProps pwa, String appID, String lang, PWAIcons icons) Generates the manifest of an application for a language.- Parameters:
app- The App.pwa- The application's PWA properties,nullwhen it has no.iiziPWA; only its presence is used.appID- The application ID, already validated by the caller.lang- The language code of this manifest.icons- The icons, ornullwhen the application has none (then the manifest has noiconsmember).- Returns:
- The manifest as JSON text, or
nullwhen the application is not installable.
generate
public static String generate(ModuleApp app, PWAProps pwa, String appID, String lang, PWAIcons icons, List<PWAScreenshots.Shot> screenshots) Generates the manifest of an application for a language, with its screenshots.- Parameters:
app- The App.pwa- The application's PWA properties,nullwhen it has no.iiziPWA; its category and orientation are written.appID- The application ID, already validated by the caller.lang- The language code of this manifest, null or empty for none: thenlanganddirare omitted.icons- The icons, ornullwhen the application has none: every file the icons hold is listed with its purpose.screenshots- The screenshots, empty for none.- Returns:
- The manifest as JSON text, or
nullwhen the application is not installable.
isRightToLeft
Tests whether a language is written right to left (ruling PM-1: the manifest'sdirand the page's<html dir>): Arabic, Persian, Hebrew, Urdu, Yiddish and their aliases, asComponentOrientation.getOrientation(Locale)knows them.- Parameters:
lang- The language code, a BCP 47 tag such asarorhe-IL.- Returns:
- true for a right-to-left language.
getThemeColor
Gets thetheme_color: the App's opaquethemeColor(a referenced colour resolved for the light scheme,PWAIcons.opaque(ModuleApp,GColor,String)), elseDEFAULT_THEME_COLOR.- Parameters:
app- The App.- Returns:
- The CSS colour.
getBackgroundColor
Gets thebackground_color, the splash background on Android: the App's opaqueiconBG, else its opaquethemeColor(a referenced colour resolved for the light scheme), elseDEFAULT_BACKGROUND_COLOR.- Parameters:
app- The App.- Returns:
- The CSS colour.