Package org.nuxeo.theme.styling.service
Class ThemeStylingServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.theme.styling.service.ThemeStylingServiceImpl
- All Implemented Interfaces:
Adaptable
,Component
,Extensible
,TimestampedService
,ThemeStylingService
Default implementation for the
ThemeStylingService
- Since:
- 5.5
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.nuxeo.theme.styling.service.ThemeStylingService
ThemeStylingService.PRESET_CATEGORY
-
Field Summary
Modifier and TypeFieldDescriptionprotected FlavorRegistry
protected NegotiationRegistry
protected PageRegistry
protected static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
Fields inherited from interface org.nuxeo.theme.styling.service.ThemeStylingService
FLAVOR_MARKER, PAGE_STYLE_CLASS_NAME_PREFIX, PAGE_STYLE_NAME_SUFFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(ComponentContext context) Activates the component.protected List<IconDescriptor>
computeIcons
(FlavorDescriptor flavor, List<String> flavors) protected LogoDescriptor
computeLogo
(FlavorDescriptor flavor, List<String> flavors) protected PalettePreview
computePalettePreview
(FlavorDescriptor flavor, List<String> flavors) protected List<FlavorPresets>
computePresets
(FlavorDescriptor flavor, List<String> flavors) getDefaultFlavorName
(String themePageName) Returns the default flavor for a given theme pageReturns the flavor for given name, or null if not found.getFlavorNames
(String themePageName) Returns the flavor names for a given theme pagegetFlavors
(String themePageName) Returns the flavors for a given theme pageReturns the logo configured for given flavor name, and fallbacks on the extends flavor logo if not set.Returns the page for given name.getPages()
Rerurns all pages declared on the service, except the global one named "*".getPresetsByCat
(FlavorDescriptor flavor) getPresetVariables
(String flavorName) Returns the map of variable replacements for given flavor.protected URL
getUrlFromPath
(String path, RuntimeContext extensionContext) protected void
mergePage
(PageDescriptor page, PageDescriptor globalPage) Returns the negotiated String value for given target variable.void
registerContribution
(Object contribution, String extensionPoint, ComponentInstance contributor) protected void
registerFlavor
(FlavorDescriptor flavor, RuntimeContext extensionContext) protected void
registerResource
(Resource resource, RuntimeContext extensionContext) void
unregisterContribution
(Object contribution, String extensionPoint, ComponentInstance contributor) protected void
unregisterResource
(Resource resource) Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
WR_EX
- See Also:
-
pageReg
-
flavorReg
-
negReg
-
-
Constructor Details
-
ThemeStylingServiceImpl
public ThemeStylingServiceImpl()
-
-
Method Details
-
activate
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
unregisterContribution
in classDefaultComponent
-
registerFlavor
-
computePresets
-
registerResource
-
unregisterResource
-
getUrlFromPath
-
getDefaultFlavorName
Description copied from interface:ThemeStylingService
Returns the default flavor for a given theme page- Specified by:
getDefaultFlavorName
in interfaceThemeStylingService
-
getFlavor
Description copied from interface:ThemeStylingService
Returns the flavor for given name, or null if not found.If not defined on the local flavor, flavor attributes will be resolved from the extended flavor if any.
- Specified by:
getFlavor
in interfaceThemeStylingService
-
getLogo
Description copied from interface:ThemeStylingService
Returns the logo configured for given flavor name, and fallbacks on the extends flavor logo if not set.- Specified by:
getLogo
in interfaceThemeStylingService
-
computeLogo
-
computePalettePreview
-
computeIcons
-
getFlavorNames
Description copied from interface:ThemeStylingService
Returns the flavor names for a given theme page- Specified by:
getFlavorNames
in interfaceThemeStylingService
-
getFlavors
Description copied from interface:ThemeStylingService
Returns the flavors for a given theme page- Specified by:
getFlavors
in interfaceThemeStylingService
-
getPresetsByCat
-
getPresetVariables
Description copied from interface:ThemeStylingService
Returns the map of variable replacements for given flavor.Returns an empty map if flavor is not resolved.
- Specified by:
getPresetVariables
in interfaceThemeStylingService
-
getPage
Description copied from interface:ThemeStylingService
Returns the page for given name.Resources and bundles declared for all pages will also be attached to returned page.
- Specified by:
getPage
in interfaceThemeStylingService
-
getPages
Description copied from interface:ThemeStylingService
Rerurns all pages declared on the service, except the global one named "*".Resources and bundles declared for all pages will also be attached to returned pages.
- Specified by:
getPages
in interfaceThemeStylingService
-
mergePage
-
negotiate
Description copied from interface:ThemeStylingService
Returns the negotiated String value for given target variable.Context can be dependent on the target variable, depending on how this method is called/used and corresponding negotiator implementations.
- Specified by:
negotiate
in interfaceThemeStylingService
-