info.magnolia.importexport
Class PropertiesImportExport

java.lang.Object
  extended by info.magnolia.importexport.PropertiesImportExport

public class PropertiesImportExport
extends java.lang.Object

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. TODO : handle conflicts (already existing nodes, properties, what to do with existing properties if we don't create new nodes, ...) TODO : consolidate syntax

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Constructor Summary
PropertiesImportExport()
           
 
Method Summary
static void appendNodeProperties(Content node, java.util.Properties out)
           
static java.util.Properties contentToProperties(Content rootContent)
           
static java.util.Properties contentToProperties(Content rootContent, Content.ContentFilter filter)
           
static java.util.Properties contentToProperties(HierarchyManager hm)
           
protected  java.lang.Object convertNodeDataStringToObject(java.lang.String valueStr)
           
 void createContent(Content root, java.io.InputStream propertiesStream)
           
static java.lang.String dumpPropertiesToString(Content content, Content.ContentFilter filter)
          Dumps content starting at the content node out to a string in the format that matches the import method.
static java.lang.String dumpPropertiesToString(java.util.Properties properties)
           
protected  void populateContent(Content c, java.lang.String name, java.lang.String valueStr)
           
static java.util.Properties toProperties(Content rootContent)
           
static java.util.Properties toProperties(HierarchyManager hm)
          Deprecated. since 4.3 This method is deprecated, it returns results in a format that does not match the format that the import method uses (doesn't include @uuid or @type properties) It is kept here to support existing test and applications that might break as a result of these changes (i.e. unit tests that are expecting a specific number of properties returned, etc) For new applications use the contentToProperties methods instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesImportExport

public PropertiesImportExport()
Method Detail

createContent

public void createContent(Content root,
                          java.io.InputStream propertiesStream)
                   throws java.io.IOException,
                          javax.jcr.RepositoryException
Throws:
java.io.IOException
javax.jcr.RepositoryException

populateContent

protected void populateContent(Content c,
                               java.lang.String name,
                               java.lang.String valueStr)
                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

convertNodeDataStringToObject

protected java.lang.Object convertNodeDataStringToObject(java.lang.String valueStr)

toProperties

public static java.util.Properties toProperties(HierarchyManager hm)
                                         throws java.lang.Exception
Deprecated. since 4.3 This method is deprecated, it returns results in a format that does not match the format that the import method uses (doesn't include @uuid or @type properties) It is kept here to support existing test and applications that might break as a result of these changes (i.e. unit tests that are expecting a specific number of properties returned, etc) For new applications use the contentToProperties methods instead.

Throws:
java.lang.Exception

toProperties

public static java.util.Properties toProperties(Content rootContent)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

contentToProperties

public static java.util.Properties contentToProperties(HierarchyManager hm)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

contentToProperties

public static java.util.Properties contentToProperties(Content rootContent)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

contentToProperties

public static java.util.Properties contentToProperties(Content rootContent,
                                                       Content.ContentFilter filter)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

appendNodeProperties

public static void appendNodeProperties(Content node,
                                        java.util.Properties out)

dumpPropertiesToString

public static java.lang.String dumpPropertiesToString(Content content,
                                                      Content.ContentFilter filter)
                                               throws java.lang.Exception
Dumps content starting at the content node out to a string in the format that matches the import method.

Throws:
java.lang.Exception

dumpPropertiesToString

public static java.lang.String dumpPropertiesToString(java.util.Properties properties)


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.