DFS-Query Service-returns only 100 records ??
Options
Hi Guys,
I am running DFS 6.5Sp1 sample code and trying to develop new service that will be based on DFS.
When I ran consumer class TQueryServiceTest with chaned query as "select r_object_id, object_name from dm_document where folder('/root',descend)" it returns on 100 records.
but when I ran same query into DA it return 1000s records. please help me how I can get all records(as many) using this Query Service of DFS.
sample class is
package com.emc.documentum.fs.doc.test.client;import java.util.List;import com.emc.documentum.fs.datamodel.core.CacheStrategyType;import com.emc.documentum.fs.datamodel.core.DataObject;import com.emc.documentum.fs.datamodel.core.DataPackage;import com.emc.documentum.fs.datamodel.core.OperationOptions;import com.emc.documentum.fs.datamodel.core.context.RepositoryIdentity;import com.emc.documentum.fs.datamodel.core.properties.PropertySet;import com.emc.documentum.fs.datamodel.core.query.PassthroughQuery;import com.emc.documentum.fs.datamodel.core.query.QueryExecution;import com.emc.documentum.fs.datamodel.core.query.QueryResult;import com.emc.documentum.fs.rt.ServiceException;import com.emc.documentum.fs.rt.context.ContextFactory;import com.emc.documentum.fs.rt.context.IServiceContext;import com.emc.documentum.fs.rt.context.ServiceFactory;import com.emc.documentum.fs.services.core.client.IQueryService;
/public class TQueryServiceTest{/************************************************************* You must supply valid values for the following fields: */
/* The repository that you want to run the query on */private String repository = "xxxx";
/* The username to login to the repository */private String userName = "xxxx";
/* The password for the username */private String password = "****";
/* The address where the DFS services are located */private String host = "http://xx.xx.xx.xx:9080/services";/***********************************************************//* The module name for the DFS core services */private static String moduleName = "core";private IServiceContext serviceContext;public TQueryServiceTest(){}
public void setContext(){/** Get the service context and set the user* credentials and repository information*/ContextFactory contextFactory = ContextFactory.getInstance();serviceContext = contextFactory.newContext();RepositoryIdentity repoId = new RepositoryIdentity();repoId.setRepositoryName(repository);repoId.setUserName(userName);repoId.setPassword(password);serviceContext.addIdentity(repoId);}/** Demonstrates a typical scenario for calling the query service.* Gets an instance of the Query service and calls the execute operation* with a hard-coded query and operation options.*/public void callQueryService(){/** Get an instance of the QueryService by passing* in the service context to the service factory.*/try{ServiceFactory serviceFactory = ServiceFactory.getInstance();IQueryService querySvc =serviceFactory.getRemoteService(IQueryService.class, serviceContext,moduleName, host);
/** Construct the query and the QueryExecution options*/PassthroughQuery query = new PassthroughQuery();//query.setQueryString("select r_object_id, "// + "object_name from dm_cabinet");
query.setQueryString("select r_object_id, "+ "object_name from dm_document where folder("+"'/root',descend"+")");query.addRepository(repository);QueryExecution queryEx = new QueryExecution();queryEx.setCacheStrategyType(CacheStrategyType.DEFAULT_CACHE_STRATEGY);/** Execute the query passing in the operation options and print the result*/OperationOptions operationOptions = null;QueryResult queryResult = querySvc.execute(query, queryEx, operationOptions);System.out.println("QueryId == " + query.getQueryString());System.out.println("CacheStrategyType == " + queryEx.getCacheStrategyType());DataPackage resultDp = queryResult.getDataPackage();List<DataObject> dataObjects = resultDp.getDataObjects();int numberOfObjects = dataObjects.size();System.out.println("Total objects returned is: " + numberOfObjects);for (DataObject dObj : dataObjects){PropertySet docProperties = dObj.getProperties();String objectId = dObj.getIdentity().getValueAsString();String docName = docProperties.get("object_name").getValueAsString();System.out.println("Document " + objectId + " name is " + docName);}}catch (ServiceException e){e.printStackTrace();}}
public static void main(String[] args) {TQueryServiceTest t = new TQueryServiceTest();t.setContext();t.callQueryService();}
}RegardsGovind
0
Answers
-
I got the idea......closing the thread
old
intint maxResults = 60;int maxResultsPerSource =20;newintint maxResults = 1000;int maxResultsPerSource =1000; startingIndex = 0; startingIndex = 0;0 -
Hi Govind6may,
We are also facing the similar kindly of issue. Can you let us know how to resolve this issue.
Thanks in advance!
0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 122 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management