info.magnolia.importexport
Class PropertiesImportExport

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

public class PropertiesImportExport
extends 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, Properties out)
           
static Properties contentToProperties(Content rootContent)
           
static Properties contentToProperties(Content rootContent, Content.ContentFilter filter)
           
static Properties contentToProperties(HierarchyManager hm)
           
protected  Object convertNodeDataStringToObject(String valueStr)
           
 void createContent(Content root, InputStream propertiesStream)
           
static 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 String dumpPropertiesToString(Properties properties)
           
protected  void populateContent(Content c, String name, String valueStr)
           
static Properties toProperties(Content rootContent)
           
static 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,
                          InputStream propertiesStream)
                   throws IOException,
                          javax.jcr.RepositoryException
Throws:
IOException
javax.jcr.RepositoryException

populateContent

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

convertNodeDataStringToObject

protected Object convertNodeDataStringToObject(String valueStr)

toProperties

public static Properties toProperties(HierarchyManager hm)
                               throws 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:
Exception

toProperties

public static Properties toProperties(Content rootContent)
                               throws Exception
Throws:
Exception

contentToProperties

public static Properties contentToProperties(HierarchyManager hm)
                                      throws Exception
Throws:
Exception

contentToProperties

public static Properties contentToProperties(Content rootContent)
                                      throws Exception
Throws:
Exception

contentToProperties

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

appendNodeProperties

public static void appendNodeProperties(Content node,
                                        Properties out)

dumpPropertiesToString

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

Throws:
Exception

dumpPropertiesToString

public static String dumpPropertiesToString(Properties properties)


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