Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I've got a bit of a problem with my web application and a CGI::Application framework.

let me explain a little.

I've written a module based on CGI::Application, and every other module i use inherits from it (ie when writing another module i do 'use base CGIA::Replacement'; )

My web app has "registered" users (ie users that will log in via the website, session stored in the database etc etc). Each user belongs to a group, and that group has specific attributes.

My goal is to create (from a dev/admin POV) a "My Website" framework, where i can just program another module, add it to the $path, update a database table and the content/functionality will be automatically added to the greater application.

Now (bear with me a bit while i share some detail), i've got a database table that maps a group with a feature (for example "upload file"), and (for the sake of normalisation) i have a mywebsite_feature table that maps a library to that feature.

From this setup i can dynamically pull in (at run time via require) whatever libraries are associated with the group of the user logged in. With a "special" method in the library, i can return the method(s) i would like the application to access (such as showTemplate(), or storeFile() )

what i'm having trouble with is the mechanics in accessing the dynamically added runmode.

so, in summary, what i want is a CGI::Application based module that will dynamically use other modules and dynamically add run modes based on the output of a "special" method in the dynamically loaded module.

in closing, i have two remarks:
1) i cant but help think this is quite a messy approach to doing this

and

2) (disclaimer) i've been working at this for hours now, and perhaps cant see the wood for the trees

If anyone has experience in doing this, or suggestions on how it could be done better, i would love to hear it.


In reply to CGI::App dynamic runmodes/modules by Ryszard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (None)
    As of 2024-04-18 23:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found