首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用filenet API在两台FILENET服务器之间下载和上传

使用filenet API在两台FILENET服务器之间下载和上传
EN

Stack Overflow用户
提问于 2015-02-20 21:52:40
回答 1查看 989关注 0票数 0

我有2台filenet服务器。我想从第一台服务器下载文档并上传到第二台server.Is中。可以使用FILENET API吗?

EN

回答 1

Stack Overflow用户

发布于 2015-02-23 21:42:01

这应该是可能的。如果我正确理解您的问题,应该是这样的:

代码语言:javascript
复制
    ObjectStore os1 = Factory.GetOSForSystem1();//create some function to get the object store for system one and for system two
    ObjectStore os2 = Factory.GetOSForSystem2();
    Document d = Factory.Document.fetchInstance(os1, "guid", null);//fetch the document from the first system

    Document newDoc = Factory.Document.createInstance(os2, "Document");//create the document in the second system
    //create contentlist for reservation object
    ContentElementList cteList = Factory.ContentElement.createList();

    //Create content transfer object and get the content from the current version
    ContentTransfer ctNew = Factory.ContentTransfer.createInstance();
    ContentTransfer ct = (ContentTransfer) d.get_ContentElements().get(0);
    //get the content as a contentstream to prevent reuse and read only error.
    ctNew.setCaptureSource(ct.accessContentStream());
    ctNew.set_RetrievalName(ct.get_RetrievalName());
    //add the new content to the list and add the list to the reservation
    cteList.add(ctNew); 
    newDoc.set_ContentElements(cteList);
    newDoc.save(RefreshMode.NO_REFRESH);//if you do not need the document after the save say no refresh, saves system resources
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28630599

复制
相关文章

相似问题

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