Sohodojo logo
  Sohodojo Forums
  The Nitty Gritty - Executable Models and Internet Programming
  The dynamic static balancing act...

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   The dynamic static balancing act...
Jim_Salmons
Black belt
posted 05-28-1999 03:43 AM     Click Here to See the Profile for Jim_Salmons   Click Here to Email Jim_Salmons     Edit/Delete Message   Reply w/Quote
Some of what makes ZOPE a good platform for building executable business model frameworks also makes it a bad platform from a web presence standpoint.

The dynamically-generated pages of a model-driven website can be engaging to the human visitor. But such dynamically-generated sites are invisible to search engines which are the traffic-generating lifeblood of the small business website. Search engine robots, spiders and crawlers do not follow links which request dynamically-generated content. They look at static pages only.

A successful website will have to find a happy balance between dynamic and static content. A shell of static HTML pages will be used to promote visibility from a web presence standpoint. Keeping this static shell in synch with its underlying dynamic model is a challenge and an opportunity.

Jim_Salmons
Black belt
posted 05-28-1999 04:50 AM     Click Here to See the Profile for Jim_Salmons   Click Here to Email Jim_Salmons     Edit/Delete Message   Reply w/Quote
If you have dug around the dojo to any extent, you know we are dealers for the WebPosition site promotion application. It is a brilliant tool suite for planning, implementing and measuring the effectiveness of keyword-based search engine marketing strategies. This is a super tool. To reinvent or ignore it would be foolish.

We want to use WebPosition Gold as the Heads Up Display for crafting and maintaining the static shell of doorway pages leading to our underlying ZOPE-based dynamic website.

As you can imagine, programmatically spewing out a selective amount of your dynamic content to static files is a simple matter of programming. The trick is getting the "roll back into the underlying model" of changes made to the static pages, by the WebPosition HUD.

You might use WebPosition to tweak some subset of your static pages and things are going great in terms of generating traffic to your site. You don't want an update of the underlying dynamic content from which the static shell pages are generated to overwrite these tweak-improved pages.

Either we need to figure out how to implement an editing indirection, that is, we need WebPosition's Page Critic to look at the static pages but edit the underlying model.... or we need to have a mechanism for rolling back model state changes from the static pages into the underlying model.

The first approach is unlikely as it would require FirstPlace Software to collaborate in the definition and implementation of an open API for binding user-defined Page Critic editors. The second approach is more likely as the existing text editing capabilities of WebPosition don't care if there is XML content tagging in the page source or not. A static file change event could trigger a synchronization by the ZOPE-based underlying model.

Jim_Salmons
Black belt
posted 06-28-1999 10:17 AM     Click Here to See the Profile for Jim_Salmons   Click Here to Email Jim_Salmons     Edit/Delete Message   Reply w/Quote
Here is an excellent post from Evan Simpson made to the ZOPE Admin list this week. Evan outlines his solution for constructing combo static/dynamic sites using Apache and ZOPE.

Thanks, Evan, for sharing this with the rest of the ZOPE community.

======================
Message: 1
From: Evan Simpson evan@ tokenexchange.com
To: zope@zope.org
Subject: Zope Example: How I handle Virtual Hosts and mixed static/dynamic serving
Date: Wed, 23 Jun 1999 14:16:49 -0500
charset=iso-8859-1

I am serving a set of websites with different domain names from a single
server, using Apache (1.3.2)'s Virtual Hosts feature. For reasons too
irrelevent to go into here, I serve some URLs (mostly images and other
binary files) statically through Apache, and the rest from Zope. All
dynamic content is served from a single Zope server, from root folders each
of whose ID is the 'site name'. Most static and dynamic pages must be able
to refer to each other with relative paths, so I can't always distinguish
them by hostname, port, or URL prefix (the usual /Zope/ hack).

All pages, including those from Zope, must be reachable with URLs which end
in '.html', since the pages are being edited (and the links maintained) in
Dreamweaver, which uses Windows file extension associations (choke). On the
other hand, I don't want to have to go around making Zope objects with IDs
ending in '.html'

I came up with the following framework:

1. I can force a static URL by prefixing it with the 'site name'.
2. No Zope object has a period in its ID, so any URL with a period is
static and any without is dynamic (but see #3). The default homepage (a
bare '/') is also static.
3. In Dreamweaver, all dynamic pages end in '.py.html', but they're stored
in Zope with no extension. Apache strips all occurrences of '.py.html', and
hands the stripped URL back to the client.
4. A dynamic URL is automatically prefixed with the 'site name', unless it
already starts with '/Zope/' (for root access).

For the site named '4am', I have:

#1 and stop
RewriteRule ^/(4am/.*) /home/httpd/html/$1 [L]
#3, repeat and show to browser
RewriteRule ^/(.*)\.py\.html(.*)$ $1$2 [R,N]
#2 and stop
RewriteRule !^/([^.]+)$ - [L]
#4
RewriteRule ^/Zope/(.*) /$1 [S=1]
RewriteRule ^/(.*) /4am/$1
RewriteCond %{HTTP:Authorization} ^(.*)
# All on one line:
RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/$1
[E=HTTP_CGI_AUTHORIZATION:%1,E=ZOPE_RAW_URI:SCRIPT_URI,T=application/x-httpd
-cgi,L]

Now, one problem remains; Zope uses the path constructed by object traversal
to construct BASEn and URLn variables and to auto-insert BASE links. This
means that my framework causes 'http://4-am.com/parrot/is/dead' to have an
incorrect < !--#var URL--> of 'http://4am.com/4am/parrot/is/dead'. Following
multiple links could lead someone to something like
'http://4am.com/4am/4am/4am/4am/4am/parrot/is/dead'. I had to patch
ZPublisher to use SCRIPT_URI (indirectly, through ZOPE_RAW_URI) as follows:

In ZPublisher/Publisher.py, around line 360, find line 'URL=request.script'.
Directly after this line, insert:

rawURI=request.environ.get('ZOPE_RAW_URI')
if rawURI:
def cvtpart(part, envget = request.environ.get):
return envget(part, part)
rawURI=join(map(cvtpart, split(rawURI)), '')

then change 'setBase(URL)' to 'setBase(rawURI or URL)' around lines 380 and
460. Finally, directly before 'request['URL']=URL' (around line 570-580),
insert:

URL=rawURI or URL

This all *seems* to work just fine, although I may have missed a corner case
or two (do I need to worry about __bobo_traverse__, for example?). In case
the above is too abstract, here's some examples:
http://4am.com]http://4am.com / == static homepage
http://4am.com/images/squishfoot.png
http://4am.com/images/squishfoot.png == static image
http://4am.com/4am/images/squishfoot.png
http://4am.com/4am/images/squishfoot.png == same static image
http://4am.com/Zope/manage
http://4am.com/Zope/manage == Manage all of Zope
http://4am.com/manage
http://4am.com/manage == Manage '4am' folder in Zope
http://4am.com/manage.py.html
http://4am.com/manage.py.html == same
http://4am.com/Zope/4am/manage
http://4am.com/Zope/4am/manage == same

[This message has been edited by Jim_Salmons (edited 28 June 1999).]

All times are ET (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | The sohodojo home page


Ultimate Bulletin Board 5.45b