commit-gnue
[Top][All Lists]
Advanced

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

r5864 - trunk/gnue-appserver/samples


From: johannes
Subject: r5864 - trunk/gnue-appserver/samples
Date: Mon, 7 Jun 2004 10:13:40 -0500 (CDT)

Author: johannes
Date: 2004-06-07 10:13:39 -0500 (Mon, 07 Jun 2004)
New Revision: 5864

Added:
   trunk/gnue-appserver/samples/sample.gcd
Log:
Added the sample.gcd :)


Added: trunk/gnue-appserver/samples/sample.gcd
===================================================================
--- trunk/gnue-appserver/samples/sample.gcd     2004-06-07 15:12:31 UTC (rev 
5863)
+++ trunk/gnue-appserver/samples/sample.gcd     2004-06-07 15:13:39 UTC (rev 
5864)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<module name="address" comment="Address Management">
+
+  <class name="country" comment="Country">
+    <property name="code" type="string( 2)" comment="ISO-Country code"/>
+    <property name="name" type="string(35)" comment="The name of the country"/>
+  </class>
+
+  <class name="person" comment="Person">
+    <property name="born" type="date" comment="Birthday" />
+    <property name="children" type="number(2)" comment="Number of children"/>
+    <property name="city" type="string(35)" 
+      comment="City where the person lives"/>
+    <property name="country" type="address_country" 
+      comment="Country where the person lives"/>
+    <property name="human" type="boolean" 
+      comment="Whether the person is human or not"/>
+    <property name="lastmeeting" type="datetime" 
+      comment="Date and time of the last meeting"/>
+    <property name="meettime" type="time" 
+      comment="Preferred time for meetings"/>
+    <property name="name" type="string(35)" comment="Name of the person"/>
+    <property name="street" type="string(35)" 
+      comment="Street where the person lives"/>
+    <property name="weight" type="number(4,1)" 
+      comment="Weight of the person in kg"/>
+    <property name="zip" type="string(35)" 
+      comment="Zip code of the city where the person lives"/>
+
+    <!-- the following is a calculated property -->
+    <property name="nextmeeting" type="datetime" 
+      comment="Calculate the next meeting date">
+      <![CDATA[
+      import mx.DateTime
+      last = self.address_lastmeeting
+      tm   = self.address_meettime
+      if last is not None and tm is not None:
+        next = last + mx.DateTime.RelativeDateTime (days=+21,
+                                                    hour = tm.hour,
+                                                    minute = tm.minute,
+                                                    second = tm.second)
+        return next
+      else:
+        return None]]>
+    </property>
+
+    <procedure name="show" comment="Simple procedure to test Appserver">
+      print self.address_name
+    </procedure>
+
+    <procedure name="test" comment="Simple procedure to test Appserver">
+      <![CDATA[
+      if self.address_name [0] == "(":
+        self.address_name = self.address_name [1:len(self.address_name)-1]
+      else:
+        self.address_name = "(" + self.address_name + ")"
+        ]]>
+    </procedure>
+  </class>
+
+</module>





reply via email to

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