cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@cocoon.apache.org
Subject [Cocoon Wiki] New: XfolioParamsOnStart
Date Sun, 17 Oct 2004 09:09:40 GMT
   Date: 2004-10-17T02:09:40
   Editor: FredericGlorieux <frederic.glorieux@xfolio.org>
   Wiki: Cocoon Wiki
   Page: XfolioParamsOnStart
   URL: http://wiki.apache.org/cocoon/XfolioParamsOnStart

   A little sitemap trick to set parameters

New Page:

[[TableOfContents([3])]]

= WHAT =

An application usually needs parameters. 
There's lots of solutions, to pass a key:value list. 
But, have you ever tried to make real world user (not sysadmin)
to edit file.properties, or change their environment variables ?
For common users, the best is to have a simple webform.
The problem is, do we want to code an heavy security policy, with 
profiles and so on ? And for the user, it's one more password to 
remember, an interface to understand... 

The idea is, don't add one security layer more. For your app, you are quite 
sure that the server admin have rights to start your app. But, your app will not
run till some parameters are provided, first page will be a form to fill in.
After the first start, these parameters could also be written somewhere, so that it 
will run for further restart of the server.

= WHO =

 [FG] FredericGlorieux http://ajlsm.com

= STATUS =

First draft of a text explaining a logic already implemented in an app.
Will be used as javadoc, and dev guide.

= HOW =

The idea is to have an universal matcher before all your pipes.
In it, there's an action checking if parameters are valid.

 * If parameters are OK, process will continue.
 * If parameters are needed, you will have a very simple xhtml form, 
 providing your key:value with their displayable explanation.
 * On submit, your parameters will still not be setted, the action
 will do the job to extract what it needs from the request.
 * If it's not enough (validation), back to the form.

You can implement a more complex way to display the form, for example aggregating
your own "status generator" of your app (very useful for debug), providing somme error messages.

{{{
      <map:match pattern="**">
        <map:act type="ParamsOnStart">
          <map:generate src="adminForm.xhtml"/>
          <map:serialize/>
        </map:act>
      </map:match>
      <map:mount check-reload="yes" src="app.xmap" uri-prefix=""/>
}}}


= WHY =

Where to get parameters ?
 * OS Environment variables
 * JAVA system variables
 * compilation variables
 * file.properties
 * Sitemap parameters
 * Servlet context parameters
 * Session user parameters
 * Request user paarmeters

How to use them
 * JAVA access
 * Sitemap acces (InputModules)

= CHANGES =

 [[Date(2004-10-17T09:09:38Z)]]:[FG] Creation


= REFERENCES =

More links to come.


= SEE ALSO =

Generated links

|| '''cited by'''     || '''about xfolio''' ||
|| [[FullSearch()]]   || [[PageList(xfolio)]] ||


Mime
View raw message