【发布时间】:2020-03-30 15:41:12
【问题描述】:
我在使用 Java 中的 Alfresco 时遇到了 openCmis 的问题。 我尝试在我的文档中添加一个secondaryType“abc:aspectCustom”,就像我们在这段代码中看到的那样:
props.put(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_DOCUMENT.value());
props.put(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, Arrays.asList("P:abc:aspectCustom"));
ContentStream contentStream = session.getObjectFactory().createContentStream(documentName, sizeFolder, typeFile, inputStream);
Document document = targetFolder.createDocument(props, contentStream, VersioningState.CHECKEDOUT);
但我有这个错误:
java.lang.IllegalArgumentException: Secondary types property contains a type that is not a secondary type: P:abc:aspectCustom
所以我尝试调试,我发现我的问题来自这部分代码(ObjectFactoryImpl):
if (!(secondaryType instanceof SecondaryType)) {
throw new IllegalArgumentException(
"Secondary types property contains a type that is not a secondary type: " + secondaryTypeId);
}
当我调试 secondaryType 对象时,我发现他是 PolicyType 的实例 而不是 SecondaryType。 所以我现在不知道问题在哪里!为什么我在模型中的方面被解释为 Policy 而不是 SecondaryType。
有关信息,在模型 Alfresco 中我有这个:
<aspect name="abc:aspectCustom">
<title>ABCAspect</title>
</aspect>
谢谢你:)
【问题讨论】: