Package org.apache.jackrabbit.core.xml
Class WorkspaceImporter
- java.lang.Object
-
- org.apache.jackrabbit.core.xml.WorkspaceImporter
-
-
Constructor Summary
Constructors Constructor Description WorkspaceImporter(Path parentPath, WorkspaceImpl wsp, SessionContext sessionContext, int uuidBehavior)Creates a newWorkspaceImporterinstance.WorkspaceImporter(Path parentPath, WorkspaceImpl wsp, SessionContext sessionContext, int uuidBehavior, ImportConfig config)Creates a newWorkspaceImporterinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend()Called once at the end of the content import.voidendNode(NodeInfo nodeInfo)Called to end the import of a node.protected voidpostProcessNode(NodeState node)Post-process imported node (initialize properties with special semantics etc.)protected voidprocessProperty(NodeState node, PropInfo pInfo)protected NodeStateresolveUUIDConflict(NodeState parent, NodeState conflicting, NodeInfo nodeInfo)voidstart()Called once at the beginning of the content import.voidstartNode(NodeInfo nodeInfo, List<PropInfo> propInfos)Called to start the import of a node.
-
-
-
Constructor Detail
-
WorkspaceImporter
public WorkspaceImporter(Path parentPath, WorkspaceImpl wsp, SessionContext sessionContext, int uuidBehavior) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
Creates a newWorkspaceImporterinstance.- Parameters:
parentPath- target path where to add the imported subtreewsp- the workspace to operate onsessionContext- the session contextuuidBehavior- flag that governs how incoming UUIDs are handled- Throws:
PathNotFoundException- if no node exists atparentPathor if the current session is not granted read access.ConstraintViolationException- if the node atparentPathis protectedVersionException- if the node atparentPathis not checked-outLockException- if a lock prevents the addition of the subtreeRepositoryException- 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 newWorkspaceImporterinstance.- Parameters:
parentPath- target path where to add the imported subtreewsp- the workspace to operate onsessionContext- the session contextuuidBehavior- flag that governs how incoming UUIDs are handledconfig- import configuration.- Throws:
PathNotFoundException- if no node exists atparentPathor if the current session is not granted read access.ConstraintViolationException- if the node atparentPathis protectedVersionException- if the node atparentPathis not checked-outLockException- if a lock prevents the addition of the subtreeRepositoryException- if another error occurs
-
-
Method Detail
-
resolveUUIDConflict
protected NodeState resolveUUIDConflict(NodeState parent, NodeState conflicting, NodeInfo nodeInfo) throws RepositoryException
- Parameters:
parent- parent node stateconflicting- conflicting node statenodeInfo- 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 RepositoryExceptionCalled once at the beginning of the content import.- Specified by:
startin interfaceImporter- 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 aImporter.endNode(NodeInfo)call is made with the same node information.- Specified by:
startNodein interfaceImporter- Parameters:
nodeInfo- information about the node being importedpropInfos- information about the properties being imported (list ofPropInfoinstances)- 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 aImporter.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:
endNodein interfaceImporter- Parameters:
nodeInfo- information about the node being imported- Throws:
RepositoryException- on a repository error
-
end
public void end() throws RepositoryExceptionCalled once at the end of the content import.- Specified by:
endin interfaceImporter- Throws:
RepositoryException- on a repository error
-
-