0

I have some choice lists and I want to export their values from content engine database to be inserted in another database.

Can anyone please advise about the query to do that?

abarisone
  • 3,707
  • 11
  • 35
  • 54
Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498

1 Answers1

3

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());
    }
mma
  • 126
  • 1
  • 2
  • 7