lumis.portal.xslcache
Class XslCacheManager

Package class diagram package XslCacheManager
java.lang.Object
  extended by lumis.portal.xslcache.XslCacheManager
All Implemented Interfaces:
IXslCacheManager

public class XslCacheManager
extends Object
implements IXslCacheManager

Manages the cache for XSLs.

Since:
4.0.0

Constructor Summary
XslCacheManager()
           
 
Method Summary
 void add(SessionConfig sessionConfig, XslCacheConfig xslCacheConfig, ITransaction transaction)
          Add a cache of the XSL.
static void addUsedTheme(String usedTheme)
          Should be called when a theme resources is used while processing xsl resources.
 void clearXslCache(ITransaction transaction)
          Clears all XSL cache.
 void clearXslCache(SessionConfig sessionConfig, String fileName, ITransaction transaction)
          Clear the cache for the specified xsl file.
 void clearXslConfigCache(SessionConfig sessionConfig, ITransaction transaction)
          Clear the XslConfigCache.
 void clearXslConfigCache(SessionConfig sessionConfig, String fileName, ITransaction transaction)
          Clear the XslConfigCache.
 Transformer createTransformer(String resourcePath)
          Creates a transformer for a XSL in the specified path.
 Transformer createTransformer(String xslStringDocument, String resourcePath)
          Creates a transformer for a specified XSL document string.
 void delete(SessionConfig sessionConfig, String fileName, ITransaction transaction)
          Delete de cache of the XSL.
 XslCacheConfig get(SessionConfig sessionConfig, String fileName, ITransaction transaction)
          Get the XslCacheConfig.
 boolean getDefaultCache()
          Get the default cache.
 Transformer getTransformer(SessionConfig sessionConfig, String fileName, ITransaction transaction)
          Get a Transformer.
static List<String> getUsedThemes()
          Returns a list of used themes.
 boolean isXslCached(String fileName)
          Verify if the xsl file is cached.
static void removeUsedThemes()
          Resets the list of used themes.
 void setDefaultCache(boolean enable)
          Set the default cache.
 void update(SessionConfig sessionConfig, XslCacheConfig xslCacheConfig, ITransaction transaction)
          Update the cache of the XSL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XslCacheManager

public XslCacheManager()
Method Detail

addUsedTheme

public static void addUsedTheme(String usedTheme)
Should be called when a theme resources is used while processing xsl resources.

Parameters:
usedTheme - the theme used.
Since:
6.2.0

getUsedThemes

public static List<String> getUsedThemes()
Returns a list of used themes.

Returns:
a non null list of used themes.
Since:
6.2.0

removeUsedThemes

public static void removeUsedThemes()
Resets the list of used themes.

Since:
6.2.0

setDefaultCache

public void setDefaultCache(boolean enable)
Description copied from interface: IXslCacheManager
Set the default cache.

Specified by:
setDefaultCache in interface IXslCacheManager

getDefaultCache

public boolean getDefaultCache()
Description copied from interface: IXslCacheManager
Get the default cache.

Specified by:
getDefaultCache in interface IXslCacheManager
Returns:

add

public void add(SessionConfig sessionConfig,
                XslCacheConfig xslCacheConfig,
                ITransaction transaction)
         throws PortalException,
                ManagerException
Description copied from interface: IXslCacheManager
Add a cache of the XSL.

Specified by:
add in interface IXslCacheManager
Throws:
PortalException
ManagerException

delete

public void delete(SessionConfig sessionConfig,
                   String fileName,
                   ITransaction transaction)
            throws PortalException,
                   ManagerException
Description copied from interface: IXslCacheManager
Delete de cache of the XSL.

Specified by:
delete in interface IXslCacheManager
Throws:
PortalException
ManagerException

update

public void update(SessionConfig sessionConfig,
                   XslCacheConfig xslCacheConfig,
                   ITransaction transaction)
            throws PortalException,
                   ManagerException
Description copied from interface: IXslCacheManager
Update the cache of the XSL.

Specified by:
update in interface IXslCacheManager
Throws:
PortalException
ManagerException

get

public XslCacheConfig get(SessionConfig sessionConfig,
                          String fileName,
                          ITransaction transaction)
                   throws PortalException,
                          ManagerException
Description copied from interface: IXslCacheManager
Get the XslCacheConfig.

Specified by:
get in interface IXslCacheManager
Returns:
a XslCacheConfig.
Throws:
PortalException
ManagerException

clearXslConfigCache

public void clearXslConfigCache(SessionConfig sessionConfig,
                                String fileName,
                                ITransaction transaction)
                         throws PortalException,
                                ManagerException
Description copied from interface: IXslCacheManager
Clear the XslConfigCache.

Specified by:
clearXslConfigCache in interface IXslCacheManager
Throws:
PortalException
ManagerException

clearXslConfigCache

public void clearXslConfigCache(SessionConfig sessionConfig,
                                ITransaction transaction)
                         throws PortalException,
                                ManagerException
Description copied from interface: IXslCacheManager
Clear the XslConfigCache.

Specified by:
clearXslConfigCache in interface IXslCacheManager
Throws:
PortalException
ManagerException

getTransformer

public Transformer getTransformer(SessionConfig sessionConfig,
                                  String fileName,
                                  ITransaction transaction)
                           throws PortalException,
                                  ManagerException
Description copied from interface: IXslCacheManager
Get a Transformer.

Specified by:
getTransformer in interface IXslCacheManager
Returns:
a Transformer.
Throws:
PortalException
ManagerException

createTransformer

public Transformer createTransformer(String resourcePath)
                              throws PortalException
Description copied from interface: IXslCacheManager
Creates a transformer for a XSL in the specified path.

Specified by:
createTransformer in interface IXslCacheManager
Parameters:
resourcePath - the relative classpath resource path where the document is present.
Returns:
the transformer.
Throws:
PortalException - if the transformer could not be created.

createTransformer

public Transformer createTransformer(String xslStringDocument,
                                     String resourcePath)
                              throws PortalException
Description copied from interface: IXslCacheManager
Creates a transformer for a specified XSL document string. This method creates a Transformer for a XSL document that is not required to physically exist on the server.

Specified by:
createTransformer in interface IXslCacheManager
Parameters:
xslStringDocument - the XSL document as a string.
resourcePath - the relative classpath resource path where the document is considered to exist, for URI resolution purposes.
Returns:
the transformer.
Throws:
PortalException - if the transformer could not be created.

clearXslCache

public void clearXslCache(SessionConfig sessionConfig,
                          String fileName,
                          ITransaction transaction)
                   throws PortalException,
                          ManagerException
Description copied from interface: IXslCacheManager
Clear the cache for the specified xsl file.

Specified by:
clearXslCache in interface IXslCacheManager
Parameters:
sessionConfig - the user session information.
fileName - the xsl file path.
transaction - the transaction for persistence access.
Throws:
PortalException
ManagerException

clearXslCache

public void clearXslCache(ITransaction transaction)
                   throws PortalException
Description copied from interface: IXslCacheManager
Clears all XSL cache.

Specified by:
clearXslCache in interface IXslCacheManager
Parameters:
transaction - the transaction for persistence access. If null, the cache is just cleared, else it is cleared as a transactional operation as specified in PortalCache.clear(ITransaction).
Throws:
PortalException

isXslCached

public boolean isXslCached(String fileName)
Description copied from interface: IXslCacheManager
Verify if the xsl file is cached.

Specified by:
isXslCached in interface IXslCacheManager
Parameters:
fileName - the xsl file path.
Returns:
true if the xsl is being cached and false otherwise.


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.