Package org.apache.jackrabbit.core.xml
Class SessionImporter
- java.lang.Object
-
- org.apache.jackrabbit.core.xml.SessionImporter
-
-
Constructor Summary
Constructors Constructor Description SessionImporter(NodeImpl importTargetNode, SessionImpl session, int uuidBehavior)Creates a newSessionImporterinstance.SessionImporter(NodeImpl importTargetNode, SessionImpl session, int uuidBehavior, ImportConfig config)Creates a newSessionImporterinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckPermission(NodeImpl parent, Name nodeName)make sure the editing session is allowed create nodes with a specified node type (and ev.protected NodeImplcreateNode(NodeImpl parent, Name nodeName, Name nodeTypeName, Name[] mixinNames, NodeId id)protected voidcreateProperty(NodeImpl node, PropInfo pInfo, QPropertyDefinition def)voidend()Called once at the end of the content import.voidendNode(NodeInfo nodeInfo)Called to end the import of a node.protected NodeImplresolveUUIDConflict(NodeImpl parent, NodeId conflictingId, 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
-
SessionImporter
public SessionImporter(NodeImpl importTargetNode, SessionImpl session, int uuidBehavior)
Creates a newSessionImporterinstance.- Parameters:
importTargetNode- the target nodesession- sessionuuidBehavior- any of the constants declared byImportUUIDBehavior
-
SessionImporter
public SessionImporter(NodeImpl importTargetNode, SessionImpl session, int uuidBehavior, ImportConfig config)
Creates a newSessionImporterinstance.- Parameters:
importTargetNode- the target nodesession- sessionuuidBehavior- the desired uuid behavior as defined byImportUUIDBehavior.config-
-
-
Method Detail
-
checkPermission
protected void checkPermission(NodeImpl parent, Name nodeName) throws RepositoryException
make sure the editing session is allowed create nodes with a specified node type (and ev. mixins),
NOTE: this check is not executed in a single place as the parent may change in case ofIMPORT_UUID_COLLISION_REPLACE_EXISTING.- Parameters:
parent- parent nodenodeName- the name- Throws:
RepositoryException- if an error occurs
-
createNode
protected NodeImpl createNode(NodeImpl parent, Name nodeName, Name nodeTypeName, Name[] mixinNames, NodeId id) throws RepositoryException
- Throws:
RepositoryException
-
createProperty
protected void createProperty(NodeImpl node, PropInfo pInfo, QPropertyDefinition def) throws RepositoryException
- Throws:
RepositoryException
-
resolveUUIDConflict
protected NodeImpl resolveUUIDConflict(NodeImpl parent, NodeId conflictingId, NodeInfo nodeInfo) 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
-
-