commit-gnue
[Top][All Lists]
Advanced

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

r5002 - in branches/gnue-appserver-featuretest: . notused


From: jan
Subject: r5002 - in branches/gnue-appserver-featuretest: . notused
Date: Thu, 18 Dec 2003 09:35:40 -0600 (CST)

Author: jan
Date: 2003-12-18 09:35:39 -0600 (Thu, 18 Dec 2003)
New Revision: 5002

Added:
   branches/gnue-appserver-featuretest/geasUser.py
   branches/gnue-appserver-featuretest/notused/
   branches/gnue-appserver-featuretest/notused/geasObjectMapping.py
Modified:
   branches/gnue-appserver-featuretest/geasMetaObject.py
Log:
Minor updates and additions

Modified: branches/gnue-appserver-featuretest/geasMetaObject.py
===================================================================
--- branches/gnue-appserver-featuretest/geasMetaObject.py       2003-12-18 
15:28:53 UTC (rev 5001)
+++ branches/gnue-appserver-featuretest/geasMetaObject.py       2003-12-18 
15:35:39 UTC (rev 5002)
@@ -317,6 +317,8 @@
     
     # create an class object in python and add the
     # class methods and attributs
+
+    # TODO: use the new library instead
         
     self._pythonclass=copy.copy(geasObject.geasObject)
     self._pythonclass.__dict__.update(self._classAttribs)

Added: branches/gnue-appserver-featuretest/geasUser.py
===================================================================
--- branches/gnue-appserver-featuretest/geasUser.py     2003-12-18 15:28:53 UTC 
(rev 5001)
+++ branches/gnue-appserver-featuretest/geasUser.py     2003-12-18 15:35:39 UTC 
(rev 5002)
@@ -0,0 +1,60 @@
+# GNU Enterprise Application Server - Basic Object
+#
+# Copyright 2001 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: geasObject.py,v 1.2 2002/05/14 17:21:33 siesel Exp $
+
+import geasObject
+
+
+# =============================================================================
+# User class
+#
+# stores the information about one user
+#
+# =============================================================================
+
+class geasUser(geasObject.geasObject):
+
+  # ---------------------------------------------------------------------------
+  # Initalize
+  #
+  # every new object has to be assigned an oid.
+  # OID = object is an unique object identifier
+  # the parent_OID is the OI
+  # ---------------------------------------------------------------------------
+
+  def __init__ (self, OID, parent_OID):
+    geasObject.geasObject.__init__ (self, OID, parent_OID
+
+
+
+  def getUsername(self):
+    return self.user
+
+  def setUsername(sel,name):
+    self.user=name
+
+  def checkPassword(self,password):
+    return (self.password==password)
+
+  def updatePassword(self,oldpassword,newpassword):
+    if self.password==oldpassword:
+      self.password=newpassword 

Added: branches/gnue-appserver-featuretest/notused/geasObjectMapping.py
===================================================================
--- branches/gnue-appserver-featuretest/notused/geasObjectMapping.py    
2003-12-18 15:28:53 UTC (rev 5001)
+++ branches/gnue-appserver-featuretest/notused/geasObjectMapping.py    
2003-12-18 15:35:39 UTC (rev 5002)
@@ -0,0 +1,98 @@
+# GNU Enterprise Application Server - Object Mapping Base Class
+#
+# Copyright 2001 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: GEDI.py,v 1.1 2002/05/13 22:34:11 siesel Exp $
+
+# =============================================================================
+# Basic class
+# =============================================================================
+
+import geasObject
+  
+class databaseObjectMapping:
+
+  # ---------------------------------------------------------------------------
+  # Initalize
+  # ---------------------------------------------------------------------------
+
+  def __init__ (self, connections):
+    self._connections = connections
+
+  # ---------------------------------------------------------------------------
+  # getObjectbyOID
+  #  from which this is a child object.
+  #  (just the geasSuperObject has no OID
+  # ---------------------------------------------------------------------------
+
+  def returnOIDRange(self):
+    pass
+  
+  def setOIDRange(self):
+    pass
+  
+  def storeObject( self,Object ):
+    pass
+
+  def getObject( self,OID ):     
+    return OID
+
+  def getObjectData (self,GOID, tablename, fieldList ):
+    self._conditions = []
+    self._sort = ["zip"]
+    
+    self._datasource = GDataSource.GDataSource ()
+    # TODO: get the table name from the class name
+    self._datasource.buildObject (name = "",
+                                 database = "gnue",
+                                 table = tablename)
+    self._datasource.setConnectionManager (self._connections)
+    self._datasource.phaseInit ()
+    # TODO: get the column names from the prefetch field names
+    for field in fieldList:
+      self._datasource.referenceField (field)
+    self._resultset = self._datasource.createResultSet ()
+    
+    moreRecords=self._resultset.firstRecord ()
+    if moreRecords==0:
+      raise geasObjectNotFound,"Object (OID=%s) is not defined in table %s." % 
\
+            (OID,tablename)
+    data=[]
+    while (moreRecords==1):
+      newdr={}
+      record=self._resultset.current
+      if record.getField("goid")==GOID:
+        for field in fieldList:
+          newdr[field] = record.getField(field)
+                  
+      moreRecords=self._resultset.nextRecord ()
+      if len(newdr)>0:
+        data.append(newdr)
+      
+    return data
+
+  def getObjectbyOID (self,OID):
+    # TODO: look up the field type (calculated, reference etc.), translate
+    # the field name into a column name
+    return self._parent_OID
+
+  def getRecordfromTable(self,transaction_id):
+    pass
+





reply via email to

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