【问题标题】:Fetch FileStorageArea in Filenet with path [Document Moving]使用路径 [文档移动] 在 Filenet 中获取 FileStorageArea
【发布时间】:2017-05-05 02:31:40
【问题描述】:

我是一名学生,我是 Filenet 的新手。我正在尝试对文件移动进行测试代码。

Document doc = Factory.Document.getInstance(os, ClassNames.DOCUMENT, new Id("{33074B6E-FD19-4C0D-96FC-D809633D35BF}") );
FileStorageArea newDocClassFSA = Factory.FileStorageArea.fetchInstance(os, new Id("{3C6CEE68-D8CC-44A5-AEE7-CADE9752AA77}"), null );

doc.moveContent(dsa);
doc.save(RefreshMode.REFRESH);

问题是我可以像这样通过它的路径获取文档,

doc = Factory.Document.fetchInstance(os, "/DEMO/MASTERFILE/ZONE-X/Org.No-XXXXX/XXXX-X-XXXX-X.TIF",null);

但我无法通过路径获取 StorageArea,它只需要 ID。有没有比这更容易移动文件的方法?如何在不使用查询的情况下获取带路径的 ID?

【问题讨论】:

    标签: java filenet-p8 filenet filenet-content-engine


    【解决方案1】:

    除了发出查询并按RootDirectoryPath 属性过滤之外,没有其他方法可以通过其路径获取FileStorageArea

    【讨论】:

      【解决方案2】:

      您可以使用路径访问文档的ID:

              //Get ID of the Document 
              StringBuffer propertyNames = new StringBuffer();
              propertyNames.append(PropertyNames.ID);
              propertyNames.append(" ");
              propertyNames.append(PropertyNames.PATH_NAME);
      
              PropertyFilter pf=new  PropertyFilter();
      
              FilterElement felement= new FilterElement(Integer.valueOf(0),Long.valueOf(0),Boolean.TRUE,propertyNames.toString(),Integer.valueOf(0));
              pf.addIncludeProperty(felement);
      
              Document document = Factory.Document.fetchInstance(os, ruta, pf );
      
              idDocument = document.get_Id().toString();
      

      并且在 idDocument 字符串中你有它。希望对您有所帮助。

      【讨论】:

      • 好答案。有趣的是要了解为什么无法通过路径获取...
      • @abarisone 这个答案没有意义。对象的 ID 始终存在,但对象被获取;那些使用 PropertyFilter 进行的操作是无用的。并不是说它没有以任何方式解决这个问题。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多