I have some good news about the archetype's compiler : I've decided to totally changed my way. Like the archetype's core is able to resolve dependencies itself, it's a good idea to use it in the compiler.
I look at HtmlUnit (http://htmlunit.sourceforge.net) which models a browser in a Java programs. With it, I can execute archetype and get back variables of the configuration from the browser's memory. I also use a system of javascript's alert, present only in the compiler, in order to obtain the good sequences of modules and components.
So, the bundle of the modules is done and I currently work on components. I also think about some solutions to merge css and templates.
I change my mercurial hosting and you can get a development version here : http://bitbucket.org/Zed/archetype/. This one is able to bundle modules, components and soon templates.
lundi 9 mars 2009
dimanche 1 mars 2009
Fraking Doxia !
Libellés :
Archetype,
Archetype Javascript Framework,
archetypejs,
doxia,
Maven,
meteofrance,
portlet,
site,
snippet
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 :
And here's an example how to load a component(component name has to follow directly "archetype-component" to work):
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 :)
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 :)
Inscription à :
Messages (Atom)