You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Marcel Greter <mg...@swissonline.ch> on 2003/01/18 06:59:04 UTC

introducing a set of modules to create dynamic websites

Hello,

I'm from switzerland and I'm quite new to this list; greetings to all 
(mod)perl mongers ;-) I always were interested to write some stuff to 
produce dynamic websites easily. Therefore I firstly began to write perl 
  (mod_cgi) stuff to do this. But about a year a go I learned about 
mod_perl and fell in love ;-)

The last project I did was quite interesting and is still going on. It 
required a lot of work, so I decided to build it on top of a flexible 
framset. This work has evolved into a IMO fairly solid and good 
framework to produce dynamic websites and I would like to share these 
modules with the public.

I know there are allready some modules that provides ways to do simliar 
things, but (hopefully) my modules work a bit different. Basically I 
would like to know if there is some interest for these modules. It would 
be too much to write all features down here, but I want to give you a 
short overview :

Basically we have users, groups, session and repositories. Repositories 
are used to store files with user permissions. I first have to load/init 
those things within the handler and can then begin to generate the 
output. I use _one_ "taglib" method-call to do this. Basically it's 
quite the same like struts tags from java. That means you can do loops, 
ifs and more within your templates. This way you easily can implement 
logics within your templates. There are also ways to display dates, 
format input fields, display input arguments, etc. I also includes 
(my)sql support (with DBI) which can be "accessed" through special tags 
within your templates. Xapian is also included as the search backend. If 
you know html you should be able to "configure" the templates and the 
taglib calls and if you know perl you also can easily extend the taglibs 
to provide other/new features.

There are also methods to localize things (ie. date output) and a 
configuration "API" (you can easily "map" methods/variables to 
configuration options). I wrote many abstraction layers to get a 
flexible way to replace a certain way of ie storing data. With the 
config package you just need to load a config file rather then calling 
all config methods from all loaded packages yourself.

Also included is a wysiwyg editor to create html content. This also 
easily can be "personalized" by editing simple text files. It's not 
really a realtime wysiwig editor, but you fairly can estimate how your 
results will be; and if your flexlib files are ok, the content will be 
valid html :-) I was also able to do a flextag that lets you choose from 
adresses from a sql databse. This way you can configure a powerfull set 
of html fragmets your editors can use. This way you are also in control 
of the look of all fragments (ie. links or lists etc). But you can also 
limit you editors if you explicit define the input fields they can edit 
(this can be image, text or any other flextag).

There are a lot more features which would be worth to mention, but it 
seems to be too much. I allready wrote about 50 pages of documentation 
and if there is some interest I also would setup a website for this.

Maybe some interesting facts:
- one http process takes about 5MB at start and can grow up to 10-20MB 
(just for these modules, apache normally will take 3-5MB for himself).
- I use caching as often as possible. You can tell taglibs that they 
should use caching. Caching actually is implemented on file-system. I 
use /dev/shm/ so it's still within ram and doesn't need seeks.
- I have a page with ~4 sql statements and one "complicated" content 
file and ~50kb template code and ~100 tags. On a PII 300 celeron it 
takes 0.60 seconds to generate the first hit and after everything is 
cached 0.15seconds. I even do cache most sql statements and cache is 
also invalidated on updates :-)
- It is designed for mod_perl 1.x; don't know how much work it would be 
to port it to.
- there are actually 42 package files with a size of 631KB

You should know that some edges may not scale that well (yet?). 
Basically the user implementation seems not to scale that well (I use 
simple files on filesystem). Fetching memberlist seems to be really 
inefficient that way (do not know how well the OS can cache these 
things). The data for content (and other) files are designed to be xml 
files, but I switched to my own format which stores the same information 
as xml can (or at least as far as I need xml), but it's faster to read, 
maybe datadumper modules are even faster, dind't try that out yet. The 
whole thing still can be run under mod_cgi, and that maybe is why some 
things do not scale that well.

I know, the whole mail is quite confused as I mixed quite a lot of info 
into it. But basically I really just would like to know if there is an 
interest in such a thing. Maybe you even like to know some more details, 
so please ask :-)

I also can give you access to the developement site and if you like I 
could set nearly all code online within some days. But I think that I 
would need some more days to setup a "starter" package with some preset 
templates and users as otherwise you'll have some headaches setting up 
everything I think :-|

greetings, Marcel Greter