当前运行的存储库将旧文件移动到存档存储库。
能够复制文档节点。问题在于版本节点副本。
尝试迭代,不太确定如何复制版本的所有属性:
VersionManager versionManager1 =
oldChildNode.getSession().getWorkspace().getVersionManager();
versionManager1.checkout(oldChildNode.getPath());
VersionHistory versionHistory1 = versionManager1.getVersionHistory(oldChildNode.getPath());
VersionIterator versions = versionHistory1.getAllVersions();
while (versions.hasNext()) {
try {
Version versionedNode = versions.nextVersion();
NodeIterator nodeIterator = versionedNode.getNodes();
System.out.println(" Version is :: " + versionedNode.getName());
while (nodeIterator.hasNext()) {
Node currentNode = nodeIterator.nextNode();
System.out.println(" JCR Title :: " + currentNode.getName());
}
}catch(UnsupportedRepositoryOperationException jcrexce){
logger.info("Exception while accessing versioned nodes >> ");
jcrexce.printStackTrace();
} catch(PathNotFoundException pexec){
pexec.printStackTrace();
}
}
文档节点 --> nt:resource 添加
Structure:
/**
* Document node
*/
[et:document] > nt:file, mix:title, mix:versionable, mix:shareable
+ * (nt:file) VERSION
- et:tags multiple
- et:role multiple
- et:docUserList multiple
- et:id (LONG)
- et:favourites (BOOLEAN)
- et:lastAccessed (STRING)
- et:lastAccessedOn (DATE)
- et:documentSize (LONG)
- et:fileOwnerName (STRING)
- et:fileOwnerId (STRING)
- * (undefined)
有关如何移动版本化节点(从存储库到另一个存储库而不是工作区副本)的任何指示?
使用 Jackrabbit 2.8.0 在 Java 1.6 上运行