07-01-2019 12:49 PM
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
07-02-2019 07:15 AM
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
07-04-2019 04:38 AM
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
07-04-2019 05:46 AM
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.
07-04-2019 06:30 AM
Hi Axel,
Thanks for your response.
Do you maybe know to which Alfresco fields the following cmis props are mapped?
Best Regards,
Đorđe
07-04-2019 06:57 AM
The other properties all have no directly corresponding Alfresco properties / fields.
Explore our Alfresco products with the links below. Use labels to filter content by product module.