嗨,提前感谢您的帮助
我在露天插入和更新文档时遇到问题,因此当我设置“cmis:creationDate 或 cmis:lastModificationDate”之类的属性时,文档已成功创建,但具有 Updatability=ReadOnly 的属性未设置为新值鉴于它是由 alfresco 自动设置的。是否有任何解决方案可以将这些属性的可更新性设置为“ReadWrite”?我正在使用 Aalfresco 5.0 和 openCmis 0.13 这是我的代码:
public void createDocument(Folder folder) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date d = sdf.parse("21/12/2012");
String name = "myNewDocument.txt";
Map<String, Object> properties = new HashMap<String, Object>();
Calendar cal = new GregorianCalendar();
cal.setTime(d);
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled,P:cm:author");
properties.put(PropertyIds.NAME, name);
properties.put(PropertyIds.CREATION_DATE, cal);
properties.put(PropertyIds.LAST_MODIFICATION_DATE, cal);
properties.put("cm:title", "Title");
properties.put("cm:description", "Description");
properties.put("cm:author", "author");
properties.put("cmis:creationDate ", cal);
byte[] content = "Hello World!".getBytes();
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(content.length), "text/plain", stream);
Document newDoc = folder.createDocument(properties, contentStream, VersioningState.MAJOR);
}