com.vaadin.flow.server.
Class PwaRegistry
- java.lang.Object
-
- com.vaadin.flow.server.PwaRegistry
-
All Implemented Interfaces:
public class PwaRegistry extends Object implements Serializable
Registry for PWA data. Includes:
PwaConfiguration
- basic info- List of
PwaIcon
:s - different sizes of icons for header and manifest - Offline page
- Manifest json
- Service worker
Since:
1.2
See Also:
-
-
Field Summary
Fields Modifier and Type Field and Description static String
WORKBOX_FOLDER
-
Method Summary
All Methods Modifier and Type Method and Description List<PwaIcon>
getHeaderIcons()
List of
PwaIcon
:s that should be added to header.List<PwaIcon>
getIcons()
List of all icons managed by
PwaRegistry
.String
getInstallPrompt()
Html and js needed for pwa install prompt as a plain string.
static PwaRegistry
getInstance(ServletContext servletContext)
Gets the pwa registry for the given servlet context.
List<PwaIcon>
getManifestIcons()
List of
PwaIcon
:s that should be added to manifest.webmanifest.String
getManifestJson()
manifest.webmanifest contents as a String.
String
getOfflineHtml()
Static offline page as String.
PwaConfiguration
getPwaConfiguration()
String
getServiceWorkerJs()
sw.js (service worker javascript) as String.
String
offlinePageCache()
Google Workbox cache resource String of offline page.
-
-
-
Field Detail
-
WORKBOX_FOLDER
public static final String WORKBOX_FOLDER
See Also:
-
-
Method Detail
-
getInstance
public static PwaRegistry getInstance(ServletContext servletContext)
Gets the pwa registry for the given servlet context. If the servlet context has no pwa registry, a new instance is created and assigned to the context.
Parameters:
servletContext
- the servlet context for which to get a route registry, notnull
Returns:
a registry instance for the given servlet context, not
null
-
getOfflineHtml
public String getOfflineHtml()
Static offline page as String.
Returns:
contents of offline page
-
getManifestJson
public String getManifestJson()
manifest.webmanifest contents as a String.
Returns:
contents of manifest.webmanifest
-
getServiceWorkerJs
public String getServiceWorkerJs()
sw.js (service worker javascript) as String.
Returns:
contents of sw.js
-
offlinePageCache
public String offlinePageCache()
Google Workbox cache resource String of offline page. example:
{url: 'offline.html', revision: '1234567'}
Returns:
Google Workbox cache resource String of offline page
-
getInstallPrompt
public String getInstallPrompt()
Html and js needed for pwa install prompt as a plain string.
Returns:
Html and js needed for pwa install prompt
-
getHeaderIcons
public List<PwaIcon> getHeaderIcons()
List of
PwaIcon
:s that should be added to header.Returns:
List of
PwaIcon
:s that should be added to header
-
getManifestIcons
public List<PwaIcon> getManifestIcons()
List of
PwaIcon
:s that should be added to manifest.webmanifest.Returns:
List of
PwaIcon
:s that should be added to manifest.webmanifest
-
getIcons
public List<PwaIcon> getIcons()
List of all icons managed by
PwaRegistry
.Returns:
List of all icons managed by
PwaRegistry
-
getPwaConfiguration
public PwaConfiguration getPwaConfiguration()
-
-