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
FieldsModifier and TypeFieldDescriptionprotected FlavorRegistryprotected NegotiationRegistryprotected PageRegistryprotected static final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, nameFields inherited from interface org.nuxeo.theme.styling.service.ThemeStylingService
FLAVOR_MARKER, PAGE_STYLE_CLASS_NAME_PREFIX, PAGE_STYLE_NAME_SUFFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(ComponentContext context) Activates the component.protected List<IconDescriptor>computeIcons(FlavorDescriptor flavor, List<String> flavors) protected LogoDescriptorcomputeLogo(FlavorDescriptor flavor, List<String> flavors) protected PalettePreviewcomputePalettePreview(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 URLgetUrlFromPath(String path, RuntimeContext extensionContext) protected voidmergePage(PageDescriptor page, PageDescriptor globalPage) Returns the negotiated String value for given target variable.voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) protected voidregisterFlavor(FlavorDescriptor flavor, RuntimeContext extensionContext) protected voidregisterResource(Resource resource, RuntimeContext extensionContext) voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) protected voidunregisterResource(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, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
unregisterContributionin classDefaultComponent
-
registerFlavor
-
computePresets
-
registerResource
-
unregisterResource
-
getUrlFromPath
-
getDefaultFlavorName
Description copied from interface:ThemeStylingServiceReturns the default flavor for a given theme page- Specified by:
getDefaultFlavorNamein interfaceThemeStylingService
-
getFlavor
Description copied from interface:ThemeStylingServiceReturns 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:
getFlavorin interfaceThemeStylingService
-
getLogo
Description copied from interface:ThemeStylingServiceReturns the logo configured for given flavor name, and fallbacks on the extends flavor logo if not set.- Specified by:
getLogoin interfaceThemeStylingService
-
computeLogo
-
computePalettePreview
-
computeIcons
-
getFlavorNames
Description copied from interface:ThemeStylingServiceReturns the flavor names for a given theme page- Specified by:
getFlavorNamesin interfaceThemeStylingService
-
getFlavors
Description copied from interface:ThemeStylingServiceReturns the flavors for a given theme page- Specified by:
getFlavorsin interfaceThemeStylingService
-
getPresetsByCat
-
getPresetVariables
Description copied from interface:ThemeStylingServiceReturns the map of variable replacements for given flavor.Returns an empty map if flavor is not resolved.
- Specified by:
getPresetVariablesin interfaceThemeStylingService
-
getPage
Description copied from interface:ThemeStylingServiceReturns the page for given name.Resources and bundles declared for all pages will also be attached to returned page.
- Specified by:
getPagein interfaceThemeStylingService
-
getPages
Description copied from interface:ThemeStylingServiceRerurns 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:
getPagesin interfaceThemeStylingService
-
mergePage
-
negotiate
Description copied from interface:ThemeStylingServiceReturns 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:
negotiatein interfaceThemeStylingService
-