|
/
Zope
/
gocept svn checkins
/
Archive
/
2007
/
2007-04
/
SVN: r4620 - AlphaFlow/trunk
[
SVN: r4616 - in AlphaFlow/trunk: . editor ... ]
[
SVN: r4629 - gocept.rdbmanagement / Michael ... ]
SVN: r4620 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-03 14:12:51 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 3 14:12:48 2007
New Revision: 4620
Log:
cleanup: coding style, removed unneeded imports and LocalRoleFake classes
Modified:
AlphaFlow/trunk/instance.py
AlphaFlow/trunk/processmanager.py
AlphaFlow/trunk/workflowedobject.py
Modified: AlphaFlow/trunk/instance.py
==============================================================================
--- AlphaFlow/trunk/instance.py (original)
+++ AlphaFlow/trunk/instance.py Tue Apr 3 14:12:48 2007
(at)(at) -4,27 +4,20 (at)(at)
# $Id$
"""Process instances"""
-# Python imports
-import sys
import logging
-import os
-# Zope imports
import zope.app.annotation.interfaces
import zope.interface
import zExceptions
from Globals import InitializeClass
from AccessControl import getSecurityManager, ClassSecurityInfo
-from DateTime import DateTime
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Acquisition import ImplicitAcquisitionWrapper, aq_base
-# Plone/AT imports
from Products.CMFCore.utils import getToolByName
from Products.CMFCore import permissions
from Products.Archetypes.public import BaseFolder, registerType
-# Sibling imports
from Products.AlphaFlow.interfaces import \
IInstance, IAlphaFlowed, IDaemonActivity, IWorkItemFactory, \
ILifeCycleController, ILifeCycleEvent
(at)(at) -33,15 +26,6 (at)(at)
from Products.AlphaFlow.lifecycle import LifeCycleObjectBase
-class LocalRoleFake(dict):
- """backward compatibility
-
- instances get removed during cleanup (in glome, yuck!)
-
- XXX: remove this class after cleanup is out for some versions
- """
-
-
class InstanceLocalRoleFake(utils.LocalRoleFakeBase):
"""fakes a dictionary for local role support"""
(at)(at) -50,7 +34,7 (at)(at)
instance = self._context
roles = alf.getDynamicRolesForInstance(instance, user)
return roles
-
+
def _get_users_with_cached_roles(self):
return
self._processmanager.listRelevantUsersForInstance(self._context)
(at)(at) -158,7 +142,7 (at)(at)
def _unlink_content_instance(self):
"""A helper method that moves an ended alphaflow instances away
- from the content object.
+ from the content object.
"""
content = self.getContentObject()
(at)(at) -191,11 +175,11 (at)(at)
unwrapped_self = aq_base(self)
# The filter below avoids implicit acquisition when
# our caches are stale.
- workitems = [getattr(self, id) for id in ids
- if hasattr(unwrapped_self, id)]
+ workitems = [getattr(self, id) for id in ids
+ if hasattr(unwrapped_self, id)]
if activity_id is not None:
- workitems = [wi for wi in workitems
+ workitems = [wi for wi in workitems
if wi.activity_id == activity_id]
return workitems
(at)(at) -218,7 +202,7 (at)(at)
if not activity_ids:
return ()
- utils.logger.log(logging.DEBUG,
+ utils.logger.log(logging.DEBUG,
'Creating workitems %r in %r' % (activity_ids, source))
self._creating += 1
(at)(at) -244,7 +228,7 (at)(at)
security.declarePrivate("notifyWorkItemStateChange")
def notifyWorkItemStateChange(self, workitem=None):
- """Notifies the process instance, that at least one workitem changed
+ """Notifies the process instance, that at least one workitem changed
it's state.
The process instance then checks if either all workitems are completed
(at)(at) -272,7 +256,7 (at)(at)
for notify in to_notify_about:
wi.notifyWorkItemStateChange(notify)
- # Update that those work item state changes have propagated
+ # Update that those work item state changes have propagated
# to notifications
for notified in to_notify_about:
notified._af_notified = True
(at)(at) -290,7 +274,7 (at)(at)
value = self.Schema()[field].get(self)
except KeyError:
value = default
- return value
+ return value
##########################
# AT configuration support
(at)(at) -554,8 +538,8 (at)(at)
try:
activity = process[activity_id]
except KeyError:
- raise UnknownActivityError, \
- "Activity '%s' does not exist." % activity_id
+ raise UnknownActivityError(
+ "Activity '%s' does not exist." % activity_id)
new.extend(IWorkItemFactory(activity)(source, content_object))
for wi in new:
(at)(at) -565,7 +549,7 (at)(at)
self._setObject(wi_id, wi)
new_wrapped.append(self[wi_id])
- return new_ids, new_wrapped
+ return new_ids, new_wrapped
InitializeClass(Instance)
Modified: AlphaFlow/trunk/processmanager.py
==============================================================================
--- AlphaFlow/trunk/processmanager.py (original)
+++ AlphaFlow/trunk/processmanager.py Tue Apr 3 14:12:48 2007
(at)(at) -3,7 +3,6 (at)(at)
# $Id$
"""Process manager"""
-import sys
import logging
from threading import Lock
(at)(at) -29,7 +28,6 (at)(at)
from Products.AlphaFlow.interfaces import \
IProcessManager, IAlphaFlowed, IWorkflowImporter, ILifeCycleController, \
ILifeCycleManager
-from Products.AlphaFlow.instance import Instance
from Products.AlphaFlow import config, utils
from Products.AlphaFlow.adapters.alphaflowable import getAlphaFlowableAdapter
from Products.AlphaFlow.adapters.renderableadapter import getRenderableAdapter
(at)(at) -91,7 +89,7 (at)(at)
manage_linkmacros = PageTemplateFile('www/linkmacros',
globals())
-
+
# Rolecache security settings
security.declarePrivate('updateWorkItemCache')
security.declarePrivate('updateCacheByContent')
(at)(at) -106,7 +104,7 (at)(at)
security.declarePrivate('_get_role_cache_entry')
security.declarePrivate('_build_workitem_cache')
security.declarePrivate('_aggregate_role_cache')
-
+
processes = None
instances = None
(at)(at) -120,7 +118,7 (at)(at)
manage_addBTreeFolder("instances")
if 'processes' not in oids:
self.manage_addProduct["OFSP"].manage_addFolder("processes")
-
+
self.initializeRoleCache()
(at)(at) -206,7 +204,7 (at)(at)
if process is _marker:
raise AttributeError, 'No such process %r' % process_id
return process
-
+
security.declareProtected(config.MANAGE_WORKFLOW, 'listProcesses')
def listProcesses(self):
"""returns sequence of IProcess instances"""
(at)(at) -229,7 +227,7 (at)(at)
result = {}
result['all_count'] = all_count
result['active_count'] = active_count
- result['failed_count'] = failed_count
+ result['failed_count'] = failed_count
return result
(at)(at) -243,10 +241,10 (at)(at)
security.declareProtected(config.MANAGE_WORKFLOW, 'listInstances')
def listInstances(self, search={}):
- """ returns list with instance objects.
+ """ returns list with instance objects.
First item will be the youngest instance
"""
- query = {'meta_type':'Instance',
+ query = {'meta_type':'Instance',
'sort_on':'modified',
'sort_order':'descending'}
query.update(search)
(at)(at) -283,7 +281,7 (at)(at)
if allowed:
processes.append(process)
return processes
-
+
security.declareProtected(config.WORK_WITH_PROCESS, "queryWorkItems")
def queryWorkItems(self, user):
"""return dict of workitems relevant for given user"""
(at)(at) -301,7 +299,7 (at)(at)
'getActivityTitleOrId': wi.getActivityTitleOrId ,
'getShortInfo': wi.getShortInfo ,})
return ret
-
+
security.declareProtected(config.WORK_WITH_PROCESS, "getWorkItems")
def getWorkItems(self, user):
"""return workitems relevant for given user"""
(at)(at) -343,7 +341,7 (at)(at)
or message)
translated = translated % kwargs
return translated
-
+
security.declarePublic('pingCronItems')
def pingCronItems(self):
"""Check if there are pending alarmworkitems which should be
(at)(at) -375,7 +373,7 (at)(at)
security.declareProtected(config.MANAGE_WORKFLOW, 'restartHelper')
def restartHelper(self, activityandprocess, REQUEST=None):
- """Restarts all work items of the given process and activity
+ """Restarts all work items of the given process and activity
which are currently fallen out.
"""
workflow_catalog = getToolByName(self, "workflow_catalog")
(at)(at) -401,7 +399,7 (at)(at)
transaction.commit()
if REQUEST is not None:
- REQUEST.RESPONSE.redirect(self.absolute_url() +
+ REQUEST.RESPONSE.redirect(self.absolute_url() +
"/manage_tools?manage_tabs_message=%s+work+items+restarted." %
restarted)
(at)(at) -421,7 +419,7 (at)(at)
if REQUEST is not None:
REQUEST.RESPONSE.redirect(self.absolute_url()+
-
"/manage_tools?manage_tabs_message=%s+instances+dropped+in.+%s+instances+ignored."
%
+
"/manage_tools?manage_tabs_message=%s+instances+dropped+in.+%s+instances+ignored."
%
(dropped_in, ignored))
security.declareProtected(config.MANAGE_WORKFLOW, 'sanityCheck')
(at)(at) -444,7 +442,7 (at)(at)
o.__ac_local_roles__.update(local_roles)
def _check_double_refs(o, path):
- # 1. check instance to content object mapping.
+ # 1. check instance to content object mapping.
# geee, this is going to be expensive
# a. get a content object (c1)
# b. get its instance
(at)(at) -457,7 +455,7 (at)(at)
c2 = instance.getContentObject()
if c1.aq_base is not c2.aq_base:
- utils.logger.log(logging.WARN,
+ utils.logger.log(logging.WARN,
"Not sane: %r (%r, %r)" % (instance, c1, c2))
c1.alf_clearInstances()
Modified: AlphaFlow/trunk/workflowedobject.py
==============================================================================
--- AlphaFlow/trunk/workflowedobject.py (original)
+++ AlphaFlow/trunk/workflowedobject.py Tue Apr 3 14:12:48 2007
(at)(at) -7,24 +7,13 (at)(at)
import Globals
from AccessControl import getSecurityManager, ClassSecurityInfo
-# Plone/AT imports
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.Expression import Expression, createExprContext
-# Sibling imports
from Products.AlphaFlow.interfaces import IAlphaFlowed
from Products.AlphaFlow import config, utils
-class LocalRoleFake(dict):
- """backward compatibility
-
- instances get removed during cleanup (in glome, yuck!)
-
- XXX: remove this class after cleanup is out for some versions
- """
-
-
class AlphaFlowedLocalRoleFake(utils.LocalRoleFakeBase):
def _get_rolecache_for_user(self, user):
(at)(at) -98,10 +87,10 (at)(at)
getContentObjectUID=self.UID())
wi = [ x.getObject() for x in workitems ]
return wi
-
+
security.declareProtected(config.INIT_PROCESS, "assignProcess")
def assignProcess(self, process_id):
- """Assigns a new instance of the workflow with the given
+ """Assigns a new instance of the workflow with the given
id to this object.
"""
if self.hasInstanceAssigned():
(at)(at) -156,17 +145,17 (at)(at)
if inst is not None:
instances.insert(0, inst)
return instances
-
+
security.declarePublic('getWorkItem')
def getWorkItem(self, id):
- """Return the workitem with the given id from the currently to this
+ """Return the workitem with the given id from the currently to this
content object attached process instance.
"""
instance = self.getInstance()
if instance is None:
raise ValueError, "No instance attached"
return self.getInstance().getWorkItem(id).__of__(self)
-
+
security.declareProtected(config.WORK_WITH_PROCESS,
'alf_getDetailListing')
def alf_getDetailListing(self):
"""return listing"""
|
SVN: r4621 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-03 14:21:19 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 3 14:21:17 2007
New Revision: 4621
Log:
LifeCycleManager -> InstanceManager
Modified:
AlphaFlow/trunk/configure.zcml
AlphaFlow/trunk/interfaces.py
AlphaFlow/trunk/lifecycle.py
AlphaFlow/trunk/processmanager.py
Modified: AlphaFlow/trunk/configure.zcml
==============================================================================
--- AlphaFlow/trunk/configure.zcml (original)
+++ AlphaFlow/trunk/configure.zcml Tue Apr 3 14:21:17 2007
(at)(at) -46,7 +46,7 (at)(at)
/>
</class>
- <utility factory=".lifecycle.LifeCycleManager" />
+ <utility factory=".lifecycle.InstanceManager" />
<!-- Other packages -->
<include package=".activities" />
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Tue Apr 3 14:21:17 2007
(at)(at) -847,7 +847,7 (at)(at)
"""Event that gets triggered when a life cycle state changes."""
-class ILifeCycleManager(zope.interface.Interface):
+class IInstanceManager(zope.interface.Interface):
"""A utility for managing life cycle objects."""
def createInstance(definition, container):
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Tue Apr 3 14:21:17 2007
(at)(at) -19,7 +19,7 (at)(at)
from Products.AlphaFlow import config
from Products.AlphaFlow.interfaces import \
- ILifeCycleObject, ILifeCycleController, ILifeCycleEvent, ILifeCycleManager
+ ILifeCycleObject, ILifeCycleController, ILifeCycleEvent, IInstanceManager
from Products.AlphaFlow.compatibility.factory import factory
from Products.AlphaFlow.exception import LifeCycleError
from Products.AlphaFlow import utils
(at)(at) -210,9 +210,9 (at)(at)
return controller.__of__(context)
-class LifeCycleManager(object):
+class InstanceManager(object):
- zope.interface.implements(ILifeCycleManager)
+ zope.interface.implements(IInstanceManager)
def createInstance(self, definition, context, container):
"""Create and return an ILifeCycleObject for a given definition."""
Modified: AlphaFlow/trunk/processmanager.py
==============================================================================
--- AlphaFlow/trunk/processmanager.py (original)
+++ AlphaFlow/trunk/processmanager.py Tue Apr 3 14:21:17 2007
(at)(at) -27,7 +27,7 (at)(at)
from Products.AlphaFlow.interfaces import \
IProcessManager, IAlphaFlowed, IWorkflowImporter, ILifeCycleController, \
- ILifeCycleManager
+ IInstanceManager
from Products.AlphaFlow import config, utils
from Products.AlphaFlow.adapters.alphaflowable import getAlphaFlowableAdapter
from Products.AlphaFlow.adapters.renderableadapter import getRenderableAdapter
(at)(at) -172,7 +172,7 (at)(at)
if not user.has_permission(config.INIT_PROCESS, obj):
raise zExceptions.Unauthorized("initProcess", obj,
config.INIT_PROCESS)
- manager = zope.component.getUtility(ILifeCycleManager)
+ manager = zope.component.getUtility(IInstanceManager)
instance = manager.createInstance(self.processes[process_id],
obj,
self.instances)
|
SVN: r4622 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-03 14:48:59 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 3 14:48:57 2007
New Revision: 4622
Log:
whitespace, indentation
Modified:
AlphaFlow/trunk/configure.zcml
Modified: AlphaFlow/trunk/configure.zcml
==============================================================================
--- AlphaFlow/trunk/configure.zcml (original)
+++ AlphaFlow/trunk/configure.zcml Tue Apr 3 14:48:57 2007
(at)(at) -26,16 +26,16 (at)(at)
<!-- Instance components -->
<subscriber handler=".instance.update_after_event" />
<adapter for=".process.Process
- zope.interface.Interface
- str"
- provides=".interfaces.ILifeCycleObject"
- factory=".instance.Instance"
+ zope.interface.Interface
+ str"
+ provides=".interfaces.ILifeCycleObject"
+ factory=".instance.Instance"
/>
<!-- Life cycle components -->
- <adapter
- for=".interfaces.ILifeCycleObject"
- provides=".interfaces.ILifeCycleController"
+ <adapter
+ for=".interfaces.ILifeCycleObject"
+ provides=".interfaces.ILifeCycleController"
factory=".lifecycle.LifeCycleControllerFactory"
/>
|
SVN: r4623 - in AlphaFlow/trunk: . tests
Thomas Lotze <tl(at)gocept.com> |
2007-04-03 14:56:32 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 3 14:56:30 2007
New Revision: 4623
Log:
improved documentation and test for IInstanceManager
Modified:
AlphaFlow/trunk/interfaces.py
AlphaFlow/trunk/tests/test_definition.py
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Tue Apr 3 14:56:30 2007
(at)(at) -848,15 +848,26 (at)(at)
class IInstanceManager(zope.interface.Interface):
- """A utility for managing life cycle objects."""
+ """A utility for managing life cycle objects.
- def createInstance(definition, container):
+ Life cycle objects happen to be those which are instances of some
+ definition, such as process instances (being instances of process
+ definitions) and work items (being instances of activities).
+
+ """
+
+ def createInstance(definition, context, container):
"""Create and return an ILifeCycleObject for a given definition.
- The object will also be placed with a generated id in the container
- and will be returned aqcuisition wrapped.
+ The object will also be placed in the container with a generated id,
+ and returned acquisition wrapped.
- For a definition to be instantiated, an ILifeCycleObjectFactory has to
- be available as an adapter for the definition.
+ For a definition to be instantiated, an ILifeCycleObject factory has
+ to be available as a multiadapter for the triple of the definition
+ object, the context object, and an id string.
+
+ definition: a process definition object, activity or similar
+ context: a content object the instance shall refer to
+ container: a container object to place the instance in
"""
Modified: AlphaFlow/trunk/tests/test_definition.py
==============================================================================
--- AlphaFlow/trunk/tests/test_definition.py (original)
+++ AlphaFlow/trunk/tests/test_definition.py Tue Apr 3 14:56:30 2007
(at)(at) -27,14 +27,15 (at)(at)
from Products.AlphaFlow.interfaces import \
IProcess, IAlphaFlowed, IInstance, IActivity, IActivityClass, IWorkItem, \
IAutomaticWorkItem, IAction, IAssignableActivity, IAutomaticActivity, \
- ILifeCycleController
+ ILifeCycleController, IInstanceManager
from Products.AlphaFlow.activities.interfaces import IExit, IPermissionSetting
from Products.AlphaFlow.xmlimport.interfaces import IWorkflowAttribute
from Products.AlphaFlow.xmlimport.attribute import WorkflowAttribute
from Products.AlphaFlow.xmlimport.domimporters import findAttrInAttributes
from Products.AlphaFlow.workflowedobject import AlphaFlowed
from Products.AlphaFlow.instance import Instance
-from Products.AlphaFlow.lifecycle import LifeCycleControllerFactory
+from Products.AlphaFlow.lifecycle import \
+ LifeCycleControllerFactory, InstanceManager
from Products.AlphaFlow.process import Process
from Products.AlphaFlow.activity import \
BaseAssignableActivity, BaseActivity, BaseAutomaticActivity, Exit
(at)(at) -93,7 +94,9 (at)(at)
(IExit, Exit),
(IActivity, BaseActivity),
(IAutomaticActivity, BaseAutomaticActivity),
- (IPermissionSetting, PermissionSetting)]
+ (IPermissionSetting, PermissionSetting),
+ (IInstanceManager, InstanceManager),
+ ]
# XXX [(IActivity, activity_registry.get(act_id))
|
SVN: r4624 - in AlphaFlow/trunk: . activities
Christian Theune <ct(at)gocept.com> |
2007-04-04 08:00:38 |
[ FULL ]
|
Author: ctheune
Date: Wed Apr 4 08:00:35 2007
New Revision: 4624
Log:
- moved iexit interface to avoid circular import during 3rd party product
tests
Modified:
AlphaFlow/trunk/activities/interfaces.py
AlphaFlow/trunk/activity.py
AlphaFlow/trunk/interfaces.py
Modified: AlphaFlow/trunk/activities/interfaces.py
==============================================================================
--- AlphaFlow/trunk/activities/interfaces.py (original)
+++ AlphaFlow/trunk/activities/interfaces.py Wed Apr 4 08:00:35 2007
(at)(at) -12,10 +12,6 (at)(at)
##############
# helper stuff
-class IExit(zope.interface.Interface):
- """Exit for INTaskActivity."""
-
-
class ICase(IExit):
"""Case for ISwitchActivity."""
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Wed Apr 4 08:00:35 2007
(at)(at) -15,7 +15,7 (at)(at)
from Products.AlphaFlow.interfaces import \
IActivity, IAutomaticActivity, IAssignableActivity, \
IActivityClass
-from Products.AlphaFlow.activities.interfaces import IExit # XXX move IExit
+from Products.AlphaFlow.interfaces import IExit # XXX move IExit
from Products.AlphaFlow import config, utils
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Wed Apr 4 08:00:35 2007
(at)(at) -285,6 +285,9 (at)(at)
"""
+class IExit(zope.interface.Interface):
+ """An exit."""
+
#######################
# content related stuff
|
SVN: r4625 - AlphaFlow/trunk/editor/browser
Roman Joost <rj(at)gocept.com> |
2007-04-04 09:33:35 |
[ FULL ]
|
Author: roman
Date: Wed Apr 4 09:33:33 2007
New Revision: 4625
Log:
- added missing view
Added:
AlphaFlow/trunk/editor/browser/editor.py
Added: AlphaFlow/trunk/editor/browser/editor.py
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/editor/browser/editor.py Wed Apr 4 09:33:33 2007
(at)(at) -0,0 +1,19 (at)(at)
+# -*- coding: iso-8859-1 -*-
+# Copyright (c) 2004-2006 gocept gmbh & co. kg
+# See also LICENSE.txt
+# $Id: instance.py 4614 2007-03-26 20:12:22Z ctheune $
+"""Process instance views"""
+
+import zope.component
+import Products.AlphaFlow.interfaces
+
+class Editor(object):
+
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
+
+
+ def getActivities(self):
+ return zope.component.getUtilitiesFor(
+ Products.AlphaFlow.interfaces.IActivityClass)
|
SVN: r4626 - in AlphaFlow/trunk: . tests
Thomas Lotze <tl(at)gocept.com> |
2007-04-04 10:15:40 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 4 10:15:36 2007
New Revision: 4626
Log:
ripped out the InstanceManager as this abstraction didn't make sense between
process instances and work items, after all
Modified:
AlphaFlow/trunk/configure.zcml
AlphaFlow/trunk/interfaces.py
AlphaFlow/trunk/lifecycle.py
AlphaFlow/trunk/processmanager.py
AlphaFlow/trunk/tests/test_definition.py
Modified: AlphaFlow/trunk/configure.zcml
==============================================================================
--- AlphaFlow/trunk/configure.zcml (original)
+++ AlphaFlow/trunk/configure.zcml Wed Apr 4 10:15:36 2007
(at)(at) -46,8 +46,6 (at)(at)
/>
</class>
- <utility factory=".lifecycle.InstanceManager" />
-
<!-- Other packages -->
<include package=".activities" />
<include package=".xmlimport" />
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Wed Apr 4 10:15:36 2007
(at)(at) -848,29 +848,3 (at)(at)
class ILifeCycleEvent(zope.app.event.interfaces.IObjectEvent):
"""Event that gets triggered when a life cycle state changes."""
-
-
-class IInstanceManager(zope.interface.Interface):
- """A utility for managing life cycle objects.
-
- Life cycle objects happen to be those which are instances of some
- definition, such as process instances (being instances of process
- definitions) and work items (being instances of activities).
-
- """
-
- def createInstance(definition, context, container):
- """Create and return an ILifeCycleObject for a given definition.
-
- The object will also be placed in the container with a generated id,
- and returned acquisition wrapped.
-
- For a definition to be instantiated, an ILifeCycleObject factory has
- to be available as a multiadapter for the triple of the definition
- object, the context object, and an id string.
-
- definition: a process definition object, activity or similar
- context: a content object the instance shall refer to
- container: a container object to place the instance in
-
- """
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Wed Apr 4 10:15:36 2007
(at)(at) -19,7 +19,7 (at)(at)
from Products.AlphaFlow import config
from Products.AlphaFlow.interfaces import \
- ILifeCycleObject, ILifeCycleController, ILifeCycleEvent, IInstanceManager
+ ILifeCycleObject, ILifeCycleController, ILifeCycleEvent
from Products.AlphaFlow.compatibility.factory import factory
from Products.AlphaFlow.exception import LifeCycleError
from Products.AlphaFlow import utils
(at)(at) -208,16 +208,3 (at)(at)
def LifeCycleControllerFactory(context):
controller = factory(LifeCycleController)(context)
return controller.__of__(context)
-
-
-class InstanceManager(object):
-
- zope.interface.implements(IInstanceManager)
-
- def createInstance(self, definition, context, container):
- """Create and return an ILifeCycleObject for a given definition."""
- id = utils.generateUniqueId(definition.getId())
- instance = zope.component.getMultiAdapter((definition, context, id),
- ILifeCycleObject)
- container._setObject(id, instance)
- return container[id]
Modified: AlphaFlow/trunk/processmanager.py
==============================================================================
--- AlphaFlow/trunk/processmanager.py (original)
+++ AlphaFlow/trunk/processmanager.py Wed Apr 4 10:15:36 2007
(at)(at) -27,7 +27,7 (at)(at)
from Products.AlphaFlow.interfaces import \
IProcessManager, IAlphaFlowed, IWorkflowImporter, ILifeCycleController, \
- IInstanceManager
+ ILifeCycleObject
from Products.AlphaFlow import config, utils
from Products.AlphaFlow.adapters.alphaflowable import getAlphaFlowableAdapter
from Products.AlphaFlow.adapters.renderableadapter import getRenderableAdapter
(at)(at) -172,11 +172,13 (at)(at)
if not user.has_permission(config.INIT_PROCESS, obj):
raise zExceptions.Unauthorized("initProcess", obj,
config.INIT_PROCESS)
- manager = zope.component.getUtility(IInstanceManager)
- instance = manager.createInstance(self.processes[process_id],
- obj,
- self.instances)
- return instance
+
+ definition = self.processes[process_id]
+ id = utils.generateUniqueId(definition.getId())
+ instance = zope.component.getMultiAdapter((definition, obj, id),
+ ILifeCycleObject)
+ self.instances._setObject(id, instance)
+ return self.instances[id]
security.declarePrivate("getInstance")
def getInstance(self, instance_id):
Modified: AlphaFlow/trunk/tests/test_definition.py
==============================================================================
--- AlphaFlow/trunk/tests/test_definition.py (original)
+++ AlphaFlow/trunk/tests/test_definition.py Wed Apr 4 10:15:36 2007
(at)(at) -27,7 +27,7 (at)(at)
from Products.AlphaFlow.interfaces import \
IProcess, IAlphaFlowed, IInstance, IActivity, IActivityClass, IWorkItem, \
IAutomaticWorkItem, IAction, IAssignableActivity, IAutomaticActivity, \
- ILifeCycleController, IInstanceManager
+ ILifeCycleController
from Products.AlphaFlow.activities.interfaces import IExit, IPermissionSetting
from Products.AlphaFlow.xmlimport.interfaces import IWorkflowAttribute
from Products.AlphaFlow.xmlimport.attribute import WorkflowAttribute
(at)(at) -35,7 +35,7 (at)(at)
from Products.AlphaFlow.workflowedobject import AlphaFlowed
from Products.AlphaFlow.instance import Instance
from Products.AlphaFlow.lifecycle import \
- LifeCycleControllerFactory, InstanceManager
+ LifeCycleControllerFactory
from Products.AlphaFlow.process import Process
from Products.AlphaFlow.activity import \
BaseAssignableActivity, BaseActivity, BaseAutomaticActivity, Exit
(at)(at) -95,7 +95,6 (at)(at)
(IActivity, BaseActivity),
(IAutomaticActivity, BaseAutomaticActivity),
(IPermissionSetting, PermissionSetting),
- (IInstanceManager, InstanceManager),
]
|
SVN: r4627 - AlphaFlow/trunk
Roman Joost <rj(at)gocept.com> |
2007-04-04 12:01:06 |
[ FULL ]
|
Author: roman
Date: Wed Apr 4 12:01:01 2007
New Revision: 4627
Log:
- fixed listPossibleActivities method
Modified:
AlphaFlow/trunk/process.py
Modified: AlphaFlow/trunk/process.py
==============================================================================
--- AlphaFlow/trunk/process.py (original)
+++ AlphaFlow/trunk/process.py Wed Apr 4 12:01:01 2007
(at)(at) -3,13 +3,15 (at)(at)
# $Id$
"""Process definitions"""
+import zope.component
import zope.interface
+
from OFS.Folder import Folder
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.AlphaFlow.interfaces import IProcess
+from Products.AlphaFlow.interfaces import IProcess, IActivityClass
from Products.AlphaFlow import utils, config
from Products.AlphaFlow.exception import UnknownActivityTypeError
(at)(at) -71,7 +73,8 (at)(at)
security.declareProtected(config.MANAGE_WORKFLOW,
"listPossibleActivities")
def listPossibleActivities(self):
- return activity_registry.keys()
+ tuples = zope.component.getUtilitiesFor(IActivityClass)
+ return [act for name, act in tuples]
security.declareProtected(config.MANAGE_WORKFLOW, "acquireProcess")
def acquireProcess(self):
|
SVN: r4628 - AlphaFlow/trunk/editor/browser/resources
Roman Joost <rj(at)gocept.com> |
2007-04-04 13:16:05 |
[ FULL ]
|
Author: roman
Date: Wed Apr 4 13:16:03 2007
New Revision: 4628
Log:
- mochikit external now uses Rev. 1279 from TRUNK
- added basic styling for Graph and sidebar panel
Modified:
AlphaFlow/trunk/editor/browser/resources/ (props changed)
AlphaFlow/trunk/editor/browser/resources/style.css
Modified: AlphaFlow/trunk/editor/browser/resources/style.css
==============================================================================
--- AlphaFlow/trunk/editor/browser/resources/style.css (original)
+++ AlphaFlow/trunk/editor/browser/resources/style.css Wed Apr 4 13:16:03 2007
(at)(at) -0,0 +1,7 (at)(at)
+#Sidepane {
+ float: left;
+}
+
+#Graph {
+ float: left;
+}
|
SVN: r4636 - AlphaFlow/trunk/editor/browser/resources
Roman Joost <rj(at)gocept.com> |
2007-04-05 14:17:11 |
[ FULL ]
|
Author: roman
Date: Thu Apr 5 14:17:09 2007
New Revision: 4636
Log:
- addded JS code for displaying more information for an activity
- added a few styling things
Added:
AlphaFlow/trunk/editor/browser/resources/editor.js
Modified:
AlphaFlow/trunk/editor/browser/resources/style.css
Added: AlphaFlow/trunk/editor/browser/resources/editor.js
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/editor/browser/resources/editor.js Thu Apr 5 14:17:09 2007
(at)(at) -0,0 +1,31 (at)(at)
+function ActivitiesPanel() {
+ this.contentElement = getElementsByTagAndClassName('div',
'ActivitiesPanel')[0];
+ var listitems = getElementsByTagAndClassName('li');
+ connect(this.contentElement, 'onclick', this, 'listItemClicked');
+}
+
+ActivitiesPanel.prototype.listItemClicked = function(event) {
+ var listitem = event.target().parentNode;
+ var url = listitem.getAttribute('value');
+ if (!url)
+ return false
+
+ this.loadActivityPreview(listitem, url + '/activity_preview')
+}
+
+ActivitiesPanel.prototype.loadActivityPreview = function(listitem, url) {
+ var d = doSimpleXMLHttpRequest(url);
+ d.addCallbacks(
+ function(result) {
+ var container = getElementsByTagAndClassName('span',
+ 'MoreInfoLink',
+ listitem)[0];
+ container.innerHTML = result.responseText;
+
+ }, alert);
+}
+
+var activityPanel;
+connect(window, 'onload', function(){
+ activityPanel = new ActivitiesPanel()
+});
Modified: AlphaFlow/trunk/editor/browser/resources/style.css
==============================================================================
--- AlphaFlow/trunk/editor/browser/resources/style.css (original)
+++ AlphaFlow/trunk/editor/browser/resources/style.css Thu Apr 5 14:17:09 2007
(at)(at) -5,3 +5,13 (at)(at)
#Graph {
float: left;
}
+
+.ActivitiesPanel ul li {
+ list-style-position: inside;
+}
+
+.MoreInfoLink {
+ color: blue;
+ text-decoration: underline;
+ cursor: pointer;
+}
|
SVN: r4637 - AlphaFlow/trunk/editor/browser
Roman Joost <rj(at)gocept.com> |
2007-04-05 14:17:57 |
[ FULL ]
|
Author: roman
Date: Thu Apr 5 14:17:56 2007
New Revision: 4637
Log:
- added macros and HTML snippet for more activity information
Added:
AlphaFlow/trunk/editor/browser/activitypreview.pt
AlphaFlow/trunk/editor/browser/standardmacros.pt
Added: AlphaFlow/trunk/editor/browser/activitypreview.pt
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/editor/browser/activitypreview.pt Thu Apr 5 14:17:56 2007
(at)(at) -0,0 +1,9 (at)(at)
+<span tal:omit-tag="">
+ <span class="MoreInfoLink">weniger</span>
+ <dl class="ActivityPreview">
+ <dt>Titel</dt>
+ <dd tal:content="context/title"> More information </dd>
+ <dt>Type</dt>
+ <dd tal:content="context/activity_type" />
+ </dl>
+</span>
Added: AlphaFlow/trunk/editor/browser/standardmacros.pt
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/editor/browser/standardmacros.pt Thu Apr 5 14:17:56 2007
(at)(at) -0,0 +1,33 (at)(at)
+<div>
+<form metal:define-macro="addActivityForm"
+ method="post"
+ tal:attributes="action
string:${context/(at)(at)absolute_url}/manage_addActivity">
+ <div class='form-label'>Add a new activity</div>
+
+ <table>
+ <tbody>
+ <tr>
+ <td>Id:</td>
+ <td>Action:</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="text" name="id"/>
+ </td>
+ <td>
+ <select name="activity">
+ <option
+ tal:repeat="act view/getActivities"
+ tal:attributes="value python:act[0]"
+ tal:content="python:act[0]">start</option>
+ </select>
+ </td>
+ <td>
+ <input type="submit" class='button' value="add"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</form>
+</div>
|
SVN: r4638 - AlphaFlow/trunk/editor/browser
Roman Joost <rj(at)gocept.com> |
2007-04-05 14:18:53 |
[ FULL ]
|
Author: roman
Date: Thu Apr 5 14:18:50 2007
New Revision: 4638
Log:
- registered standardmacros as a view
- added editor graph as a view
- registered mochikit directory as resourceDirectory
Modified:
AlphaFlow/trunk/editor/browser/configure.zcml
Modified: AlphaFlow/trunk/editor/browser/configure.zcml
==============================================================================
--- AlphaFlow/trunk/editor/browser/configure.zcml (original)
+++ AlphaFlow/trunk/editor/browser/configure.zcml Thu Apr 5 14:18:50 2007
(at)(at) -1,18 +1,49 (at)(at)
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:gs="http://namespaces.zope.org/genericsetup"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="alphaflow">
-
+
<browser:page
- for="*"
+ for="Products.AlphaFlow.interfaces.IProcess"
template="index.pt"
+ class=".editor.Editor"
permission="zope2.View"
name="editor.html"
/>
+ <browser:page
+ for="Products.AlphaFlow.interfaces.IProcess"
+ class=".editor.Graph"
+ permission="zope2.View"
+ name="graph"
+ attribute="getGraph"
+ />
+
+ <browser:page
+ for="Products.AlphaFlow.interfaces.IActivity"
+ template="activitypreview.pt"
+ name="activity_preview"
+ permission="zope2.View"
+ />
+
+ <browser:page
+ for="*"
+ template="standardmacros.pt"
+ name="standardmacros"
+ permission="zope2.View"
+ />
+
<browser:resource
name="style.css"
file="resources/style.css"
/>
+ <browser:resourceDirectory
+ name="mochikit"
+ directory="resources/mochikit"
+ />
+
+ <browser:resource
+ name="editor.js"
+ file="resources/editor.js"
+ />
</configure>
|
SVN: r4639 - AlphaFlow/trunk/editor/browser
Roman Joost <rj(at)gocept.com> |
2007-04-05 14:21:47 |
[ FULL ]
|
Author: roman
Date: Thu Apr 5 14:21:44 2007
New Revision: 4639
Log:
- added editor viewclass
- structural changes for index page
Modified:
AlphaFlow/trunk/editor/browser/editor.py
AlphaFlow/trunk/editor/browser/index.pt
Modified: AlphaFlow/trunk/editor/browser/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/browser/editor.py (original)
+++ AlphaFlow/trunk/editor/browser/editor.py Thu Apr 5 14:21:44 2007
(at)(at) -5,15 +5,59 (at)(at)
"""Process instance views"""
import zope.component
+import AccessControl
+import Globals
+
+import Products.CMFCore.utils
+import Products.Five
+
+import Products.AlphaFlow.config
import Products.AlphaFlow.interfaces
-class Editor(object):
- def __init__(self, context, request):
- self.context = context
- self.request = request
-
+class Editor(Products.Five.BrowserView):
+
+ security = AccessControl.ClassSecurityInfo()
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'getActivities')
def getActivities(self):
- return zope.component.getUtilitiesFor(
- Products.AlphaFlow.interfaces.IActivityClass)
+ """Returns a list of addable activities to this process."""
+ return self.context.listPossibleActivities()
+
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'listProcessActivities')
+ def listProcessActivities(self):
+ """Returns a list of dictionaries with information about activities in
+ this process.
+ """
+ activities = self.context.objectValues()
+ result = []
+
+ for act in activities:
+ info = {'icon' : act.icon,
+ 'title': act.title,
+ 'id' : act.getId(),
+ 'type': act.activity_type,
+ 'url': act.absolute_url(),
+ }
+ result.append(info)
+
+ return result
+
+Globals.InitializeClass(Editor)
+
+
+class Graph(Products.Five.BrowserView):
+
+ security = AccessControl.ClassSecurityInfo()
+
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'getGraph')
+ def getGraph(self):
+ """Returns graph data for this process"""
+ pm = Products.CMFCore.utils.getToolByName(self, 'workflow_manager')
+ return pm.renderProcess(self.context.id, kind='minimal',
+ REQUEST=self.request)
+
+Globals.InitializeClass(Graph)
Modified: AlphaFlow/trunk/editor/browser/index.pt
==============================================================================
--- AlphaFlow/trunk/editor/browser/index.pt (original)
+++ AlphaFlow/trunk/editor/browser/index.pt Thu Apr 5 14:21:44 2007
(at)(at) -1,37 +1,54 (at)(at)
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en"
+<html xmlns="http://www.w3.org/1999/xhtml"
+ tal:omit-tag=""><?xml version="1.0" encoding="utf-8"?>
+ <!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
metal:define-macro="master"
>
- <head>
- <title tal:content="here/title_or_id">Title</title>
- <style type="text/css" media="all"
+ <head>
+ <title tal:content="here/title_or_id">Title</title>
+ <style type="text/css" media="all"
tal:content="string:(at)import url(++resource++style.css);">
- (at)import url(style.css);
- </style>
-
- <!--<script type="text/javascript"-->
- <!-- tal:attributes="src
here/ecmascript/mochikit.js/absolute_url"></script>-->
-
- <base href="" tal:attributes="href python:request.URL1" />
- </head>
- <body>
- <div id="Menu">
- </div>
- <div id="DropShadow">
- </div>
+ (at)import url(style.css);
+ </style>
- <div id="Container">
- <h1>Workfloweditor</h1>
- <div id="Panels" metal:define-slot="panels">
- <hr />
+ <script type="text/javascript"
+ tal:attributes="src
string:${context/(at)(at)absolute_url}/++resource++mochikit/MochiKit.js"></script>
+ <script type="text/javascript"
+ tal:attributes="src
string:${context/(at)(at)absolute_url}/++resource++editor.js"></script>
+
+ <!--<base href="" tal:attributes="href python:request.URL1"
/>-->
+ </head>
+ <body>
+ <div id="Header">
+ <metal:macro use-macro="here/standardmacros/macros/addActivityForm"
/>
</div>
- <div id="Graph" metal:define-slot="graph">
- <!--<tal:graph-->
- <!-- tal:replace="structure
python:here.renderProcess(here.acquireProcess().getId(), format='svg',
kind='detailed')">-->
- <!--</tal:graph>-->
+ <div id="Container">
+ <h1>Workfloweditor: <span tal:content="here/title_or_id"
/></h1>
+ <div id="Sidepane" metal:define-slot="panels">
+ <h2>Workflow Activities:</h2>
+ <div class="ActivitiesPanel">
+ <ul tal:define="activities view/listProcessActivities">
+ <li tal:repeat="activity activities"
+ tal:attributes="class activity/type;
+ value activity/url">
+ <span tal:content="activity/id"
+ tal:attributes="title activity/title" />
+ <span class="MoreInfoLink">mehr</span>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div id="Graph" metal:define-slot="graph">
+ <h2>Graph</h2>
+ <img tal:attributes="src
string:${context/(at)(at)absolute_url}/(at)(at)graph" />
+ </div>
</div>
- </div>
-
- </body>
+
+ </body>
+ </html>
</html>
|
SVN: r4641 - AlphaFlow/trunk/editor/browser/resources
Roman Joost <rj(at)gocept.com> |
2007-04-05 17:07:27 |
[ FULL ]
|
Author: roman
Date: Thu Apr 5 17:07:25 2007
New Revision: 4641
Log:
- added more styling
Modified:
AlphaFlow/trunk/editor/browser/resources/style.css
Modified: AlphaFlow/trunk/editor/browser/resources/style.css
==============================================================================
--- AlphaFlow/trunk/editor/browser/resources/style.css (original)
+++ AlphaFlow/trunk/editor/browser/resources/style.css Thu Apr 5 17:07:25 2007
(at)(at) -1,9 +1,31 (at)(at)
+body {
+ margin:0;
+ padding: 0;
+}
+
+h1 {
+ font-size: 110%;
+}
+
+h2 {
+ font-size: 100%;
+}
+
+#Header {
+ padding: 0.5em;
+ background-color: #b7d774;
+ border-bottom: 1px solid #7c914e;
+}
#Sidepane {
float: left;
+ border-right: 1px dotted #b7d774;
+ padding: 0.5em;
}
#Graph {
float: left;
+ padding: 1em;
+ background-color: #e1e1e1;
}
.ActivitiesPanel ul li {
(at)(at) -15,3 +37,11 (at)(at)
text-decoration: underline;
cursor: pointer;
}
+
+.leftfloating {
+ float: left;
+}
+
+.rightfloating {
+ float: right;
+}
|
SVN: r4642 - in AlphaFlow/trunk: . activities
Thomas Lotze <tl(at)gocept.com> |
2007-04-10 13:26:46 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 10 13:26:43 2007
New Revision: 4642
Log:
made LifeCycleObjectBase inherit from atapi.BaseFolder
Modified:
AlphaFlow/trunk/activities/configuration.py
AlphaFlow/trunk/instance.py
AlphaFlow/trunk/lifecycle.py
AlphaFlow/trunk/workitem.py
Modified: AlphaFlow/trunk/activities/configuration.py
==============================================================================
--- AlphaFlow/trunk/activities/configuration.py (original)
+++ AlphaFlow/trunk/activities/configuration.py Tue Apr 10 13:26:43 2007
(at)(at) -49,17 +49,22 (at)(at)
# XXX security declaration?
def Schema(self):
- instance = self.getInstance()
- other = instance.Schema()
schema = self.schema.copy()
-
- activity = self.getActivity()
- configures = activity.configures
- for field in other.fields():
- # field.group is the activity_id
- if configures is None \
- or getattr(field, 'group', '') in configures:
- schema.addField(field)
+ try:
+ instance = self.getInstance()
+ except AttributeError:
+ # Not yet in context. Ignore this.
+ pass
+ else:
+ other = instance.Schema()
+
+ activity = self.getActivity()
+ configures = activity.configures
+ for field in other.fields():
+ # field.group is the activity_id
+ if configures is None \
+ or getattr(field, 'group', '') in configures:
+ schema.addField(field)
return schema
#####################
Modified: AlphaFlow/trunk/instance.py
==============================================================================
--- AlphaFlow/trunk/instance.py (original)
+++ AlphaFlow/trunk/instance.py Tue Apr 10 13:26:43 2007
(at)(at) -39,8 +39,8 (at)(at)
return
self._processmanager.listRelevantUsersForInstance(self._context)
-class Instance(LifeCycleObjectBase, utils.DynamicLocalRoleSupport,
- utils.ContentObjectRetrieverBase, BaseFolder):
+class Instance(utils.DynamicLocalRoleSupport,
+ utils.ContentObjectRetrieverBase, LifeCycleObjectBase):
zope.interface.implements(
IInstance,
(at)(at) -100,7 +100,7 (at)(at)
If this object is (directly) wrapped into an IAlphaFlowed,
it will return the url of the IAlphaFlowed object"""
- absurl = BaseFolder.absolute_url
+ absurl = Instance.inheritedAttribute("absolute_url")
if inner:
return absurl(self)
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Tue Apr 10 13:26:43 2007
(at)(at) -17,6 +17,8 (at)(at)
from zExceptions.ExceptionFormatter import format_exception
from Globals import InitializeClass
+from Products.Archetypes.atapi import BaseFolder
+
from Products.AlphaFlow import config
from Products.AlphaFlow.interfaces import \
ILifeCycleObject, ILifeCycleController, ILifeCycleEvent
(at)(at) -34,9 +36,13 (at)(at)
zope.interface.implements(ILifeCycleEvent)
-class LifeCycleObjectBase(object):
- """Mix-in base class for objects that are part of a workflow and have a
- life cycle.
+class LifeCycleObjectBase(BaseFolder):
+ """Mix-in base class for objects that have a life cycle.
+
+ In AlphaFlow, these happen to be just those objects that are instances of
+ some definition, such as process instances and work items. They may have
+ children (such as a process instance having a number of work items) and
+ the association is implemented as containment.
"""
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Tue Apr 10 13:26:43 2007
(at)(at) -104,8 +104,8 (at)(at)
return
self._processmanager.listRelevantUsersForWorkItem(self._context)
-class BaseWorkItem(LifeCycleObjectBase, DynamicLocalRoleSupport,
- ContentObjectRetrieverBase, atapi.BaseContent):
+class BaseWorkItem(DynamicLocalRoleSupport,
+ ContentObjectRetrieverBase, LifeCycleObjectBase):
zope.interface.implements(
IWorkItem, zope.app.annotation.interfaces.IAttributeAnnotatable)
(at)(at) -121,7 +121,7 (at)(at)
generated_by = None
generated_workitems = ()
- schema = atapi.BaseContent.schema.copy() + atapi.Schema((
+ schema = LifeCycleObjectBase.schema.copy() + atapi.Schema((
atapi.TextField("comment",
widget=atapi.TextAreaWidget(
description="Please enter any comments you "
(at)(at) -146,7 +146,7 (at)(at)
manage_options = \
({'label' : 'Overview', 'action' : 'manage_overview'},) + \
- atapi.BaseContent.manage_options
+ LifeCycleObjectBase.manage_options
# XXX security.declareProtected(ManagePortal, 'manage_overview')
manage_overview = PageTemplateFile('www/workitemOverview', globals())
(at)(at) -348,7 +348,7 (at)(at)
If this object is (directly) wrapped into an IAlphaFlowed,
it will return the url of the IAlphaFlowed object"""
- absurl = atapi.BaseContent.absolute_url
+ absurl = BaseWorkItem.inheritedAttribute("absolute_url")
if inner:
return absurl(self)
(at)(at) -485,22 +485,27 (at)(at)
security.declareProtected(config.WORK_WITH_PROCESS, "Schema")
def Schema(self):
schema = self.schema.copy()
- activity = self.getActivity()
- comment_field = schema['comment']
- comment_expr = activity.commentfield
+ try:
+ activity = self.getActivity()
+ except AttributeError:
+ # Not yet in context. Ignore this.
+ pass
+ else:
+ comment_field = schema['comment']
+ comment_expr = activity.commentfield
- # just make sure that the commentfield is set to default
- # behavior
- #if comment_expr:
- # widget = comment_field.widget
- # widget.visible = {'edit': True, 'view': 1}
- if comment_expr == "hidden":
- widget = comment_field.widget
- widget.visible = {'edit': -1, 'view': -1}
- comment_field.required = False
+ # just make sure that the commentfield is set to default
+ # behavior
+ #if comment_expr:
+ # widget = comment_field.widget
+ # widget.visible = {'edit': True, 'view': 1}
+ if comment_expr == "hidden":
+ widget = comment_field.widget
+ widget.visible = {'edit': -1, 'view': -1}
+ comment_field.required = False
- if comment_expr == "required":
- comment_field.required = True
+ if comment_expr == "required":
+ comment_field.required = True
return schema
|
SVN: r4643 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-10 13:33:56 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 10 13:33:54 2007
New Revision: 4643
Log:
removed explicit references to BaseFolder which are now through
LifeCycleObjectBase
Modified:
AlphaFlow/trunk/instance.py
Modified: AlphaFlow/trunk/instance.py
==============================================================================
--- AlphaFlow/trunk/instance.py (original)
+++ AlphaFlow/trunk/instance.py Tue Apr 10 13:33:54 2007
(at)(at) -16,7 +16,7 (at)(at)
from Products.CMFCore.utils import getToolByName
from Products.CMFCore import permissions
-from Products.Archetypes.public import BaseFolder, registerType
+from Products.Archetypes.public import registerType
from Products.AlphaFlow.interfaces import \
IInstance, IAlphaFlowed, IDaemonActivity, IWorkItemFactory, \
(at)(at) -57,7 +57,7 (at)(at)
# complete until we're back on the initial stack.
_creating = 0
- schema = BaseFolder.schema.copy()
+ schema = LifeCycleObjectBase.schema.copy()
schema["id"].write_permission = permissions.ManagePortal
schema['title'].required = False
schema["title"].write_permission = permissions.ManagePortal
(at)(at) -67,7 +67,7 (at)(at)
manage_options = \
({'label' : 'Overview', 'action' : 'manage_overview'},
) + \
- BaseFolder.manage_options
+ LifeCycleObjectBase.manage_options
manage_overview = PageTemplateFile('www/instanceOverview', globals())
(at)(at) -76,7 +76,7 (at)(at)
security.declareProtected(config.INIT_PROCESS, '__init__')
def __init__(self, process, object, id):
"""Initialize a new process instance."""
- BaseFolder.__init__(self, id)
+ LifeCycleObjectBase.__init__(self, id)
self.object = object.UID()
self.process_id = process.getId()
|
SVN: r4644 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-11 09:30:36 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 11 09:30:34 2007
New Revision: 4644
Log:
prevent life cycle object from getting completed as a side effect of being
terminated or reset
Modified:
AlphaFlow/trunk/lifecycle.py
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Wed Apr 11 09:30:34 2007
(at)(at) -149,6 +149,8 (at)(at)
def complete(self, comment):
"""Complete the life cycle instance object."""
+ if self.state in ("terminating", "resetting"):
+ return
if self.state != "active":
raise LifeCycleError(
"Can't complete instance that is `%s`." % self.state)
(at)(at) -162,6 +164,7 (at)(at)
if self.state == "ended":
raise LifeCycleError(
"Can't terminate instance that is already `ended`.")
+ self.state = "terminating"
self.__parent__.onTermination()
self.state = "ended"
self.recordEvent("terminate", "ended", comment)
(at)(at) -169,6 +172,7 (at)(at)
def reset(self, comment):
"""Reset the life cycle back to `new`."""
+ self.state = "resetting"
self.__parent__.onReset()
self.state = "new"
self.recordEvent("reset", "new", comment)
|
SVN: r4645 - in AlphaFlow/trunk: . aspects
Thomas Lotze <tl(at)gocept.com> |
2007-04-11 10:03:03 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 11 10:02:59 2007
New Revision: 4645
Log:
added some child management code to life cycle objects' hooks
Modified:
AlphaFlow/trunk/aspects/checkpoint.py
AlphaFlow/trunk/instance.py
AlphaFlow/trunk/lifecycle.py
AlphaFlow/trunk/workitem.py
Modified: AlphaFlow/trunk/aspects/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/aspects/checkpoint.py (original)
+++ AlphaFlow/trunk/aspects/checkpoint.py Wed Apr 11 10:02:59 2007
(at)(at) -9,6 +9,7 (at)(at)
import zope.interface
+import Products.AlphaFlow.lifecycle
import Products.AlphaFlow.aspects.interfaces
(at)(at) -23,42 +24,21 (at)(at)
self.aspects = persistent.list.PersistentList()
-class CheckpointInstance(persistent.Persistent):
+class CheckpointInstance(Products.AlphaFlow.lifecycle.LifeCycleObjectBase):
zope.interface.implements(
- Products.AlphaFlow.interfaces.ILifeCycleObject,
zope.app.annotation.interfaces.IAttributeAnnotatable)
+ log_name = "checkpoint"
+ log_children_name = "aspects"
+
def __init__(self, definition):
+ CheckpointInstance.inheritedAttribute("__init__")(self)
self.definition = persistent.wref.WeakRef(definition)
- self.generated = persistent.list.PersistentList()
def onStart(self):
for aspect in self.definition().aspects:
- inst = Products.AlphaFlow.interfaces.ILifeCycleInstance(aspect)
- inst = inst.__of__(self)
- self.generated.append(inst)
+ inst = self.createChild(aspect, "Aspect")
controller = ILifeCycleController(inst)
controller.start('Started by checkpoint.')
ILifeCycleController(self).complete('Completed all aspects.')
-
- def onTermination(self):
- for aspect in self.generated:
- controller = ILifeCycleController(aspect)
- if controller.state != 'ended':
- controller.terminate(
- 'Terminated due to termination of checkpoint.')
-
- def onReset(self):
- for aspect in self.generated:
- controller = ILifeCycleController(aspect)
- if controller.state != 'ended':
- controller.terminate(
- 'Terminated due to reset of checkpoint.')
-
- def onRecovery(self):
- for aspect in self.generated:
- controller = ILifeCycleController(aspect)
- if controller.state == 'failed':
- raise ValueError(
- "Can't recover while failed aspects are left.")
Modified: AlphaFlow/trunk/instance.py
==============================================================================
--- AlphaFlow/trunk/instance.py (original)
+++ AlphaFlow/trunk/instance.py Wed Apr 11 10:02:59 2007
(at)(at) -52,6 +52,9 (at)(at)
process_id = None
generated_workitems = ()
+ log_name = "instance"
+ log_children_name = "work items"
+
# This variable monitors the stack of createWorkitem calls within one
# request. We need this to defer the check whether the instance is
# complete until we're back on the initial stack.
(at)(at) -119,25 +122,20 (at)(at)
# IInstance
def onStart(self):
+ Instance.inheritedAttribute("onStart")(self)
start_activities = self.getProcess().startActivity
self.createWorkItems(start_activities, self)
- def onRecover(self):
- if len(self.getWorkItems("failed")) != 0:
- raise ValueError(
- "Can't recover while failed work items are left.")
+ def onRecovery(self):
+ Instance.inheritedAttribute("onRecovery")(self)
self.notifyWorkItemStateChange()
def onTermination(self):
- for wi in self.getWorkItems(state=None):
- wi_controller = ILifeCycleController(wi)
- if wi_controller.state in ["new", "active", "failed"]:
- wi_controller.terminate(
- "Automatically terminated due to termination of "
- "instance.")
+ Instance.inheritedAttribute("onTermination")(self)
self._unlink_content_instance()
def onCompletion(self):
+ Instance.inheritedAttribute("onCompletion")(self)
self._unlink_content_instance()
def _unlink_content_instance(self):
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Wed Apr 11 10:02:59 2007
(at)(at) -50,6 +50,15 (at)(at)
security = ClassSecurityInfo()
+ log_name = "parent"
+ log_children_name = "children"
+
+ def createChild(self, definition, name=None):
+ id = utils.generateUniqueId(name or definition.getId())
+ instance = ILifeCycleObject(definition)
+ self._setObject(id, instance)
+ return self[id]
+
def onStart(self):
"""Trigger that gets called after the object is started."""
(at)(at) -58,15 +67,30 (at)(at)
def onTermination(self):
"""Trigger that gets called before the object is terminated."""
+ for inst in self.objectValues():
+ controller = ILifeCycleController(inst)
+ if controller.state != 'ended':
+ controller.terminate(
+ 'Terminated due to termination of %s.' % self.log_name)
def onReset(self):
"""Trigger that gets called after the object is reset."""
+ for inst in self.objectValues():
+ controller = ILifeCycleController(inst)
+ if controller.state != 'ended':
+ controller.terminate(
+ 'Terminated due to reset of %s.' % self.log_name)
def onFailure(self):
"""Trigger that gets called before the object is declared failed."""
def onRecovery(self):
"""Trigger that gets called after the object is recovered."""
+ for inst in self.objectValues():
+ controller = ILifeCycleController(inst)
+ if controller.state == 'failed':
+ raise ValueError("Can't recover while failed %s are left." %
+ self.log_children_name)
# ZMI helper methods
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Wed Apr 11 10:02:59 2007
(at)(at) -121,6 +121,9 (at)(at)
generated_by = None
generated_workitems = ()
+ log_name = "work item"
+ log_children_name = "checkpoints"
+
schema = LifeCycleObjectBase.schema.copy() + atapi.Schema((
atapi.TextField("comment",
widget=atapi.TextAreaWidget(
|
SVN: r4646 - in AlphaFlow/trunk: . aspects aspects/tests
Thomas Lotze <tl(at)gocept.com> |
2007-04-11 11:26:41 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 11 11:26:39 2007
New Revision: 4646
Log:
clean-up: moved checkpoints.py out of aspects/, ripped out StartActivity
Added:
AlphaFlow/trunk/checkpoint.py
- copied unchanged from r4645, AlphaFlow/trunk/aspects/checkpoint.py
Removed:
AlphaFlow/trunk/aspects/checkpoint.py
AlphaFlow/trunk/aspects/start.py
AlphaFlow/trunk/aspects/tests/
Modified:
AlphaFlow/trunk/aspects/interfaces.py
AlphaFlow/trunk/interfaces.py
Modified: AlphaFlow/trunk/aspects/interfaces.py
==============================================================================
--- AlphaFlow/trunk/aspects/interfaces.py (original)
+++ AlphaFlow/trunk/aspects/interfaces.py Wed Apr 11 11:26:39 2007
(at)(at) -8,17 +8,3 (at)(at)
import zope.interface
-class IAspectDefinition(zope.interface.Interface):
- """Configuration data for an aspect."""
-
-
-class ICheckpointDefinition(zope.interface.Interface):
-
- aspects = zope.interface.Attribute("List of IAspectDefinition objects.")
-
-
-class IStartActivityAspect(zope.interface.Interface):
- """Starts a set of activities."""
-
- activities = zope.interface.Attribute(
- "List of activity ids that shall be started.")
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Wed Apr 11 11:26:39 2007
(at)(at) -285,6 +285,16 (at)(at)
"""
+
+class IAspectDefinition(zope.interface.Interface):
+ """Configuration data for an aspect."""
+
+
+class ICheckpointDefinition(zope.interface.Interface):
+
+ aspects = zope.interface.Attribute("List of IAspectDefinition objects.")
+
+
class IExit(zope.interface.Interface):
"""An exit."""
|
SVN: r4647 - LeuBsm/trunk
Christian Zagrodnick <cz(at)gocept.com> |
2007-04-11 13:34:22 |
[ FULL ]
|
Author: zagy
Date: Wed Apr 11 13:34:20 2007
New Revision: 4647
Log:
more sort criteria for nikos
Modified:
LeuBsm/trunk/niveau.py
Modified: LeuBsm/trunk/niveau.py
==============================================================================
--- LeuBsm/trunk/niveau.py (original)
+++ LeuBsm/trunk/niveau.py Wed Apr 11 13:34:20 2007
(at)(at) -82,10 +82,13 (at)(at)
res = cmp(self.getSchoolEdit(), other.getSchoolEdit())
if res:
return res
- s_ss = self.getPrimarySubjectEdit()
- o_ss = other.getPrimarySubjectEdit()
- return cmp(s_ss, o_ss)
-
+ res = cmp(self.getPrimarySubjectEdit(), other.getPrimarySubjectEdit())
+ if res:
+ return res
+ res = cmp(self.getDefaultClass(), other.getDefaultClass())
+ if res:
+ return res
+ return cmp(self.Title(), other.Title())
###########
# Accessors
|
SVN: r4648 - LeuBsm/trunk
Christian Zagrodnick <cz(at)gocept.com> |
2007-04-11 13:49:18 |
[ FULL ]
|
Author: zagy
Date: Wed Apr 11 13:49:16 2007
New Revision: 4648
Log:
changed text of nivau material upload
Modified:
LeuBsm/trunk/interfaces.py
Modified: LeuBsm/trunk/interfaces.py
==============================================================================
--- LeuBsm/trunk/interfaces.py (original)
+++ LeuBsm/trunk/interfaces.py Wed Apr 11 13:49:16 2007
(at)(at) -422,7 +422,10 (at)(at)
ExtFileField(
'data',
required=True,
- widget=ExtFileWidget(label="Datei", description="Wählen Sie eine
lokale Datei aus.", show_content_type=0)),
+ widget=ExtFileWidget(
+ label="Datei",
+ description="Wählen Sie eine lokale Datei aus.",
+ show_content_type=0)),
))
class IMaterial(Interface):
(at)(at) -573,8 +576,17 (at)(at)
schemata='page4',
edit_acessor='getRawNewFileTitle',
searchable=1,
- widget=StringWidget(label='10. Titel der Datei',
- description='Sie können hier eine Datei mit
Material zum Umsetzungsbeispiel hochladen. Die Datei sollte in einem der
folgenden Format sein: PDF, MS Office, OpenOffice, HTML, JPG, GIF. Wenn Sie
eine verlinkte Webseite hochladen wollen, so packen Sie alle zugehörigen
Dateien zuvor im ZIP-Format. Nach dem Speichern erhalten Sie die Möglichkeit
weitere Dateien hochzuladen.'),
+ widget=StringWidget(
+ label='10. Titel der Datei',
+ description=('Sie können hier die Datei mit der'
+ 'Niveaukonkretisierung hochladen. Die Datei sollte '
+ 'in einem der folgenden Format sein: PDF, MS Office,
'
+ 'OpenOffice, HTML, JPG, GIF. Wenn Sie eine verlinkte
'
+ 'Webseite hochladen wollen, so packen Sie alle '
+ 'zugehörigen Dateien zuvor im ZIP-Format. Nach dem '
+ 'Speichern erhalten Sie die Möglichkeit weitere '
+ 'Dateien mit Materialien zu dieser '
+ 'Niveaukonkretisierung hochzuladen.')),
),
FileField(
|
SVN: r4650 - LeuBsm/trunk
Christian Zagrodnick <cz(at)gocept.com> |
2007-04-11 14:42:16 |
[ FULL ]
|
Author: zagy
Date: Wed Apr 11 14:42:15 2007
New Revision: 4650
Log:
0.6.5
Modified:
LeuBsm/trunk/version.txt
Modified: LeuBsm/trunk/version.txt
==============================================================================
--- LeuBsm/trunk/version.txt (original)
+++ LeuBsm/trunk/version.txt Wed Apr 11 14:42:15 2007
(at)(at) -1 +1 (at)(at)
-0.6.4
+0.6.5
|
SVN: r4653 - AlphaFlow/trunk/editor/browser/resources
Roman Joost <rj(at)gocept.com> |
2007-04-11 15:17:02 |
[ FULL ]
|
Author: roman
Date: Wed Apr 11 15:17:00 2007
New Revision: 4653
Log:
- avoid flickering when panel is loaded
Modified:
AlphaFlow/trunk/editor/browser/resources/style.css
Modified: AlphaFlow/trunk/editor/browser/resources/style.css
==============================================================================
--- AlphaFlow/trunk/editor/browser/resources/style.css (original)
+++ AlphaFlow/trunk/editor/browser/resources/style.css Wed Apr 11 15:17:00 2007
(at)(at) -20,6 +20,7 (at)(at)
float: left;
border-right: 1px dotted #b7d774;
padding: 0.5em;
+ width: 21%;
}
#Graph {
|
SVN: r4654 - AlphaFlow/trunk/editor/browser/resources
Roman Joost <rj(at)gocept.com> |
2007-04-11 15:21:05 |
[ FULL ]
|
Author: roman
Date: Wed Apr 11 15:21:03 2007
New Revision: 4654
Log:
- feature to add new activities
- reload the graph without a page reload
- reload the activity panel without a page reload
Modified:
AlphaFlow/trunk/editor/browser/resources/editor.js
Modified: AlphaFlow/trunk/editor/browser/resources/editor.js
==============================================================================
--- AlphaFlow/trunk/editor/browser/resources/editor.js (original)
+++ AlphaFlow/trunk/editor/browser/resources/editor.js Wed Apr 11 15:21:03 2007
(at)(at) -1,6 +1,60 (at)(at)
+function Editor() {
+ this.sidebar = getElement('Sidepane');
+ this.baseURL = this.sidebar.getAttribute('base');
+ this.contentElement = getElementsByTagAndClassName('div',
'ActivitiesPanel')[0];
+ this.addForm = getElement('addActivityForm');
+
+ this.loadPanels();
+ //connect(this.addForm, 'onsubmit', this, 'addActivity');
+}
+
+/* XXX works currently only for activityPanel and somehow this should be
+ * implemented simpler */
+Editor.prototype.loadPanels = function() {
+ var url = this.baseURL + '/activitypanel';
+ var d = doSimpleXMLHttpRequest(url);
+ d.addCallbacks(
+ function(result) {
+ var sidebar = this.editor.sidebar
+ hideElement(sidebar);
+ sidebar.innerHTML = result.responseText;
+ appear(sidebar);
+
+ // initialize the Objects
+ activityPanel = new ActivitiesPanel();
+ }, alert);
+}
+Editor.prototype.reloadPanels = function() {
+ var url = this.baseURL + '/activitypanel';
+ var d = doSimpleXMLHttpRequest(url);
+ d.addCallbacks(
+ function(result) {
+ var sidebar = this.editor.sidebar
+ sidebar.innerHTML = result.responseText;
+ }, alert);
+}
+Editor.prototype.addActivity = function(event) {
+ //var form = event.target();
+ var form = event;
+ var toSend = []
+ for (var i=0; i<form.elements.length; i++)
+ toSend[form.elements[i].name] = form.elements[i].value;
+
+ var d = doSimpleXMLHttpRequest(form.action, toSend);
+
+ d.addCallbacks(
+ function(result) {
+ this.editor.reloadPanels();
+ this.canvas.reload();
+ }, alert);
+ return false;
+}
+
+
+
+
function ActivitiesPanel() {
this.contentElement = getElementsByTagAndClassName('div',
'ActivitiesPanel')[0];
- var listitems = getElementsByTagAndClassName('li');
connect(this.contentElement, 'onclick', this, 'listItemClicked');
}
(at)(at) -10,22 +64,40 (at)(at)
if (!url)
return false
- this.loadActivityPreview(listitem, url + '/activity_preview')
+ this.loadActivityPreview(listitem, url + '/activitypreview')
}
ActivitiesPanel.prototype.loadActivityPreview = function(listitem, url) {
var d = doSimpleXMLHttpRequest(url);
d.addCallbacks(
function(result) {
- var container = getElementsByTagAndClassName('span',
- 'MoreInfoLink',
- listitem)[0];
- container.innerHTML = result.responseText;
-
+ var container = getElementsByTagAndClassName('span',
+ 'MoreInfoLink',
+ listitem)[0];
+ container.innerHTML = result.responseText;
}, alert);
}
-var activityPanel;
+
+
+function Canvas() {
+ this.contentElement = getElement('Graph');
+ this.dummy = 1;
+ // temporary for testing reload
+ var temp = getElement('reloadbutton');
+ connect(temp, 'onclick', this, 'reload');
+}
+
+Canvas.prototype.reload = function() {
+ var img = getFirstElementByTagAndClassName('img', '',
this.contentElement);
+ var url = this.contentElement.getAttribute('imgurl');
+ img.src = url + '?dummy=parameter'+ this.dummy++;
+}
+
+var canvas;
+var editor;
+var activityPanel = null;
connect(window, 'onload', function(){
- activityPanel = new ActivitiesPanel()
+ editor = new Editor();
+ canvas = new Canvas();
});
|
SVN: r4655 - AlphaFlow/trunk/editor/browser
Roman Joost <rj(at)gocept.com> |
2007-04-11 15:25:46 |
[ FULL ]
|
Author: roman
Date: Wed Apr 11 15:25:42 2007
New Revision: 4655
Log:
- new methods for graph reload, new activities and activity panel
Added:
AlphaFlow/trunk/editor/browser/activitypanel.pt
Modified:
AlphaFlow/trunk/editor/browser/configure.zcml
AlphaFlow/trunk/editor/browser/editor.py
AlphaFlow/trunk/editor/browser/index.pt
AlphaFlow/trunk/editor/browser/standardmacros.pt
Added: AlphaFlow/trunk/editor/browser/activitypanel.pt
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/editor/browser/activitypanel.pt Wed Apr 11 15:25:42 2007
(at)(at) -0,0 +1,12 (at)(at)
+<div class="ActivitiesPanel">
+ <h2>Workflow Activities:</h2>
+ <ul tal:define="activities view/listProcessActivities">
+ <li tal:repeat="activity activities"
+ tal:attributes="class activity/type;
+ value activity/url">
+ <span tal:content="activity/id"
+ tal:attributes="title activity/title" />
+ <span class="MoreInfoLink">mehr</span>
+ </li>
+ </ul>
+</div>
Modified: AlphaFlow/trunk/editor/browser/configure.zcml
==============================================================================
--- AlphaFlow/trunk/editor/browser/configure.zcml (original)
+++ AlphaFlow/trunk/editor/browser/configure.zcml Wed Apr 11 15:25:42 2007
(at)(at) -20,9 +20,25 (at)(at)
/>
<browser:page
+ for="Products.AlphaFlow.interfaces.IProcess"
+ class=".editor.ActivityForm"
+ name="addNewActivity"
+ attribute="addNewActivity"
+ permission="zope2.View"
+ />
+
+ <browser:page
for="Products.AlphaFlow.interfaces.IActivity"
template="activitypreview.pt"
- name="activity_preview"
+ name="activitypreview"
+ permission="zope2.View"
+ />
+
+ <browser:page
+ for="Products.AlphaFlow.interfaces.IProcess"
+ template="activitypanel.pt"
+ class=".editor.ActivityPanel"
+ name="activitypanel"
permission="zope2.View"
/>
(at)(at) -33,6 +49,7 (at)(at)
permission="zope2.View"
/>
+ <!-- Resources -->
<browser:resource
name="style.css"
file="resources/style.css"
Modified: AlphaFlow/trunk/editor/browser/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/browser/editor.py (original)
+++ AlphaFlow/trunk/editor/browser/editor.py Wed Apr 11 15:25:42 2007
(at)(at) -5,6 +5,7 (at)(at)
"""Process instance views"""
import zope.component
+import zope.app.traversing.browser
import AccessControl
import Globals
(at)(at) -16,7 +17,7 (at)(at)
class Editor(Products.Five.BrowserView):
-
+
security = AccessControl.ClassSecurityInfo()
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
(at)(at) -25,6 +26,13 (at)(at)
"""Returns a list of addable activities to this process."""
return self.context.listPossibleActivities()
+Globals.InitializeClass(Editor)
+
+
+class ActivityPanel(Products.Five.BrowserView):
+
+ security = AccessControl.ClassSecurityInfo()
+
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'listProcessActivities')
def listProcessActivities(self):
(at)(at) -45,8 +53,21 (at)(at)
return result
-Globals.InitializeClass(Editor)
-
+Globals.InitializeClass(ActivityPanel)
+
+
+class ActivityForm(Products.Five.BrowserView):
+
+ security = AccessControl.ClassSecurityInfo()
+
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'addNewActivity')
+ def addNewActivity(self, id, activity):
+ """Returns graph data for this process"""
+ self.context.manage_addActivity(activity, self.request)
+
+Globals.InitializeClass(ActivityForm)
+
class Graph(Products.Five.BrowserView):
(at)(at) -56,7 +77,7 (at)(at)
'getGraph')
def getGraph(self):
"""Returns graph data for this process"""
- pm = Products.CMFCore.utils.getToolByName(self, 'workflow_manager')
+ pm = Products.CMFCore.utils.getToolByName(self, 'workflow_manager')
return pm.renderProcess(self.context.id, kind='minimal',
REQUEST=self.request)
Modified: AlphaFlow/trunk/editor/browser/index.pt
==============================================================================
--- AlphaFlow/trunk/editor/browser/index.pt (original)
+++ AlphaFlow/trunk/editor/browser/index.pt Wed Apr 11 15:25:42 2007
(at)(at) -25,27 +25,21 (at)(at)
</head>
<body>
<div id="Header">
+ <h1 class="rightfloating">
+ Workfloweditor: <span tal:content="here/title_or_id" />
+ </h1>
<metal:macro use-macro="here/standardmacros/macros/addActivityForm"
/>
+ <a href="javascript: void(null)" id="reloadbutton">Reload
canvas</a>
</div>
<div id="Container">
- <h1>Workfloweditor: <span tal:content="here/title_or_id"
/></h1>
- <div id="Sidepane" metal:define-slot="panels">
- <h2>Workflow Activities:</h2>
- <div class="ActivitiesPanel">
- <ul tal:define="activities view/listProcessActivities">
- <li tal:repeat="activity activities"
- tal:attributes="class activity/type;
- value activity/url">
- <span tal:content="activity/id"
- tal:attributes="title activity/title" />
- <span class="MoreInfoLink">mehr</span>
- </li>
- </ul>
- </div>
+ <div id="Sidepane" metal:define-slot="panels"
+ tal:attributes="base view/request/URL1">
</div>
- <div id="Graph" metal:define-slot="graph">
+ <div id="Graph" metal:define-slot="graph"
+ tal:define="imgurl
string:${context/(at)(at)absolute_url}/(at)(at)graph"
+ tal:attributes="imgurl imgurl">
<h2>Graph</h2>
- <img tal:attributes="src
string:${context/(at)(at)absolute_url}/(at)(at)graph" />
+ <img tal:attributes="src imgurl" />
</div>
</div>
Modified: AlphaFlow/trunk/editor/browser/standardmacros.pt
==============================================================================
--- AlphaFlow/trunk/editor/browser/standardmacros.pt (original)
+++ AlphaFlow/trunk/editor/browser/standardmacros.pt Wed Apr 11 15:25:42 2007
(at)(at) -1,7 +1,8 (at)(at)
<div>
-<form metal:define-macro="addActivityForm"
- method="post"
- tal:attributes="action
string:${context/(at)(at)absolute_url}/manage_addActivity">
+<form id="addActivityForm"
+ metal:define-macro="addActivityForm"
+ action="(at)(at)addNewActivity"
+ onsubmit="return editor.addActivity(this);">
<div class='form-label'>Add a new activity</div>
<table>
|
SVN: r4656 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-11 15:57:39 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 11 15:57:37 2007
New Revision: 4656
Log:
clean-up after moving ICheckpointDefinition out of aspects package
Modified:
AlphaFlow/trunk/checkpoint.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Wed Apr 11 15:57:37 2007
(at)(at) -10,13 +10,12 (at)(at)
import zope.interface
import Products.AlphaFlow.lifecycle
-import Products.AlphaFlow.aspects.interfaces
class CheckpointDefinition(persistent.Persistent):
zope.interface.implements(
- Products.AlphaFlow.aspects.interfaces.ICheckpointDefinition)
+ Products.AlphaFlow.interfaces.ICheckpointDefinition)
aspects = []
|
SVN: r4658 - AlphaFlow/trunk/editor/browser/resources
Roman Joost <rj(at)gocept.com> |
2007-04-11 16:27:56 |
[ FULL ]
|
Author: roman
Date: Wed Apr 11 16:27:55 2007
New Revision: 4658
Log:
- moved external to mochikit to resources directory one level up
- moved resource files in resources dir one level up
Removed:
AlphaFlow/trunk/editor/browser/resources/editor.js
AlphaFlow/trunk/editor/browser/resources/style.css
Modified:
AlphaFlow/trunk/editor/browser/resources/ (props changed)
|
SVN: r4660 - in AlphaFlow/trunk/editor: . activity
Roman Joost <rj(at)gocept.com> |
2007-04-11 17:40:55 |
[ FULL ]
|
Author: roman
Date: Wed Apr 11 17:40:52 2007
New Revision: 4660
Log:
- moved generic html code to standardmacros
- added new template for activity editor
- templates for editor and activity editor now use standardmacros
Added:
AlphaFlow/trunk/editor/activity/
AlphaFlow/trunk/editor/activity/__init__.py
AlphaFlow/trunk/editor/activity/configure.zcml
AlphaFlow/trunk/editor/activity/editActivity.pt
Modified:
AlphaFlow/trunk/editor/configure.zcml
AlphaFlow/trunk/editor/index.pt
AlphaFlow/trunk/editor/standardmacros.pt
Added: AlphaFlow/trunk/editor/activity/__init__.py
==============================================================================
Added: AlphaFlow/trunk/editor/activity/configure.zcml
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/editor/activity/configure.zcml Wed Apr 11 17:40:52 2007
(at)(at) -0,0 +1,13 (at)(at)
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="alphaflow">
+
+ <browser:page
+ for="Products.AlphaFlow.interfaces.IActivity"
+ template="editActivity.pt"
+ permission="zope2.View"
+ name="editActivity.html"
+ />
+
+</configure>
Added: AlphaFlow/trunk/editor/activity/editActivity.pt
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/editor/activity/editActivity.pt Wed Apr 11 17:40:52 2007
(at)(at) -0,0 +1,7 (at)(at)
+<html xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="here/standardmacros/macros/pagemaster">
+
+ <div metal:fill-slot="graph">
+ graph comes here
+ </div>
+</html>
Modified: AlphaFlow/trunk/editor/configure.zcml
==============================================================================
--- AlphaFlow/trunk/editor/configure.zcml (original)
+++ AlphaFlow/trunk/editor/configure.zcml Wed Apr 11 17:40:52 2007
(at)(at) -63,4 +63,6 (at)(at)
name="editor.js"
file="resources/editor.js"
/>
+
+ <include package=".activity" />
</configure>
Modified: AlphaFlow/trunk/editor/index.pt
==============================================================================
--- AlphaFlow/trunk/editor/index.pt (original)
+++ AlphaFlow/trunk/editor/index.pt Wed Apr 11 17:40:52 2007
(at)(at) -1,48 +1,17 (at)(at)
-<html xmlns="http://www.w3.org/1999/xhtml"
- tal:omit-tag=""><?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en"
- xmlns:tal="http://xml.zope.org/namespaces/tal"
- xmlns:metal="http://xml.zope.org/namespaces/metal"
- metal:define-macro="master"
- >
- <head>
- <title tal:content="here/title_or_id">Title</title>
- <style type="text/css" media="all"
- tal:content="string:(at)import url(++resource++style.css);">
- (at)import url(style.css);
- </style>
-
- <script type="text/javascript"
- tal:attributes="src
string:${context/(at)(at)absolute_url}/++resource++mochikit/MochiKit.js"></script>
+<html xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="here/standardmacros/macros/pagemaster">
+ <metal:javascript fill-slot="javascript">
<script type="text/javascript"
tal:attributes="src
string:${context/(at)(at)absolute_url}/++resource++editor.js"></script>
+ </metal:javascript>
- <!--<base href="" tal:attributes="href python:request.URL1"
/>-->
- </head>
<body>
<div id="Header">
- <h1 class="rightfloating">
- Workfloweditor: <span tal:content="here/title_or_id" />
- </h1>
- <metal:macro use-macro="here/standardmacros/macros/addActivityForm"
/>
- <a href="javascript: void(null)" id="reloadbutton">Reload
canvas</a>
- </div>
- <div id="Container">
- <div id="Sidepane" metal:define-slot="panels"
- tal:attributes="base view/request/URL1">
- </div>
- <div id="Graph" metal:define-slot="graph"
- tal:define="imgurl
string:${context/(at)(at)absolute_url}/(at)(at)graph"
- tal:attributes="imgurl imgurl">
- <h2>Graph</h2>
- <img tal:attributes="src imgurl" />
+ <div metal:fill-slot="headerContents">
+ <metal:macro
use-macro="here/standardmacros/macros/addActivityForm" />
+ <a href="javascript: void(null)" id="reloadbutton">Reload
canvas</a>
</div>
</div>
</body>
- </html>
</html>
Modified: AlphaFlow/trunk/editor/standardmacros.pt
==============================================================================
--- AlphaFlow/trunk/editor/standardmacros.pt (original)
+++ AlphaFlow/trunk/editor/standardmacros.pt Wed Apr 11 17:40:52 2007
(at)(at) -1,34 +1,84 (at)(at)
<div>
-<form id="addActivityForm"
- metal:define-macro="addActivityForm"
- action="(at)(at)addNewActivity"
- onsubmit="return editor.addActivity(this);">
- <div class='form-label'>Add a new activity</div>
-
- <table>
- <tbody>
- <tr>
- <td>Id:</td>
- <td>Action:</td>
- <td> </td>
- </tr>
- <tr>
- <td>
- <input type="text" name="id"/>
- </td>
- <td>
- <select name="activity">
- <option
- tal:repeat="act view/getActivities"
- tal:attributes="value python:act[0]"
- tal:content="python:act[0]">start</option>
- </select>
- </td>
- <td>
- <input type="submit" class='button' value="add"/>
- </td>
- </tr>
- </tbody>
- </table>
-</form>
+ <html xmlns="http://www.w3.org/1999/xhtml"
+ metal:define-macro="pagemaster"
+ tal:omit-tag=""><?xml version="1.0" encoding="utf-8"?>
+ <!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en"
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ >
+ <head>
+ <title tal:content="here/title_or_id">Title</title>
+ <style type="text/css" media="all"
+ tal:content="string:(at)import url(++resource++style.css);">
+ (at)import url(style.css);
+ </style>
+
+ <script type="text/javascript"
+ tal:attributes="src
string:${context/(at)(at)absolute_url}/++resource++mochikit/MochiKit.js"></script>
+ <metal:javascript define-slot="javascript" />
+
+ </head>
+ <body>
+ <div id="Header">
+ <h1 class="rightfloating">
+ Workfloweditor: <span tal:content="here/title_or_id" />
+ </h1>
+ <metal:header metal:define-slot="headerContents">
+ </metal:header>
+ </div>
+ <div id="Container">
+ <div id="Sidepane"
+ tal:attributes="base view/request/URL1">
+ <metal:slot define-slot="sidepane" />
+ </div>
+
+ <div id="Graph" metal:define-slot="graph"
+ tal:define="imgurl
string:${context/(at)(at)absolute_url}/(at)(at)graph"
+ tal:attributes="imgurl imgurl">
+ <h2>Graph</h2>
+ <img tal:attributes="src imgurl" />
+ </div>
+ </div>
+
+ </body>
+ </html>
+ </html>
+
+ <form id="addActivityForm"
+ metal:define-macro="addActivityForm"
+ action="(at)(at)addNewActivity"
+ onsubmit="return editor.addActivity(this);">
+ <div class='form-label'>Add a new activity</div>
+
+ <table>
+ <tbody>
+ <tr>
+ <td>Id:</td>
+ <td>Action:</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="text" name="id"/>
+ </td>
+ <td>
+ <select name="activity">
+ <option
+ tal:repeat="act view/getActivities"
+ tal:attributes="value python:act[0]"
+ tal:content="python:act[0]">start</option>
+ </select>
+ </td>
+ <td>
+ <input type="submit" class='button' value="add"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </form>
+
</div>
|
SVN: r4661 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-12 06:42:32 |
[ FULL ]
|
Author: thomas
Date: Thu Apr 12 06:42:19 2007
New Revision: 4661
Log:
made activities Folders
Modified:
AlphaFlow/trunk/activity.py
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Thu Apr 12 06:42:19 2007
(at)(at) -8,7 +8,7 (at)(at)
from Persistence import Persistent
from AccessControl import ClassSecurityInfo, getSecurityManager, Unauthorized
from OFS.PropertyManager import PropertyManager
-from OFS.SimpleItem import SimpleItem
+from OFS.Folder import Folder
from Products.Archetypes import public as atapi
(at)(at) -33,7 +33,7 (at)(at)
self.activities = activities
-class BaseActivity(PropertyManager, SimpleItem):
+class BaseActivity(PropertyManager, Folder):
"""A base class to implement activities"""
zope.interface.implements(IActivity)
(at)(at) -122,8 +122,7 (at)(at)
security = ClassSecurityInfo()
icon = "misc_/AlphaFlow/baseautomaticactivity"
- manage_options = (PropertyManager.manage_options + \
- SimpleItem.manage_options)
+ manage_options = (PropertyManager.manage_options + Folder.manage_options)
_properties = PropertyManager._properties + \
({'id': 'continue_activity', 'type': 'multiple selection',
|
SVN: r4662 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-12 09:11:03 |
[ FULL ]
|
Author: thomas
Date: Thu Apr 12 09:10:49 2007
New Revision: 4662
Log:
Folder is already a PropertyManager
Modified:
AlphaFlow/trunk/activity.py
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Thu Apr 12 09:10:49 2007
(at)(at) -7,7 +7,6 (at)(at)
from Globals import InitializeClass
from Persistence import Persistent
from AccessControl import ClassSecurityInfo, getSecurityManager, Unauthorized
-from OFS.PropertyManager import PropertyManager
from OFS.Folder import Folder
from Products.Archetypes import public as atapi
(at)(at) -33,7 +32,7 (at)(at)
self.activities = activities
-class BaseActivity(PropertyManager, Folder):
+class BaseActivity(Folder):
"""A base class to implement activities"""
zope.interface.implements(IActivity)
(at)(at) -122,9 +121,9 (at)(at)
security = ClassSecurityInfo()
icon = "misc_/AlphaFlow/baseautomaticactivity"
- manage_options = (PropertyManager.manage_options + Folder.manage_options)
+ manage_options = (Folder.manage_options)
- _properties = PropertyManager._properties + \
+ _properties = Folder._properties + \
({'id': 'continue_activity', 'type': 'multiple selection',
'mode': 'w', 'select_variable': 'listActivityIds'},
)
|
SVN: r4663 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-12 10:04:53 |
[ FULL ]
|
Author: thomas
Date: Thu Apr 12 10:04:37 2007
New Revision: 4663
Log:
pass an ID to the LifeCycleObject constructor since it is a BaseFolder
Modified:
AlphaFlow/trunk/checkpoint.py
AlphaFlow/trunk/lifecycle.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Thu Apr 12 10:04:37 2007
(at)(at) -31,8 +31,8 (at)(at)
log_name = "checkpoint"
log_children_name = "aspects"
- def __init__(self, definition):
- CheckpointInstance.inheritedAttribute("__init__")(self)
+ def __init__(self, definition, id):
+ CheckpointInstance.inheritedAttribute("__init__")(self, id)
self.definition = persistent.wref.WeakRef(definition)
def onStart(self):
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Thu Apr 12 10:04:37 2007
(at)(at) -9,6 +9,7 (at)(at)
import persistent
import zope.interface
+import zope.component
import zope.event
import zope.app.event
import DateTime
(at)(at) -55,7 +56,8 (at)(at)
def createChild(self, definition, name=None):
id = utils.generateUniqueId(name or definition.getId())
- instance = ILifeCycleObject(definition)
+ instance = zope.component.getMultiAdapter((definition, id),
+ ILifeCycleObject)
self._setObject(id, instance)
return self[id]
|
SVN: r4664 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-12 13:03:09 |
[ FULL ]
|
Author: thomas
Date: Thu Apr 12 13:02:55 2007
New Revision: 4664
Log:
prevent LifeCycleController from getting into the acquisition chain
Modified:
AlphaFlow/trunk/lifecycle.py
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Thu Apr 12 13:02:55 2007
(at)(at) -170,7 +170,7 (at)(at)
raise LifeCycleError("Can't start instance that is not `new`.")
self.state = 'active'
self.recordEvent("start", "active", comment)
- self.__parent__.onStart()
+ self.__parent__.aq_inner.onStart()
zope.event.notify(LifeCycleEvent(self.__parent__))
def complete(self, comment):
|
SVN: r4665 - AlphaFlow/trunk/www
Roman Joost <rj(at)gocept.com> |
2007-04-13 01:14:31 |
[ FULL ]
|
Author: roman
Date: Thu Apr 12 17:23:16 2007
New Revision: 4665
Log:
- added link to editor
Added:
AlphaFlow/trunk/www/edit_process.gif (contents, props changed)
Modified:
AlphaFlow/trunk/www/definitions.zpt
AlphaFlow/trunk/www/processOverview.zpt
Modified: AlphaFlow/trunk/www/definitions.zpt
==============================================================================
--- AlphaFlow/trunk/www/definitions.zpt (original)
+++ AlphaFlow/trunk/www/definitions.zpt Thu Apr 12 17:23:16 2007
(at)(at) -16,6 +16,7 (at)(at)
<table tal:condition="processes" class="pagewidth">
<tr class="list-header">
<th>Process</th>
+ <th>Edit</th>
<th>Delete</th>
</tr>
(at)(at) -30,6 +31,13 (at)(at)
tal:condition="process/validation_errors" />
</td>
<td class="form-text">
+ <a href="#"
+ tal:attributes="href
+ string:${process/absolute_url}/editor.html">
+ <img border="0" src="/misc_/AlphaFlow/edit_process.gif"
/>
+ </a>
+ </td>
+ <td class="form-text">
<a href="#"
tal:attributes="href
string:${here/absolute_url}/manage_delProcess?id=${process/getId}"><img
border="0" src="/misc_/AlphaFlow/trash.gif"/></a>
</td>
Added: AlphaFlow/trunk/www/edit_process.gif
==============================================================================
Binary file. No diff available.
Modified: AlphaFlow/trunk/www/processOverview.zpt
==============================================================================
--- AlphaFlow/trunk/www/processOverview.zpt (original)
+++ AlphaFlow/trunk/www/processOverview.zpt Thu Apr 12 17:23:16 2007
(at)(at) -98,7 +98,8 (at)(at)
<select name="activity">
<option
tal:repeat="act here/listPossibleActivities"
- tal:attributes="value act"
tal:content="act">start</option>
+ tal:attributes="value python:act[0]"
+ tal:content="python:act[0]">start</option>
</select>
</td>
<td>
|
SVN: r4666 - AlphaFlow/trunk
Roman Joost <rj(at)gocept.com> |
2007-04-13 01:34:54 |
[ FULL ]
|
Author: roman
Date: Thu Apr 12 17:24:28 2007
New Revision: 4666
Log:
- set the id of an activity when it is added
- fixed method listPossibleActivities
Modified:
AlphaFlow/trunk/process.py
Modified: AlphaFlow/trunk/process.py
==============================================================================
--- AlphaFlow/trunk/process.py (original)
+++ AlphaFlow/trunk/process.py Thu Apr 12 17:24:28 2007
(at)(at) -57,9 +57,11 (at)(at)
uid = utils.generateUniqueId(activity)
factory = zope.component.getUtility(IActivityClass, name=activity)
self[uid] = factory()
- if REQUEST is not None:
- REQUEST.RESPONSE.redirect(self.absolute_url() +
- "/processes/%s/views" % self.id)
+ self[uid].id = uid
+ return self[uid]
+ #if REQUEST is not None:
+ # REQUEST.RESPONSE.redirect(self.absolute_url() +
+ # "/processes/%s" % self.id)
################
# IProcess
(at)(at) -73,8 +75,7 (at)(at)
security.declareProtected(config.MANAGE_WORKFLOW,
"listPossibleActivities")
def listPossibleActivities(self):
- tuples = zope.component.getUtilitiesFor(IActivityClass)
- return [act for name, act in tuples]
+ return zope.component.getUtilitiesFor(IActivityClass)
security.declareProtected(config.MANAGE_WORKFLOW, "acquireProcess")
def acquireProcess(self):
|
SVN: r4668 - in AlphaFlow/trunk: . Extensions
Thomas Lotze <tl(at)gocept.com> |
2007-04-16 15:39:01 |
[ FULL ]
|
Author: thomas
Date: Mon Apr 16 15:38:59 2007
New Revision: 4668
Log:
added config switch for whether to use GenericSetup
Modified:
AlphaFlow/trunk/Extensions/Install.py
AlphaFlow/trunk/config.py
AlphaFlow/trunk/custom_config.py.example
Modified: AlphaFlow/trunk/Extensions/Install.py
==============================================================================
--- AlphaFlow/trunk/Extensions/Install.py (original)
+++ AlphaFlow/trunk/Extensions/Install.py Mon Apr 16 15:38:59 2007
(at)(at) -266,12 +266,13 (at)(at)
def install(self):
out = StringIO()
- # Integrate with GenericSetup
- setup_tool = getToolByName(self, 'portal_setup')
- old_context = setup_tool.getImportContextID()
- setup_tool.setImportContext('profile-Products.AlphaFlow:default')
- setup_tool.runAllImportSteps()
- setup_tool.setImportContext(old_context)
+ if config.USE_GENERICSETUP:
+ # Integrate with GenericSetup
+ setup_tool = getToolByName(self, 'portal_setup')
+ old_context = setup_tool.getImportContextID()
+ setup_tool.setImportContext('profile-Products.AlphaFlow:default')
+ setup_tool.runAllImportSteps()
+ setup_tool.setImportContext(old_context)
# XXX Run the remaining non-GenericSetup steps
print >>out, 'Installing types ...'
(at)(at) -319,11 +320,12 (at)(at)
def uninstall(self):
out = StringIO()
- # Uninstall via GenericSetup
- setup_tool = getToolByName(self, 'portal_setup')
- setup_tool.setImportContext('profile-AlphaFlow:uninstall')
- setup_tool.runAllImportSteps()
- setup_tool.setImportContext('profile-CMFPlone:plone')
+ if config.USE_GENERICSETUP:
+ # Uninstall via GenericSetup
+ setup_tool = getToolByName(self, 'portal_setup')
+ setup_tool.setImportContext('profile-AlphaFlow:uninstall')
+ setup_tool.runAllImportSteps()
+ setup_tool.setImportContext('profile-CMFPlone:plone')
# Run the remaining other uninstall steps
print >>out, 'Uninstalling...'
Modified: AlphaFlow/trunk/config.py
==============================================================================
--- AlphaFlow/trunk/config.py (original)
+++ AlphaFlow/trunk/config.py Mon Apr 16 15:38:59 2007
(at)(at) -34,6 +34,9 (at)(at)
# Enable ZODB commits for the process manager?
ENABLE_ZODB_COMMITS = True
+# Use GenericSetup?
+USE_GENERICSETUP = True
+
try:
from Products.AlphaFlow.custom_config import *
except ImportError:
Modified: AlphaFlow/trunk/custom_config.py.example
==============================================================================
--- AlphaFlow/trunk/custom_config.py.example (original)
+++ AlphaFlow/trunk/custom_config.py.example Mon Apr 16 15:38:59 2007
(at)(at) -25,3 +25,7 (at)(at)
# Only for Plone 2.1: Do you want to patch Plone's default content types to
# use AlphaFlow?
PATCH_PLONE_TYPES = True
+
+
+# Use GenericSetup?
+USE_GENERICSETUP = True
|
SVN: r4669 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-16 18:37:37 |
[ FULL ]
|
Author: thomas
Date: Mon Apr 16 18:37:35 2007
New Revision: 4669
Log:
temporary hack to unbreak wf details view
Modified:
AlphaFlow/trunk/lifecycle.py
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Mon Apr 16 18:37:35 2007
(at)(at) -123,6 +123,11 (at)(at)
def state(self):
return ILifeCycleController(self).state
+ # XXX This shouldn't be here, only for intermediary BBB.
+ (at)property
+ def begin(self):
+ pass
+
InitializeClass(LifeCycleObjectBase)
|
SVN: r4670 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-17 11:40:43 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 17 11:40:40 2007
New Revision: 4670
Log:
removed obsolete comment on Plone version
Modified:
AlphaFlow/trunk/config.py
Modified: AlphaFlow/trunk/config.py
==============================================================================
--- AlphaFlow/trunk/config.py (original)
+++ AlphaFlow/trunk/config.py Tue Apr 17 11:40:40 2007
(at)(at) -28,7 +28,7 (at)(at)
# Value must be one of ['detailed', 'minimal']
GRAPH_DISPLAY = 'detailed'
-# Only for plone 2.1: Do you want to patch your default content types to use
alphaflow?
+# Do you want to patch your default content types to use alphaflow?
PATCH_PLONE_TYPES = True
# Enable ZODB commits for the process manager?
|
SVN: r4671 - AlphaFlow/trunk/browser
Roman Joost <rj(at)gocept.com> |
2007-04-17 17:08:10 |
[ FULL ]
|
Author: roman
Date: Tue Apr 17 17:08:08 2007
New Revision: 4671
Log:
- added configlet
Added:
AlphaFlow/trunk/browser/portlet.py
AlphaFlow/trunk/browser/portlet_editor.pt
Modified:
AlphaFlow/trunk/browser/configure.zcml
Modified: AlphaFlow/trunk/browser/configure.zcml
==============================================================================
--- AlphaFlow/trunk/browser/configure.zcml (original)
+++ AlphaFlow/trunk/browser/configure.zcml Tue Apr 17 17:08:08 2007
(at)(at) -11,4 +11,26 (at)(at)
permission="zope2.View"
/>
+ <browser:page
+ for="*"
+ name="portlet_editor"
+ template="portlet_editor.pt"
+ permission="zope2.View"
+ />
+
+ <browser:pages
+ for="*"
+ class=".portlet.Portlet"
+ permission="zope2.View">
+
+ <browser:page
+ name="addProcess"
+ attribute="addProcess"
+ />
+ <browser:page
+ name="delProcess"
+ attribute="delProcess"
+ />
+ </browser:pages>
+
</configure>
Added: AlphaFlow/trunk/browser/portlet.py
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/browser/portlet.py Tue Apr 17 17:08:08 2007
(at)(at) -0,0 +1,52 (at)(at)
+# -*- coding: iso-8859-1 -*-
+# Copyright (c) 2004-2006 gocept gmbh & co. kg
+# See also LICENSE.txt
+# $Id: instance.py 4614 2007-03-26 20:12:22Z ctheune $
+"""Process instance views"""
+
+import zope.app.traversing.browser.absoluteurl
+import AccessControl
+import Globals
+
+import Products.CMFCore.utils
+import Products.Five
+
+import Products.AlphaFlow.config
+import Products.AlphaFlow.utils
+import Products.AlphaFlow.interfaces
+
+
+class Portlet(Products.Five.BrowserView):
+
+ security = AccessControl.ClassSecurityInfo()
+
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'addProcess')
+ def addProcess(self, title):
+ """Adds new process to process manager."""
+ pm = Products.CMFCore.utils.getToolByName(self.context,
+ 'workflow_manager')
+ uid = Products.AlphaFlow.utils.generateUniqueId('process')
+
+ process = pm.addProcess(uid)
+ process.title = title
+ url = zope.app.traversing.browser.absoluteurl.absoluteURL(process,
+
self.request)
+ self.request.response.redirect(url + "/editor.html");
+
+
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'delProcess')
+ def delProcess(self, id):
+ """Removes process with given id from process manager."""
+ portal = Products.CMFCore.utils.getToolByName(self.context,
+ 'portal_url').getPortalObject()
+ portal_url = portal.absolute_url()
+
+ pm = Products.CMFCore.utils.getToolByName(self.context,
'workflow_manager')
+ pm.deleteProcess(id)
+
+ msg = "?portal_status_message=Workflow entfernt."
+ self.request.response.redirect(portal_url + msg)
+
+Globals.InitializeClass(Portlet)
Added: AlphaFlow/trunk/browser/portlet_editor.pt
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/browser/portlet_editor.pt Tue Apr 17 17:08:08 2007
(at)(at) -0,0 +1,47 (at)(at)
+<html xmlns:tal="http://xml.zope.org/namespaces/tal"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ i18n:domain="alphaflow">
+
+<body>
+
+<!-- The work item information box -->
+
+<div metal:define-macro="portlet">
+
+ <form action=""
+ tal:define="procs here/workflow_manager/listProcesses"
+ >
+ <dl class="portlet" id="portlet-alphafloweditor">
+ <dt class="portletHeader"
+ i18n:translate="wi_portlet_headline">Workfloweditor</dt>
+
+ <tal:repeat repeat="process procs">
+ <dd class="portletItem"
+ tal:define="cssClass python:repeat['process'].odd() and 'odd'
or 'even'"
+ tal:attributes="class string:portletItem ${cssClass}">
+ <span class="portletDetails"
+ tal:content="process/title_or_id"></span>
+ <a href="view"
+ tal:attributes="href
string:${process/absolute_url}/editor.html">
+ <img border="0" src="/misc_/AlphaFlow/edit_process.gif"
/>
+ </a>
+ <a href="#"
+ tal:attributes="href
string:${process/absolute_url}/(at)(at)delProcess?id=${process/getId}">
+ <img border="0" src="/misc_/AlphaFlow/trash.gif"/>
+ </a>
+ </dd>
+ </tal:repeat>
+
+ </dl>
+ </form>
+ <form action=""
+ tal:attributes="action
string:${here/workflow_manager/absolute_url}/(at)(at)addProcess">
+ <h5>Neuer Workflow</h5>
+ Title: <input type="text" value="" name="title" />
+ <input type="submit" value="Anlegen" />
+ </form>
+</div>
+
+</body>
+</html>
+
|
SVN: r4672 - AlphaFlow/trunk/tests
Roman Joost <rj(at)gocept.com> |
2007-04-17 17:13:13 |
[ FULL ]
|
Author: roman
Date: Tue Apr 17 17:13:12 2007
New Revision: 4672
Log:
- added tests for editor
Added:
AlphaFlow/trunk/tests/test_editor.py
Added: AlphaFlow/trunk/tests/test_editor.py
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/tests/test_editor.py Tue Apr 17 17:13:12 2007
(at)(at) -0,0 +1,75 (at)(at)
+# Copyright (c) 2005-2006 gocept gmbh & co. kg
+# See also LICENSE.txt
+# $Id: test_processmanager.py 4614 2007-03-26 20:12:22Z ctheune $
+
+import unittest
+
+import zope.publisher.browser
+
+from Products.AlphaFlow.tests.AlphaFlowTestCase import AlphaFlowTestCase
+from Products.AlphaFlow.editor.editor import Editor, ActivityPanel
+from Products.AlphaFlow.browser.portlet import Portlet
+
+
+class EditorViewTest(AlphaFlowTestCase):
+
+ interfaces_to_test = [ ]
+
+ def test_getActivities(self):
+ self._import_wf('workflows/permission.alf')
+ pm = self.portal.workflow_manager
+ process = pm.processes.test
+ request = zope.publisher.browser.TestRequest()
+
+ editorview = Editor(process, request)
+ activities = editorview.getActivities()
+ self.assertEquals(16, len(list(activities)))
+
+
+class ActivityPanelTest(AlphaFlowTestCase):
+
+ interfaces_to_test = []
+
+ def test_listProcessActivities(self):
+ self._import_wf('workflows/permission.alf')
+ pm = self.portal.workflow_manager
+ process = pm.processes.test
+ request = zope.publisher.browser.TestRequest()
+
+ apview = ActivityPanel(process, request)
+ activities = apview.listProcessActivities()
+ self.assertEquals(9, len(activities))
+
+
+class PortletTest(AlphaFlowTestCase):
+
+ interfaces_to_test = []
+
+ def test_addProcess(self):
+ pm = self.portal.workflow_manager
+ # by default, we only have 4 processes definded
+ self.assertEquals(4, len(pm.processes.objectIds()))
+
+ # now add a new process
+ portlet = Portlet(pm, zope.publisher.browser.TestRequest())
+ title = "neuer TestWorkflow"
+ portlet.addProcess(title)
+ self.assertEquals(5, len(pm.processes.objectIds()))
+ self.assertEquals(title, pm.processes.objectValues()[-1].title)
+
+ def test_delProcess(self):
+ pm = self.portal.workflow_manager
+ portlet = Portlet(pm, zope.publisher.browser.TestRequest())
+ # add a new process and delete it
+ portlet.addProcess("Testprocess")
+ self.assertEquals(5, len(pm.processes.objectIds()))
+
+ portlet.delProcess(pm.processes.objectIds()[-1])
+ self.assertEquals(4, len(pm.processes.objectIds()))
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(EditorViewTest))
+ suite.addTest(unittest.makeSuite(ActivityPanelTest))
+ suite.addTest(unittest.makeSuite(PortletTest))
+ return suite
|
SVN: r4673 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-17 17:38:08 |
[ FULL ]
|
Author: roman
Date: Tue Apr 17 17:38:06 2007
New Revision: 4673
Log:
- handle empty workflow definitions
- changed form titles
Modified:
AlphaFlow/trunk/editor/standardmacros.pt
Modified: AlphaFlow/trunk/editor/standardmacros.pt
==============================================================================
--- AlphaFlow/trunk/editor/standardmacros.pt (original)
+++ AlphaFlow/trunk/editor/standardmacros.pt Tue Apr 17 17:38:06 2007
(at)(at) -40,7 +40,11 (at)(at)
tal:define="imgurl
string:${context/(at)(at)absolute_url}/(at)(at)graph"
tal:attributes="imgurl imgurl">
<h2>Graph</h2>
- <img tal:attributes="src imgurl" />
+ <img tal:attributes="src imgurl"
+ tal:condition="view/canRenderWorkflow" />
+ <span tal:condition="not:view/canRenderWorkflow">
+ Do yourself a favour and add at least two activities and connect
those ;)
+ </span>
</div>
</div>
(at)(at) -52,7 +56,7 (at)(at)
metal:define-macro="addActivityForm"
action="(at)(at)addNewActivity"
onsubmit="return editor.addActivity(this);">
- <div class='form-label'>Add a new activity</div>
+ <div class='form-label'>New Activity</div>
<table>
<tbody>
(at)(at) -80,5 +84,29 (at)(at)
</tbody>
</table>
</form>
+
+ <form id="addExitsForm"
+ metal:define-macro="addExitsForm"
+ action="(at)(at)addNewActivity"
+ onsubmit="return editor.addActivity(this);">
+ <div class='form-label'>New Exit</div>
+
+ <table>
+ <tbody>
+ <tr>
+ <td>Id:</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="text" name="id"/>
+ </td>
+ <td>
+ <input type="submit" class='button' value="add"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </form>
</div>
|
SVN: r4674 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-17 17:40:50 |
[ FULL ]
|
Author: roman
Date: Tue Apr 17 17:40:48 2007
New Revision: 4674
Log:
- added method which checks if it makes sense to render the workflow
Modified:
AlphaFlow/trunk/editor/editor.py
Modified: AlphaFlow/trunk/editor/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/editor.py (original)
+++ AlphaFlow/trunk/editor/editor.py Tue Apr 17 17:40:48 2007
(at)(at) -23,9 +23,19 (at)(at)
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'getActivities')
def getActivities(self):
- """Returns a list of addable activities to this process."""
+ """Returns a generator obj of addable activities to this
+ process.
+ """
return self.context.listPossibleActivities()
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'canRenderWorkflow')
+ def canRenderWorkflow(self):
+ """Returns True if activities can be found and it's possible to render
+ the workflow graph.
+ """
+ return self.context.listActivityIds() != []
+
Globals.InitializeClass(Editor)
|
SVN: r4675 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-18 14:21:56 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 18 14:21:54 2007
New Revision: 4675
Log:
working around stupid AT BaseFolder behaviour to side-step acquisition trouble
Modified:
AlphaFlow/trunk/instance.py
AlphaFlow/trunk/lifecycle.py
Modified: AlphaFlow/trunk/instance.py
==============================================================================
--- AlphaFlow/trunk/instance.py (original)
+++ AlphaFlow/trunk/instance.py Wed Apr 18 14:21:54 2007
(at)(at) -545,7 +545,7 (at)(at)
new_ids.append(wi_id)
wi.generated_by = source.getId()
self._setObject(wi_id, wi)
- new_wrapped.append(self[wi_id])
+ new_wrapped.append(getattr(self, wi_id))
return new_ids, new_wrapped
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Wed Apr 18 14:21:54 2007
(at)(at) -59,7 +59,7 (at)(at)
instance = zope.component.getMultiAdapter((definition, id),
ILifeCycleObject)
self._setObject(id, instance)
- return self[id]
+ return getattr(self, id)
def onStart(self):
"""Trigger that gets called after the object is started."""
|
SVN: r4676 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-18 15:26:37 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 18 15:26:35 2007
New Revision: 4676
Log:
renamed special checkpoints as names starting with underscores underly access
restrictions
Modified:
AlphaFlow/trunk/config.py
Modified: AlphaFlow/trunk/config.py
==============================================================================
--- AlphaFlow/trunk/config.py (original)
+++ AlphaFlow/trunk/config.py Wed Apr 18 15:26:35 2007
(at)(at) -87,5 +87,5 (at)(at)
mtAllowedRolesAndUsersProxy = 'AllowedRolesAndUsersProxy'
-CHECKPOINT_START = "__checkpoint_start"
-CHECKPOINT_COMPLETE = "__checkpoint_complete"
+CHECKPOINT_START = "CHECKPOINT_START"
+CHECKPOINT_COMPLETE = "CHECKPOINT_COMPLETE"
|
SVN: r4677 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-18 15:51:36 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 18 15:51:34 2007
New Revision: 4677
Log:
added missing import
Modified:
AlphaFlow/trunk/checkpoint.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Wed Apr 18 15:51:34 2007
(at)(at) -9,6 +9,7 (at)(at)
import zope.interface
+import Products.AlphaFlow.interfaces
import Products.AlphaFlow.lifecycle
(at)(at) -38,6 +39,8 (at)(at)
def onStart(self):
for aspect in self.definition().aspects:
inst = self.createChild(aspect, "Aspect")
- controller = ILifeCycleController(inst)
+ controller = Products.AlphaFlow.interfaces.ILifeCycleController(
+ inst)
controller.start('Started by checkpoint.')
- ILifeCycleController(self).complete('Completed all aspects.')
+ Products.AlphaFlow.interfacesILifeCycleController(self).complete(
+ 'Completed all aspects.')
|
SVN: r4678 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-18 15:53:56 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 18 15:53:55 2007
New Revision: 4678
Log:
this time hopefully correctly (code not yet tested :o()
Modified:
AlphaFlow/trunk/checkpoint.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Wed Apr 18 15:53:55 2007
(at)(at) -42,5 +42,5 (at)(at)
controller = Products.AlphaFlow.interfaces.ILifeCycleController(
inst)
controller.start('Started by checkpoint.')
- Products.AlphaFlow.interfacesILifeCycleController(self).complete(
+ Products.AlphaFlow.interfaces.ILifeCycleController(self).complete(
'Completed all aspects.')
|
SVN: r4679 - AlphaFlow/trunk/browser
Roman Joost <rj(at)gocept.com> |
2007-04-18 16:54:17 |
[ FULL ]
|
Author: roman
Date: Wed Apr 18 16:54:15 2007
New Revision: 4679
Log:
- refactored portlet to configlet
Added:
AlphaFlow/trunk/browser/configlet.py
- copied, changed from r4671, AlphaFlow/trunk/browser/portlet.py
AlphaFlow/trunk/browser/configlet_editor.pt
- copied, changed from r4671, AlphaFlow/trunk/browser/portlet_editor.pt
Removed:
AlphaFlow/trunk/browser/portlet.py
AlphaFlow/trunk/browser/portlet_editor.pt
Modified:
AlphaFlow/trunk/browser/configure.zcml
Copied: AlphaFlow/trunk/browser/configlet.py (from r4671,
AlphaFlow/trunk/browser/portlet.py)
==============================================================================
--- AlphaFlow/trunk/browser/portlet.py (original)
+++ AlphaFlow/trunk/browser/configlet.py Wed Apr 18 16:54:15 2007
(at)(at) -16,7 +16,7 (at)(at)
import Products.AlphaFlow.interfaces
-class Portlet(Products.Five.BrowserView):
+class Configlet(Products.Five.BrowserView):
security = AccessControl.ClassSecurityInfo()
(at)(at) -34,19 +34,17 (at)(at)
self.request)
self.request.response.redirect(url + "/editor.html");
-
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'delProcess')
def delProcess(self, id):
"""Removes process with given id from process manager."""
- portal = Products.CMFCore.utils.getToolByName(self.context,
+ portal = Products.CMFCore.utils.getToolByName(self.context,
'portal_url').getPortalObject()
portal_url = portal.absolute_url()
-
pm = Products.CMFCore.utils.getToolByName(self.context,
'workflow_manager')
pm.deleteProcess(id)
- msg = "?portal_status_message=Workflow entfernt."
- self.request.response.redirect(portal_url + msg)
+ qs = "/configlet_editor?portal_status_message=Workflow entfernt"
+ self.request.response.redirect(portal_url + qs)
-Globals.InitializeClass(Portlet)
+Globals.InitializeClass(Configlet)
Copied: AlphaFlow/trunk/browser/configlet_editor.pt (from r4671,
AlphaFlow/trunk/browser/portlet_editor.pt)
==============================================================================
--- AlphaFlow/trunk/browser/portlet_editor.pt (original)
+++ AlphaFlow/trunk/browser/configlet_editor.pt Wed Apr 18 16:54:15 2007
(at)(at) -1,45 +1,95 (at)(at)
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
+ metal:use-macro="here/prefs_main_template/macros/master"
i18n:domain="alphaflow">
+<metal:block fill-slot="top_slot">
+ <tal:block define="dummy python:request.set('disable_border',1)" />
+</metal:block>
+
<body>
<!-- The work item information box -->
-<div metal:define-macro="portlet">
+<div metal:fill-slot="prefs_configlet_main">
+
+ <div id="content" class="documentEditable"
+ tal:define="errors python:request.get('errors', {});">
+
+ <h1 i18n:translate="label_configlet_alphaflow_editor">
+ AlphaFlow Workflow Editor
+ </h1>
+
+ <div class="portalMessage"
+ tal:define="msg errors/msg |nothing"
+ tal:condition="msg"
+ tal:content="msg"> portal message </div>
+
+ <div id="region-content" class="documentContent">
+
+ <fieldset>
+ <legend i18n:translate="label_configlet_edit_processes">
+ Edit Existing Processes
+ </legend>
+ <form action="."
+ method="POST"
+ tal:define="procs here/workflow_manager/listProcesses"
+ >
+
+ <table class="listing">
+ <thead>
+ <th i18n:translate="label_configlet_processtitle">
+ Process
+ </th>
+ <th i18n:translate="label_configlet_edit">
+ Edit
+ </th>
+ <th i18n:translate="label_configlet_delete">
+ Delete
+ </th>
+ </thead>
+ <tbody>
+ <tal:repeat repeat="process procs">
+ <tr tal:define="cssClass python:repeat['process'].odd()
and 'odd' or 'even'"
+ tal:attributes="class string:portletItem
${cssClass}">
+ <td tal:content="process/title_or_id">
+ Workflowtitle
+ </td>
+ <td>
+ <a href="view"
+ tal:attributes="href
string:${process/absolute_url}/editor.html">
+ <img border="0"
src="/misc_/AlphaFlow/edit_process.gif" />
+ </a>
+ </td>
+ <td>
+ <a href="#"
+ tal:attributes="href
string:${process/absolute_url}/(at)(at)delProcess?id=${process/getId}">
+ <img border="0"
src="/misc_/AlphaFlow/trash.gif"/>
+ </a>
+ </td>
+ </tr>
+ </tal:repeat>
+ </tbody>
+ </table>
+ </form>
+ </fieldset>
+
+ <fieldset>
+ <legend i18n:translate="label_configlet_new_workflow">
+ New Workflow
+ </legend>
- <form action=""
- tal:define="procs here/workflow_manager/listProcesses"
- >
- <dl class="portlet" id="portlet-alphafloweditor">
- <dt class="portletHeader"
- i18n:translate="wi_portlet_headline">Workfloweditor</dt>
-
- <tal:repeat repeat="process procs">
- <dd class="portletItem"
- tal:define="cssClass python:repeat['process'].odd() and 'odd'
or 'even'"
- tal:attributes="class string:portletItem ${cssClass}">
- <span class="portletDetails"
- tal:content="process/title_or_id"></span>
- <a href="view"
- tal:attributes="href
string:${process/absolute_url}/editor.html">
- <img border="0" src="/misc_/AlphaFlow/edit_process.gif"
/>
- </a>
- <a href="#"
- tal:attributes="href
string:${process/absolute_url}/(at)(at)delProcess?id=${process/getId}">
- <img border="0" src="/misc_/AlphaFlow/trash.gif"/>
- </a>
- </dd>
- </tal:repeat>
-
- </dl>
- </form>
- <form action=""
- tal:attributes="action
string:${here/workflow_manager/absolute_url}/(at)(at)addProcess">
- <h5>Neuer Workflow</h5>
- Title: <input type="text" value="" name="title" />
- <input type="submit" value="Anlegen" />
- </form>
+ <form action=""
+ tal:attributes="action
string:${here/workflow_manager/absolute_url}/(at)(at)addProcess">
+ <span
i18n:translate="label_configlet_new_workflowtitle">
+ Title:
+ </span>
+ <input type="text" value="" name="title" />
+ <input type="submit" class="context" value="Anlegen"
/>
+ </form>
+ </fieldset>
+ </div>
+ </div>
</div>
</body>
Modified: AlphaFlow/trunk/browser/configure.zcml
==============================================================================
--- AlphaFlow/trunk/browser/configure.zcml (original)
+++ AlphaFlow/trunk/browser/configure.zcml Wed Apr 18 16:54:15 2007
(at)(at) -13,14 +13,14 (at)(at)
<browser:page
for="*"
- name="portlet_editor"
- template="portlet_editor.pt"
+ name="configlet_editor"
+ template="configlet_editor.pt"
permission="zope2.View"
/>
<browser:pages
for="*"
- class=".portlet.Portlet"
+ class=".configlet.Configlet"
permission="zope2.View">
<browser:page
(at)(at) -29,7 +29,7 (at)(at)
/>
<browser:page
name="delProcess"
- attribute="delProcess"
+ attribute="delProcess"
/>
</browser:pages>
|
SVN: r4680 - AlphaFlow/trunk/tests
Roman Joost <rj(at)gocept.com> |
2007-04-18 16:54:49 |
[ FULL ]
|
Author: roman
Date: Wed Apr 18 16:54:48 2007
New Revision: 4680
Log:
- refactored portlet to configlet
Modified:
AlphaFlow/trunk/tests/test_editor.py
Modified: AlphaFlow/trunk/tests/test_editor.py
==============================================================================
--- AlphaFlow/trunk/tests/test_editor.py (original)
+++ AlphaFlow/trunk/tests/test_editor.py Wed Apr 18 16:54:48 2007
(at)(at) -8,7 +8,7 (at)(at)
from Products.AlphaFlow.tests.AlphaFlowTestCase import AlphaFlowTestCase
from Products.AlphaFlow.editor.editor import Editor, ActivityPanel
-from Products.AlphaFlow.browser.portlet import Portlet
+from Products.AlphaFlow.browser.configlet import Configlet
class EditorViewTest(AlphaFlowTestCase):
(at)(at) -41,7 +41,7 (at)(at)
self.assertEquals(9, len(activities))
-class PortletTest(AlphaFlowTestCase):
+class ConfigletTest(AlphaFlowTestCase):
interfaces_to_test = []
(at)(at) -51,25 +51,25 (at)(at)
self.assertEquals(4, len(pm.processes.objectIds()))
# now add a new process
- portlet = Portlet(pm, zope.publisher.browser.TestRequest())
+ configlet = Configlet(pm, zope.publisher.browser.TestRequest())
title = "neuer TestWorkflow"
- portlet.addProcess(title)
+ configlet.addProcess(title)
self.assertEquals(5, len(pm.processes.objectIds()))
self.assertEquals(title, pm.processes.objectValues()[-1].title)
def test_delProcess(self):
pm = self.portal.workflow_manager
- portlet = Portlet(pm, zope.publisher.browser.TestRequest())
+ configlet = Configlet(pm, zope.publisher.browser.TestRequest())
# add a new process and delete it
- portlet.addProcess("Testprocess")
+ configlet.addProcess("Testprocess")
self.assertEquals(5, len(pm.processes.objectIds()))
- portlet.delProcess(pm.processes.objectIds()[-1])
+ configlet.delProcess(pm.processes.objectIds()[-1])
self.assertEquals(4, len(pm.processes.objectIds()))
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(EditorViewTest))
suite.addTest(unittest.makeSuite(ActivityPanelTest))
- suite.addTest(unittest.makeSuite(PortletTest))
+ suite.addTest(unittest.makeSuite(ConfigletTest))
return suite
|
SVN: r4681 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-18 17:03:31 |
[ FULL ]
|
Author: roman
Date: Wed Apr 18 17:03:27 2007
New Revision: 4681
Log:
- removed 'reload canvas' link
Modified:
AlphaFlow/trunk/editor/index.pt
Modified: AlphaFlow/trunk/editor/index.pt
==============================================================================
--- AlphaFlow/trunk/editor/index.pt (original)
+++ AlphaFlow/trunk/editor/index.pt Wed Apr 18 17:03:27 2007
(at)(at) -9,7 +9,6 (at)(at)
<div id="Header">
<div metal:fill-slot="headerContents">
<metal:macro
use-macro="here/standardmacros/macros/addActivityForm" />
- <a href="javascript: void(null)" id="reloadbutton">Reload
canvas</a>
</div>
</div>
|
SVN: r4682 - AlphaFlow/trunk/editor/resources
Roman Joost <rj(at)gocept.com> |
2007-04-18 17:10:19 |
[ FULL ]
|
Author: roman
Date: Wed Apr 18 17:10:17 2007
New Revision: 4682
Log:
small refactoring for _loadPanels method
Modified:
AlphaFlow/trunk/editor/resources/editor.js
Modified: AlphaFlow/trunk/editor/resources/editor.js
==============================================================================
--- AlphaFlow/trunk/editor/resources/editor.js (original)
+++ AlphaFlow/trunk/editor/resources/editor.js Wed Apr 18 17:10:17 2007
(at)(at) -4,26 +4,9 (at)(at)
this.contentElement = getElementsByTagAndClassName('div',
'ActivitiesPanel')[0];
this.addForm = getElement('addActivityForm');
- this.loadPanels();
- //connect(this.addForm, 'onsubmit', this, 'addActivity');
+ this._loadPanels();
}
-/* XXX works currently only for activityPanel and somehow this should be
- * implemented simpler */
-Editor.prototype.loadPanels = function() {
- var url = this.baseURL + '/activitypanel';
- var d = doSimpleXMLHttpRequest(url);
- d.addCallbacks(
- function(result) {
- var sidebar = this.editor.sidebar
- hideElement(sidebar);
- sidebar.innerHTML = result.responseText;
- appear(sidebar);
-
- // initialize the Objects
- activityPanel = new ActivitiesPanel();
- }, alert);
-}
Editor.prototype.reloadPanels = function() {
var url = this.baseURL + '/activitypanel';
var d = doSimpleXMLHttpRequest(url);
(at)(at) -49,6 +32,23 (at)(at)
}, alert);
return false;
}
+/* XXX works currently only for activityPanel
+ * this javascript method initiates the panels
+ * `reloadPanels` can be called to update the panels*/
+Editor.prototype._loadPanels = function() {
+ var url = this.baseURL + '/activitypanel';
+ var d = doSimpleXMLHttpRequest(url);
+ d.addCallbacks(
+ function(result) {
+ var sidebar = this.editor.sidebar
+ hideElement(sidebar);
+ sidebar.innerHTML = result.responseText;
+ appear(sidebar);
+
+ // initialize the Objects
+ activityPanel = new ActivitiesPanel();
+ }, alert);
+}
|
SVN: r4683 - AlphaFlow/trunk
Roman Joost <rj(at)gocept.com> |
2007-04-18 21:24:20 |
[ FULL ]
|
Author: roman
Date: Wed Apr 18 21:24:18 2007
New Revision: 4683
Log:
- added edit_process graphic
Modified:
AlphaFlow/trunk/__init__.py
Modified: AlphaFlow/trunk/__init__.py
==============================================================================
--- AlphaFlow/trunk/__init__.py (original)
+++ AlphaFlow/trunk/__init__.py Wed Apr 18 21:24:18 2007
(at)(at) -24,6 +24,8 (at)(at)
globals()),
'trash.gif':ImageFile('www/trash.gif',
globals()),
+ 'edit_process.gif':ImageFile('www/edit_process.gif',
+ globals()),
}
|
SVN: r4684 - AlphaFlow/tags/2.0a1
Christian Theune <ct(at)gocept.com> |
2007-04-18 22:02:00 |
[ FULL ]
|
Author: ctheune
Date: Wed Apr 18 22:01:58 2007
New Revision: 4684
Log:
- release AlphaFlow 2.0a1 for Belimo milestone
Added:
AlphaFlow/tags/2.0a1/
- copied from r4683, AlphaFlow/trunk/
|
SVN: r4685 - AlphaFlow/tags/2.0a1
Christian Theune <ct(at)gocept.com> |
2007-04-18 22:02:22 |
[ FULL ]
|
Author: ctheune
Date: Wed Apr 18 22:02:21 2007
New Revision: 4685
Log:
- marking version number for release
Modified:
AlphaFlow/tags/2.0a1/version.txt
Modified: AlphaFlow/tags/2.0a1/version.txt
==============================================================================
--- AlphaFlow/tags/2.0a1/version.txt (original)
+++ AlphaFlow/tags/2.0a1/version.txt Wed Apr 18 22:02:21 2007
(at)(at) -1 +1 (at)(at)
-2.0dev
+2.0a1
|
SVN: r4686 - AlphaFlow/trunk/tests
Roman Joost <rj(at)gocept.com> |
2007-04-19 15:15:43 |
[ FULL ]
|
Author: roman
Date: Thu Apr 19 15:15:41 2007
New Revision: 4686
Log:
- added new test for canRenderWorkflow method in Editor view
Modified:
AlphaFlow/trunk/tests/test_editor.py
Modified: AlphaFlow/trunk/tests/test_editor.py
==============================================================================
--- AlphaFlow/trunk/tests/test_editor.py (original)
+++ AlphaFlow/trunk/tests/test_editor.py Thu Apr 19 15:15:41 2007
(at)(at) -7,7 +7,8 (at)(at)
import zope.publisher.browser
from Products.AlphaFlow.tests.AlphaFlowTestCase import AlphaFlowTestCase
-from Products.AlphaFlow.editor.editor import Editor, ActivityPanel
+from Products.AlphaFlow.editor.editor import\
+ Editor, ActivityPanel, ActivityForm
from Products.AlphaFlow.browser.configlet import Configlet
(at)(at) -25,6 +26,28 (at)(at)
activities = editorview.getActivities()
self.assertEquals(16, len(list(activities)))
+ def test_canRenderWorkflow(self):
+ request = zope.publisher.browser.TestRequest()
+ pm = self.portal.workflow_manager
+ configlet = Configlet(pm, request)
+ configlet.addProcess('test')
+ process = pm.processes.objectValues()[-1]
+
+ editorview = Editor(process, request)
+ actform = ActivityForm(process, request)
+ act1 = actform.addActivity("Task1", 'task')
+ act2 = actform.addActivity("Task2", 'task')
+
+ # we should have two activities in this process
+ self.assertEquals(2, len(process.objectIds()))
+ self.assert_(act1 in process.objectValues())
+ self.assert_(act2 in process.objectValues())
+ self.assertEquals(False, editorview.canRenderWorkflow())
+
+ # now connect those and we should be able to display a graph
+ act1.startActivity = (act2.id, )
+ self.assertEquals(True, editorview.canRenderWorkflow())
+
class ActivityPanelTest(AlphaFlowTestCase):
(at)(at) -40,6 +63,26 (at)(at)
activities = apview.listProcessActivities()
self.assertEquals(9, len(activities))
+class ActivityFormTest(AlphaFlowTestCase):
+
+ interfaces_to_test = []
+
+ def test_addActivity(self):
+ self._import_wf('workflows/permission.alf')
+ pm = self.portal.workflow_manager
+ process = pm.processes.test
+ request = zope.publisher.browser.TestRequest()
+ # test for a defined amount of activities this workflow provides
+ self.assertEquals(9, len(process.objectIds()))
+
+ form = ActivityForm(process, request)
+ title = "New activity as a test"
+ activity = 'switch'
+ newactivity = form.addActivity(title, activity)
+
+ self.assertEquals(10, len(process.objectValues()))
+ self.assertEquals(title, newactivity.title )
+
class ConfigletTest(AlphaFlowTestCase):
(at)(at) -72,4 +115,5 (at)(at)
suite.addTest(unittest.makeSuite(EditorViewTest))
suite.addTest(unittest.makeSuite(ActivityPanelTest))
suite.addTest(unittest.makeSuite(ConfigletTest))
+ suite.addTest(unittest.makeSuite(ActivityFormTest))
return suite
|
SVN: r4687 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-19 15:18:45 |
[ FULL ]
|
Author: roman
Date: Thu Apr 19 15:18:43 2007
New Revision: 4687
Log:
- refactoring and revamped the canRenderWorkflow method
Modified:
AlphaFlow/trunk/editor/editor.py
Modified: AlphaFlow/trunk/editor/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/editor.py (original)
+++ AlphaFlow/trunk/editor/editor.py Thu Apr 19 15:18:43 2007
(at)(at) -21,20 +21,17 (at)(at)
security = AccessControl.ClassSecurityInfo()
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
- 'getActivities')
- def getActivities(self):
- """Returns a generator obj of addable activities to this
- process.
- """
- return self.context.listPossibleActivities()
-
- security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'canRenderWorkflow')
def canRenderWorkflow(self):
"""Returns True if activities can be found and it's possible to render
the workflow graph.
"""
- return self.context.listActivityIds() != []
+ ids = self.context.listActivityIds()
+ for id in ids:
+ if self.context[id].startActivity:
+ return True
+
+ return False
Globals.InitializeClass(Editor)
(at)(at) -43,6 +40,14 (at)(at)
security = AccessControl.ClassSecurityInfo()
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ 'getActivities')
+ def getActivities(self):
+ """Returns a generator obj of addable activities to this
+ process.
+ """
+ return self.context.listPossibleActivities()
+
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'listProcessActivities')
def listProcessActivities(self):
(at)(at) -71,10 +76,17 (at)(at)
security = AccessControl.ClassSecurityInfo()
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
- 'addNewActivity')
- def addNewActivity(self, id, activity):
+ 'addActivity')
+ def addActivity(self, title, activity):
"""Returns graph data for this process"""
- self.context.manage_addActivity(activity, self.request)
+ uid = Products.AlphaFlow.utils.generateUniqueId(activity)
+ factory = zope.component.getUtility(
+ Products.AlphaFlow.interfaces.IActivityClass, name=activity)
+ activity = factory()
+ activity.title = title
+ self.context[uid] = activity
+
+ return activity
Globals.InitializeClass(ActivityForm)
|
SVN: r4688 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-19 15:19:20 |
[ FULL ]
|
Author: roman
Date: Thu Apr 19 15:19:18 2007
New Revision: 4688
Log:
- moved addActivity form to activitypanel
Modified:
AlphaFlow/trunk/editor/activitypanel.pt
AlphaFlow/trunk/editor/index.pt
AlphaFlow/trunk/editor/standardmacros.pt
Modified: AlphaFlow/trunk/editor/activitypanel.pt
==============================================================================
--- AlphaFlow/trunk/editor/activitypanel.pt (original)
+++ AlphaFlow/trunk/editor/activitypanel.pt Thu Apr 19 15:19:18 2007
(at)(at) -4,9 +4,10 (at)(at)
<li tal:repeat="activity activities"
tal:attributes="class activity/type;
value activity/url">
- <span tal:content="activity/id"
+ <span tal:content="activity/title"
tal:attributes="title activity/title" />
<span class="MoreInfoLink">mehr</span>
</li>
</ul>
+ <metal:macro use-macro="here/standardmacros/macros/addActivityForm" />
</div>
Modified: AlphaFlow/trunk/editor/index.pt
==============================================================================
--- AlphaFlow/trunk/editor/index.pt (original)
+++ AlphaFlow/trunk/editor/index.pt Thu Apr 19 15:19:18 2007
(at)(at) -5,12 +5,4 (at)(at)
tal:attributes="src
string:${context/(at)(at)absolute_url}/++resource++editor.js"></script>
</metal:javascript>
- <body>
- <div id="Header">
- <div metal:fill-slot="headerContents">
- <metal:macro
use-macro="here/standardmacros/macros/addActivityForm" />
- </div>
- </div>
-
- </body>
</html>
Modified: AlphaFlow/trunk/editor/standardmacros.pt
==============================================================================
--- AlphaFlow/trunk/editor/standardmacros.pt (original)
+++ AlphaFlow/trunk/editor/standardmacros.pt Thu Apr 19 15:19:18 2007
(at)(at) -42,8 +42,10 (at)(at)
<h2>Graph</h2>
<img tal:attributes="src imgurl"
tal:condition="view/canRenderWorkflow" />
- <span tal:condition="not:view/canRenderWorkflow">
- Do yourself a favour and add at least two activities and connect
those ;)
+ <span tal:condition="not:view/canRenderWorkflow"
+ i18n:translate="label_editor_no_graph">
+ No activities added currently two display a graph. Please
+ add at least two activities and connect them.
</span>
</div>
</div>
(at)(at) -54,20 +56,20 (at)(at)
<form id="addActivityForm"
metal:define-macro="addActivityForm"
- action="(at)(at)addNewActivity"
+ action="(at)(at)addActivity"
onsubmit="return editor.addActivity(this);">
<div class='form-label'>New Activity</div>
<table>
<tbody>
<tr>
- <td>Id:</td>
+ <td>Title:</td>
<td>Action:</td>
<td> </td>
</tr>
<tr>
<td>
- <input type="text" name="id"/>
+ <input type="text" name="title"/>
</td>
<td>
<select name="activity">
|
SVN: r4689 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-19 15:21:09 |
[ FULL ]
|
Author: roman
Date: Thu Apr 19 15:21:08 2007
New Revision: 4689
Log:
- renamed method
Modified:
AlphaFlow/trunk/editor/configure.zcml
Modified: AlphaFlow/trunk/editor/configure.zcml
==============================================================================
--- AlphaFlow/trunk/editor/configure.zcml (original)
+++ AlphaFlow/trunk/editor/configure.zcml Thu Apr 19 15:21:08 2007
(at)(at) -22,8 +22,8 (at)(at)
<browser:page
for="Products.AlphaFlow.interfaces.IProcess"
class=".editor.ActivityForm"
- name="addNewActivity"
- attribute="addNewActivity"
+ name="addActivity"
+ attribute="addActivity"
permission="zope2.View"
/>
|
SVN: r4690 - in AlphaFlow/trunk/editor/resources: . icons
Roman Joost <rj(at)gocept.com> |
2007-04-19 17:15:55 |
[ FULL ]
|
Author: roman
Date: Thu Apr 19 17:15:53 2007
New Revision: 4690
Log:
- added activity icons
Added:
AlphaFlow/trunk/editor/resources/icons/
AlphaFlow/trunk/editor/resources/icons/alarm.png (contents, props changed)
AlphaFlow/trunk/editor/resources/icons/baseautomaticactivity.png
(contents, props changed)
AlphaFlow/trunk/editor/resources/icons/basetalesactivity.png (contents,
props changed)
AlphaFlow/trunk/editor/resources/icons/configuration.png (contents, props
changed)
AlphaFlow/trunk/editor/resources/icons/dcworkflow.png (contents, props
changed)
AlphaFlow/trunk/editor/resources/icons/decision.png (contents, props
changed)
AlphaFlow/trunk/editor/resources/icons/email.png (contents, props changed)
AlphaFlow/trunk/editor/resources/icons/expression.png (contents, props
changed)
AlphaFlow/trunk/editor/resources/icons/gate.png (contents, props changed)
AlphaFlow/trunk/editor/resources/icons/generic.png (contents, props
changed)
AlphaFlow/trunk/editor/resources/icons/ntask.png (contents, props changed)
AlphaFlow/trunk/editor/resources/icons/permission-change.png (contents,
props changed)
AlphaFlow/trunk/editor/resources/icons/recursion.png (contents, props
changed)
AlphaFlow/trunk/editor/resources/icons/route.png (contents, props changed)
AlphaFlow/trunk/editor/resources/icons/task.png (contents, props changed)
AlphaFlow/trunk/editor/resources/icons/version.png (contents, props
changed)
Modified:
AlphaFlow/trunk/editor/resources/style.css
Added: AlphaFlow/trunk/editor/resources/icons/alarm.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/baseautomaticactivity.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/basetalesactivity.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/configuration.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/dcworkflow.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/decision.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/email.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/expression.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/gate.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/generic.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/ntask.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/permission-change.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/recursion.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/route.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/task.png
==============================================================================
Binary file. No diff available.
Added: AlphaFlow/trunk/editor/resources/icons/version.png
==============================================================================
Binary file. No diff available.
Modified: AlphaFlow/trunk/editor/resources/style.css
==============================================================================
--- AlphaFlow/trunk/editor/resources/style.css (original)
+++ AlphaFlow/trunk/editor/resources/style.css Thu Apr 19 17:15:53 2007
(at)(at) -46,3 +46,22 (at)(at)
.rightfloating {
float: right;
}
+
+.ActivitiesPanel li {
+ list-style-image: url("++resource++icons/generic.png");
+}
+li.permission-change {
+ list-style-image: url("++resource++icons/permission-change.png");
+}
+li.dcworkflow {
+ list-style-image: url("++resource++icons/dcworkflow.png");
+}
+li.ntask {
+ list-style-image: url("++resource++icons/ntask.png");
+}
+li.decision {
+ list-style-image: url("++resource++icons/decision.png");
+}
+li.configuration {
+ list-style-image: url("++resource++icons/configuration.png");
+}
|
SVN: r4691 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-19 17:16:11 |
[ FULL ]
|
Author: roman
Date: Thu Apr 19 17:16:10 2007
New Revision: 4691
Log:
- added activity icons
Modified:
AlphaFlow/trunk/editor/configure.zcml
Modified: AlphaFlow/trunk/editor/configure.zcml
==============================================================================
--- AlphaFlow/trunk/editor/configure.zcml (original)
+++ AlphaFlow/trunk/editor/configure.zcml Thu Apr 19 17:16:10 2007
(at)(at) -58,6 +58,10 (at)(at)
name="mochikit"
directory="resources/mochikit"
/>
+ <browser:resourceDirectory
+ name="icons"
+ directory="resources/icons"
+ />
<browser:resource
name="editor.js"
|
SVN: r4692 - AlphaFlow/trunk/editor
Roman Joost <rj(at)gocept.com> |
2007-04-19 17:31:18 |
[ FULL ]
|
Author: roman
Date: Thu Apr 19 17:31:15 2007
New Revision: 4692
Log:
- don't use the activity.icon attribute
Modified:
AlphaFlow/trunk/editor/editor.py
Modified: AlphaFlow/trunk/editor/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/editor.py (original)
+++ AlphaFlow/trunk/editor/editor.py Thu Apr 19 17:31:15 2007
(at)(at) -58,8 +58,7 (at)(at)
result = []
for act in activities:
- info = {'icon' : act.icon,
- 'title': act.title,
+ info = {'title': act.title,
'id' : act.getId(),
'type': act.activity_type,
'url': act.absolute_url(),
|
SVN: r4693 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-20 06:41:26 |
[ FULL ]
|
Author: thomas
Date: Fri Apr 20 06:41:23 2007
New Revision: 4693
Log:
turned CheckpointDefinition into a Folder
Modified:
AlphaFlow/trunk/checkpoint.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Fri Apr 20 06:41:23 2007
(at)(at) -3,9 +3,10 (at)(at)
# $Id: interfaces.py 4613 2007-03-22 18:34:52Z ctheune $
"""Checkpoints"""
-import persistent
import persistent.list
import persistent.wref
+from OFS.Folder import Folder
+from Globals import InitializeClass
import zope.interface
(at)(at) -13,15 +14,18 (at)(at)
import Products.AlphaFlow.lifecycle
-class CheckpointDefinition(persistent.Persistent):
+class CheckpointDefinition(Folder):
zope.interface.implements(
Products.AlphaFlow.interfaces.ICheckpointDefinition)
- aspects = []
+ activities = ()
def __init__(self):
- self.aspects = persistent.list.PersistentList()
+ self.activities = persistent.list.PersistentList()
+
+
+InitializeClass(CheckpointDefinition)
class CheckpointInstance(Products.AlphaFlow.lifecycle.LifeCycleObjectBase):
|
SVN: r4694 - AlphaFlow/trunk/tests
Roman Joost <rj(at)gocept.com> |
2007-04-20 10:36:37 |
[ FULL ]
|
Author: roman
Date: Fri Apr 20 10:36:35 2007
New Revision: 4694
Log:
- fixed test
Modified:
AlphaFlow/trunk/tests/test_editor.py
Modified: AlphaFlow/trunk/tests/test_editor.py
==============================================================================
--- AlphaFlow/trunk/tests/test_editor.py (original)
+++ AlphaFlow/trunk/tests/test_editor.py Fri Apr 20 10:36:35 2007
(at)(at) -16,16 +16,6 (at)(at)
interfaces_to_test = [ ]
- def test_getActivities(self):
- self._import_wf('workflows/permission.alf')
- pm = self.portal.workflow_manager
- process = pm.processes.test
- request = zope.publisher.browser.TestRequest()
-
- editorview = Editor(process, request)
- activities = editorview.getActivities()
- self.assertEquals(16, len(list(activities)))
-
def test_canRenderWorkflow(self):
request = zope.publisher.browser.TestRequest()
pm = self.portal.workflow_manager
(at)(at) -52,6 +42,17 (at)(at)
class ActivityPanelTest(AlphaFlowTestCase):
interfaces_to_test = []
+
+ def test_getActivities(self):
+ self._import_wf('workflows/permission.alf')
+ pm = self.portal.workflow_manager
+ process = pm.processes.test
+ request = zope.publisher.browser.TestRequest()
+
+ ap = ActivityPanel(process, request)
+ activities = ap.getActivities()
+ self.assertEquals(16, len(list(activities)))
+
def test_listProcessActivities(self):
self._import_wf('workflows/permission.alf')
|
SVN: r4695 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-20 10:37:07 |
[ FULL ]
|
Author: thomas
Date: Fri Apr 20 10:37:06 2007
New Revision: 4695
Log:
avoiding some acquisition wrappers
Modified:
AlphaFlow/trunk/activity.py
AlphaFlow/trunk/process.py
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Fri Apr 20 10:37:06 2007
(at)(at) -61,7 +61,7 (at)(at)
security.declareProtected(config.MANAGE_WORKFLOW, "acquireActivity")
def acquireActivity(self):
"""returns the activity instance from the acquisition chain"""
- return self
+ return self.aq_inner
security.declarePrivate("getConfigurationSchema")
def getConfigurationSchema(self, content):
Modified: AlphaFlow/trunk/process.py
==============================================================================
--- AlphaFlow/trunk/process.py (original)
+++ AlphaFlow/trunk/process.py Fri Apr 20 10:37:06 2007
(at)(at) -80,7 +80,7 (at)(at)
security.declareProtected(config.MANAGE_WORKFLOW, "acquireProcess")
def acquireProcess(self):
"""returns the process instance from the acquisition chain"""
- return self
+ return self.aq_inner
#########
# private
|
SVN: r4696 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-20 10:51:06 |
[ FULL ]
|
Author: thomas
Date: Fri Apr 20 10:51:04 2007
New Revision: 4696
Log:
CheckpointInstance -> Checkpoint
Modified:
AlphaFlow/trunk/checkpoint.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Fri Apr 20 10:51:04 2007
(at)(at) -28,7 +28,7 (at)(at)
InitializeClass(CheckpointDefinition)
-class CheckpointInstance(Products.AlphaFlow.lifecycle.LifeCycleObjectBase):
+class Checkpoint(Products.AlphaFlow.lifecycle.LifeCycleObjectBase):
zope.interface.implements(
zope.app.annotation.interfaces.IAttributeAnnotatable)
(at)(at) -37,7 +37,7 (at)(at)
log_children_name = "aspects"
def __init__(self, definition, id):
- CheckpointInstance.inheritedAttribute("__init__")(self, id)
+ Checkpoint.inheritedAttribute("__init__")(self, id)
self.definition = persistent.wref.WeakRef(definition)
def onStart(self):
|
SVN: r4697 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-20 10:57:13 |
[ FULL ]
|
Author: thomas
Date: Fri Apr 20 10:57:11 2007
New Revision: 4697
Log:
declared an interface, called InitializeClass for Checkpoints
Modified:
AlphaFlow/trunk/checkpoint.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Fri Apr 20 10:57:11 2007
(at)(at) -31,7 +31,8 (at)(at)
class Checkpoint(Products.AlphaFlow.lifecycle.LifeCycleObjectBase):
zope.interface.implements(
- zope.app.annotation.interfaces.IAttributeAnnotatable)
+ zope.app.annotation.interfaces.IAttributeAnnotatable,
+ Products.AlphaFlow.interfaces.ICheckpoint)
log_name = "checkpoint"
log_children_name = "aspects"
(at)(at) -48,3 +49,6 (at)(at)
controller.start('Started by checkpoint.')
Products.AlphaFlow.interfaces.ILifeCycleController(self).complete(
'Completed all aspects.')
+
+
+InitializeClass(Checkpoint)
|
SVN: r4698 - in AlphaFlow/trunk: . tests xmlimport
Thomas Lotze <tl(at)gocept.com> |
2007-04-20 11:54:22 |
[ FULL ]
|
Author: thomas
Date: Fri Apr 20 11:54:20 2007
New Revision: 4698
Log:
implemented creation of startActivities of work items using checkpoints
Modified:
AlphaFlow/trunk/checkpoint.py
AlphaFlow/trunk/configure.zcml
AlphaFlow/trunk/tests/test_definition.py
AlphaFlow/trunk/workitem.py
AlphaFlow/trunk/xmlimport/domimporters.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Fri Apr 20 11:54:20 2007
(at)(at) -41,7 +41,11 (at)(at)
Checkpoint.inheritedAttribute("__init__")(self, id)
self.definition = persistent.wref.WeakRef(definition)
+ def getActivities(self):
+ return self.definition().activities
+
def onStart(self):
+ self.getWorkItem().createWorkItems(self.getActivities())
for aspect in self.definition().aspects:
inst = self.createChild(aspect, "Aspect")
controller = Products.AlphaFlow.interfaces.ILifeCycleController(
Modified: AlphaFlow/trunk/configure.zcml
==============================================================================
--- AlphaFlow/trunk/configure.zcml (original)
+++ AlphaFlow/trunk/configure.zcml Fri Apr 20 11:54:20 2007
(at)(at) -15,6 +15,13 (at)(at)
<include file="security.zcml" />
+ <!-- Checkpoint components -->
+ <adapter factory=".checkpoint.Checkpoint"
+ for=".interfaces.ICheckpointDefinition
+ str"
+ provides=".interfaces.ILifeCycleObject"
+ />
+
<!-- Work item components -->
<adapter
factory=".workitem.WorkItemExit"
Modified: AlphaFlow/trunk/tests/test_definition.py
==============================================================================
--- AlphaFlow/trunk/tests/test_definition.py (original)
+++ AlphaFlow/trunk/tests/test_definition.py Fri Apr 20 11:54:20 2007
(at)(at) -46,6 +46,8 (at)(at)
from Products.AlphaFlow.activities.decision import DecisionWorkItem
from Products.AlphaFlow.utils import flexSplit
from Products.AlphaFlow.exception import ConfigurationError
+from Products.AlphaFlow import config
+from Products.AlphaFlow.checkpoint import CheckpointDefinition
from Products.AlphaFlow.exception import UnknownActivityError
(at)(at) -273,8 +275,13 (at)(at)
def add_activity(process, id, name):
factory = zope.component.getUtility(IActivityClass, name=name)
process[id] = factory()
- process[id].id = id
- return process[id]
+ activity = process[id]
+ activity.id = id
+ activity._setObject(config.CHECKPOINT_START,
+ CheckpointDefinition())
+ activity._setObject(config.CHECKPOINT_COMPLETE,
+ CheckpointDefinition())
+ return activity
# "task" is a special kind of activity to ask people to do
# something
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Fri Apr 20 11:54:20 2007
(at)(at) -171,6 +171,10 (at)(at)
return '<%s for %r (%s)>' % (self.__class__.__name__,
self.activity_id, state)
+ security.declarePrivate("getWorkItem")
+ def getWorkItem(self):
+ return self.aq_inner
+
security.declarePrivate('manage_afterAdd')
def manage_afterAdd(self, item, container):
BaseWorkItem.inheritedAttribute('manage_afterAdd')(self, item,
(at)(at) -307,7 +311,11 (at)(at)
def onStart(self):
- self.createWorkItems(self.getActivity().startActivity)
+ self.passCheckpoint(config.CHECKPOINT_START)
+
+
+ def onComplete(self):
+ self.passCheckpoint(config.CHECKPOINT_COMPLETE)
security.declarePublic("getActivity") # XXX .... yurks
def getActivity(self):
(at)(at) -403,10 +411,11 (at)(at)
security.declarePrivate('passCheckpoint')
def passCheckpoint(self, name):
if name in [config.CHECKPOINT_START, config.CHECKPOINT_COMPLETE]:
- checkpoint = LifecycleCheckpoint(self, name)
+ checkpoint = self.createChild(self.getActivity()[name],
"Checkpoint")
+ ILifeCycleController(checkpoint).start("Started by work item.")
else:
checkpoint = self.getExits()[name]
- return checkpoint()
+ return checkpoint()
def getAspects(self, checkpoint):
return ()
Modified: AlphaFlow/trunk/xmlimport/domimporters.py
==============================================================================
--- AlphaFlow/trunk/xmlimport/domimporters.py (original)
+++ AlphaFlow/trunk/xmlimport/domimporters.py Fri Apr 20 11:54:20 2007
(at)(at) -16,6 +16,8 (at)(at)
from Products.AlphaFlow.activities.interfaces import IGateActivity
from Products.AlphaFlow.xmlimport.utils import \
configure_attributes, get_element_children
+from Products.AlphaFlow import config
+import Products.AlphaFlow.checkpoint
class DOMImporterBase(object):
(at)(at) -87,6 +89,11 (at)(at)
factory = zope.component.getUtility(IActivityClass, name=name)
activity = factory()
configure_attributes(node, activity, self.attributes)
+ cp_start = Products.AlphaFlow.checkpoint.CheckpointDefinition()
+ cp_start.activities.extend(activity.startActivity)
+ activity._setObject(config.CHECKPOINT_START, cp_start)
+ cp_complete = Products.AlphaFlow.checkpoint.CheckpointDefinition()
+ activity._setObject(config.CHECKPOINT_COMPLETE, cp_complete)
return [activity]
|
SVN: r4699 - in AlphaFlow/trunk: editor tests
Roman Joost <rj(at)gocept.com> |
2007-04-20 13:21:17 |
[ FULL ]
|
Author: roman
Date: Fri Apr 20 13:21:14 2007
New Revision: 4699
Log:
- assign the generated id to newly created activity
Modified:
AlphaFlow/trunk/editor/editor.py
AlphaFlow/trunk/tests/test_editor.py
Modified: AlphaFlow/trunk/editor/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/editor.py (original)
+++ AlphaFlow/trunk/editor/editor.py Fri Apr 20 13:21:14 2007
(at)(at) -83,6 +83,7 (at)(at)
Products.AlphaFlow.interfaces.IActivityClass, name=activity)
activity = factory()
activity.title = title
+ activity.id = uid
self.context[uid] = activity
return activity
Modified: AlphaFlow/trunk/tests/test_editor.py
==============================================================================
--- AlphaFlow/trunk/tests/test_editor.py (original)
+++ AlphaFlow/trunk/tests/test_editor.py Fri Apr 20 13:21:14 2007
(at)(at) -81,6 +81,7 (at)(at)
activity = 'switch'
newactivity = form.addActivity(title, activity)
+ self.assert_(newactivity.id.startswith(activity))
self.assertEquals(10, len(process.objectValues()))
self.assertEquals(title, newactivity.title )
|
SVN: r4700 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-20 15:48:40 |
[ FULL ]
|
Author: thomas
Date: Fri Apr 20 15:48:37 2007
New Revision: 4700
Log:
aspects are now supposed to be just children of checkpoints
Modified:
AlphaFlow/trunk/activity.py
AlphaFlow/trunk/checkpoint.py
AlphaFlow/trunk/interfaces.py
AlphaFlow/trunk/workitem.py
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Fri Apr 20 15:48:37 2007
(at)(at) -46,7 +46,6 (at)(at)
nonEditableFields = ()
startActivity = ()
- aspects = None
def manage_afterAdd(self, item, container):
super(BaseActivity, self).manage_afterAdd(item, container)
(at)(at) -55,8 +54,6 (at)(at)
# container
if container == self.aq_parent:
self.__parent__ = container
- if self.aspects is None:
- self.aspects = {} #XXX
security.declareProtected(config.MANAGE_WORKFLOW, "acquireActivity")
def acquireActivity(self):
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Fri Apr 20 15:48:37 2007
(at)(at) -46,7 +46,7 (at)(at)
def onStart(self):
self.getWorkItem().createWorkItems(self.getActivities())
- for aspect in self.definition().aspects:
+ for aspect in self.definition().objectValues():
inst = self.createChild(aspect, "Aspect")
controller = Products.AlphaFlow.interfaces.ILifeCycleController(
inst)
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Fri Apr 20 15:48:37 2007
(at)(at) -246,9 +246,6 (at)(at)
startActivity = zope.interface.Attribute(
"sequence of activity ids to create work items from upon start")
- aspects = zope.interface.Attribute(
- "A dictionary that maps the name of a checkpoint to a list of
aspects.")
-
def getPossibleChildren():
"""Return a list of all ids of activities that can be instantiated as
successors by instances of this activity."""
(at)(at) -513,13 +510,6 (at)(at)
to ensure an up-to-date cache.
"""
- def getAspects(checkpoint):
- """Return all aspects for a checkpoint.
-
- The checkpoint is given as a name.
-
- """
-
def beforeCreationItems(items, parent):
"""Trigger that gets called before new work items get active.
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Fri Apr 20 15:48:37 2007
(at)(at) -417,12 +417,6 (at)(at)
checkpoint = self.getExits()[name]
return checkpoint()
- def getAspects(self, checkpoint):
- return ()
- aspects = self.getActivity().aspects[checkpoint]
- return [zope.component.getMultiAdapter((self, aspect),
IWorkItemAspect)
- for aspect in aspects]
-
security.declarePrivate('getExits')
def getExits(self):
activity = self.getActivity()
|
SVN: r4701 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-20 19:44:06 |
[ FULL ]
|
Author: thomas
Date: Fri Apr 20 19:44:04 2007
New Revision: 4701
Log:
store generated workitems on checkpoints to be able to return them from
passCheckpoint
Modified:
AlphaFlow/trunk/checkpoint.py
AlphaFlow/trunk/interfaces.py
AlphaFlow/trunk/workitem.py
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Fri Apr 20 19:44:04 2007
(at)(at) -37,6 +37,8 (at)(at)
log_name = "checkpoint"
log_children_name = "aspects"
+ generated_workitems = ()
+
def __init__(self, definition, id):
Checkpoint.inheritedAttribute("__init__")(self, id)
self.definition = persistent.wref.WeakRef(definition)
(at)(at) -45,7 +47,8 (at)(at)
return self.definition().activities
def onStart(self):
- self.getWorkItem().createWorkItems(self.getActivities())
+ self.generated_workitems = self.getWorkItem().createWorkItems(
+ self.getActivities())
for aspect in self.definition().objectValues():
inst = self.createChild(aspect, "Aspect")
controller = Products.AlphaFlow.interfaces.ILifeCycleController(
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Fri Apr 20 19:44:04 2007
(at)(at) -548,6 +548,8 (at)(at)
id = zope.interface.Attribute("ID")
+ generated_workitems = zope.interface.Attribute("Generated work items")
+
def __call__(self):
"""Executes all aspects of the checkpoint.
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Fri Apr 20 19:44:04 2007
(at)(at) -413,6 +413,7 (at)(at)
if name in [config.CHECKPOINT_START, config.CHECKPOINT_COMPLETE]:
checkpoint = self.createChild(self.getActivity()[name],
"Checkpoint")
ILifeCycleController(checkpoint).start("Started by work item.")
+ return checkpoint.generated_workitems
else:
checkpoint = self.getExits()[name]
return checkpoint()
|
SVN: r4702 - AlphaFlow/trunk/activities
Thomas Lotze <tl(at)gocept.com> |
2007-04-23 13:21:17 |
[ FULL ]
|
Author: thomas
Date: Mon Apr 23 13:21:14 2007
New Revision: 4702
Log:
more straight-forward coding
Modified:
AlphaFlow/trunk/activities/parent.py
Modified: AlphaFlow/trunk/activities/parent.py
==============================================================================
--- AlphaFlow/trunk/activities/parent.py (original)
+++ AlphaFlow/trunk/activities/parent.py Mon Apr 23 13:21:14 2007
(at)(at) -89,11 +89,8 (at)(at)
while parent.activity_id != parent_name:
parent = parent.getParent()
if parent is None:
- break
-
- if parent is None:
- raise AlphaFlowException(
- 'Could not find %r activity within parents' % parent_name)
+ raise AlphaFlowException(
+ 'Could not find %r activity within parents' % parent_name)
continue_with = parent.getParent()
if continue_with is None:
|
SVN: r4704 - in AlphaFlow/trunk: . Extensions
Thomas Lotze <tl(at)gocept.com> |
2007-04-24 13:12:54 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 24 13:12:52 2007
New Revision: 4704
Log:
don't index Checkpoints
Modified:
AlphaFlow/trunk/Extensions/Install.py
AlphaFlow/trunk/checkpoint.py
Modified: AlphaFlow/trunk/Extensions/Install.py
==============================================================================
--- AlphaFlow/trunk/Extensions/Install.py (original)
+++ AlphaFlow/trunk/Extensions/Install.py Tue Apr 24 13:12:52 2007
(at)(at) -151,6 +151,8 (at)(at)
for name, workitem in zope.component.getUtilitiesFor(IWorkItemClass):
at.setCatalogsByType(workitem.meta_type, ["workflow_catalog"])
+ at.setCatalogsByType("Checkpoint", [])
+
if added:
wfc.refreshCatalog(clear=1)
Modified: AlphaFlow/trunk/checkpoint.py
==============================================================================
--- AlphaFlow/trunk/checkpoint.py (original)
+++ AlphaFlow/trunk/checkpoint.py Tue Apr 24 13:12:52 2007
(at)(at) -30,6 +30,8 (at)(at)
class Checkpoint(Products.AlphaFlow.lifecycle.LifeCycleObjectBase):
+ portal_type = "Checkpoint"
+
zope.interface.implements(
zope.app.annotation.interfaces.IAttributeAnnotatable,
Products.AlphaFlow.interfaces.ICheckpoint)
|
SVN: r4705 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-24 13:13:45 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 24 13:13:43 2007
New Revision: 4705
Log:
keep LifeCycleController out of the acquisition chain in more cases
Modified:
AlphaFlow/trunk/lifecycle.py
Modified: AlphaFlow/trunk/lifecycle.py
==============================================================================
--- AlphaFlow/trunk/lifecycle.py (original)
+++ AlphaFlow/trunk/lifecycle.py Tue Apr 24 13:13:43 2007
(at)(at) -185,7 +185,7 (at)(at)
if self.state != "active":
raise LifeCycleError(
"Can't complete instance that is `%s`." % self.state)
- self.__parent__.onCompletion()
+ self.__parent__.aq_inner.onCompletion()
self.state = "ended"
self.recordEvent("complete", "ended", comment)
zope.event.notify(LifeCycleEvent(self.__parent__))
(at)(at) -196,7 +196,7 (at)(at)
raise LifeCycleError(
"Can't terminate instance that is already `ended`.")
self.state = "terminating"
- self.__parent__.onTermination()
+ self.__parent__.aq_inner.onTermination()
self.state = "ended"
self.recordEvent("terminate", "ended", comment)
zope.event.notify(LifeCycleEvent(self.__parent__))
(at)(at) -204,14 +204,14 (at)(at)
def reset(self, comment):
"""Reset the life cycle back to `new`."""
self.state = "resetting"
- self.__parent__.onReset()
+ self.__parent__.aq_inner.onReset()
self.state = "new"
self.recordEvent("reset", "new", comment)
zope.event.notify(LifeCycleEvent(self.__parent__))
def fail(self, comment, exception=None):
"""Put the life cycle instance object into `failed` state."""
- self.__parent__.onFailure()
+ self.__parent__.aq_inner.onFailure()
if DEBUG_FAILURE:
raise
(at)(at) -234,7 +234,7 (at)(at)
raise ValueError("Can't drop in when in `%s` state." % self.state)
self.state = "active"
self.recordEvent("recover", "active", comment)
- self.__parent__.onRecovery()
+ self.__parent__.aq_inner.onRecovery()
zope.event.notify(LifeCycleEvent(self.__parent__))
def recordEvent(self, action, state, comment):
|
SVN: r4706 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-24 13:14:00 |
[ FULL ]
|
Author: thomas
Date: Tue Apr 24 13:13:58 2007
New Revision: 4706
Log:
fix hook name
Modified:
AlphaFlow/trunk/workitem.py
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Tue Apr 24 13:13:58 2007
(at)(at) -314,7 +314,7 (at)(at)
self.passCheckpoint(config.CHECKPOINT_START)
- def onComplete(self):
+ def onCompletion(self):
self.passCheckpoint(config.CHECKPOINT_COMPLETE)
security.declarePublic("getActivity") # XXX .... yurks
|
SVN: r4707 - AlphaFlow/trunk/tests
Thomas Lotze <tl(at)gocept.com> |
2007-04-25 08:52:13 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 25 08:52:10 2007
New Revision: 4707
Log:
better use of the language
Modified:
AlphaFlow/trunk/tests/test_definition.py
Modified: AlphaFlow/trunk/tests/test_definition.py
==============================================================================
--- AlphaFlow/trunk/tests/test_definition.py (original)
+++ AlphaFlow/trunk/tests/test_definition.py Wed Apr 25 08:52:10 2007
(at)(at) -78,10 +78,6 (at)(at)
class ProcessDefinitionFake(SimpleItem):
pass
-
-def sort_tuple_by_item_0(a,b):
- return cmp(a[0], b[0])
-
class ProcessDefinitionTest(AlphaFlowTestCase):
(at)(at) -169,17 +165,13 (at)(at)
continue
if nodeName == 'workflow' and attr == 'id':
continue # id in workflow tag may be left out or set by hand
- breaked = False
for act_attr in act_attrs:
- if act_attr.domAttr == attr:
- if convert_to_xml(act_attr.default) == value:
- breaked = True
- break
- if breaked:
- continue
- res.append((attr, value))
- res.sort(sort_tuple_by_item_0)
- return res
+ if (act_attr.domAttr == attr and
+ convert_to_xml(act_attr.default) == value):
+ break
+ else:
+ res.append((attr, value))
+ return sorted(res)
def _filter_relevant_childs(self, node):
assignees_attrs = self._get_assignees_attrs()
|
SVN: r4708 - AlphaFlow/trunk/tests
Thomas Lotze <tl(at)gocept.com> |
2007-04-25 09:26:13 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 25 09:26:10 2007
New Revision: 4708
Log:
cleaning up whitespace after Vim users *g
Modified:
AlphaFlow/trunk/tests/test_editor.py
Modified: AlphaFlow/trunk/tests/test_editor.py
==============================================================================
--- AlphaFlow/trunk/tests/test_editor.py (original)
+++ AlphaFlow/trunk/tests/test_editor.py Wed Apr 25 09:26:10 2007
(at)(at) -27,7 +27,7 (at)(at)
actform = ActivityForm(process, request)
act1 = actform.addActivity("Task1", 'task')
act2 = actform.addActivity("Task2", 'task')
-
+
# we should have two activities in this process
self.assertEquals(2, len(process.objectIds()))
self.assert_(act1 in process.objectValues())
(at)(at) -42,20 +42,20 (at)(at)
class ActivityPanelTest(AlphaFlowTestCase):
interfaces_to_test = []
-
+
def test_getActivities(self):
- self._import_wf('workflows/permission.alf')
+ self._import_wf('workflows/permission.alf')
pm = self.portal.workflow_manager
process = pm.processes.test
request = zope.publisher.browser.TestRequest()
-
+
ap = ActivityPanel(process, request)
activities = ap.getActivities()
self.assertEquals(16, len(list(activities)))
def test_listProcessActivities(self):
- self._import_wf('workflows/permission.alf')
+ self._import_wf('workflows/permission.alf')
pm = self.portal.workflow_manager
process = pm.processes.test
request = zope.publisher.browser.TestRequest()
(at)(at) -69,7 +69,7 (at)(at)
interfaces_to_test = []
def test_addActivity(self):
- self._import_wf('workflows/permission.alf')
+ self._import_wf('workflows/permission.alf')
pm = self.portal.workflow_manager
process = pm.processes.test
request = zope.publisher.browser.TestRequest()
(at)(at) -80,7 +80,7 (at)(at)
title = "New activity as a test"
activity = 'switch'
newactivity = form.addActivity(title, activity)
-
+
self.assert_(newactivity.id.startswith(activity))
self.assertEquals(10, len(process.objectValues()))
self.assertEquals(title, newactivity.title )
(at)(at) -94,7 +94,7 (at)(at)
pm = self.portal.workflow_manager
# by default, we only have 4 processes definded
self.assertEquals(4, len(pm.processes.objectIds()))
-
+
# now add a new process
configlet = Configlet(pm, zope.publisher.browser.TestRequest())
title = "neuer TestWorkflow"
(at)(at) -108,7 +108,7 (at)(at)
# add a new process and delete it
configlet.addProcess("Testprocess")
self.assertEquals(5, len(pm.processes.objectIds()))
-
+
configlet.delProcess(pm.processes.objectIds()[-1])
self.assertEquals(4, len(pm.processes.objectIds()))
|
SVN: r4709 - AlphaFlow/trunk/editor
Thomas Lotze <tl(at)gocept.com> |
2007-04-25 09:30:38 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 25 09:30:35 2007
New Revision: 4709
Log:
cleaning up whitespace after Vim users *g
Modified:
AlphaFlow/trunk/editor/editor.py
Modified: AlphaFlow/trunk/editor/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/editor.py (original)
+++ AlphaFlow/trunk/editor/editor.py Wed Apr 25 09:30:35 2007
(at)(at) -33,11 +33,12 (at)(at)
return False
+
Globals.InitializeClass(Editor)
class ActivityPanel(Products.Five.BrowserView):
-
+
security = AccessControl.ClassSecurityInfo()
security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
(at)(at) -48,7 +49,7 (at)(at)
"""
return self.context.listPossibleActivities()
- security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'listProcessActivities')
def listProcessActivities(self):
"""Returns a list of dictionaries with information about activities in
(at)(at) -56,7 +57,7 (at)(at)
"""
activities = self.context.objectValues()
result = []
-
+
for act in activities:
info = {'title': act.title,
'id' : act.getId(),
(at)(at) -64,9 +65,10 (at)(at)
'url': act.absolute_url(),
}
result.append(info)
-
+
return result
-
+
+
Globals.InitializeClass(ActivityPanel)
(at)(at) -74,7 +76,7 (at)(at)
security = AccessControl.ClassSecurityInfo()
- security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'addActivity')
def addActivity(self, title, activity):
"""Returns graph data for this process"""
(at)(at) -88,6 +90,7 (at)(at)
return activity
+
Globals.InitializeClass(ActivityForm)
(at)(at) -95,12 +98,13 (at)(at)
security = AccessControl.ClassSecurityInfo()
- security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
+ security.declareProtected(Products.AlphaFlow.config.MANAGE_WORKFLOW,
'getGraph')
def getGraph(self):
"""Returns graph data for this process"""
pm = Products.CMFCore.utils.getToolByName(self, 'workflow_manager')
- return pm.renderProcess(self.context.id, kind='minimal',
+ return pm.renderProcess(self.context.id, kind='minimal',
REQUEST=self.request)
+
Globals.InitializeClass(Graph)
|
SVN: r4710 - in AlphaFlow/trunk: . editor tests
Thomas Lotze <tl(at)gocept.com> |
2007-04-25 10:09:40 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 25 10:09:35 2007
New Revision: 4710
Log:
removed startActivity attribute of activities except during xml import
Modified:
AlphaFlow/trunk/activity.py
AlphaFlow/trunk/editor/editor.py
AlphaFlow/trunk/interfaces.py
AlphaFlow/trunk/tests/test_editor.py
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Wed Apr 25 10:09:35 2007
(at)(at) -45,7 +45,6 (at)(at)
commentfield = ""
nonEditableFields = ()
- startActivity = ()
def manage_afterAdd(self, item, container):
super(BaseActivity, self).manage_afterAdd(item, container)
(at)(at) -97,7 +96,7 (at)(at)
"Return list of activities titles which are startActivities of this
one."
res = []
process = self.acquireProcess()
- for activity_id in self.startActivity:
+ for activity_id in self[config.CHECKPOINT_START].activities:
res.append(process[activity_id].getId())
return res
Modified: AlphaFlow/trunk/editor/editor.py
==============================================================================
--- AlphaFlow/trunk/editor/editor.py (original)
+++ AlphaFlow/trunk/editor/editor.py Wed Apr 25 10:09:35 2007
(at)(at) -14,6 +14,7 (at)(at)
import Products.AlphaFlow.config
import Products.AlphaFlow.interfaces
+import Products.AlphaFlow.checkpoint
class Editor(Products.Five.BrowserView):
(at)(at) -28,7 +29,8 (at)(at)
"""
ids = self.context.listActivityIds()
for id in ids:
- if self.context[id].startActivity:
+ if self.context[id][Products.AlphaFlow.config.CHECKPOINT_START
+ ].activities:
return True
return False
(at)(at) -88,6 +90,13 (at)(at)
activity.id = uid
self.context[uid] = activity
+ cp_start = Products.AlphaFlow.checkpoint.CheckpointDefinition()
+ activity._setObject(Products.AlphaFlow.config.CHECKPOINT_START,
+ cp_start)
+ cp_complete = Products.AlphaFlow.checkpoint.CheckpointDefinition()
+ activity._setObject(Products.AlphaFlow.config.CHECKPOINT_COMPLETE,
+ cp_complete)
+
return activity
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Wed Apr 25 10:09:35 2007
(at)(at) -243,9 +243,6 (at)(at)
nonEditableFields = zope.interface.Attribute(
"list of configurationSchema field names that can't be edited")
- startActivity = zope.interface.Attribute(
- "sequence of activity ids to create work items from upon start")
-
def getPossibleChildren():
"""Return a list of all ids of activities that can be instantiated as
successors by instances of this activity."""
Modified: AlphaFlow/trunk/tests/test_editor.py
==============================================================================
--- AlphaFlow/trunk/tests/test_editor.py (original)
+++ AlphaFlow/trunk/tests/test_editor.py Wed Apr 25 10:09:35 2007
(at)(at) -10,6 +10,7 (at)(at)
from Products.AlphaFlow.editor.editor import\
Editor, ActivityPanel, ActivityForm
from Products.AlphaFlow.browser.configlet import Configlet
+import Products.AlphaFlow.config
class EditorViewTest(AlphaFlowTestCase):
(at)(at) -35,7 +36,8 (at)(at)
self.assertEquals(False, editorview.canRenderWorkflow())
# now connect those and we should be able to display a graph
- act1.startActivity = (act2.id, )
+ act1[Products.AlphaFlow.config.CHECKPOINT_START].activities += (
+ act2.id, )
self.assertEquals(True, editorview.canRenderWorkflow())
|
SVN: r4712 - AlphaFlow/trunk/activities
Thomas Lotze <tl(at)gocept.com> |
2007-04-25 11:12:26 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 25 11:12:23 2007
New Revision: 4712
Log:
declaring switch case conditions more formally
Modified:
AlphaFlow/trunk/activities/interfaces.py
AlphaFlow/trunk/activities/switch.py
Modified: AlphaFlow/trunk/activities/interfaces.py
==============================================================================
--- AlphaFlow/trunk/activities/interfaces.py (original)
+++ AlphaFlow/trunk/activities/interfaces.py Wed Apr 25 11:12:23 2007
(at)(at) -15,6 +15,9 (at)(at)
class ICase(IExit):
"""Case for ISwitchActivity."""
+ condition = zope.interface.Attribute(
+ "TALES expression returning True or False.")
+
class IEMailRecipientMode(zope.interface.Interface):
"""Configure which users are recipients for an email activity."""
Modified: AlphaFlow/trunk/activities/switch.py
==============================================================================
--- AlphaFlow/trunk/activities/switch.py (original)
+++ AlphaFlow/trunk/activities/switch.py Wed Apr 25 11:12:23 2007
(at)(at) -29,7 +29,9 (at)(at)
class Case(Exit):
- pass
+
+ condition = ""
+
class SwitchActivity(BaseActivity):
|
SVN: r4713 - AlphaFlow/trunk/xmlimport
Thomas Lotze <tl(at)gocept.com> |
2007-04-25 11:59:20 |
[ FULL ]
|
Author: thomas
Date: Wed Apr 25 11:59:18 2007
New Revision: 4713
Log:
a SwitchActivity isn't a BaseAutomaticActivity
Modified:
AlphaFlow/trunk/xmlimport/domimporters.py
Modified: AlphaFlow/trunk/xmlimport/domimporters.py
==============================================================================
--- AlphaFlow/trunk/xmlimport/domimporters.py (original)
+++ AlphaFlow/trunk/xmlimport/domimporters.py Wed Apr 25 11:59:18 2007
(at)(at) -395,7 +395,7 (at)(at)
)
-class Switch(BaseAutomaticActivity):
+class Switch(BaseActivity):
attributes = BaseAutomaticActivity.attributes + (
WorkflowAttribute('mode', 'mode', None,
|
SVN: r4733 - AlphaFlow/trunk
Thomas Lotze <tl(at)gocept.com> |
2007-04-26 14:06:26 |
[ FULL ]
|
Author: thomas
Date: Thu Apr 26 14:06:23 2007
New Revision: 4733
Log:
added and wired abstract aspect stuff
Added:
AlphaFlow/trunk/aspect.py (contents, props changed)
Modified:
AlphaFlow/trunk/configure.zcml
AlphaFlow/trunk/interfaces.py
Added: AlphaFlow/trunk/aspect.py
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/aspect.py Thu Apr 26 14:06:23 2007
(at)(at) -0,0 +1,46 (at)(at)
+# Copyright (c) 2007 gocept gmbh & co. kg
+# See also LICENSE.txt
+# $Id$
+"""Aspect and their definitions."""
+
+import persistent.wref
+import OFS.SimpleItem
+from Globals import InitializeClass
+
+import zope.interface
+
+import Products.AlphaFlow.interfaces
+import Products.AlphaFlow.lifecycle
+import Products.AlphaFlow.utils
+
+
+class AspectDefinition(OFS.SimpleItem.SimpleItem):
+
+ zope.interface.implements(Products.AlphaFlow.interfaces.IAspectDefinition)
+
+
+InitializeClass(AspectDefinition)
+
+
+class Aspect(Products.AlphaFlow.utils.ContentObjectRetrieverBase,
+ Products.AlphaFlow.lifecycle.LifeCycleObjectBase):
+
+ zope.interface.implements(Products.AlphaFlow.interfaces.IAspect)
+
+ definition = None
+
+ def __init__(self, definition, id):
+ Aspect.inheritedAttribute("__init__")(self, id)
+ self.definition = persistent.wref.WeakRef(definition)
+
+ def __call__(self):
+ pass
+
+ def onStart(self):
+ Aspect.inheritedAttribute("onStart")(self)
+ self.__call__()
+ Products.AlphaFlow.interfaces.ILifeCycleController(self).complete(
+ "Completed aspect.")
+
+
+InitializeClass(Aspect)
Modified: AlphaFlow/trunk/configure.zcml
==============================================================================
--- AlphaFlow/trunk/configure.zcml (original)
+++ AlphaFlow/trunk/configure.zcml Thu Apr 26 14:06:23 2007
(at)(at) -15,6 +15,13 (at)(at)
<include file="security.zcml" />
+ <!-- Aspect components -->
+ <adapter factory=".aspect.Aspect"
+ for=".interfaces.IAspectDefinition
+ str"
+ provides=".interfaces.IAspect"
+ />
+
<!-- Checkpoint components -->
<adapter factory=".checkpoint.ExitDefinition"
for=".interfaces.IActivity"
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Thu Apr 26 14:06:23 2007
(at)(at) -539,6 +539,18 (at)(at)
Returns nothing.
"""
+class IAspect(IContentObjectRetriever):
+ """An aspect.
+
+ Aspects are executed by checkpoints. They are similar to automatic work
+ items in that they have a life cycle which is short-circuited: aspects
+ perform their task complete immediately when they are started.
+ """
+
+ def __call__():
+ """Worker method that does whatever the aspect is supposed to do.
+ """
+
class ICheckpoint(zope.interface.Interface):
"""A checkpoint.
|
|