UrlSchemeAPI.py :  » Web-Frameworks » Aquarium » aquarium-2.3 » aquarium » urlscheme » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Web Frameworks » Aquarium 
Aquarium » aquarium 2.3 » aquarium » urlscheme » UrlSchemeAPI.py
"""Document the API for url scheme classes.

An url scheme class encapsulates information about how URL's work for a
particular Web site.  For instance, how does the desired screen get retrieved
from an URL, and where is the images directory in relation to that URL?  By
using an url scheme class successfully, all URL's are be created dynamically,
and changing to a new format will be easy.  (On the other hand, it's not a good
idea to be changing the format of your URL's often, since bookmarks, external
links, and search engines will break.)

The following methods are required:

.. _getRootUrl:

``getRootUrl(self, secure=-1)``
  Figure out the URL for the root of this site.

  secure::

       0 -> http://
       1 -> https://
      -1 -> (the default) results in whatever is currently being used

``static(self, file, secure=-1)``
  Return an URL for something relative to the root URL.

  file
    This is a file relative to the root URL.

  secure
    See getRootUrl_.

``img(self, img, secure=-1)``
  Return an URL to an image.

  Return ``self.static("images/" + img, secure)``.  Hence, ``img`` should be
  something like ``buttons/foo.jpg``.

``screen(self, screen, vars=None, secure=-1)``
  Return a dynamic URL for the given screen.

  screen
    This is the module name (i.e. use dots, not slashes) of the screen relative
    to the screen package.

  vars
    A dictionary of variables that you want appended to the URL in the query
    string.  This is done by ``urllib.urlencode``.

  secure
    See getRootUrl_.

``hiddenFormFields(self, screen, vars=None)``
  Return necessary hidden form fields.

  screen
    This is the module name (i.e. use dots, not slashes) of the screen relative
    to the screen package.

  vars
    A dictionary of key/value pairs that you want included as hidden variables
    on the form.

  This is a wrapper around aquarium.widget.HiddenFormFields_ that adds any
  hidden form fields Aquarium needs to use such as: ``sid``, ``screen``, etc.
  You should probably use this method everytime you generate a form.

``whichScreen(self)``
  Which screen does the user want to view?

  Return the module name (i.e. use dots, not slashes) of the screen
  relative to the screen package.

  Alternatively, advanced users may return a tuple
  ``(moduleName, screenArgs, screenKargs)``.

.. _aquarium.widget.HiddenFormFields:
   aquarium.widget.HiddenFormFields.HiddenFormFields-class.html

"""

__docformat__ = "restructuredtext"

# Created: Mon Mar 29 15:55:47 PST 2004
# Author: Shannon -jj Behrens
# Email: jjinux@users.sourceforge.net
#
# Copyright (c) Shannon -jj Behrens.  All rights reserved.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.