如何从内容引擎数据库中获取选择列表项?

时间:2013-10-24 06:56:45

标签: filenet-p8 filenet-content-engine

我有一些选择列表,我想从内容引擎数据库中导出它们的值,以便插入到另一个数据库中。

任何人都可以建议您进行查询吗?

1 个答案:

答案 0 :(得分:2)

FileNet 5.2.1。

    String s = "SELECT id, DisplayName from ChoiceList where DisplayName = 'YourChoiceListName'";
    SearchSQL searchSQL = new SearchSQL(s);

    SearchScope searchScope = new SearchScope(objectStore);
    RepositoryRowSet rowSet = searchScope.fetchRows(searchSQL, null, null, new Boolean(true));
    Iterator iter = rowSet.iterator();
    Id docId = null;
    RepositoryRow row = null ;

    while (iter.hasNext()) {
        row = (RepositoryRow) iter.next();
        docId = row.getProperties().get("Id").getIdValue();
        String DisplayName = row.getProperties().getStringValue("DisplayName");

        System.out.println(" Id=" + docId.toString());
        System.out.println(" DisplayName=" + DisplayName);

    }

    com.filenet.api.admin.ChoiceList list = Factory.ChoiceList.fetchInstance(objectStore,docId, null);
    com.filenet.api.collection.ChoiceList choicelist = null;
    choicelist = list.get_ChoiceValues();
    Iterator i = choicelist.iterator();
    while (i.hasNext() ) {
        com.filenet.apiimpl.core.ChoiceImpl choice = (ChoiceImpl) i.next();
        System.out.println(choice.get_DisplayName());
    }
相关问题