[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Re: directory structure and static pages


On October 27, 2003 08:30 pm, Mark Stosberg wrote:
> On 2003-10-28, Darin McBride <suppressed> wrote:
> > But of course, no CGI.  So all pages must exist on the server as static
> > HTML.  How does one create static HTML from dynamic content?
> >
> > I now use CGI::Application::StaticGenerator.  Which I would look
> > forward to comments on from other users of C::A.  You cannot find it on
> > CPAN - I would like comments first ;-).  You can, however, find it on
> > my ISP's webserver:
> >
> > http://members.shaw.ca/darin.mcbride/CGI-Application-StaticGenerator-0.01
> >.tar.gz
> >
> > If things go well with this, I will put it on CPAN later.
>
> Darin,
>
> This is an interesting idea. Here's some feedback:
>
> - The "static_filename" needs some more documentation. What is passed
> into the subroutine that I can use to construct a dynamic file name?

Fair enough.

> - I think the "dynamic" case may be used rather frequently. For
>   example, in "Cascade", It's designed to work in both "dynamic" and
>   "static" modes. In the static mode, it's possible to generate a lot of
>   static pages. Hundreds of pages are generated from just a few distinct
>   templates.

Depends on your needs - that's why there are so many modules with
similar themes doing significantly different things.  We have Net::FTP,
LWP, etc.

> To accomodate this, I would design your module to accomodate any
> possible CGI::App input as something that could influence the output.
> This would include all the parameters passed into an instance script, as
> well as the "query" object.
>
> I would also expect that "fancy" page names will want to be used
> frequently. For example, in Cascade all the category pages are using the
> same template. The page name for a category might be:
>
> "/Top_Level/Mid_Level/Category_Name/Index.html"
>
> The file name generation is complex. It involves putting together
> several category names and encoding them in a particular scheme.

Yes - I'm giving some flexibility to that end so far.

> You may enjoy looking at Cascade::Admin::write_static_pages to see how I
> tackled this. I now want to refactor this code to not use the global
> %FORM for CGI param data and make some other stylistic changes, but you
> get the idea.
>
> Cascade home page: http://summersault.com/software/cascade/

Looked too complex for me.  ;-)

> Overall, it seems like your module is targeted at a CGI::Application
> project that was designed to be rendered as a bunch of static pages. For

Well, that was my first project with it, yes.  Part of my problem is
that my pages refer to each other, and that's hard to do when sometimes
they should refer to "dynamic" pages (e.g.
"http://my.domain.net/app.cgi?rm=mode1";) vs "static" pages (e.g.
"http://my.domain.net/mode1.html";)  I'd like to figure out a good way
to do this, but it hasn't hit me yet.

> complex projects that may be rendered as dynamic or static content, I
> think I would still be inclined to cook up a custom solution.

I humbly offer this as a place to start, or at least get ideas from :-)

> It may also be worth nothing one of the standard website mirroring tools
> may play a role here. I don't use these frequently, but I believe tools
> like "w3mir" are good at creating a copy of a dynamic website and
> storing it as static pages.

Different problem space solved here.  In my case, I'm writing code at
home to put on my ISP's webspace.  I don't have access to a webserver
to host this on as an intermediary.  Or at least that's what I was
thinking of.  Of course, I should put some of this in the description
so that people searching cpan may be able to find it :-)


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.