Class ThemeManagerImpl
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.perspective.gateway.assets.AbstractAssetManager<String,String>
 
com.inductiveautomation.perspective.gateway.assets.themes.ThemeManagerImpl
- All Implemented Interfaces:
- ThemeManager
- 
Field SummaryFields inherited from class com.inductiveautomation.perspective.gateway.assets.AbstractAssetManagerassetPath, cacheLock, perspectiveContext
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected CopyOption[]copyOptions(byte[] existingAssetDigest, byte[] currentExistingAssetDigest) generateKey(Path path) Generate a cache key for the givenPathENTRY Delivers a processed theme file.Fetch a list of all of the available theme names.protected voidProcesses themes that are already in cache, and which have been requested via getTheme.parseValue(Path path) Parse the cache value for the givenPathprotected voidOperates under the assumption that if the dark and light theme folders do not exist in the themes folder, then the user has not upgraded.voidsetup()Setup the Asset Manager.Methods inherited from class com.inductiveautomation.perspective.gateway.assets.AbstractAssetManagercopyInputStreamToPath, copyInputStreamToPath, getCache, getCachedValue, getDigestCopy, getDigestFor, onShutdown, onStartupMethods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycleisRunning, shutdown, startup
- 
Constructor Details- 
ThemeManagerImpl
 
- 
- 
Method Details- 
setuppublic void setup()Description copied from class:AbstractAssetManagerSetup the Asset Manager. Copies any defaults into the asset home directory. Should be run beforeAbstractLifecycle.startup()- Overrides:
- setupin class- AbstractAssetManager<String,- String> 
 
- 
performUpgradeCheckAndBackupOperates under the assumption that if the dark and light theme folders do not exist in the themes folder, then the user has not upgraded. In this case, we copy anything in the themes folder into a backup folder.- Throws:
- IOException
 
- 
getThemeENTRY Delivers a processed theme file. The first time a theme is requested, the processed css is stored in cache. Subsequent requests return the cached css.- Specified by:
- getThemein interface- ThemeManager
- Parameters:
- themeName- - The base name, ie. theme-dark, of the theme to fetch. Assumes that the theme does not contain the css file extension.
- Returns:
- - Returns an optional string representing the requested theme as css.
 
- 
getThemesListDescription copied from interface:ThemeManagerFetch a list of all of the available theme names.- Specified by:
- getThemesListin interface- ThemeManager
- Returns:
- A string list of available themes that may be fetched
 using ThemeManager.getTheme(String themeName).
 
- 
generateKeyDescription copied from class:AbstractAssetManagerGenerate a cache key for the givenPath- Specified by:
- generateKeyin class- AbstractAssetManager<String,- String> 
- Parameters:
- path- The- Pathfor which we want to generate a cache key
- Returns:
- An Optionalcontaining the cache key or an empty Optional if the cache key could not be generated
 
- 
parseValueDescription copied from class:AbstractAssetManagerParse the cache value for the givenPath- Specified by:
- parseValuein class- AbstractAssetManager<String,- String> 
- Parameters:
- path- The- Pathfor which we want to generate a cache value
- Returns:
- An Optionalcontaining the cache value or an empty Optional if the cache value could not be generated
 
- 
onCacheChangedprotected void onCacheChanged()Processes themes that are already in cache, and which have been requested via getTheme.- Overrides:
- onCacheChangedin class- AbstractAssetManager<String,- String> 
 
- 
copyOptionsprotected CopyOption[] copyOptions(@Nonnull byte[] existingAssetDigest, @Nonnull byte[] currentExistingAssetDigest) - Overrides:
- copyOptionsin class- AbstractAssetManager<String,- String> 
 
 
-