Class AbstractInternalDynamicInformationGenerator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.generation.AbstractGenerator
-
- org.apache.cocoon.generation.ServiceableGenerator
-
- org.ametys.plugins.linkdirectory.dynamic.AbstractInternalDynamicInformationGenerator
-
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
- Direct Known Subclasses:
AbstractMessagingConnectorDynamicInformationGenerator,TicketsDynamicInformationGenerator
public abstract class AbstractInternalDynamicInformationGenerator extends ServiceableGenerator
Abstract generator for saxing dynamic information.
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider_currentUserProviderThe current user providerstatic StringDYNAMIC_INFORMATIONConstant for root tagstatic StringERRORConstant for item's error message tagstatic StringERROR_ATTRIBUTE_TYPEConstant for item's error type tagstatic StringITEMConstant for item tagstatic StringITEM_FOOTERConstant for item's footer tagstatic StringITEM_SUMMARYConstant for item's summary tagstatic StringITEM_TITLEConstant for item's title tagstatic StringLONG_VALUEConstant for long value tagstatic StringSHORT_VALUEConstant for short value tagstatic StringTOOLTIPConstant for tooltip tag-
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
-
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
-
Constructor Summary
Constructors Constructor Description AbstractInternalDynamicInformationGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidgenerate()protected StringgetCurrentLanguage()Get the current languageprotected UserIdentitygetCurrentUser()Get the current connected userprotected intgetMaxItems()Get the number of requested max itemsprotected voidsaxError(DynamicInformationException e)SAX the errorprotected voidsaxItem(String title, String summary, String footer)Create an item node.protected voidsaxItem(Date title, String summary, String footer)Create an item node when the title is aDateprotected abstract voidsaxLongValue()Create a long value node.protected abstract voidsaxShortValue()Create a short value node.protected abstract voidsaxTooltips()Create a tooltip node.voidservice(ServiceManager serviceManager)-
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
-
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
-
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.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
DYNAMIC_INFORMATION
public static final String DYNAMIC_INFORMATION
Constant for root tag- See Also:
- Constant Field Values
-
SHORT_VALUE
public static final String SHORT_VALUE
Constant for short value tag- See Also:
- Constant Field Values
-
LONG_VALUE
public static final String LONG_VALUE
Constant for long value tag- See Also:
- Constant Field Values
-
TOOLTIP
public static final String TOOLTIP
Constant for tooltip tag- See Also:
- Constant Field Values
-
ITEM
public static final String ITEM
Constant for item tag- See Also:
- Constant Field Values
-
ITEM_TITLE
public static final String ITEM_TITLE
Constant for item's title tag- See Also:
- Constant Field Values
-
ITEM_SUMMARY
public static final String ITEM_SUMMARY
Constant for item's summary tag- See Also:
- Constant Field Values
-
ITEM_FOOTER
public static final String ITEM_FOOTER
Constant for item's footer tag- See Also:
- Constant Field Values
-
ERROR
public static final String ERROR
Constant for item's error message tag- See Also:
- Constant Field Values
-
ERROR_ATTRIBUTE_TYPE
public static final String ERROR_ATTRIBUTE_TYPE
Constant for item's error type tag- See Also:
- Constant Field Values
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
-
Constructor Detail
-
AbstractInternalDynamicInformationGenerator
public AbstractInternalDynamicInformationGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableGenerator- Throws:
ServiceException
-
generate
public void generate() throws IOException, SAXException, ProcessingException
-
getCurrentUser
protected UserIdentity getCurrentUser()
Get the current connected user- Returns:
- A user identity or
nullif there is no connected user
-
getCurrentLanguage
protected String getCurrentLanguage()
Get the current language- Returns:
- the current language
-
getMaxItems
protected int getMaxItems()
Get the number of requested max items- Returns:
- the number of max items. -1 if there is no limitations
-
saxError
protected void saxError(DynamicInformationException e) throws SAXException
SAX the error- Parameters:
e- The thrown exception- Throws:
SAXException- If a SAXException error occurs
-
saxShortValue
protected abstract void saxShortValue() throws SAXException
Create a short value node.- Throws:
SAXException- If a SAXException error occurs
-
saxLongValue
protected abstract void saxLongValue() throws SAXException
Create a long value node.- Throws:
SAXException- If a error occurs while saxing
-
saxTooltips
protected abstract void saxTooltips() throws SAXException
Create a tooltip node.- Throws:
SAXException- If a error occurs while saxing
-
saxItem
protected void saxItem(String title, String summary, String footer) throws SAXException
Create an item node.- Parameters:
title- The title of item.summary- The summary of item.footer- The footer of item.- Throws:
SAXException- If a error occurs while saxing
-
saxItem
protected void saxItem(Date title, String summary, String footer) throws SAXException
Create an item node when the title is aDate- Parameters:
title- The title of item as Date.summary- The summary of item.footer- The footer of item.- Throws:
SAXException- If a error occurs while saxing
-
-