| Home | Trees | Index | Help |
|---|
| Package qm :: Module web :: Class DtmlPage |
|
UploadAttachmentPageBase 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.| Method Summary | |
|---|---|
Create a new page. | |
Generate an HTML page from the DTML template. | |
Return markup to end the body of the HTML document. | |
Return the HTML for ending an embedded script. | |
Return the header for an HTML document. | |
Return markup to start the body of the HTML document. | |
Return the HTML for beginning a script. | |
Return the XML header for the document. | |
Return the URL for the main page. | |
Return the name of this application program. | |
Generate HTML for a button to load a URL. | |
Generate a URL for an image. | |
MakeLoginForm(self,
redirect_request,
default_user_id)
| |
Generate a plain horizontal rule. | |
Generate a spacer. | |
Return true if the user is a member of group 'group_id'. | |
Convenience constructor for 'WebRequest' objects. | |
| Class Variable Summary | |
|---|---|
str |
common_javascript = '/common.js'
|
classobj |
default_class = qm.web.DtmlPage |
str |
html_stylesheet = '/stylesheets/qm.css'
|
str |
qm_bug_system_url = 'mailto:qmtest@codesourcery.com'
|
| Method Details |
|---|
__init__(self,
dtml_template,
**attributes)
|
__call__(self,
request=None)
|
GenerateEndBody(self, decorations=1)Return markup to end the body of the HTML document. |
GenerateEndScript(self)Return the HTML for ending an embedded script. returns -- A string consisting of HTML for ending an embedded script. |
GenerateHtmlHeader(self, description, headers='')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. |
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. '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. |
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. '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. |
MakeImageUrl(self, image)Generate a URL for an image. |
MakeRule(self, color='black')Generate a plain horizontal rule. |
MakeSpacer(self, width=1, height=1)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. |
UserIsInGroup(self, group_id)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. |
WebRequest(self, script_url, **fields)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. |
| Class Variable Details |
|---|
common_javascript
|
html_stylesheet
|
qm_bug_system_url
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Sep 27 15:49:03 2007 | http://epydoc.sf.net |