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

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

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

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

@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: 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());
org.apache.chemistry.opencmis.client.apiQueryResultgetPropertyById

Javadoc

Returns a property by ID.

Because repositories are not obligated to add property IDs to their query result properties, this method might not always work as expected with some repositories. Use #getPropertyByQueryName(String) instead.

Popular methods of QueryResult

  • 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.
  • getPropertyMultivalueById
    Returns a property multi-value by ID.
  • getRelationships
    Returns the relationships if they have been requested.

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JLabel (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Github Copilot alternatives
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