Package XSLForms :: Package Resources :: Module WebResources :: Class XSLFormsResource
[show private | hide private]
[frames | no frames]

Class XSLFormsResource

CommonResource --+
                 |
                XSLFormsResource

Known Subclasses:
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_identifier, output_filename,
                            node_identifier) tuples, indicating the output
                            identifier for which the fragment applies, 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
  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, stylesheet_expressions, references)
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' dictionary and the optional 'references' to external documents.
  prepare_fragment(self, fragment_identifier)
Prepare the output stylesheets for the given 'fragment_identifier', indicating which templates and stylesheets are to be employed in the production of output from the resource.
  prepare_initialiser(self, input_identifier, init_enumerations)
Prepare an initialiser/input transformation using the given 'input_identifier'.
  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.
  prepare_parameters(self, parameters)
Prepare the stylesheet parameters from the given request 'parameters'.
  prepare_transform(self, transform_identifier)
Prepare a transformation using the given 'transform_identifier'.
  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, stylesheet_expressions, references)
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_document(self, document_identifier)
Prepare a document using the given 'document_identifier'.

Class Variable Summary
dict in_page_resources = {}
dict init_resources = {}
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' dictionary and the optional 'references'
to external documents.

prepare_fragment(self, fragment_identifier)

Prepare the output stylesheets for the given 'fragment_identifier',
indicating which templates and stylesheets are to be employed in the
production of output from the resource.

The 'fragment_identifier' is used as a key to the 'in_page_resources'
dictionary attribute which in turn obtains an 'output_identifier', which
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_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

in_page_resources

Type:
dict
Value:
{}                                                                     

init_resources

Type:
dict
Value:
{}                                                                     

template_resources

Type:
dict
Value:
{}                                                                     

transform_resources

Type:
dict
Value:
{}                                                                     

Generated by Epydoc 2.1 on Thu Mar 1 00:46:44 2007 http://epydoc.sf.net