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 Classes Modifier and Type Class Description static class
DefaultCDMFrSyncTransformer.CDMFrPrefixResolver
XML prefix resolver which declares CDMFr namespaces.
-
Field Summary
Fields Modifier and Type Field Description protected Set<Pattern>
_applications
Set of applications supported by the transformer.protected DOMParser
_domParser
The DOM parser.protected PrefixResolver
_prefixResolver
The prefix resolver.protected SourceResolver
_sourceResolver
Ametys object resolver.protected XPathProcessor
_xPathProcessor
The XPath processor.protected String
_xslFile
The XSL file to transform the document.static Map<String,String>
DEFAULT_NAMESPACES
The default XML namespace prefixes.
-
Constructor Summary
Constructors Constructor Description DefaultCDMFrSyncTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
protected void
configureNamespaces(Configuration configuration)
Configure the namespace to use.void
service(ServiceManager manager)
boolean
supports(Document document)
Analyze the document and tell if it's support or not by the current transformer.Document
transform(Document document, Map<String,Object> parameters)
Transform the document to a generic document designed for Ametys importers and synchronizers.
-
-
-
Field Detail
-
DEFAULT_NAMESPACES
public static final Map<String,String> DEFAULT_NAMESPACES
The default XML namespace prefixes.
-
_domParser
protected DOMParser _domParser
The DOM parser.
-
_sourceResolver
protected SourceResolver _sourceResolver
Ametys object resolver.
-
_xPathProcessor
protected XPathProcessor _xPathProcessor
The XPath processor.
-
_applications
protected Set<Pattern> _applications
Set of applications supported by the transformer.
-
_prefixResolver
protected PrefixResolver _prefixResolver
The prefix resolver.
-
-
Constructor Detail
-
DefaultCDMFrSyncTransformer
public DefaultCDMFrSyncTransformer()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
configureNamespaces
protected void configureNamespaces(Configuration configuration)
Configure the namespace to use.- Parameters:
configuration
- the namespaces configuration, can be null.
-
supports
public boolean supports(Document document)
Description copied from interface:CDMFrSyncTransformer
Analyze the document and tell if it's support or not by the current transformer.- Specified by:
supports
in 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, ProcessingException
Description 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.
-
-