Hi everyone,
I'm am trying to integrate with Alfresco using it's public REST API and I found some limitations there so far.
Currently I'm using Alfresco 5.2 Community edition.
First I was not able to get list of all available fields on a node, as it is not possible to get dictionary info using Alfresco's public REST API. With above mentioned, I assume I cannot also get list of all available permissions that one can set on a node, please correct if I'm wrong?
Now if I'm using search API, and cmis QL, I'm not able to get just specific properties from the cmis:document. If I use following POST call:
http://localhostort/alfresco/api/-default-/public/search/versions/1/search
with following body parameter:
{
"query": {
"language": "cmis",
"query": "select * from cmis:document where cmis:name like 'tes%'",
}
}
result I've got is as expected.
But if I use query to select specific cmis properties e.g.
"query": "select cmisbjectId from cmis:document where cmis:name like 'djur%'",
it returns me exactly the same subset of data as I'm using '*'.
Is this a bug in Alfresco public REST API, or is there another way to achieve what I described above?
Thanks in advance,
Djordje
Hi,
You can use the fields JSON body parameter to restrict the fields returned within a response Like:
{
"query": {
"language": "cmis",
"query": "select * from cmis:document where cmis:name like 'tes%'"
},
"fields": ["id"]
}
Please refer this Alfresco Content Services REST API Explorer
Thanks,
Prachi
Hi Prachi,
Thanks for your response. Yeah I know that I can use fields property to filter fields I would like to see in the response.
In my use case users are writing these queries and sending it to the service I provide. And to use fields property you've mentioned, I would need to know exact mapping between all cmis available properties and alfresco fields (objectId->id, name->name... ) and I'm not sure how to know these mappings.
Best Regards,
Đorđe
There really are not that many CMIS properties to map.
Most/all of those should be quite easy to figure out by looking at the documentation of the response schema for the search operation, e.g. that cmis:createdBy maps to createdByUser etc.
Hi Axel,
Thanks for your response.
Do you maybe know to which Alfresco fields the following cmis props are mapped?
Best Regards,
Đorđe
The other properties all have no directly corresponding Alfresco properties / fields.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.