08-12-2020 07:02 AM
Good day
Is there a way to retrieve a list all the defined properties and aspects from the Alfresco repository?
Appreciate the help in advance.
Regards
Stephan
08-12-2020 08:50 AM
Try this REST API if suits your requirements:
GET /alfresco/service/api/dictionary
http://127.0.0.1:8080/alfresco/service/api/dictionary
GET /alfresco/s/api/defclasses
http://127.0.0.1:8080/alfresco/s/api/defclasses
GET /alfresco/service/api/classes/{className}
http://127.0.0.1:8080/alfresco/service/api/classes/cm_content (type) http://127.0.0.1:8080/alfresco/service/api/classes/cm_auditable (aspect)
For a specific node:
Example:
http://127.0.0.1:8080/alfresco/service/api/properties?nodeRef=workspace://SpacesStore/1c76d9a6-8d01-...
Visit this doc for more details: https://docs.alfresco.com/5.0/references/RESTful-Dictionary.html
08-12-2020 08:18 AM
Hi @OomStephan,
To retrieve aspects, take a look at this API documentation - although this method will depend on how old your Alfresco instance is. For Alfresco 5,2+ the API call will be something like the following:
'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?include=aspectNames&skipCount=0&maxItems=100'
For the properties, something like this:
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?include=aspectNames,properties&skipCount=0&maxItems=100'
HTH,
08-12-2020 08:23 AM
Hi Eddie
Thanks for the reply, I am aware of the documentation you linked. However, does this not retrieve the aspects/properties for the specific node?
My use case is that I would like to retrieve all available defined aspects/properties and display them to my user, so that the user can decide what properties he would like to add.
Thanks in advance.
Regards
Stephan
08-12-2020 08:27 AM
Just to add to the above, is there an endpoint that does not require a nodeId as parameter and instead returns all available aspects and/or properties that can be applied to a node, both system and custom aspects?
Stephan
08-12-2020 08:50 AM
Try this REST API if suits your requirements:
GET /alfresco/service/api/dictionary
http://127.0.0.1:8080/alfresco/service/api/dictionary
GET /alfresco/s/api/defclasses
http://127.0.0.1:8080/alfresco/s/api/defclasses
GET /alfresco/service/api/classes/{className}
http://127.0.0.1:8080/alfresco/service/api/classes/cm_content (type) http://127.0.0.1:8080/alfresco/service/api/classes/cm_auditable (aspect)
For a specific node:
Example:
http://127.0.0.1:8080/alfresco/service/api/properties?nodeRef=workspace://SpacesStore/1c76d9a6-8d01-...
Visit this doc for more details: https://docs.alfresco.com/5.0/references/RESTful-Dictionary.html
08-13-2020 05:12 AM
Exactly what I am looking for. Thank you very much!
Stephan
08-13-2020 05:20 AM
Hi @OomStephan,
Glad that @abhinavmishra14 was able to help you out & thanks for accepting his solution - really helpful to other users too.
Best wishes,
08-12-2020 08:38 AM
Hi @OomStephan,
I presume you've looked at NodeService? There is a discussion here about using it.
HTH,
Explore our Alfresco products with the links below. Use labels to filter content by product module.