#!/usr/bin/env python
# -*- coding: UTF-8 -*-



##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from MainTemplate import MainTemplate

##################################################
## MODULE CONSTANTS
try:
    True, False
except NameError:
    True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0.1'
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
__CHEETAH_genTime__ = 1225031612.188421
__CHEETAH_genTimestamp__ = 'Sun Oct 26 14:33:32 2008'
__CHEETAH_src__ = 'ReportTemplate.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Jan 19 14:16:23 2007'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'

if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
    raise AssertionError(
      'This template was compiled with Cheetah version'
      ' %s. Templates compiled before version %s must be recompiled.'%(
         __CHEETAH_version__, RequiredCheetahVersion))

##################################################
## CLASSES

class ReportTemplate(MainTemplate):

    ##################################################
    ## CHEETAH GENERATED METHODS


    def __init__(self, *args, **KWs):

        MainTemplate.__init__(self, *args, **KWs)
        if not self._CHEETAH__instanceInitialized:
            cheetahKWArgs = {}
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
            for k,v in KWs.items():
                if k in allowedKWs: cheetahKWArgs[k] = v
            self._initCheetahInstance(**cheetahKWArgs)
        

    def additionalCSS(self, **KWS):



        ## CHEETAH: generated from #block additionalCSS at line 65, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        _v = VFFSL(SL,"default_table_CSS",False)() # '$default_table_CSS()' on line 66, col 1
        if _v is not None: write(_filter(_v, rawExpr='$default_table_CSS()')) # from line 66, col 1.
        write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def additionalJavaScript(self, **KWS):



        ## CHEETAH: generated from #block additionalJavaScript at line 69, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<script type="text/javascript" src="/js/table.js"></script>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def content(self, **KWS):



        ## CHEETAH: generated from #block content at line 73, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''
''')
        if VFFSL(SL,"search",True)>0: # generated from line 75, col 1
            write('''
<a href="''')
            _v = VFFSL(SL,"old_uri",True) # '${old_uri}' on line 77, col 10
            if _v is not None: write(_filter(_v, rawExpr='${old_uri}')) # from line 77, col 10.
            write('''adv=">Close Search</a>
<h2>Advanced Search</h2><form action="" method="get">

<div style="float:right">The operators are used like this
<ul><li>= : "equals" (enter null for empty string)</li><li>~ : "case insensitive search (* wildcards)"</li><li>[:] : "between", takes two colon-separated arguments</li><li>(,,) : "is one of", takes a comma-separated list of any size as argument. </li></ul><p><,>,<= and >= needs no explanation. </p><p> All these operators may be negated by clicking the "not" checkbox.</p></div>

<table>

''')
            counter = 0
            for a in VFFSL(SL,"report.form",True): # generated from line 86, col 1
                write('''<tr><td><label for="adv''')
                _v = VFFSL(SL,"counter",True) # '${counter}' on line 87, col 24
                if _v is not None: write(_filter(_v, rawExpr='${counter}')) # from line 87, col 24.
                write('''">''')
                _v = VFFSL(SL,"a.title",True) # '$a.title' on line 87, col 36
                if _v is not None: write(_filter(_v, rawExpr='$a.title')) # from line 87, col 36.
                write('''</label></td><td><input type="checkbox" name="not_''')
                _v = VFFSL(SL,"a.raw",True) # '${a.raw}' on line 87, col 94
                if _v is not None: write(_filter(_v, rawExpr='${a.raw}')) # from line 87, col 94.
                write('''" id="not_adv''')
                _v = VFFSL(SL,"counter",True) # '${counter}' on line 87, col 115
                if _v is not None: write(_filter(_v, rawExpr='${counter}')) # from line 87, col 115.
                write('''"''')
                if VFN(VFFSL(SL,"neg",True),"has_key",False)(VFFSL(SL,"a.raw",True)): # generated from line 88, col 1
                    write(''' checked="1"''')
                write('''>
</td><td><label for="not_adv''')
                _v = VFFSL(SL,"counter",True) # '${counter}' on line 92, col 29
                if _v is not None: write(_filter(_v, rawExpr='${counter}')) # from line 92, col 29.
                write('''">not</label></td><td>
''')
                if VFN(VFFSL(SL,"operator",True),"has_key",False)(VFFSL(SL,"a.raw",True)): # generated from line 93, col 1
                    _v = VFFSL(SL,"selectoptiondraw",False)("op_"+VFFSL(SL,"a.raw",True), VFFSL(SL,"operatorlist",True), VFFSL(SL,"operators",True),VFFSL(SL,"operator",True)[VFFSL(SL,"a.raw",True)], VFFSL(SL,"descriptions",True)) # '$selectoptiondraw("op_"+$a.raw, $operatorlist, $operators,$operator[$a.raw], $descriptions)' on line 94, col 1
                    if _v is not None: write(_filter(_v, rawExpr='$selectoptiondraw("op_"+$a.raw, $operatorlist, $operators,$operator[$a.raw], $descriptions)')) # from line 94, col 1.
                    write('''
''')
                else: # generated from line 95, col 1
                    _v = VFFSL(SL,"selectoptiondraw",False)("op_"+VFFSL(SL,"a.raw",True), VFFSL(SL,"operatorlist",True), VFFSL(SL,"operators",True),"", VFFSL(SL,"descriptions",True)) # '$selectoptiondraw("op_"+$a.raw, $operatorlist, $operators,"", $descriptions)' on line 96, col 1
                    if _v is not None: write(_filter(_v, rawExpr='$selectoptiondraw("op_"+$a.raw, $operatorlist, $operators,"", $descriptions)')) # from line 96, col 1.
                    write('''
''')
                write('''</td><td><input type="text" name="''')
                _v = VFFSL(SL,"a.raw",True) # '$a.raw' on line 98, col 35
                if _v is not None: write(_filter(_v, rawExpr='$a.raw')) # from line 98, col 35.
                write('''" id="adv''')
                _v = VFFSL(SL,"counter",True) # '${counter}' on line 98, col 50
                if _v is not None: write(_filter(_v, rawExpr='${counter}')) # from line 98, col 50.
                write('''"''')
                if VFN(VFFSL(SL,"contents",True),"has_key",False)(VFFSL(SL,"a.raw",True)): # generated from line 99, col 1
                    write(''' value="''')
                    _v = VFFSL(SL,"contents",True)[VFFSL(SL,"a.raw",True)] # '$contents[$a.raw]' on line 100, col 9
                    if _v is not None: write(_filter(_v, rawExpr='$contents[$a.raw]')) # from line 100, col 9.
                    write('''"''')
                write('''>
</tr>
''')
                counter += 1
            write('''
<tr><td></td><td></td><td><input type="hidden" name="adv" value="1"/></td><td><input type="submit" name="r4g3n53nd" value="Send"/></table></form>

''')
        else: # generated from line 109, col 1
            write('''<p><a href="''')
            _v = VFFSL(SL,"old_uri",True) # '${old_uri}' on line 110, col 13
            if _v is not None: write(_filter(_v, rawExpr='${old_uri}')) # from line 110, col 13.
            write('''adv=1">Advanced Search</a></p>
''')
        #  ----------------------------------------------------------------------- REPORT ---- ##
        if VFFSL(SL,"report",True): # generated from line 113, col 1
            rowcount = len(VFFSL(SL,"report.table.rows",True)) + 1
            columncount = len(VFFSL(SL,"report.table.header.cells",True))
            write('''
  <table class="horiztable">

''')
            #  --- TITLE ROW ---- ##
            write('''    <caption>
        <span class="cornerkludge"></span>

''')
            if VFFSL(SL,"report.navigator.previous",True): # generated from line 123, col 1
                write('''        <span class="previous">
        <a title="previous page" href="''')
                _v = VFFSL(SL,"report.navigator.previous",True) # '$report.navigator.previous' on line 125, col 40
                if _v is not None: write(_filter(_v, rawExpr='$report.navigator.previous')) # from line 125, col 40.
                write('''"
            onmouseover="imgprev.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 126, col 39
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 126, col 39.
                write('''/ragen/previous-active.gif\';"
            onmouseout="imgprev.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 127, col 38
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 127, col 38.
                write('''/ragen/previous.gif\';">
        <img id="imgprev" src="''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 128, col 32
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 128, col 32.
                write('''/ragen/previous.gif"
            alt="&lt;&lt; previous" /></a></span>
''')
            if VFFSL(SL,"report.navigator.next",True): # generated from line 131, col 1
                write('''        <span class="next">
        <a title="next page" href="''')
                _v = VFFSL(SL,"report.navigator.next",True) # '$report.navigator.next' on line 133, col 36
                if _v is not None: write(_filter(_v, rawExpr='$report.navigator.next')) # from line 133, col 36.
                write('''"
            onmouseover="imgnext.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 134, col 39
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 134, col 39.
                write('''/ragen/next-active.gif\';"
            onmouseout="imgnext.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 135, col 38
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 135, col 38.
                write('''/ragen/next.gif\';">
        <img id="imgnext" src="''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 136, col 32
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 136, col 32.
                write('''/ragen/next.gif"
            alt="next &gt;&gt;" /></a></span>
''')
            write('''
        ''')
            _v = VFFSL(SL,"report.header",True) # '$report.header' on line 140, col 9
            if _v is not None: write(_filter(_v, rawExpr='$report.header')) # from line 140, col 9.
            write('''<br />
        <span class="subtitle">''')
            _v = VFFSL(SL,"report.navigator.view",True) # '$report.navigator.view' on line 141, col 32
            if _v is not None: write(_filter(_v, rawExpr='$report.navigator.view')) # from line 141, col 32.
            write('''</span>
    </caption>

''')
            #  --- HEADER ROW ---- ##
            write('''    <tr class="header">
        <td class="leftkludge" rowspan="''')
            _v = VFFSL(SL,"rowcount",True) # '$rowcount' on line 146, col 41
            if _v is not None: write(_filter(_v, rawExpr='$rowcount')) # from line 146, col 41.
            write('''"></td>
''')
            for cell in VFFSL(SL,"report.table.header.cells",True): # generated from line 147, col 1
                if VFFSL(SL,"cell.uri",True): # generated from line 148, col 1
                    write('''        <th><a class="navbar" href="''')
                    _v = VFFSL(SL,"cell.uri",True) # '$cell.uri' on line 149, col 37
                    if _v is not None: write(_filter(_v, rawExpr='$cell.uri')) # from line 149, col 37.
                    write('''" title="''')
                    _v = VFFSL(SL,"cell.explanation",True) # '$cell.explanation' on line 149, col 55
                    if _v is not None: write(_filter(_v, rawExpr='$cell.explanation')) # from line 149, col 55.
                    write('''">''')
                    _v = VFFSL(SL,"cell.text",True) # '$cell.text' on line 149, col 74
                    if _v is not None: write(_filter(_v, rawExpr='$cell.text')) # from line 149, col 74.
                    write('''</a></th>
''')
                else: # generated from line 150, col 1
                    write('''        <th><a class="navbar" title="''')
                    _v = VFFSL(SL,"cell.explanation",True) # '$cell.explanation' on line 151, col 38
                    if _v is not None: write(_filter(_v, rawExpr='$cell.explanation')) # from line 151, col 38.
                    write('''">''')
                    _v = VFFSL(SL,"cell.text",True) # '$cell.text' on line 151, col 57
                    if _v is not None: write(_filter(_v, rawExpr='$cell.text')) # from line 151, col 57.
                    write('''</a></th>
''')
            write('''        <td class="rightkludge" rowspan="''')
            _v = VFFSL(SL,"rowcount",True) # '$rowcount' on line 154, col 42
            if _v is not None: write(_filter(_v, rawExpr='$rowcount')) # from line 154, col 42.
            write('''"></td>
    </tr>

''')
            #  --- DATA ROWS ---- ##
            for row in VFFSL(SL,"report.table.rows",True): # generated from line 158, col 1
                write('''    <tr class="''')
                _v = VFFSL(SL,"rowcycler",True) # '$rowcycler' on line 159, col 16
                if _v is not None: write(_filter(_v, rawExpr='$rowcycler')) # from line 159, col 16.
                write('''">
''')
                for cell in VFFSL(SL,"row.cells",True): # generated from line 160, col 1
                    write('''        <td class="''')
                    _v = VFFSL(SL,"cellcycler",True) # '$cellcycler' on line 161, col 20
                    if _v is not None: write(_filter(_v, rawExpr='$cellcycler')) # from line 161, col 20.
                    write('''">
''')
                    if VFFSL(SL,"cell.uri",True): # generated from line 162, col 1
                        write('''            <a href="''')
                        _v = VFFSL(SL,"cell.uri",True) # '$cell.uri' on line 163, col 22
                        if _v is not None: write(_filter(_v, rawExpr='$cell.uri')) # from line 163, col 22.
                        write('''">''')
                        _v = VFFSL(SL,"cell.text",True) # '$cell.text' on line 163, col 33
                        if _v is not None: write(_filter(_v, rawExpr='$cell.text')) # from line 163, col 33.
                        write('''</a>
''')
                    else: # generated from line 164, col 1
                        write('''            ''')
                        _v = VFFSL(SL,"cell.text",True) # '$cell.text' on line 165, col 13
                        if _v is not None: write(_filter(_v, rawExpr='$cell.text')) # from line 165, col 13.
                        write('''
''')
                    write('''        </td>
''')
                write('''    </tr>
''')
            write('''
''')
            #  --- FOOTER ---- ##
            if VFFSL(SL,"report.table.footer",True): # generated from line 173, col 1
                cols = len(VFFSL(SL,"report.table.header.cells",True))
                write('''    <tr class="tablesum">
        <td></td>
''')
                for cell in VFFSL(SL,"report.table.footer.cells",True): # generated from line 177, col 1
                    write('''        <th>
''')
                    if VFFSL(SL,"cell.sum",True): # generated from line 179, col 1
                        write('''        ''')
                        _v = VFFSL(SL,"cell.sum",True) # '$cell.sum' on line 180, col 9
                        if _v is not None: write(_filter(_v, rawExpr='$cell.sum')) # from line 180, col 9.
                        write('''
''')
                    write('''        </th>
''')
                write('''        <td></td>
    </tr>
''')
            write('''
''')
            #  --- FOOTER NAVIGATION ---- ##
            write('''    <tr class="footer">
        <td class="leftkludge"></td>
        <th colspan="''')
            _v = VFFSL(SL,"columncount",True) # '$columncount' on line 191, col 22
            if _v is not None: write(_filter(_v, rawExpr='$columncount')) # from line 191, col 22.
            write('''">
''')
            if VFFSL(SL,"report.navigator.previous",True): # generated from line 192, col 1
                write('''            <span class="previous">
            <a title="previous page" href="''')
                _v = VFFSL(SL,"report.navigator.previous",True) # '$report.navigator.previous' on line 194, col 44
                if _v is not None: write(_filter(_v, rawExpr='$report.navigator.previous')) # from line 194, col 44.
                write('''"
                onmouseover="imgprevb.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 195, col 44
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 195, col 44.
                write('''/ragen/bottom-previous-active.gif\';"
                onmouseout="imgprevb.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 196, col 43
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 196, col 43.
                write('''/ragen/bottom-previous.gif\';">
            <img id="imgprevb" src="''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 197, col 37
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 197, col 37.
                write('''/ragen/bottom-previous.gif"
                alt="&lt;&lt; previous" /></a></span>
''')
            if VFFSL(SL,"report.navigator.next",True): # generated from line 200, col 1
                write('''            <span class="next">
            <a title="next page" href="''')
                _v = VFFSL(SL,"report.navigator.next",True) # '$report.navigator.next' on line 202, col 40
                if _v is not None: write(_filter(_v, rawExpr='$report.navigator.next')) # from line 202, col 40.
                write('''"
                onmouseover="imgnextb.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 203, col 44
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 203, col 44.
                write('''/ragen/bottom-next-active.gif\';"
                onmouseout="imgnextb.src=\'''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 204, col 43
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 204, col 43.
                write('''/ragen/bottom-next.gif\';">
            <img id="imgnextb" src="''')
                _v = VFFSL(SL,"imagefolder",True) # '$imagefolder' on line 205, col 37
                if _v is not None: write(_filter(_v, rawExpr='$imagefolder')) # from line 205, col 37.
                write('''/ragen/bottom-next.gif" alt="next &gt;&gt;" /></a></span>
''')
            write('''            <span>''')
            _v = VFFSL(SL,"report.navigator.view",True) # '$report.navigator.view' on line 207, col 19
            if _v is not None: write(_filter(_v, rawExpr='$report.navigator.view')) # from line 207, col 19.
            write('''</span>
        </th>
        <td class="rightkludge"></td>
    </tr>

</table>
''')
        else : # generated from line 213, col 1
            write('''<p class="error">No results found!</p>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def selectoptiondraw(self, name, elementlist, elementdict, selected="", descriptiondict=None, **KWS):



        ## CHEETAH: generated from #def selectoptiondraw($name, $elementlist, $elementdict, $selected="", $descriptiondict=None) at line 218, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''<select name="''')
        _v = VFFSL(SL,"name",True) # '$name' on line 219, col 15
        if _v is not None: write(_filter(_v, rawExpr='$name')) # from line 219, col 15.
        write('''">
''')
        for element in VFFSL(SL,"elementlist",True): # generated from line 220, col 1
            write('''    <option value="''')
            _v = VFFSL(SL,"element",True) # '$element' on line 221, col 20
            if _v is not None: write(_filter(_v, rawExpr='$element')) # from line 221, col 20.
            write('''"''')
            if VFFSL(SL,"element",True) == VFFSL(SL,"selected",True): # generated from line 222, col 1
                write(''' selected="1"''')
            if VFN(VFFSL(SL,"descriptiondict",True),"has_key",False)(VFFSL(SL,"element",True)): # generated from line 225, col 1
                write(''' title="''')
                _v = VFFSL(SL,"descriptiondict",True)[VFFSL(SL,"element",True)] # '$descriptiondict[$element]' on line 226, col 9
                if _v is not None: write(_filter(_v, rawExpr='$descriptiondict[$element]')) # from line 226, col 9.
                write('''"''')
            write('''>''')
            _v = VFFSL(SL,"elementdict",True)[VFFSL(SL,"element",True)] # '$elementdict[$element]' on line 229, col 1
            if _v is not None: write(_filter(_v, rawExpr='$elementdict[$element]')) # from line 229, col 1.
            write('''</option>
''')
        write('''</select>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def writeBody(self, **KWS):



        ## CHEETAH: main method generated for this template
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        #  $Id: ReportTemplate.tmpl 3809 2007-01-19 14:16:23Z jodal $
        #   
        #  Copyright 2003-2005 Norwegian University of Science and Technology
        # 
        #  This file is part of Network Administration Visualized (NAV)
        # 
        #  NAV is free software; you can redistribute it and/or modify
        #  it under the terms of the GNU General Public License as published by
        #  the Free Software Foundation; either version 2 of the License, or
        #  (at your option) any later version.
        # 
        #  NAV is distributed in the hope that it will be useful,
        #  but WITHOUT ANY WARRANTY; without even the implied warranty of
        #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        #  GNU General Public License for more details.
        # 
        #  You should have received a copy of the GNU General Public License
        #  along with NAV; if not, write to the Free Software
        #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
        # 
        # 
        #  Author: Magnar Sveen <magnars@idi.ntnu.no>
        # 
        write('''
''')
        # 
        #  Extends the MainTemplate for header-information, nav-logo and navigation-bar.
        #  Builds html for the Report Generator with data in this form:
        # 
        #  $report
        #    +-- header                        :: name of the report
        #    +-- navigator
        #    |    +-- previous                 :: uri to previous page (optional)
        #    |    +-- view                     :: info about current page
        #    |    +-- next                     :: uri to next page (optional)
        #    +-- table
        #         +-- header
        #         |    +-- cells               :: array of cells
        #         |         +-- uri            :: link (optional)
        #         |         +-- text           :: name of the column
        #         |         +-- explanation    :: description of data in the column (optional)
        #         +-- rows
        #         |    +-- cells               :: array of cells
        #         |         +-- uri            :: link (optional)
        #         |         +-- text           :: the bread and butter of the table
        #         +-- footer
        #              +-- cells               :: array of cells
        #                   +-- sum            :: sum of values in the column (optional)
        # 
        #  The template uses images in $imagefolder/ragen/, where $imagefolder
        #  is inherited from MainTemplate and defaults to "/images".
        # 
        #  This template can easily be used for other tables, as long as the indata is
        #  structured in the same way. To change the watermark-logo, change the $logo attribute.
        #  To illustrate:
        # 
        #    import ReportTemplate from foo.bar.ReportTemplate
        #    page = ReportTemplate()
        #    page.report = fillReportWithData()
        #    page.logo = "/foo/bar.gif"
        # 
        write('''

''')
        self.additionalCSS(trans=trans)
        write('''
''')
        self.additionalJavaScript(trans=trans)
        write('''
''')
        self.content(trans=trans)
        write('''
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        
    ##################################################
    ## CHEETAH GENERATED ATTRIBUTES


    _CHEETAH__instanceInitialized = False

    _CHEETAH_version = __CHEETAH_version__

    _CHEETAH_versionTuple = __CHEETAH_versionTuple__

    _CHEETAH_genTime = __CHEETAH_genTime__

    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__

    _CHEETAH_src = __CHEETAH_src__

    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__

    _mainCheetahMethod_for_ReportTemplate= 'writeBody'

## END CLASS DEFINITION

if not hasattr(ReportTemplate, '_initCheetahAttributes'):
    templateAPIClass = getattr(ReportTemplate, '_CHEETAH_templateClass', Template)
    templateAPIClass._addCheetahPlumbingCodeToClass(ReportTemplate)


# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/

##################################################
## if run from command line:
if __name__ == '__main__':
    from Cheetah.TemplateCmdLineIface import CmdLineIface
    CmdLineIface(templateObj=ReportTemplate()).run()


