On 09.07.2009 00:19 Harri T. wrote:
Can I merge two repositories by running two different JCRs and
implementing a Java application for merge operation?
I'm trying to implement a utility for accessing two different Jackrabbit
repositories for merging nodes from one repository to another. The both
repositories are created by Liferay Portal 4.3.4 and as far as I
understand, the Jackrabbit version is 1.3.1.
I installed the 1.3.1. web app, configured it to used one of the Liferay
Jackrabbit repository snapshots and wrote a short program for utilizing it:
public static void main(String[] args) throws Exception {
ClientRepositoryFactory factory = new ClientRepositoryFactory();
Repository repository = factory.getRepository(
"rmi://localhost:1099/jackrabbit.repository");
Session session = repository.login();
traverseNodes(session.getRootNode());
}
private static void traverseNodes(Node node) throws Exception {
System.out.println(node.getPath());
NodeIterator children = node.getNodes();
while (children.hasNext()) {
traverseNodes(children.nextNode());
}
}
However, I can't find no file items from the repository. See the output
below. What is wrong with the program?
-Harri
/
/jcr:system
/jcr:system/jcr:versionStorage
/jcr:system/jcr:nodeTypes
/jcr:system/jcr:nodeTypes/rep:nodeTypes
/jcr:system/jcr:nodeTypes/rep:nodeTypes/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/mix:versionable
/jcr:system/jcr:nodeTypes/mix:versionable/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/mix:versionable/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/mix:versionable/jcr:propertyDefinition[3]
/jcr:system/jcr:nodeTypes/mix:versionable/jcr:propertyDefinition[4]
/jcr:system/jcr:nodeTypes/mix:versionable/jcr:propertyDefinition[5]
/jcr:system/jcr:nodeTypes/nt:file
/jcr:system/jcr:nodeTypes/nt:file/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/nt:hierarchyNode
/jcr:system/jcr:nodeTypes/nt:hierarchyNode/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:versionedChild
/jcr:system/jcr:nodeTypes/nt:versionedChild/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:version
/jcr:system/jcr:nodeTypes/nt:version/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:version/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:version/jcr:propertyDefinition[3]
/jcr:system/jcr:nodeTypes/nt:version/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/nt:versionLabels
/jcr:system/jcr:nodeTypes/nt:versionLabels/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:folder
/jcr:system/jcr:nodeTypes/nt:folder/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/rep:versionStorage
/jcr:system/jcr:nodeTypes/rep:versionStorage/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/rep:versionStorage/jcr:childNodeDefinition[2]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[3]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[4]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[5]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[6]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[7]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[8]
/jcr:system/jcr:nodeTypes/nt:propertyDefinition/jcr:propertyDefinition[9]
/jcr:system/jcr:nodeTypes/nt:nodeType
/jcr:system/jcr:nodeTypes/nt:nodeType/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:nodeType/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:nodeType/jcr:propertyDefinition[3]
/jcr:system/jcr:nodeTypes/nt:nodeType/jcr:propertyDefinition[4]
/jcr:system/jcr:nodeTypes/nt:nodeType/jcr:propertyDefinition[5]
/jcr:system/jcr:nodeTypes/nt:nodeType/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/nt:nodeType/jcr:childNodeDefinition[2]
/jcr:system/jcr:nodeTypes/nt:base
/jcr:system/jcr:nodeTypes/nt:base/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:base/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition[3]
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition[4]
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition[5]
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition[6]
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition[7]
/jcr:system/jcr:nodeTypes/nt:childNodeDefinition/jcr:propertyDefinition[8]
/jcr:system/jcr:nodeTypes/nt:resource
/jcr:system/jcr:nodeTypes/nt:resource/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:resource/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:resource/jcr:propertyDefinition[3]
/jcr:system/jcr:nodeTypes/nt:resource/jcr:propertyDefinition[4]
/jcr:system/jcr:nodeTypes/mix:referenceable
/jcr:system/jcr:nodeTypes/mix:referenceable/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:versionHistory
/jcr:system/jcr:nodeTypes/nt:versionHistory/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:versionHistory/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/nt:versionHistory/jcr:childNodeDefinition[2]
/jcr:system/jcr:nodeTypes/nt:versionHistory/jcr:childNodeDefinition[3]
/jcr:system/jcr:nodeTypes/nt:unstructured
/jcr:system/jcr:nodeTypes/nt:unstructured/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:unstructured/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:unstructured/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/mix:lockable
/jcr:system/jcr:nodeTypes/mix:lockable/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/mix:lockable/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:frozenNode
/jcr:system/jcr:nodeTypes/nt:frozenNode/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:frozenNode/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:frozenNode/jcr:propertyDefinition[3]
/jcr:system/jcr:nodeTypes/nt:frozenNode/jcr:propertyDefinition[4]
/jcr:system/jcr:nodeTypes/nt:frozenNode/jcr:propertyDefinition[5]
/jcr:system/jcr:nodeTypes/nt:frozenNode/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/rep:system
/jcr:system/jcr:nodeTypes/rep:system/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/rep:system/jcr:childNodeDefinition[2]
/jcr:system/jcr:nodeTypes/rep:system/jcr:childNodeDefinition[3]
/jcr:system/jcr:nodeTypes/rep:root
/jcr:system/jcr:nodeTypes/rep:root/jcr:childNodeDefinition
/jcr:system/jcr:nodeTypes/nt:query
/jcr:system/jcr:nodeTypes/nt:query/jcr:propertyDefinition
/jcr:system/jcr:nodeTypes/nt:query/jcr:propertyDefinition[2]
/jcr:system/jcr:nodeTypes/nt:linkedFile
/jcr:system/jcr:nodeTypes/nt:linkedFile/jcr:propertyDefinition