public class ExportCatalogByLevelsGenerator extends ServiceableGenerator
Modifier and Type | Class and Description |
---|---|
(package private) class |
ExportCatalogByLevelsGenerator.FilteredByVersionLabelIterable<P extends VersionAwareAmetysObject> |
Modifier and Type | Field and Description |
---|---|
protected ContentTypesHelper |
_contentTypesHelper
The content type helper
|
protected MetadataManager |
_metadataManager
The Metadata Manager
|
protected OdfClassificationHandler |
_odfClassificationHandler
The ODF classification handler
|
protected ODFHelper |
_odfHelper
The ODF helper
|
protected OdfReferenceTableHelper |
_odfRefTableHelper
The helper for reference tables
|
protected AmetysObjectResolver |
_resolver
The AmetysObject resolver
|
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Constructor and Description |
---|
ExportCatalogByLevelsGenerator() |
Modifier and Type | Method and Description |
---|---|
protected void |
_addLevelAttributes(AttributesImpl attrs,
String value,
String lang)
Add attributes for classification level
|
private void |
_saxChildren(Program parentProgram,
ProgramItem programItem,
String metadataSetName,
Map<String,String> wsParameters)
Explore and sax children of the passed program item.
|
private void |
_saxStructure(Program parentProgram,
ProgramItem programItem,
String metadataSetName,
Map<String,String> wsParameters)
Sax the structure of the parentProgram by exploring its children and saxing metadata containing into the passed metadataSet.
|
void |
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) |
dispose
recycle, setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
protected AmetysObjectResolver _resolver
protected MetadataManager _metadataManager
protected ContentTypesHelper _contentTypesHelper
protected ODFHelper _odfHelper
protected OdfClassificationHandler _odfClassificationHandler
protected OdfReferenceTableHelper _odfRefTableHelper
public ExportCatalogByLevelsGenerator()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableGenerator
ServiceException
public void generate() throws IOException, SAXException, ProcessingException
protected void _addLevelAttributes(AttributesImpl attrs, String value, String lang)
attrs
- The XML attributesvalue
- The level's valuelang
- The languageprotected boolean getParameters(Map<String,String> wsParameters) throws SAXException
wsParameters
- Map of parameters to fillSAXException
- if an error occuredprotected String getParameter(Request request, String parameterName) throws SAXException
request
- The requestparameterName
- The parameter nameSAXException
- if an error occuredprotected AmetysObjectIterable<Program> getConcernedPrograms(Map<String,String> wsParameters)
wsParameters
- Parameters of the web serviceprivate void _saxStructure(Program parentProgram, ProgramItem programItem, String metadataSetName, Map<String,String> wsParameters) throws AmetysRepositoryException, SAXException, IOException
parentProgram
- Initial programprogramItem
- Part of the program to exploremetadataSetName
- Name of the metadata set to SAXwsParameters
- Parameters of the web serviceAmetysRepositoryException
- if an error occuredSAXException
- if an error occuredIOException
- if an error occuredprivate void _saxChildren(Program parentProgram, ProgramItem programItem, String metadataSetName, Map<String,String> wsParameters) throws AmetysRepositoryException, SAXException, IOException
parentProgram
- Initial programprogramItem
- Part of the program to exploremetadataSetName
- Name of the metadata set to SAXwsParameters
- Parameters of the web serviceAmetysRepositoryException
- if an error occuredSAXException
- if an error occuredIOException
- if an error occuredprotected AttributesImpl getContentAttributes(ProgramItem programItem, Program parentProgram, Map<String,String> wsParameters)
programItem
- Part of the program to get attributesparentProgram
- Initial programwsParameters
- Parameters of the web service