Class MinimizeTransformer
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.xml.AbstractXMLPipe
-
- org.apache.cocoon.transformation.AbstractTransformer
-
- org.apache.cocoon.transformation.ServiceableTransformer
-
- org.ametys.plugins.core.ui.minimize.MinimizeTransformer
-
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,Configurable
,Contextualizable
,LogEnabled
,Serviceable
,SitemapModelComponent
,Transformer
,XMLConsumer
,XMLPipe
,XMLProducer
,XMLConsumer
,ContentHandler
,LexicalHandler
- Direct Known Subclasses:
FrontMinimizeTransformer
public class MinimizeTransformer extends ServiceableTransformer implements Contextualizable, Configurable
This transformer will minimize every scripts together
-
-
Field Summary
Fields Modifier and Type Field Description protected Context
_context
The avalon contextprotected String
_currentContextPath
The current contextprotected Boolean
_inlineCssMedias
Should css medias be taken in account?protected Boolean
_isSuperDevMode
Is developer mode?protected String
_locale
The current localprotected List<Pattern>
_patterns
The list of patterns available for minimization-
Fields inherited from class org.apache.cocoon.transformation.ServiceableTransformer
manager, objectModel, parameters, resolver, source
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
-
-
Constructor Summary
Constructors Constructor Description MinimizeTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
_getMinimizeUrl()
Get the url of the minimizerprotected String
_removeContextPath(String uri)
Remove the context path from the uri to be able to analyse correctly the patternsvoid
configure(Configuration configuration)
void
contextualize(Context context)
void
endElement(String uri, String loc, String raw)
protected String
getHashSalt()
Return the salt used by the hash cachevoid
service(ServiceManager smanager)
void
setup(SourceResolver res, Map obj, String src, Parameters par)
void
startDocument()
void
startElement(String uri, String loc, String raw, Attributes a)
-
Methods inherited from class org.apache.cocoon.transformation.ServiceableTransformer
dispose, recycle
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity, startPrefixMapping
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping
-
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
-
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
_isSuperDevMode
protected Boolean _isSuperDevMode
Is developer mode?
-
_inlineCssMedias
protected Boolean _inlineCssMedias
Should css medias be taken in account?
-
_currentContextPath
protected String _currentContextPath
The current context
-
-
Constructor Detail
-
MinimizeTransformer
public MinimizeTransformer()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableTransformer
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_getMinimizeUrl
protected String _getMinimizeUrl()
Get the url of the minimizer- Returns:
- The minimizer url
-
setup
public void setup(SourceResolver res, Map obj, String src, Parameters par) throws ProcessingException, SAXException, IOException
- Specified by:
setup
in interfaceSitemapModelComponent
- Overrides:
setup
in classServiceableTransformer
- Throws:
ProcessingException
SAXException
IOException
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classAbstractXMLPipe
- Throws:
SAXException
-
startElement
public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classAbstractXMLPipe
- Throws:
SAXException
-
endElement
public void endElement(String uri, String loc, String raw) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classAbstractXMLPipe
- Throws:
SAXException
-
_removeContextPath
protected String _removeContextPath(String uri)
Remove the context path from the uri to be able to analyse correctly the patterns- Parameters:
uri
- The incomming uri- Returns:
- The uri with no context path
-
getHashSalt
protected String getHashSalt()
Return the salt used by the hash cache- Returns:
- The salt string
-
-