• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF and Web designer

 
Andreas Oikonomou
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question that applies to more technologies than jsf but especially to jsf.

If you have a web designer that creates astonishing layouts written in html with a design tool or by hand,
can a developer convert the produced html to jsf - and if yes how can this be done - ,
or should the designer know about jsf from the beginning?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65518
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Expecting a designer to know something like JSF would be a real reach, in my opinion. Any web designer should be well aware of the capabilities limitations of the technologies being used, but to actually know that technology? Nope.
 
Andreas Oikonomou
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So is there an easy way for an html page to be converted to jsf?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65518
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to wait until someone who is JSF savvy sees this. Personally, I wouldn't touch it with a ten-foot pole.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF is an abstract Model/View/Controller architecture which happens to mostly be used in an HTML environment, but is not limited to only HTML.

In JSF 2, Views are defined in a View Definition Language (VDL, sometime seen as VTL), and although they are referred to as "xhtml" because that's the accepted filename extension, they aren't actually xthml as defined by the HTML standard group, but rather a Facelets template.

Although the core tagsets are mapped onto HTML, they are not literally HTML and therefore their characteristics vary from HTML in various ways, usually having to do with JSF's abstraction and its ability to do automated validation and conversion of data. For example, an HTML form has a submit type (commonly GET or POST), but JSF's "h:form" does not - JSF's form submit process is a specialized type of POST with associated meta-data, without exception. Likewise, you don't have "input type=" text controls, you have discrete h:inputText and h:inputHidden controls.

At an even more extreme level are the truly abstract constructs like dataTables. Not only is the actual iteration mechanism completely abstracted out (a dataTable functionally isn't a loop, it's a 2-dimensional static object), but there are no row/column marker tags a la HTML, but rather an abstract row prototype containing column information if/as needed. The actual cell is a single JSF control and therefore needs no explicit cell delimiters (td tags). More frustratingly, the core datatable and panelgrid objects don't support row or column merging (spans), You have to get your "span" effects by building up from sub-table elements.

Trying to automatically convert raw HTML to abstract JSF, therefore is not unlike the process of taking binary code (assembly language) and reverse-engineering it to a high-level language. In a general way it's usually possible, but it's never as elegant as the original and you can expect frequent breakage in the process simply because hand coded HTML can be much more variable than machine-generated stuff and therefore the number of surprises can be truly large.


On the other hand, like I said, JSF is designed to be abstract and one of the characteristics of that abstraction is that the appearance of the View is done - wherever possible - via CSS instead of the unholy mix of CSS, HTML and sometime other things that hand-designed HTML web pages often are. And the total number and visual layout of the JSF tags is actually quite a bit less than HTML, unless I mis-estimate. The idea is that an app designer could be passed a general page layout, build the JSF page, then pass the JSF view template to a visual designer who can add class elements, skins, possibly spin off variants (for example for mobile devices) and, if necessary re-arrange elements to make them less hideous. The visual designer doesn't need to know how tags function in detail and in fact, probably should be doing little or no JavaScript (JSF does a lot of JS under the hood anyway, so there's less need of it to begin with).

This isn't an accident. Sun intended that webapps could be constructed like on Henry Ford's assembly lines, where specialists each owned a stage in the process. Unlike the 21st Century approach which is to fire all those "useless extra people" and make one person be both the graphics design expert and the programmer. And if you'd ever seen what my artwork looks like....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!