"John D. Leonard II" wrote: > > All: > > Has anyone created "cool" ASP mini-applications (or applets) for inclusion > within larger Apache-ASP applications? For example: banner rotators, > threaded message boards (with or without DBI), directory locators, > on-the-fly directory thumbnail generators, etc. > > The ASP model is pretty cool, but I'm finding that I'm constantly writing > these simple-type apps from scratch. I think that it would be great to > begin to compile a list of these mini-apps, and begin to address the problem > of how to efficiently re-use these applets across web sites, and how to > design new ASP sites to better take advantage of this code base. > > Perhaps we can collect these applets and include them in Joshua's "Examples" > page, or even create a new section titled "Helper apps." >
I like this idea, and believe that there could be a useful applet section that could demo these. There should be some "standard" that people should create these applets with, and I do not think the sample apps section in the distribution would conform to these standards. The applets as you describe should be sub-applications, and fully mixable with a parent Apache::ASP application where you could just <% $Response->Include('helper.inc'); %> and that would be that. To make an applet then I would suggest some guidelines: - no global.asa usage. Applications get to use global.asa to control global web application behavior. Applets must be reusable site to site so must not need to override global web application behaviour. - documented via perldoc Apache::ASP::Applet::$Name - approved / registered namespace, a perl package might look like Apache::ASP::Applet::*, with XMLSubs looking like <applet:* args=/>, files looking like applet/$registered/files*, and PerlSetVar configs like Applet$Registered$Key $Value As an example then for the WebForm applet perl module Apache::ASP::Applet::WebForm xml sub looks like <applet:webform args="" /> applet include applet/webform.inc or applet/webform/main.inc custom config PerlSetVar AppletWebFormAutoRender 1 Thinking on this some more, I am not sure that applets should create the own XMLSubs namespace, because that would necessarily affect the global XMLSubsMatch directive, and one rule would be to not affect global app settings. So to support the notion of applets in this way, it may be that we have an auto applet XMLSubs loader created configured with: PerlSetVar XMLSubsApplet 1 which might behave similar to a yet to be created config: PerlSetVar XMlSubsMatchFile applet::[\w\:]+ Which would automatically create an XMLSubs for the <applet:*> namespace, and each function would automatically map to loading the file of the same name like: <applet::webform /> $main::Response->Include('applet/webform.inc', $args, $html); <applet::webform::db /> $main::Response->Include('applet/webform/db.inc'); To support this notion better, it may be that we start to have include files loadable from the perl library tree, such that all applet files could be installed under $perllib/Apache/ASP/applet/* To this end, we might have a runtime path search for where Apache::ASP is installed, and add that directory to the IncludesDir path temporarily. Any more thoughts anyone? --Josh _________________________________________________________________ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com 1-714-625-4051 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]