Trees | Index | Help |
---|
Package XSLForms :: Package Resources :: Module WebResources :: Class XSLFormsResource |
|
CommonResource
--+
|
XSLFormsResource
XSLFormsResource
A generic XSLForms resource for use with WebStack. When overriding this class, define the following attributes appropriately: * template_resources - a dictionary mapping output identifiers to (template_filename, output_filename) tuples, indicating the template and stylesheet filenames to be employed * in_page_resources - a dictionary mapping fragment identifiers to (output_filename, node_identifier) tuples, indicating the stylesheet filename to be employed, along with the node identifier used in the original template and output documents to mark a region of those documents as the fragment to be updated upon "in-page" requests * init_resources - a dictionary mapping initialiser/input identifiers to (template_filename, input_filename) tuples, indicating the template and initialiser/input stylesheet filenames to be employed * transform_resources - a dictionary mapping transform identifiers to lists of stylesheet filenames for use with the transformation methods * document_resources - a dictionary mapping document identifiers to single filenames for use as source documents or as references with the transformation methods * resource_dir - the absolute path of the directory in which stylesheet resources are to reside All filenames shall be simple leafnames for files residing in the resource's special resource directory 'resource_dir'. The following attributes may also be specified: * path_encoding - the assumed encoding of characters in request paths * encoding - the assumed encoding of characters in request bodies
Method Summary | |
---|---|
Workaround stray zero value characters from Konqueror in XMLHttpRequest communications. | |
Return the in-page resource being referred to in the given transaction 'trans'. | |
Get the result of applying a transformation using stylesheets with the given 'stylesheet_filenames', the 'document' upon which the result will be based, the optional parameters as defined in the 'stylesheet_parameters' dictionary, the optional parameters as defined in the 'stylesheet_parameters' dictionaryand the optional 'references' to external documents. | |
Prepare the output stylesheets for the given 'output_identifier' and 'fragment_identifier', indicating which templates and stylesheets are to be employed in the production of output from the resource. | |
Prepare an initialiser/input transformation using the given 'input_identifier'. | |
Prepare the output stylesheets using the given 'output_identifier' to indicate which templates and stylesheets are to be employed in the production of output from the resource. | |
Prepare the stylesheet parameters from the given request 'parameters'. | |
Prepare a transformation using the given 'transform_identifier'. | |
Respond to the request described by the given transaction 'trans'. | |
Respond to the request described by the given transaction 'trans', using the given 'form' object to conveniently retrieve field (request parameter) information and structured form information (as DOM-style XML documents). | |
Send the output from the resource to the user employing the transaction 'trans', stylesheets having the given 'stylesheet_filenames', the 'document' upon which the output will be based, the optional parameters as defined in the 'stylesheet_parameters' dictionary, the optional expressions are defined in the 'stylesheet_expressions' dictionary, and the optional 'references' to external documents. | |
Inherited from CommonResource | |
Prepare a document using the given 'document_identifier'. |
Class Variable Summary | |
---|---|
str |
encoding = 'utf-8'
|
dict |
in_page_resources = {}
|
dict |
init_resources = {}
|
str |
path_encoding = 'utf-8'
|
dict |
template_resources = {}
|
dict |
transform_resources = {}
|
Inherited from CommonResource | |
dict |
document_resources = {}
|
NoneType |
resource_dir = None |
Method Details |
---|
clean_parameters(self, parameters)Workaround stray zero value characters from Konqueror in XMLHttpRequest communications. |
get_in_page_resource(self, trans)Return the in-page resource being referred to in the given transaction 'trans'. |
get_result(self, stylesheet_filenames, document, stylesheet_parameters=None, stylesheet_expressions=None, references=None)Get the result of applying a transformation using stylesheets with the given 'stylesheet_filenames', the 'document' upon which the result will be based, the optional parameters as defined in the 'stylesheet_parameters' dictionary, the optional parameters as defined in the 'stylesheet_parameters' dictionaryand the optional 'references' to external documents. |
prepare_fragment(self, output_identifier, fragment_identifier)Prepare the output stylesheets for the given 'output_identifier' and 'fragment_identifier', indicating which templates and stylesheets are to be employed in the production of output from the resource. The 'output_identifier' is used as a key to the 'template_resources' dictionary attribute; the 'fragment_identifier' is used as a key to the 'in_page_resources' dictionary attribute. Return the full path to the output stylesheet for use with 'send_output' or 'get_result'. |
prepare_initialiser(self, input_identifier, init_enumerations=1)Prepare an initialiser/input transformation using the given 'input_identifier'. The optional 'init_enumerations' (defaulting to true) may be used to indicate whether enumerations are to be initialised from external documents. Return the full path to the input stylesheet for use with 'send_output' or 'get_result'. |
prepare_output(self, output_identifier)Prepare the output stylesheets using the given 'output_identifier' to indicate which templates and stylesheets are to be employed in the production of output from the resource. The 'output_identifier' is used as a key to the 'template_resources' dictionary attribute. Return the full path to the output stylesheet for use with 'send_output' or 'get_result'. |
prepare_parameters(self, parameters)Prepare the stylesheet parameters from the given request 'parameters'. This is most useful when preparing fragments for in-page update output. |
prepare_transform(self, transform_identifier)Prepare a transformation using the given 'transform_identifier'. Return a list of full paths to the output stylesheets for use with 'send_output' or 'get_result'. |
respond(self, trans)Respond to the request described by the given transaction 'trans'. |
respond_to_form(self, trans, form)Respond to the request described by the given transaction 'trans', using the given 'form' object to conveniently retrieve field (request parameter) information and structured form information (as DOM-style XML documents). |
send_output(self, trans, stylesheet_filenames, document, stylesheet_parameters=None, stylesheet_expressions=None, references=None)Send the output from the resource to the user employing the transaction 'trans', stylesheets having the given 'stylesheet_filenames', the 'document' upon which the output will be based, the optional parameters as defined in the 'stylesheet_parameters' dictionary, the optional expressions are defined in the 'stylesheet_expressions' dictionary, and the optional 'references' to external documents. |
Class Variable Details |
---|
encoding
|
in_page_resources
|
init_resources
|
path_encoding
|
template_resources
|
transform_resources
|
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Fri Dec 9 15:06:36 2005 | http://epydoc.sf.net |