You are not logged in Log in Join
You are here: Home » Members » J. David Ibáñez » TimetableTag » README.txt

Log in
Name

Password

 

README.txt

Timetable DTML Tag

Renders a timetable. Usage:

    <dtml-timetable [attributes]>
      ...
    </dtml-timetable>

The timetable tag receives an unordered sequence of items, each item must have two attributes, start and end, used to arrange each one in the timetable; start and end are strings like "8:00" or "15:30".

The body of the tag is called for each item to render its table cell. Arbitrary properties of the cells can be set with "setTimetable". Here is an example:

bgcolor, yellow)">

The tag has two modes, the one column mode (default) and the multicolumn mode. If the multicolumn mode is used the main argument must be a sequence of sequences of items:

    <dtml-timetable "[f1.objectValues(), f2.objectValues()]" multicolumn>
      ...
    </dtml-timetable>

Attributes

  • name (string)

    the list of items to be rendered.

  • expr (string expr)

    expression that evaluates to the list of items to be rendered.

  • multicolumn (bool)

    if set a multicolumn timetable is rendered

  • header (sequence of strings)

    a list with headers of the timetable

  • mapping (bool)

    if set the items to be rendered are treated as mappings

  • grid (sequence of strings)

    an ordered list of strings, for example:

    grid="[8:00, 9:00, 10:00, 11:00, '12:00']"

    If not present the grid is automatically calculated from the list of items.

  • pdf (bool)

    if set the a pdf file will be built.

  • pdf_pagesize (string)

    can be any size defined in the module 'reportlab.lib.pagesizes': A0-A6, B0-B6, elevenSeventeen, legal or letter. Default is A4.

  • pdf_layout (string)

    portrait or landscape. Default is portrait.

  • pdf_author, pdf_author_expr (string, string expr)

    the author of the PDF file

  • pdf_title, pdf_title_expr (string, string expr)

    the title of the PDF file

  • pdf_subject, pdf_subject_expr (string, string expr)

    the subject of the PDF file

PDF

When the pdf argument is true a pdf file is generated, but you can't deliver PDF documents inline in the middle of an HTML page! Use this code to generate a PDF file:

    <dtml-call "RESPONSE.setHeader('content-type', 'application/pdf')">
    <dtml-timetable ... pdf>
     ...
    </dtml-timetable>

Don't add add any text before or after the timetable tag, be careful with spaces, tabs and newlines.

Using the setTimetable method you can set cell properties, but when building a pdf the timetable tag only interprets the following properties:

  • bgcolor

    it can be a RGB string like "#DDDDDD" or a color name like "yellow". The first form is prefered, if the colorname is used it could look different than in a web browser.

The text inside the timetable tag is not interpreted, that means that HTML tags can't be used.

Author and License

Copyright (C) 2000 Juan David Ib��ez Palomar

This program 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.

This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.