org.apache.jackrabbit.core.xml
Class WorkspaceImporter

java.lang.Object
  extended by org.apache.jackrabbit.core.xml.WorkspaceImporter
All Implemented Interfaces:
Importer

public class WorkspaceImporter
extends Object
implements Importer

WorkspaceImporter ...


Constructor Summary
WorkspaceImporter(Path parentPath, WorkspaceImpl wsp, SessionContext sessionContext, int uuidBehavior)
          Creates a new WorkspaceImporter instance.
WorkspaceImporter(Path parentPath, WorkspaceImpl wsp, SessionContext sessionContext, int uuidBehavior, ImportConfig config)
          Creates a new WorkspaceImporter instance.
 
Method Summary
 void end()
          Called once at the end of the content import.
 void endNode(NodeInfo nodeInfo)
          Called to end the import of a node.
protected  void postProcessNode(NodeState node)
          Post-process imported node (initialize properties with special semantics etc.)
protected  void processProperty(NodeState node, PropInfo pInfo)
           
protected  NodeState resolveUUIDConflict(NodeState parent, NodeState conflicting, NodeInfo nodeInfo)
           
 void start()
          Called once at the beginning of the content import.
 void startNode(NodeInfo nodeInfo, List<PropInfo> propInfos)
          Called to start the import of a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkspaceImporter

public WorkspaceImporter(Path parentPath,
                         WorkspaceImpl wsp,
                         SessionContext sessionContext,
                         int uuidBehavior)
                  throws PathNotFoundException,
                         ConstraintViolationException,
                         VersionException,
                         LockException,
                         RepositoryException
Creates a new WorkspaceImporter instance.

Parameters:
parentPath - target path where to add the imported subtree
wsp - the workspace to operate on
ntReg - the node type registry
uuidBehavior - flag that governs how incoming UUIDs are handled
Throws:
PathNotFoundException - if no node exists at parentPath or if the current session is not granted read access.
ConstraintViolationException - if the node at parentPath is protected
VersionException - if the node at parentPath is not checked-out
LockException - if a lock prevents the addition of the subtree
RepositoryException - if another error occurs

WorkspaceImporter

public WorkspaceImporter(Path parentPath,
                         WorkspaceImpl wsp,
                         SessionContext sessionContext,
                         int uuidBehavior,
                         ImportConfig config)
                  throws PathNotFoundException,
                         ConstraintViolationException,
                         VersionException,
                         LockException,
                         RepositoryException
Creates a new WorkspaceImporter instance.

Parameters:
parentPath - target path where to add the imported subtree
wsp - the workspace to operate on
ntReg - the node type registry
uuidBehavior - flag that governs how incoming UUIDs are handled
config - import configuration.
Throws:
PathNotFoundException - if no node exists at parentPath or if the current session is not granted read access.
ConstraintViolationException - if the node at parentPath is protected
VersionException - if the node at parentPath is not checked-out
LockException - if a lock prevents the addition of the subtree
RepositoryException - if another error occurs
Method Detail

resolveUUIDConflict

protected NodeState resolveUUIDConflict(NodeState parent,
                                        NodeState conflicting,
                                        NodeInfo nodeInfo)
                                 throws RepositoryException
Parameters:
parent - parent node state
conflicting - conflicting node state
nodeInfo - the node info
Returns:
the resolved node state
Throws:
RepositoryException - if an error occurs

postProcessNode

protected void postProcessNode(NodeState node)
                        throws RepositoryException
Post-process imported node (initialize properties with special semantics etc.)

Parameters:
node - the node state
Throws:
RepositoryException - if an error occurs

processProperty

protected void processProperty(NodeState node,
                               PropInfo pInfo)
                        throws RepositoryException
Throws:
RepositoryException

start

public void start()
           throws RepositoryException
Called once at the beginning of the content import.

Specified by:
start in interface Importer
Throws:
RepositoryException - on a repository error

startNode

public void startNode(NodeInfo nodeInfo,
                      List<PropInfo> propInfos)
               throws RepositoryException
Called to start the import of a node. Information about the imported node and all it's properties are passed as arguments. Possible child nodes are imported recursively using this same method until a Importer.endNode(NodeInfo) call is made with the same node information.

Specified by:
startNode in interface Importer
Parameters:
nodeInfo - information about the node being imported
propInfos - information abouth the properties being imported (list of PropInfo instances)
Throws:
RepositoryException - on a repository error

endNode

public void endNode(NodeInfo nodeInfo)
             throws RepositoryException
Called to end the import of a node. This method is called after a Importer.startNode(NodeInfo, List) call with the stame node information and after all the possible child nodes have been imported with respective startNode/endNode calls.

Just like XML elements, the startNode/endNode calls are guaranteed to be properly nested and complete.

Specified by:
endNode in interface Importer
Parameters:
nodeInfo - information about the node being imported
Throws:
RepositoryException - on a repository error

end

public void end()
         throws RepositoryException
Called once at the end of the content import.

Specified by:
end in interface Importer
Throws:
RepositoryException - on a repository error


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.