@Service
@Property(name="extensions",value="xml") @Property(name="contentTypes",value={"application/xml","text/xml"})
public class XmlReader
extends Object
implements ContentReader
<node>
<name>the name of the node</name>
<primaryNodeType>type</primaryNodeType>
<mixinNodeTypes>
<mixinNodeType>mixtype1</mixinNodeType>
<mixinNodeType>mixtype2</mixinNodeType>
</mixingNodeTypes>
<properties>
<property>
<name>propName</name>
<value>propValue</value>
or
<values>
<value/> for multi value properties
</values>
<type>propType</type>
</property>
<!-- more properties -->
</properties>
<nodes>
<!-- child nodes -->
<node>
..
</node>
</nodes>
</node>
If you want to include a binary file in your loaded content, you may specify it using a
XmlReader.FileDescription <nt:file> element.| Modifier and Type | Class and Description |
|---|---|
protected static class |
XmlReader.AttributeMap
Utility class for dealing with attributes from KXmlParser.
|
protected static class |
XmlReader.FileDescription
Represents a reference to a file that is to be loaded into the repository.
|
protected static class |
XmlReader.NodeDescription |
protected static class |
XmlReader.PropertyDescription |
PROPERTY_EXTENSIONS, PROPERTY_TYPES| Constructor and Description |
|---|
XmlReader() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate() |
void |
parse(InputStream ins,
ContentCreator creator)
Read the content from the input stream and create the
content using the provided content creator.
|
void |
parse(URL url,
ContentCreator creator)
Read the content from the URL and create the
content using the provided content creator.
|
@Activate protected void activate()
public void parse(URL url, ContentCreator creator) throws IOException, javax.jcr.RepositoryException
ContentReaderparse in interface ContentReaderurl - The input stream.IOExceptionjavax.jcr.RepositoryExceptionContentReader.parse(URL, org.apache.sling.jcr.contentloader.ContentCreator)public void parse(InputStream ins, ContentCreator creator) throws IOException, javax.jcr.RepositoryException
ContentReaderparse in interface ContentReaderins - the input stream.IOExceptionjavax.jcr.RepositoryExceptionCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.