如何使用com.Filenet.wcm.api更改Filenet文档MimeType



我是FileNet的新手。我们正在使用P8内容引擎-5.1.0.2我需要使用Filenet WCM API更改现有文档的MimeType。Workuround是下载文档,更改MimeType并重新上传文档,但在这种情况下,文档集Id将被更改。我更喜欢更新现有文档,而不是重新上传文档。

基本上,我需要通过Filenet WCM API以编程方式更改内容元素MIME类型中描述的内容。

代码是

public boolean changeDocumnetMimeType(String documentId, String docMimeType) throws IOException {
com.filenet.wcm.api.TransportInputStream in1 = null;
com.filenet.wcm.api.ObjectStore docObjectStore;
com.filenet.wcm.api.Session session;
try {
session = ObjectFactory.getSession(this.applicationId, null, this.user,this.password);
session.setRemoteServerUrl(this.remoteServerUrl);
session.setRemoteServerUploadUrl(this.remoteServerUploadUrl);
session.setRemoteServerDownloadUrl(this.remoteServerDownloadUrl);
docObjectStore = ObjectFactory.getObjectStore(this.objectStoreName, session);
Document doc = (Document) docObjectStore.getObject(BaseObject.TYPE_DOCUMENT, documentId);
in1 = doc.getContent();
System.out.println("documnet MIME type is : " + in1.getMimeType());
//how to Update mimeType for the document???
} catch (Exception ex) {
ex.printStackTrace();
}
if (in1 != null) {
in1.close();
}
return true;
}

提前谢谢。

FileNet是一个EDMS系统,它以OOP的方式构建记录。

FileNet Document对象是从FileNet Document类实例化的。无论使用哪种API,FileNet都不允许在MimeType上进行更新。这是MimeType属性的约束。

IBM FileNet MimeType属性

上面的链接定义MimeType属性,并显示其限制:这里的关键点是:可设置性:SETTABLE_ONLY_BEFORE_CHECKKIN

这意味着MimeType属性只能在Versionable对象的RESERVATION状态期间设置。不可版本控制的对象(如Annotations(不能具有此约束。

最新更新