Home | Trees | Index | Help |
---|
|
Base class for classes to generate web pages from DTML.
The 'DtmlPage' object is used as the variable context when generating HTML from DTML. Attributes and methods are available as variables in DTML expressions.
This base class contains common variables and functions that are available when generating all DTML files.
To generate HTML from a DTML template, instantiate a 'DtmlPage' object, passing the name of the DTML template file to the initializer function (or create a subclass which does this automatically). Additional named attributes specified in the initializer functions are set as attributes of the 'DtmlPage' object, and thus available as variables in DTML Python expressions.
To generate HTML from the template, use the '__call__' method, passing a 'WebRequest' object representing the request in response to which the HTML page is being generated. The request set as the 'request' attribute of the 'DtmlPage' object. The 'WebRequest' object may be omitted, if the generated HTML page is generic and requires no information specific to the request or web session; in this case, an empty request object is used.
This class also has an attribute, 'default_class', which is the default 'DtmlPage' subclass to use when generating HTML. By default, it is initialized to 'DtmlPage' itself, but applications may derive a 'DtmlPage' subclass and point 'default_class' to it to obtain customized versions of standard pages.
|
|||
default_class | Base class for classes to generate web pages from DTML. |
|
|||
GenerateEndBody(self,
decorations=1)
Return markup to end the body of the HTML document. |
|||
GenerateEndScript(self)
Return the HTML for ending an embedded script. |
|||
GenerateHtmlHeader(self,
description,
headers="")
Return the header for an HTML document. |
|||
GenerateStartBody(self,
decorations=1)
Return markup to start the body of the HTML document. |
|||
GenerateStartScript(self,
uri=None)
Return the HTML for beginning a script. |
|||
GenerateXMLHeader(self)
Return the XML header for the document. |
|||
GetMainPageUrl(self)
Return the URL for the main page. |
|||
GetProgramName(self)
Return the name of this application program. |
|||
MakeButton(self,
title,
script_url,
css_class=None,
**fields)
Generate HTML for a button to load a URL. |
|||
MakeImageUrl(self,
image)
Generate a URL for an image. |
|||
MakeLoginForm(self, redirect_request=None, default_user_id="") | |||
MakeRule(self,
color="black")
Generate a plain horizontal rule. |
|||
MakeSpacer(self,
width=1,
height=1)
Generate a spacer. |
|||
UserIsInGroup(self,
group_id)
Return true if the user is a member of group 'group_id'. |
|||
WebRequest(self,
script_url,
**fields)
Convenience constructor for 'WebRequest' objects. |
|||
__call__(self,
request=None)
Generate an HTML page from the DTML template. |
|||
__init__(self,
dtml_template,
**attributes)
Create a new page. |
|
|||
common_javascript | |||
html_stylesheet | The URL for the cascading stylesheet to use with generated pages. | ||
qm_bug_system_url | The public URL for the bug tracking system for the QM tools. | ||
web | Common code for implementing web user interfaces. |
|
|
Return the HTML for ending an embedded script. returns -- A string consisting of HTML for ending an embedded script. |
Return the header for an HTML document. 'description' -- A string describing this page. 'headers' -- Any additional HTML headers to place in the '<head>' section of the HTML document. |
|
Return the HTML for beginning a script. 'uri' -- If not None, a string giving the URI of the script. returns -- A string consisting of HTML for beginning an embedded script. 'GenerateEndScript' must be called later to terminate the script. |
|
|
|
Generate HTML for a button to load a URL. 'title' -- The button title. 'script_url' -- The URL of the script. 'fields' -- Additional fields to add to the script request. 'css_class' -- The CSS class to use for the button, or 'None'. The resulting HTML must be included in a form. |
|
|
|
Generate a spacer. 'width' -- The width of the spacer, in pixels. 'height' -- The height of the spacer, in pixels. returns -- A transparent image of the requested size. |
Return true if the user is a member of group 'group_id'. Checks the group membership of the user associated with the current session. If there is no group named 'group_id' in the user database, returns a false result. |
Convenience constructor for 'WebRequest' objects. Constructs a 'WebRequest' using the specified 'script_url' and 'fields', using the request associated with this object as the base request. |
Generate an HTML page from the DTML template. 'request' -- A 'WebRequest' object containing a page request in response to which an HTML page is being generated. Session information from the request may be used when generating the page. The request may be 'None', if none is available. returns -- The generated HTML text. |
Create a new page. 'dtml_template' -- The file name of the DTML template from which the page is generated. The file is assumed to reside in the 'dtml' subdirectory of the configured share directory. '**attributes' -- Additional attributes to include in the variable context. |
|
common_javascript
|
html_stylesheetThe URL for the cascading stylesheet to use with generated pages.
|
qm_bug_system_urlThe public URL for the bug tracking system for the QM tools.
|
webCommon code for implementing web user interfaces.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 3.0alpha2 on Fri Sep 28 00:57:34 2007 | http://epydoc.sf.net |