[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r6762 - in trunk/gnue-reports: samples/foobulations src/adapters/filters
From: |
jcater |
Subject: |
r6762 - in trunk/gnue-reports: samples/foobulations src/adapters/filters/Char/char src/base |
Date: |
Tue, 30 Nov 2004 17:28:03 -0600 (CST) |
Author: jcater
Date: 2004-11-30 17:28:02 -0600 (Tue, 30 Nov 2004)
New Revision: 6762
Modified:
trunk/gnue-reports/samples/foobulations/char.grd
trunk/gnue-reports/src/adapters/filters/Char/char/Adapter.py
trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
trunk/gnue-reports/src/base/GRParser.py
Log:
The Char filter doesn't have to use the SuppressGNUeTags option (though, if
specified, will still work.)
This makes the Char filter work with the GNUe:Reports:Base constructs.
Modified: trunk/gnue-reports/samples/foobulations/char.grd
===================================================================
--- trunk/gnue-reports/samples/foobulations/char.grd 2004-11-30 23:25:52 UTC
(rev 6761)
+++ trunk/gnue-reports/samples/foobulations/char.grd 2004-11-30 23:28:02 UTC
(rev 6762)
@@ -1,70 +1,70 @@
-<?xml version="1.0"?>
-<report>
- <sources>
- <datasource connection="gnue" name="dtsFoo" table="foobulations"
order_by="name,color,foodate"/>
- </sources>
- <layout xmlns:out="GNUe:Reports:Char" suppressGNUeTags="Y">
-
+<?xml version="1.0"?>
+<report>
+ <sources>
+ <datasource connection="gnue" name="dtsFoo" table="foobulations"
order_by="name,color,foodate"/>
+ </sources>
+ <layout xmlns:out="GNUe:Reports:Char" >
+
<out:report width="80" height="15">
- <out:pageheader height="4">
- <out:label x="0" y="0" width="80" align="center">Monthly Accounting
Foobulation Report</out:label>
- <out:label x="0" y="2" width="4">Name</out:label>
- <out:label x="20" y="2" width="5">Color</out:label>
- <out:label x="40" y="2" width="4">Date</out:label>
- <out:label x="75" y="2" width="5">Foobs</out:label>
- <out:label x="0" y="3" width="4">====</out:label>
- <out:label x="20" y="3" width="5">=====</out:label>
- <out:label x="40" y="3" width="4">====</out:label>
- <out:label x="75" y="3" width="5">=====</out:label>
+ <out:pageheader height="4">
+ <out:label x="0" y="0" width="80" align="center">Monthly Accounting
Foobulation Report</out:label>
+ <out:label x="0" y="2" width="4">Name</out:label>
+ <out:label x="20" y="2" width="5">Color</out:label>
+ <out:label x="40" y="2" width="4">Date</out:label>
+ <out:label x="75" y="2" width="5">Foobs</out:label>
+ <out:label x="0" y="3" width="4">====</out:label>
+ <out:label x="20" y="3" width="5">=====</out:label>
+ <out:label x="40" y="3" width="4">====</out:label>
+ <out:label x="75" y="3" width="5">=====</out:label>
</out:pageheader>
-
- <out:pagefooter height="3">
- <out:label x="0" y="1" width="80">GNU Enterprise</out:label>
+
+ <out:pagefooter height="3">
+ <out:label x="0" y="1" width="80">GNU Enterprise</out:label>
</out:pagefooter>
-
- <section source="dtsFoo" name="mynameBreak">
- <out:groupheader height="1">
- <out:label x="0" y="0" width="20"><field name="name"/></out:label>
- </out:groupheader>
-
- <section name="mycolorBreak">
-<!--
- <out:groupheader height="1">
- <out:label x="10" y="0" width="10"><field
name="color"/></out:label>
- </out:groupheader>
--->
- <section name="details">
- <out:detail height="1">
- <out:label x="20" y="0" width="15"><field
name="color"/></out:label>
- <out:label x="40" y="0" width="25"><field
name="foodate"/></out:label>
- <out:label x="70" y="0" width="10" align="right"><field
name="foobs"/></out:label>
- </out:detail>
- </section>
-
- <out:groupfooter height="2">
- <out:label x="50" y="0" width="12"><field name="color"/>
total</out:label>
- <out:label x="70" y="0" width="10" align="right" bold="Y"><summ
function="sum" section="details" field="foobs"/></out:label>
- </out:groupfooter>
+
+ <section source="dtsFoo" name="mynameBreak">
+ <out:groupheader height="1">
+ <out:label x="0" y="0" width="20"><field name="name"/></out:label>
+ </out:groupheader>
+
+ <section name="mycolorBreak">
+<!--
+ <out:groupheader height="1">
+ <out:label x="10" y="0" width="10"><field
name="color"/></out:label>
+ </out:groupheader>
+-->
+ <section name="details">
+ <out:detail height="1">
+ <out:label x="20" y="0" width="15"><field
name="color"/></out:label>
+ <out:label x="40" y="0" width="25"><field
name="foodate"/></out:label>
+ <out:label x="70" y="0" width="10" align="right"><field
name="foobs"/></out:label>
+ </out:detail>
+ </section>
+
+ <out:groupfooter height="2">
+ <out:label x="50" y="0" width="12"><field name="color"/>
total</out:label>
+ <out:label x="70" y="0" width="10" align="right" bold="Y"><summ
function="sum" section="details" field="foobs"/></out:label>
+ </out:groupfooter>
</section>
-
- <out:groupfooter height="1">
- <out:label x="50" y="0" width="12"><field name="name"/>
total</out:label>
- <out:label x="70" y="0" width="10" align="right" bold="Y"><summ
function="sum" section="mycolorBreak" field="foobs"/></out:label>
- </out:groupfooter>
+
+ <out:groupfooter height="1">
+ <out:label x="50" y="0" width="12"><field name="name"/>
total</out:label>
+ <out:label x="70" y="0" width="10" align="right" bold="Y"><summ
function="sum" section="mycolorBreak" field="foobs"/></out:label>
+ </out:groupfooter>
</section>
<out:titlepage>
<out:label x="35" y="10" width="17" bold="Y" italic="Y">Grand Char
Report</out:label>
<out:label x="35" y="11" width="17"
bold="Y">=================</out:label>
</out:titlepage>
-
- <out:summarypage>
- <out:label x="50" y="2" width="12">Grand total</out:label>
- <out:label x="65" y="2" width="10"><summ function="sum"
section="mynameBreak" field="foobs"/></out:label>
+
+ <out:summarypage>
+ <out:label x="50" y="2" width="12">Grand total</out:label>
+ <out:label x="65" y="2" width="10"><summ function="sum"
section="mynameBreak" field="foobs"/></out:label>
</out:summarypage>
</out:report>
- </layout>
-</report>
+ </layout>
+</report>
Modified: trunk/gnue-reports/src/adapters/filters/Char/char/Adapter.py
===================================================================
--- trunk/gnue-reports/src/adapters/filters/Char/char/Adapter.py
2004-11-30 23:25:52 UTC (rev 6761)
+++ trunk/gnue-reports/src/adapters/filters/Char/char/Adapter.py
2004-11-30 23:28:02 UTC (rev 6762)
@@ -26,12 +26,12 @@
#
# NOTES:
#
-
-from gnue.reports.base.GROutputAdapter import TransformAdapter as Base
+
+from gnue.reports.base.GROutputAdapter import TransformAdapter as Base
from CHParser import loadFile
from PrinterDefs import *
-
+
class TransformAdapter(Base):
def __init__(self, *args, **parms):
Base.__init__(self, *args, **parms)
@@ -46,16 +46,16 @@
# We are finished with the intermediate file
self.input.close()
-
+
# Get a file for output from the destination adapter.
self.writer.output = self.destination.getOutputHandle()
- report = loadFile(self.infile)
-
+ report = loadFile(self.infile)
+
# print report.dumpXML()
self.parse(report)
-
+
# infile.close()
try:
@@ -73,7 +73,7 @@
def parse(self, report):
self.writer.initialize(report)
-
+
report.process(self.writer)
-
+
self.writer.finalize()
Modified: trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
===================================================================
--- trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
2004-11-30 23:25:52 UTC (rev 6761)
+++ trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
2004-11-30 23:28:02 UTC (rev 6762)
@@ -35,9 +35,9 @@
from gnue.common.logic import GTrigger
import copy, types
-
-
+
+
########
######## Please keep this file neat !!!
########
@@ -63,10 +63,10 @@
def getXMLelements():
global xmlElements
-
- import CHObjects
- import CHReport
+ import CHObjects
+ import CHReport
+
if xmlElements == None:
#
@@ -88,33 +88,33 @@
'description': {
'Typecast': GTypecast.text }
},
- 'ParentTags': None
+ 'ParentTags': None
},
-
+
'titlepage': {
'BaseClass': CHObjects.CHTitlePage,
'SingleInstance': 1,
- 'ParentTags': ('report',)
+ 'ParentTags': ('report',)
},
-
+
'summarypage': {
'BaseClass': CHObjects.CHSummaryPage,
'SingleInstance': 1,
- 'ParentTags': ('report',)
+ 'ParentTags': ('report',)
},
-
+
'pageheader': {
'BaseClass': CHObjects.CHPageHeader,
'Attributes': {
'height': {
'Required': True,
'Typecast': GTypecast.whole,
- 'Description': 'The height of the page header in text rows. ' }
+ 'Description': 'The height of the page header in text rows. ' }
},
'SingleInstance': 1,
- 'ParentTags': ('report',)
+ 'ParentTags': ('report',)
},
-
+
'pagefooter': {
'BaseClass': CHObjects.CHPageFooter,
'Attributes': {
@@ -137,7 +137,7 @@
},
'ParentTags': ('report',)
},
-
+
'groupfooter': {
'BaseClass': CHObjects.CHGroupFooter,
'Attributes': {
@@ -148,7 +148,7 @@
},
'ParentTags': ('report',)
},
-
+
'detail': {
'BaseClass': CHObjects.CHDetail,
'Attributes': {
@@ -160,7 +160,7 @@
'SingleInstance': 1,
'ParentTags': ('report',)
},
-
+
'label': {
'BaseClass': CHObjects.CHLabel,
'MixedContent': True,
@@ -209,18 +209,18 @@
'Typecast': GTypecast.whole,
'Description': 'The row starting position of the label. Based
upon the top row of the report being 0.' }
},
- 'ParentTags': ('titlepage',
- 'summarypage',
- 'pageheader',
- 'pagefooter',
- 'groupheader',
- 'groupfooter',
+ 'ParentTags': ('titlepage',
+ 'summarypage',
+ 'pageheader',
+ 'pagefooter',
+ 'groupheader',
+ 'groupfooter',
'detail',)
},
-
+
}
-
+
return GParser.buildImportableTags('report',xmlElements)
@@ -234,7 +234,10 @@
#######################################################
class xmlReportHandler (GParser.xmlHandler):
+
+ ignore_unknown_namespaces = True
+ default_namespace = 'GNUe:Reports:Char'
+
def __init__(self):
GParser.xmlHandler.__init__(self)
-
self.xmlElements = getXMLelements()
Modified: trunk/gnue-reports/src/base/GRParser.py
===================================================================
--- trunk/gnue-reports/src/base/GRParser.py 2004-11-30 23:25:52 UTC (rev
6761)
+++ trunk/gnue-reports/src/base/GRParser.py 2004-11-30 23:28:02 UTC (rev
6762)
@@ -22,12 +22,11 @@
# GRParser.py
#
# DESCRIPTION:
-# Class that contains a SAX-based xml processor for GNUe Reports
-#
+"""
+ Class that contains a SAX-based xml processor for GNUe Reports
+"""
# NOTES:
#
-# HISTORY:
-#
from gnue.common.datasources import GDataSource
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r6762 - in trunk/gnue-reports: samples/foobulations src/adapters/filters/Char/char src/base,
jcater <=