我尝试在远程 Magnolia 存储库中制作一个文件作为主要版本。对于这个提议,我在 Eclipse EE IDE 上使用 java,来自 org.apache.chemistry.opencmis.* 的库和 REST 架构。我用于制作文档的代码如下:
Folder parent = rute.get(rute.size() - 1);
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
properties.put(PropertyIds.NAME, name);
// content
byte[] content = "".getBytes();
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = new ContentStreamImpl
(nombre, BigInteger.valueOf(content.length), "text/plain", stream);
// create a major version
try {
parent.createDocument(properties, contentStream, VersioningState.MAJOR);
} catch (CmisConstraintException e) {
e.printStackTrace();
}
它会抛出异常“cmis:document 不支持版本控制”。相同的代码但连接到 Alfresco 而不是 Magnolia 可以完美运行,所以我认为 Magnolia 配置有问题,但我找不到问题。有人可以帮助我吗?