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)
          Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)
static Properties contentToProperties(Content rootContent, Content.ContentFilter filter)
          Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)
static Properties contentToProperties(HierarchyManager hm)
          Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)
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)
          Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)
static Properties toProperties(HierarchyManager hm)
          Deprecated. since 4.3 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)
 
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

@Deprecated
public static Properties toProperties(HierarchyManager hm)
                               throws Exception
Deprecated. since 4.3 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)

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)

Throws:
Exception

toProperties

public static Properties toProperties(Content rootContent)
                               throws Exception
Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)

Throws:
Exception

contentToProperties

public static Properties contentToProperties(HierarchyManager hm)
                                      throws Exception
Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)

Throws:
Exception

contentToProperties

public static Properties contentToProperties(Content rootContent)
                                      throws Exception
Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)

Throws:
Exception

contentToProperties

public static Properties contentToProperties(Content rootContent,
                                             Content.ContentFilter filter)
                                      throws Exception
Deprecated. since 5.0 - use PropertiesImportExport.toProperties(javax.jcr.Node, info.magnolia.jcr.predicate.AbstractPredicate)

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-2013 Magnolia International Ltd.. All Rights Reserved.