Hi all
Fist of all, sorry for my bad english...
We "think/found" a technic to manage user action through a web
interface. And I like to know your opinion about it.
The goal is to trigger actions through the server without using cgi ( or
mod_perl ) fake pages.
The actions are managed by a Content Handler on a location:
<Location /action>
An example is better than long ( bad writen text ) so:
/action/Client/Add
Is parsed to obtains an object type ( "Client" ) and an action to
perform ( "Add" )
$object = "Client"
$method = "Add"
and posted data are read in $fdat ( hash table ref )
Then a perl package is found regarding the object type.
$package = MyNameSpace::Client;
An the action is called on that package.
The problem we have was that we wanted the handler to be able to call
any function available on any authorised package, whithout using a
dispatcher
with a long
if() {
}elsif(){
}elsif(){
}else{
}
To sumup, here want we are doing:
1: parsing URI, to obtain a package and a method
2: look if action is allowed on that package, by this user ( with a
session management ).
3: build a string $str = 'MyNameSpace::Client->Add( $session, $fdat
)', $fdat are the data posted throught the handler
4: calling $return = eval $str.
5: find a redirection page for that ( package, action, result )
That all, it's work fine and it's allowing to call package/object methods whithout
having fake pages to maintains.
Comments are very, very welcomes
--
Don't be irreplaceable, if you can't be replaced, you can't be promoted.