public class SkinService extends AbstractResourceService implements org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SKIN |
protected static org.exoplatform.services.log.Log |
log |
compressor, contexts, mainResolver| Constructor and Description |
|---|
SkinService(org.exoplatform.container.ExoContainerContext context,
ResourceCompressor compressor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCategoryTheme(String categoryName)
Add a new category for portlet themes if it does not exist
|
void |
addPortalSkin(String module,
String skinName,
String cssPath)
Add a portal skin with the
priority is Integer.MAX_VALUE and the overwrite is false by default |
void |
addPortalSkin(String module,
String skinName,
String cssPath,
boolean overwrite)
Add a portal skin with the
priority is Integer.MAX_VALUE by default |
void |
addPortalSkin(String module,
String skinName,
String cssPath,
int priority,
boolean overwrite)
Register a portal skin
|
void |
addPortalSkin(String module,
String skinName,
String cssPath,
javax.servlet.ServletContext scontext)
Deprecated.
use
addPortalSkin(String, String, String) instead |
void |
addPortalSkin(String module,
String skinName,
String cssPath,
javax.servlet.ServletContext scontext,
boolean overwrite)
Deprecated.
use
addPortalSkin(String, String, String, boolean) instead |
void |
addPortalSkin(String module,
String skinName,
String cssPath,
String cssData)
Deprecated.
This method is not supported anymore. The resource resolver pluggability mechanism should be used somehow
|
void |
addSkin(String module,
String skinName,
String cssPath)
Add a skin with the
priority is Integer.MAX_VALUE and the overwrite is false by default |
void |
addSkin(String module,
String skinName,
String cssPath,
boolean overwrite)
Add a portal skin with the
priority is Integer.MAX_VALUE |
void |
addSkin(String module,
String skinName,
String cssPath,
int priority,
boolean overwrite)
Register the Skin for available portal Skins.
|
void |
addSkin(String module,
String skinName,
String cssPath,
javax.servlet.ServletContext scontext)
Deprecated.
use
addSkin(String, String, String) instead |
void |
addSkin(String module,
String skinName,
String cssPath,
javax.servlet.ServletContext scontext,
boolean overwrite)
Deprecated.
use
addSkin(String, String, String, boolean) instead |
void |
addSkin(String module,
String skinName,
String cssPath,
String cssData)
Deprecated.
|
void |
addTheme(String categoryName,
List<String> themesName)
Registry theme category with its themes for portlet Theme
|
Collection<SkinConfig> |
findSkins(SkinVisitor visitor)
Return a collection of SkinConfig based on SkinVisitor provided as the argument
|
Set<String> |
getAvailableSkinNames()
Get names of all the currently registered skins.
|
String |
getCSS(ControllerContext context,
boolean compress)
Return the CSS content of the file specified by the given URI.
|
long |
getLastModified(ControllerContext context)
Returns last modified date of cached css.
|
String |
getMergedCSS(ControllerContext context,
String path)
Deprecated.
|
Collection<SkinConfig> |
getPortalSkins(String skinName)
Return a collection of Portal Skins that its elements are ordered by CSS priority
|
Map<String,Set<String>> |
getPortletThemes()
Return the map of portlet themes
|
SkinConfig |
getSkin(String module,
String skinName)
Return a SkinConfig mapping by the module and skin name
|
String[] |
getSkinList()
Get all available skin
|
void |
invalidateCachedSkin(String path)
Invalidate skin from the cache
|
void |
invalidatePortalSkinCache(String portalName,
String skinName)
Deprecated.
the method name is wrong to the behaviour it does. Use
removeSkin(String, String) instead |
Skin |
merge(Collection<SkinConfig> skins)
Merge several skins into one single skin.
|
void |
reloadSkin(String skinId)
reload skin by skin ID
|
void |
reloadSkins()
Clean cache, reload all Skins
|
void |
remove(List<SkinKey> keys)
Deprecated.
This is deprecated as its name was not clear. Use
removeSkins(List) instead |
void |
remove(String module,
String skinName)
Deprecated.
The method name is not clear. Using
removeSkin(String, String) instead |
void |
removeSkin(SkinKey key)
Remove a Skin mapped to the
key |
void |
removeSkin(String module,
String skinName)
Remove a Skin from the service as well as its cache
|
void |
removeSkins(List<SkinKey> keys)
Remove SkinConfig from Portal Skin Config by SkinKey
|
void |
removeSupportedSkin(String skinName)
Remove Skin from Portal available Skin by skin name
|
boolean |
renderCSS(ControllerContext context,
ResourceRenderer renderer,
boolean compress)
Render css content of the file specified by the given URI
|
int |
size()
Return the number of skin config maintaining in this SkinService
|
void |
start()
Start service.
|
void |
stop()
Stop service Remove org.exoplatform.portal.resource.GateInSkinConfigDeployer and
org.exoplatform.portal.resource.GateInSkinConfigRemoval from ServletContainer.
|
addResourceResolver, registerContext, unregisterServletContextprotected static org.exoplatform.services.log.Log log
public static final String DEFAULT_SKIN
public SkinService(org.exoplatform.container.ExoContainerContext context,
ResourceCompressor compressor)
public void addCategoryTheme(String categoryName)
categoryName - the category name@Deprecated public void addPortalSkin(String module, String skinName, String cssPath, javax.servlet.ServletContext scontext)
addPortalSkin(String, String, String) insteadpublic void addPortalSkin(String module, String skinName, String cssPath)
priority is Integer.MAX_VALUE and the overwrite is false by defaultmodule - skinName - cssPath - @Deprecated public void addPortalSkin(String module, String skinName, String cssPath, javax.servlet.ServletContext scontext, boolean overwrite)
addPortalSkin(String, String, String, boolean) insteadpublic void addPortalSkin(String module, String skinName, String cssPath, boolean overwrite)
priority is Integer.MAX_VALUE by defaultmodule - skinName - cssPath - overwrite - public void addPortalSkin(String module, String skinName, String cssPath, int priority, boolean overwrite)
module - skin module identifierskinName - skin namecssPath - path uri to the css file. This is relative to the root context, use leading '/'priority - priority to support sorting in skin listoverwrite - if any previous skin should be replaced by that one@Deprecated public void addPortalSkin(String module, String skinName, String cssPath, String cssData)
cssDatamodule - skin module identifierskinName - skin namecssPath - path uri to the css file. This is relative to the root context, use leading '/'cssData - the content of css@Deprecated public void addSkin(String module, String skinName, String cssPath, javax.servlet.ServletContext scontext)
addSkin(String, String, String) insteadpublic void addSkin(String module, String skinName, String cssPath)
priority is Integer.MAX_VALUE and the overwrite is false by defaultmodule - skinName - cssPath - @Deprecated public void addSkin(String module, String skinName, String cssPath, javax.servlet.ServletContext scontext, boolean overwrite)
addSkin(String, String, String, boolean) insteadpublic void addSkin(String module, String skinName, String cssPath, boolean overwrite)
priority is Integer.MAX_VALUEmodule - skinName - cssPath - overwrite - public void addSkin(String module, String skinName, String cssPath, int priority, boolean overwrite)
module - skin module identifierskinName - skin namecssPath - path uri to the css file. This is relative to the root context, use leading '/'overwrite - if any previous skin should be replaced by that onepriority - priority to support sorting in skin list@Deprecated public void addSkin(String module, String skinName, String cssPath, String cssData)
module - skin module identifierskinName - skin namecssPath - path uri to the css file. This is relative to the root context, use leading '/'cssData - public Skin merge(Collection<SkinConfig> skins)
skins - the skins to mergepublic void addTheme(String categoryName, List<String> themesName)
categoryName - category name that will be registriedthemesName - list theme name of categoryNamepublic Set<String> getAvailableSkinNames()
public String getCSS(ControllerContext context, boolean compress)
context - compress - public boolean renderCSS(ControllerContext context, ResourceRenderer renderer, boolean compress) throws RenderingException, IOException
context - renderer - the webapp's ResourceRenderercompress - true if the CSS resource is found and rendered; false otherwise.RenderingExceptionIOException@Deprecated public String getMergedCSS(ControllerContext context, String path)
pathcontext - path - path uri to the css filepublic Collection<SkinConfig> getPortalSkins(String skinName)
skinName - name of Portal Skinpublic Collection<SkinConfig> findSkins(SkinVisitor visitor)
visitor - public Map<String,Set<String>> getPortletThemes()
public SkinConfig getSkin(String module, String skinName)
module - skinName - @Deprecated public void invalidatePortalSkinCache(String portalName, String skinName)
removeSkin(String, String) insteadportalName - skinName - public void invalidateCachedSkin(String path)
path - the keypublic long getLastModified(ControllerContext context)
In development mode, it always returns Long.MAX_VALUE. Return null if cached css can not be found
context - @Deprecated public void remove(String module, String skinName)
removeSkin(String, String) insteadpublic void removeSkin(String module, String skinName)
module - skinName - public void removeSkin(SkinKey key)
keykey - key whose mapping skin is to be removed from the service@Deprecated public void remove(List<SkinKey> keys) throws Exception
removeSkins(List) insteadExceptionpublic void removeSkins(List<SkinKey> keys)
keys - SkinKey list these will be removedpublic void removeSupportedSkin(String skinName)
skinName - name of skin that will be removedpublic int size()
public String[] getSkinList()
public void reloadSkins()
public void reloadSkin(String skinId)
skinId - the skin ID that will be reloadedpublic void start()
start in interface org.picocontainer.StartableStartable.start()public void stop()
stop in interface org.picocontainer.StartableStartable.stop()Copyright © 2018 JBoss by Red Hat. All Rights Reserved.