[CPS-devel] Using a local vocabulary for a Contentbox under CPS 3.3.8

Julien Anguenot ja at nuxeo.com
Thu Jun 1 00:07:00 CEST 2006


Patrick CHAILLOUX wrote:
> I'm trying to force a contentbox to list documents using some local
> metadata vocabulary  ('Local Vocabularies Container' under CPS).
> I have some trouble accessing the local vocabulary in
> "contentbox_edit_form".
> 
> 'Themes'  is a property of my documents' metadata. It uses a local
> vocabulary.
> I tried to recycle some code used in the "advanced search form" but of
> course it's using the locale 'here'.
> 
>        <tr> <b>Choose some themes</b>
> 
>            <select size="5" name="Themes:list" multiple="multiple"
>              tal:define="themes_set python:request.get('Themes', ());
>              all_themes python:here.getListFromVocabulary('themes_voc')">
>            <option value="" tal:attributes="selected not:themes_set"
>                i18n:translate="label_all">All</option>
>            <option                tal:repeat="item all_themes/items"
>                tal:attributes="value python:item[0];
>                                selected python:item[0] in themes_set or
> None"
>                tal:content="python:item[1]"
>                i18n:translate=""></option>
>            </select>
> 
>        </tr>
> 
> I need this chunk to use as context the folder I have chosen in
> 'contentbox_edit_form.' .
> I tried modifying this to :
>                 all_themes
> python:box['box'].getListFromVocabulary('themes_voc')">
> 
> but it still lists the global vocabulary.

yup because the content box instance should *not* be defined locally in
this case but at the root of the instance. If you want to find you local
vocabulary container through acquisition you certainly need to call the
getListFromVocabulary() method on on of the item instance instead unless
there's a variable within the context of the boxes which represents the
actual context in which the user is navigating which I doubt... This is
something that do exist with the portlets nowadays.

	J.

-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - www.nuxeo.com
CPS Platform - http://www.cps-project.org
Mobile: +33 (0) 6 72 57 57 66

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.nuxeo.com/pipermail/cps-devel/attachments/20060601/6478d38b/signature.pgp


More information about the cps-devel mailing list

This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.