EduploneLearningSequence/Extensions EduploneOpenFlow.py,1.3,1.4 Install.py,1.7,1.8

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-serv18613/Extensions

Modified Files:
	EduploneOpenFlow.py Install.py 
Log Message:
huge nameageddon and code cleanup


Index: EduploneOpenFlow.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneLearningSequence/Extensions/EduploneOpenFlow.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** EduploneOpenFlow.py	16 Jun 2004 14:05:31 -0000	1.3
--- EduploneOpenFlow.py	27 Jun 2004 16:09:23 -0000	1.4
***************
*** 17,21 ****
  
  
! def lsq_complete(self, uid, action='forward') :
      """ Finalizes an activity (learning step)"""
  
--- 17,21 ----
  
  
! def lsq_complete_activity(self, uid, action='forward') :
      """ Finalizes an activity (learning step)"""
  
***************
*** 27,33 ****
      # first pick an instance fitting to the username and uid    
      instances = oftool.Catalog(meta_type="Instance", 
!                                uid = uid,
!                               )
!     i = w =0
      for instancebrain in instances :
        instance = instancebrain.getObject()
--- 27,33 ----
      # first pick an instance fitting to the username and uid    
      instances = oftool.Catalog(meta_type="Instance", 
!                                uid = uid )
!     i = w = 0
!     # this loops are brain-dead ugly, need to find a smother way...
      for instancebrain in instances :
        instance = instancebrain.getObject()
***************
*** 45,49 ****
      instance_id = instance.id
      workitem_id = workitem.id
-     print "got ids and other stuff"
          
      # now get next uid in OrderedFolder
--- 45,48 ----
***************
*** 108,134 ****
          oftool.activateWorkitem(instance_id, workitem_id=workitem.id, actor=instance['user'])
      
!         if new_user_name==user_name and nexturl:
!              self.REQUEST.RESPONSE.redirect(nexturl)
!         else:
!              self.REQUEST.RESPONSE.redirect(self.portal_membership.getHomeUrl(user_name))
  
  
! def lsq_call(self, process_id, instance_id, workitem_id, activity_id) :
!     """ Just calls an activity """
      
      oftool = self.portal_openflow
      instance = oftool[instance_id]
!     try:
          uid = instance['uid']
!     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
!     RESPONSE =  request.RESPONSE
!     
!     self.REQUEST.RESPONSE.redirect(url)
!     
--- 107,130 ----
          oftool.activateWorkitem(instance_id, workitem_id=workitem.id, actor=instance['user'])
      
!     if new_user_name==user_name and nexturl:
!          self.REQUEST.RESPONSE.redirect(nexturl)
!     else:
!          self.REQUEST.RESPONSE.redirect(self.portal_membership.getHomeUrl(user_name))
  
  
! def get_lsq_activity(self, instance_id) :
!     """ returns an activity from an openflow instance
!         instance lookup by id
!     """
      
      oftool = self.portal_openflow
+     attool = self.archetype_tool
+     
      instance = oftool[instance_id]
!     if hasattr(instance, 'uid'):
          uid = instance['uid']
!     else:
!         return None
!         
!     self.REQUEST.response.redirect(attool.getObject(uid).absolute_url())
! 

Index: Install.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneLearningSequence/Extensions/Install.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Install.py	16 Jun 2004 14:05:31 -0000	1.7
--- Install.py	27 Jun 2004 16:09:24 -0000	1.8
***************
*** 49,61 ****
  
      # 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
--- 49,67 ----
  
      # Install External Methods for OpenFlow
!     manage_addExternalMethod(self,
!         'lsq_complete_activity',    
!         'lsq_complete_activity',    
!         PROJECTNAME+'.EduploneOpenFlow', 
!         'lsq_complete_activity')
!     manage_addExternalMethod(self,
!         'get_lsq_activity',
!         'get_lsq_activity',
!         PROJECTNAME+'.EduploneOpenFlow', 
!         'get_lsq_activity')
      
      # Add applications to Openflow-Tool
      oft=portal['portal_openflow']
      oft.addApplication('lsq_app_use_step','lsq_use_step')
!     oft.addApplication('lsq_app_call','get_lsq_activity')
      
      # Add process to Openflow-Tool
***************
*** 128,132 ****
        
      # Add workitemList to left slots
!     portal.left_slots=tuple(portal.left_slots)+('here/worklist_portlet/macros/worklistBox',)
  
      # add Roles
--- 134,138 ----
        
      # Add workitemList to left slots
!     portal.left_slots=tuple(portal.left_slots)+('here/portlet_lsqworklist/macros/portlet',)
  
      # add Roles



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.