Class DefaultCDMFrSyncTransformer
java.lang.Object
org.ametys.plugins.odfsync.cdmfr.transformers.DefaultCDMFrSyncTransformer
- All Implemented Interfaces:
CDMFrSyncTransformer,Configurable,Serviceable
public class DefaultCDMFrSyncTransformer
extends Object
implements CDMFrSyncTransformer, Serviceable, Configurable
Default implementation of CDMFrSyncTransformer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classXML prefix resolver which declares CDMFr namespaces. -
Field Summary
FieldsModifier and TypeFieldDescriptionSet of applications supported by the transformer.protected DOMParserThe DOM parser.protected PrefixResolverThe prefix resolver.protected SourceResolverAmetys object resolver.protected XPathProcessorThe XPath processor.protected StringThe XSL file to transform the document.The default XML namespace prefixes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration configuration) protected voidconfigureNamespaces(Configuration configuration) Configure the namespace to use.voidservice(ServiceManager manager) booleanAnalyze the document and tell if it's support or not by the current transformer.Transform 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.
-
-
Constructor Details
-
DefaultCDMFrSyncTransformer
public DefaultCDMFrSyncTransformer()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
configureNamespaces
Configure the namespace to use.- Parameters:
configuration- the namespaces configuration, can be null.
-
supports
Description copied from interface:CDMFrSyncTransformerAnalyze the document and tell if it's support or not by the current transformer.- Specified by:
supportsin interfaceCDMFrSyncTransformer- Parameters:
document- The document to analyze.- Returns:
- TRUE if the document is supported by the transformer, otherwise FALSE.
-
transform
public Document transform(Document document, Map<String, Object> parameters) throws IOException, SAXException, ProcessingExceptionDescription copied from interface:CDMFrSyncTransformerTransform the document to a generic document designed for Ametys importers and synchronizers.- Specified by:
transformin 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.
-