[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r6558 - trunk/gnue-reports/src/client
From: |
johannes |
Subject: |
r6558 - trunk/gnue-reports/src/client |
Date: |
Mon, 25 Oct 2004 04:23:49 -0500 (CDT) |
Author: johannes
Date: 2004-10-25 04:23:45 -0500 (Mon, 25 Oct 2004)
New Revision: 6558
Modified:
trunk/gnue-reports/src/client/GRRunUI.py
Log:
Added destinationtype and destination to form
Modified: trunk/gnue-reports/src/client/GRRunUI.py
===================================================================
--- trunk/gnue-reports/src/client/GRRunUI.py 2004-10-24 13:18:12 UTC (rev
6557)
+++ trunk/gnue-reports/src/client/GRRunUI.py 2004-10-25 09:23:45 UTC (rev
6558)
@@ -34,6 +34,10 @@
class GRRunUI:
+ _DTYPES = [('file' , u_("File")),
+ ('printer', u_("Printer")),
+ ('email' , u_("E-Mail"))]
+
# --------------------------------------------------------------------------
# Constructor
# --------------------------------------------------------------------------
@@ -87,7 +91,7 @@
# First add some internal parameters to the userparams-dictionary
self.userParameters ['filter'] = self.filter
self.userParameters ['destination'] = self.destination
- self.userParameters ['destinationType'] = self.destinationType
+ self.userParameters ['destinationtype'] = self.destinationType
self.userParameters ['canceled'] = False
# Create the form's code on the fly and put it into an instance
@@ -105,11 +109,11 @@
self.filter = self.userParameters ['filter']
self.destination = self.userParameters ['destination']
- self.destinationType = self.userParameters ['destinationType']
+ self.destinationType = self.userParameters ['destinationtype']
del self.userParameters ['filter']
del self.userParameters ['destination']
- del self.userParameters ['destinationType']
+ del self.userParameters ['destinationtype']
del self.userParameters ['canceled']
@@ -191,7 +195,10 @@
@return: filehandle to read the form from
"""
- code = ['<?xml version="1.0" encoding="utf-8"?>', '<form>']
+ code = ['<?xml version="1.0" encoding="utf-8"?>']
+ code.extend (self._getXMLTag ('form', \
+ {'title': self.reportInfo.getTitle ()}, "", True))
+
fields = self.__translateParameters ()
@@ -312,7 +319,29 @@
{'fk_key': 'key'},
{'fk_description': 'descr'}]})
+ fields.append ({'name' : 'destinationtype',
+ 'label' : u_("Destination type"),
+ 'style' : 'dropdown',
+ 'format' : None,
+ 'typecast': None,
+ 'dLength' : 35,
+ 'pType' : 'char',
+ 'skip' : False,
+ 'fieldDef': [{'fk_source': 'dtsDestinations'},
+ {'fk_key': 'key'},
+ {'fk_description': 'descr'}]})
+ fields.append ({'name' : 'destination',
+ 'label' : u_("Destination"),
+ 'style' : None,
+ 'format' : None,
+ 'typecast': None,
+ 'dLength' : 35,
+ 'pType' : 'char',
+ 'skip' : False,
+ 'fieldDef': []})
+
+
# ---------------------------------------------------------------------------
# Create the XML code for all datasources needed by the form
# ---------------------------------------------------------------------------
@@ -331,20 +360,41 @@
rows = []
for (key, descr) in filters:
- rows.extend (self._getXMLTag ('staticsetrow',
- {'contents': \
- self._getXMLTag ('staticsetfield', \
- {'name': 'key', 'value': key}, "") + \
- self._getXMLTag ('staticsetfield', \
- {'name': 'descr', 'value': descr}, "")}, ""))
+ rows.extend (self.__getStaticSetRow (key, descr))
- return self._getXMLTag ('datasource', {'name': 'dtsFilters',
+ result = self._getXMLTag ('datasource', {'name': 'dtsFilters',
'type': 'static', 'prequery': 'Y',
'contents': self._getXMLTag ('staticset', {'fields': 'key,descr',
'contents': rows}, "")}, " ")
+ rows = []
+ for (key, descr) in self._DTYPES:
+ rows.extend (self.__getStaticSetRow (key, descr))
+ result.extend (self._getXMLTag ('datasource', {'name': 'dtsDestinations',
+ 'type': 'static', 'prequery': 'Y',
+ 'contents': self._getXMLTag ('staticset', {'fields': 'key,descr',
+ 'contents': rows})}, " "))
+
+
+ return result
+
+
# ---------------------------------------------------------------------------
+ # Create a row in a static set for the given key and value
+ # ---------------------------------------------------------------------------
+
+ def __getStaticSetRow (self, key, val):
+ """
+ """
+
+ k = self._getXMLTag ('staticsetfield', {'name': 'key', 'value': key}, "")
+ d = self._getXMLTag ('staticsetfield', {'name': 'descr', 'value': val}, "")
+
+ return self._getXMLTag ('staticsetrow', {'contents': k + d})
+
+
+ # ---------------------------------------------------------------------------
# Add the XML code for all blocks needed
# ---------------------------------------------------------------------------
@@ -393,6 +443,8 @@
onActivate.append ("blkInput.%s.set (getParameter ('%s'))" \
% (item ['name'], item ['name']))
+ onActivate.append ('print "%s:", getParameter ("%s")' \
+ % (item ['name'], item ['name']))
onExit.append ("setParameter ('%s', blkInput.%s.get ())" \
% (item ['name'], item ['name']))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r6558 - trunk/gnue-reports/src/client,
johannes <=