Skip to main content

A Multi-templating System : what does it mean for you?

Posted by lamine_ba on November 12, 2011 at 2:25 PM PST

 

For prosperity to be sustained it must be shared.
thegatesnotes

Introduction

Ladies and Gentlemen, today, while I'm writing this blog post, I'm one-eyed. I woke up last saturday, earlier in the morning, and noticed that I couldn't see out with my right eye. Then, I went to see an ophtalmologist to find the cause and the solution and now I'm taking drugs. I did have the strong desire to share with you this crazy experience because it has teached me something : That life is all about having the right vision. I have built a Multi-templating system inspired by Joomla's, the most popular CMS in the PHP world, to correct a mistake that Java EE and its web frameworks are doing ever since. Why are they putting the front-end devolopers aside? Why Java EE has the ugliest user interfaces I have ever seen? Why most of the web sites are Php-based ? But maybe soon, we will have the great chance to discover it through the words of Akintayo Abiona Olusegun, a nigerian developer who has converted his PHP application into a JSF application. "I did decide to use JSF not because I have any particular problems with PHP, No. The website needs a facelift and since I have just studied JSF and all the goodness, I decided to use JSF. Primefaces is also one of the things that help my decision. Most of the things I have to write css and/or javascript (or look for plugins upon plugins for jquery) are made very easy using primefaces. Java EE 6 was the icing on the cake. It is really now very easy to do a Java EE APP compared to say 5 years ago. Here in Nigeria, the predominant web design language is still PHP though. A few people use java for web really, Most people just either use PHP or ASP.NET. The reason is because hosting a Java APP is still very expensive and most of the independent Java developers I know can't afford it. But Java is still the most popular programming language, ALL the companies I know use Java somehow. The biggest companies here (telecoms, oil and gas and banking) are all using Java and Oracle tools, so to get a Job in these companies, Java knowledge is a MUST. But a very high percentage of the freelancers I know use PHP for web...

Let's meet in the Cloud

But soon such will not be the case because a metamorphosis is happening and depending on the perspective you are, it means these things for you. Like for Joomla and PHP, JAX-RS and the Java EE world are moving towards a worldwide collaborative development. A JAX-RS web developer will no longer create the user interface of his web application from scratch, he will just download a template from the web and hop he will be ready to go. But will a Multi-Templating system be enough to fulfill this dream if we are still unable to answer these two following questions?

  • From a web developer perspective : Where can I find templates?
  • From a web designer perspective : Where can I publish free and commercial templates to make my own business?

And to have this marketplace where we can connect to push Java EE to the next level, we are planning to collaborate with a Cloud provider. And who knows, maybe soon, we will have the great honor to meet in the Cloud....

Templates

  1. Carligian
  2. Cartion
  3. Archange
  4. Moanes
  5. Via Granitti
  6. Story of Glory
  7. Arlqueens
  8. Cimmanon
  9. Toodnen
  10. Platine45



twitter : lamine_ba

 

AttachmentSize
video5.PNG457.64 KB
video6.PNG246.65 KB
video1.PNG456.16 KB
video4.PNG476.11 KB
video2.PNG454.58 KB
video3.PNG371.68 KB
Related Topics >>

Comments

Hi bro, hope my message find you in good heath that allow ...

Hi bro, hope my message find you in good heath that allow you to continue to solve a big problem in JavaEE. This blog has very nicely explained. JSF2.2+PrimeFaces will biggy improve the development web in JavaEE platform. I still believed JSF and i continue to believe it, because it will be the solution.
Regards!!

Hi papesdiop Thank you very much for your nice comment and ...

Hi papesdiop

Thank you very much for your nice comment and I appreciate your prayer. Yes, continue to believe in Java EE and JSF. Having a bad start in the starting-block does not mean you cannot be the winner of the race. The JSF community, you included, is currently doing an amazing work. But more are coming. Hope to read you soon.

Regards
Lamine

Good day,  This is a really awesome idea and it has my ...

Good day,

This is a really awesome idea and it has my vote to be included in the JSF spec. I wonder if it would be possible to have the templates externalized from the actual WAR file which has a number of advantages.

Regards,

Mark P Ashworth (http://mpashworth.wordpress.com)

Hello Mark, First of all, thank you very much for your vote ...

Hello Mark,

First of all, thank you very much for your vote and for your clever comment. Yes, having the templates externalized from the actual WAR file has a number of advantages and that is a part of a topic I have called : " The deployment scenarios ". When I have built the prototype of this Multi-templating system, I have covered and solved this problem at last. I was waiting just for people to understand the idea and I'm really glad they did it. Let's me share with you now the different deployment scenarios available to us so that you can choose the right one depending on your needs.

  1. First scenario : you have stored your templates in a directory in the war file. Can we call this : " the evident and non-efficient way ". With this model, how one can share his templates among his JSF applications?  Surely with a copy and paste? The use of this model will lead to a lot of duplication. And when a developer downloads his templates from the web on his computer, he stores them already in an external directory. So why can't he just reference in the web.xml the location of this directory to have the templates loaded by any of his JSF applications? That is one solution but it means these things for you : you are working alone and your applications are running in a local mode. And when you deploy your JSF application in a remote web server and the templates are still in your local external directory, you must also upload this directory and make the right change (location) in the web.xml. But at least, using this solution, you have a central place and any of your JSF applications hosted on this remote web server can share your templates. Thus you have no resources duplication.To finish, when you are collaborating with a team using this solution in the development of a JSF application, my suggestion is to create first a svn or a git repository for only the storage of templates.
  2. Second Scenario : Here is another cool way to externalize your templates. Did you know that you can use my own templates without having them installed on your computer? How I did that? I have a template service built with JAX-RS available worldwide. You can see it in action in my prototype. My JSF applications are using these templates remotely because each template has an url  and I can reference one of them in my web.xml. And after that, I let the two entities (JSF and JAX-RS) to talk and make my will. And with this solution I can build another template clients like an android client to view my templates on my phone. cool, no?

JSF and JAX-RS playing seamlessly

 If you find another deployment scenario, It would be nice if you can share it to us. I have also the project of an administration console so that you can manage easily your templates and set the default one at runtime without the use of the the web.xml file so that you can avoid a restart of your application and a waste of your precious time. At last, I think that you will be the guest star of one of my next blog posts because many people will not read your clever comment and my reply. Thank you again Mark

Regards
Lamine

 I concur. Having the template outside the war file ...

I concur.

Having the template outside the war file means you can change the LAF of your page without having to recompile the whole app. This would be very advantageous. I think this would be also be easy if one can link to the template using say href. Right now what I do is host my images and css file in apache, so that I can change the images and css files easily to change the LAF of my web page without having to recompile/re-deploy.

Thanks Lamine.

Hi trinisoftinc, Thank you very much for your nice comment. ...

Hi trinisoftinc,

Thank you very much for your nice comment. Yes, Having the template outside the war file means you can change the LAF of your page without having to recompile the whole app and this would be very advantageous. And you can be sure that you will have it. Please read my reply to Mark or wait for my next blog post. Regarding your statement "I think this would be also be easy if one can link to the template using say href", Let me reveal you that we have already this feature and it working pretty well on my prototype. We call it "Dynamic Template Selection". You can change the LAF of your application while navigating to another page of course if your add in the url the id of the template you want to use as a request parameter following this scheme : http://server/app/page.xhtml?template=id. Please see it in action in my prototype . Thanks

One page using dynamically three different templates

  1. http://jsfmtsystem.appspot.com/faces/templateDetails.xhtml?template=tbc_xen
  2. href="http://jsfmtsystem.appspot.com/faces/templateDetails.xhtml?template=pinkkitty
  3. http://jsfmtsystem.appspot.com/faces/templateDetails.xhtml?template=rockstar

Regards
Lamine

hi all .  i ask what it is El resolver into ...

hi all .

i ask what it is El resolver into JSF .

I study JSF self me and i not understand .

Tank you all.

naciu

Hi naciu45 I'm very glad to hear that you are learning JSF ...

Hi naciu45

I'm very glad to hear that you are learning JSF and I like very much your approach. When you want to have a clear understanding of something, you must always try to understand first its concepts. Google can be your best friend in your learning process, just type what you are looking for in the input text or you can consider to buy a recent JSF book covering the 2.0 version of JSF. I recommend you "JSF 2.0 the complete reference" from Ed Burns. But here are some links I have found in the web. Try first to understand what is an Expression Language (EL) and after it will be very easy for you to understand what is an EL Resolver. These concepts were first introduced in JSP. 

Thanks
Lamine