Changeset 6349 for main


Ignore:
Timestamp:
11 Jun 2011, 10:56:25 (14 years ago)
Author:
uli
Message:

Base further workflow stuff on hurry.workflow 0.11.

Location:
main/waeup.sirp/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/buildout.cfg

    r6308 r6349  
    3434[versions]
    3535collective.recipe.sphinxbuilder = 0.7.0
    36 hurry.workflow = 0.10
     36hurry.workflow = 0.11
    3737# Pinned to circumvent breakage in 0.4.x
    3838hurry.zoperesource = 0.6
  • main/waeup.sirp/trunk/setup.py

    r6287 r6349  
    1313    'hurry.jquery',
    1414    'hurry.jqueryui',
    15     'hurry.workflow',
     15    'hurry.workflow >= 0.11',
    1616    # Add extra requirements here
    1717    'docutils', # For RST-processing...
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6348 r6349  
    428428        role_manager.assignRoleToPrincipal(
    429429            'waeup.PortalUser', self.request.principal.id)
    430         state = IWorkflowState(self.context[pin]).getState()
    431         if state == INITIALIZED:
    432             IWorkflowInfo(self.context[pin]).fireTransition('start')
     430        # XXX: disable for now. Pins will get a different workflow.
     431        #state = IWorkflowState(self.context[pin]).getState()
     432        #if state == INITIALIZED:
     433        #    IWorkflowInfo(self.context[pin]).fireTransition('start')
    433434        self.redirect(self.url(self.context[pin], 'edit'))
    434435        return
     
    548549        return '%s Application Form' % container_title
    549550
    550     @property
    551551    def getTransitions(self):
     552        """XXX: need docs
     553        """
    552554        allowed_transitions_ids = IWorkflowInfo(
    553555            self.context).getManualTransitionIds()
     
    599601
    600602    def dataNotComplete(self):
    601         #import pdb; pdb.set_trace()
    602603        if not self.request.form.get('confirm_passport', False):
    603604            return 'Passport confirmation box not ticked.'
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py

    r6339 r6349  
    1212from waeup.sirp.interfaces import IObjectHistory
    1313
    14 
    1514INITIALIZED = 'initialized'
    1615STARTED = 'started'
     
    1918NOT_ADMITTED = 'not admitted'
    2019CREATED = 'created'
     20
     21NULL_TRANSITION = Transition(
     22    transition_id = '',
     23    title = 'No transition',
     24    source = None,
     25    condition = NullCondition,
     26    msg = '',
     27    destination = None,)
    2128
    2229def create_workflow():
     
    99106        destination = STARTED)
    100107
    101     return [init_transition, start_transition, submit_transition,
    102             admit_transition, create_transition, refuse1_transition,
    103             refuse2_transition, reset1_transition, reset2_transition,
    104             reset3_transition, reset4_transition]
     108    return [NULL_TRANSITION, init_transition, start_transition,
     109            submit_transition, admit_transition, create_transition,
     110            refuse1_transition, refuse2_transition, reset1_transition,
     111            reset2_transition, reset3_transition, reset4_transition]
    105112
    106113
     
    152159
    153160# Register global utilities for workflows and workflow versions...
    154 grok.global_utility(ApplicationWorkflow, IWorkflow)
    155 grok.global_utility(ApplicationWorkflowNullVersions, IWorkflowVersions)
     161#grok.global_utility(ApplicationWorkflow, IWorkflow, name=WORKFLOW_NAME)
     162#grok.global_utility(ApplicationWorkflowNullVersions, IWorkflowVersions,
     163#                    name=WORKFLOW_NAME)
    156164
    157 class ApplicationState(grok.Adapter, WorkflowState):
     165application_workflow = ApplicationWorkflow()
     166
     167class ApplicationWorkflowState(WorkflowState, grok.Adapter):
    158168    """An adapter to adapt Applicant objects to workflow states.
    159169    """
     
    161171    grok.provides(IWorkflowState)
    162172
    163 class ApplicationInfo(grok.Adapter, WorkflowInfo):
     173    state_key = 'wf.application.state'
     174    state_id = 'wf.application.id'
     175
     176class ApplicationWorkflowInfo(WorkflowInfo, grok.Adapter):
    164177    """Adapter to adapt Applicant objects to workflow info objects.
    165178    """
     
    167180    grok.provides(IWorkflowInfo)
    168181
     182    def __init__(self, context):
     183        self.context = context
     184        self.wf = application_workflow
    169185
    170186@grok.subscribe(IApplicantBaseData, IWorkflowTransitionEvent)
Note: See TracChangeset for help on using the changeset viewer.