コード例 #1
0
 List<Record> getRandomFolders(int qty, int counter) {
   MetadataSchema folderSchema =
       getMetadataSchemasManager().getSchemaTypes(COLLECTION).getSchema("folder_default");
   Metadata categoryMetadata = folderSchema.getMetadata(Folder.CATEGORY_ENTERED);
   SearchServices searchServices = getSearchServices();
   String categoryId = level1And2CategoryIds.get(counter % level1And2CategoryIds.size());
   LogicalSearchCondition condition =
       from(folderSchema).where(categoryMetadata).isEqualTo(categoryId);
   LogicalSearchQuery query = new LogicalSearchQuery(condition);
   query.setNumberOfRows(qty);
   return searchServices.search(query);
 }
コード例 #2
0
 void doSearch(HttpServletRequest request, HttpServletResponse response, int serviceCall)
     throws ServletException, IOException {
   int qty = getRequiredIntegerParameter(request, QUANTITY_PARAMETER);
   MetadataSchema folderSchema =
       getMetadataSchemasManager().getSchemaTypes(COLLECTION).getSchema("folder_default");
   Metadata categoryMetadata = folderSchema.getMetadata("category");
   SearchServices searchServices = getSearchServices();
   String categoryId = level1And2CategoryIds.get(serviceCall % level1And2CategoryIds.size());
   LogicalSearchCondition condition =
       from(folderSchema).where(categoryMetadata).isEqualTo(categoryId);
   LogicalSearchQuery query = new LogicalSearchQuery(condition);
   query.setReturnedMetadatas(ReturnedMetadatasFilter.idVersionSchemaTitle());
   query.setNumberOfRows(qty);
   searchServices.search(query);
 }