Package org.ametys.odf.export
Class ExportCatalogByLevelsGenerator
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.odf.export.ExportCatalogByLevelsGenerator
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
- Direct Known Subclasses:
ExportCatalogByLevelsGenerator
Generate the ODF structure with 2 levels (metadata), the catalog and the lang. It's possible to determine a metadataset to sax data.
You should call this generator with the following parameters :
- catalog : identifier of the catalog
- lang : language code (fr, en, etc.)
- level1 : name of the attribute for the first level
- level2 : name of the attribute for the second level
- metadataSet (optional) : name of the view to sax values
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypesHelper
The content type helperprotected OdfClassificationHandler
The ODF classification handlerprotected ODFHelper
The ODF helperprotected OdfReferenceTableHelper
The helper for reference tablesprotected AmetysObjectResolver
The AmetysObject resolverFields 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addLevelAttributes
(AttributesImpl attrs, String value, String lang) Add attributes for classification levelvoid
generate()
protected AmetysObjectIterable<Program>
getConcernedPrograms
(Map<String, String> wsParameters) Get the programs to SAX.protected AttributesImpl
getContentAttributes
(ProgramItem programItem, Program parentProgram, Map<String, String> wsParameters) Get attributes for the current saxed content (title, id, etc.).protected String
getParameter
(Request request, String parameterName) Get the parameter from the request and test if it's not null or blank.protected boolean
getParameters
(Map<String, String> wsParameters) Get the parameters from the request and test it.void
service
(ServiceManager smanager) 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 Details
-
_resolver
The AmetysObject resolver -
_contentTypesHelper
The content type helper -
_odfHelper
The ODF helper -
_odfClassificationHandler
The ODF classification handler -
_odfRefTableHelper
The helper for reference tables
-
-
Constructor Details
-
ExportCatalogByLevelsGenerator
public ExportCatalogByLevelsGenerator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableGenerator
- Throws:
ServiceException
-
generate
-
_addLevelAttributes
Add attributes for classification level- Parameters:
attrs
- The XML attributesvalue
- The level's valuelang
- The language
-
getParameters
Get the parameters from the request and test it.- Parameters:
wsParameters
- Map of parameters to fill- Returns:
- false if a parameter is missing or something going wrong with the parameters, otherwise true
- Throws:
SAXException
- if an error occured
-
getParameter
Get the parameter from the request and test if it's not null or blank. Sax an error if the parameter is missing or empty.- Parameters:
request
- The requestparameterName
- The parameter name- Returns:
- null when the parameter is missing or empty, otherwise the parameter value
- Throws:
SAXException
- if an error occured
-
getConcernedPrograms
Get the programs to SAX.- Parameters:
wsParameters
- Parameters of the web service- Returns:
- A Collection of programs
-
getContentAttributes
protected AttributesImpl getContentAttributes(ProgramItem programItem, Program parentProgram, Map<String, String> wsParameters) Get attributes for the current saxed content (title, id, etc.).- Parameters:
programItem
- Part of the program to get attributesparentProgram
- Initial programwsParameters
- Parameters of the web service- Returns:
- The attributes to sax
-