在OpenCMIS中是否可以建立父子关系?

时间:2015-01-13 11:54:43

标签: java alfresco opencmis

我需要在父子等文档之间建立关系。 OpenCMIS 提供直接的方法吗? “关系”的实际用途是什么?

以下是关系的示例代码。如何获取这些关系文档(我的意思是提供父文档,列出所有子文档)。

newFolderProps = new HashMap<String, String>();
newFolderProps.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
newFolderProps.put(PropertyIds.NAME, "ADGFolderAssociations");
Folder folderAssociations = target.createFolder(newFolderProps);

newFileProps = new HashMap<String, String>();
newFileProps.put(PropertyIds.OBJECT_TYPE_ID,
        "D:cmiscustom:document");
newFileProps.put(PropertyIds.NAME, "ADGFileSource");
Document sourceDoc = folderAssociations.createDocument(
        newFileProps, null, VersioningState.MAJOR);

newFileProps.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
newFileProps.put(PropertyIds.NAME, "ADGFileTarget");
Document targetDoc = folderAssociations.createDocument(
        newFileProps, null, VersioningState.MAJOR);

Map<String, String> relProps = new HashMap<String, String>();
relProps.put("cmis:sourceId", sourceDoc.getId());
relProps.put("cmis:targetId", targetDoc.getId());
relProps.put("cmis:objectTypeId", "R:cmiscustom:assoc");
ObjectId relId = session.createRelationship(relProps, null,
        null, null);

有没有其他方法可以使用OpenCMIS在Alfresco实现亲子关系?

0 个答案:

没有答案