我有一个probleme与openCmis与Alfresco在Java.I尝试添加一个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。
作为参考,在模型Alfresco中,我有这个。
<aspect name="abc:aspectCustom">
<title>ABCAspect</title>
</aspect>
Thnakk you:)
首先,确保你使用的是CMIS 1.1的服务URL,也就是 https:/localhost:8080alfrescoapi-default-publiccmisversions1.1atom。 的ATOMPub结合和 https:/localhost:8080alfrescoapi-default-publiccmisversions1.1browser。 的浏览器绑定。
接下来,尝试添加一个开箱即用的方面,比如 P:cm:geographic,而不是你的自定义方面,只是为了确保它的工作。这将排除你的自定义内容模型的任何问题。