[Archetype JavaScript Framework] Fraking Doxia !

3 views
Skip to first unread message

TeMs@

unread,
Feb 28, 2009, 8:07:16 PM2/28/09
to archety...@googlegroups.com
Since the early start of archetypejs.org, we use maven to generate the static main website.

While we're in the documenting phase of the 0.10 (don't wait to try it ! I think we'll release a beta this week as the main code has been almost freezed weeks ago), we're also reshaping the website and reviewing our documentation.

My goal today was to achieve a carroussel for the main Archetype features on the home page giving more space to other informations like who uses Archetype, and so on. However, Doxia, the system under the hood of our website has just some particularly annoying behaviors regarding our xdoc documents. In fact, it just removes our "class" attributes of at least most of the interesting html elements.

Why adding class to html elements is so important to us now ? Beacause we want to do a "web 1.5" website (before a full "web2.0", for one of the next site release), and we were planning to use an element class based strategy to retrieve graphical components to load dynamically for the current page... for example, a Carroussel ! This strategy has been successfully used on http://france.meteofrance.com and is easy to use, while not very intrusive and quite clean.

Here is a snippet to retrieve components that have to be loaded on a particular page, in the page controller, that work both using Jquery or Prototype as Archetype engine :

Archetype.requireComponent($$(".archetype-component").collect(
function(o){
return $A(o.className.split(" ")).findAll(
function(c){
if(arguments.callee.c=="archetype-component")
return true;
arguments.callee.c=c;
return false;
})[0];
}));


And here's an example how to load a component(component name has to follow directly "archetype-component" to work):

[...]class="archetype-component ArchetypejsOrg.component.Carroussel"[...]


I still have to check that it works for multiple components because of the fun "arguments.callee" use for storing the latest class used, and that it doesn't break in any browser as using "." is quite bad (meteo's version was using "-" instead, could be a neater solution).

So what will we do to circumvent the problem ? We'll probably get the xdoc document as html documents and use doxia only for the dynamic parts of the website and some particular pages... but it will be a little longer to move rather than keep it like this. The solution will probably be to make a beta or RC of the 0.10, without the whole new website, but with a website containing almost the same thing :)

--
Envoyé par TeMs@ dans Archetype JavaScript Framework le 3/01/2009 02:29:00 AM
Reply all
Reply to author
Forward
0 new messages