commit-gnue
[Top][All Lists]
Advanced

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

r5856 - in trunk/gnue-appserver: doc/api src


From: johannes
Subject: r5856 - in trunk/gnue-appserver: doc/api src
Date: Wed, 2 Jun 2004 09:26:58 -0500 (CDT)

Author: johannes
Date: 2004-06-02 09:26:57 -0500 (Wed, 02 Jun 2004)
New Revision: 5856

Modified:
   trunk/gnue-appserver/doc/api/api.texi
   trunk/gnue-appserver/src/geasInstance.py
   trunk/gnue-appserver/src/geasSessionManager.py
Log:
OnChange-trigger gets the propertyname via namespace; updated documentation


Modified: trunk/gnue-appserver/doc/api/api.texi
===================================================================
--- trunk/gnue-appserver/doc/api/api.texi       2004-06-02 13:13:11 UTC (rev 
5855)
+++ trunk/gnue-appserver/doc/api/api.texi       2004-06-02 14:26:57 UTC (rev 
5856)
@@ -167,7 +167,8 @@
 These functions provide a means for getting data for a list of objects
 fulfilling certain conditions.
 
address@hidden list_id request (session_id @var{session}, string 
@var{classname}, string @var{conditions}, stringlist @var{sortorder}, 
stringlist @var{properties})
address@hidden list_id request (session_id @var{session}, string 
@var{classname},
+stringlist @var{conditions}, stringlist @var{sortorder}, stringlist 
@var{properties})
 Requests a list of objects of class @var{classname} matching the
 @var{conditions}.  Appserver prepares to send the values of the properties
 listed in @var{properties} on subsequent calls to @code{fetch}, where
@@ -355,6 +356,10 @@
 of digits.
 @end defcv
 
address@hidden Property gnue_property gnue_nullable boolean
+If TRUE this property can contain NULL values.
address@hidden defcv
+
 @defcv Property gnue_property gnue_comment string(70)
 Arbitary text explaining the purpose of the property.
 @end defcv
@@ -364,15 +369,15 @@
 @section @code{gnue_procedure}
 
 @defcv Property gnue_procedure gnue_class gnue_class
-The class the property belongs to.
+The class the procedure belongs to.
 @end defcv
 
 @defcv Property gnue_procedure gnue_module gnue_module
-The module that defines the property.
+The module that defines the procedure.
 @end defcv
 
 @defcv Property gnue_procedure gnue_name string(35)
-The name of the property without the module name. You can find out the module
+The name of the procedure without the module name. You can find out the module
 name by referencing the @code{gnue_module} property.
 @end defcv
 
@@ -384,10 +389,77 @@
 The source code of the procedure.
 @end defcv
 
address@hidden Property gnue_procedure gnue_type string(35)
+The type of the procedures' result. This can be one of the predefined types
+"string", "number", "boolean", "date", "time", or "datetime". If the procedure
+has no result this property will be left empty.
address@hidden defcv
+
address@hidden Property gnue_procedure gnue_length number(6)
+The length of the procedures' result. Only relevant if @code{gnue_type} is
+"string" or "number".
address@hidden defcv
+
address@hidden Property gnue_procedure gnue_scale number(4)
+Only relevant if @code{gnue_type} is "number", in which case it defines the
+number of fractional digits, while @code{gnue_length} defines the total number
+of digits.
address@hidden defcv
+
address@hidden Property gnue_procedure gnue_nullable boolean
+If TRUE this procedure can return "NULL" or "None" values.
address@hidden defcv
+
 @defcv Property gnue_procedure gnue_comment string(70)
 Arbitary text explaining the purpose of the procedure.
 @end defcv
 
address@hidden Special procedures
+
+Procedures having a @code{gnue_name} starting with "@code{get}" and without any
+parameters but a result are automatically treaten as "calculated properties".
+A procedure called "@code{getfoobar}" in a module named "@code{address}" could
+be accessed as a property called "@code{address_foobar}". Appserver will
+implicitly call the procedure "address_getfoobar".
+
+Besides this the application server looks for other special procedure names to
+be called automatically as "triggers". The following procedure names
+(@code{gnue_name}) are recognized:
+
address@hidden OnInit
+
+When the application server comes to create a new instance of a given class,
+all procedures of this class having a @code{gnue_name} of "@code{OnInit}"
+(case-insensitive) are called. Such a procedure can refer to the instance via
address@hidden
+
address@hidden OnChange
+
+Before the application server changes the value of a property, all procedures 
of
+the class having a @code{gnue_name} of "@code{OnChange}" (case-insensitive) are
+called. The variable @var{propertyName} holds the name of the property to be
+changed. The variable @var{newValue} holds the new value which should be set
+and @var{oldValue} holds the original value of the property. One can use the
+function @code{abort} to prevent a modification of the property.
+
address@hidden OnValidate
+
+Before the application server performs a @code{commit} it calls all procedures
+of the class having a @code{gnue_name} of "@code{OnValidate}"
+(case-insensitive). Such a procedure can refer to the calling instance via
address@hidden One can use the function @code{abort} to abort the validation
+process and to stop the commit.
+
+
address@hidden OnDelete
+
+Before the application server deletes an instance of a class all procedures of
+the class having a @code{gnue_name} of "@code{OnDelete}" (case-insensitive)
+will be executed. Such a procedure can refer to the calling instance via
address@hidden One can use the function @code{abort} to abort the deletion.
+
+
+
 @c ----------------------------------------------------------------------------
 
 @section @code{gnue_parameter}

Modified: trunk/gnue-appserver/src/geasInstance.py
===================================================================
--- trunk/gnue-appserver/src/geasInstance.py    2004-06-02 13:13:11 UTC (rev 
5855)
+++ trunk/gnue-appserver/src/geasInstance.py    2004-06-02 14:26:57 UTC (rev 
5856)
@@ -245,9 +245,9 @@
 
     for proc in self.__classdef.procedures.values ():
       if proc.gnue_name.upper () == 'ONCHANGE':
-        self.call (proc, {'propertyName': propertydef.fullName},
-                         {'oldValue': self.__getValue (propertyname),
-                          'newValue': __value})
+        self.call (proc, {}, {'oldValue': self.__getValue (propertyname),
+                              'newValue': __value,
+                              'propertyName': propertydef.fullName})
 
 
     self.__record.putField (propertydef.column, __value)

Modified: trunk/gnue-appserver/src/geasSessionManager.py
===================================================================
--- trunk/gnue-appserver/src/geasSessionManager.py      2004-06-02 13:13:11 UTC 
(rev 5855)
+++ trunk/gnue-appserver/src/geasSessionManager.py      2004-06-02 14:26:57 UTC 
(rev 5856)
@@ -159,7 +159,7 @@
   # Fetch objects from list
   # ---------------------------------------------------------------------------
 
-  def fetch (self, session_id, list_id, start, count, close=0):
+  def fetch (self, session_id, list_id, start, count, close = False):
 
     s = self._getSession (session_id)
     return s.fetch (list_id, start, count)





reply via email to

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