1

我是一名学生,我是 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?

4

2 回答 2

0

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

于 2017-05-04T18:31:40.333 回答
-3

您可以使用以下路径访问文档的 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 字符串中拥有它。希望能帮助到你。

于 2014-09-29T13:32:47.487 回答