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
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.
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
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.
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.