[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r5258 - in trunk/gnue-appserver: doc src
From: |
reinhard |
Subject: |
r5258 - in trunk/gnue-appserver: doc src |
Date: |
Mon, 8 Mar 2004 04:18:51 -0600 (CST) |
Author: reinhard
Date: 2004-03-08 04:18:50 -0600 (Mon, 08 Mar 2004)
New Revision: 5258
Removed:
trunk/gnue-appserver/doc/diagrams/
trunk/gnue-appserver/doc/geasarch/
trunk/gnue-appserver/src/geasBClass.py
trunk/gnue-appserver/src/geasTrigger.py
Log:
Moved some old stuff to the gnue-appserver-featuretest branch.
Deleted: trunk/gnue-appserver/src/geasBClass.py
===================================================================
--- trunk/gnue-appserver/src/geasBClass.py 2004-03-08 10:06:17 UTC (rev
5257)
+++ trunk/gnue-appserver/src/geasBClass.py 2004-03-08 10:18:50 UTC (rev
5258)
@@ -1,136 +0,0 @@
-# GNU Enterprise Application Server - List Object
-#
-# Copyright 2001-2004 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-from gnue.common.datasources import GDataSource,GConditions
-import geasInstance
-import string
-
-# =============================================================================
-# List class
-# =============================================================================
-
-class geasBClass:
-
- # ---------------------------------------------------------------------------
- # Initalize
- # ---------------------------------------------------------------------------
-
- def __init__ (self, session, classname):
- self._session = session
- self._classname = classname
-
-
- def _populate (self):
-
- if hasattr(self,"_sort"):
- sorting = string.joinfields(self._sort,",")
- else:
- sorting = None
-
- self._datasource = GDataSource.DataSourceWrapper(
- connections=self._session._connections,
- fields=self._prefetch,
- init=1,
- attributes = {
- "name": "tmp",
- "connection": self._session._database,
- "table": self._classname,
- "order_by": sorting } )
-
- if hasattr(self,"_conditionTree"):
- self._resultset = self._datasource.createResultSet(self._conditionTree)
- else:
- self._resultset = self._datasource.createResultSet()
-
-
-
- def _firstInstance (self):
- if self._classname!='appserver_pytrigger':
- trigger=self._session._triggerMg.getTriggerByEvent \
- ('%s:pre_first_inst' % self._classname)
- if trigger!=None:
- trigger()
-
- if self._resultset.firstRecord () != 0:
- return geasInstance.geasInstance (self, self._resultset.current)
- else:
- return None
-
- # ---------------------------------------------------------------------------
- # Get the next instance in the list
- # ---------------------------------------------------------------------------
-
- def _nextInstance (self):
- if self._resultset.nextRecord () != 0:
- return geasInstance.geasInstance (self, self._resultset.current)
- else:
- return None
-
- # ---------------------------------------------------------------------------
- # insert a new empty instance in the list and return it
- # ---------------------------------------------------------------------------
-
- def _insertNewInstance (self):
- self._resultset.insertRecord ()
- return geasInstance.geasInstance (self, self._resultset.current)
-
- def load(self,obj_id_list,propertylist):
- # method 1: build one resultset out of the whole stuff
- # method 2: load every record one by one
-
- # doing method 1:
-
- # 1. build condition:
- for i in obj_id_list:
-
- pass
-
- # 2. set prefetch
- propertylist.add('gnue_id')
- self._prefetch=propertylist
-
- # 3. load recordset
- self._populate()
-
-
-
- def store(self,obj_id_list,propertylist,data):
- for i in obj_id_list:
- ## check for oid here
- if 0:
- # store record here
- pass
- else:
- print "'%s' is no valid obj id" % i
-
- def call(self,obj_id_list,methodname,parameters):
- pass
-
- def delete(self,obj_id_list):
- for i in obj_id_list:
- ## check for oid here
- if 0:
- # store record here
- pass
- else:
- print "'%s' is no valid obj id" % i
Deleted: trunk/gnue-appserver/src/geasTrigger.py
===================================================================
--- trunk/gnue-appserver/src/geasTrigger.py 2004-03-08 10:06:17 UTC (rev
5257)
+++ trunk/gnue-appserver/src/geasTrigger.py 2004-03-08 10:18:50 UTC (rev
5258)
@@ -1,132 +0,0 @@
-# GNU Enterprise Application Server - Trigger Settings
-#
-# Copyright 2001-2004 Free Software Foundation
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
-import string,new
-
-# =============================================================================
-# Basic Trigger Class ( abstract )
-# =============================================================================
-
-class geasTriggerManager:
-
- # ---------------------------------------------------------------------------
- # Initalize
- # ---------------------------------------------------------------------------
-
- def __init__ (self):
- pass
-
- # ---------------------------------------------------------------------------
- # get named trigger X
- # the returned trigger is an executable object, which can be called directly
- # ---------------------------------------------------------------------------
-
- def getTriggerByName(self, triggername):
- return None
-
- # ---------------------------------------------------------------------------
- # get named trigger X
- # the returned trigger is an executable object, which can be called directly
- # ---------------------------------------------------------------------------
-
- def getTriggerByEvent(self, triggerevent):
- return None
-
-
-# =============================================================================
-# Database Authentification Agent
-# =============================================================================
-
-class geasPythonDBTriggerMg(geasTriggerManager):
-
- # ---------------------------------------------------------------------------
- # Initalize
- # ---------------------------------------------------------------------------
-
- def __init__ (self,session):
- # creation and populating the triggerlist list should be
- # moved here
- self._session=session
-
- # ---------------------------------------------------------------------------
- # get named trigger X
- # this trigger is an executable object, which can be called directly
- # ---------------------------------------------------------------------------
-
- def getTriggerByName(self, triggername):
- triggerList = self._session.createList ("appserver_pytrigger")
-
- triggerList.setPrefetch (["name", "event", "code"])
- triggerList.setConditions ([['eq', ''],
- ['field', 'name'],
- ['const', triggername ]])
- triggerList.populate ()
-
- instance = triggerList.firstInstance ()
-
- # no such trigger
- if instance==None:
- # log something
- print "Trigger '%s' does not exist." % triggername
-
- return None
-
- code=instance.get('code')
- # format code
-
- ccode=compile (code,'<string>','exec')
- myfunc=new.function(ccode, {'session':self._session}, triggername)
-
- return myfunc
-
- # ---------------------------------------------------------------------------
- # get named trigger X
- # this trigger is an executable object, which can be called directly
- # ---------------------------------------------------------------------------
-
- def getTriggerByEvent(self, eventname):
- triggerList = self._session.createList ("appserver_pytrigger")
-
- triggerList.setPrefetch (["name", "event", "code"])
- triggerList.setConditions ([['eq', ''],
- ['field', 'event'],
- ['const', eventname ]])
- triggerList.populate ()
-
- instance = triggerList.firstInstance ()
-
- # no such trigger
- if instance==None:
- # log something
-# print _("Trigger for event '%s' does not exist.") % eventname
-
- return None
-
- code=instance.get('code')
- # format code
-
- ccode=compile (code,'<string>','exec')
- myfunc=new.function(ccode, {'session':self._session}, instance.get('name'))
-
- return myfunc
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r5258 - in trunk/gnue-appserver: doc src,
reinhard <=