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

-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 に答える