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

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>
0 votes

1 answers

1585 views

ANSWER



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 :)

0 votes