public class DefaultXmlContentImporter extends AbstractXmlContentImporter
AbstractXmlContentImporter.DefaultPrefixResolver
AbstractContentImporter.ContentReference
Modifier and Type | Field and Description |
---|---|
protected ContentTypesHelper |
_cTypeHelper
The content type helper.
|
protected static String |
_DEFAULT_CONTENT_LANG_KEY
Default content language key in the import map.
|
protected static String |
_DEFAULT_CONTENT_MIXINS_KEY
Default content mixins key in the import map.
|
protected static String |
_DEFAULT_CONTENT_TYPES_KEY
Default content types key in the import map.
|
protected String |
_matchPath
The XPath expression to match.
|
protected Pattern |
_matchRegex
The XPath value to match.
|
protected String |
_matchValue
The XPath value to match.
|
_domParser, _prefixResolver, _saxParser, _srcResolver, _xPathProcessor, _xsl, _xsltProcessor, _xslTransformerHandler
_CONTENT_ID_MAP_KEY, _CONTENT_LINK_MAP_KEY, _CONTENT_REPEATER_SIZE_MAP, _contentTypes, _contentWorkflowHelper, _editActionId, _extensions, _initialActionId, _language, _mixins, _priority, _resolver, _workflowName, DEFAULT_PRIORITY
Constructor and Description |
---|
DefaultXmlContentImporter() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Configuration configuration) |
protected void |
configureXmlMatch(Configuration configuration)
Configure the matching value.
|
protected Content |
importContent(Node contentNode,
String[] defaultTypes,
String[] defaultMixins,
String defaultLang,
Map<String,Object> params)
Import a content from a XML node.
|
protected Set<String> |
importContents(Document node,
Map<String,Object> params)
Import the contents from the XML DOM
Document . |
protected void |
importMetadata(ModifiableContent content,
ModifiableCompositeMetadata meta,
Node metaNode,
MetadataDefinition metaDef,
String metadataPath,
Map<String,Object> params)
Import metadata from a DOM node.
|
protected void |
importMetadata(ModifiableContent content,
Node contentNode,
String prefix,
Map<String,Object> params)
Import metadata from a content node.
|
protected Content |
importSubContent(ModifiableTraversableAmetysObject subContentMeta,
Node contentNode,
String parentContentId,
String metadataPath,
Map<String,Object> params)
Import a sub-content.
|
void |
service(ServiceManager serviceManager) |
protected void |
setComposite(ModifiableContent content,
ModifiableCompositeMetadata meta,
Node metaNode,
MetadataDefinition metaDef,
String name,
String metadataPath,
Map<String,Object> params)
Set a composite metadata.
|
protected void |
setContentReferences(ModifiableContent content,
ModifiableCompositeMetadata meta,
Node metaNode,
String name,
MetadataDefinition metaDef,
String[] values,
String metadataPath,
Map<String,Object> params)
Set a content metadata.
|
protected void |
setMetadata(ModifiableContent content,
ModifiableCompositeMetadata meta,
Node metaNode,
MetadataDefinition metaDef,
String name,
String[] values,
String metadataPath,
Map<String,Object> params)
Set the values of a metadata.
|
protected void |
setMultilingualString(ModifiableCompositeMetadata meta,
Node metaNode,
String name)
Set a RichText metadata.
|
protected void |
setRepeater(ModifiableContent content,
ModifiableCompositeMetadata meta,
Node metaNode,
RepeaterDefinition repeaterDef,
String name,
String metadataPath,
Map<String,Object> params)
Set a repeater metadata.
|
protected void |
setRichText(ModifiableCompositeMetadata meta,
Node metaNode,
String name)
Set a RichText metadata.
|
protected void |
setSubContents(ModifiableCompositeMetadata meta,
Node metaNode,
String name,
String parentContentId,
String metadataPath,
Map<String,Object> params)
Set a sub-content metadata.
|
boolean |
supports(Document document)
Tests if the
XmlContentImporter is able to import the corresponding Document. |
configureContentCreation, configureNamespaces, configureXml, getAttributeValue, getAttributeValue, getPrefixResolver, getTextContent, getTextContent, importContents, initializeXslTransformerHandler, supports
addContentReference, addContentReference, addContentReferences, configureExtensions, configureWorkflow, createContent, createContent, createContent, createContent, createContent, getContentFromProperties, getContentIdMap, getContentRefMap, getContentRepeaterSizeMap, getContentTypes, getDefaultExtensions, getEditActionId, getInitialActionId, getLanguage, getMixins, getPriority, getReferencedContentId, getWorkflowName, isExtensionValid, parseDate, parseDate, restoreContentReferences, setBinaryMetadata, setBooleanMetadata, setDateMetadata, setDoubleMetadata, setGeocodeMetadata, setGeocodeMetadata, setLongMetadata, setReferenceMetadatas, setRepeaterSize, setRichText, setStringMetadata
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPriority
protected static final String _DEFAULT_CONTENT_TYPES_KEY
protected static final String _DEFAULT_CONTENT_MIXINS_KEY
protected static final String _DEFAULT_CONTENT_LANG_KEY
protected ContentTypesHelper _cTypeHelper
protected String _matchPath
protected String _matchValue
protected Pattern _matchRegex
public DefaultXmlContentImporter()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class AbstractXmlContentImporter
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configure
in class AbstractXmlContentImporter
ConfigurationException
protected void configureXmlMatch(Configuration configuration) throws ConfigurationException
configuration
- the matching configuration.ConfigurationException
- if an error occurs.public boolean supports(Document document) throws IOException
XmlContentImporter
XmlContentImporter
is able to import the corresponding Document.document
- the XML Document
to test.XmlContentImporter
can import the corresponding stream, false otherwise.IOException
- if an error occurs.protected Set<String> importContents(Document node, Map<String,Object> params) throws IOException
AbstractXmlContentImporter
Document
.importContents
in class AbstractXmlContentImporter
node
- the XML Document.params
- the import parameters.IOException
- if an error occurs importing the contents.protected Content importContent(Node contentNode, String[] defaultTypes, String[] defaultMixins, String defaultLang, Map<String,Object> params) throws IOException, com.opensymphony.workflow.WorkflowException
contentNode
- the content XML node.defaultTypes
- the default content types.defaultMixins
- the default mixins.defaultLang
- the default content language.params
- the import parameters.IOException
- if an error occurs during the import.com.opensymphony.workflow.WorkflowException
- if an error occurs creating the Content.protected void importMetadata(ModifiableContent content, Node contentNode, String prefix, Map<String,Object> params) throws IOException
content
- the content to populate.contentNode
- the content DOM node.prefix
- the metadata prefix.params
- the import parameters.IOException
- if an error occurs.protected void importMetadata(ModifiableContent content, ModifiableCompositeMetadata meta, Node metaNode, MetadataDefinition metaDef, String metadataPath, Map<String,Object> params) throws IOException
content
- The content being imported.meta
- the metadata holder to populate.metaNode
- the metadata DOM node.metaDef
- the metadata definition.metadataPath
- the metadata path.params
- the import parameters.IOException
- if an error occurs.protected void setMetadata(ModifiableContent content, ModifiableCompositeMetadata meta, Node metaNode, MetadataDefinition metaDef, String name, String[] values, String metadataPath, Map<String,Object> params) throws IOException
content
- The content being imported.meta
- the metadata holder.metaNode
- the metadata DOM node.metaDef
- the metadata definition.name
- the metadata name.values
- the metadata values.metadataPath
- the metadata path.params
- the import parameters.IOException
- if an error occurs.protected void setComposite(ModifiableContent content, ModifiableCompositeMetadata meta, Node metaNode, MetadataDefinition metaDef, String name, String metadataPath, Map<String,Object> params) throws IOException
content
- The content being imported.meta
- the metadata holder.metaNode
- the metadata DOM node.metaDef
- the metadata definition.name
- the metadata name.metadataPath
- the metadata path.params
- the import parameters.IOException
- if an error occurs.protected void setMultilingualString(ModifiableCompositeMetadata meta, Node metaNode, String name) throws IOException
meta
- the metadata holder.metaNode
- the metadata node.name
- the metadata name.IOException
- if an error occurs.protected void setRichText(ModifiableCompositeMetadata meta, Node metaNode, String name) throws IOException
meta
- the metadata holder.metaNode
- the metadata node.name
- the metadata name.IOException
- if an error occurs.protected void setRepeater(ModifiableContent content, ModifiableCompositeMetadata meta, Node metaNode, RepeaterDefinition repeaterDef, String name, String metadataPath, Map<String,Object> params) throws IOException
content
- The content being imported.meta
- the metadata holder.metaNode
- the metadata DOM node.repeaterDef
- the repeater definition.name
- the metadata name.metadataPath
- the metadata path.params
- the import parameters.IOException
- if an error occurs.protected void setContentReferences(ModifiableContent content, ModifiableCompositeMetadata meta, Node metaNode, String name, MetadataDefinition metaDef, String[] values, String metadataPath, Map<String,Object> params) throws IOException
content
- The content being imported.meta
- the metadata holder.metaNode
- the metadata DOM node.name
- the metadata name.metaDef
- the metadata definitionvalues
- the values arraymetadataPath
- the metadata path.params
- the import parameters.IOException
- if an error occurs.protected void setSubContents(ModifiableCompositeMetadata meta, Node metaNode, String name, String parentContentId, String metadataPath, Map<String,Object> params) throws IOException
meta
- the metadata holder.metaNode
- the metadata DOM node.name
- the metadata name.parentContentId
- the parent content ID.metadataPath
- the metadata path.params
- the import parameters.IOException
- if an error occurs.protected Content importSubContent(ModifiableTraversableAmetysObject subContentMeta, Node contentNode, String parentContentId, String metadataPath, Map<String,Object> params) throws IOException
subContentMeta
- the content collection metadata.contentNode
- the DOM node representing the sub-content.parentContentId
- the parent content ID.metadataPath
- the content collection metadata path.params
- the import parameters.IOException
- if an error occurs.