05-04-2017 02:43 AM
Hi,
I want all custom content types which we can see on Aflfresco Advanced Search Page from Java-backed Webscript.
I have referred advsearch.get.js, it retrieves all the content types from share-config-custom.xml, but I want to that from Java Backed Web script.
Is there anyway we can parse share-config-custom.xml from Java class and get content types, or is there any other way to use any Public Java API like Node service for retrieving the content type.
Thanks in advance.
05-04-2017 12:03 PM
Maybe this helps:
DictionaryService | Alfresco Documentation
There is also a webscript retrieving full dictionary data:
/alfresco/service/api/dictionary
Regards.
--C.
05-05-2017 01:14 AM
But I want only those content types which we can see on advanced search page, currently that arrays is created in advsearch.get.js, but if I wan to pass this content types array via remote call to repository side, so how to pass it and on java side how to retrieve it. Please let me know if any ideas are there.
Thanks.
05-05-2017 12:38 PM
Hi Riya:
If you need only few of them, you need some kind of config file like share-config-custom.xml for Alfresco Share.
You can configure your webscript with a config xml file mywebscript.get.config.xml directly and having these custom content types.
Maybe this helps:
Best way to inject .properties file to a webscript
Regards.
--C.
05-08-2017 03:03 AM
Ok, thanks, let me try thi once.
06-14-2018 10:43 AM
So, to get this straight, if you want to retrieve all custom created content types, you cannot get them via the API and you have to manually write them into a file instead?
06-14-2018 11:33 AM
No, there are APIs for that. Cesar referenced the Repository-tier Java API for it. The CMIS API also exposes dictionary information, and there is also a ReST API for internal use that exposes types and other dictionary information. It is just that there currently is no public v1 ReST API to access dictionary information in a generic way.
The file option is something Cesar mentioned as a potential simplification for a known set of custom types.
Explore our Alfresco products with the links below. Use labels to filter content by product module.