|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.jcr.util.PropertiesImportExport
public class PropertiesImportExport
Utility class providing support for properties-like format to import/export jcr data. Useful when data regularly needs to be bootstrapped, for instance, and the jcr xml format is too cumbersome to maintain. Caution: Binary data is represented as ByteArrayInputStream because of the lack of a proper javax.jcr.Binary implementation TODO : handle conflicts (already existing nodes, properties, what to do with existing properties if we don't create new nodes, ...)
Constructor Summary | |
---|---|
PropertiesImportExport()
|
Method Summary | |
---|---|
protected Object |
convertPropertyStringToObject(String valueStr)
|
void |
createNodes(javax.jcr.Node root,
InputStream propertiesStream)
Each property or node in the stream has to be separated by the \n. |
void |
createNodes(javax.jcr.Node root,
String... properties)
Each property is one item in the properties varargs passed in. |
protected void |
populateNode(javax.jcr.Node node,
String name,
String valueStr)
|
protected void |
setIdentifier(javax.jcr.Node ignoredNode,
String ignoredString)
Intentionally created this method to allow simple creation of subclasses actually setting the identifier (e.g. |
Properties |
toProperties(javax.jcr.Node node,
AbstractPredicate<javax.jcr.Node> nodePredicate)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertiesImportExport()
Method Detail |
---|
public void createNodes(javax.jcr.Node root, String... properties) throws IOException, javax.jcr.RepositoryException
IOException
javax.jcr.RepositoryException
public void createNodes(javax.jcr.Node root, InputStream propertiesStream) throws IOException, javax.jcr.RepositoryException
IOException
javax.jcr.RepositoryException
protected void populateNode(javax.jcr.Node node, String name, String valueStr) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void setIdentifier(javax.jcr.Node ignoredNode, String ignoredString)
protected Object convertPropertyStringToObject(String valueStr)
public Properties toProperties(javax.jcr.Node node, AbstractPredicate<javax.jcr.Node> nodePredicate) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |