you can add entry to a vocabulary in the vocabulary link at the top of the 
application

Yes, but I wanted to do it automatically.

At last I think I have got it (I am still working on it)

I have created an extension point defining a directory which schema is 
"vocabulary" and which default values would be in a csv file:

*<directory name="documents_type_vocabulary">*
      *<schema>vocabulary</schema>*
      *<dataSource>java:/nxsqldirectory</dataSource>*
      *<table>documents_type_vocabulary</table>*
      *<idField>id</idField>*
      *<autoincrementIdField>false</autoincrementIdField>*
      *<dataFile>directories2/documents_type_vocabulary.csv</dataFile>*
      *<createTablePolicy>on_missing_columns</createTablePolicy>*
  *</directory>* 

Then with the +org.nuxeo.ecm.directory.Session+ class and the DirectoryService 
Service I can access to its values and modify it:

*try{*
*org.nuxeo.ecm.directory.Session dir = null;*
*DirectoryService dirService = 
Framework.getLocalService(DirectoryService.class);*
*                       *
*dir = dirService.open("documents_type_vocabulary");*
*DocumentModel entry = dir.getEntry(docType);      --> docType is the String 
value of the document Type.*
*                       *
*if(entry!=null){    --> if not null, the entry exists. Else, the entry does 
not exists.*
            *..................*
*}*
*...........*

Thanks a lot
--
Posted by "franciscogonzalez" at Nuxeo Discussions 
<http://nuxeo.org/discussions>
View the complete thread: 
<http://www.nuxeo.org/discussions/thread.jspa?threadID=2985#8785>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to