Looking for Model Title using Alfresco API service

cancel
Showing results for 
Search instead for 
Did you mean: 
piyush48
Active Member II

Looking for Model Title using Alfresco API service

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

3 Replies
afaust
Master

Re: Looking for Model Title using Alfresco API service

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.

piyush48
Active Member II

HiRe: Looking for Model Title using Alfresco API service

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

afaust
Master

Re: HiRe: Looking for Model Title using Alfresco API service

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.