Nuxeo mailing list archives
[CPS-users] Lock cpsDocument fields
Winterflood, Jonathan
jonathan.winterflood at capgemini.com
Fri Jul 27 09:49:21 CEST 2007
Hi,
Indeed your HowTo's look quite useful :)
However before I got to them I'd dug up the source where the execution environment for these expressions are built, and there are some extra variables defined for us already:
in
CPSSchemas/Widget.py:Widget._createExpressionContext
Line 193+:
data = {
'widget': self,
'datamodel': datamodel,
'user': datamodel._acl_cache_user,
'nothing': None,
'context': datamodel._context,
'portal': portal,
'modules': SecureModuleImporter,
'proxy': proxy,
'portal_workflow': wftool,
'review_state': review_state,
'layout_mode': layout_mode,
}
So we can use 'review_state' directly instead of retrieving it via getContentInfo().
Maybe you'd like to include these in your blog?
Keep up the good work helping us newbies ;)
Cheers,
Jonathan
-----Message d'origine-----
De : Jose Luis de la Rosa Triviño [mailto:joseluis.rosa at iavante.es]
Envoyé : jeudi 26 juillet 2007 11:19
À : Winterflood, Jonathan
Cc : cps-users at lists.nuxeo.com
Objet : Re: [CPS-users] Lock cpsDocument fields
Hi,
I recently wrote a How to about this
http://cpsproject-howto.blogspot.com/2007/07/how-to-hide-widget-for-given-workflow.html
Maybe it is useful for any other person who wants to know exactly what
expression to use.
Cheers,
Jose Luis.
Winterflood, Jonathan wrote:
> Hi,
>
> Sorry for the extra-short question, Ctrl-Enter sent the mail before I'd quite finished it...
>
> Your solution does it exactly, thanks.
>
> I used the ZMI property "Widget mode (TALES)"
> (xml snippet <property name="widget_mode_expr">)
>
> Cheers,
> Jonathan
>
> -----Message d'origine-----
> De : Florent Guillaume [mailto:fg at nuxeo.com]
> Envoyé : mercredi 25 juillet 2007 13:04
> À : Winterflood, Jonathan
> Cc : cps-users at lists.nuxeo.com
> Objet : Re: [CPS-users] Lock cpsDocument fields
>
> You can use an expression based on the workflow state in the widgets
> to force a "view" mode in some cases and therefore disallow edit.
>
> Florent
>
> On 25 Jul 2007, at 12:18, Winterflood, Jonathan wrote:
>
>> In a CPS document (based on a layout, schema and type), I need to
>> lock the editing of some schema fields / layout cells, based on the
>> workflow state of the document.
>>
>>
>>
>> How should I go about this?
>>
>>
>>
>>
>
>
--
Jose Luis de la Rosa
Técnico de Innovación y Tecnología
Fundación IAVANTE
Telf.: 951 01 53 13 - Fax: 951 01 53 01
www.iavante.es
Este correo electrónico y, en su caso, cualquier fichero anexo, contiene
información confidencial exclusivamente dirigida a su(s)
destinatario(s). Toda copia o divulgación deberá ser autorizada por
IAVANTE.
This e-mail and any attachments are confidential and exclusively
directed to its adressee(s). Any copy or distribution will have to be
authorized by IAVANTE.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
This list archive provided by Nuxeo, the
leaders of open source ECM.
Check out the Nuxeo 5 open source,
standards-based ECM project.