How to List Records in IBM Enterprise Records

import java.util.Iterator;

import com.filenet.rm.api.RMObjectStore;
import com.filenet.rm.api.util.RMUtil;
import com.filenet.wcm.api.BaseObject;
import com.filenet.wcm.api.BaseObjects;
import com.filenet.wcm.api.Document;
import com.filenet.wcm.api.ObjectFactory;
import com.filenet.wcm.api.ObjectStore;
import com.filenet.wcm.api.Session;

public final class ErSample {

  public static void main(final String[] args) {
    final Session sess = ObjectFactory.getSession("Sample", null, "user", "password");

    final ObjectStore os = ObjectFactory.getObjectStore("Sample", sess);

    final RMObjectStore rmos = RMUtil._getRMObjectStore(os);

    final BaseObjects coll = RMUtil._getQueriedObjects(rmos, "SELECT * FROM Record", BaseObject.TYPE_DOCUMENT, 10);
   
    final Iterator<?> it = coll.iterator();

    while (it.hasNext()) {
      final Document doc = (Document) it.next();

      ...
    }

  }

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s