On Sep 30, 2011, at 1:00 AM, David Blevins wrote: > > On Sep 15, 2011, at 2:29 AM, Jean-Louis MONTEIRO wrote: > >> FYI, I asked someone in my company to help us with the design of the new web >> site. >> If we could get something sexy to accompany the upcoming Apache OpenEJB >> 4.0.0, that'd be great. > > Was describing to Jean-Louis how the site works so he could hack on it. This > is not complete, but it's a start: > > The template is in velocity. It is "smart". It pulls in a few pages aside > from the page being rendered > > https://gist.github.com/1252966 > > Namely > > left > https://cwiki.apache.org/confluence/display/OPENEJB/Navigation > > top > https://cwiki.apache.org/confluence/display/OPENEJB/QuickLinks > > right (if such a page exists) > https://cwiki.apache.org/confluence/display/OPENEJB/{Page}Links > > Example of the right magically popping up: > > https://cwiki.apache.org/confluence/display/OPENEJBx30/Apache+TomEE > https://cwiki.apache.org/confluence/display/OPENEJBx30/Apache+TomEELinks > http://openejb.apache.org/3.0/apache-tomee.html > > We can change anything about the site or template. A big change to a simpler > site would be cool. We can get fancy later.
Did some more describing to Daniel on how things work. Here's a rough version of that: # Editing the Template An admin can change the template here: https://cwiki.apache.org/confluence/admin/autoexport/configuration.action You simply click the 'Edit Template' link and paste in the new template. # Viewing the output The space: https://cwiki.apache.org/confluence/display/OPENEJB The auto-exported version: https://cwiki.apache.org/OPENEJB Any time you change the template you have to use the 'rebuild space' functionality on the "autoexport/configuration.action" section in confluence. Once select the spaces and click 'rebuild space' it takes a minute or two to complete. # Synching to the website The auto-exported content from https://cwiki.apache.org/OPENEJB is synced to people.apache.org once an hour to a special 'autoexport' directory. It is synced from that directory to /www/openejb.apache.org/, also on people.apache.org, once an hour. Then finally /www/openejb.apache.org/ is synced to a completely different machine that serves the actual http://openejb.apache.org website. So once the template is changed you have a few hours before it shows up on the actual website. # Images, css and other content Even though we're not switched over yet, the CMS could still be used to hold all the images and css (everything but the velocity template itself basically). Anything checked in here: http://svn.apache.org/repos/asf/openejb/site/trunk/content/ Will sync to here within a few seconds or a minute: http://openejb.staging.apache.org/ # The Templates Some of this info is in the previous email, but here it is again. The velocity template: https://gist.github.com/1252966 The template uses the confluence autoexport API to pull pages. For example the left navigation is pulled into the page like this: #set($child = $pageManager.getPage($page.space.key,"Navigation")) #set($content = $renderer.convertWikiToXHtml($child.toPageContext(), $child.content).trim()) #set ($content = $content.replaceAll("^<[pP]>|</[pP]>$", "") ) $content The "right side boxes" for example is done like this: #if ($pageManager.getPage($page.space.key,"${title}Links")) #set($child = $pageManager.getPage($page.space.key,"${title}Links")) #set($content = $renderer.convertWikiToXHtml($child.toPageContext(), $child.content).trim()) #set ($content = $content.replaceAll("^<[pP]>|</[pP]>$", "") ) <div id="RightContent">$content</div> #end The interesting part is the if statement. Just sort of a 'by convention" way to get right side boxes on a page without needing more than one template It just looks for a FooLinks page when rendering the Foo page and includes the contents if such a page exists. -David
