Tabnine Logo
QueryResult
Code IndexAdd Tabnine to your IDE (free)

How to use
QueryResult
in
org.apache.chemistry.opencmis.client.api

Best Java code snippets using org.apache.chemistry.opencmis.client.api.QueryResult (Showing top 19 results out of 315)

origin: jpotts/alfresco-api-java-examples

public void doQuery(String cql, int maxItems) {
  Session cmisSession = getCmisSession();
  OperationContext oc = new OperationContextImpl();
  oc.setMaxItemsPerPage(maxItems);
  ItemIterable<QueryResult> results = cmisSession.query(cql, false, oc);
  for (QueryResult result : results) {
    for (PropertyData<?> prop : result.getProperties()) {
      System.out.println(prop.getQueryName() + ": " + prop.getFirstValue());
    }
    System.out.println("--------------------------------------");
  }
  System.out.println("--------------------------------------");
  System.out.println("Total number: " + results.getTotalNumItems());
  System.out.println("Has more: " + results.getHasMoreItems());
  System.out.println("--------------------------------------");
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

private void doQuery(Session session, String stmt) {
  for (QueryResult qr : session.query(stmt, false)) {
    qr.getPropertyByQueryName("cmis:name");
  }
}
origin: deas/alfresco

properties.put(PropertyIds.OBJECT_ID, (String) result.getPropertyValueById(PropertyIds.OBJECT_ID));
properties.put(PropertyIds.NAME, (String) result.getPropertyValueById(PropertyIds.NAME));
properties.put(Section.PROPERTY_TITLE, (String) result.getPropertyValueById(Section.PROPERTY_TITLE));
properties.put(Section.PROPERTY_DESCRIPTION, 
    (String) result.getPropertyValueById(Section.PROPERTY_DESCRIPTION));
properties.put(Section.PROPERTY_EXCLUDE_FROM_NAV, 
    (Boolean) result.getPropertyValueById(Section.PROPERTY_EXCLUDE_FROM_NAV));
List<String> configList = result.getPropertyMultivalueById(Section.PROPERTY_SECTION_CONFIG);
properties.put(Section.PROPERTY_SECTION_CONFIG, (Serializable) configList);
List<String> tagSummary = result.getPropertyMultivalueById(PROPERTY_TAG_SUMMARY);
section.setTags(createTags(tagSummary));
section.setSectionFactory(this);
sectionDetails.objectTypeId = (String) result.getPropertyValueById(PropertyIds.OBJECT_TYPE_ID);
  String parentId = (String) result.getPropertyValueById(PropertyIds.PARENT_ID);
  section.setPrimarySectionId(parentId);
origin: deas/alfresco

Map<String, Serializable> properties = new TreeMap<String, Serializable>();
properties.put(PropertyIds.OBJECT_ID, (String) result.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue());
properties.put(PropertyIds.OBJECT_TYPE_ID, (Serializable) result.getPropertyById(PropertyIds.OBJECT_TYPE_ID)
    .getFirstValue());
properties.put(PropertyIds.NAME, (Serializable) result.getPropertyById(PropertyIds.NAME).getFirstValue());
properties.put(PropertyIds.CONTENT_STREAM_LENGTH, (Serializable) result.getPropertyById(
    PropertyIds.CONTENT_STREAM_LENGTH).getFirstValue());
properties.put(PropertyIds.CONTENT_STREAM_MIME_TYPE, (Serializable) result.getPropertyById(
    PropertyIds.CONTENT_STREAM_MIME_TYPE).getFirstValue());
properties.put(Resource.PROPERTY_TITLE, (Serializable) result.getPropertyById(Resource.PROPERTY_TITLE)
    .getFirstValue());
properties.put(Resource.PROPERTY_MODIFIED_TIME, SqlUtils.getDateProperty(result,
    Resource.PROPERTY_MODIFIED_TIME));
properties.put(Resource.PROPERTY_DESCRIPTION, (Serializable) result.getPropertyById(
    Resource.PROPERTY_DESCRIPTION).getFirstValue());
properties.put(Asset.PROPERTY_AVERAGE_RATING, (Serializable) result.getPropertyById(
    Asset.PROPERTY_AVERAGE_RATING).getFirstValue());
properties.put(Asset.PROPERTY_COMMENT_COUNT, (Serializable) result
    .getPropertyById(Asset.PROPERTY_COMMENT_COUNT).getFirstValue());
properties.put(Asset.PROPERTY_TAGS, (Serializable) result.getPropertyMultivalueById(Asset.PROPERTY_TAGS));
properties.put(Asset.PROPERTY_PUBLISHED_TIME, SqlUtils.getDateProperty(result, Asset.PROPERTY_PUBLISHED_TIME));
properties.put(Asset.PROPERTY_AUTHOR, (Serializable) result.getPropertyById(Asset.PROPERTY_AUTHOR)
    .getFirstValue());
List<String> parentSectionIds = result.getPropertyMultivalueById(Asset.PROPERTY_PARENT_SECTIONS);
if (parentSectionIds == null || parentSectionIds.isEmpty())
origin: deas/alfresco

.getPropertyValueByQueryName("SEARCH_SCORE")).scaleByPowerOfTen(2).intValue()));
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

if (qr.getProperties().isEmpty()) {
  addResult(results, createResult(FAILURE, "Query result is empty!"));
} else {
    PropertyData<?> pd = qr.getPropertyByQueryName(propDef.getQueryName());
origin: deas/alfresco

private VisitorFeedbackImpl buildFeedbackObject(QueryResult queryResult)
{
  BigInteger rating = (BigInteger) queryResult.getPropertyValueById(PROP_RATING);
  VisitorFeedbackImpl feedback = buildFeedbackObject(
      (String) queryResult.getPropertyValueById(PROP_ARTICLE), 
      (String) queryResult.getPropertyValueById(PROP_NAME),
      (String) queryResult.getPropertyValueById(PROP_EMAIL), 
      (String) queryResult.getPropertyValueById(PROP_WEBSITE), 
      (String) queryResult.getPropertyValueById(PROP_FEEDBACK_TYPE), 
      (String) queryResult.getPropertyValueById(PROP_SUBJECT), 
      (String) queryResult.getPropertyValueById(PROP_COMMENT), 
      (Boolean) queryResult.getPropertyValueById(PROP_COMMENT_FLAGGED), 
      rating == null ? null : rating.intValue());
  
  feedback.setId((String) queryResult.getPropertyValueById(PropertyIds.OBJECT_ID));
  feedback.setPostTime(((Calendar) queryResult.getPropertyValueById(PropertyIds.CREATION_DATE)).getTime());
  return feedback;
}
origin: deas/alfresco

  /**
   * Open CMIS returns dates as a Calendar but freemarker cannot
   * cope with these so convert them to a Date.
   * @param result Queryresult from CMIS
   * @param propertyId property name
   * @return Date 
   */
  public static Date getDateProperty(QueryResult result, String propertyId)
  {
    PropertyData<Object> property = result.getPropertyById(propertyId);
    if (property == null) return null;
    Calendar calendar = (Calendar)property.getFirstValue();
    return calendar != null ? calendar.getTime() : null;
  }
}
origin: deas/alfresco

/**
 * Build a list of related target node ids for the collection
 * @param result
 * @return List<String> list of related resource ids
 */
private List<String> buildRelatedAssetList(QueryResult result)
{
  List<String> relatedIds = new ArrayList<String>();
  List<Relationship> relationships = result.getRelationships();
  for (Relationship relationship : relationships)
  {
    String name = relationship.getPropertyValue(PropertyIds.NAME);
    String targetId = relationship.getPropertyValue(PropertyIds.TARGET_ID);
    log.debug(name+" "+targetId);
    relatedIds.add(targetId);
  }
  return relatedIds;
}
 
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

ItemIterable<QueryResult> results = statement.query(false);
for (QueryResult qr : results) {
  String folderId = qr.getPropertyValueByQueryName("folderId");
    String folderName = qr.getPropertyValueByQueryName("folderName");
origin: jbarrez/Activiti-KickStart

kickstartWorkflowInfo.setName((String) result.getPropertyValueById("cm:description"));
kickstartWorkflowInfo.setId(processNameToBaseName((String) result.getPropertyValueById(PropertyIds.NAME)));  
GregorianCalendar createDate = result.getPropertyValueById(PropertyIds.CREATION_DATE); 
kickstartWorkflowInfo.setCreateTime(createDate.getTime()) ;
workflowInfos.add(kickstartWorkflowInfo);
origin: deas/alfresco

@Override
public Map<String, Date> getModifiedTimesOfAssets(Collection<String> assetIds)
{
  Map<String, Date> map = new TreeMap<String, Date>();
  String idList = buildIdList(assetIds);
  String cmisQuery = MessageFormat.format(modifiedTimesByAssetIds, idList);
  ItemIterable<QueryResult> results = runQuery(cmisQuery);
  Iterator<QueryResult> iterator = results.iterator();
  Date modifiedTime;
  String id;
  while (iterator.hasNext())
  {
    QueryResult result = iterator.next();
    modifiedTime = SqlUtils.getDateProperty(result, Resource.PROPERTY_MODIFIED_TIME);
    id = (String) result.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue();
    map.put(id, modifiedTime);
  }
  return map;
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

count++;
String objectId = qr.getPropertyValueByQueryName("cmis:objectId");
origin: deas/alfresco

String id = result.getPropertyValueById(PropertyIds.OBJECT_ID);
String hostName = result.getPropertyValueById(WebSite.PROP_HOSTNAME);
BigInteger hostPort = result.getPropertyValueById(WebSite.PROP_HOSTPORT);
String context = result.getPropertyValueById(WebSite.PROP_CONTEXT);
if (context == null)
String title = result.getPropertyValueById(Asset.PROPERTY_TITLE);
String description = result.getPropertyValueById(Asset.PROPERTY_DESCRIPTION);
List<String> configList = result.getPropertyMultivalueById(WebSite.PROP_SITE_CONFIG);
Map<String,String> configProperties = parseSiteConfig(configList);
origin: net.aequologica.neo/geppaequo-cmis

  log.debug("{} \nobjectTypeId={}\nname={}\ncreatedBy={}\nobjectId={}\ncontentStreamFileName={}\ncontentStreamMimeType={}\ncontentStreamLengt={}",
    i++,
    qr.getPropertyByQueryName("cmis:objectTypeId").getFirstValue(),
    qr.getPropertyByQueryName("cmis:name").getFirstValue(),
    qr.getPropertyByQueryName("cmis:createdBy").getFirstValue(),
    qr.getPropertyByQueryName("cmis:objectId").getFirstValue(),
    qr.getPropertyByQueryName("cmis:contentStreamFileName").getFirstValue(),
    qr.getPropertyByQueryName("cmis:contentStreamMimeType").getFirstValue(),
    qr.getPropertyByQueryName("cmis:contentStreamLength").getFirstValue());
CmisObject object = this.openCMISSession.getObject(qr.getPropertyByQueryName("cmis:objectId").getFirstValue().toString());
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

public void runFolderQuery(Session session, Folder testFolder) {
  if (!Boolean.TRUE.equals(testFolder.getType().isQueryable())) {
    addResult(createResult(SKIPPED, "Folder type '" + testFolder.getType().getId()
        + "' is not queryable. Folder query test skipped!"));
    return;
  }
  CmisTestResult f;
  QueryStatement[] statements = new QueryStatement[] {
      session.createQueryStatement("SELECT * FROM ? WHERE ? = ?"),
      session.createQueryStatement("SELECT * FROM ? WHERE ? IN (?)") };
  for (QueryStatement statement : statements) {
    statement.setType(1, testFolder.getType());
    statement.setProperty(2, testFolder.getType().getPropertyDefinitions().get(PropertyIds.OBJECT_ID));
    statement.setString(3, testFolder.getId());
    addResult(createInfoResult("Folder query: " + statement.toQueryString()));
    int count = 0;
    for (QueryResult qr : statement.query(false)) {
      count++;
      String objectId = qr.getPropertyValueByQueryName("cmis:objectId");
      f = createResult(FAILURE, "Folder query returned unexpected object. Id: " + objectId);
      addResult(assertEquals(testFolder.getId(), objectId, null, f));
    }
    f = createResult(FAILURE, "Folder query should return exactly one hit, but returned " + count + ".");
    addResult(assertEquals(1, count, null, f));
  }
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

String objectId = (String) qr.getPropertyByQueryName(objectIdQueryName).getFirstValue();
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

count++;
String objectId = qr.getPropertyValueByQueryName("cmis:objectId");
origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-tck

count++;
String folderName = qr.getPropertyValueByQueryName("folderName");
String folderId = qr.getPropertyValueByQueryName("folderId");
org.apache.chemistry.opencmis.client.apiQueryResult

Javadoc

Query result.

Most used methods

  • getProperties
    Returns the list of all properties in this query result.
  • getPropertyByQueryName
    Returns a property by query name or alias.
  • getPropertyValueById
    Returns a property (single) value by ID.
  • getPropertyValueByQueryName
    Returns a property (single) value by query name or alias.
  • getPropertyById
    Returns a property by ID. Because repositories are not obligated to add property IDs to their query
  • getPropertyMultivalueById
    Returns a property multi-value by ID.
  • getRelationships
    Returns the relationships if they have been requested.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • setScale (BigDecimal)
  • runOnUiThread (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now