On Jun 18, 2006, at 5:53 AM, Aristedes Maniatis wrote:


We have a need to deploy a WebObjects application for (hopefully) 20-50 sites, possibly more. Each site will run as a separate instance (or two) but the application code is identical. Each application will be running as a separate Apache virtual host with different images, css, etc. The main difficulty we are having now is deciding how to manage and deploy the html. Although very many of the html pages will be identical (particularly the smaller components), the front page, the layout, and a couple of other pages may vary between the sites.

We have thought about some ideas:

* keep pages in the database which override certain html in the .woa. We need to write some code to check the database for relevant html upon each page request. * put the common pages and code into a framework and make changes in the .woa directly. Version control might get a little tricky. * have one project and code, but use subversion to maintain separate html repositories which get copied into the .woa when we deploy. No special deployment code, but some tricks to managing development processes.

Each of these approaches seem to have their pros and cons. Has anyone else had a similar challenge and found a successful solution?


One pretty standard trick is to override the method that loads the templates to load a different .html file based on values in the session.

That is, a .wo "file" is really a folder with:

   blah.wo:
      blah.html
      blah.wod

 There's no reason you can't do:

   blah.wo:
       blah.html <--- default, loaded if no override found
       blah.skin1.html
       blah.skin2.html
       blah.wod

Then you don't even need separate instances, just separate entry points. The .wod file is usually a superset of the requirements of all the .html files.

Another method relies on the fact that WebObjects will look for components in a certain order, so if the search order is:

   skin1
   main project

 Any .wo files in skin1 will be loaded over those in the main project.

 Finally, you can use the existing localization support.

In other sites, I've built a mini-CMS that allowed people to store HTML bits in the database, then the site would pull that HTML out and shove it here and there. That has its limitations, because it's more work to pull stuff out of a database, then have WebObjects parse it for WO tags.


 Pierce



WOTip: Set things to NULL when you're done with them. It makes the JVM happy, and saves you GC time later.
More Tips: http://www.twinforces.com



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list      (Webobjects-deploy@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to