Class DefaultCDMFrSyncTransformer
java.lang.Object
org.ametys.plugins.odfsync.cdmfr.transformers.DefaultCDMFrSyncTransformer
- All Implemented Interfaces:
CDMFrSyncTransformer
,Prioritizable
,Supporter<Document>
,Configurable
,Serviceable
public class DefaultCDMFrSyncTransformer
extends Object
implements CDMFrSyncTransformer, Serviceable, Configurable
Default implementation of CDMFrSyncTransformer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
XML prefix resolver which declares CDMFr namespaces. -
Field Summary
FieldsModifier and TypeFieldDescriptionSet of applications supported by the transformer.protected DOMParser
The DOM parser.protected PrefixResolver
The prefix resolver.protected Integer
The priorityprotected SourceResolver
Ametys object resolver.protected XPathProcessor
The XPath processor.protected String
The XSL file to transform the document.The default XML namespace prefixes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) protected void
configureNamespaces
(Configuration configuration) Configure the namespace to use.int
Get the priority for the component.void
service
(ServiceManager manager) boolean
Check if an element is supportedTransform the document to a generic document designed for Ametys importers and synchronizers.
-
Field Details
-
DEFAULT_NAMESPACES
The default XML namespace prefixes. -
_domParser
The DOM parser. -
_sourceResolver
Ametys object resolver. -
_xPathProcessor
The XPath processor. -
_xslFile
The XSL file to transform the document. -
_applications
Set of applications supported by the transformer. -
_prefixResolver
The prefix resolver. -
_priority
The priority
-
-
Constructor Details
-
DefaultCDMFrSyncTransformer
public DefaultCDMFrSyncTransformer()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
configureNamespaces
Configure the namespace to use.- Parameters:
configuration
- the namespaces configuration, can be null.
-
supports
Description copied from interface:Supporter
Check if an element is supported -
transform
public Document transform(Document document, Map<String, Object> parameters) throws IOException, SAXException, ProcessingExceptionDescription copied from interface:CDMFrSyncTransformer
Transform the document to a generic document designed for Ametys importers and synchronizers.- Specified by:
transform
in interfaceCDMFrSyncTransformer
- Parameters:
document
- The document to transform.parameters
- additional parameters for transformation- Returns:
- The transformed document.
- Throws:
IOException
- if an error occurs.SAXException
- if an error occurs.ProcessingException
- if an error occurs.
-
getPriority
Description copied from interface:Prioritizable
Get the priority for the component. On components usingPrioritizable
interface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriority
in interfacePrioritizable
- Returns:
- the priority
-