Enrique Perez wrote:
> Hi!
>
> When I create new properties for a fragment I have three choices: text
> area, string and selection.
>
> Text area and string are easy to use, but I don't know how to use the
> selection type.
>
> I think that I must create a new class that implements Vocabulary and
> a new extension point in the theme-contrib.xml file. But, how do I
> select this vocabulary in the FieldInfo annotation?
>
> I thought that I must use the attribute source, but it's undefined for
> the annotation type FieldInfo.
>
> Thanks!
>

Hi,

You need to register a vocabulary:

  <extension target="org.nuxeo.theme.services.ThemeService"
point="vocabularies">

    <vocabulary name="web widget providers">
      <class>org.nuxeo.theme.webwidgets.ProviderVocabulary</class>
    </vocabulary>

  </extension>

the vocabulary class then needs to implement
org.nuxeo.theme.vocabularies.Vocabulary

public interface Vocabulary {
  List<VocabularyItem> getItems();
}

there is an example at:
https://svn.nuxeo.org/nuxeo/org.nuxeo.theme/trunk/nuxeo-theme-webwidgets/src/main/java/org/nuxeo/theme/webwidgets/ProviderVocabulary.java

PS: I've recently changed the class, since it wasn't possible to set
item labels, so you might need to do a fresh svn checkout.

best
/JM

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to