[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue gnue-common/doc/GCommSpecifications.txt gn...
From: |
Jason Cater |
Subject: |
gnue gnue-common/doc/GCommSpecifications.txt gn... |
Date: |
Tue, 16 Oct 2001 18:07:13 -0400 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/10/16 18:07:13
Modified files:
gnue-common/doc: GCommSpecifications.txt
TriggerSpecifications.txt
gnue-common/src/FormatMasks: BaseMask.py DateMask.py __init__.py
reports/samples/mailmerge: extract-fields.pl
Log message:
synching machines
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/doc/GCommSpecifications.txt.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/doc/TriggerSpecifications.txt.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/FormatMasks/BaseMask.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/FormatMasks/DateMask.py.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/FormatMasks/__init__.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/samples/mailmerge/extract-fields.pl.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gnue/gnue-common/doc/GCommSpecifications.txt
diff -u gnue/gnue-common/doc/GCommSpecifications.txt:1.2
gnue/gnue-common/doc/GCommSpecifications.txt:1.3
--- gnue/gnue-common/doc/GCommSpecifications.txt:1.2 Thu Sep 27 00:32:52 2001
+++ gnue/gnue-common/doc/GCommSpecifications.txt Tue Oct 16 18:07:13 2001
@@ -1,5 +1,7 @@
Objective
=========
+Provide an abstract model for providing services to the world and
+for requesting services from a compatable provider.
Motivation
@@ -12,6 +14,7 @@
* GNUe Reports (server/client)
* GEAS (server/client) (?)
* GNUe Integrator (server/client)
+ * GNUe Transaction Server (server/client)???
* GNUe Security Server (server/client)???
Each of these tools will need to communicate with the world via several
@@ -31,10 +34,21 @@
GComm tools will support the new encryption model.
+ Provider/Server
+ .-------------. .-------------.
+ | | --> XML-RPC <-- | |
+MyFunction1() --> | GComm | --> SOAP <-- | GComm |
+ | | --> Sockets <-- | | <-- Client
+MyFunction2() --> | Abstraction | --> CORBA <-- | Abstraction | Requests
+ | | --> Other <-- | |
+ `-------------' `-------------'
+
Pitfalls
========
-
+This design only exposes services. It does not try to emulate Object
+management for transports that do not support Object management natively.
+Such a design is far too complicated of a task for GNUe to embark upon.
Design Considerations
Index: gnue/gnue-common/doc/TriggerSpecifications.txt
diff -u gnue/gnue-common/doc/TriggerSpecifications.txt:1.4
gnue/gnue-common/doc/TriggerSpecifications.txt:1.5
--- gnue/gnue-common/doc/TriggerSpecifications.txt:1.4 Mon Sep 10 16:33:08 2001
+++ gnue/gnue-common/doc/TriggerSpecifications.txt Tue Oct 16 18:07:13 2001
@@ -18,18 +18,23 @@
pre-existing triggers as our specification grows.
+ Only languages with support for object-oriented concepts can
be embedded.
+
+ Notes:
+ + If the developer uses some standard for naming objects (as
+ designer does by default with standard prefixes [pg, dts,
+ blk, inp] ), then namespace collisions are not a concern.
+ However, not everyone uses standards
- * Add <block>.fields.<field> to namespace
+ * Add blocks.<block>.fields.<field> to namespace
Advantages:
+ Easy to implement
+ Less namespace conflict than above method
Disadvantages:
- + Since there will still be namespace conflicts, all of the
- previous disadvantages still apply.
+ Code will be harder to read because of long object references.
+
* Function-based lookups: find("block.field")
@@ -46,6 +51,7 @@
languages (scheme, etc) if an object-specific implementation is
selected
+
* Pre-parsing tokens (:block.field)
Advantages:
@@ -97,7 +103,7 @@
Scratchpad
----------
-* All event triggers should return a value.
+* All event triggers should return a success/fail value.
* Modify state of widgets:
widget.properties.
@@ -119,6 +125,7 @@
for i :=0 to datasource.field.count do
mytotal = datasource.field[i]
+
if len(:currentBlock.zipcode):
datasource1.clear()
:datasource1.zipcode = :currentBlock.zipcode
@@ -126,7 +133,7 @@
currentBlock.FieldByName('city').
:currentBlock.city = :datasource1.city
:currentBlock.state = :datasource1.state
- for obj in currentblock
+ for obj in currentblock
obj.ReadOnly = true
X = 10
end
Index: gnue/gnue-common/src/FormatMasks/BaseMask.py
diff -u gnue/gnue-common/src/FormatMasks/BaseMask.py:1.4
gnue/gnue-common/src/FormatMasks/BaseMask.py:1.5
--- gnue/gnue-common/src/FormatMasks/BaseMask.py:1.4 Thu Oct 11 00:36:08 2001
+++ gnue/gnue-common/src/FormatMasks/BaseMask.py Tue Oct 16 18:07:13 2001
@@ -122,3 +122,116 @@
return 0
+
+
+class MaskInputInstance:
+ def __init__(self, handler):
+ self.handler = self
+ self.index = 0
+ self.cursor = 0
+ self.display = ""
+ self.input = ""
+ self.inputMaskPos = []
+ self.inputMaskLen = []
+ for i in range(len(self.handler.inputHandlers)):
+ self.inputMaskPos.append(0)
+ self.inputMaskLen.append(0)
+
+ def setText(self, text):
+ self.input = text
+ self.display = text
+ self.cursor = 0
+ self.index = 0
+
+ def isValid(self):
+ return 1
+
+ def addText(self, text, pos, replaces):
+ pass
+
+ def deleteText(self, text, pos, characters):
+ pass
+
+ def cursorToIndex(self, val):
+ return val
+
+
+ def indexToCursor(self, val):
+ return val
+
+
+ def moveCursor(self, relative):
+
+ # Direction will be either 1 or -1.
+ direction = relative = 0 or int(relative/abs(relative))
+
+ self.cursor = self.cursor + relative
+
+ if self.cursor <= 0:
+ self.cursor = 0
+ self.direction = 1
+ elif self.cursor >= len(self.display)
+ self.cursor = len(self.display)
+ self.direction = -1
+
+ section = 0
+ while section < len(self.inputMaskPos) and \
+ self.inputMaskPos[section] < pos:
+ section += 1
+
+ if section = len(self.handler.inputMaskPos):
+ self.cursor = len(self.display)
+
+ elif isinstance(self.handler.inputMaskPos[section], Literal)
+ self.moveCursor(self, direction)
+
+ self.index = self.indexToCursor(self.cursor)
+
+ return self.cursor
+
+
+ def processEdit (self, value, str, pos=0, replaces=0):
+ GDebug.printMesg(15,'processEdit(%s,%s,%s,%s)' % (value,str,pos,replaces))
+ nv = value
+ if pos == len(nv):
+ nv += str
+ else:
+ nv = "%s%s%s" % (nv[:pos],str,nv[pos+replaces:])
+
+ GDebug.printMesg(15,"inputMaskPos=%s" % self.inputMaskPos)
+
+ section = 0
+ while section < len(self.handler.inputMaskPos) and \
+ self.handler.inputMaskPos[section] < pos:
+ section += 1
+ i = pos
+ while i < len(nv):
+ if not self.handler.inputHandlers[section]\
+ .isValidEntry(nv[self.handler.inputMaskPos[section]:i+1]):
+ if i == self.handler.inputMaskPos[section] and \
+ not isinstance(self.handler.inputHandlers[section],Literal):
+ self.handler.inputMaskLen[section] = i -
self.handler.inputMaskPos[section]
+ return nv
+ else:
+ self.handler.inputMaskLen[section] = i -
self.handler.inputMaskPos[section]
+ if section == len(self.handler.inputHandlers) - 1:
+ if i != len(nv)-1:
+ return nv
+ else:
+ section += 1
+ self.inputMaskPos[section] = i
+ self.inputMaskLen[section] = 0
+ else:
+ i += 1
+
+ self.handler.inputMaskLen[section] = i - self.handler.inputMaskPos[section]
+
+ for i in range(section+1, len(self.handler.inputHandlers)):
+ self.handler.inputMaskLen[i] = 0
+
+ GDebug.printMesg(15,"<< %s" % nv)
+ return nv
+
+
+
+
Index: gnue/gnue-common/src/FormatMasks/DateMask.py
diff -u gnue/gnue-common/src/FormatMasks/DateMask.py:1.8
gnue/gnue-common/src/FormatMasks/DateMask.py:1.9
--- gnue/gnue-common/src/FormatMasks/DateMask.py:1.8 Fri Oct 12 20:06:18 2001
+++ gnue/gnue-common/src/FormatMasks/DateMask.py Tue Oct 16 18:07:13 2001
@@ -112,56 +112,13 @@
self.value = GDateTime()
self.entry = ""
- self.inputMaskPos = []
- self.inputMaskLen = []
- for i in range(len(self.inputHandlers)):
- self.inputMaskPos.append(0)
- self.inputMaskLen.append(0)
-
-
- def processEdit (self, value, str, pos=0, replaces=0):
- GDebug.printMesg(15,'processEdit(%s,%s,%s,%s)' % (value,str,pos,replaces))
- nv = value
- if pos == len(nv):
- nv += str
- else:
- nv = "%s%s%s" % (nv[:pos],str,nv[pos+replaces:])
-
- GDebug.printMesg(15,"inputMaskPos=%s" % self.inputMaskPos)
- section = 0
- while section < len(self.inputMaskPos) and \
- self.inputMaskPos[section] < pos:
- section += 1
- i = pos
- while i < len(nv):
- if not self.inputHandlers[section]\
- .isValidEntry(nv[self.inputMaskPos[section]:i+1]):
- if i == self.inputMaskPos[section] and \
- not isinstance(self.inputHandlers[section],Literal):
- self.inputMaskLen[section] = i - self.inputMaskPos[section]
- return nv
- else:
- self.inputMaskLen[section] = i - self.inputMaskPos[section]
- if section == len(self.inputHandlers) - 1:
- if i != len(nv)-1:
- return nv
- else:
- section += 1
- self.inputMaskPos[section] = i
- self.inputMaskLen[section] = 0
- else:
- i += 1
- self.inputMaskLen[section] = i - self.inputMaskPos[section]
+ def createInputHandler(self, value):
+ instance = MaskInputInstance(self)
+ instance.setValue(value)
+ return instance
- for i in range(section+1, len(self.inputHandlers)):
- self.inputMaskLen[i] = 0
-
- GDebug.printMesg(15,"<< %s" % nv)
- return nv
-
-
def getFormattedOutput(self, value, secondary=0):
rv = ""
val = self._buildDate(value, 1)
@@ -185,12 +142,14 @@
val = self._buildDate(value, 0)
print val
-
-# self.lastInputPos =
- print self.inputMaskLen
+ self.lastInputPos = 0
for i in range(len(self.inputHandlers)):
+ if self.inputMaskLen[i]:
+ self.lastInputPos = i + self.inputMaskLen[i] - 1
+ if (i < len(self.inputMaskLen) - 1) and not self.inputMaskLen[i+1]):
+ rv += val[self.inputMaskLen
if self.inputMaskLen[i] or isinstance(self.inputHandlers[i],Literal):
rv += self.inputHandlers[i].getFormattedValue(val)
elif len(padding):
Index: gnue/gnue-common/src/FormatMasks/__init__.py
diff -u gnue/gnue-common/src/FormatMasks/__init__.py:1.2
gnue/gnue-common/src/FormatMasks/__init__.py:1.3
--- gnue/gnue-common/src/FormatMasks/__init__.py:1.2 Wed Oct 10 19:24:50 2001
+++ gnue/gnue-common/src/FormatMasks/__init__.py Tue Oct 16 18:07:13 2001
@@ -29,7 +29,6 @@
# HISTORY:
#
-
from DateMask import DateMask
from TextMask import TextMask
from NumberMask import NumberMask
Index: gnue/reports/samples/mailmerge/extract-fields.pl
diff -u gnue/reports/samples/mailmerge/extract-fields.pl:1.1
gnue/reports/samples/mailmerge/extract-fields.pl:1.2
--- gnue/reports/samples/mailmerge/extract-fields.pl:1.1 Tue Oct 2
23:52:41 2001
+++ gnue/reports/samples/mailmerge/extract-fields.pl Tue Oct 16 18:07:13 2001
@@ -9,16 +9,17 @@
}
}
-print "<report>\n";
-print " <layout>\n";
-print " <section name=\"main\" source=\"dtsMain\">\n";
-print "<record>\n";
+#print "<report>\n";
+#print " <layout>\n";
+#print " <section name=\"main\" source=\"dtsMain\">\n";
+#print "<record>\n";
foreach $key (sort keys %fields) {
- print " <field name=\"$key\" value=\"<field name=\"$key\"/>/>\n";
+ print "$key\n";
+ #print " <field name=\"$key\" value=\"<field name=\"$key\"/>/>\n";
}
-print "<record/>\n";
-print " </section>\n";
-print " </layout\n";
-print "</report>\n";
+#print "<record/>\n";
+#print " </section>\n";
+#print " </layout\n";
+#print "</report>\n";
- gnue gnue-common/doc/GCommSpecifications.txt gn...,
Jason Cater <=