672329 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 14 Messages: 14 Messages: 14 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Skin Web applications using Xkins

Posted by: Guillermo Meyer on October 26, 2004 DIGG
You can use Xkins along with other UI frameworks, such as Struts and Tiles. Here, I walk you through an example application that needs two skins and illustrates how to add a unique skin to it.

A skin refers to a user interface's appearance; it gives a Web application a different look and feel. A skin changes the way the user interface appears when a user clicks a button, but does not change the UI's behavior. A change in the skin thus results in a change to an application's appearance, but to achieve that modification, your Web application must know how to use a skin.

Read the full article at Skin Web applications using Xkins

It is interesting to compare this to SiteMesh. One of my frustrations is to see a lot of CDATA, embedding HTML in an XML skins template

Threaded replies

·  Skin Web applications using Xkins by Guillermo Meyer on Tue Oct 26 17:37:02 EDT 2004
  ·  Or you could just use webwork by jelmer kuperus on Wed Oct 27 12:34:55 EDT 2004
    ·  Or you could just use webwork by Aapo Laakkonen on Wed Oct 27 12:41:47 EDT 2004
      ·  Or you could just use webwork by Tommy Hellstroem on Wed Oct 27 12:58:58 EDT 2004
      ·  and the winner is ... by bad mASH on Wed Oct 27 14:13:46 EDT 2004
        ·  CSS, XSLT and XML by Fini Alring on Fri Oct 29 08:07:48 EDT 2004
          ·  CSS, XSLT and XML by Brian Miller on Fri Oct 29 12:11:10 EDT 2004
    ·  Or you could use web standards by java user on Wed Oct 27 12:58:42 EDT 2004
    ·  webwork. Not The same Skin by Travis Berthelot on Thu Oct 28 03:01:58 EDT 2004
  ·  Skin Web applications using Xkins by John Corro on Wed Oct 27 14:39:44 EDT 2004
    ·  Skin Web applications using Xkins by Guillermo Meyer on Wed Oct 27 15:10:35 EDT 2004
  ·  Skinnig with Millstone by Marc Englund on Thu Oct 28 03:23:12 EDT 2004
  ·  All Ways of Skinning a Cat by Travis Berthelot on Thu Oct 28 03:42:26 EDT 2004
    ·  All Ways of Skinning a Cat by Guillermo Meyer on Thu Oct 28 07:18:21 EDT 2004
  ·  Skin Web applications using Xkins by Guillermo Meyer on Thu Oct 28 07:26:23 EDT 2004
  Message #144077 Post reply Post reply Post reply Go to top Go to top Go to top

Or you could just use webwork

Posted by: jelmer kuperus on October 27, 2004 in response to Message #143974
http://wiki.opensymphony.com/display/WW/Webwork+2+skinning

xskins seams painfull

  Message #144080 Post reply Post reply Post reply Go to top Go to top Go to top

Or you could just use webwork

Posted by: Aapo Laakkonen on October 27, 2004 in response to Message #144077
Or you could just use CSS Zen Garden, :-): http://www.csszengarden.com/

  Message #144082 Post reply Post reply Post reply Go to top Go to top Go to top

Or you could use web standards

Posted by: java user on October 27, 2004 in response to Message #144077
Generate semantic xhtml from your webapp, and use css to control the page design and layout. See The Web Standards Project.

  Message #144083 Post reply Post reply Post reply Go to top Go to top Go to top

Or you could just use webwork

Posted by: Tommy Hellstroem on October 27, 2004 in response to Message #144080
+1 for CSS!

+1 for painful!

/Tommy
VisionProject
Bugtracking made simple

  Message #144092 Post reply Post reply Post reply Go to top Go to top Go to top

and the winner is ...

Posted by: bad mASH on October 27, 2004 in response to Message #144080
CSS Zen Garden http://www.csszengarden.com/

I can't imag'ne moving my struts application UI to another framework --xkins , webwork or whatever . CSS can be fitted into existing jsps. But of course, one size does not fit all !

  Message #144098 Post reply Post reply Post reply Go to top Go to top Go to top

Skin Web applications using Xkins

Posted by: John Corro on October 27, 2004 in response to Message #143974
Developing cross browser CSS can be a real pain in the behind, but it appears using this framework might be even more painful.

  Message #144106 Post reply Post reply Post reply Go to top Go to top Go to top

Skin Web applications using Xkins

Posted by: Guillermo Meyer on October 27, 2004 in response to Message #144098
In fact, skinning an application is a real pain. Xkins is an option for doing this, but certainly not the only one.

In Xkins you have the "pieces" of the UI in templates, and by pieces I mean for instance a "frame" or a "button" or a "title", etc.

For example in skin A, a "title" could be:
<div class="myTitle">This is my title</div>

And in Skin B:
<table><tr>
<td><img src="/top.gif"/></td>
<td>This is my title</td>
<td><img src="/bottom.gif"/></td>
</tr></table>

Here, the HTML is completelly different and Xkins solves this scenario.

But if you don't need this huge skin change, just using CSS (myTitle) is enought. It really depends on the customer requirements and your skinning capabilities needs.

We use Xkins in a large project with four skins, and one of them has no images for a lightweight skin and the others has images and different look&feel and HTML. In this application, there are a lot of enterprises working in the same system and each one has their own graphical design and we have to fit in each one corporate image. Xkins gives us the flexibility to do this without restricting the corporative image and look&feel. And if a new Skin is needed, we just extend an existing one and change the templates to fit to the new skin look&feel.

Regards.
Guillermo Meyer.

  Message #144175 Post reply Post reply Post reply Go to top Go to top Go to top

webwork. Not The same Skin

Posted by: Travis Berthelot on October 28, 2004 in response to Message #144077
http://wiki.opensymphony.com/display/WW/Webwork+2+skinningxskins seams painfull

Oh great now I can have 50 different versions of my jsp. This is really for request type and not styling. Not that Webwork is not a great project.

  Message #144180 Post reply Post reply Post reply Go to top Go to top Go to top

Skinnig with Millstone

Posted by: Marc Englund on October 28, 2004 in response to Message #143974
Since everyone seems to be mentioning their personal favourite skinning technology, so I thought I'd bring my 2c:

Millstone ( http://www.millstone.org ) comes with advanced skinning support -- or more specifically the Millstone WebAdapter (since Millstone is not limited to web use), and they are called "themes".

Though implementing a complete theme from scratch is a rather complex task, customizing a theme to suit your needs is not: the "themes" are extendable -- you can inherit the default theme, and just change the parts that you want. You can also apply a "style" to some component instance to adjust the look&feel of that particular instance.
The themes are implemented in xsl files (plus .css, .js, etc), arranged in a hierarchical manner, so it's quite easy to modify a particular component. Of course you're in trouble if you're allergic to xsl ;-)

The documentation about "theming" Millstone is somewhat limited currently, but you should be able to get the hang of it by looking at existing themes. Hopefully there will be a tutorial available soon.

  Message #144181 Post reply Post reply Post reply Go to top Go to top Go to top

All Ways of Skinning a Cat

Posted by: Travis Berthelot on October 28, 2004 in response to Message #143974
Lets review the most common ways to skin:

* CSS By Itself
* Formatting Objects - XSL-FO
* Request Type Styling - WebWork 2
* XSL + XML Transform with request type and style setting
* Custom JSP Styling Tags - Struts, JSF, XSkins, WebWork 2 and many more
* And More and I thought the MVC market was flooded

CSS is basically only simple style for html.

FO is like JSP styling tags in xsl. Oh goody more presentation tranformation.

Request type styling requires a whole bunch of presentation pages whether its jsp or other. Really suited for choosing response type like wml or html and not style.

XSL + XML requires a bunch of custom presentations, but very flexible. Although, no set standard structure.

Custom JSP Styling Tags. Basically a presentation converter.

I personaly have stayed away from Styling tags. From experience I can say that using any combination of all types is possible, but be prepared to make changes moving between them. I like power and control over everthing so I use XSLT and generate most of my JSP pages. XSkins looks a like just another entry. If your new just start using one and get to work. After a while you will realize they are all mostly the same.

  Message #144207 Post reply Post reply Post reply Go to top Go to top Go to top

All Ways of Skinning a Cat

Posted by: Guillermo Meyer on October 28, 2004 in response to Message #144181
Xkins encourages you to split your UI in pieces. This can be compared to an abstraction of your UI. This abstraction consists in the different templates and elements that compose your Skin (SkinType in Xkins). XkinsForms is an example of an abstraction of UI that have forms, buttons, fields, rows, etc.
In each skin, you implement this abstraction, and you can use inheritance and composition between skins. This helps you to identify the UI parts and reuse them, avoiding duplication. Xkins framework is based on this concept. You can extend XkinsForms and add your templates to this abstraction for your UI (you can add branding parts, help elements, etc. that are not contained in XkinsForms, so you are here defining a new SkinType for your application).

So your JSP pages do not use HTML tags nor CSS styles, but use this abstraction through Custom Tags.
JSF (Faces) use renderers to do this, and Xkins can be used in the renderers to generate the HTML. XkinsFaces is a starting point of this concept.

Xkins is not excluyent to CSS. You can use Xkins along with CSS. But if for example in one skin you want to add a flash object to a piece of your UI, with Xkins this can be done.

Xkins can also be used out of the web environment (for example in a Service or in an EJB) to process templates (as a facade of other templating tools)

Skinning web apps is difficult and we have several ways to achieve this. Xkins is one alternative and certainly not the only one. And each alternative has its pro and cons. You should decide according to your needs and customer requirements, and having in mind what are these pro and cons in each case.

Regards
Guillermo Meyer

  Message #144209 Post reply Post reply Post reply Go to top Go to top Go to top

Skin Web applications using Xkins

Posted by: Guillermo Meyer on October 28, 2004 in response to Message #143974
It is interesting to compare this to SiteMesh. One of my frustrations is to see a lot of CDATA, embedding HTML in an XML skins template

If you dont like CDATA[] tags in xml, you could use <content url="/youtTemplateFile.vm"/> so you can externalize yout templates out of the XML.

SiteMesh is a web-page layout and decoration framework and could be used also to skin. SiteMesh intercepts the HTML generated by the JSP and decorates it. Xkins generates the HTML in the first time. You can use Xkins along with SiteMesh, because they do not overlap.

Cheers.
Guillermo Meyer.

  Message #144314 Post reply Post reply Post reply Go to top Go to top Go to top

CSS, XSLT and XML

Posted by: Fini Alring on October 29, 2004 in response to Message #144092
CSS, XSLT and XML will do wonders for most skinning tasks.
I see no point in using a skinning api, especially if it is overly complex.

  Message #144346 Post reply Post reply Post reply Go to top Go to top Go to top

CSS, XSLT and XML

Posted by: Brian Miller on October 29, 2004 in response to Message #144314
CSS, XSLT and XML will do wonders for most skinning tasks.I see no point in using a skinning api, especially if it is overly complex.

Agreed. Context-sensitive skinning is what drove the maturation of IE's MSXML. I wonder if there's anything a servlet skinning API can do that CSS+XSL can't? XSL is the only skinning facility that is tier neutral; it can run on either the client or the server.

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 2

Reza Rahman continues to explore the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (January 21, Article)

Ted Neward Q&A: What you must know about JavaScript, Scala and more

Ted Neward is an independent consultant specializing in high-scale enterprise systems, and an authority in Java and .NET technologies. He is the author and co-author of several books, including Effective Enterprise Java. At TheServerSide Java Symposium in March, he will be presenting sessions on pragmatic architecture, ECMAScript and Scala. (January 15, Article)

Developers split on open sourcing Java

Now that Oracle is absorbing Sun Microsystems, there mixed views on what should come of the Java Community Process (JCP). While some say Oracle should become the new steward of Java and keep the JCP much as it was, others argue that it may be time to open-source this widespread language. (November 24, Article)

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map