5 Replies Latest reply on Apr 3, 2009 4:56 PM by Jay Balunas

    Richfaces themes: tooling support for new themes creation

    Nick Belaevski Master

      RichFaces 3.3.1 will support new feature called "themes".

      More information can be found in the following forum threads: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=152000 and http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151615&postdays=0&postorder=desc&start=0

      Let's discuss how would developers create their own themes. We've decided that tooling support for new themes creation will be based on Maven. There are two different options.

      1. Maven archetype

      Common approach widely used in Maven.

      a) Commands necessary to create new theme

      mvn archetype:create
      -DarchetypeGroupId=org.richfaces.cdk
      -DarchetypeArtifactId=maven-archetype-theme
      -DarchetypeVersion=RF-VERSION
      -DartifactId=ARTIFACT-ID
      -DgroupId=GROUP-ID
      -Dversion=VERSION

      Will create new project containing files for the single theme.

      b) Pros: very easy to develop, will save time.
      Cons: allows creation of only single theme per project (.jar file). Second, third, etc. themes can be added to the project only by manually creating necessary files.

      2. Maven archetype + CDK goal

      Common approach used in RichFaces CDK (currently, goals for components and Plug'n'Skins exist)

      a) Commands necessary to create new theme
      mvn archetype:create
      -DarchetypeGroupId=org.richfaces.cdk
      -DarchetypeArtifactId=maven-archetype-theme
      -DarchetypeVersion=RF-VERSION
      -DartifactId=ARTIFACT-ID
      -DgroupId=GROUP-ID
      -Dversion=VERSION

      Will create project - can be skipped if project exists.
      mvn cdk:add-theme -Dname=THEME_NAME
      mvn cdk:add-theme -Dname=ANOTHER_THEME_NAME
      ...

      Will add themes.

      b) Pros: allows to add arbitrary number of themes to the project easily (themes can be even added to existing plug'n'skin projects)
      Cons: we can reuse existing plug'n'skin archetype, but implementation of CDK goal requires more resources for development and testing.