OpenCmis in-memory을 테스트 용으로 사용합니다. 그러나 문서를 만들 때 versioningState를 다른 것으로 설정 한 다음 versioningState.NONE을 설정할 수 없습니다.작성된 문서는 버전이 없습니다.
public void test() {
String filename = "test123";
Folder folder = this.session.getRootFolder();
// Create a doc
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
properties.put(PropertyIds.NAME, filename);
String docText = "This is a sample document";
byte[] content = docText.getBytes();
InputStream stream = new ByteArrayInputStream(content);
ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, Long.valueOf(content.length), "text/plain", stream);
Document doc = folder.createDocument(
properties,
contentStream,
VersioningState.MAJOR);
}
내가 얻을 예외 :
org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException: The versioning state flag is imcompatible to the type definition.
무엇 오전
몇 가지 방법을 버전 관리가되지 않고 생성 된 문서는 ... 나는 http://chemistry.apache.org/java/examples/example-create-update.html
시험 방법의 코드를 사용 내가 빠졌어? 버전 관리를 허용하지 않는 : 나는 OBJECT_TYPE_ID '문서 CMIS가'발견 다음 코드를 실행함으로써
나는 이유를 발견