- java.lang.Object
-
- org.omnifaces.resourcehandler.WebAppManifest
-
public abstract class WebAppManifest extends Object
Please refer to
PWAResourceHandler
for usage instructions.- Since:
- 3.6
- Author:
- Bauke Scholtz
- See Also:
PWAResourceHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
WebAppManifest.Category
Enumeration of categories, to be used ingetCategories()
.protected static class
WebAppManifest.Dir
Enumeration of text direction types, to be used ingetDir()
.protected static class
WebAppManifest.Display
Enumeration of display modes, to be used ingetDisplay()
.protected static class
WebAppManifest.ImageResource
To be used ingetIcons()
.protected static class
WebAppManifest.Orientation
Enumeration of orientation modes, to be used ingetOrientation()
.protected static class
WebAppManifest.Platform
Enumeration of related application platforms, to be used inWebAppManifest.RelatedApplication.getPlatform()
.protected static class
WebAppManifest.RelatedApplication
To be used ingetRelatedApplications()
protected static class
WebAppManifest.Size
To be used inWebAppManifest.ImageResource.getSizes()
.
-
Constructor Summary
Constructors Constructor Description WebAppManifest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getBackgroundColor()
Returns the placeholder background color of your web application.protected Collection<String>
getCacheableViewIds()
Returns a collection of Faces view IDs which should be cached via the service worker so that they are available offline.Collection<WebAppManifest.Category>
getCategories()
Returns a collection of categories where your web application supposedly belongs to.String
getDescription()
Returns the description of your web application.WebAppManifest.Dir
getDir()
Returns the default text direction type of your web application.WebAppManifest.Display
getDisplay()
Returns the default display mode of your web application.String
getIarcRatingId()
Returns the IARC rating ID of your web application.abstract Collection<WebAppManifest.ImageResource>
getIcons()
Returns the icons of your web application.String
getLang()
Returns the default language of your web application.abstract String
getName()
Returns the name of your web application.protected String
getOfflineViewId()
Returns the Faces view ID which should represent the "You're offline!" error page.WebAppManifest.Orientation
getOrientation()
Returns the default orientation mode of your web application.Collection<WebAppManifest.RelatedApplication>
getRelatedApplications()
Returns a collection of related (native) applications that provide similar/equivalent functionality as your web application.String
getScope()
Returns the scope of this manifest.String
getShortName()
Returns the short name of your web application.String
getStartUrl()
Returns the default home URL of your web application.String
getThemeColor()
Returns the theme color of your web application.boolean
isPreferRelatedApplications()
Returns whether the applications listed ingetRelatedApplications()
should be preferred over the web application.
-
-
-
Method Detail
-
getName
public abstract String getName()
Returns the name of your web application.- Returns:
- The name of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/name
-
getIcons
public abstract Collection<WebAppManifest.ImageResource> getIcons()
Returns the icons of your web application.- Returns:
- The icons of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/icons
-
getLang
public String getLang()
Returns the default language of your web application. The default implementation returnsFaces.getDefaultLocale()
with a fallback ofLocale.getDefault()
.- Returns:
- The default language of your web application.
-
getDir
public WebAppManifest.Dir getDir()
Returns the default text direction type of your web application. The default implementation returnsWebAppManifest.Dir.AUTO
.- Returns:
- The default text direction type of your web application.
-
getDisplay
public WebAppManifest.Display getDisplay()
Returns the default display mode of your web application. The default implementation returnsWebAppManifest.Display.BROWSER
.- Returns:
- The default display mode of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/display
-
getOrientation
public WebAppManifest.Orientation getOrientation()
Returns the default orientation mode of your web application. The default implementaiton returnsWebAppManifest.Orientation.ANY
.- Returns:
- The default orientation mode of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/orientation
-
getStartUrl
public String getStartUrl()
Returns the default home URL of your web application. The default implementation returnsFaces.getRequestBaseURL()
.- Returns:
- The default home URL of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/start_url
-
getCacheableViewIds
protected Collection<String> getCacheableViewIds()
Returns a collection of Faces view IDs which should be cached via the service worker so that they are available offline. The default implementation returns Faces view IDs derived fromWebXml.getWelcomeFiles()
. If this method returns an empty collection, then no service worker will be generated.- Returns:
- A collection of Faces view IDs which should be cached via the service worker so that they are available offline.
- Since:
- 3.7
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers
-
getOfflineViewId
protected String getOfflineViewId()
Returns the Faces view ID which should represent the "You're offline!" error page. The default implementation returnsnull
, meaning that there is no such one. IfgetCacheableViewIds()
returns an empty collection, then this method will be ignored.- Returns:
- the Faces view ID which should represent the "You're offline!" error page.
- Since:
- 3.7
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers
-
getScope
public String getScope()
Returns the scope of this manifest. The default implementation returnsnull
.- Returns:
- The scope of this manifest.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/scope
-
getShortName
public String getShortName()
Returns the short name of your web application. The default implementation returnsnull
.- Returns:
- The short name of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/short_name
-
getDescription
public String getDescription()
Returns the description of your web application. The default implementation returnsnull
.- Returns:
- The description of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/description
-
getThemeColor
public String getThemeColor()
Returns the theme color of your web application. The default implementation returnsnull
.- Returns:
- The theme color of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/theme_color
-
getBackgroundColor
public String getBackgroundColor()
Returns the placeholder background color of your web application. The default implementation returnsnull
.- Returns:
- The placeholder background color of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/background_color
-
getCategories
public Collection<WebAppManifest.Category> getCategories()
Returns a collection of categories where your web application supposedly belongs to. The default implementation returns an empty set.- Returns:
- A collection of categories where your web application supposedly belongs to.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/categories
-
getIarcRatingId
public String getIarcRatingId()
Returns the IARC rating ID of your web application. The default implementation returnsnull
.- Returns:
- The IARC rating ID of your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/iarc_rating_id
-
getRelatedApplications
public Collection<WebAppManifest.RelatedApplication> getRelatedApplications()
Returns a collection of related (native) applications that provide similar/equivalent functionality as your web application. The default implementation returns an empty set.- Returns:
- A collection of related (native) applications that provide similar/equivalent functionality as your web application.
- See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/related_applications
-
isPreferRelatedApplications
public boolean isPreferRelatedApplications()
Returns whether the applications listed ingetRelatedApplications()
should be preferred over the web application. The default implementation returnsfalse
.- Returns:
- Whether the applications listed in
getRelatedApplications()
should be preferred over the web application. - See Also:
- https://developer.mozilla.org/en-US/docs/Web/Manifest/prefer_related_applications
-
-