我正在尝试做一个处理 Filenet Documents 的测试程序。我知道如何获取带有Object Id
或path
类似的文档实例,
doc = Factory.Document.fetchInstance(os,ID,null);
doc = Factory.Document.fetchInstance(os,path,null);
但我喜欢添加更多查找选项,以便我可以获取 Document with name 或 custom property 。我正在尝试这种搜索作为一种方法:
String mySQLString = "SELECT * FROM DEMO WHERE DocumentTitle LIKE '"+prp+"'";
SearchSQL sqlObject = new SearchSQL();
sqlObject.setQueryString(mySQLString);
// System.out.println(mySQLString);
SearchScope searchScope = new SearchScope(os);
RepositoryRowSet rowSet = searchScope.fetchRows(sqlObject, null, null, new Boolean(true));
Iterator ppg = rowSet.iterator();
if (ppg.hasNext()) {
RepositoryRow rr = (RepositoryRow) ppg.next();
System.err.println(rr.getProperties());
Properties properties = rr.getProperties();
String ID = properties.getStringValue("ID");
System.out.println(ID);
doc = Factory.Document.fetchInstance(os,ID,null);
但 ID 不是 Document 属性,它是 System 属性。我怎样才能得到文件?如何通过Search 获取path
orid
并获取此文档?有没有快速的方法?