[CPS-users-fr] CPSWorkflow.constants

Cedric Marfil cedric.marfil at capgemini.com
Mar 26 Sep 10:52:45 CEST 2006


Bonjour,
Ayant le besoin de créer des workflows spécifiques, je me suis intéressé à la méthode 'verifyWorkflow' de l'installer.
J'ai donc construit un skin qui me retourne les workflows à installer, mais pour pouvoir définir ces derniers, j'avais besoin d'accéder aux constantes stockées dans CPSWorkflow/constants.py.
Quoi que je fasse, je n'avais jamais accès à ces constantes. Je me suis donc inspiré de ce qui était fait dans CPSCore/permissions.py puisque l'import de constantes de permissions fonctionnait.
J'ai donc ajouté au fichier constants.py le code suivant:

from AccessControl import ModuleSecurityInfo
security = ModuleSecurityInfo('Products.CPSWorkflow.constants')

security.declarePublic('TRANSITION_ALLOWSUB_CREATE')
TRANSITION_ALLOWSUB_CREATE = 10
security.declarePublic('TRANSITION_ALLOWSUB_DELETE')
TRANSITION_ALLOWSUB_DELETE = 11
security.declarePublic('TRANSITION_ALLOWSUB_MOVE')
TRANSITION_ALLOWSUB_MOVE = 12 # Into this container.
security.declarePublic('TRANSITION_ALLOWSUB_COPY')
TRANSITION_ALLOWSUB_COPY = 13 # Same...
..
..
..

Pour chaque constante déclarée, j'ai ajouté une déclaration de sécurité. Maintenant, mon code fonctionne.

Est-ce la bonne solution ?
Si oui, peut-on intégrer cette modification à CPS ?
Si non, quelle est la bonne solution ?

Cordialement


--------------------------------------------------------------------------------
Cédric Marfil
Concepteur Réalisateur Intégrateur Confirmé
Tél. direct: 03.20.65.34.82
Mail: cedric.marfil at capgemini.com

Capgemini
181 rue Jules Delcenserie
59700 Marcq en Baroeul


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.
-------------- section suivante --------------
Une pièce jointe HTML a été enlevée...
URL: http://lists.nuxeo.com/pipermail/cps-users-fr/attachments/20060926/a21ddb5b/attachment.htm



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