cancel
Showing results for 
Search instead for 
Did you mean: 

Question about grabbing document properties

gereeyehrmo
Champ in-the-making
Champ in-the-making
So I am having trouble with the description property from the service from my local alfresco server.  Here's what I am using:


Alfresco Version: Community Edition 4.2e
Service API URL: http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom/query
Data sent to service:

  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <cmis:query xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"
    xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:app="http://www.w3.org/2007/app"
    xmlns:cmisra="http://docs.oasisopen.org/ns/cmis/restatom/200908/">
    <cmis:statement><![CDATA[SELECT * FROM cmis:document WHERE CONTAINS('TAG:"photos"') ORDER BY cmis:lastModificationDate DESC]]></cmis:statement>
    <cmis:searchAllVersions>false</cmis:searchAllVersions>
    <cmis:includeAllowableActions>true</cmis:includeAllowableActions>
    <cmis:includeRelationships></cmis:includeRelationships>
    <cmis:renditionFilter></cmis:renditionFilter>
    <cmis:maxItems>60</cmis:maxItems>
    <cmis:skipCount>0</cmis:skipCount>
  </cmis:query>


And the attached xml (or https://gist.github.com/beverlyguillermo/7589952) is the resulting xml output.

In my test environment, every file has a description and I am expecting to see in the results "cm:description" in my SecondaryObjectTypeIds OR PropertyString "cmis:description"; but cm:description isn't there and the value for cmis:description is empty. Any insight on this issue would be helpful.

Thanks!


1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
I'm not sure that contains clause is going to get you documents with that tag. So let's put that aside and modify your query to find objects with a certain name. You are looking for description. That's defined in an aspect. When need to select properties defined in an aspect you have to use a join. So the query to return the name and description for an object named 'coins.JPG' would look like this:
SELECT D.cmis:name,T.cm:description FROM cmis:document as D join cm:titled as T on D.cmis:objectId = T.cmis:objectId WHERE D.cmis:name='coins.JPG' ORDER BY D.cmis:lastModificationDate DESC


Jeff