commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/appserver grpc/GEAS.grpc src/geasSession.p...


From: Jan Ischebeck
Subject: gnue/appserver grpc/GEAS.grpc src/geasSession.p...
Date: Sun, 08 Dec 2002 18:50:04 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jan Ischebeck <address@hidden>  02/12/08 18:50:04

Modified files:
        appserver/grpc : GEAS.grpc 
        appserver/src  : geasSession.py geasSessionManager.py 

Log message:
        add classname parameter to store/load/call
        add delete function

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/grpc/GEAS.grpc.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSession.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSessionManager.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnue/appserver/grpc/GEAS.grpc
diff -c gnue/appserver/grpc/GEAS.grpc:1.5 gnue/appserver/grpc/GEAS.grpc:1.6
*** gnue/appserver/grpc/GEAS.grpc:1.5   Fri Nov 29 09:16:20 2002
--- gnue/appserver/grpc/GEAS.grpc       Sun Dec  8 18:50:04 2002
***************
*** 34,53 ****
      </method>
      <method name="load" return="array">
        <argument name="sessionid" type="string"/>
        <argument name="objids" type="list of objids"/>
        <argument name="propertylist" type="stringlist"/>
      </method>
!     <method name="store" return="array">
        <argument name="sessionid" type="string"/>
        <argument name="objids" type="list of objids"/>
        <argument name="propertylist" type="stringlist"/>
        <argument name="data" type="stringlist"/>
      </method>
      <method name="call" return="array">
        <argument name="sessionid" type="string"/>
        <argument name="objids" type="list of objids"/>
        <argument name="methodname" type="string"/>
        <argument name="parameters" type="stringlist"/>
      </method>
  
    </service>
--- 34,61 ----
      </method>
      <method name="load" return="array">
        <argument name="sessionid" type="string"/>
+       <argument name="classname" type="string"/>
        <argument name="objids" type="list of objids"/>
        <argument name="propertylist" type="stringlist"/>
      </method>
!     <method name="store">
        <argument name="sessionid" type="string"/>
+       <argument name="classname" type="string"/>
        <argument name="objids" type="list of objids"/>
        <argument name="propertylist" type="stringlist"/>
        <argument name="data" type="stringlist"/>
      </method>
      <method name="call" return="array">
        <argument name="sessionid" type="string"/>
+       <argument name="classname" type="string"/>
        <argument name="objids" type="list of objids"/>
        <argument name="methodname" type="string"/>
        <argument name="parameters" type="stringlist"/>
+     </method>
+     <method name="delete">
+       <argument name="sessionid" type="string"/>
+       <argument name="classname" type="string"/>
+       <argument name="objids" type="list of objids"/>
      </method>
  
    </service>
Index: gnue/appserver/src/geasSession.py
diff -c gnue/appserver/src/geasSession.py:1.10 
gnue/appserver/src/geasSession.py:1.11
*** gnue/appserver/src/geasSession.py:1.10      Thu Jun 20 20:34:33 2002
--- gnue/appserver/src/geasSession.py   Sun Dec  8 18:50:04 2002
***************
*** 19,25 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.10 2002/06/21 00:34:33 siesel Exp $
  
  import geasList
  import geasTrigger 
--- 19,25 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.11 2002/12/08 23:50:04 siesel Exp $
  
  import geasList
  import geasTrigger 
***************
*** 40,48 ****
      self._user = ""
      self._connections = connections
      self._database = "gnue"
!     self._activelists = []
      self._authAdapter = geasAuthentification.geasAuthAgent()
      self._triggerMg = geasTrigger.geasPythonDBTriggerMg(self)
    # 
---------------------------------------------------------------------------
    # Log into the application server
    # 
---------------------------------------------------------------------------
--- 40,51 ----
      self._user = ""
      self._connections = connections
      self._database = "gnue"
!     self._lists = {}
!     self._classes = {}
!     self._listcount=0
      self._authAdapter = geasAuthentification.geasAuthAgent()
      self._triggerMg = geasTrigger.geasPythonDBTriggerMg(self)
+ 
    # 
---------------------------------------------------------------------------
    # Log into the application server
    # 
---------------------------------------------------------------------------
***************
*** 75,85 ****
        tr=self._triggerMg.getTriggerByEvent('%s:pre_new_list' % classname)
        if tr!=None:
          tr()
        # create new List
        newlist=geasList.geasList (self, classname)
!       # every new list will be added to the _activelists list
        # which will be parsed for commit and rollback actions
!       self._activelists.append(newlist)
        return newlist;
      
      else: # no access
--- 78,90 ----
        tr=self._triggerMg.getTriggerByEvent('%s:pre_new_list' % classname)
        if tr!=None:
          tr()
+         
        # create new List
        newlist=geasList.geasList (self, classname)
!       # every new list will be added to the _lists list
        # which will be parsed for commit and rollback actions
!       self._listcount+=1
!       self._lists[self._listcount]=newlist
        return newlist;
      
      else: # no access
***************
*** 90,104 ****
    # 
---------------------------------------------------------------------------
  
    def commit (self):
!     for l in self._activelists:
!       l._resultset.post()
!       l._datasource.commit()
  
    # 
---------------------------------------------------------------------------
    # Rollback the active transaction
    # 
---------------------------------------------------------------------------
  
    def rollback (self):  
!     for l in self._activelists:
!       if hasattr(l,"_datasource"):
!         l._datasource.rollback()    
--- 95,191 ----
    # 
---------------------------------------------------------------------------
  
    def commit (self):
!     for l in self._lists.keys():      
!       if hasattr(self._lists[l],"_datasource"):
!         self._lists[l]._resultset.post()
!         self._lists[l]._datasource.commit()
  
    # 
---------------------------------------------------------------------------
    # Rollback the active transaction
    # 
---------------------------------------------------------------------------
  
    def rollback (self):  
!     for l in self._lists.keys():  
!       if hasattr(self._lists[l],"_datasource"):
!         self._lists[l]._datasource.rollback()    
! 
! 
!   # ---------------------------------------
!   # functions of the new RPC API
!   #     not well documented and still a subject of change
!   # ---------------------------------------
! 
!   # 
---------------------------------------------------------------------------
!   # Create a new list of business objects of a given class
!   # 
---------------------------------------------------------------------------
! 
!   def _getClass(self, classname):
! 
!     # if bclass already used, then continue to use the old one
!     if self._bclasses.has_key(classname):
!       return self._bclasses[classname]
! 
! 
!     # build new bclass (Buisness Object Class Manager)
!     
!     # Authentification
!     # TODO: use getRole (n.i.y.) function instead
!     if not self._authAdapter.hasAccess (self, self._user, classname):
!       raise Error,'Class "%s": No Access Granted or Not Existent' % classname
! 
!     # build bclass object
!     # TODO: replace it with a call to the class repository, like:
!     #       classrepository.buildBClassManager(classname, self._user, role)
!     newbclass=geasBClass.geasBClass (self, classname)
! 
!     # cache the bclass object
!     self._bclasses[classname]=newbclass
! 
!     return newbclass;    
!    
! 
!   def requestList(self,context,classname,conditions,
!                   sortorder,propertylist):
!     # TODO move the whole function into the session obj
!     a_list=self.createList(classname)
!     list_id=self._listcount
! 
!     # TODO: add a config_option to set the name of the ID field in the DB 
table
!     propertylist.add('_id_')
!     a_list.setPrefetch (propertylist)
!     a_list.setConditions (conditions)
!     a_list.setSort (sortorder)
!     a_list.populate()
!     
!     return list_id;
! 
!   def count(self,list_id):
!     return self._lists[list_id].count();
! 
!   def fetch(self,list_id,start,count):
!     rset=[]
!     c=0
!     row=self._lists[list_id].firstInstance ()
!     while (row!=None) and (c<start+count):
!       if c>=start:
!         rrow={}
!         for field in self._lists[list_id]._prefetch:
!           rrow[field]=row.get(field)
!         rset.append(rrow)
!         
!       c+=1
!       row=self._lists[list_id].nextInstance ()
!     
!     return rset;
! 
!   def load(self,classname,obj_id_list,propertylist):
!     return self._getClass(classname).load(self,obj_id_list,propertylist)
!         
!   def store(self,classname,obj_id_list,propertylist,data):
!     return self._getClass(classname).store(obj_id_list,propertylist,data)
!   
!   def call(self,classname,obj_id_list,methodname,parameters):
!     return self._getClass(classname).call(obj_id_list,methodname,parameters)
! 
!   def delete(self,classname,obj_id_list):
!     return self._getClass(classname).delete(obj_id_list)
Index: gnue/appserver/src/geasSessionManager.py
diff -c gnue/appserver/src/geasSessionManager.py:1.1 
gnue/appserver/src/geasSessionManager.py:1.2
*** gnue/appserver/src/geasSessionManager.py:1.1        Fri Nov 29 09:16:20 2002
--- gnue/appserver/src/geasSessionManager.py    Sun Dec  8 18:50:04 2002
***************
*** 19,25 ****
  #
  # Copyright 2001-2002 Free Software Foundation
  #
! # $Id: geasSessionManager.py,v 1.1 2002/11/29 14:16:20 siesel Exp $
  
  from geasList import *
  from geasSession import *
--- 19,25 ----
  #
  # Copyright 2001-2002 Free Software Foundation
  #
! # $Id: geasSessionManager.py,v 1.2 2002/12/08 23:50:04 siesel Exp $
  
  from geasList import *
  from geasSession import *
***************
*** 89,95 ****
    def rollback(self,session_id):
      self._sessions[session_id].rollback()
  
!   def requestList(self,session_id,context,classname,conditions,
                    sortorder,propertylist):
      self._sessions[session_id].requestList(context,classname,conditions,
                                             sortorder,propertylist)
--- 89,95 ----
    def rollback(self,session_id):
      self._sessions[session_id].rollback()
  
!   def requestList(self,session_id,classname,conditions,
                    sortorder,propertylist):
      self._sessions[session_id].requestList(context,classname,conditions,
                                             sortorder,propertylist)
***************
*** 97,113 ****
    def count(self,session_id,list_id):
      return self._sessions[session_id].count(list_id);
  
!   def fetch(self,session_id,list_id,start,count):
      return self._sessions[session_id].fetch(list_id,start,count)
  
!   def load(self,session_id,obj_id_list,propertylist):
!     return self._sessions[session_id].load(obj_id_list,propertylist)
    
!   def store(self,session_id,obj_id_list,propertylist,data):
!     return self._sessions[session_id].store(obj_id_list,propertylist)  
    
!   def call(self,session_id,obj_id_list,methodname,parameters):
!     return self._sessions[session_id].store(obj_id_list,propertylist)
     
    # 
    # thats the end of the new API
--- 97,118 ----
    def count(self,session_id,list_id):
      return self._sessions[session_id].count(list_id);
  
!   def fetch(self,session_id,list_id,start,count,close=0):
      return self._sessions[session_id].fetch(list_id,start,count)
  
!   def load(self,session_id,classname,obj_id_list,propertylist):
!     return self._sessions[session_id].load(classname,obj_id_list,propertylist)
    
!   def store(self,session_id,classname,obj_id_list,propertylist,data):
!     return self._sessions[session_id].store(classname,obj_id_list,\
!                                             propertylist,data)  
    
!   def call(self,session_id,classname,obj_id_list,methodname,parameters):
!     return self._sessions[session_id].call(classname,obj_id_list,\
!                                            methodname,parameters)
!   
!   def delete(self,session_id,classname,obj_id_list):
!     return self._sessions[session_id].delete(classname,obj_id_list)
     
    # 
    # thats the end of the new API



reply via email to

[Prev in Thread] Current Thread [Next in Thread]