org.nuxeo.theme.themes
Class ThemeManager
java.lang.Object
org.nuxeo.theme.themes.ThemeManager
- All Implemented Interfaces:
- Registrable
public final class ThemeManager
- extends java.lang.Object
- implements Registrable
Method Summary |
static boolean |
belongToSameTheme(Element element1,
Element element2)
|
void |
clear()
This method is called when the object is unregistered. |
static ThemeDescriptor |
createCustomTheme(java.lang.String name)
|
Layout |
createLayout()
|
Style |
createStyle()
|
static void |
createThemeDir()
|
Widget |
createWidget()
|
static ThemeDescriptor |
customizeTheme(ThemeDescriptor themeDescriptor)
|
void |
deleteFormat(Format format)
|
void |
deletePage(java.lang.String path)
|
void |
deleteTheme(java.lang.String src)
|
static void |
deleteThemeDescriptor(java.lang.String src)
|
void |
destroyElement(Element element)
|
Element |
duplicateElement(Element element,
boolean duplicateFormats)
|
Format |
duplicateFormat(Format format)
|
void |
fillScratchPage(java.lang.String themeName,
Element element)
|
static Format |
getAncestorFormatOf(Format format)
|
java.lang.String |
getCachedStyles(java.lang.String themeName,
java.lang.String basePath)
|
static java.util.List<java.io.File> |
getCustomThemeFiles()
|
static java.lang.String |
getCustomThemePath(java.lang.String themeName)
|
static java.lang.String |
getDefaultTemplateEngineName()
|
static java.lang.String |
getDefaultTheme(java.lang.String... paths)
|
static java.lang.String |
getDefaultTheme(java.lang.String applicationPath)
|
static Element |
getElementById(java.lang.Integer id)
|
static Element |
getElementById(java.lang.String id)
|
static Element |
getElementByUrl(java.net.URL url)
|
static EngineType |
getEngineByUrl(java.net.URL url)
|
static Format |
getFormatById(java.lang.Integer id)
|
static Format |
getFormatById(java.lang.String id)
|
java.util.List<Format> |
getFormatsByTypeName(java.lang.String formatTypeName)
|
java.util.Set<java.lang.String> |
getFormatTypeNames()
|
java.util.Map<java.lang.String,Info> |
getGlobalInfoMap()
|
byte[] |
getImageResource(java.lang.String path)
|
java.lang.Long |
getLastModified(java.lang.String themeName)
|
java.lang.Long |
getLastModified(java.net.URL url)
|
ModelType |
getModelByClassname(java.lang.String className)
|
Identifiable |
getNamedObject(java.lang.String themeName,
java.lang.String realm,
java.lang.String name)
|
java.util.List<Identifiable> |
getNamedObjects(java.lang.String themeName,
java.lang.String realm)
|
java.util.List<Style> |
getNamedStyles(java.lang.String themeName)
|
PageElement |
getPageByPath(java.lang.String path)
|
static java.lang.String |
getPageNameFromPagePath(java.lang.String path)
|
java.util.Set<java.lang.String> |
getPageNames(java.lang.String themeName)
|
java.lang.String |
getPagePathByUrl(java.net.URL url)
|
java.util.List<PageElement> |
getPagesOf(java.lang.String themeName)
|
static java.util.List<PageElement> |
getPagesOf(ThemeElement theme)
|
static PerspectiveType |
getPerspectiveByUrl(java.net.URL url)
|
static java.util.List<java.lang.String> |
getPreviewCategories()
|
static java.lang.String |
getPreviewCategoryForProperty(java.lang.String name)
|
java.lang.String |
getResource(java.lang.String name)
|
static ResourceBank |
getResourceBank(java.lang.String name)
|
static java.util.List<ResourceBank> |
getResourceBanks()
|
java.util.List<java.lang.String> |
getResourceOrdering()
|
java.util.List<Style> |
getStyles()
|
java.util.List<Style> |
getStyles(java.lang.String themeName)
|
static TemplateEngineType |
getTemplateEngineByUrl(java.net.URL url)
|
static java.lang.String |
getTemplateEngineName(java.lang.String applicationPath)
|
static java.util.List<java.lang.String> |
getTemplateEngineNames()
|
ThemeElement |
getThemeByName(java.lang.String name)
|
ThemeElement |
getThemeBySrc(java.lang.String src)
|
ThemeElement |
getThemeByUrl(java.net.URL url)
|
static ThemeDescriptor |
getThemeDescriptor(java.lang.String src)
|
static ThemeDescriptor |
getThemeDescriptorByThemeName(java.lang.String themeName)
|
static ThemeDescriptor |
getThemeDescriptorByThemeName(java.lang.String templateEngine,
java.lang.String themeName)
|
static java.util.List<ThemeDescriptor> |
getThemeDescriptors()
|
static java.io.File |
getThemeDir()
|
static java.lang.String |
getThemeNameByUrl(java.net.URL url)
|
java.lang.String |
getThemeNameOfNamedObject(Identifiable object)
|
static java.util.Set<java.lang.String> |
getThemeNames()
|
static java.util.Set<java.lang.String> |
getThemeNames(java.lang.String templateEngine)
|
static ThemeElement |
getThemeOf(Element element)
|
static ThemeElement |
getThemeOfFormat(Format format)
|
PageElement |
getThemePageByUrl(java.net.URL url)
|
ThemeSet |
getThemeSetByName(java.lang.String name)
|
java.util.List<ThemeSet> |
getThemeSets()
|
static java.util.List<java.lang.String> |
getUnusedStyleViews(Style style)
|
static java.lang.String |
getUrlDescription(java.net.URL url)
|
static java.lang.String |
getViewModeByUrl(java.net.URL url)
|
static java.util.List<ViewType> |
getViewTypesForFragmentType(FragmentType fragmentType)
|
static java.util.List<Format> |
listAncestorFormatsOf(Format format)
|
java.util.List<Format> |
listFormats()
|
static java.util.List<Format> |
listFormatsDirectlyInheritingFrom(Format format)
|
static void |
loadRemoteStyle(java.lang.String resourceBankName,
Style style)
|
void |
loadTheme(java.lang.String src)
|
void |
loadTheme(java.lang.String src,
java.lang.String xmlSource)
|
static void |
loadTheme(ThemeDescriptor themeDescriptor)
|
void |
makeElementUseNamedStyle(Element element,
java.lang.String inheritedName,
java.lang.String themeName)
|
void |
makeFormatInherit(Format format,
Format ancestor)
|
void |
registerFormat(Format format)
|
void |
registerModelByClassname(ModelType modelType)
|
void |
registerPage(ThemeElement theme,
PageElement page)
|
void |
registerTheme(ThemeElement theme)
|
static void |
removeInheritanceFrom(Format ancestor)
|
static void |
removeInheritanceTowards(Format descendant)
|
void |
removeNamedObject(java.lang.String themeName,
java.lang.String realm,
java.lang.String name)
|
void |
removeNamedObjects(java.lang.String themeName)
|
void |
removeNamedStylesOf(java.lang.String themeName)
|
void |
removeOrphanedFormats()
|
static java.lang.String |
renderElement(java.net.URL url)
|
static void |
repairTheme(ThemeElement theme)
|
static void |
saveTheme(java.lang.String src)
|
static void |
saveTheme(java.lang.String src,
int indent)
|
void |
setCachedStyles(java.lang.String themeName,
java.lang.String basePath,
java.lang.String css)
|
void |
setLastModified(java.lang.String themeName,
java.lang.Long date)
|
void |
setNamedObject(java.lang.String themeName,
java.lang.String realm,
Identifiable object)
|
void |
setResource(java.lang.String name,
java.lang.String content)
|
static void |
setStyleInheritance(java.lang.String styleName,
java.lang.String ancestorStyleName,
java.lang.String themeName,
boolean allowMany)
|
void |
stylesModified(java.lang.String themeName)
|
void |
themeModified(java.lang.String themeName)
|
static ThemeDescriptor |
uncustomizeTheme(ThemeDescriptor themeDescriptor)
|
void |
unregisterFormat(Format format)
|
void |
unregisterModelByClassname(ModelType modelType)
|
void |
unregisterPage(PageElement page)
|
void |
unregisterResourceOrdering(ResourceType resourceType)
|
void |
unregisterTheme(ThemeElement theme)
|
void |
updateResourceOrdering()
|
static void |
updateThemeDescriptors()
|
static boolean |
validateThemeName(java.lang.String themeName)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThemeManager
public ThemeManager()
createThemeDir
public static void createThemeDir()
getThemeDir
public static java.io.File getThemeDir()
clear
public void clear()
- Description copied from interface:
Registrable
- This method is called when the object is unregistered. Clean up local
variables here.
- Specified by:
clear
in interface Registrable
getGlobalInfoMap
public java.util.Map<java.lang.String,Info> getGlobalInfoMap()
validateThemeName
public static boolean validateThemeName(java.lang.String themeName)
getCustomThemePath
public static java.lang.String getCustomThemePath(java.lang.String themeName)
throws ThemeIOException
- Throws:
ThemeIOException
getCustomThemeFiles
public static java.util.List<java.io.File> getCustomThemeFiles()
customizeTheme
public static ThemeDescriptor customizeTheme(ThemeDescriptor themeDescriptor)
throws ThemeException
- Throws:
ThemeException
uncustomizeTheme
public static ThemeDescriptor uncustomizeTheme(ThemeDescriptor themeDescriptor)
throws ThemeException
- Throws:
ThemeException
createCustomTheme
public static ThemeDescriptor createCustomTheme(java.lang.String name)
throws ThemeException
- Throws:
ThemeException
updateThemeDescriptors
public static void updateThemeDescriptors()
getDefaultTheme
public static java.lang.String getDefaultTheme(java.lang.String applicationPath)
getDefaultTheme
public static java.lang.String getDefaultTheme(java.lang.String... paths)
getThemeNames
public static java.util.Set<java.lang.String> getThemeNames(java.lang.String templateEngine)
getThemeDescriptorByThemeName
public static ThemeDescriptor getThemeDescriptorByThemeName(java.lang.String templateEngine,
java.lang.String themeName)
getThemeDescriptorByThemeName
public static ThemeDescriptor getThemeDescriptorByThemeName(java.lang.String themeName)
getThemeNames
public static java.util.Set<java.lang.String> getThemeNames()
getPageNames
public java.util.Set<java.lang.String> getPageNames(java.lang.String themeName)
getPagesOf
public static java.util.List<PageElement> getPagesOf(ThemeElement theme)
getPagesOf
public java.util.List<PageElement> getPagesOf(java.lang.String themeName)
getThemeOf
public static ThemeElement getThemeOf(Element element)
belongToSameTheme
public static boolean belongToSameTheme(Element element1,
Element element2)
getEngineByUrl
public static EngineType getEngineByUrl(java.net.URL url)
getViewModeByUrl
public static java.lang.String getViewModeByUrl(java.net.URL url)
getTemplateEngineByUrl
public static TemplateEngineType getTemplateEngineByUrl(java.net.URL url)
getThemeBySrc
public ThemeElement getThemeBySrc(java.lang.String src)
throws ThemeException
- Throws:
ThemeException
getThemeByUrl
public ThemeElement getThemeByUrl(java.net.URL url)
getThemeNameByUrl
public static java.lang.String getThemeNameByUrl(java.net.URL url)
getPagePathByUrl
public java.lang.String getPagePathByUrl(java.net.URL url)
getThemePageByUrl
public PageElement getThemePageByUrl(java.net.URL url)
getPageByPath
public PageElement getPageByPath(java.lang.String path)
getPageNameFromPagePath
public static java.lang.String getPageNameFromPagePath(java.lang.String path)
getThemeByName
public ThemeElement getThemeByName(java.lang.String name)
fillScratchPage
public void fillScratchPage(java.lang.String themeName,
Element element)
throws NodeException,
ThemeException
- Throws:
NodeException
ThemeException
getElementByUrl
public static Element getElementByUrl(java.net.URL url)
getPerspectiveByUrl
public static PerspectiveType getPerspectiveByUrl(java.net.URL url)
getUrlDescription
public static java.lang.String getUrlDescription(java.net.URL url)
getNamedObject
public Identifiable getNamedObject(java.lang.String themeName,
java.lang.String realm,
java.lang.String name)
getThemeNameOfNamedObject
public java.lang.String getThemeNameOfNamedObject(Identifiable object)
setNamedObject
public void setNamedObject(java.lang.String themeName,
java.lang.String realm,
Identifiable object)
throws ThemeException
- Throws:
ThemeException
getNamedObjects
public java.util.List<Identifiable> getNamedObjects(java.lang.String themeName,
java.lang.String realm)
removeNamedObject
public void removeNamedObject(java.lang.String themeName,
java.lang.String realm,
java.lang.String name)
removeNamedObjects
public void removeNamedObjects(java.lang.String themeName)
makeElementUseNamedStyle
public void makeElementUseNamedStyle(Element element,
java.lang.String inheritedName,
java.lang.String themeName)
throws ThemeException
- Throws:
ThemeException
setStyleInheritance
public static void setStyleInheritance(java.lang.String styleName,
java.lang.String ancestorStyleName,
java.lang.String themeName,
boolean allowMany)
throws ThemeException
- Throws:
ThemeException
loadRemoteStyle
public static void loadRemoteStyle(java.lang.String resourceBankName,
Style style)
duplicateElement
public Element duplicateElement(Element element,
boolean duplicateFormats)
throws ThemeException
- Throws:
ThemeException
destroyElement
public void destroyElement(Element element)
throws ThemeException,
NodeException
- Throws:
ThemeException
NodeException
removeNamedStylesOf
public void removeNamedStylesOf(java.lang.String themeName)
throws ThemeException
- Throws:
ThemeException
duplicateFormat
public Format duplicateFormat(Format format)
throws ThemeException
- Throws:
ThemeException
listFormats
public java.util.List<Format> listFormats()
registerFormat
public void registerFormat(Format format)
throws ThemeException
- Throws:
ThemeException
unregisterFormat
public void unregisterFormat(Format format)
throws ThemeException
- Throws:
ThemeException
getFormatTypeNames
public java.util.Set<java.lang.String> getFormatTypeNames()
getFormatsByTypeName
public java.util.List<Format> getFormatsByTypeName(java.lang.String formatTypeName)
getStyles
public java.util.List<Style> getStyles()
getStyles
public java.util.List<Style> getStyles(java.lang.String themeName)
getNamedStyles
public java.util.List<Style> getNamedStyles(java.lang.String themeName)
getLastModified
public java.lang.Long getLastModified(java.lang.String themeName)
setLastModified
public void setLastModified(java.lang.String themeName,
java.lang.Long date)
getLastModified
public java.lang.Long getLastModified(java.net.URL url)
themeModified
public void themeModified(java.lang.String themeName)
stylesModified
public void stylesModified(java.lang.String themeName)
registerTheme
public void registerTheme(ThemeElement theme)
registerPage
public void registerPage(ThemeElement theme,
PageElement page)
throws NodeException
- Throws:
NodeException
unregisterTheme
public void unregisterTheme(ThemeElement theme)
unregisterPage
public void unregisterPage(PageElement page)
loadTheme
public static void loadTheme(ThemeDescriptor themeDescriptor)
loadTheme
public void loadTheme(java.lang.String src,
java.lang.String xmlSource)
throws ThemeIOException,
ThemeException
- Throws:
ThemeIOException
ThemeException
loadTheme
public void loadTheme(java.lang.String src)
throws ThemeIOException,
ThemeException
- Throws:
ThemeIOException
ThemeException
deleteTheme
public void deleteTheme(java.lang.String src)
throws ThemeIOException,
ThemeException
- Throws:
ThemeIOException
ThemeException
deletePage
public void deletePage(java.lang.String path)
throws ThemeIOException,
ThemeException
- Throws:
ThemeIOException
ThemeException
saveTheme
public static void saveTheme(java.lang.String src)
throws ThemeIOException,
ThemeException
- Throws:
ThemeIOException
ThemeException
saveTheme
public static void saveTheme(java.lang.String src,
int indent)
throws ThemeIOException,
ThemeException
- Throws:
ThemeIOException
ThemeException
repairTheme
public static void repairTheme(ThemeElement theme)
throws ThemeIOException
- Throws:
ThemeIOException
renderElement
public static java.lang.String renderElement(java.net.URL url)
throws ThemeException
- Throws:
ThemeException
removeOrphanedFormats
public void removeOrphanedFormats()
throws ThemeException
- Throws:
ThemeException
makeFormatInherit
public void makeFormatInherit(Format format,
Format ancestor)
removeInheritanceTowards
public static void removeInheritanceTowards(Format descendant)
removeInheritanceFrom
public static void removeInheritanceFrom(Format ancestor)
getAncestorFormatOf
public static Format getAncestorFormatOf(Format format)
listAncestorFormatsOf
public static java.util.List<Format> listAncestorFormatsOf(Format format)
listFormatsDirectlyInheritingFrom
public static java.util.List<Format> listFormatsDirectlyInheritingFrom(Format format)
deleteFormat
public void deleteFormat(Format format)
throws ThemeException
- Throws:
ThemeException
getUnusedStyleViews
public static java.util.List<java.lang.String> getUnusedStyleViews(Style style)
getCachedStyles
public java.lang.String getCachedStyles(java.lang.String themeName,
java.lang.String basePath)
setCachedStyles
public void setCachedStyles(java.lang.String themeName,
java.lang.String basePath,
java.lang.String css)
getResource
public java.lang.String getResource(java.lang.String name)
setResource
public void setResource(java.lang.String name,
java.lang.String content)
updateResourceOrdering
public void updateResourceOrdering()
getResourceOrdering
public java.util.List<java.lang.String> getResourceOrdering()
unregisterResourceOrdering
public void unregisterResourceOrdering(ResourceType resourceType)
getImageResource
public byte[] getImageResource(java.lang.String path)
throws ThemeException
- Throws:
ThemeException
getViewTypesForFragmentType
public static java.util.List<ViewType> getViewTypesForFragmentType(FragmentType fragmentType)
getResourceBank
public static ResourceBank getResourceBank(java.lang.String name)
throws ThemeException
- Throws:
ThemeException
getResourceBanks
public static java.util.List<ResourceBank> getResourceBanks()
getThemeDescriptors
public static java.util.List<ThemeDescriptor> getThemeDescriptors()
getThemeDescriptor
public static ThemeDescriptor getThemeDescriptor(java.lang.String src)
throws ThemeException
- Throws:
ThemeException
deleteThemeDescriptor
public static void deleteThemeDescriptor(java.lang.String src)
throws ThemeException
- Throws:
ThemeException
getTemplateEngineNames
public static java.util.List<java.lang.String> getTemplateEngineNames()
getTemplateEngineName
public static java.lang.String getTemplateEngineName(java.lang.String applicationPath)
getDefaultTemplateEngineName
public static java.lang.String getDefaultTemplateEngineName()
getElementById
public static Element getElementById(java.lang.Integer id)
getElementById
public static Element getElementById(java.lang.String id)
getFormatById
public static Format getFormatById(java.lang.Integer id)
getFormatById
public static Format getFormatById(java.lang.String id)
getThemeOfFormat
public static ThemeElement getThemeOfFormat(Format format)
createLayout
public Layout createLayout()
createWidget
public Widget createWidget()
createStyle
public Style createStyle()
registerModelByClassname
public void registerModelByClassname(ModelType modelType)
unregisterModelByClassname
public void unregisterModelByClassname(ModelType modelType)
getModelByClassname
public ModelType getModelByClassname(java.lang.String className)
getThemeSets
public java.util.List<ThemeSet> getThemeSets()
getThemeSetByName
public ThemeSet getThemeSetByName(java.lang.String name)
getPreviewCategoryForProperty
public static java.lang.String getPreviewCategoryForProperty(java.lang.String name)
getPreviewCategories
public static java.util.List<java.lang.String> getPreviewCategories()
Copyright © 2010 Nuxeo SAS. All Rights Reserved.