EduploneLearningSequence/Extensions EduploneOpenFlow.py,1.2,1.3 Install.py,1.6,1.7
Jens Klein <[email protected]>
| Newsgroups | gmane.comp.web.zope.eduplone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/eduplone/EduploneLearningSequence/Extensions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3239/Extensions
Modified Files:
EduploneOpenFlow.py Install.py
Log Message:
first name-ageddon
be careful, still busg in
Index: EduploneOpenFlow.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneLearningSequence/Extensions/EduploneOpenFlow.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** EduploneOpenFlow.py 22 Mar 2004 16:44:05 -0000 1.2
--- EduploneOpenFlow.py 16 Jun 2004 14:05:31 -0000 1.3
***************
*** 17,38 ****
! def ep_abs_complete(self, uid, action='forward') :
! """ Finalizes an activity """
!
! # this script completes a learning step
!
! print "----------"
! print "ep_abs_complete is being called"
!
! print "get openflow"
! oftool = self.portal_openflow
! print "get archetypestool"
! attool = self.archetype_tool
! print "get object with uid", uid
! archetype = attool.getObject(uid)
! print "got:", archetype
! print "get user"
user_name = self.REQUEST.AUTHENTICATED_USER.getUserName()
- print "user is", user_name
# first pick an instance fitting to the username and uid
--- 17,27 ----
! def lsq_complete(self, uid, action='forward') :
! """ Finalizes an activity (learning step)"""
!
! oftool = self.portal_openflow
! attool = self.archetype_tool
! activity = attool.getObject(uid)
user_name = self.REQUEST.AUTHENTICATED_USER.getUserName()
# first pick an instance fitting to the username and uid
***************
*** 40,52 ****
uid = uid,
)
! print "workitems #instances", len(instances)
! i = 0
! w = 0
for instancebrain in instances :
instance = instancebrain.getObject()
workitems=instance.objectValues('Workitem')
- print "got successfully instance and workitem"
! for workitem in workitems :
if (workitem.actor == user_name) :
if (workitem.status == 'active') :
--- 29,38 ----
uid = uid,
)
! i = w =0
for instancebrain in instances :
instance = instancebrain.getObject()
workitems=instance.objectValues('Workitem')
! for workitem in workitems:
if (workitem.actor == user_name) :
if (workitem.status == 'active') :
***************
*** 54,88 ****
i = instance
! if w :
! workitem = w
! if i :
! instance = i
instance_id = instance.id
workitem_id = workitem.id
print "got ids and other stuff"
!
! ## # Engine checks metatypes now......
! ## try :
! ## isLearningStep = archetype.isLearningStep
! ## except :
! ## isLearningStep = 0
!
# now get next uid in OrderedFolder
if (action == 'prev') :
! nextobj = archetype.getPreviousObject()
else :
! nextobj = archetype.getNextObject()
! print "got nextobj"
try :
! uid = nextobj.UID()
! archetype = attool.getObject(uid)
! at_type=archetype.getActivitytype()
! nexturl = nextobj.absolute_url()
except :
uid = None
! archetype = None
! at_type = None
nexturl=None
--- 40,66 ----
i = instance
! workitem = w or None
! instance = i or None
instance_id = instance.id
workitem_id = workitem.id
print "got ids and other stuff"
!
# now get next uid in OrderedFolder
if (action == 'prev') :
! nextobj = activity.getPreviousObject()
else :
! nextobj = activity.getNextObject()
!
try :
! uid = nextobj.UID()
! activity = attool.getObject(uid)
! activitytype = activity.getActivitytype()
! nexturl = nextobj.absolute_url()
except :
uid = None
! activity = None
! activitytype = None
nexturl=None
***************
*** 93,105 ****
print "Changed uid in instance: ", uid
! instance.manage_changeProperties(at_metatype=at_type)
! print "Changed at_metatype in instance: ", at_type
new_user_name=''
! if (archetype != None) :
! if (archetype.getActivitytype() == 'learning-activity') :
new_user_name=instance['student']
print "Changed user in instance to", instance['student']
! elif (archetype.getActivitytype() == 'support-activity') :
new_user_name=instance['tutor']
print "Changed user in instance to", instance['tutor']
--- 71,83 ----
print "Changed uid in instance: ", uid
! instance.manage_changeProperties(activitytype=activitytype)
! print "Changed activitytype in instance: ", activitytype
new_user_name=''
! if (activity != None) :
! if (activity.getActivitytype() == 'learning-activity') :
new_user_name=instance['student']
print "Changed user in instance to", instance['student']
! elif (activity.getActivitytype() == 'support-activity') :
new_user_name=instance['tutor']
print "Changed user in instance to", instance['tutor']
***************
*** 136,144 ****
! def ep_abs_call(self, process_id, instance_id, workitem_id, activity_id) :
! """ Just calls an archetype """
- print "ep_abs_call is being called"
-
oftool = self.portal_openflow
instance = oftool[instance_id]
--- 114,120 ----
! def lsq_call(self, process_id, instance_id, workitem_id, activity_id) :
! """ Just calls an activity """
oftool = self.portal_openflow
instance = oftool[instance_id]
***************
*** 147,154 ****
except KeyError:
return
! attool = self.archetype_tool
! archetype = attool.getObject(uid)
user_name = self.REQUEST.AUTHENTICATED_USER.getUserName()
! url = archetype.absolute_url()
request = self.REQUEST
--- 123,130 ----
except KeyError:
return
! attool = self.activity_tool
! activity = attool.getObject(uid)
user_name = self.REQUEST.AUTHENTICATED_USER.getUserName()
! url = activity.absolute_url()
request = self.REQUEST
Index: Install.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneLearningSequence/Extensions/Install.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Install.py 14 Jun 2004 16:05:25 -0000 1.6
--- Install.py 16 Jun 2004 14:05:31 -0000 1.7
***************
*** 49,65 ****
# Install External Methods for OpenFlow
! manage_addExternalMethod(self,'ep_abs_call', 'ep_abs_call',
! PROJECTNAME+'.EduploneOpenFlow', 'ep_abs_call')
! manage_addExternalMethod(self,'ep_abs_complete','ep_abs_complete',
! PROJECTNAME+'.EduploneOpenFlow', 'ep_abs_complete')
# Add applications to Openflow-Tool
oft=portal['portal_openflow']
! oft.addApplication('ep_abs_app_use_step','ep_abs_use_step')
! oft.addApplication('ep_abs_app_call','ep_abs_call')
# Add process to Openflow-Tool
oft.addProcess(
! 'ep_abs_process', # id
'eduplone learning sequence', #title
'eduplone action based learning sequence process', # description
--- 49,65 ----
# Install External Methods for OpenFlow
! manage_addExternalMethod(self,'lsq_call', 'lsq_call',
! PROJECTNAME+'.EduploneOpenFlow', 'lsq_call')
! manage_addExternalMethod(self,'lsq_complete','lsq_complete',
! PROJECTNAME+'.EduploneOpenFlow', 'lsq_complete')
# Add applications to Openflow-Tool
oft=portal['portal_openflow']
! oft.addApplication('lsq_app_use_step','lsq_use_step')
! oft.addApplication('lsq_app_call','lsq_call')
# Add process to Openflow-Tool
oft.addProcess(
! 'lsq_process', # id
'eduplone learning sequence', #title
'eduplone action based learning sequence process', # description
***************
*** 67,73 ****
)
! ofp = oft['ep_abs_process']
# Add activities to process
! ofp.addActivity( 'ep_abs_act_router',
split_mode='xor',
join_mode='xor',
--- 67,73 ----
)
! ofp = oft['lsq_process']
# Add activities to process
! ofp.addActivity( 'lsq_act_router',
split_mode='xor',
join_mode='xor',
***************
*** 84,88 ****
kind='dummy'
)
! ofp.addActivity( 'ep_abs_act_use_step',
split_mode='xor',
join_mode='xor',
--- 84,88 ----
kind='dummy'
)
! ofp.addActivity( 'lsq_act_use_step',
split_mode='xor',
join_mode='xor',
***************
*** 92,96 ****
subflow='',
push_application='',
! application='ep_abs_app_call',
title='Use Step!',
parameters='',
--- 92,96 ----
subflow='',
push_application='',
! application='lsq_app_call',
title='Use Step!',
parameters='',
***************
*** 99,103 ****
kind='standard'
)
! ofp.addActivity( 'ep_abs_act_use_action',
split_mode='and',
join_mode='and',
--- 99,103 ----
kind='standard'
)
! ofp.addActivity( 'lsq_act_use_action',
split_mode='and',
join_mode='and',
***************
*** 107,111 ****
subflow='',
push_application='',
! application='ep_abs_app_use_step',
title='TutorAction',
parameters='',
--- 107,111 ----
subflow='',
push_application='',
! application='lsq_app_use_step',
title='TutorAction',
parameters='',
***************
*** 116,128 ****
# Add transitions to process
! ofp.addTransition('Begin_ep_abs_act_router',
! 'Begin','ep_abs_act_router')
! ofp.addTransition('ep_abs_act_router_ep_abs_act_use_step',
! 'ep_abs_act_router','ep_abs_act_use_step',
'python:(here.uid != None)')
! ofp.addTransition('ep_abs_act_use_step_ep_abs_act_router',
! 'ep_abs_act_use_step','ep_abs_act_router')
! ofp.addTransition('ep_abs_act_router_End',
! 'ep_abs_act_router','End',
'python:(here.uid == None)')
--- 116,128 ----
# Add transitions to process
! ofp.addTransition('Begin_lsq_act_router',
! 'Begin','lsq_act_router')
! ofp.addTransition('lsq_act_router_lsq_act_use_step',
! 'lsq_act_router','lsq_act_use_step',
'python:(here.uid != None)')
! ofp.addTransition('lsq_act_use_step_lsq_act_router',
! 'lsq_act_use_step','lsq_act_router')
! ofp.addTransition('lsq_act_router_End',
! 'lsq_act_router','End',
'python:(here.uid == None)')
***************
*** 188,197 ****
# Remove applications to Openflow-Tool
oft=portal['portal_openflow']
! oft.deleteApplication('ep_abs_app_use_step')
! oft.deleteApplication('ep_abs_app_call')
print >> out, "Removed openflow applications."
# remove process from Openflow-Tool
! oft.deleteProcess('ep_abs_process')
# unistall roles
--- 188,197 ----
# Remove applications to Openflow-Tool
oft=portal['portal_openflow']
! hasattr(oft,'lsq_app_use_step') and oft.deleteApplication('lsq_app_use_step')
! hasattr(oft,'lsq_app_use_call') and oft.deleteApplication('lsq_app_call')
print >> out, "Removed openflow applications."
# remove process from Openflow-Tool
! hasattr(oft,'lsq_process') and oft.deleteProcess('lsq_process')
# unistall roles
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND