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
_currentUserProvider
The current user providerstatic String
DYNAMIC_INFORMATION
Constant for root tagstatic String
ERROR
Constant for item's error message tagstatic String
ERROR_ATTRIBUTE_TYPE
Constant for item's error type tagstatic String
ITEM
Constant for item tagstatic String
ITEM_FOOTER
Constant for item's footer tagstatic String
ITEM_SUMMARY
Constant for item's summary tagstatic String
ITEM_TITLE
Constant for item's title tagstatic String
LONG_VALUE
Constant for long value tagstatic String
SHORT_VALUE
Constant for short value tagstatic String
TOOLTIP
Constant 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 void
generate()
protected String
getCurrentLanguage()
Get the current languageprotected UserIdentity
getCurrentUser()
Get the current connected userprotected int
getMaxItems()
Get the number of requested max itemsprotected void
saxError(DynamicInformationException e)
SAX the errorprotected void
saxItem(String title, String summary, String footer)
Create an item node.protected void
saxItem(Date title, String summary, String footer)
Create an item node when the title is aDate
protected abstract void
saxLongValue()
Create a long value node.protected abstract void
saxShortValue()
Create a short value node.protected abstract void
saxTooltips()
Create a tooltip node.void
service(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:
service
in interfaceServiceable
- Overrides:
service
in 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
null
if 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
-
-