首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用MimeType更改Filenet文档com.filenet.wcm.api

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

Stack Overflow用户
提问于 2018-11-08 17:05:31
回答 1查看 1K关注 0票数 1

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

基本上,我需要通过Filenet以编程方式执行更改内容元素MIME类型中描述的相同的事情。

代码是

代码语言:javascript
复制
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;
}

提前谢谢你。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-08 19:31:31

FileNet是一个EDMS系统,它以面向对象的方式构造它的记录。

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

IBM FileNet MimeType属性

上面的链接定义了MimeType属性,并显示了它的禁忌:这里的关键点是:设置性: SETTABLE_ONLY_BEFORE_CHECKIN

这意味着只能在可验证对象的保留状态期间设置MimeType属性。不可验证的对象(如注释)不能具有此约束。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53212756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档