05-07-2021 06:36 AM
Hi All,
I am looking for custom Content Model title using Alfresco AP service.
Below is my piece of model:-
<type name="img:ibEng"> <title>IB_Eng</title> <parent>img:abcimg</parent> <properties/> <mandatory-aspects> <aspect>img:uniqueDocumentAspect</aspect> </mandatory-aspects> </type>
I am using DictionaryService API to get title:-
QName itemType = this.serviceRegistry.getNodeService().getType(document); String qName = itemType.getPrefixString(); System.out.println("Qname "+qName); String[] values = qName.split(":"); String siteName = values[0]; System.out.println("Sitename "+siteName); String folderName = this.serviceRegistry.getDictionaryService().getType(itemType).getTitle();
Here folderName output must be like:- IB_Eng but it is returning as IB_Eng Type. I am not getting where it is taking "Type" from.
Thanks,
Piyush
05-10-2021 04:36 AM
The getTitle operation will first look into any registered i18n message bundles before falling back to the title in the model XML. Chances are, you have a localisation entry for that type in one of your message properties files.
05-10-2021 11:46 AM
Hi @afaust ,
Thanks for always guiding and helping. If I am getting it right, you mean to say that first it will looking into messages . properties file? As while trying to get desired output I tried changing . properties file in messages of Alfresco in SDK but still was getting Type attached to it for some and for some it was working fine.
Should I try changing both model.xml and model.properties title as same?
Also should I need to change share messages file?.
Please do guide me out.
Thanks,
Piyush
05-10-2021 02:29 PM
Of course you do not have to change the Share properties files if you are only working with the Repository APIs.
There is no need to change model XML and properties files just for i18n/l10n updates, as long as you don't add / remove / rename model types, aspects, properties etc.
Since you are getting "Type" attached you will most definitely have a properties file which contains the exact text you are getting - simply do a search over all text files for that and you should find it. Alfresco never adds a "Type" text to any value maintained in XML or properties on its own.
Explore our Alfresco products with the links below. Use labels to filter content by product module.