[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/appserver grpc/GEAS.grpc src/geasList.py s...
From: |
Jan Ischebeck |
Subject: |
gnue/appserver grpc/GEAS.grpc src/geasList.py s... |
Date: |
Fri, 29 Nov 2002 09:16:20 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jan Ischebeck <address@hidden> 02/11/29 09:16:20
Modified files:
appserver/grpc : GEAS.grpc
appserver/src : geasList.py geasRpcServer.py geasRpcClient2.py
test2.py
Added files:
appserver/src : geasSessionManager.py
Log message:
new RPC api [part 2]
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/grpc/GEAS.grpc.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSessionManager.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasList.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasRpcServer.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasRpcClient2.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/test2.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.4 gnue/appserver/grpc/GEAS.grpc:1.5
*** gnue/appserver/grpc/GEAS.grpc:1.4 Mon Nov 25 18:24:20 2002
--- gnue/appserver/grpc/GEAS.grpc Fri Nov 29 09:16:20 2002
***************
*** 1,6 ****
<?xml version = '1.0' ?>
<gnurpc>
! <service name="SessionManager" binding="SessionManager">
<method name="open" helptext="open a new session">
<argument name="authentification" type="integer" default="0"/>
</method>
--- 1,6 ----
<?xml version = '1.0' ?>
<gnurpc>
! <service name="Session" binding="SessionManager">
<method name="open" helptext="open a new session">
<argument name="authentification" type="integer" default="0"/>
</method>
***************
*** 50,55 ****
--- 50,58 ----
<argument name="parameters" type="stringlist"/>
</method>
+ </service>
+ <service name="SessionManager" binding="OldSessionManager">
+
<method name="getNewSession" return="<SessionManager.geasSession>"
helptext="Return an new geasSession object"/>
<method name="Restart" helptext="Restarts the server"/>
<method name="Shutdown" helptext="shuts the server down">
Index: gnue/appserver/src/geasList.py
diff -c gnue/appserver/src/geasList.py:1.11 gnue/appserver/src/geasList.py:1.12
*** gnue/appserver/src/geasList.py:1.11 Wed Sep 18 10:07:45 2002
--- gnue/appserver/src/geasList.py Fri Nov 29 09:16:20 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.11 2002/09/18 14:07:45 siesel Exp $
from gnue.common import GDataSource,GConditions
import geasInstance
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasList.py,v 1.12 2002/11/29 14:16:20 siesel Exp $
from gnue.common import GDataSource,GConditions
import geasInstance
***************
*** 46,52 ****
#
---------------------------------------------------------------------------
def setPrefetch (self, prefetch):
! self._prefetch = prefetch
# conditions = an list consisting of condition elements written down in
--- 46,57 ----
#
---------------------------------------------------------------------------
def setPrefetch (self, prefetch):
! if type(prefetch)==type(""):
! self._prefetch = string.split(prefetch,",")
! elif type(prefetch)==type([]):
! self._prefetch = prefetch
! else:
! raise Error,"Wrong format of prefetch information."
# conditions = an list consisting of condition elements written down in
Index: gnue/appserver/src/geasRpcClient2.py
diff -c gnue/appserver/src/geasRpcClient2.py:1.1
gnue/appserver/src/geasRpcClient2.py:1.2
*** gnue/appserver/src/geasRpcClient2.py:1.1 Mon Nov 25 18:24:20 2002
--- gnue/appserver/src/geasRpcClient2.py Fri Nov 29 09:16:20 2002
***************
*** 19,25 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasRpcClient2.py,v 1.1 2002/11/25 23:24:20 siesel Exp $
--- 19,25 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: geasRpcClient2.py,v 1.2 2002/11/29 14:16:20 siesel Exp $
***************
*** 39,45 ****
def requestSessionManager(self):
! sessionManager = self._server.request("SessionManager")
return sessionManager
--- 39,45 ----
def requestSessionManager(self):
! sessionManager = self._server.request("Session")
return sessionManager
***************
*** 71,78 ****
print "Setup an link to the session manager"
sessionManager = rpcClient.requestSessionManager()
! print "Get the status of the session manager"
! print "Status: ",sessionManager.Status()
return sessionManager
--- 71,78 ----
print "Setup an link to the session manager"
sessionManager = rpcClient.requestSessionManager()
! # print "Get the status of the session manager"
! # print "Status: ",sessionManager.Status()
return sessionManager
Index: gnue/appserver/src/geasRpcServer.py
diff -c gnue/appserver/src/geasRpcServer.py:1.14
gnue/appserver/src/geasRpcServer.py:1.15
*** gnue/appserver/src/geasRpcServer.py:1.14 Mon Nov 25 18:24:20 2002
--- gnue/appserver/src/geasRpcServer.py Fri Nov 29 09:16:20 2002
***************
*** 19,31 ****
#
# Copyright 2001-2002 Free Software Foundation
#
! # $Id: geasRpcServer.py,v 1.14 2002/11/25 23:24:20 siesel Exp $
from geasList import *
from geasSession import *
import geasAuthentification
! class geasSessionManager:
def __init__(self):
self._sessNo=0
# use DB for authetification
--- 19,38 ----
#
# Copyright 2001-2002 Free Software Foundation
#
! # $Id: geasRpcServer.py,v 1.15 2002/11/29 14:16:20 siesel Exp $
!
! ####
! #
! # TODO: The old geasSessionManager should be removed
! # GEAS.grpc has to be updated too.
! #
! #
from geasList import *
from geasSession import *
import geasAuthentification
! class geasOldSessionManager:
def __init__(self):
self._sessNo=0
# use DB for authetification
***************
*** 56,130 ****
else:
return "Running (%s session created)" % self._sessNo
! #####
! # here the new API begins
! #
!
! def open(self,authentification):
! session_id=self.getNewSession()
! session_id.login(authentification['user'],authentification['password'])
! return session_id
!
! def close(self,session_id,commit):
! if commit:
! self.commit(session_id)
!
! session_id.logoff()
!
! def commit(self,session_id):
! session_id.commit()
!
! def rollback(self,session_id):
! session_id.rollback()
!
! def requestList(self,session_id,context,classname,conditions,
! sortorder,propertylist):
!
! a_list=session_id.createList(classname)
!
! a_list.setPrefetch (propertylist)
! a_list.setConditions (conditions)
! a_list.setSort (sortorder)
! a_list.populate ()
! return a_list;
!
! def count(self,session_id,list_id):
! return list_id.count();
!
! def fetch(self,session_id,list_id,start,count):
! rset=[]
! c=0
! row=list_id.firstInstance ()
! while (row!=None) and (c<start+count):
! if c>=start:
! rrow={}
! for field in list_id._prefetch:
! rrow[field]=row.get(field)
! rrow['_myID']=row
! rset.append(rrow)
!
! c+=1
! row=list_id.nextInstance ()
!
! return rset;
- def load(self,session_id,obj_id_list,propertylist):
- return rset;
-
- def store(self,session_id,obj_id_list,propertylist,data):
- return null;
-
- def call(self,session_id,obj_id_list,methodname,parameters):
- return null;
- #
- # thats the end of the new API
- #####
from gnue.common import GComm, GLoginHandler, GConfig
from gnue.common.FileUtils import openResource
from gnue.common.GServerApp import GServerApp
import time,os,sys
from gnue.appserver import VERSION
#
=============================================================================
# RPC application class
--- 63,79 ----
else:
return "Running (%s session created)" % self._sessNo
! # Old Session Manager
! #
! ####
from gnue.common import GComm, GLoginHandler, GConfig
from gnue.common.FileUtils import openResource
from gnue.common.GServerApp import GServerApp
import time,os,sys
from gnue.appserver import VERSION
+ import geasSessionManager
#
=============================================================================
# RPC application class
***************
*** 193,199 ****
servers=GComm.bind (GConfig.getInstalledBase('install_prefix')+\
'/shared/grpc/GEAS.grpc',
self._transports,
! {'SessionManager': self.requestSessionManager })
# Daemonize (if appropriate)
GServerApp.run(self)
--- 142,149 ----
servers=GComm.bind (GConfig.getInstalledBase('install_prefix')+\
'/shared/grpc/GEAS.grpc',
self._transports,
! {'OldSessionManager': self.requestOldSessionManager,
! 'SessionManager': self.requestSessionManager})
# Daemonize (if appropriate)
GServerApp.run(self)
***************
*** 210,218 ****
print "Appserver is shuting down....ok"
def requestSessionManager(self):
#print "SessionManager has started up."
! sm=geasSessionManager()
loginhandler=testLoginHandler ()
if self.OPTIONS["username"]:
loginhandler.setLoginData(self.OPTIONS["username"],
--- 160,181 ----
print "Appserver is shuting down....ok"
+ def requestOldSessionManager(self):
+ #print "SessionManager has started up."
+ sm=geasOldSessionManager()
+ loginhandler=testLoginHandler ()
+ if self.OPTIONS["username"]:
+ loginhandler.setLoginData(self.OPTIONS["username"],
+ self.OPTIONS["password"])
+
+ self.connections.setLoginHandler (loginhandler)
+ sm.setConnections(self.connections)
+ sm.setDatabase(self.OPTIONS["database"])
+ return sm
+
def requestSessionManager(self):
#print "SessionManager has started up."
! sm=geasSessionManager.geasSessionManager()
loginhandler=testLoginHandler ()
if self.OPTIONS["username"]:
loginhandler.setLoginData(self.OPTIONS["username"],
***************
*** 222,227 ****
--- 185,191 ----
sm.setConnections(self.connections)
sm.setDatabase(self.OPTIONS["database"])
return sm
+
#
=============================================================================
# Login Handler
Index: gnue/appserver/src/test2.py
diff -c gnue/appserver/src/test2.py:1.1 gnue/appserver/src/test2.py:1.2
*** gnue/appserver/src/test2.py:1.1 Mon Nov 25 18:24:20 2002
--- gnue/appserver/src/test2.py Fri Nov 29 09:16:20 2002
***************
*** 19,30 ****
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: test2.py,v 1.1 2002/11/25 23:24:20 siesel Exp $
import os
from gnue.common import GClientApp
from gnue.common import GLoginHandler
! import geasRpcServer
#
=============================================================================
# Test application
--- 19,30 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
! # $Id: test2.py,v 1.2 2002/11/29 14:16:20 siesel Exp $
import os
from gnue.common import GClientApp
from gnue.common import GLoginHandler
! import geasSessionManager
#
=============================================================================
# Test application
***************
*** 41,47 ****
self.connections.setLoginHandler (testLoginHandler ())
print "Creating session object ..."
! sm=geasRpcServer.geasSessionManager ()
sm.setConnections(self.connections)
sm.setDatabase('gnue')
return sm
--- 41,47 ----
self.connections.setLoginHandler (testLoginHandler ())
print "Creating session object ..."
! sm=geasSessionManager.geasSessionManager ()
sm.setConnections(self.connections)
sm.setDatabase('gnue')
return sm
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/appserver grpc/GEAS.grpc src/geasList.py s...,
Jan Ischebeck <=