cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch the title of a type?

drocco88
Champ in-the-making
Champ in-the-making
Hi there,

As the subject says, I have a custom type described by a QName. How can I get for example the title element of it in Java?

Many thanks,
Rocco
5 REPLIES 5

billerby
Champ on-the-rise
Champ on-the-rise
With a custom title:

String title = (String) nodeService.getProperty(myNodeRef, QName.createQName("http://www.mycompany.com/model/customModel/1.0", "title");

Change to your namespace and the name of your custom title.

/Erik

drocco88
Champ in-the-making
Champ in-the-making
Many thanks

drocco88
Champ in-the-making
Champ in-the-making
And what about if is in this situation:

<namespace uri="http://xxx/model/1.0" prefix="xxx" />

<type name="xxx:customType">
   <title>My Title</title>

How do I fetch the title?

billerby
Champ on-the-rise
Champ on-the-rise
Well that title-element is just a way to name your type (like naming a java class or something). To find that out you will have to use the DictionaryService.getType and on the returned TypeDefinition do a getTitle() I suppose…

/Erik

drocco88
Champ in-the-making
Champ in-the-making
Thanks a lot