cancel
Showing results for 
Search instead for 
Did you mean: 

How do I can have the current document type translated into my xhtml fragment ?

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

I'm writing a xhtml fragment and I would like to display into this fragment the document type translated.

I know that jsf bring a translation possibilities through this:

#{messages[label]]

How can access to "my.doc.label" used for the doc type when I create this document type definition:

<type id="MyDocType">
  <label>my.doc.label</label>
  <icon>/icons/myicon.gif</icon>
  ... etc...
</type>
1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

You have to get the TypeInfoAdapter that will expose all the attribute of the Document Type (UI part).

Normally to get an adapter you just have to do this:

TypeInfoAdapter type = TypeInfoAdapterFactory.getAdapter(yourDocumentModel);

And so to get the label:

type.getLabel();

And Nuxeo provides a JSF component to get this adapter:

<div ...
   xmlns:nxd="http://nuxeo.org/nxweb/document"
   ...>

... create my content where I want to put the docType translated ...
   #{messages[nxd:typeInfo(yourDocument).label]}
.... etc...

Hope this will help you as help me 🙂

View answer in original post

1 REPLY 1

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

You have to get the TypeInfoAdapter that will expose all the attribute of the Document Type (UI part).

Normally to get an adapter you just have to do this:

TypeInfoAdapter type = TypeInfoAdapterFactory.getAdapter(yourDocumentModel);

And so to get the label:

type.getLabel();

And Nuxeo provides a JSF component to get this adapter:

<div ...
   xmlns:nxd="http://nuxeo.org/nxweb/document"
   ...>

... create my content where I want to put the docType translated ...
   #{messages[nxd:typeInfo(yourDocument).label]}
.... etc...

Hope this will help you as help me 🙂

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.