Commit 521761b7 authored by Jim Fulton's avatar Jim Fulton

added option for tabular vs record reports

parent ad3bca87
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
############################################################################## ##############################################################################
__doc__='''Shared Aqueduct classes and functions __doc__='''Shared Aqueduct classes and functions
$Id: Aqueduct.py,v 1.16 1997/12/12 23:38:04 jim Exp $''' $Id: Aqueduct.py,v 1.17 1998/01/09 13:58:14 jim Exp $'''
__version__='$Revision: 1.16 $'[11:-2] __version__='$Revision: 1.17 $'[11:-2]
from Globals import HTMLFile, Persistent from Globals import HTMLFile, Persistent
import DocumentTemplate, DateTime, regex, regsub, string, urllib, rotor import DocumentTemplate, DateTime, regex, regsub, string, urllib, rotor
...@@ -191,7 +191,7 @@ def default_input_form(id,arguments,action='query', ...@@ -191,7 +191,7 @@ def default_input_form(id,arguments,action='query',
custom_default_report_src=DocumentTemplate.File( custom_default_report_src=DocumentTemplate.File(
dtml_dir+'customDefaultReport.dtml') dtml_dir+'customDefaultReport.dtml')
def custom_default_report(id, result, action=''): def custom_default_report(id, result, action='', no_table=0):
columns=result._searchable_result_columns() columns=result._searchable_result_columns()
__traceback_info__=columns __traceback_info__=columns
heading=('<tr>\n%s</tr>' % heading=('<tr>\n%s</tr>' %
...@@ -202,19 +202,24 @@ def custom_default_report(id, result, action=''): ...@@ -202,19 +202,24 @@ def custom_default_report(id, result, action=''):
'' ''
) )
) )
row=('<tr>\n%s</tr>' %
string.joinfields( if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', '
map(lambda c: else: tr, _tr, td, _td, delim = '<tr>', '</tr>', '<td>', '</td>', ''
'\t\t<td><!--#var %s%s--></td>\n'
% (urllib.quote(c['name']), if no_table: tr='<p>'
c['type']!='s' and ' null=""' or '', else: tr, _tr = '<tr>', '</p>'
),
row=('%s\n%s\t\t%s' %
(tr,string.joinfields(
map(lambda c, td=td, _td=_td:
'\t\t%s<!--#var %s%s-->%s\n'
% (td,urllib.quote(c['name']),
c['type']!='s' and ' null=""' or '',_td),
columns), columns),
'' delim), _tr))
)
)
return custom_default_report_src( return custom_default_report_src(
id=id,heading=heading,row=row,action=action) id=id,heading=heading,row=row,action=action,no_table=no_table)
def detypify(arg): def detypify(arg):
l=string.find(arg,':') l=string.find(arg,':')
...@@ -360,6 +365,9 @@ def delimited_output(results,REQUEST,RESPONSE): ...@@ -360,6 +365,9 @@ def delimited_output(results,REQUEST,RESPONSE):
############################################################################## ##############################################################################
# #
# $Log: Aqueduct.py,v $ # $Log: Aqueduct.py,v $
# Revision 1.17 1998/01/09 13:58:14 jim
# added option for tabular vs record reports
#
# Revision 1.16 1997/12/12 23:38:04 jim # Revision 1.16 1997/12/12 23:38:04 jim
# Added debugging info. # Added debugging info.
# #
......
...@@ -10,15 +10,16 @@ ...@@ -10,15 +10,16 @@
########################################################################## ##########################################################################
__doc__='''Aqueduct Search Interface Wizard __doc__='''Aqueduct Search Interface Wizard
$Id: Search.py,v 1.2 1998/01/07 16:32:48 jim Exp $''' $Id: Search.py,v 1.3 1998/01/09 13:58:15 jim Exp $'''
__version__='$Revision: 1.2 $'[11:-2] __version__='$Revision: 1.3 $'[11:-2]
from Globals import HTMLFile from Globals import HTMLFile
from Aqueduct import custom_default_report, nicify from Aqueduct import custom_default_report, nicify
from string import join from string import join
addForm=HTMLFile('searchAdd', globals()) addForm=HTMLFile('searchAdd', globals())
def add(self, report_id, report_title, input_id, input_title, queries=[], def add(self, report_id, report_title, report_style,
input_id, input_title, queries=[],
REQUEST=None): REQUEST=None):
'add a report' 'add a report'
...@@ -56,7 +57,8 @@ def add(self, report_id, report_title, input_id, input_title, queries=[], ...@@ -56,7 +57,8 @@ def add(self, report_id, report_title, input_id, input_title, queries=[],
report_id,report_title, report_id,report_title,
('<!--#var standard_html_header-->\n%s\n' ('<!--#var standard_html_header-->\n%s\n'
'<!--#var standard_html_footer-->' % '<!--#var standard_html_footer-->' %
join(map(lambda q: custom_default_report(q.id, q), qs), join(map(lambda q, report_style=report_style:
custom_default_report(q.id, q, no_table=report_style), qs),
'\n<hr>\n'))) '\n<hr>\n')))
if REQUEST: return self.manage_main(self,REQUEST) if REQUEST: return self.manage_main(self,REQUEST)
...@@ -171,6 +173,9 @@ def default_input_form(arguments,action='query', ...@@ -171,6 +173,9 @@ def default_input_form(arguments,action='query',
############################################################################## ##############################################################################
# #
# $Log: Search.py,v $ # $Log: Search.py,v $
# Revision 1.3 1998/01/09 13:58:15 jim
# added option for tabular vs record reports
#
# Revision 1.2 1998/01/07 16:32:48 jim # Revision 1.2 1998/01/07 16:32:48 jim
# Brought up to date with latest Principia models. # Brought up to date with latest Principia models.
# #
......
<!--#in %(id)s size=50 start=query_start-->
<!--#in %(id)s size=50 start=query_start-->
<!--#if sequence-start--> <!--#if sequence-start-->
<!--#if previous-sequence--> <!--#if previous-sequence-->
<a href="<!--#var URL-->/<!--#var sequence-query <a href="<!--#var URL-->/<!--#var sequence-query
...@@ -8,20 +7,14 @@ ...@@ -8,20 +7,14 @@
(Previous <!--#var previous-sequence-size--> results) (Previous <!--#var previous-sequence-size--> results)
</a> </a>
<!--#/if previous-sequence--> <!--#/if previous-sequence-->
<table border> %(else no_table)[<table border>
%(heading)s%(else)]
%(heading)s
<!--#/if sequence-start--> <!--#/if sequence-start-->
%(row)s %(row)s
<!--#if sequence-end--> <!--#if sequence-end-->
</table> %(else no_table)[</table>%(else)]
<!--#if next-sequence--> <!--#if next-sequence-->
<a href="<!--#var URL-->/<!--#var sequence-query <a href="<!--#var URL-->/<!--#var sequence-query
-->&query_start=<!--#var -->&query_start=<!--#var
...@@ -31,9 +24,8 @@ ...@@ -31,9 +24,8 @@
<!--#/if next-sequence--> <!--#/if next-sequence-->
<!--#/if sequence-end--> <!--#/if sequence-end-->
<!--#else--> <!--#else-->
There was no data matching this <!--#var title_or_id--> query. There was no data matching this <!--#var title_or_id--> query.
<!--#/in--> <!--#/in-->
...@@ -11,7 +11,7 @@ and a report for a searchable object. ...@@ -11,7 +11,7 @@ and a report for a searchable object.
<table> <table>
<tr> <th>Select one or more searchable objects</th> <tr> <th>Select one or more searchable objects</th>
<td><select name="queries:list" size=5 multiple> <td><select name="queries:list" size=4 multiple>
<!--#in aqueductQueryIds--> <!--#in aqueductQueryIds-->
<option><!--#var sequence-item--></option> <option><!--#var sequence-item--></option>
<!--#/in aqueductQueryIds--> <!--#/in aqueductQueryIds-->
...@@ -20,11 +20,15 @@ and a report for a searchable object. ...@@ -20,11 +20,15 @@ and a report for a searchable object.
<td><input name="report_id" size="40"></td></tr> <td><input name="report_id" size="40"></td></tr>
<tr> <th><em>Report Title<em></th> <tr> <th><em>Report Title<em></th>
<td><input name="report_title" size="40"></td></tr> <td><input name="report_title" size="40"></td></tr>
<tr> <th>Report Style</th>
<td><select name='report_style:int'>
<option value="0">Tabular</option>
<option value="1">Records</option>
</select></td></tr>
<tr> <th>Search Input ID</th> <tr> <th>Search Input ID</th>
<td><input name="input_id" size="40"></td></tr> <td><input name="input_id" size="40"></td></tr>
<tr> <th><em>Search Input Title</em></th> <tr> <th><em>Search Input Title</em></th>
<td><input name="input_title" size="40"></td></tr> <td><input name="input_title" size="40"></td></tr>
<!--#var smallRolesWidget-->
<tr><td></td><td><input type="SUBMIT" name="SUBMIT" value="Add"></td></tr> <tr><td></td><td><input type="SUBMIT" name="SUBMIT" value="Add"></td></tr>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment