JBoss Rich Faces SVN: r15385 - root.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2009-08-27 20:57:53 -0400 (Thu, 27 Aug 2009)
New Revision: 15385
Modified:
root/readme-examples.txt
Log:
Updated license, formatting, and some basic fixes
Modified: root/readme-examples.txt
===================================================================
--- root/readme-examples.txt 2009-08-28 00:57:22 UTC (rev 15384)
+++ root/readme-examples.txt 2009-08-28 00:57:53 UTC (rev 15385)
@@ -1,3 +1,11 @@
+RichFaces 4.0 Examples
+=========================================================
+Version 4.0.0.ALPHA1
+
+This software is distributed under the terms of the FSF Lesser Gnu Public License (see lgpl.txt).
+
+Getting up and running quickly
+-------------------------------
This demo application should be built using Maven 2.1.0
tomcat6/jetty targetted build:
@@ -6,9 +14,14 @@
For JEE5 application server:
1) execute "mvn install -P jee5" in root application folder(richfaces-examples-4.x.y.z/richfaces-demo)
-2) Deploy to Jboss 4.x or higher or some other jee5 application server.
+2) Deploy to Jboss 4.x or higher or some other jee5 application servers.
3) Do not forget to change the JSF implementation shipped with application server to JSF 2 (latest SNAPSHOT)
-To Build both archives execute "mvn install -P release"
+To build both archives execute "mvn install -P release"
-Type http://localhost:8080/richfaces-demo in your browser command line after starting server.
\ No newline at end of file
+Type http://localhost:8080/richfaces-demo in your browser command line after starting server.
+
+Learn more
+----------
+RichFaces Project - http://www.jboss.org/richfaces
+RichFaces 4.0 Wiki - http://www.jboss.org/community/wiki/RichFaces40Planning
\ No newline at end of file
15 years, 4 months
JBoss Rich Faces SVN: r15384 - root.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2009-08-27 20:57:22 -0400 (Thu, 27 Aug 2009)
New Revision: 15384
Modified:
root/readme-ui.txt
Log:
Updated license, formatting, and some basic fixes
Modified: root/readme-ui.txt
===================================================================
--- root/readme-ui.txt 2009-08-28 00:39:31 UTC (rev 15383)
+++ root/readme-ui.txt 2009-08-28 00:57:22 UTC (rev 15384)
@@ -1,4 +1,13 @@
-1) Put RichFaces libraries and its dependencies to your application libraries folder:
+RichFaces - Ajax enabled JSF 2.0 component library
+=========================================================
+Version 4.0.0.ALPHA1
+
+This software is distributed under the terms of the FSF Lesser Gnu Public License (see lgpl.txt).
+
+Getting up and running quickly
+-------------------------------
+
+1) Put RichFaces libraries and its dependencies in your application libraries folder:
1.1) richfaces-api
1.2) richfaces-impl
1.3) core-ui
@@ -6,19 +15,18 @@
1.5) commons-beanutils
1.6) slf4j-api
1.7) slf4j-log4j12 (or whatever else - select the implementation according to logging framework that you use)
-
- JBoss Cache is recommended for optimal performance.
-
2) As opposed to the previous 3.x.y versions of RichFaces, no special configuration steps are necessary.
-You don't need to modify web.xml/faces-config.xml
+You don't need to modify web.xml or faces-config.xml
-3) Add RichFaces namespace/taglib declaration to your Facelets pages which will use RichFaces components
+3) Add RichFaces namespace/taglib declaration to your VDL/XHTML pages which will use RichFaces components
Use xmlns:a4j="http://richfaces.org/a4j" namespace
-4) Add one of the available RichFaces 4.0.A1 components to your page and try it!
-
-Components Available:
+4) Add one of the available RichFaces 4.0.A1 components to your page and try it!
+ 4.1) Take a look at the RichFaces examples distribution for assistance with usage.
+
+Available Components
+---------------------------------
a4j:ajax
a4j:commandLink
a4j:commandButton
@@ -27,4 +35,9 @@
a4j:status
a4j:jsFunction
a4j:log
-a4j:outputPanel
\ No newline at end of file
+a4j:outputPanel
+
+Learn more
+----------
+RichFaces Project - http://www.jboss.org/richfaces
+RichFaces 4.0 Wiki - http://www.jboss.org/community/wiki/RichFaces40Planning
\ No newline at end of file
15 years, 4 months
JBoss Rich Faces SVN: r15383 - in root/docs/trunk/guides: migrationguide and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-08-27 20:39:31 -0400 (Thu, 27 Aug 2009)
New Revision: 15383
Added:
root/docs/trunk/guides/photo_album_app_guide/
root/docs/trunk/guides/photo_album_app_guide/en/
root/docs/trunk/guides/photo_album_app_guide/en/pom.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/
root/docs/trunk/guides/photo_album_app_guide/en/src/main/
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/a4j_status.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/albumView.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/button.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/contextMenu.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/errorsReports.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/hiw.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/imageView.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/shelfView.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/tooltips.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/uploadImages.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/usedComponents.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/userPreferencesView.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/validators.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/master.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/application_overview.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/intro.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/overview.xml
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/albumView.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_album.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_image.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_shelf.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/contentArea.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/diagram.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/dnd.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/ejb_struct.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/erd.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/imageView.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/image_size.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/indexxhtml.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/messages_en_property.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/modulesList.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/richfaces_logo.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_mess.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_pers.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_start.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/slide_show.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/tooltip.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/tree.png
root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/web_struct.png
root/docs/trunk/guides/photo_album_app_guide/pom.xml
Modified:
root/docs/trunk/guides/migrationguide/pom.xml
root/docs/trunk/guides/pom.xml
Log:
https://jira.jboss.org/jira/browse/RF-7335 - Photo Album Guide is added to the 4.0 build
Modified: root/docs/trunk/guides/migrationguide/pom.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/pom.xml 2009-08-28 00:25:48 UTC (rev 15382)
+++ root/docs/trunk/guides/migrationguide/pom.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -11,233 +11,5 @@
<name>RichFaces Migration Guide</name>
<modules>
<module>${docs.translation}</module>
- </modules>
-
- <!--version>3.3.2-SNAPSHOT</version>
- <name>Migration Guide</name>
- <description>RichFaces Migration Guide from 3.1.* to 3.2.0 version</description>
- <pluginRepositories>
- <pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
- </pluginRepository>
- </pluginRepositories>
- <profiles>
- <profile>
- <id>html</id>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin
- </artifactId>
- <version>2.1.0-200803311251UTC-MPJDOCBOOK-8
- </version>
- <configuration>
- <formats>
- <format>
- <formatName>html</formatName>
- <stylesheetResource> ${xsl_html}</stylesheetResource>
- <finalName> index.html</finalName>
- <imageCopyingRequired> true</imageCopyingRequired>
- <imagePathSettingRequired> false</imagePathSettingRequired>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- </profile>
- <profile>
- <id>html_single</id>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin
- </artifactId>
- <version>2.1.0-200803311251UTC-MPJDOCBOOK-8
- </version>
- <configuration>
- <formats>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource> ${xsl_html_single}</stylesheetResource>
- <imageCopyingRequired> true</imageCopyingRequired>
- <imagePathSettingRequired> false</imagePathSettingRequired>
- <finalName> index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- </profile>
- </profiles>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>
- org.richfaces.docs.common-resources
- </groupId>
- <artifactId>
- ${translation}
- </artifactId>
- <version>
- ${project.version}
- </version>
- <type>jar</type>
- <overWrite>true</overWrite>
- <outputDirectory>
- ${project.build.directory}
- </outputDirectory>
- </artifactItem>
- </artifactItems>
- <overWriteReleases>
- false
- </overWriteReleases>
- <overWriteSnapshots>
- true
- </overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
- <executions>
- <execution>
- <id>jdocbook:generate</id>
- <phase>compile</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>jdocbook:resources</id>
- <phase>process-resources</phase>
- <goals>
- <goal>resources</goal>
- </goals>
- </execution>
- <execution>
- <id>jdocbook:bundle</id>
- <phase>package</phase>
- <goals>
- <goal>bundle</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- <dependency>
- <groupId>org.richfaces.docs.common-resources</groupId>
- <artifactId>${translation}</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>fop</artifactId>
- <version>0.95</version>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDirectory>
- ${basedir}/src/main/docbook
- </sourceDirectory>
- <imageResource>
- <directory>
- ${project.build.directory}/common-resources
- </directory>
- </imageResource>
- <cssResource>
- <directory>
- ${project.build.directory}/common-resources
- </directory>
- </cssResource>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/common-resources/xslt/pdf-common.xsl</stylesheetResource>
- <finalName>richfaces_migration_guide.pdf</finalName>
- <imagePathSettingRequired>true</imagePathSettingRequired>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>
- ${xsl_html}
- </stylesheetResource>
- <finalName>index.html</finalName>
- <imageCopyingRequired>
- true
- </imageCopyingRequired>
- <imagePathSettingRequired>
- false
- </imagePathSettingRequired>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>
- ${xsl_html_single}
- </stylesheetResource>
- <imageCopyingRequired>true</imageCopyingRequired>
- <imagePathSettingRequired>false</imagePathSettingRequired>
- <finalName>index.html </finalName>
- </format>
- </formats>
- <xincludeSupported>true</xincludeSupported>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <useRelativeImageUris> true </useRelativeImageUris>
- <xmlTransformerType> saxon </xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <modules>
- <module>en</module>
- </modules-->
+ </modules>
</project>
Added: root/docs/trunk/guides/photo_album_app_guide/en/pom.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/pom.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/pom.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.richfaces.docs.guides</groupId>
+ <artifactId>photo_album_app_guide</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.docs.photo_album_app_guide</groupId>
+ <artifactId>en</artifactId>
+ <packaging>jar</packaging>
+ <name>RichFaces Photo Album Application Guide (${translation})</name>
+ <build>
+ <finalName>
+ ${project.parent.artifactId}_${translation}-${version}
+ </finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/a4j_status.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/a4j_status.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/a4j_status.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="a4j_status">
+ <title>The <emphasis role="bold"><property><a4j:status></property></emphasis> component</title>
+ <para>
+
+ <emphasis role="bold"><property><a4j:status></property></emphasis>
+ is a component, designed to create some visual effect during Ajax request. The comportment is usually attached to a certain request, which implies time consuming processing, so that the end user is aware the page is not hung up,
+ it's responding to her actions: the user sees the processing progress (the component is frequently used to indicate file uploading process).
+ </para>
+ <para>
+ However, in the Photo Album application the <emphasis role="bold"><property><a4j:status></property></emphasis> component is triggered on any Ajax request: to demonstrate the component itself and partially to display for the user that on every click on a link or a button something is happening, as all actions in the application occur on a single page which is not typical for usual web-workflow, when on each action the user navigates to a new page.
+ </para>
+ <para>
+
+ By default, <emphasis role="bold"><property><a4j:status></property></emphasis> works for each Ajax components inside the local region. This means if you have no region defined on the page (the whole view is a region) and have only one <emphasis role="bold"><property><a4j:status></property></emphasis> on the page, the <emphasis role="bold"><property><a4j:status></property></emphasis> will be activated during Ajax request by any of the Ajax component located on the page.
+ </para>
+ <para>
+ As there are no regions defined explicitly in the application, <emphasis role="bold"><property><a4j:status></property></emphasis> is located in the main template (template.xhtml) for all pages:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ ...
+ <body class="main-body">
+ ...
+ <ui:include src="/includes/index/status.xhtml" />
+ </body>
+</html>
+
+...]]></programlisting>
+ <para>
+ Hence the default behavior of the component meets that application's requirements: the component is shown on every single Ajax request.
+ </para>
+ <para>
+ This is the page with the <emphasis role="bold"><property><a4j:status></property></emphasis> component:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:richx="http://richfaces.org/richx">
+ <a4j:status layout="block" stopStyle="display: none;"
+ startStyle="height: 52px; width: 79px; position: absolute; top: 0px; left: 278px;">
+ <f:facet name="start">
+ <h:panelGroup>
+ <h:graphicImage style="position: absolute; top: 0px; left: 0px;"
+ height="79" width="52" alt="" value="/img/shell/ai.png" />
+ <h:graphicImage style="position: absolute; top: 26px; left: 13px;"
+ height="26" width="26" alt="" value="/img/shell/ai.gif" />
+ </h:panelGroup>
+ </f:facet>
+ </a4j:status>
+</ui:composition>
+...]]></programlisting>
+ <para>
+ The <code>startStyle="height: 52px; width: 79px; position: absolute; top: 0px; left: 278px;"</code>, attribute specifies what is displayed on the page after the request initiation, which means in our case that it is positioned absolutely: 278 pixels from the left border of the page and 0 pixels from the top, its width is 79px and the height is 52px.
+ </para>
+
+ <para>
+ The <code>stopStyle="display: none;"</code> attribute is responsible for displaying the component on the page when the request is finished, in our case the it will be hidden.
+
+ </para>
+ <para>
+ As we need to show only the beginning of the request, we customize only the <code><f:facet name="start"></code> which is just an image(you can insert any image you like).
+ </para>
+ <para>
+
+ If you would like to get more details about the <emphasis role="bold"><property><a4j:status></property></emphasis> please visit <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/status.jsf?c=status">Live Demo</ulink> web page and <ulink url="&devguide;/#a4j_status">RichFaces Developer Guide</ulink>.
+ </para>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/a4j_status.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/albumView.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/albumView.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/albumView.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="albumView">
+ <title>Album View</title>
+ <para>
+ <property>Album</property> view allows you to observe album items as thumbnails,
+ scale the size of the thumbnails with the slider control, as well as to switch to slideshow mode.
+ By clicking on an image in the <property>Album</property> view the <property>Image</property> View is opened.
+ </para>
+
+ <figure>
+ <title>Album view</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/albumView.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <section>
+ <title>Image Size Control with <rich:inputNumberSlider></title>
+ <para>
+ The <emphasis role="bold"><property><rich:inputNumberSlider/></property></emphasis> component in the Photo Album Demo is used as a control that helps a user to change photos size while previewing an album.
+ A handler position on the slider track corresponds to a particular value of an image size.
+ The component is included into the page with the help of <emphasis role="bold"><property><ui:include/></property></emphasis>:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:include src="src/main/webapp/includes/image/inputNumberSlider.xhtml"/>
+...]]></programlisting>
+
+ <para>
+ Now let's have a look at <code>src/main/webapp/includes/image/inputNumberSlider.xhtml</code> file:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition ...>
+ <div>
+ <rich:inputNumberSlider value="#{imageSizeHelper.value}"
+ minValue="80"
+ maxValue="200"
+ step="40"
+ enableManualInput="false"
+ showArrows="false"
+ showBoundaryValues="true"
+ showInput="false">
+ <a4j:support event="onchange" reRender="userAlbumImages"/>
+ </rich:inputNumberSlider>
+ </div>
+</ui:composition>
+...]]></programlisting>
+ <para>
+ There is special Enumeration type that contains four predefined values for image size. Each type has a set of image related attributes such as CSS class for new photo size, postfix for a new file name, image background.
+ The <code>setValue</code> method of the <code>ImageSizeHelper.java</code> class is triggered on each slider's position change. This method sets one of four predefined values for image size and corresponds to slider's position.
+ </para>
+ <programlisting role="JAVA"><![CDATA[public void setValue(int value) {
+ currentDimension = ImageDimension.getInstance(value);
+ this.value = currentDimension.getX();
+}]]></programlisting>
+
+ <para>
+ And here is the <code>ImageDimension.java</code> class:
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ public enum ImageDimension {
+
+ SIZE_80(80), SIZE_120(120), SIZE_160(160), SIZE_200(200), SIZE_MEDIUM(600), ORIGINAL(0);
+
+ final static String CSS_CLASS = "preview_box_photo_";
+ final static String FILE_POSTFIX = "_small";
+ final static String IMAGE_BG = "/img/shell/frame_photo_%1$d.png";
+ final static String IMAGE_BG_STYLE = "width: %1$dpx; height: %1$dpx";
+
+ int x;
+ String bgStyle;
+ String cssClass;
+ String imageBgSrc;
+ String filePostfix;
+
+ private ImageDimension(int x) {
+ this.x = x;
+ this.bgStyle = String.format(IMAGE_BG_STYLE, x + 20);
+ cssClass = CSS_CLASS + x;
+ imageBgSrc = String.format(IMAGE_BG, (x == 160) ? 200 : x);
+ if(x == 600){
+ filePostfix = "_medium";
+ }else if(x == 0){
+ filePostfix = "";
+ }else{
+ filePostfix = FILE_POSTFIX + x;
+ }
+ }
+ ...]]></programlisting>
+
+ <para>
+ After the <emphasis role="bold"><property><a4j:support></property></emphasis> finished its job user photos
+ (more exactly, the <emphasis role="bold"><property>h:panelGroup</property></emphasis> with <code>userAlbumImages</code> id that contains user photos)
+ are rendered correspondingly to the new value. Here is <code>web/src/main/webapp/includes/image/imageList.xhtml</code>:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:panelGroup id="userAlbumImages">
+ <a4j:repeat id="imageList" value="#{model.images}" var="image" rows="20">
+ <h:panelGroup layout="block" styleClass="#{imageSizeHelper.currentDimension.cssClass}">
+ <h:graphicImage styleClass="pr_photo_bg" style="#{imageSizeHelper.currentDimension.imageBgStyle}" value="#{imageSizeHelper.currentDimension.imageBg}" />
+ <h:panelGrid cellpadding="0">
+ <h:panelGroup>
+ <a4j:commandLink
+ actionListener="#{controller.showImage(image)}"
+ reRender="mainArea, treePanel">
+ <a4j:mediaOutput id="img" element="img"
+ createContent="#{imageLoader.paintImage}"
+ style="border : 1px solid #FFFFFF;"
+ value="#{fileManager.transformPath(image.fullPath, imageSizeHelper.currentDimension.filePostfix)}">
+ <f:param value="#{imageSizeHelper.currentDimension.x}" name="x" />
+ <rich:dragSupport rendered="#{controller.isUserImage(image)}" reRender="mainArea, treePanel" id="dragSource" dragIndicator="dragIndicator"
+ dragType="image" dragValue="#{image}">
+ <rich:dndParam id="dragParam" name="label" value="#{image.name}" />
+ </rich:dragSupport>
+ </a4j:mediaOutput>
+ </a4j:commandLink>
+ <br/>
+ </h:panelGroup>
+ <ui:include src="/includes/contextMenu/CMForImage.xhtml" >
+ <ui:param name="image" value="#{image}" />
+ <ui:param name="mediaOutput" value="#{rich:clientId('img')}"/>
+ </ui:include>
+
+ </h:panelGrid>
+ <h:panelGroup layout="block" styleClass="photo_name">#{image.name}</h:panelGroup>
+ <h:panelGroup layout="block" styleClass="photo_data">
+ <h:outputText value="#{image.created}">
+ <f:convertDateTime />
+ </h:outputText>
+ </h:panelGroup>
+ </h:panelGroup>
+ </a4j:repeat>
+ </h:panelGroup>
+...]]></programlisting>
+
+ <para>
+ When the <emphasis role="bold"><property><rich:inputNumberSlider></property></emphasis> is rendered, initially its default value for image size is 120 px.
+ </para>
+
+ <figure>
+ <title>Image size control</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/image_size.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>
+ Visit following pages at RichFaces Live Demo for more information, examples and sources on the components used in the application and described in this chapter:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/inputNumberSlider.jsf...">InputNumberSlider</ulink> page for the <emphasis role="bold"><property><rich:inputNumberSlider></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/support.jsf?c=support">AjaxSupport</ulink> for the <emphasis role="bold"><property><a4j:suport></property></emphasis> component.
+ </para>
+ </listitem>
+
+
+ </itemizedlist>
+
+ </section>
+
+
+
+ <section id="slideshow">
+ <title>Slideshow</title>
+
+ <para>The slideshow feature in the Photo Album Demo can be enabled by clicking on <emphasis role="bold">"Start Slideshow"</emphasis> link from two different places in the application:
+ 1) from user's album preview (<code>/web/src/main/webapp/image/albumInfo.xhtml</code>) and 2) from a particular photo preview (<code>src/main/webapp/image/imageInfo.xhtml</code>).
+ Both of two mentioned XHTML files include slideshow with the help of Facelets <<emphasis role="bold"><property>ui:include</property></emphasis> tag
+ (for more information about <<emphasis role="bold"><property>ui:include</property></emphasis> see Facelets Reference Guide —
+ <ulink url="http://www.jsftoolbox.com/documentation/facelets/01-Introduction/index.jsf">http://www.jsftoolbox.com/documentation/facelets/01-Introduction/index.jsf</ulink>).
+ </para>
+ <para>
+ The components that implement the slideshow functionality are:
+ </para>
+ <itemizedlist>
+ <listitem><para><emphasis role="bold"><property><rich:modalPanel></property></emphasis> located in <code>web/src/main/webapp/includes/image/slideshow.xhtml</code> that is hidden by default as the attribute <code>showWhenRendered="#{slideshow.active}"</code> and the active property of <code>SlideshowManager.java</code> is set to "false" by default.</para></listitem>
+ <listitem><para><emphasis role="bold"><property><a4j:poll></property></emphasis> located in <code>includes/misc/slideShowPooler.xhtml</code> which is also inactive due to the mentioned active property ( <code>active=#{slideshow.active}</code>)</para></listitem>
+ </itemizedlist>
+
+ <para>
+
+ After activation, <emphasis role="bold"><property><a4j:poll></property></emphasis> will send asynchronous requests to the server with some certain interval, as the result of these requests modal panel will display the next image in the row.
+ </para>
+
+<para>
+ Now let's have a look at the details of the slideshow implementation.
+</para>
+
+ <para>
+ The <code>startSlideshow()</code> method of <code>SlideshowManager.java</code> is invoked when no photo is selected in the current image list. The method iterates over all photos of a particular album starting from the first one in the list. Look at the <code>SlideshowManager.java</code> listing below:
+ </para>
+
+<programlisting role="JAVA"><![CDATA[...
+ ...
+public void startSlideshow(){
+ active = true;
+ this.slideshowIndex = 0;
+ if(model.getImages() == null || model.getImages().size() < 1){
+ stopSlideshow();
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "No images for slideshow!");
+ return;
+ }
+ this.selectedImage = model.getImages().get(this.slideshowIndex);
+ this.selectedImage.getAlbum().visitImage(selectedImage, true);
+}
+...]]></programlisting>
+ <para>
+ The second variation of the <code>startSlideshow()</code> method is activated when a link to slide-show is clicked from a particular photo preview. This method iterates over the rest of photos starting from the current selected one:
+
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+ public void startSlideshow(Image selectedImage){
+ active = true;
+ if(model.getImages() == null || model.getImages().size() < 1){
+ stopSlideshow();
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "No images for slideshow!");
+ return;
+ }
+ this.slideshowIndex = model.getImages().indexOf(selectedImage);
+ this.selectedImage = selectedImage;
+ this.selectedImage.getAlbum().visitImage(selectedImage, true);
+}
+...]]></programlisting>
+
+ <para>
+ Both variants of <code>startSlideshow()</code> method set the <code>active</code> property to "true" as a result the poller is activated and modal panel becomes visible.
+
+ </para>
+ <para>
+ The slideshow modal panel is kept in the <code>web/src/main/webapp/includes/image/slideshow.xhtml</code> file and referred from the corresponding pages with the help of <ui:include> Facelets tag:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:include src="/includes/image/slideshow.xhtml"/>
+...]]></programlisting>
+ <para>
+ Have a look at <code>web/src/main/webapp/includes/image/slideshow.xhtml</code> file:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"...>
+
+ <rich:modalPanel showWhenRendered="#{slideshow.active}"
+
+ domElementAttachment="parent"
+
+ id="slideShowModalPanel"
+
+ width="650"
+
+ onshow="showPictureEffect();"
+
+ height="650">
+
+ <f:facet name="controls">
+
+ <h:panelGroup>
+
+ <h:graphicImage value="/img/modal/close.png" style="cursor:pointer" id="hidelink">
+
+ <a4j:support event="onclick" actionListener="#{slideshow.stopSlideshow}" reRender="slideShowForm, mainArea, tree" />
+
+ </h:graphicImage>
+
+ </h:panelGroup>
+
+ </f:facet>
+
+ ...
+
+ </rich:modalPanel>
+
+</ui:composition>
+
+...]]></programlisting>
+ <para>
+
+ This is the source code of <code>includes/misc/slideShowPooler.xhtml</code>:
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:richx="http://richfaces.org/richx">
+ <a4j:form id="slideShowForm">
+ <a4j:poll reRender="slideshowImage"
+ actionListener="#{slideshow.showNextImage()}"
+ interval="#{slideshow.interval}"
+ enabled="#{slideshow.active}"
+ onsubmit="hidePictureEffect()"
+ oncomplete="showPictureEffect();"/>
+ </a4j:form>
+</ui:composition>
+...]]></programlisting>
+
+ <para>
+ The slideshow poller sends the request for the next image (<code>showNextImage()</code> method) each four seconds.
+ The interval is defined in the interval property of the <code>SlideshowManager.java</code> and refers to a <code>INITIAL.DELAY</code> constant (<code>constants.java</code>).
+ </para>
+ <para>
+ The described above example implements a modal panel with photos that rotate them in the order they are stored in an album.
+ </para>
+ <figure>
+ <title>Image size control</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/slide_show.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>
+ To stop the slide-show user clicks <emphasis role="bold">Close window</emphasis> button on the slide-show panel and <code>stopSlideshow()</code> method is invoked.
+ </para>
+<programlisting role="XML"><![CDATA[...
+@Observer("stopSlideshow")
+ public void stopSlideshow(){
+ active = false;
+ this.selectedImage = null;
+ this.slideshowIndex = 0;
+ }
+ ...]]></programlisting>
+
+ <para>
+ The <code>active</code> field is set to "false" again, consequently the poller becomes inactive and the modal panel becomes invisible too.
+ </para>
+ </section>
+ <para>
+ Visit following pages at RichFaces Live Demo for more information, examples and sources on the components used in the application and described in this chapter:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.jsf?c=moda...">ModalPanel</ulink> page for the <emphasis role="bold"><property><rich:modalPanel></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/effect.jsf?c=effect">Effect</ulink> for the <emphasis role="bold"><property><rich:effect></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/mediaOutput.jsf?c=med...">MediaOutput</ulink> for the <emphasis role="bold"><property><a4j:mediaOutput></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/support.jsf?c=support">AjaxSupport</ulink> for the <emphasis role="bold"><property><a4j:suport></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/commandLink.jsf?c=com...">CommandLink</ulink> for the <emphasis role="bold"><property><a4j:commandLink></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/form.jsf?c=form">AjaxForm</ulink> for the <emphasis role="bold"><property><a4j:form></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/poll.jsf?c=poll">Poll</ulink> for the <emphasis role="bold"><property><a4j:poll></property></emphasis> component.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/albumView.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/button.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/button.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/button.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="Button">
+ <title>How the button is created and how it acts
+ </title>
+ <para>
+
+ Due to specific design of the buttons in the Photo Album application, it's necessary to clarify some design and development points about the button. The button is visually represented by Facelets template stored in the <property>button.xhtml</property> file.
+
+ </para>
+ <para>Please have a look at the content of the file:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:richx="http://richfaces.org/richx">
+ <a4j:loadScript src="/scripts/buttons.js" />
+ <richx:actionMapper>
+ <a4j:outputPanel layout="block" style="#{style}" styleClass="photoalbumButton #{styleClass}" lang="#{lang}" dir="#{dir}" title="#{title}"
+ rendered="#{empty rendered or rendered}"
+ onmousedown="RF_RW_DEMO.toPressed(this)" onmouseup="RF_RW_DEMO.toReleased(this)" onmouseout="RF_RW_DEMO.toReleased(this)">
+ <h:graphicImage value="/img/shell/button.png" alt="" />
+ <h:graphicImage value="/img/shell/button_press.png" style="display: none;" alt="" />
+ <div>#{value}</div>
+ <a4j:commandButton accesskey="#{accesskey}" ajaxSingle="#{ajaxSingle}" alt="#{alt}" type="image" image="/img/shell/spacer.gif"
+ actionListener="#{mappedActionListener}" action="#{mappedAction}" bypassUpdates="#{bypassUpdates}" data="#{data}" disabled="#{disabled}"
+ eventsQueue="#{eventsQueue}" focus="#{focus}" ignoreDupResponses="#{ignoreDupResponses}" immediate="#{immediate}" limitToList="#{limitToList}"
+ onbeforedomupdate="#{onbeforedomupdate}" timeout="#{timeout}" tabindex="#{tabindex}" status="#{status}" similarityGroupingId="#{similarityGroupingId}"
+ reRender="#{reRender}" requestDelay="#{requestDelay}" process="#{process}" oncomplete="#{oncomplete}"
+ onblur="#{onblur}" onclick="#{onclick}" ondblclick="#{ondblclick}" onfocus="#{onfocus}" onkeydown="#{onkeydown}" onkeypress="#{onkeypress}" onkeyup="#{onkeyup}"
+ onmousedown="#{onmousedown}" onmousemove="#{onmousemove}" onmouseout="#{onmouseout}" onmouseover="#{onmouseover}" onmouseup="#{onmouseup}" />
+ </a4j:outputPanel>
+ </richx:actionMapper>
+</ui:composition>
+
+...]]></programlisting>
+ <para>
+ The <emphasis role="bold"> <property><richx:actionMapper></property></emphasis>
+ tag is covered in more detail further in the text. In brief, it's a special tag developed deliberately to pass to the button a method expression of the action which must be performed when the button is clicked.
+
+ </para>
+ <para>
+ To make sure the button works correctly we include the required JavaScript code that is located in the button.js file using <code> <a4j:loadScript src="/scripts/buttons.js" /> </code> component.
+ </para>
+ <para>
+ The button consists of several parts:
+ </para>
+ <itemizedlist>
+ <listitem><para>2 images (pressed and not pressed)</para></listitem>
+ <listitem><para><div> element that displays the button's text </para></listitem>
+ <listitem><para><emphasis role="bold"><property><a4j:commandButton></property></emphasis> that sends Ajax request to the server</para></listitem>
+
+ </itemizedlist>
+ <para>
+ These elements are wrapped by <emphasis role="bold"><property><a4j:outputPanel></property></emphasis> to adjust the look-and-feel.
+ </para>
+ <para>
+ In the application the button is used for example like this:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<richx:commandButton actionListener="#{authenticator.register(user)}" reRender="mainform, headerPanel" value="#{messages['user.register']}" />
+...]]></programlisting>
+ <para>
+ We can pass to the <emphasis role="bold"><property><richx:commandButton></property></emphasis> all required attributes, in the example only actionListener, reRender and value are passed.
+ </para>
+ <para>
+ <emphasis role="bold"><property><richx:commandButton></property></emphasis>
+ is a custom tag that is declared in the photoalbum-taglib.xml tag library:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "facelet-taglib_1_0.dtd">
+<facelet-taglib>
+ <namespace>http://richfaces.org/richx</namespace>
+ <tag>
+ <tag-name>commandButton</tag-name>
+ <source>templates/button.xhtml</source>
+ </tag>
+ <tag>
+ <tag-name>actionMapper</tag-name>
+ <handler-class>org.richfaces.photoalbum.util.ActionMapperTagHandler</handler-class>
+ </tag>
+</facelet-taglib>
+...]]></programlisting>
+ <para>
+ In order to use the <emphasis role="bold"><property><richx:commandButton></property></emphasis> on the page the namespace of the taglib must be declared:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ ...
+xmlns:richx="http://richfaces.org/richx">
+...]]></programlisting>
+ <para>
+ A more complex part of the button implementation, as we said earlier, is <emphasis role="bold"><property><richx:actionMapper></property></emphasis> which is also described in tablib. But it is not just a simple tag-template since it has Facelets handler-class which specifies how it is handled when declared on the page. It is created because Facelets templates do not allow to make the MethodExpression a Facelets-template parameter. Please find below the code of the class(some irrelevant details are omitted):
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+ public class ActionMapperTagHandler extends TagHandler {
+
+ private static final Class<?>[] ACTION_PARAM_TYPES = new Class[0];
+
+ private static final Class<?>[] ACTION_LISTENER_PARAM_TYPES = new Class[] {ActionEvent.class};
+
+ private static final String ACTION = "action";
+
+ private static final String ACTION_LISTENER = "actionListener";
+
+ private static final String MAPPED_ACTION = "mappedAction";
+
+ private static final String MAPPED_ACTION_LISTENER = "mappedActionListener";
+
+ public ActionMapperTagHandler(TagConfig config) {
+ super(config);
+ }
+
+ private MethodExpression remap(FaceletContext faceletContext, String varName,
+ Class<?> expectedReturnType, Class<?>[] expectedParamTypes) {
+
+ MethodExpression result = null;
+
+ VariableMapper mapper = faceletContext.getVariableMapper();
+ ValueExpression valueExpression = mapper.resolveVariable(varName);
+ if (valueExpression != null) {
+ ExpressionFactory ef = faceletContext.getExpressionFactory();
+ ELContext elContext = faceletContext.getFacesContext().getELContext();
+
+ result = ef.createMethodExpression(elContext, valueExpression.getExpressionString(),
+ expectedReturnType, expectedParamTypes);
+ }
+
+ return result;
+ }
+
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+
+ MethodExpression actionExpression = remap(ctx, ACTION, String.class, ACTION_PARAM_TYPES);
+ MethodExpression actionListenerExpression = remap(ctx, ACTION_LISTENER, null, ACTION_LISTENER_PARAM_TYPES);
+
+ if (actionExpression != null || actionListenerExpression != null) {
+ VariableMapper initialVarMapper = ctx.getVariableMapper();
+ try {
+ VariableMapperWrapper varMapper = new VariableMapperWrapper(initialVarMapper);
+
+ if (actionExpression == null) {
+ actionExpression = NOOP_ACTION_EXPRESSION;
+ }
+
+ varMapper.setVariable(MAPPED_ACTION,
+ ctx.getExpressionFactory().createValueExpression(actionExpression,
+ MethodExpression.class));
+
+ if (actionListenerExpression == null) {
+ actionListenerExpression = NOOP_ACTION_LISTENER_EXPRESSION;
+ }
+
+ varMapper.setVariable(MAPPED_ACTION_LISTENER,
+ ctx.getExpressionFactory().createValueExpression(actionListenerExpression,
+ MethodExpression.class));
+
+ ctx.setVariableMapper(varMapper);
+
+ nextHandler.apply(ctx, parent);
+
+ } finally {
+ ctx.setVariableMapper(initialVarMapper);
+ }
+ } else {
+ nextHandler.apply(ctx, parent);
+ }
+ }
+}
+
+...]]></programlisting>
+ <para>
+ You can find more infromation about Facelets, custom tags, taglibs, Facelets tag handlers and Facelets templates here.
+ </para>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/button.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/contextMenu.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/contextMenu.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/contextMenu.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,128 @@
+<section id="contextMenu">
+ <title>Context Menus </title>
+ <para>Context menus are called when you right-click on a UI element. RichFaces library provides a special component <emphasis role="bold"><property><rich:contextMenu ></property></emphasis> to implement this type of functionality. </para>
+
+
+ <para>Context menu is made for the following UI controls:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><property>Album</property> menu item in navigation menu/Album thumbnail</para>
+<figure>
+ <title>Context Menu for </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/cm_album.png"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+
+ </listitem>
+ <listitem><para>Image thumbnail</para>
+
+
+ <figure>
+ <title>Image thumbnail context menu</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/cm_image.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </listitem>
+
+ <listitem><para><property>Shelf</property> menu item in navigation menu</para>
+ <figure>
+ <title>Context Menu for Shelf menu item </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/cm_shelf.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+
+ </itemizedlist>
+ <para>
+ Let's have a look at the context menu for single image is constructed.
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+ <rich:contextMenu disableDefaultMenu="false" style="text-align:left;" rendered="#{controller.isUserImage(image)}"
+ event="oncontextmenu" attached="true" submitMode="ajax" attachTo="#{mediaOutput}">
+ <rich:menuItem value="#{messages['image.delete']}" limitToList="true"
+ actionListener="#{confirmationPopupHelper.initImagePopup('deleteImage',messages['image.delete.confirm'],image)}"
+ oncomplete="#{rich:component('confirmation')}.show()"
+ reRender="confirmation">
+ </rich:menuItem>
+ <rich:menuItem value="#{messages['image.edit']}" limitToList="true"
+ actionListener="#{controller.startEditImage(image)}"
+ reRender="mainArea">
+ </rich:menuItem>
+ <rich:menuItem value="#{messages['image_show']}" limitToList="true"
+ actionListener="#{controller.showImage(image)}"
+ reRender="mainArea">
+ </rich:menuItem>
+ </rich:contextMenu>
+ ...]]></programlisting>
+ <para>
+ That is a listing from <code>\includes\contextMenu\CMForImage.xhtml</code>.
+ This code is included into the very bottom of imageList.xhtml file like this:
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+ <ui:include src="/includes/contextMenu/CMForImage.xhtml" >
+ <ui:param name="image" value="#{image}" />
+ <ui:param name="mediaOutput" value="#{rich:clientId('img')}"/>
+ </ui:include>
+ ...]]></programlisting>
+
+ <para>The context menu code is included with 2 parameters: <code>"image"</code> and <code>"mediaOutput"</code>. The first ( <code>"image"</code>) is the name of the current image. The <emphasis role="bold"><property><a4j:repeat></property></emphasis> iterates over a collection of images(see the next listing), the name of the current image is stored in the <code>"image"</code> variable. <code>"mediaOutput"</code> parameter is set with the help of <code>rich:clientId('id')</code> that returns client id by short id or null if the component with the id specified hasn't been found. </para>
+
+ <para>This is the block of code that displays each image: </para>
+
+ <programlisting role="XML"><![CDATA[...
+<a4j:repeat id="imageList" value="#{model.images}" var="image" rows="20">
+ <h:panelGroup layout="block" styleClass="#{imageSizeHelper.currentDimension.cssClass}">
+ <h:graphicImage styleClass="pr_photo_bg" style="#{imageSizeHelper.currentDimension.imageBgStyle}" value="#{imageSizeHelper.currentDimension.imageBg}" />
+ <h:panelGrid cellpadding="0">
+ <h:panelGroup>
+ <a4j:commandLink
+ actionListener="#{controller.showImage(image)}"
+ reRender="mainArea, treePanel">
+ <a4j:mediaOutput id="img" element="img"
+ createContent="#{imageLoader.paintImage}"
+ style="border : 1px solid #FFFFFF;"
+ value="#{fileManager.transformPath(image.fullPath, imageSizeHelper.currentDimension.filePostfix)}">
+ <f:param value="#{imageSizeHelper.currentDimension.x}" name="x" />
+ <rich:dragSupport rendered="#{controller.isUserImage(image)}" reRender="mainArea, treePanel" id="dragSource" dragIndicator="dragIndicator"
+ dragType="image" dragValue="#{image}">
+ <rich:dndParam id="dragParam" name="label" value="#{image.name}" />
+ </rich:dragSupport>
+ </a4j:mediaOutput>
+ </a4j:commandLink>
+ <br/>
+ </h:panelGroup>
+ </h:panelGrid>
+ <h:panelGroup layout="block" styleClass="photo_name">#{image.name}</h:panelGroup>
+ <h:panelGroup layout="block" styleClass="photo_data">
+ <h:outputText value="#{image.created}">
+ <f:convertDateTime />
+ </h:outputText>
+ </h:panelGroup>
+ </h:panelGroup>
+ <ui:include src="/includes/contextMenu/CMForImage.xhtml" >
+ <ui:param name="image" value="#{image}" />
+ <ui:param name="mediaOutput" value="#{rich:clientId('img')}"/>
+ </ui:include>
+ </a4j:repeat>
+
+ ...]]></programlisting>
+
+ <para>The key attribute of <emphasis role="bold"><property><contextMenu></property></emphasis> is <emphasis><property>"attachTo"</property></emphasis> that specifies for which control the context menu is displayed. As you can see this attribute has <code>#{mediaOutput}</code> as its value(<code> attachTo="#{mediaOutput}"</code> so this way the id of the current image is passed to <emphasis role="bold"><property><rich:contexMenu></property></emphasis> and this is how it knows what photo is affected by user actions. </para>
+
+
+</section>
+
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/contextMenu.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/errorsReports.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/errorsReports.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/errorsReports.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,74 @@
+<section id="errorsReports">
+ <title>Errors Reports</title>
+ <para>
+ The Photo Album application has a global mechanism for errors checking.
+ You become informed about the error each time it occurs.
+ It is possible because
+ the main page of the application
+ <code>web/src/main/webapp/index.xhtml
+ </code>
+ includes the
+ <code>web/src/main/webapp/includes/misc/errorPanel.xhtml</code>:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<a4j:outputPanel id="errors" ajaxRendered="true">
+ <h:panelGroup rendered="#{errorHandlerBean.errorExist}">
+ <rich:modalPanel id="errorPanel" showWhenRendered="true" minWidth="300" minHeight="200" autosized="true">
+ ...
+ </rich:modalPanel>
+ </h:panelGroup>
+</a4j:outputPanel>
+...]]></programlisting>
+ <para>
+ Here is the listing of the <code>errorHandlerBean</code> class:
+ </para>
+<programlisting role="JAVA"><![CDATA[package org.richfaces.photoalbum.ui;
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.photoalbum.service.Constants;
+
+@Name("errorHandlerBean")
+(a)Scope(ScopeType.EVENT)
+@AutoCreate
+public class ErrorHandlerBean {
+ private List<String> errors = new ArrayList<String>();
+
+ public List<String> getErrors() {
+ return errors;
+ }
+
+ public boolean isErrorExist(){
+ return errors.size() > 0 ;
+ }
+
+ @Observer(Constants.ADD_ERROR_EVENT)
+ public void addToErrors(String e){
+ errors.add(e);
+ }
+}]]></programlisting>
+ <para>
+ The error panel contains the
+ <emphasis role="bold"><property><a4j:outputPanel></property></emphasis>
+ component that is rendered on every Ajax request (<code>ajaxRendered="true"</code>).
+ If an error is occurred the <code>isErrorExist()</code> method of <code>errorHandlerBean</code> class
+ returns "true", so the
+ <emphasis role="bold"><property><h:panelGroup></property></emphasis> component
+ is rendered.
+ In order to show nested
+ <emphasis role="bold"><property><rich:modalPanel></property></emphasis> component
+ with the collected errors
+ the <emphasis><property>"showWhenRendered"</property></emphasis> attribute
+ should be set to "true".
+ </para>
+ <para>
+ The <code>addToErrors()</code> method is annotated with <code>@Observer</code> annotation,
+ thus it observes all events with <code>ADD_ERROR_EVENT</code> constant and adds errors to the
+ <code>errors</code> List.
+ </para>
+</section>
+
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/errorsReports.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/hiw.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/hiw.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/hiw.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+ <section>
+ <title>Image Size control</title>
+
+
+ <section>
+ <title>Links in Photo Album Demo. Using the <a4j:commandLink></title>
+ <para>
+ The main difference between <emphasis role="bold"><property><h:commandLink></property></emphasis> component is a) Ajax request that is generated on a click and b) dynamic rerendering of the page after a response comes back.
+ It's not necessary to plug any support into the component, as Ajax support is already built-in.
+ </para>
+ <para>
+ The <emphasis role="bold"><property><a4j:commandLink></property></emphasis> component is used widely in the application.
+ In the following example clicking on the <Edit> link will rerender the main ares (watching area) of the application and open an album edit form.
+ Each album has its owner and only owner can edit the album contents.
+ The link <Edit> will be rendered only if the current logged-in user is the owner of this album: the <emphasis><property>"rendered"</property></emphasis> attribute refers to the owner id and compares it with the current user id:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<a4j:commandLink rendered="#{model.selectedAlbum.owner.id == user.id}"
+ value="#{messages['album.edit']} "
+ actionListener="#{controller.startEditAlbum(model.selectedAlbum)}"
+ reRender="mainArea">
+</a4j:commandLink>
+...]]></programlisting>
+ <para>
+ The <emphasis><property><value></property></emphasis> attribute (text that will appear on the link) is picked up from the <code>messages_en.properties</code> file.
+ Such property files are very useful e.g. for multi language applications.
+ Each property is saved in the format "name—value".
+ Let's have a look at this file in the JBDS:
+ </para>
+ <figure>
+ <title>Image size control</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/messages_en_property.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+
+
+
+ </section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/hiw.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/imageView.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/imageView.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/imageView.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="imageView">
+ <title>Image View</title>
+ <para>
+ Image View in the Photo Album application is a page where only one image is displayed. In this view you can also browse the current album with the image scroller as well as to switch to slideshow mode.
+ If you are a registered user you can leave comments under the current image.
+ </para>
+
+ <figure>
+ <title>Some title</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/imageView.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <section id="customImagesScroller">
+ <title>Custom images scroller widget</title>
+
+ <para>
+ The Images Scroller implementation in the Photo Album application is basically <emphasis role="bold"><property><a4j:repeat></property></emphasis> with the value attribute bound to <code>#{model.selectedAlbum.images}</code>, which is a collection of images of the selected album and the <emphasis role="bold"><property><rich:dataScroller></property></emphasis> component tied to the <emphasis role="bold"><property><a4j:repeat></property></emphasis> .
+ </para>
+
+ <para>
+ The source code you can find in the includes/images/imageScroller.xhtml file.
+ Now let's go deeper into the details. The main component here is <emphasis role="bold"><property><a4j:repeat></property></emphasis>:
+
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<a4j:repeat value="#{model.selectedAlbum.images}" rows="5"
+ var="img" id="repeat" rowKeyVar="rk">
+
+ <a4j:outputPanel layout="block"
+ styleClass="preview_box_photo_nav #{model.selectedImage == img ? 'preview_box_photo_current' : 'preview_box_photo_default'}">
+ <h:panelGroup layout="block" styleClass="preview_box_photo_80">
+ <h:graphicImage styleClass="pr_photo_bg"
+ value="/img/shell/frame_photo_80.png" />
+ <h:panelGrid cellpadding="0" cellspacing="2">
+ <h:panelGroup layout="block">
+ <a4j:mediaOutput element="img"
+ createContent="#{imageLoader.paintImage}"
+ value="#{fileManager.transformPath(img.fullPath, '_small80')}">
+ </a4j:mediaOutput>
+ <br />
+ </h:panelGroup>
+ </h:panelGrid>
+ <h:panelGroup layout="block" styleClass="photo_name">
+ <h:outputText value="#{img.name}" />
+ </h:panelGroup>
+ <h:panelGroup layout="block" styleClass="photo_data">
+ <h:outputText value="#{rk + 1}" />
+ </h:panelGroup>
+ </h:panelGroup>
+
+ <a4j:support event="onclick" rendered="#{model.selectedImage != img}"
+ reRender="mainArea,treePanel, imagesTable" action="#{controller.showImage(img)}" />
+ </a4j:outputPanel>
+</a4j:repeat>
+...]]></programlisting>
+
+ <para>
+ Each element of the
+
+ <emphasis role="bold"><property><a4j:repeat></property></emphasis> has a corresponding <emphasis role="bold"><property><a4j:outputPanel></property></emphasis> with the <emphasis role="bold"><property><a4j:mediaOutput></property></emphasis> as a nested element. <emphasis role="bold"><property><a4j:mediaOutput></property></emphasis> renders the thumbnail of the image. As the rows attribute is set to "5" (<code>rows="5"</code>), only 5 images are displayed on the page at a time.
+
+ </para>
+
+ <para>
+ As you've noticed, the currently selected image in the images scroller has different style, namely: a red frame around thumbnail, which is implemented with this code:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<a4j:outputPanel layout="block"
+styleClass="preview_box_photo_nav #{model.selectedImage == img ? 'preview_box_photo_current' : 'preview_box_photo_default'}">
+...]]></programlisting>
+ <para>
+ As you can see from the code snippet,
+ identification of whether the currently selected image is the same image displayed by the <emphasis role="bold"><property><a4j:repeat></property></emphasis> is performed in the styleClass, if it returns "true", different style is applied.
+ </para>
+ <para>
+ Each <emphasis role="bold"><property><a4j:repeat></property></emphasis> has a corresponding <emphasis role="bold"><property><a4j:support></property></emphasis> configured like this:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <a4j:support event="onclick"
+ rendered="#{model.selectedImage != img}"
+ reRender="mainArea,treePanel, imagesTable"
+ action="#{controller.showImage(img)}" />
+
+...]]></programlisting>
+
+ <para>
+ On every click <emphasis role="bold"><property><a4j:support></property></emphasis> calls <code> #{controller.showImage(img)}</code> method that sets the current image, thumbnail of which has just been clicked on. For more details please see Controller.java class.
+ </para>
+
+ <para>
+ To implement thumbnails scrolling effect the <emphasis role="bold"><property><rich:datascroller></property></emphasis> is attached to the <emphasis role="bold"><property><a4j:repeat></property></emphasis>:
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<rich:datascroller page="#{controller.getPage()}"
+ styleClass="image-scroller" lastPageMode="full" for="repeat" reRender="imagesTable"
+ boundaryControls="hide" stepControls="hide">
+ <f:facet name="pages">
+ <h:outputText />
+ </f:facet>
+ <f:facet name="fastforward">
+ <h:graphicImage styleClass="image-scroller-right-arrow"
+ value="img/shell/arr_right.png" />
+ </f:facet>
+ <f:facet name="fastforward_disabled">
+ <h:graphicImage styleClass="image-scroller-right-arrow"
+ value="img/shell/arr_right_dis.png" />
+ </f:facet>
+ <f:facet name="fastrewind">
+ <h:graphicImage styleClass="image-scroller-left-arrow"
+ value="img/shell/arr_left.png" />
+ </f:facet>
+ <f:facet name="fastrewind_disabled">
+ <h:graphicImage styleClass="image-scroller-left-arrow"
+ value="img/shell/arr_left_dis.png" />
+ </f:facet>
+</rich:datascroller>
+
+...]]></programlisting>
+ <para>
+ The page attribute identifies which page should be displayed right now. For instance, if you have only 20 images and the current image has the 12<superscript>th</superscript> index in the collection, then the 3<superscript>rd</superscript> page will be displayed:
+
+ </para>
+ <programlisting role="XML"><![CDATA[...
+public Integer getPage(){
+ final Integer index = model.getSelectedAlbum().getIndex(model.getSelectedImage());
+ return index / 5 + 1;
+ }
+
+...]]></programlisting>
+
+ <para>
+ The <code>lastPageMode="full" </code> attribute ensures that 5 thumbnails are always shown on the page. If this attribute hadn't been configured like this, in case the 19th thumbnail out of 20 had been selected then only 2 last thumbnails would have been displayed.
+ </para>
+
+ <para>
+ As you can see, <emphasis role="bold"><property><rich:dataScroller></property></emphasis> has a slightly different look-and-feel, the trick is in the redefinition of <property>fastforward</property>, <property>fastforward_disabled</property>, <property>fastrewind</property> and <property>fastrewind_disabled</property> facets on which places we display our images. We didn't redefine other facets because they are not rendered to the page which is achieved with <code>boundaryControls="hide"</code> and <code>stepControls="hide</code> attributes of <emphasis role="bold"><property><rich:dataSroller></property></emphasis>.
+ </para>
+
+ <para>
+ Visit following pages at RichFaces Live Demo for more information, examples and sources on the components used in the application and described in this chapter:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dataTableScroller.jsf...">DataTableScrolling</ulink> page for the <emphasis role="bold"><property><rich:dataScroller></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/repeat.jsf?c=repeat">Repeat</ulink> for the <emphasis role="bold"><property><a4j:repeat></property></emphasis> component.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </section>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/imageView.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,403 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="navigationTree" xreflabel="navigationTree">
+ <?dbhtml filename="navigationPanel.html"?>
+ <title>Navigation tree</title>
+ <para>
+ The <emphasis role="bold"><property><rich:tree></property></emphasis> component takes one of the main places
+ in the <property>Photo Album</property> and is tightly bound with the application logic.
+ It helps to represent
+ and implement inherently the "Shelves - Albums" hierarchy.
+ Shelf is the highest possible level in the tree hierarchy, that
+ is used to group thematic albums and may contain as many albums as needed.
+ </para>
+ <para>
+ There are two types of navigation tree in the application: for a registered user and for a guest.
+ The difference between them is that the first one has a context menu and drag-and-drop possibility.
+ </para>
+ <section>
+ <title>Navigation tree for a guest</title>
+
+ <!--para>
+ The <emphasis role="bold"><property><rich:tree></property></emphasis> component is designed for
+ hierarchical data presentation and is used to build a tree structure.
+ The component also supports built-in drag-and-drop functionality.
+ </para-->
+ <para>
+ Navigation tree for a guest is represented as a simple
+ <emphasis role="bold"><property><rich:tree></property></emphasis> component.
+ </para>
+ <para>
+ There are several ways to implement the <emphasis role="bold"><property><rich:tree></property></emphasis> on a page.
+ In the current application the <emphasis role="bold"><property><rich:tree></property></emphasis> is designed
+ using a model tag <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis>.
+ </para>
+ <para>
+ The <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component
+ has a <emphasis><property>"nodes"</property></emphasis> attribute that accepts
+ a collection of elements, so <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis>
+ iterates over the collection and renders a hierarchical tree structure on a page.
+ </para>
+ <para>
+ According to the "Shelves - Albums" hierarchy we need two nested
+ <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> components.
+ The first one iterates over the Shelves collection
+ that is returned from the <code>getPredefinedShelves()</code> method of <code>ShelfManager.java</code> class:
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+public List<Shelf> getPredefinedShelves() {
+ if (shelves == null) {
+ shelves = shelfAction.getPredefinedShelves();
+ }
+ return shelves;
+ }
+}
+...]]></programlisting>
+ <para>
+ The second <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component
+ iterates over the Albums collection of the current Shelf which is available via
+ <emphasis><property>"var"</property></emphasis> attribute.
+ The <emphasis><property>"var"</property></emphasis> attribute
+ is used to get access to the data object of the current collection element Shelf,
+ so it is possible to output any necessary data. Let's see the <code>src/main/webapp/includes/index/tree.xhtml</code> file:
+ </para>
+ <!--
+ The <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component accepts
+ a collection of elements, which are allowed to include lists, arrays, maps, XML NodeList or NamedNodeMap, and iterate over it.
+ The <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component repeats a hierarchical tree structure on a <code>xhtml</code> or <code>jsp</code> page in a component tree and can be nested without any limitations.
+ The code snippet below schematically shows the idea of how a tree can be built on a page with the help of adaptors:
+
+
+
+ <programlisting role="XML"><![CDATA[<rich:tree>
+ <rich:treeNodesAdaptor>
+ <rich:treeNode />
+
+ <rich:treeNodesAdaptor>
+ <rich:treeNode />
+
+ <rich:treeNodesAdaptor>
+ <rich:treeNode />
+ ...
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+</rich:tree>]]></programlisting>
+
+ <para>
+ When using <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component
+ there is no need to specify
+ the <emphasis><property>"value"</property></emphasis> and
+ <emphasis><property>"var"</property></emphasis> attributes
+ for the <emphasis role="bold"><property><rich:tree></property></emphasis>.
+ The values for nodes to render are passed directly into the corresponding adaptor
+ and the component performs all the necessary iterative work
+ (Visit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/treeNodesAdaptor.jsf?..."><rich:treeNodesAdaptor> page</ulink> on the RichFacesLiveDemo for more details).
+ </para>
+
+ <para>
+ Implementation of the <emphasis role="bold"><property><rich:tree></property></emphasis> in the application
+ is very similar to the model shown above.
+ The top <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis>
+ in the <emphasis role="bold"><property><rich:tree></property></emphasis> in the Photo Album
+ application is responsible for shelves rendering.
+ Its <emphasis><property>"nodes"</property></emphasis> attribute refers
+ to <emphasis><property>getShelves()</property></emphasis> method of the <code>ShelfManager</code> class
+ and gets the collection of shelves associated with the current user including all shared shelves in the system.
+ Take a look at this method:
+ </para-->
+
+ <!-- para>
+ When the <emphasis><property>"nodes"</property></emphasis> attribute of the <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis>, which is responsible for shelves rendering, receives the collection of shelves,
+ the iteration process switches to the nested <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis>, which is responsible for albums.
+ The "albums" <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> <emphasis><property>"nodes"</property></emphasis> attribute refers in its turn to the <code>albums</code> field of the <code>Shelf</code> class
+ and takes a collection of all albums associated with the current shelf.
+ The "albums" <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> renders all albums that belong to the current iterating shelf and then switches back to the "shelf" <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> to render and iterate the next shelf in the shelves collection received earlier.
+ Here is how it looks in the <code>webapp/includes/index/tree.xhtml</code> file:
+ </para-->
+
+ <programlisting role="XML"><![CDATA[...
+<rich:tree adviseNodeOpened="#{treeManager.adviseNodeSelected}"
+ adviseNodeSelected="#{treeManager.adviseNodeSelected}"
+ ajaxSubmitSelection="false" id="PreDefinedTree"
+ treeNodeVar="treeNode" switchType="client"
+ iconCollapsed="/img/shell/tree_icon_plus.png"
+ iconExpanded="/img/shell/tree_icon_minus.png"
+ showConnectingLines="false">
+ <rich:treeNodesAdaptor nodes="#{shelfManager.getPredefinedShelves()}" var="shelf">
+ <rich:treeNode style="cursor:pointer" reRender="treePanel,mainArea" selectedClass="tree-selected-node">
+ <f:facet name="icon">
+ <h:graphicImage style="border: none" value="/img/shell/tree_icon_shelf.png">
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showShelf(shelf)}" similarityGroupingId="sel" />
+ </h:graphicImage>
+ </f:facet>
+ <a4j:outputPanel >
+ <h:outputText style="cursor:pointer" value="#{shelf.name}" />
+ <h:outputText value=" :: " />
+ <strong>#{shelf.unvisitedImages.size()}</strong> new
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showShelf(shelf)}" similarityGroupingId="sel" />
+ </a4j:outputPanel>
+ </rich:treeNode>
+
+ <rich:treeNodesAdaptor var="album" nodes="#{shelf.albums}">
+ <rich:treeNode style="cursor:pointer" reRender="treePanel,mainArea" selectedClass="tree-selected-node" icon="img/shell/tree_icon_album.png">
+ <f:facet name="iconLeaf">
+ <h:graphicImage style="border: none" value="img/shell/tree_icon_album.png">
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showAlbum(album)}" similarityGroupingId="sel" />
+ </h:graphicImage>
+ </f:facet>
+ <a4j:outputPanel>
+ <h:outputText style="cursor:pointer" value="#{album.name}" />
+ <h:outputText value=" :: " />
+ <strong>#{album.unvisitedImages.size()}</strong> new
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showAlbum(album)}" similarityGroupingId="sel" />
+ </a4j:outputPanel>
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+</rich:tree>
+...]]></programlisting>
+
+ <para>
+ The image below shows how the navigation tree for a guest is rendered on the page.
+ </para>
+
+ <figure>
+ <title>Shelves and albums nodes rendered with the help of the <rich:treeNodesAdaptor></title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tree.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+</section>
+
+ <section>
+ <title>Navigation tree for a registered user</title>
+ <para>
+ As it was mentioned before a navigation tree for a registered user has
+ two main features: drag-and-drop and context menu. Context menu is described
+ in the <link linkend="contextMenu">"Context menu"</link> chapter.
+ </para>
+ <para>
+ Drag-and-drop feature supported in the Photo Album application is not so complicated
+ as it may seem from the first view.
+ In this application we can mark out two types of drag-and-drop:
+ one type takes place only inside the tree (between tree nodes)
+ and another one - between the watching area and the tree.
+ The difference is not considerable enough to describe two types separately,
+ but also not at all insignificant to be omitted here.
+ </para>
+
+ <para>
+ The tree related components
+ (<emphasis role="bold"><property><rich:tree></property></emphasis> and <emphasis role="bold"><property><rich:treeNode></property></emphasis>)
+ have their own attributes that provide drag-and-drop functionality.
+ These attributes can be divided into two groups:
+ those which provide drag (dragValue, dragListener, dragIndicator, dragType attributes)
+ and those which provide drop operations (dropValue, dropListener, acceptedTypes, typeMapping).
+ </para>
+ <note>
+ <title>
+ Note:
+ </title>
+ <para>
+ Due to "Shelves - Albums - Photos" hierarchy we can say that photos could be moved between albums,
+ albums could be moved between shelves.
+ To avoid a mishmash, it's not allowed to place photos directly in shelves as well as nesting shelves
+ inside shelves or albums inside albums.
+ </para>
+ </note>
+ <para>
+ Let's explore how drag-and-drop works for albums.
+ </para>
+ <para>
+ All albums, that are represented as TreeNodes, must be marked somehow for dragging.
+ For this purpose we use previously mentioned
+ <emphasis><property>"dragValue"</property></emphasis>,
+ <emphasis><property>"dragType"</property></emphasis>
+ attributes. Let's have a look at the <code>src/main/webapp/includes/index/tree.xhtml</code> file:
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:treeNodesAdaptor var="album" nodes="#{shelf.albums}">
+ <rich:treeNode style="cursor:pointer"
+ reRender="mainArea, treePanel"
+ dragType="album"
+ dragValue="#{album}"
+ dropValue="#{album}"
+ acceptedTypes="image"
+ selectedClass="tree-selected-node"
+ icon="img/shell/tree_icon_album.png">
+ ...
+ <rich:dndParam name="label" type="drag" value="#{album.name}" />
+ ...
+ </rich:treeNode>
+</rich:treeNodesAdaptor>
+]]></programlisting>
+ <para>
+ To provide drop functionality for the marked albums, we should mark Shelves as drop zones in the application code too.
+ For this purpose we add the <emphasis><property>"dropValue"</property></emphasis> and
+ <emphasis><property>"acceptedTypes"</property></emphasis> attributes to the "Shelf" node in the same <code>src/main/webapp/includes/index/tree.xhtml</code> file:
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:treeNodesAdaptor nodes="#{shelfManager.getUserShelves()}" var="shelf">
+ <rich:treeNode style="cursor:pointer" acceptedTypes="album" dropValue="#{shelf}" reRender="mainArea, treePanel" selectedClass="tree-selected-node">
+ ...
+ </rich:treeNode>
+</rich:treeNodeAdaptor>]]></programlisting>
+ <para>
+ The <emphasis><property>"acceptedTypes"</property></emphasis> attribute tells the "Shelf" node
+ what types of dragged zones (albums in this case) it can accept.
+ We have specified "Album" node
+ <emphasis><property>"dragType"</property></emphasis> as "album",
+ so the "Shelf" node can accept it.
+ </para>
+ <para>
+ Finally in order to process drop on the server side we need to specify a listener for the <emphasis role="bold"><property><rich:tree></property></emphasis> in the <emphasis><property>"dropListener"</property></emphasis>
+ attribute (<code>src/main/webapp/includes/index/tree.xhtml</code> file):
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:tree adviseNodeOpened="#{treeManager.adviseNodeSelected}"
+ adviseNodeSelected="#{treeManager.adviseNodeSelected}"
+ ajaxSubmitSelection="false" dragIndicator="dragIndicator"
+ treeNodeVar="treeNode" switchType="client"
+ iconCollapsed="/img/shell/tree_icon_plus.png"
+ iconExpanded="/img/shell/tree_icon_minus.png"
+ dropListener="#{dndManager.processDrop}"
+ showConnectingLines="false">
+ ...
+</tree>]]></programlisting>
+ <para>
+ The code for the <emphasis role="bold"><property><rich:dragIndicator></property></emphasis> looks like the following:
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:dragIndicator id="dragIndicator" />]]></programlisting>
+
+
+ <para>
+ The <code>processDrop()</code> method of <code>DnDManager.java</code> class is shown in the listing below:
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+public void processDrop(DropEvent dropEvent) {
+ Dropzone dropzone = (Dropzone) dropEvent.getComponent();
+ Object dragValue = dropEvent.getDragValue();
+ Object dropValue = dropzone.getDropValue();
+ if(dragValue instanceof Image){
+ if(!((Album)dropValue).getOwner().getLogin().equals(user.getLogin())){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.DND_PHOTO_ERROR);
+ return;
+ }
+ handleImage((Image)dragValue, (Album)dropValue);
+ }else if(dragValue instanceof Album){
+ if(!((Shelf)dropValue).getOwner().getLogin().equals(user.getLogin())){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.DND_ALBUM_ERROR);
+ return;
+ }
+ handleAlbum((Album)dragValue, (Shelf)dropValue);
+ }
+}
+...]]></programlisting>
+ <para>
+ Here is the whole example of the "Navigation tree for a registered user":
+ </para>
+ <programlisting role="XML"><![CDATA[<h:panelGroup id="tree" rendered="#{identity.hasRole('admin')}" layout="block">
+ <a4j:commandLink actionListener="#{controller.selectShelves()}" reRender="mainArea, treePanel"><h2><h:outputText value="My shelves:"/></h2></a4j:commandLink><br/>
+ <rich:dragIndicator
+ id="dragIndicator" />
+ <rich:tree
+ adviseNodeOpened="#{treeManager.adviseNodeSelected}"
+ adviseNodeSelected="#{treeManager.adviseNodeSelected}"
+ ajaxSubmitSelection="false" dragIndicator="dragIndicator"
+ treeNodeVar="treeNode" switchType="client"
+ iconCollapsed="/img/shell/tree_icon_plus.png"
+ iconExpanded="/img/shell/tree_icon_minus.png"
+ dropListener="#{dndManager.processDrop}"
+ showConnectingLines="false">
+
+ <f:facet name="icon">
+ <h:graphicImage style="border: none" value="/img/shell/tree_icon_shelf.png">
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showShelf(shelf)}" similarityGroupingId="sel" />
+ </h:graphicImage>
+ </f:facet>
+ <ui:include src="/includes/contextMenu/CMForShelf.xhtml" >
+ <ui:param name="shelf" value="#{shelf}" />
+ </ui:include>
+ <a4j:outputPanel>
+ <h:outputText style="cursor:pointer" value="#{shelf.name}" />
+ <h:outputText value=" :: " />
+ <strong>#{shelf.unvisitedImages.size()}</strong> new
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showShelf(shelf)}" similarityGroupingId="sel" />
+ </a4j:outputPanel>
+ </rich:treeNode>
+
+ <rich:treeNodesAdaptor var="album"
+ nodes="#{shelf.albums}">
+ <rich:treeNode style="cursor:pointer" reRender="mainArea, treePanel" dragType="album"
+ dragValue="#{album}" dropValue="#{album}"
+ acceptedTypes="image"
+ selectedClass="tree-selected-node"
+ icon="img/shell/tree_icon_album.png">
+ <f:facet name="iconLeaf">
+ <h:graphicImage style="border: none" value="img/shell/tree_icon_album.png">
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showAlbum(album)}" similarityGroupingId="sel" />
+ </h:graphicImage>
+ </f:facet>
+ <ui:include src="/includes/contextMenu/CMForAlbum.xhtml" >
+ <ui:param name="album" value="#{album}" />
+ </ui:include>
+ <rich:dndParam name="label" type="drag" value="#{album.name}" />
+ <a4j:outputPanel >
+ <h:outputText style="cursor:pointer" value="#{album.name}" />
+ <h:outputText value=" :: " />
+ <strong>#{album.unvisitedImages.size()}</strong> new
+ <a4j:support reRender="treePanel, mainArea" event="onclick" actionListener="#{controller.showAlbum(album)}" similarityGroupingId="sel" />
+ </a4j:outputPanel>
+ </rich:treeNode>
+
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+
+ </rich:tree>
+ </h:panelGroup>]]></programlisting>
+ <para>
+ The image below shows how the described above drag-and-drop features are rendered in the Photo Album.
+ </para>
+ <figure>
+ <title>Dragging the "Flora" album from "Sport" shelf into the "Nature" (left) and the tree after drag-and-drop (right).</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/dnd.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>
+ Visit following pages at RichFaces Live Demo for more information, examples and sources on the components used in the application and described in this chapter:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?c=tree">Tree</ulink> for the <emphasis role="bold"><property><rich:tree></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/treeNodesAdaptor.jsf?...">TreeNodesAdaptor</ulink> for the <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dra...">DragIndicator</ulink> for the <emphasis role="bold"><property><rich:dragIndicator></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dnd...">DragDropParameter</ulink> for the <emphasis role="bold"><property><rich:dndParam></property></emphasis> component.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+
+ </section>
+</section>
+
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/shelfView.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/shelfView.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/shelfView.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="shelfView">
+ <title>Shelf View</title>
+ <para>
+ Work in progress...
+ </para>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/shelfView.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="skinnability" xreflabel="skinnability">
+<?dbhtml filename="skinnability.html"?>
+ <title>Skinnability</title>
+ <para>
+
+ The Photo Album application employs such feature of RichFaces framework as skinnability. If you have a look at the web.xml you will see that the <code>
+ org.richfaces.SKIN
+ </code>
+ parameter has "photoalbum" value.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>photoalbum</param-value>
+ </context-param>
+...]]></programlisting>
+ <para>
+ This means that the application uses the custom "photoalbum" skin. The skin parameters are stored in the <code>photoalbum.skin.properties</code> file that is located in the
+ <code>photoalbum\source\web\src\main\resources\META-INF\skins\</code> folder.
+ </para>
+ <para>
+ Each visual RichFaces component has a XCSS file where some CSS selectors are defined with style properties mapped to the skin parameters. Here is a fragment of the XCSS file of <emphasis role="bold"><property><rich:calendar></property></emphasis>.
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+ <u:selector name=".rich-calendar-header">
+ <u:style name="border-bottom-color" skin="panelBorderColor"/>
+ <u:style name="background-color" skin="additionalBackgroundColor"/>
+ <u:style name="font-size" skin="generalSizeFont"/>
+ <u:style name="font-family" skin="generalFamilyFont"/>
+ </u:selector>
+ ...]]></programlisting>
+ <para>This code sets style for upper part of the calendar. Hence, for example, <code>font-family</code> property is mapped to the <code>generalFamilyFont</code> property which in its turn has <code>Arial, Verdana, sans-serif</code> value. </para>
+ <para>These are all values the <code>.rich-calendar-header</code> has.</para>
+ <programlisting role="XML"><![CDATA[...
+panelBorderColor=#636363
+additionalBackgroundColor=#F2F2F2
+generalSizeFont=11px
+generalFamilyFont=Arial, Verdana, sans-serif
+...]]></programlisting>
+
+ <para>
+ You can find more information about the Skinnability feature in <ulink url="&devguide;/#Skinnability">RichFaces Developer Guide</ulink>.
+ </para>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/tooltips.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/tooltips.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/tooltips.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="tooltips">
+ <title>ToolTips </title>
+ <para>
+ When using RichFaces components library you've got nealy everything to build UI, making a tooltip is not an exception. RichFaces provides a separate component to make a bubble appeare when the user hovers a UI element or layout area.
+ The component is <emphasis role="bold"><property><rich:toolTip></property></emphasis>.
+ There's nothing complicated in using <emphasis role="bold"><property><rich:toolTip></property></emphasis>: you just need to set the text to be shown in the tooltip with the <emphasis><property>"value"</property></emphasis> attribute and specify for which component you want the tooltip to be shown with the <emphasis><property>"for"</property></emphasis> attribute that takes the id of the targeted component as a parameter.
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<rich:panel id="panelId">
+<p>Element which has a tooltip</p>
+</rich:panel>
+<rich:toolTip value="This is a tooltip." for="panelId"/>
+...]]></programlisting>
+
+ <para>
+ Alternatively, you can just place <emphasis role="bold"><property><rich:toolTip></property></emphasis> as a nested element of container for which the tooltip is shown.
+
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[...
+<div>
+<p>Element which has a tooltip</p>
+
+<rich:toolTip>
+<p>Tooltip text</p>
+</rich:toolTip>
+</div>
+...]]></programlisting>
+ <para>This approach was adopted in the Photo Alum to display tooltips for </para>
+
+ <para>
+ This code outputs an album's image.
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<a4j:mediaOutput id="img" element="img" styleClass="main-image"
+ createContent="#{imageLoader.paintImage}" style="border : 3px solid #808080;"
+ value="#{fileManager.transformPath(model.selectedImage.fullPath, '_medium')}">
+
+</rich:dragSupport>
+ <rich:toolTip followMouse="true" direction="top-right"
+ showDelay="500" styleClass="tooltip" rendered="#{model.selectedImage.showMetaInfo}">
+ <span style="white-space:nowrap; display:block; text-align:left;">
+ <h:outputText value="Size in bytes: #{model.selectedImage.size}" />
+ <br />
+ <h:outputText
+ value="#{messages['original_size']}: #{model.selectedImage.height}x#{model.selectedImage.width}" />
+ <br />
+ <h:outputText value="Captured at: #{model.selectedImage.created}" />
+ <br />
+ <h:outputText
+ value="#{messages['camera']}: #{model.selectedImage.cameraModel}" />
+ </span>
+ </rich:toolTip>
+</a4j:mediaOutput>
+...]]></programlisting>
+
+ <para>The <emphasis role="bold"><property><rich:toolTip></property></emphasis> is nested in <emphasis role="bold"><property><a4j:mediaOutput></property></emphasis>
+and prints the size of the image, size in pixels, when the picture was taken and the type of camera used to take the picture.
+ </para>
+ <figure>
+ <title>Tooltip</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tooltip.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/tooltips.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/uploadImages.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/uploadImages.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/uploadImages.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <title>Upload Images</title>
+ <para>
+ In the previous chapter we have discussed how to create Navigation Trees
+ that represent "Shelves - Albums" hierarchy.
+ Now it is time to upload images.
+ </para>
+ <para>
+ The <emphasis role="bold"><property><rich:fileUpload></property></emphasis> component
+ in the Photo Album application uses the embedded Flash module
+ that adds extra functionality to the component:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>Multiple files choosing;</para>
+ </listitem>
+ <listitem>
+ <para>Definition of permitted file types in the "Open File" dialog window;</para>
+ </listitem>
+ <listitem>
+ <para>A number of additional client-side object properties.</para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The code for the <emphasis role="bold"><property><rich:fileUpload></property></emphasis> is contained in the "/includes/fileUpload/fileUploader.xhtml" page:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload
+ allowFlash="true" maxFilesQuantity="100" autoclear="true"
+ fileUploadListener="#{fileUploadManager.listener}" id="fileUpload"
+ disabled="#{model.selectedAlbum == null}"
+ immediateUpload="false" acceptedTypes="jpg,jpeg">
+ <a4j:support event="onuploadcomplete" reRender="filesPanel, treeform" actionListener="#{fileWrapper.setComplete(true)}"/>
+ <a4j:support event="onfileuploadcomplete" />
+</rich:fileUpload>
+...]]></programlisting>
+ <para>
+ The <emphasis><property>"allowFlash"</property></emphasis> attribute set to "true"
+ enables the Flash module.
+ </para>
+ <para>
+ The <emphasis><property>"acceptedTypes"</property></emphasis> attribute
+ specifies "jpg", "jpeg" as the permitted file types you can upload.
+ </para>
+ <para>
+ The <emphasis><property>"fileUploadListener"</property></emphasis> attribute
+ represents the action listener method <code>listener()</code> of the <code>FileUploadManager</code>
+ class that is notified after file is uploaded.
+ This method makes the main job on the upload:
+ </para>
+<programlisting role="JAVA"><![CDATA[...
+ public void listener(UploadEvent event) throws Exception {
+ UploadItem item = event.getUploadItem();
+ Image image = constructImage(item);
+ try {
+ extractMetadata(item, image);
+ } catch (Exception e1) {
+ addError(item, image, Constants.FILE_PROCESSING_ERROR);
+ return;
+ }
+ image.setAlbum(model.getSelectedAlbum());
+ if(image.getAlbum() == null){
+ addError(item, image, Constants.NO_ALBUM_TO_DOWNLOAD_ERROR);
+ return;
+ }
+ try{
+ if(imageAction.isImageWithThisPathExist(image)){
+ image.setPath(generateNewPath(image.getPath()));
+ }
+ imageAction.addImage(image);
+ }catch(Exception e){
+ addError(item, image, Constants.IMAGE_SAVING_ERROR);
+ return;
+ }
+ if(!fileManager.addImage(image.getFullPath(), item.getFile().getPath())){
+ addError(item, image, Constants.FILE_SAVE_ERROR);
+ return;
+ }
+ fileWrapper.getFiles().add(image);
+ Events.instance().raiseEvent(Constants.IMAGE_ADDED_EVENT, image);
+ item.getFile().delete();
+ }
+...]]></programlisting>
+ <para>
+ The <code>listener()</code> method is called at server side after every file uploaded
+ and server saves these files in a temporary folder or in RAM depending on configuration.
+ In the Photo Album application the uploaded files are stored in the temporary folder
+ because the value of the <code>createTempFile</code> parameter is set to <code>true</code>.
+ See the code from the <code>web.xml</code> descriptor:
+ </para>
+
+<programlisting role="XML"><![CDATA[...
+<filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ <init-param>
+ <param-name>createTempFiles</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>20000000</param-value>
+ </init-param>
+</filter>
+...]]></programlisting>
+ <para>
+ The <code>listener()</code> method creates an <code>Image</code> object
+ and extracts all image metadata such as Camera name, Image size, etc.
+ It performs scaling of an image and saves six different image's dimentions in order to create thumbnails.
+ After that the photo is added into the database
+ the temporary file is removed.
+ </para>
+
+ <para>
+ Visit following pages at RichFaces Live Demo for more information, examples and sources on the components used in the application and described in this chapter:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf?c=file...">FileUpload</ulink> page for the <emphasis role="bold"><property><rich:fileUpload></property></emphasis> component;
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/support.jsf?c=support">AjaxSupport</ulink> for the <emphasis role="bold"><property><a4j:suport></property></emphasis> component.
+ </para>
+ </listitem>
+
+
+ </itemizedlist>
+
+
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/uploadImages.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/usedComponents.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/usedComponents.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/usedComponents.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="usedComponents" xreflabel="usedComponents">
+<?dbhtml filename="usedComponents.html"?>
+ <title>Used Components</title>
+ <para>
+ Have a look at the list of components used in the <property>Photo Album</property> application.
+ </para>
+ <table>
+ <title>Components used in "Photo Album Demo"</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><a4j:commandLink></entry>
+ <entry>The component is very similar to the <h:commandLink> component, the only difference is that an Ajax form submit is generated on a click and it allows dynamic rerendering after a response comes back. It's not necessary to plug any support into the component, as Ajax support is already built in.</entry>
+ </row>
+ <row>
+ <entry><a4j:commandButton></entry>
+ <entry>The component is very similar to the <h:commandButton> component, the only difference is that an Ajax form submit is generated on a click and it allows dynamic rerendering after a response comes back. It's not necessary to plug any support into the component, as Ajax support is already built in.</entry>
+ </row>
+ <!-- row>
+ <entry>a4j:push</entry>
+ <entry>The component periodically perform Ajax request to the server, to simulate 'push' data.</entry>
+ </row-->
+ <row>
+ <entry><a4j:poll></entry>
+ <entry>The component allows periodical sending of Ajax requests to the server and is used for a page update according to a specified time interval.</entry>
+ </row>
+ <row>
+ <entry><rich:calendar></entry>
+ <entry>The component is used for creating monthly calendar elements on a page.</entry>
+ </row>
+ <row>
+ <entry><rich:contextMenu></entry>
+ <entry>The component is used for creation of multileveled context menus that are activated after a user defines an event ("onmouseover", "onclick", etc.) on any element on the page.</entry>
+ </row>
+ <row>
+ <entry><rich:dataGrid></entry>
+ <entry>The component to render data as a grid that allows choosing data from a model and obtains built-in support of Ajax updates.</entry>
+ </row>
+ <row>
+ <entry><rich:datascroller></entry>
+ <entry>The component is designed for providing the functionality of tables scrolling using Ajax requests.</entry>
+ </row>
+ <row>
+ <entry><rich:fileUpload></entry>
+ <entry>The component is designed to perform Ajax-ed files upload to the server.</entry>
+ </row>
+ <row>
+ <entry><rich:inplaceInput></entry>
+ <entry>The component is an input component used for displaying and editing data inputted. </entry>
+ </row>
+ <row>
+ <entry><rich:inplaceSelect></entry>
+ <entry>The component is used to create select based inputs: it shows the value as text in one state and enables editing the value, providing a list of options in another state.</entry>
+ </row>
+ <row>
+ <entry><rich:mediaOutput></entry>
+ <entry>The component implements one of the basic features specified in the framework. The component is a facility for generating images, video, sounds and other binary resources defined by you on-the-fly.</entry>
+ </row>
+ <row>
+ <entry><rich:modalPanel></entry>
+ <entry>The component implements a modal dialog window. All operations in the main application window are locked out while this window is active. Opening and closing the window is done with client JavaScript code.</entry>
+ </row>
+ <row>
+ <entry><rich:progressBar></entry>
+ <entry>The component is designed for displaying a progress bar which shows the current status of the process. </entry>
+ </row>
+ <row>
+ <entry><rich:tree></entry>
+ <entry>The component is designed for hierarchical data presentation and is applied for building a tree structure with a drag-and-drop capability. The component also uses built-in drag and drop.</entry>
+ </row>
+
+
+ </tbody>
+ </tgroup>
+ </table>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/usedComponents.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/userPreferencesView.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/userPreferencesView.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/userPreferencesView.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="userPrefView">
+ <title>User Preferences View</title>
+ <para>
+ Work in progress...
+ </para>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/userPreferencesView.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/validators.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/validators.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/validators.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="Validators">
+ <title>User Input Data Validation</title>
+ <para>
+ Validation of user input is a very frequent situation for a developer. RichFaces library offers 3 component to get this job done:
+ <emphasis role="bold"><property><rich:beanValidator></property></emphasis>, <emphasis role="bold"><property><rich:graphValidator></property></emphasis>,
+
+ and <emphasis role="bold"><property><rich:ajaxValidator></property></emphasis>. The latter two components are used in the Photo Album application. <emphasis role="bold"><property><rich:graphValidator></property></emphasis> is intended to validate the whole object or the graph of interrelated objects and the validation occurs when the whole form is submitted. While <emphasis role="bold"><property><rich:ajaxValidator></property></emphasis> validates only one input field or a value at a time, validation is activated upon some event and adds interactivity to the application.
+ Both components use Hibernate validators which helps to locate validation logic in one place, such approach is really helpful given that usually data validation logic is stored in multiple places including UI pages and in Java code that interacts with a database.
+ </para>
+ <para>
+
+ Let's have a look at the components usage on the registration page. This is how the page looks like (some irrelevant details were removed from the example):
+
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition xmlns="http://www.w3.org/1999/xhtml" ...
+
+ <rich:graphValidator>
+ ...
+ <h:inputText id="loginName" value="#{user.login}" />
+ <rich:messages for="loginName" />
+ <h:inputSecret required="true" id="password" value="#{user.password}" />
+ <rich:messages for="password" />
+ <h:inputSecret required="true" id="confirmPassword"
+ value="#{user.confirmPassword}" />
+ <rich:messages for="confirmPassword" />
+ <h:inputText id="firstname" value="#{user.firstName}" />
+ <rich:messages for="firstname" style="color:red;" />
+ <h:inputText id="secondname" value="#{user.secondName}" />
+ <rich:messages for="secondname" />
+ <h:selectOneRadio required="true" id="sex" value="#{user.sex}">
+ <f:selectItems value="#{userPrefsBean.sexs}" />
+ <s:convertEnum />
+ </h:selectOneRadio>
+ <rich:messages for="sex" />
+ <a4j:outputPanel id="calendar" layout="block">
+ <rich:calendar id="birthDate" value="#{user.birthDate}"
+
+ <rich:ajaxValidator event="oninputblur" />
+ </rich:calendar>
+ </a4j:outputPanel>
+ <rich:messages for="birthDate" />
+ <h:inputText id="email" value="#{user.email}" />
+ <rich:messages for="email" />
+ </rich:graphValidator>
+ <richx:commandButton actionListener="#{authenticator.register(user)}"
+ value="Register" />
+ <richx:commandButton actionListener="#{controller.cancelRegistration()}"
+ immediate="true" value="Cancel" />
+</ui:composition>
+
+...]]></programlisting>
+
+ <para>
+
+ <emphasis role="bold"><property><rich:graphValidator></property></emphasis> validates the entity User object, in which restrictions are set with the help of Hibernate annotations.
+ When the <emphasis role="bold" >Register</emphasis> button is clicked on the <property>name, password, sex</property> etc. fields are validated sequentially. In case of an error (for example, if a <property>loginName</property> contains only on character and the annotation restricts it to at least 3 characters to be typed in) a error message in red color is displayed next to the input field and the request is aborted. If all values are valid the <code>authenticator.register(user)</code> method will be invoked and the user will be saved to the database.
+
+ </para>
+ <para>
+ <emphasis role="bold"><property><rich:ajaxValidator></property></emphasis> acts in a slightly different way, in our case it is attached to the <code>user.birthDate</code> field. When the value of the field is changed and the field loses focus it is immediately validated. If the input data is incorrect and error message will displayed, which is a quick way to respond to user input errors and avoid sending incorrect data to the server.
+
+ </para>
+ <para>
+ If you would like to get more details about the validators that RichFaces library provides please visit <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxValidator.jsf">Live Demo</ulink> web page and <ulink url="&devguide;" >RichFaces Developer Guide</ulink>.
+
+ </para>
+</section>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/includes/validators.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/master.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/master.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/master.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+"http://www.docbook.org/xml/4.3CR3/docbookx.dtd" [
+ <!ENTITY intro SYSTEM "modules/intro.xml">
+ <!ENTITY application_overview SYSTEM "modules/application_overview.xml">
+ <!ENTITY overview SYSTEM "modules/overview.xml">
+ <!ENTITY getting_started SYSTEM "modules/getting_started.xml">
+
+
+ <!ENTITY skinnability SYSTEM "includes/skinnability.xml">
+ <!ENTITY usedComponents SYSTEM "includes/usedComponents.xml">
+ <!ENTITY navigationPanel SYSTEM "includes/navigationPanel.xml">
+ <!ENTITY uploadImages SYSTEM "includes/uploadImages.xml">
+ <!ENTITY shelfView SYSTEM "includes/shelfView.xml">
+ <!ENTITY albumView SYSTEM "includes/albumView.xml">
+ <!ENTITY errorsReports SYSTEM "includes/errorsReports.xml">
+ <!ENTITY imageView SYSTEM "includes/imageView.xml">
+ <!ENTITY contextMenu SYSTEM "includes/contextMenu.xml">
+ <!ENTITY tooltips SYSTEM "includes/tooltips.xml">
+ <!ENTITY hiw SYSTEM "includes/hiw.xml">
+ <!ENTITY validators SYSTEM "includes/validators.xml">
+ <!ENTITY button SYSTEM "includes/button.xml">
+ <!ENTITY a4j_status SYSTEM "includes/a4j_status.xml">
+
+ <!ENTITY cdkguide "../../cdkguide/html_single/index.html">
+ <!ENTITY devguide "../../devguide/html_single/index.html">
+ <!ENTITY migrationguide "../../migrationguide/html_single/index.html">
+ <!ENTITY photoalbumguide "../../realworld/html_single/index.html">
+ <!ENTITY realworld "../../realworld/html_single/index.html">
+ <!ENTITY tlddoc "../../tlddoc/index.html">
+ <!ENTITY apidoc "../../apidoc/index.html">
+ <!ENTITY apidoc_framework "../../apidoc_framework/index.html">
+
+]>
+
+<book>
+ <bookinfo>
+ <title>RichFaces Photo Album Application Guide</title>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject role="fo">
+ <imagedata format="PNG" fileref="images/richfaces_logo.png" />
+ </imageobject>
+ <imageobject role="html">
+ <imagedata/>
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <subtitle>This documentation is work in progress, thus some mistakes or incompleteness is possible</subtitle>
+ <author>
+ <firstname>Alex</firstname>
+ <surname>Tsebro</surname>
+ <email>atsebro(a)exadel.com</email>
+ </author>
+ <author>
+ <firstname>Svetlana</firstname>
+ <surname>Mukhina</surname>
+ <email>smukhina(a)exadel.com</email>
+ </author>
+ <author>
+ <firstname>Gleb</firstname>
+ <surname>Galkin</surname>
+ <email>ggalkin(a)exadel.com</email>
+ </author>
+ <author>
+ <firstname>Michael</firstname>
+ <surname>Sorokin</surname>
+ <email>msorokin(a)exadel.com</email>
+ </author>
+ <copyright>
+ <year>2009</year>
+ <holder>Red Hat</holder>
+ </copyright>
+
+ <!--<abstract>
+ <title/>
+ <para>
+ <ulink url="../../migrationguide/pdf/richfaces_migration_guide.pdf">PDF version</ulink>
+ </para>
+ </abstract> -->
+
+ </bookinfo>
+ <toc/>
+ &intro;
+ &getting_started;
+ &overview;
+ <!-- &application_overview; -->
+ <chapter id="patterns" xreflabel="patterns">
+ <?dbhtml filename="patterns.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>How it works</title>
+ <para>
+ In this chapter we explain how the Photo Album works.
+ </para>
+ <?forseChanks?>
+
+ &usedComponents;
+ &skinnability;
+ &navigationPanel;
+ <!-- &shelfView; -->
+ &albumView;
+ &imageView;
+ &uploadImages;
+ &contextMenu;
+ &tooltips;
+ &validators;
+ &button;
+ &a4j_status;
+ <!-- &hiw; -->
+ &userPreferencesView;
+ &errorsReports;
+ </chapter>
+</book>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/master.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/application_overview.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/application_overview.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/application_overview.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="app_over" xreflabel="app_over">
+ <?dbhtml filename="app_over.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+
+ </keywordset>
+ </chapterinfo>
+
+ <title>Application Overview</title>
+
+ <!-- section><title>Used technologies</title>
+ <para>
+ The Photo Album Demo application is not only a JSF application. It encompasses various technologies and frameworks:
+ </para>
+ <itemizedlist>
+ <listitem><para><emphasis>Java Server Faces (JSF)</emphasis>, technology that provides a single, standard, efficient way to use Java technologies to build Web-based applications;</para></listitem>
+ <listitem><para><emphasis>Facelets</emphasis>, technology that combines the power of UI components and the flexibility of XML to accelerate JSF development. Facelets presents a compelling alternative to JSP as the markup technology of choice for next-generation JSF applications;</para></listitem>
+ <listitem><para><emphasis>Asynchronous JavaScript and XML (AJAX)</emphasis>, several incorporated technologies. Ajax binds together standards-based presentation using XHTML and CSS, dynamic display and interaction using the DOM, data interchange and manipulation using XML and XSLT, asynchronous data retrieval using XMLHttpRequest and JavaScript;</para></listitem>
+ <listitem><para><emphasis>Enterprise Java Beans (EJB) 3.0</emphasis>, technology for development of server-side component architecture for Java Platform, Enterprise Edition (Java EE);</para></listitem>
+ <listitem><para><emphasis>Seam</emphasis> technology that integrates previous mentioned technologies with Java Persistence (JPA), Enterprise Java Beans (EJB 3.0) and Business Process Management (BPM) into a unified full-stack solution;</para></listitem>
+ <listitem><para><emphasis>RichFaces</emphasis>, a framework and library of Ajax-capable UI components for JSF framework that had been evolved from Ajax4JSF framework (merge of Ajax and JavaServer Faces technologies).</para></listitem>
+
+ </itemizedlist>
+ </section-->
+
+ <section>
+ <title>General overview</title>
+ <para>
+ While designing the <property>Photo Album Demo</property>, one of the goal was to create a well-structured and transparent system, which will provide a photo-album-like functionality on one hand and demonstrate the main benefits of the <property>RichFaces</property> on the other.
+ Thinking within the bounds of the <property>RichFaces</property> library only we could get is an application flooded with modal panels, toggles and other controls where they are necessary and where are not.
+ Developing just a photo album could cause missing the goal to demonstrate the components functionality.
+ That’s why the development of the application was started with brewing of Rich component use cases. Some smart cases of using the components were found.
+ </para>
+ <para>
+ The clickable prototype of the application (a scope of graphic images linked with HTML graphic map) is available for download at
+ <ulink url="https://anonsvn.jboss.org/repos/richfaces/management/design/realWorldDemo...">https://anonsvn.jboss.org/repos/richfaces/management/design/realWorldDemo...</ulink>
+ </para>
+ <para>
+ In order to document the key concepts and conceptual representation of data of the <property>Photo Album Demo</property> application the Entity Relation Diagram (ERD) is created.
+ The diagram also identifies the relationships among all major entities within the system and their significant methods and attributes.
+ It provides a structural view of the system that can be complemented by other dynamic views in use case models.
+ </para>
+
+ <figure>
+ <title>The Photo Album Demo Entity Relation Diagram</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/erd.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>
+ An important benefit of an entity relation diagram is that it describes and constrains the system scope.
+ It is also used to verify and validate the understanding of the problems among various stakeholders of a project group.
+ It is especially useful as a communication tool and a focusing point between technical and business teams.
+ </para>
+
+ <para>
+ To create a Seam application with <property>RichFaces</property> and Facelets project structure, use special archetype that could be found at
+ <ulink url="https://anonsvn.jboss.org/repos/richfaces/trunk/cdk/maven-archetype-seam-...">https://anonsvn.jboss.org/repos/richfaces/trunk/cdk/maven-archetype-seam-...</ulink> directory.
+ For this purpose the Maven should be installed and configured (see the "Environment Configuration" chapter).
+ This archetype represents a project template.
+ </para>
+ <para>
+ The following steps describe how to use this archetype:
+ </para>
+ <itemizedlist>
+ <listitem><para>Create a new project directory on your hard disk;</para></listitem>
+ <listitem><para>Browse to the directory with the archetype (<code>richfaces\cdk\maven-archetype-seam-app</code>), switch to the command line and type the next command <code>mvn install</code> to install the archetype in your repository;</para></listitem>
+ <listitem><para>Then browse to your project directory and type in the command line</para>
+ <para><code>mvn archetype:generate </code></para>
+ <para><code>-DarchetypeGroupId=org.richfaces.cdk </code></para>
+ <para><code>-DarchetypeArtifactId=maven-archetype-seam-app </code></para>
+ <para><code>-DarchetypeVersion=3.3.0-SNAPSHOT </code></para>
+ <para><code>-DgroupId=[Your_project_group_id] </code></para>
+ <para><code>-DartifactId=[Your_project_name] </code></para>
+ <para>Some project preferences such as <property>RichFaces</property> components version or Jboss server version and others could be customized in the root <code>.pom</code> file </para>
+ </listitem>
+ <listitem><para>Type <code>mvn install</code>;</para></listitem>
+ <listitem><para>Type <code>mvn eclipse:eclipse</code> to generate eclipse project </para></listitem>
+ <listitem><para>Import projects into your IDE.</para></listitem>
+ </itemizedlist>
+
+ <para>
+ View the generated project structure. It keeps three main modules called <code>ear</code>, <code>ejb</code> and <code>web</code>.
+ This is a typical Seam project structure.
+ </para>
+
+ <para>
+ The <code>ear</code> module generated with the help of this archetype contains <code>jboss-app.xml</code> file:
+ </para>
+ <programlisting role="XML"><![CDATA[<jboss-app>
+ <loader-repository>
+ seam.jboss.org:loader=photoalbum-ear-1.0-SNAPSHOT.ear
+ </loader-repository>
+</jboss-app>]]>
+ </programlisting>
+
+ <para>
+ The loader repository is a specific feature of JBoss projects architecture.
+ It's used to prevent classes of one application being used by classes of another application when two or more applications running on the same server.
+ Jboss class loading uses the concept of a class loader repository.
+ It needs a little getting used to, so some its features should be described:
+ </para>
+
+ <itemizedlist>
+ <listitem><para>Each of dynamically deployed files (EAR, WAR, EJB jar, RAR and SAR) is loaded with a new subordinate class loader; </para></listitem>
+ <listitem><para>However the files also register themselves with a loader repository;</para></listitem>
+ <listitem><para>These class loaders at first ask the repository and then load their own classes;</para></listitem>
+ <listitem><para>They may also decide to become the head of a new loader repository;</para></listitem>
+ <listitem><para>Classes loaded into child loader repositories are not visible to parent loader repositories;</para></listitem>
+ <listitem><para>The order in which the class loaders are added to the repository matters.</para></listitem>
+ </itemizedlist>
+
+ <para>
+ The EJB module contains the entity diagram classes and the classes for interaction with a database. The structure of EJB module is illustrated below:
+ </para>
+
+ <figure>
+ <title>The Photo Album Demo EJB module structure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ejb_struct.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>
+ The WEB module structure contains <code>.xhtml</code> sources that looks similar to a usual JSF application. The structure of WEB module is illustrated below:
+ </para>
+
+ <figure>
+ <title>The Photo Album Demo EJB module structure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/web_struct.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Since the Photo Album Demo uses the Facelets technology the main page <code>index.xhtml</code> represents an <include> (or facelet) wrapped with the <emphasis role="bold"><ui:composition></emphasis> tag.
+ This tag is used to trim unnecessary markup in the facelet.
+ Any content outside of <emphasis role="bold"><ui:composition></emphasis> tag is ignored by the Facelets view handler.
+ A facelet can be incorporated into another page or facelet with the help of <emphasis role="bold"><ui:define></emphasis> and <emphasis role="bold"><ui:include></emphasis> tags pointed to by the <emphasis role="bold"><ui:include></emphasis> "src" attribute.
+ The facelet may simply contain a fragment of XHTML or XML to be included.</para>
+
+ <para>Here is <code>index.xhtml</code> page source code:</para>
+ <programlisting role="XML"><![CDATA[<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:richx="http://richfaces.org/richx"
+ template="layout/template.xhtml">
+
+ <ui:define name="searchWidget">
+ <ui:include src="includes/search/searchWidget.xhtml" />
+ </ui:define>
+
+ <ui:define name="menu">
+ <ui:include src="/includes/index/menu.xhtml" />
+ </ui:define>
+
+ <ui:define name="tree">
+ <ui:include src="/includes/index/tree.xhtml" />
+ </ui:define>
+
+ <ui:define name="body">
+ <h:panelGroup id="mainArea" layout="block">
+ <h:panelGroup styleClass="content_box" layout="block">
+ <ui:include src="#{model.mainArea.template}" />
+ </h:panelGroup>
+ <ui:include src="includes/misc/errorPanel.xhtml" />
+ </h:panelGroup>
+ </ui:define>
+
+</ui:composition>]]>
+ </programlisting>
+
+ <para>The snippet above shows that the <code>index.xhtml</code> page does not contain sources for application functional parts but includes them as templates that are rendered depending on conditions and events taking place during user interaction with the Photo Album Demo.
+ The picture below shows <code>index.xhtml</code> page schematically with all its "includes" and paths to them:</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/indexxhtml.png"/>
+ </imageobject>
+ </mediaobject>
+
+
+ </section>
+
+
+</chapter>
+
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/application_overview.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="getting_started" xreflabel="getting_started">
+ <?dbhtml filename="getting_started.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+
+ </keywordset>
+ </chapterinfo>
+ <title>Getting started</title>
+ <section>
+ <title>Environment Configuration</title>
+ <para>
+ In order to download, build, modify, and deploy the Photo Album application
+ you need to have the following installed and configured:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://java.sun.com/javase/downloads/index.jsp">JDK 1.5 and higher</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://maven.apache.org/download.html">Maven 2.0.10</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.org/tools">JBoss Tools</ulink>
+ (or <ulink url="http://www.eclipse.org/">Eclipse</ulink>)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.org/jbossas/downloads/">JBoss Server</ulink> (4.2.3.GA, 5.0.x.GA)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://subversion.tigris.org/">SVN client</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Installation</title>
+ <para>
+ Once you have configured the environment you can install the Photo Album application:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>Checkout the project</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[svn co http://anonsvn.jboss.org/repos/richfaces/trunk/examples/photoalbum/]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Build the project</emphasis>.
+ Open command line console,
+ point to the folder with checkouted project,
+ and tell Maven:
+ </para>
+ <programlisting role="XML"><![CDATA[mvn clean install eclipse:eclipse -Dwtpversion=1.5]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Import the project into Eclipse IDE</emphasis>.
+ You can just deploy Photo Album application onto the server, but
+ the convenient way is to import the project into your IDE.
+ We recommend Eclipse with JBoss Tools since this bundle is more preferable to
+ ensure rapid development process with Seam and RichFaces.
+ You can find a step-by-step tutorial "Importing existing projects"
+ at the
+<ulink url="http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.user/task...">Eclipse documentation</ulink> page
+or simply in the <emphasis>Help</emphasis> > <emphasis>Help Contents</emphasis> of the Eclipse.
+ <!--
+ Steps to follow for JBDS users:
+ click <code>File</code> -> <code>Import</code> and select <code>Existing project into Workspace</code> as import source;
+ in <code>Import Project</code> window click <code>Browse</code> button and point to the realworld project folder; сlick <code>OK</code>.
+ -->
+ As the result three modules of Photo Album project appear in the Workspace:
+ </para>
+ <figure>
+ <title>Modules of Photo Album in the Workspace</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/modulesList.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Add JBoss AS</emphasis>.
+ Now you need to add JBoss Application Server runtime.
+
+ Detailed instructions on how you can do it are given in the
+ <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html/runtimes_ser...">Runtimes and Servers in the JBoss AS plugin</ulink>
+ chapter from the <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html/index.html">JBoss Server Manager Reference Guide</ulink>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Run photoalbum-ear-1.0-SNAPSHOT</emphasis> on the JBoss Application Server
+ you have just installed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Browse to <code>http:/localhost:8080/photoalbum</code>.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <tip>
+ <title>Tip:</title>
+ <para>
+ By default Photo Album is assembled with a limited set of images (4-5 in each album).
+ In order to build the version of the application with a full set of images you need to use <property>livedemo</property> profile while building Photo Album like this:
+ </para>
+<programlisting role="JAVA"><![CDATA[
+mvn clean install -Plivedemo
+]]></programlisting>
+
+ </tip>
+ </section>
+ <section>
+ <title>Running Functional(Selenium) Tests </title>
+ <para>
+ Before starting Selenium test please make sure that you have Firefox browser installed on your local machine, as
+ the Photo Album application is designed to be deployed and run on JBoss Application server,
+ so please make sure that the <jboss.installer.url> property of the project pom.xml (<code>examples/photoalbum/</code>) points to an existing JBoss Application server copy.
+ </para>
+
+ <para>
+ You also need to build the Photo Album project in <code>inexamples/photoalbum/reource</code>.
+ </para>
+ <para>
+ Then, you need to go to the test folder of the project (examples/photoalbum/test/) and run the
+
+
+ </para>
+ <programlisting role="XML"><![CDATA[...
+mvn clean integration-test
+...]]></programlisting>
+ <para>
+ By default Selenium tests are executed in the Firefox browser, hence you need to have it installed.
+ If you configured everything like it is said above you will see tests being executed in the Firefox browser.
+ When the tests are finished you can read test reports in the <code>examples/photoalbum/tests/target/surefire-reports/</code> folder.
+ </para>
+ </section>
+
+ <section>
+ <title>Context Help</title>
+ <para>
+ The Photo Album application was developed in the first place to demonstrate the mighty power of RichFaces thus most of UI elements in the application has a context help article that tells how a particular element works, providing technical details about it.
+ A context help article is displayed when you click on the question mark icon (
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/help_sign.png"/>
+ </imageobject>
+ </inlinemediaobject>
+ ).
+
+ </para>
+ </section>
+
+
+
+
+
+</chapter>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/intro.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/intro.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/intro.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="introduction" xreflabel="introduction">
+ <?dbhtml filename="introduction.html"?>
+
+ <title>Introduction</title>
+ <para>
+ The "Photo Album" web application is a desktop-like on-line photo manager.
+ It provides social services for uploading photos, storing and previewing them,
+ creating your own albums and sharing them with other users, searching albums,
+ photos or users, managing the environment.
+ Newcomers or not registered users can navigate through other users' shelves and albums
+ in "Anonymous mode", but in this case no possibilities to create personal
+ shelves or albums or upload photos are available.
+ </para>
+ <para>
+ The "Photo Album" represents and implements strict "Shelves - Albums - Photos" hierarchy.
+ It means that photos are kept in albums and albums are stored on shelves, but albums can not contain another albums
+ or shelves and shelves can not keep another shelves and can not be stored in albums.
+ </para>
+ <para>
+ The Photo Album web application is designed and developed with RichFaces and by RichFaces team. This application demonstrates:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>wide variety of UI components</emphasis> - the <property>RichFaces</property> provides
+ a Lego-like way of building user interfaces for web applications;
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Built-in Ajax capability</emphasis> - the <property>RichFaces</property> offers
+ both component-wide and very flexible page-wide Ajax support with no need to write any JavaScript code;
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Highly customizable look-and-feel</emphasis> - the <property>RichFaces</property> have special feature called
+ <ulink url="&devguide;/#Skinnability">Skinnability</ulink>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The Photo Album application also encompasses technologies and frameworks such as:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="https://facelets.dev.java.net/">Facelets</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://java.sun.com/products/ejb/">Enterprise Java Beans (EJB) 3.0</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://seamframework.org/">Seam framework</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The application is available online at <ulink url="http://livedemo.exadel.com/photoalbum/">Photo Album</ulink> page.
+ </para>
+
+</chapter>
+
+
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/intro.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/overview.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/overview.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/overview.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="overview" xreflabel="overview">
+ <?dbhtml filename="overview.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+
+ </keywordset>
+ </chapterinfo>
+ <title>Application Overview </title>
+ <section id="pageFlows">
+ <title>Page flows</title>
+ <para>
+
+ The page flow of the application is illustrated in the diagram.
+ </para>
+ <figure>
+ <title>Page Flow diagram</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/diagram.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <section>
+ <title>Page flows: implementation details</title>
+
+ <para>
+ This section covers how the particular elements that govern page flow are implemented in the application.
+ </para>
+ <section>
+ <title>Registering</title>
+ <para>
+ Registering in is basically the first step a user takes in the application if he/she wants to have access to all features of the application. Have a look at a piece of code from <code>\includes\index\index.xhtml</code>:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:panelGroup rendered="#{!identity.loggedIn}" styleClass="top-right-bottom-menu-item-link" layout="block">
+ <h:form style="margin: 0px">
+ <a4j:commandLink value="#{messages['login.register']}"actionListener="#{authenticator.goToRegister}" reRender="mainArea" />
+ </h:form>
+</h:panelGroup>
+...]]></programlisting>
+ <para>When the button is hit the <code>goToRegister</code> method of the <code>Authenticator</code> class is invoked and the <code>START_REGISTER_EVENT</code> is raised. These action display the registration form that is included from <code>\includes\register.xhtml</code>. </para>
+
+
+ <para>The <emphasis role="bold"><property><a4j:commandLink></property></emphasis> displays the link to the registration form and invokes the <code>goToRegister</code> method.
+ </para>
+ <para>When all fields are filled out with correct values the <code>authenticator.register(user)</code> is triggered and a new user object is declared. </para>
+ </section>
+
+ <section>
+ <title>Navigation Between Pages</title>
+ <para>
+ Technically, user does not browse between pages of the application: every content page is included into the content area of <code>index.xhtml</code> file after a certain action performed by user.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:panelGroup styleClass="content_box" layout="block">
+ <ui:include src="#{model.mainArea.template}" />
+</h:panelGroup>
+...]]></programlisting>
+ <figure>
+ <title>Content Area</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/contentArea.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>
+
+ The <code>NavigationEnum</code> enumeration encapsulated all possible states, that can be applied to content area ("mainArea") on the page.
+
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+ public enum NavigationEnum {
+ ANONYM("includes/publicShelves.xhtml"),
+ FILE_UPLOAD("includes/fileUpload.xhtml"),
+ USER_PREFS("includes/userPrefs.xhtml"),
+ REGISTER("includes/register.xhtml"),
+ SEARCH("includes/search.xhtml"),
+ ALBUM_PREVIEW("includes/album.xhtml"),
+ ALBUM_IMAGE_PREVIEW("/includes/image.xhtml"),
+ SHELF_PREVIEW("/includes/shelf.xhtml"),
+ ALL_SHELFS("/includes/userShelves.xhtml"),
+ TAGS("includes/tag.xhtml"),
+ ALL_ALBUMS("/includes/userAlbums.xhtml"),
+ ALL_IMAGES("/includes/userImages.xhtml"),
+ ALBUM_IMAGE_EDIT("/includes/imageEdit.xhtml"),
+ ALBUM_EDIT("/includes/albumEdit.xhtml"),
+ SHELF_EDIT("/includes/shelfEdit.xhtml"),
+ SHELF_UNVISITED("/includes/shelfUnvisited.xhtml"),
+ USER_SHARED_ALBUMS("/includes/userSharedAlbums.xhtml"),
+ USER_SHARED_IMAGES("/includes/userSharedImages.xhtml"),
+ ALBUM_UNVISITED("/includes/albumUnvisited.xhtml");
+...
+}
+]]></programlisting>
+
+ <para>
+
+ This class specifies which file is included depending on some user action.
+ The template to be loaded is identified according to some condition in the Controller
+ (<code>Controllor.java</code>) class and is saved to the Model (<code>Model.java</code>). During <code>index.xhtml</code> page rendering the value is taken from the Model to define what should be rendered to the page.
+ </para>
+ </section>
+
+ </section>
+ <section id="dataModel">
+ <title>Data Model</title>
+ <para>
+ The data model of the application has the following structure:
+ </para>
+
+ <figure>
+ <title>Photo Album Data Model</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/erd.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ </section>
+ <!--section id="setUp">
+ <title>Project Set Up</title>
+ <para>
+ Work in progress...
+ </para>
+ </section-->
+</chapter>
+
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/docbook/modules/overview.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/albumView.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/albumView.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_album.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_album.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_image.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_image.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_shelf.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/cm_shelf.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/contentArea.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/contentArea.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/diagram.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/diagram.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/dnd.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/dnd.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/ejb_struct.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/ejb_struct.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/erd.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/erd.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/imageView.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/imageView.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/image_size.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/image_size.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/indexxhtml.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/indexxhtml.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/messages_en_property.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/messages_en_property.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/modulesList.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/modulesList.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/richfaces_logo.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/richfaces_logo.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_mess.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_mess.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_pers.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_pers.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_start.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/rw_its_start.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/slide_show.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/slide_show.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/tooltip.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/tooltip.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/tree.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/tree.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/web_struct.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/guides/photo_album_app_guide/en/src/main/resources/images/web_struct.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/guides/photo_album_app_guide/pom.xml
===================================================================
--- root/docs/trunk/guides/photo_album_app_guide/pom.xml (rev 0)
+++ root/docs/trunk/guides/photo_album_app_guide/pom.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -0,0 +1,17 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.richfaces.docs</groupId>
+ <artifactId>guides</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.docs.guides</groupId>
+ <artifactId>photo_album_app_guide</artifactId>
+ <packaging>pom</packaging>
+ <name>RichFaces Photo Album Application Guide</name>
+ <modules>
+ <module>${docs.translation}</module>
+ </modules>
+</project>
Property changes on: root/docs/trunk/guides/photo_album_app_guide/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: root/docs/trunk/guides/pom.xml
===================================================================
--- root/docs/trunk/guides/pom.xml 2009-08-28 00:25:48 UTC (rev 15382)
+++ root/docs/trunk/guides/pom.xml 2009-08-28 00:39:31 UTC (rev 15383)
@@ -19,7 +19,8 @@
<!-- all deployed modules should be reflected in version-matrix also -->
<modules>
<module>testguide</module>
- <module>migrationguide</module>
+ <module>migrationguide</module>
+ <module>photo_album_app_guide</module>
</modules>
<build>
15 years, 4 months
JBoss Rich Faces SVN: r15382 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/cdk/freemarker and 13 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-08-27 20:25:48 -0400 (Thu, 27 Aug 2009)
New Revision: 15382
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/AbstractCdkContext.java
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ComponentLibraryTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JaxbMarshalTest.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
Log:
fire alarm saving
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/AbstractCdkContext.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/AbstractCdkContext.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/AbstractCdkContext.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -1,132 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.cdk;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-import org.richfaces.cdk.CdkWriter.OutputType;
-import org.richfaces.cdk.model.ComponentLibrary;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-/**
- * <p class="changed_added_4_0">Base CDK context class. Particular build tool ( Ant, Maven ) should extend that class with
- * tool-specific methods.</p>
- * @author asmirnov(a)exadel.com
- *
- */
-public class AbstractCdkContext implements CdkContext {
-
- private final ClassLoader loader;
-
- private Map<SourceType, Iterable<File>> sources = Maps.newHashMap();
-
- private Map<OutputType,File> outputs = Maps.newHashMap();
-
- private Map<SourceType,Iterable<File>> inputFolders = Maps.newHashMap();
-
- private Map<Class<? extends CdkWorker>,CdkWorker> workers = Maps.newHashMap();
-
- private List<CdkError> errors = Lists.newArrayList();
-
- public AbstractCdkContext(ClassLoader loader) {
- this.loader = loader;
- // TODO Auto-generated constructor stub
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.cdk.CdkContext#getLoader()
- */
- public ClassLoader getLoader() {
- return loader;
- }
-
- public void addSources(SourceType type,Iterable<File> files) {
- sources.put(type, files);
- }
-
- @Override
- public Iterable<File> getSources(SourceType type) {
- return sources.get(type);
- }
-
- @Override
- public File getOutputFolder(OutputType type) {
- File outputFolder = outputs.get(type);
- return outputFolder;
- }
-
-
- public void setOutputFolder(OutputType type, File folder) {
- outputs.put(type, folder);
- }
-
- @Override
- public void sendError(CdkError error) {
- errors.add(error);
- }
-
- @Override
- public Iterable<CdkError> getErrors() {
- return errors;
- }
-
-
- @Override
- public Iterable<File> getSourceFolders(SourceType type) {
- return inputFolders.get(type);
- }
-
-
- public void setSourceFolders(SourceType type, Iterable<File> folders){
- inputFolders.put(type, folders);
- }
-
- @Override
- public <W extends CdkWorker> W getWorkerInstance(Class<W> workerClass)
- throws CdkException {
- CdkWorker worker = workers.get(workerClass);
- if(null == worker){
- // TODO - instantiate worker.
- try {
- worker = workerClass.newInstance();
- worker.init(this);
- workers.put(workerClass, worker);
- } catch (InstantiationException e) {
- throw new CdkException("error to instantiate cdk component "+workerClass.getName(), e);
- } catch (IllegalAccessException e) {
- throw new CdkException("Illegal access to cdk component "+workerClass.getName(), e);
- }
- }
- return (W) worker;
- }
-
-
- public <W extends CdkWorker> void addWorker(Class<W> workerClass, W worker) {
- workers.put(workerClass, worker);
- }
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -49,7 +49,16 @@
*/
public File getOutputFolder(OutputType type);
+
/**
+ * <p class="changed_added_4_0">This method creates output file in the appropriate output folder. If target file exists and its modification time is late than model modification time from {@code lastModified} parameter, no new file will be created.</p>
+ * @param output target output folder.
+ * @param relativePath path to file in the output folder.
+ * @param lastModified model modification time. If that parameter is less then 0, no checks for existing file will be performed.
+ * @return new created file or null if the target file exists and its modification time is late then model.
+ */
+ public File createOutputFile(OutputType output,String relativePath,long lastModified) throws CdkException;
+ /**
* <p class="changed_added_4_0">Record recowerable CdkError. To avoid consequence builds of the project with many errors, all non-fatal errors ( Java compilation errors, incorrect xml fales, inconsistent component descriptions ) these error are stored in the context and marks whole build failed.</p>
* @param error
*/
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java (from rev 15351, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/AbstractCdkContext.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,183 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.richfaces.cdk.CdkWriter.OutputType;
+import org.richfaces.cdk.model.ComponentLibrary;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+/**
+ * <p class="changed_added_4_0">Base CDK context class. Particular build tool ( Ant, Maven ) should extend that class with
+ * tool-specific methods.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class CdkContextBase implements CdkContext {
+
+ private final ClassLoader loader;
+
+ private Map<SourceType, Iterable<File>> sources = Maps.newHashMap();
+
+ private Map<OutputType,File> outputs = Maps.newHashMap();
+
+ private Map<SourceType,Iterable<File>> inputFolders = Maps.newHashMap();
+
+ private Map<Class<? extends CdkWorker>,CdkWorker> workers = Maps.newHashMap();
+
+ private List<CdkError> errors = Lists.newArrayList();
+
+ public CdkContextBase(ClassLoader loader) {
+ this.loader = loader;
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.CdkContext#getLoader()
+ */
+ public ClassLoader getLoader() {
+ return loader;
+ }
+
+ public void addSources(SourceType type,Iterable<File> files) {
+ sources.put(type, files);
+ }
+
+ @Override
+ public Iterable<File> getSources(SourceType type) {
+ return sources.get(type);
+ }
+
+ @Override
+ public File getOutputFolder(OutputType type) {
+ File outputFolder = outputs.get(type);
+ OutputType folderType = type.getFolderType();
+ if(null == outputFolder && null != folderType){
+ // Lookup for standard folder type.
+ outputFolder = outputs.get(folderType);
+ // Lookup for output with same folder type.
+ Iterator<OutputType> keysIterator = outputs.keySet().iterator();
+ while (null == outputFolder && keysIterator.hasNext()) {
+ CdkWriter.OutputType outputType = (CdkWriter.OutputType) keysIterator
+ .next();
+ if(folderType.equals(outputType.getFolderType())){
+ outputFolder = outputs.get(outputType);
+ }
+ }
+ }
+ return outputFolder;
+ }
+
+
+ public void setOutputFolder(OutputType type, File folder) {
+ outputs.put(type, folder);
+ }
+
+ @Override
+ public void sendError(CdkError error) {
+ errors.add(error);
+ }
+
+ @Override
+ public Iterable<CdkError> getErrors() {
+ return errors;
+ }
+
+
+ @Override
+ public Iterable<File> getSourceFolders(SourceType type) {
+ return inputFolders.get(type);
+ }
+
+
+ public void setSourceFolders(SourceType type, Iterable<File> folders){
+ inputFolders.put(type, folders);
+ }
+
+ @Override
+ public <W extends CdkWorker> W getWorkerInstance(Class<W> workerClass)
+ throws CdkException {
+ CdkWorker worker = workers.get(workerClass);
+ if(null == worker){
+ // TODO - instantiate worker.
+ try {
+ worker = workerClass.newInstance();
+ worker.init(this);
+ workers.put(workerClass, worker);
+ } catch (InstantiationException e) {
+ throw new CdkException("error to instantiate cdk component "+workerClass.getName(), e);
+ } catch (IllegalAccessException e) {
+ throw new CdkException("Illegal access to cdk component "+workerClass.getName(), e);
+ }
+ }
+ return (W) worker;
+ }
+
+
+ public <W extends CdkWorker> void addWorker(Class<W> workerClass, W worker) {
+ workers.put(workerClass, worker);
+ }
+
+ @Override
+ public File createOutputFile(OutputType output, String relativePath,
+ long lastModified) throws CdkException {
+ if(null == relativePath){
+ throw new NullPointerException();
+ }
+ File outputFolder = getOutputFolder(output);
+ if(null == outputFolder){
+ throw new CdkException("No output folder for type "+output.getName());
+ }
+ if(outputFolder.exists() && !outputFolder.isDirectory()){
+ throw new CdkException("Output folder "+outputFolder+" not is directory.");
+ }
+ // Strip leading '/'
+ if(relativePath.startsWith(File.separator)){
+ relativePath = relativePath.substring(1);
+ }
+ File outputFile = new File(outputFolder,relativePath);
+ if(outputFile.exists()){
+ if(lastModified > 0 && outputFile.lastModified() > lastModified){
+ return null;
+ } else {
+ outputFile.delete();
+ }
+ }
+ // Create file folder.
+ outputFile.getParentFile().mkdirs();
+ try {
+ outputFile.createNewFile();
+ } catch (IOException e) {
+ throw new CdkException("Error create output file", e);
+ }
+ return outputFile;
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -34,6 +34,7 @@
interface OutputType {
String getName();
+ OutputType getFolderType();
}
public void init(CdkContext context) throws CdkException;
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,50 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk;
+
+import org.richfaces.cdk.CdkWriter.OutputType;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public enum StandardOutputFolders implements OutputType {
+ JAVA_CLASSES,
+ RESOURCES,
+ TEST_JAVA_CLASSES,
+ TEST_RESOURCES,
+ DOCUMENTATION;
+
+ @Override
+ public OutputType getFolderType() {
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return name();
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -31,19 +31,33 @@
*
*/
public enum StandardOutputs implements OutputType {
- COMPONENT_CLASSES,
- RENDERER_CLASSES,
- EVENT_LISTENER_CLASSES,
- EVENT_SOURCE_CLASSES,
- TAG_HANDLER_CLASSES,
- FACES_CONFIG,
- TAG_LIBRARY,
- JBDS_RENDERERS,
- XML_SCHEMA;
+ COMPONENT_CLASSES(StandardOutputFolders.JAVA_CLASSES),
+ RENDERER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
+ EVENT_LISTENER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
+ EVENT_SOURCE_CLASSES(StandardOutputFolders.JAVA_CLASSES),
+ TAG_HANDLER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
+ FACES_CONFIG(StandardOutputFolders.RESOURCES),
+ TAG_LIBRARY(StandardOutputFolders.RESOURCES),
+ JBDS_RENDERERS(StandardOutputFolders.JAVA_CLASSES),
+ XML_SCHEMA(StandardOutputFolders.RESOURCES);
+ private final OutputType folderType;
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param folderType
+ */
+ private StandardOutputs(OutputType folderType) {
+ this.folderType = folderType;
+ }
+
@Override
public String getName() {
return name();
}
+ @Override
+ public OutputType getFolderType() {
+ return folderType;
+ }
+
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,73 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.freemarker;
+
+import org.richfaces.cdk.model.Component;
+import org.richfaces.cdk.model.Property;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+
+import freemarker.ext.beans.BeanModel;
+import freemarker.ext.beans.BeansWrapper;
+import freemarker.template.TemplateModel;
+import freemarker.template.TemplateModelException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ComponentTemplateModel extends BeanModel implements TemplateModel {
+
+ private final Component component;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param object
+ * @param wrapper
+ */
+ public ComponentTemplateModel(Component object, BeansWrapper wrapper) {
+ super(object, wrapper);
+ component = object;
+ }
+
+ @Override
+ public TemplateModel get(String key) throws TemplateModelException {
+ if("generatedAttributes".equals(key)){
+ return generatedAttributes();
+ }
+ return super.get(key);
+ }
+
+ private TemplateModel generatedAttributes() throws TemplateModelException {
+ return wrapper.wrap(Collections2.filter(component.getAttributes(), new Predicate<Property>() {
+
+ @Override
+ public boolean apply(Property input) {
+ return input.isGenerate();
+ }
+ }));
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,7 @@
package org.richfaces.cdk.freemarker;
+import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
@@ -33,6 +34,7 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.LibraryVisitor;
import org.richfaces.cdk.model.Searchable;
+import org.richfaces.cdk.model.Trackable;
import org.richfaces.cdk.model.Visitable;
import freemarker.template.Configuration;
@@ -71,14 +73,14 @@
}
@Override
- public Boolean visit(Visitable c, P param) {
+ public Boolean visit(Visitable c, P param) throws CdkException {
if(isMyComponent(c)){
return processComponent((C)c, param);
}
return null;
}
- protected boolean processComponent(C c, P param) {
+ protected boolean processComponent(C c, P param) throws CdkException {
try {
Writer out = getOutput(c);
template.process(c, out);
@@ -94,15 +96,27 @@
return false;
}
- protected Writer getOutput(C c) throws IOException {
- return new FileWriter(getOutputFile(c));
+ protected Writer getOutput(C c) throws CdkException {
+ long lastModified = Long.MIN_VALUE;
+ if (c instanceof Trackable) {
+ Trackable trackuble = (Trackable) c;
+ lastModified = trackuble.lastModified();
+ }
+ File sourceOutput = getContext().createOutputFile(getOutputType(), getOutputFile(c), lastModified);
+ try {
+ return new FileWriter(sourceOutput);
+ } catch (IOException e) {
+ throw new CdkException(e);
+ }
}
- protected abstract String getOutputFile(C c) throws IOException;
+ protected abstract String getOutputFile(C c) throws CdkException;
protected abstract boolean isMyComponent(Visitable c);
protected abstract String getTemplateName();
+
+ protected abstract OutputType getOutputType();
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,22 +23,43 @@
package org.richfaces.cdk.freemarker;
+import org.richfaces.cdk.model.Component;
+import org.richfaces.cdk.model.Property;
+
+import freemarker.ext.beans.BeansWrapper;
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.ObjectWrapper;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import freemarker.template.TemplateScalarModel;
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
*
*/
-public class LibraryModelWrapper extends DefaultObjectWrapper implements
+public class LibraryModelWrapper extends BeansWrapper implements
ObjectWrapper {
+ public LibraryModelWrapper() {
+ super();
+ setStrict(true);
+ setSimpleMapWrapper(true);
+// setNullModel(TemplateScalarModel.EMPTY_STRING);
+ setUseCache(true);
+ }
+
@Override
public TemplateModel wrap(Object obj) throws TemplateModelException {
// TODO wrap specified model classes.
- return super.wrap(obj);
+ TemplateModel templateModel;
+ if (obj instanceof Component) {
+ templateModel = new ComponentTemplateModel((Component)obj,this);
+ } else if (obj instanceof Property) {
+ templateModel = new PropertyModel((Property)obj,this);
+ }else {
+ templateModel = super.wrap(obj);
+ }
+ return templateModel;
}
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,75 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.freemarker;
+
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.util.Strings;
+
+import freemarker.ext.beans.BeanModel;
+import freemarker.ext.beans.BeansWrapper;
+import freemarker.template.TemplateModel;
+import freemarker.template.TemplateModelException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class PropertyModel extends BeanModel implements TemplateModel {
+
+ private final Property property;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param object
+ * @param wrapper
+ */
+ public PropertyModel(Property object, BeansWrapper wrapper) {
+ super(object, wrapper);
+ property = object;
+ }
+
+ @Override
+ public TemplateModel get(String key) throws TemplateModelException {
+ Object value;
+ if("getterName".equals(key)){
+ value = getGetterName();
+ } else if("setterName".equals(key)){
+ value = getSetterName();
+ } else {
+ return super.get(key);
+ }
+ return wrapper.wrap(value);
+ }
+ // Model utility methods.
+
+ public String getGetterName(){
+ return property.getType().getGetterPrefix()+Strings.firstToUpperCase(property.getName().toString());
+ }
+
+ public String getSetterName(){
+ return "set"+Strings.firstToUpperCase(property.getName().toString());
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -41,7 +41,7 @@
* @author asmirnov(a)exadel.com
*
*/
-public class ComponentClassGenerator extends FreeMarkerRenderer<Component, String> implements CdkWriter {
+public class ComponentClassGenerator extends FreeMarkerRenderer<Component, ComponentLibrary> implements CdkWriter {
/* (non-Javadoc)
* @see org.richfaces.cdk.CdkWriter#init(org.richfaces.cdk.CdkContext)
@@ -57,23 +57,15 @@
protected boolean isMyComponent(Visitable c) {
if (c instanceof Component) {
Component component = (Component) c;
- return !component.isGenerate();
+ return component.isGenerate();
}
return false;
}
@Override
- protected String getOutputFile(Component c) throws IOException {
- File sourceOutput = getContext().getOutputFolder(StandardOutputs.COMPONENT_CLASSES);
- File outputFile = new File(sourceOutput,c.getComponentClass().getName().replace('.', File.separatorChar)+".java");
- if(!outputFile.exists()){
- outputFile.getParentFile().mkdirs();
- } else {
- outputFile.delete();
- }
-// outputFile.createNewFile();
- return outputFile.getAbsolutePath();
+ protected String getOutputFile(Component c) throws CdkException {
+ return c.getComponentClass().getName().replace('.', File.separatorChar)+".java";
}
@@ -81,4 +73,10 @@
protected String getTemplateName() {
return "component.ftl";
}
+
+
+ @Override
+ protected OutputType getOutputType() {
+ return StandardOutputs.COMPONENT_CLASSES;
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -58,7 +60,7 @@
}
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,102 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.model;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class BehaviorRenderer implements ModelElement<BehaviorRenderer, BehaviorRenderer.Type>{
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ @SuppressWarnings("serial")
+ public static final class Type extends Key {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type
+ */
+ public Type(String type) {
+ super(type);
+ // TODO Auto-generated constructor stub
+ }
+
+ }
+
+ private final Type type;
+
+ private ClassDescription rendererClass;
+
+ public BehaviorRenderer(Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public Type getKey() {
+ return type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the type
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the rendererClass
+ */
+ public ClassDescription getRendererClass() {
+ return rendererClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param rendererClass the rendererClass to set
+ */
+ public void setRendererClass(ClassDescription rendererClass) {
+ this.rendererClass = rendererClass;
+ }
+
+ @Override
+ public void merge(BehaviorRenderer other) {
+ ComponentLibrary.merge(this, other);
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -96,6 +96,14 @@
}
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param cl
+ */
+ public ClassDescription(Class<?>cl) {
+ // TODO get information directly from class.
+ this(cl.getName());
+ }
/**
* <p class="changed_added_4_0"></p>
@@ -168,6 +176,10 @@
public String getBoxingName() {
return boxingClassName;
}
+
+ public String getGetterPrefix(){
+ return Boolean.class.getName().equals(boxingClassName)?"is":"get";
+ }
@Override
public String toString() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -12,6 +12,7 @@
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlType;
+import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.model.Event.ClassName;
import org.richfaces.cdk.model.Facet.Name;
import org.richfaces.cdk.util.Strings;
@@ -111,7 +112,7 @@
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -36,6 +36,8 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
+import org.richfaces.cdk.CdkException;
+
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
@@ -53,7 +55,7 @@
*/
@XmlRootElement(name = "faces-config", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@XmlType(namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, name = "faces-configType")
-public class ComponentLibrary implements Serializable {
+public class ComponentLibrary implements Serializable,Extensible<ConfigExtension>,Trackable {
public static final String FACES_CONFIG_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
@@ -123,12 +125,16 @@
return listener;
}
};
+
+ private ConfigExtension extension;
/**
* <p class="changed_added_4_0">
* Tag library with references of all used tags
* </p>
*/
private final TagLibrary tagLibrary;
+
+ private long lastModified = Long.MIN_VALUE;
/**
* <p class="changed_added_4_0">
@@ -155,7 +161,7 @@
listeners.merge(otherLibrary.listeners);
}
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
R result = accept(components, visitor, param, null);
result = accept(renderKits, visitor, param, result);
result = accept(converters, visitor, param, result);
@@ -270,6 +276,27 @@
// Utility methods.
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the extension
+ */
+ public ConfigExtension getExtension() {
+ return extension;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param extension the extension to set
+ */
+ public void setExtension(ConfigExtension extension) {
+ this.extension = extension;
+ }
+
+ @Override
+ public long lastModified() {
+ return lastModified;
+ }
+
static <K extends Key,T extends ModelElement<T,K>> void merge(Collection<T> target,
Collection<T> source) {
for (T element : source) {
@@ -312,7 +339,7 @@
}
static <R, P, T extends ModelElement<T,?>> R accept(Iterable<T> components,
- LibraryVisitor<R, P> visitor, P param, R result) {
+ LibraryVisitor<R, P> visitor, P param, R result) throws CdkException {
if (null == result) {
for (T t : components) {
R accept = t.accept(visitor, param);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -34,7 +36,7 @@
private final Key type;
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -25,6 +25,8 @@
import javax.faces.event.FacesEvent;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0">That bean represent {@link FacesEvent} subclass that can be fired by component.</p>
* @author asmirnov(a)exadel.com
@@ -92,7 +94,7 @@
}
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -83,7 +85,7 @@
}
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -37,7 +39,8 @@
* @param c
* @param param
* @return
+ * @throws CdkException
*/
- public R visit(Visitable c, P param);
+ public R visit(Visitable c, P param) throws CdkException;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -37,7 +39,7 @@
private final Key type;
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,20 +23,14 @@
package org.richfaces.cdk.model;
-import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Set;
+import org.richfaces.cdk.CdkException;
+
import com.google.common.base.Predicate;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
/**
* <p class="changed_added_4_0">
@@ -50,6 +44,7 @@
implements SearchableCollection<E, K>, Visitable,
Mergeable<SearchableCollection<E, K>> {
+ @SuppressWarnings("unused")
private final class SearchPredicate implements Predicate<E> {
private final K key;
@@ -179,7 +174,7 @@
}
public <R, P> R accept(
- org.richfaces.cdk.model.LibraryVisitor<R, P> visitor, P param) {
+ org.richfaces.cdk.model.LibraryVisitor<R, P> visitor, P param) throws CdkException {
R result = null;
Iterator<E> iterator = iterator();
while (null == result && iterator.hasNext()) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -24,6 +24,9 @@
import java.util.List;
import java.util.Set;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.util.Strings;
+
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -321,7 +324,7 @@
}
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -65,12 +65,20 @@
@Override
public Renderer create(Renderer.Type key) {
- Renderer renderer = new Renderer();
- renderer.setType(key);
+ Renderer renderer = new Renderer(key);
return renderer;
}
};
+ private final SearchableCollection<BehaviorRenderer,BehaviorRenderer.Type> behaviorRenderers = new ModelCollection<BehaviorRenderer, BehaviorRenderer.Type>() {
+
+ @Override
+ public BehaviorRenderer create(BehaviorRenderer.Type key) {
+ BehaviorRenderer renderer = new BehaviorRenderer(key);
+ return renderer;
+ }
+ };
+
public RenderKit(Id id) {
this.id = id;
}
@@ -116,6 +124,14 @@
return renderers;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the behaviorRenderers
+ */
+ public SearchableCollection<BehaviorRenderer, BehaviorRenderer.Type> getBehaviorRenderers() {
+ return behaviorRenderers;
+ }
+
/* (non-Javadoc)
* @see org.richfaces.cdk.model.ModelElement#accept(org.richfaces.cdk.model.LibraryVisitor, java.lang.Object)
*/
@@ -133,11 +149,22 @@
public Renderer getOrCreateRenderer(String rendererType) {
Renderer.Type type = new Renderer.Type(rendererType);
- return renderers.findOrCreate(type);
+ return renderers.find(type);
}
public Renderer findOrCreateRenderer(String rendererType) {
Renderer.Type type = new Renderer.Type(rendererType);
return renderers.findOrCreate(type);
}
+
+ public BehaviorRenderer getOrCreateBehaviorRenderer(String rendererType) {
+ BehaviorRenderer.Type type = new BehaviorRenderer.Type(rendererType);
+ return behaviorRenderers.find(type);
+ }
+
+ public BehaviorRenderer findOrCreateBehaviorRenderer(String rendererType) {
+ BehaviorRenderer.Type type = new BehaviorRenderer.Type(rendererType);
+ return behaviorRenderers.findOrCreate(type);
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -24,6 +24,7 @@
package org.richfaces.cdk.model;
import org.richfaces.builder.model.JavaClass;
+import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
@@ -41,10 +42,14 @@
private ClassDescription rendererClass;
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
- return visitor.visit(this, param);
+
+ public Renderer() {
}
+
+ public Renderer(Type type) {
+ this.type=type;
+ }
+
/* (non-Javadoc)
* @see org.richfaces.cdk.model.ModelElement#getType()
*/
@@ -60,6 +65,9 @@
this.type = type;
}
+ public Type getType() {
+ return type;
+ }
/**
* <p class="changed_added_4_0"></p>
* @return the template
@@ -108,6 +116,11 @@
}
@Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ @Override
public void merge(Renderer other) {
ComponentLibrary.merge(this, other);
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,16 @@
+package org.richfaces.cdk.model;
+
+/**
+ * <p class="changed_added_4_0">Interface for model components that have related modification time.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface Trackable {
+
+ /**
+ * <p class="changed_added_4_0">Last modification time for model information.</p>
+ * @return
+ */
+ public long lastModified();
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -34,7 +36,7 @@
private final Key type;
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -1,5 +1,7 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
public interface Visitable {
/**
@@ -10,6 +12,6 @@
* @param param
* @return
*/
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param);
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException;
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -34,9 +34,11 @@
import org.richfaces.cdk.xmlconfig.model.FacesConfigAdapter;
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class FacesConfigGenerator implements CdkWriter {
@@ -44,9 +46,12 @@
private CdkContext context;
private JAXBBinding jaxbBinding;
private FacesConfigAdapter libraryAdapter;
- public static final String FACES_SCHEMA_LOCATION = ComponentLibrary.FACES_CONFIG_NAMESPACE+" "+ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION;
+ public static final String FACES_SCHEMA_LOCATION = ComponentLibrary.FACES_CONFIG_NAMESPACE
+ + " " + ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.CdkWriter#init(org.richfaces.cdk.CdkContext)
*/
@Override
@@ -56,34 +61,33 @@
libraryAdapter = new FacesConfigAdapter();
}
- /* (non-Javadoc)
- * @see org.richfaces.cdk.CdkWriter#render(org.richfaces.cdk.model.ComponentLibrary)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.cdk.CdkWriter#render(org.richfaces.cdk.model.ComponentLibrary
+ * )
*/
@Override
public void render(ComponentLibrary library) throws CdkException {
- File outputFolder = context.getOutputFolder(StandardOutputs.FACES_CONFIG);
- File facesConfigXml = new File(outputFolder,FACES_CONFIG_XML);
- try {
- if(facesConfigXml.exists()){
- // TODO - check last modification time and bypass generation for non-modified source.
- facesConfigXml.delete();
- } else if(!facesConfigXml.getParentFile().exists()){
- facesConfigXml.getParentFile().mkdirs();
- }
- facesConfigXml.createNewFile();
- try {
- // TODO - transform output to strip prefixes from faces-config namespace.
- jaxbBinding.marshal(facesConfigXml, FACES_SCHEMA_LOCATION, libraryAdapter.marshal(library));
- } catch (Exception e) {
- if (e instanceof CdkException) {
- throw (CdkException) e;
- } else {
- throw new CdkException(e);
+ // TODO - check modification time.
+ File facesConfigXml = context.createOutputFile(
+ StandardOutputs.FACES_CONFIG, FACES_CONFIG_XML, library.lastModified());
+ if (null != facesConfigXml) {
+ try {
+ // TODO - transform output to strip prefixes from faces-config
+ // namespace.
+ jaxbBinding.marshal(facesConfigXml, FACES_SCHEMA_LOCATION,
+ libraryAdapter.marshal(library));
+ } catch (Exception e) {
+ if (e instanceof CdkException) {
+ throw (CdkException) e;
+ } else {
+ throw new CdkException(e);
+ }
}
+
}
- } catch(IOException e){
- throw new CdkException("error create faces-config.xml", e);
- }
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -26,7 +26,6 @@
import javax.xml.bind.annotation.adapters.XmlAdapter;
import org.richfaces.cdk.model.Attribute;
-import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,48 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.xmlconfig.model;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.richfaces.cdk.model.BehaviorRenderer;
+import org.richfaces.cdk.xmlconfig.JAXBBinding;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class BehaviorRendererAdapter extends XmlAdapter<BehaviorRendererBean, BehaviorRenderer> {
+
+ @Override
+ public BehaviorRendererBean marshal(BehaviorRenderer v) throws Exception {
+ return JAXBBinding.createAdapter(BehaviorRendererBean.class, v);
+ }
+
+ @Override
+ public BehaviorRenderer unmarshal(BehaviorRendererBean v) throws Exception {
+ return JAXBBinding.createModelElement(BehaviorRenderer.class, v, new BehaviorRenderer.Type(v.getType()));
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,100 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.xmlconfig.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ConfigExtension;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@XmlType(name="faces-config-client-behavior-rendererType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+public class BehaviorRendererBean {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ public static class BehaviorRendererExtension extends ConfigExtension {
+
+ }
+
+ private String type;
+
+
+ private ClassDescription rendererClass;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the type
+ */
+ @XmlElement(name="client-behavior-renderer-type",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the rendererClass
+ */
+ @XmlElement(name="client-behavior-renderer-class",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ @XmlJavaTypeAdapter(ClassAdapter.class)
+ public ClassDescription getRendererClass() {
+ return rendererClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param rendererClass the rendererClass to set
+ */
+ public void setRendererClass(ClassDescription rendererClass) {
+ this.rendererClass = rendererClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the extension
+ */
+// @XmlElement(name="client-behavior-renderer-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+// public BehaviorRendererExtension getExtension() {
+// return super.getExtension();
+// }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -25,9 +25,7 @@
import javax.xml.bind.annotation.adapters.XmlAdapter;
-import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.Component;
-import org.richfaces.cdk.model.ConfigExtension;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
/**
@@ -40,14 +38,14 @@
@Override
public ComponentBean marshal(Component v) throws Exception {
ComponentBean bean = JAXBBinding.createAdapter(ComponentBean.class, v);
+ // TODO - copy renderer types.
return bean;
}
@Override
public Component unmarshal(ComponentBean v) throws Exception {
- Component component = new Component(new Component.Type(v.getType()));
- JAXBBinding.copyProperties(v, component);
- JAXBBinding.copyExtensions(v, component, false);
+ Component component = JAXBBinding.createModelElement(Component.class, v, new Component.Type(v.getType()));
+ // TODO - copy renderer types.
return component;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -24,29 +24,27 @@
package org.richfaces.cdk.xmlconfig.model;
import java.util.List;
-import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.DescriptionGroup;
-import org.richfaces.cdk.model.Extensible;
import org.richfaces.cdk.model.Facet;
import org.richfaces.cdk.model.Property;
import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
*
*/
-public class ComponentBean implements Extensible<ComponentBean.ComponentExtension>,DescriptionGroup {
+@XmlType(name="faces-config-componentType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+public class ComponentBean extends ExtensibleBean<ComponentBean.ComponentExtension> {
private String type;
@@ -55,14 +53,6 @@
private List<Property> attributes = Lists.newArrayList();
- private ComponentExtension extension;
-
- private String icon;
-
- private String description;
-
- private String displayname;
-
private List<Facet> facets = Lists.newArrayList();
/**
@@ -142,69 +132,14 @@
@XmlElement(name="component-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
@Override
public ComponentExtension getExtension() {
- return extension;
+ return super.getExtension();
}
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param extension the extension to set
- */
+
@Override
public void setExtension(ComponentExtension extension) {
- this.extension = extension;
+ super.setExtension(extension);
}
- /**
- * <p class="changed_added_4_0"></p>
- * @return the icon
- */
- @XmlElement(name="icon",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
- public String getIcon() {
- return icon;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param icon the icon to set
- */
- public void setIcon(String icon) {
- this.icon = icon;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the description
- */
- @XmlElement(name="description",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
- public String getDescription() {
- return description;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param description the description to set
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the displayname
- */
- @XmlElement(name="display-name",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
- public String getDisplayname() {
- return displayname;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param displayname the displayname to set
- */
- public void setDisplayname(String displayname) {
- this.displayname = displayname;
- }
-
public static class ComponentExtension extends ConfigExtension {
private String family;
@@ -212,6 +147,8 @@
private ClassDescription baseClass;
private boolean generate;
+
+ private List<String> rendererTypes = Lists.newArrayList();
/**
* <p class="changed_added_4_0"></p>
@@ -264,5 +201,22 @@
public void setGenerate(boolean generate) {
this.generate = generate;
}
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param rendererTypes the rendererTypes to set
+ */
+ @XmlElement(name="renderer-type",namespace=ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public void setRendererTypes(List<String> rendererTypes) {
+ this.rendererTypes = rendererTypes;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the rendererTypes
+ */
+ public List<String> getRendererTypes() {
+ return rendererTypes;
+ }
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -4,8 +4,6 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.DescriptionGroup;
-import org.richfaces.cdk.model.Extensible;
-import org.richfaces.cdk.xmlconfig.model.FacetBean.FacetExtension;
public class DescriptionGroupBean implements DescriptionGroup {
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,55 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.xmlconfig.model;
+
+import org.richfaces.cdk.model.ConfigExtension;
+import org.richfaces.cdk.model.Extensible;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ExtensibleBean<E extends ConfigExtension> extends DescriptionGroupBean implements
+ Extensible<E> {
+
+ private E extension;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the extension
+ */
+ public E getExtension() {
+ return extension;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param extension the extension to set
+ */
+ public void setExtension(E extension) {
+ this.extension = extension;
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -25,12 +25,15 @@
import java.util.List;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.Component;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ConfigExtension;
+import org.richfaces.cdk.model.Extensible;
import org.richfaces.cdk.model.RenderKit;
import com.google.common.collect.Lists;
@@ -41,8 +44,11 @@
*
*/
@XmlRootElement(name="faces-config",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
-public class FacesConfigBean {
+public class FacesConfigBean implements Extensible<FacesConfigBean.FacesConfigExtension> {
+ public static final class FacesConfigExtension extends ConfigExtension {
+
+ }
@XmlElement(name="component",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
@XmlJavaTypeAdapter(ComponentAdapter.class)
private List<Component> components = Lists.newArrayList();
@@ -51,8 +57,28 @@
@XmlJavaTypeAdapter(RenderKitAdapter.class)
private List<RenderKit> renderKits = Lists.newArrayList();
+ private FacesConfigExtension extension;
+
+ private String version="2.0";
/**
* <p class="changed_added_4_0"></p>
+ * @return the version
+ */
+ @XmlAttribute
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param version the version to set
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
* @return the components
*/
public List<Component> getComponents() {
@@ -82,4 +108,21 @@
public void setRenderKits(List<RenderKit> renderKits) {
this.renderKits = renderKits;
}
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the extension
+ */
+ @XmlElement(name="faces-config-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ public FacesConfigExtension getExtension() {
+ return extension;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param extension the extension to set
+ */
+ public void setExtension(FacesConfigExtension extension) {
+ this.extension = extension;
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -27,16 +27,13 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.DescriptionGroup;
-import org.richfaces.cdk.model.Extensible;
-import org.richfaces.cdk.xmlconfig.model.ComponentBean.ComponentExtension;
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
*
*/
-public class FacetBean extends DescriptionGroupBean implements Extensible<FacetBean.FacetExtension>,DescriptionGroup{
+public class FacetBean extends ExtensibleBean<FacetBean.FacetExtension>{
/**
* <p class="changed_added_4_0"></p>
@@ -68,8 +65,6 @@
private String name;
- private FacetExtension extension;
-
/**
* <p class="changed_added_4_0"></p>
* @return the name
@@ -93,15 +88,12 @@
*/
@XmlElement(name="facet-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public FacetExtension getExtension() {
- return extension;
+ return super.getExtension();
}
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param extension the extension to set
- */
+
+ @Override
public void setExtension(FacetExtension extension) {
- this.extension = extension;
+ super.setExtension(extension);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -28,9 +28,7 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.richfaces.cdk.model.Attribute;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.Property;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -25,7 +25,6 @@
import javax.xml.bind.annotation.adapters.XmlAdapter;
-import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -33,9 +33,7 @@
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.DescriptionGroup;
import org.richfaces.cdk.model.EventName;
-import org.richfaces.cdk.model.Extensible;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -45,7 +43,7 @@
* @author asmirnov(a)exadel.com
*
*/
-public class PropertyBean extends DescriptionGroupBean implements Extensible<PropertyBean.PropertyExtension> {
+public class PropertyBean extends ExtensibleBean<PropertyBean.PropertyExtension> {
/**
* <p class="changed_added_4_0"></p>
@@ -236,8 +234,6 @@
private String suggestedValue;
- private PropertyExtension extension;
-
/**
* <p class="changed_added_4_0"></p>
* @return the name
@@ -310,16 +306,11 @@
@Override
@XmlElement(name="property-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public PropertyExtension getExtension() {
- return extension;
+ return super.getExtension();
}
- /**
- * <p class="changed_added_4_0"></p>
- * @param extension the extension to set
- */
@Override
public void setExtension(PropertyExtension extension) {
- this.extension = extension;
+ super.setExtension(extension);
}
-
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -25,8 +25,6 @@
import javax.xml.bind.annotation.adapters.XmlAdapter;
-import org.richfaces.cdk.model.ClassDescription;
-import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.model.RenderKit;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -30,10 +30,10 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.richfaces.cdk.model.BehaviorRenderer;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.Extensible;
import org.richfaces.cdk.model.Renderer;
import com.google.common.collect.Lists;
@@ -43,7 +43,7 @@
* @author asmirnov(a)exadel.com
*
*/
-public class RenderKitBean extends DescriptionGroupBean implements Extensible<RenderKitBean.RenderKitExtension>{
+public class RenderKitBean extends ExtensibleBean<RenderKitBean.RenderKitExtension>{
/**
* <p class="changed_added_4_0"></p>
@@ -54,8 +54,6 @@
}
- @XmlElement(name="render-kit-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
- private RenderKitExtension extension;
@XmlElement(name="render-kit-id",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
private String id = RenderKitFactory.HTML_BASIC_RENDER_KIT;
@@ -68,6 +66,10 @@
@XmlJavaTypeAdapter(RendererAdapter.class)
private List<Renderer> renderers = Lists.newArrayList();
+ @XmlElement(name="client-behavior-renderer",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ @XmlJavaTypeAdapter(BehaviorRendererAdapter.class)
+ private List<BehaviorRenderer> behaviorRenderers = Lists.newArrayList();
+
/**
* <p class="changed_added_4_0"></p>
* @return the renderkitClass
@@ -120,8 +122,9 @@
* <p class="changed_added_4_0"></p>
* @return the extension
*/
+ @XmlElement(name="render-kit-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public RenderKitExtension getExtension() {
- return extension;
+ return super.getExtension();
}
/**
@@ -129,6 +132,6 @@
* @param extension the extension to set
*/
public void setExtension(RenderKitExtension extension) {
- this.extension = extension;
+ super.setExtension(extension);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -25,8 +25,6 @@
import javax.xml.bind.annotation.adapters.XmlAdapter;
-import org.richfaces.cdk.model.ClassDescription;
-import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.model.Renderer;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -24,19 +24,20 @@
package org.richfaces.cdk.xmlconfig.model;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.Extensible;
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
*
*/
-public class RendererBean extends DescriptionGroupBean implements Extensible<RendererBean.RendererExtension>{
+@XmlType(name="faces-config-rendererType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+public class RendererBean extends ExtensibleBean<RendererBean.RendererExtension>{
/**
* <p class="changed_added_4_0"></p>
@@ -47,23 +48,17 @@
}
- @XmlElement(name="renderer-type",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
private String type;
- @XmlElement(name="component-family",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
private String family;
- @XmlElement(name="renderer-class",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
- @XmlJavaTypeAdapter(ClassAdapter.class)
private ClassDescription rendererClass;
- @XmlElement(name="renderer-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
- private RendererExtension extension;
-
/**
* <p class="changed_added_4_0"></p>
* @return the type
*/
+ @XmlElement(name="renderer-type",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public String getType() {
return type;
}
@@ -80,6 +75,7 @@
* <p class="changed_added_4_0"></p>
* @return the family
*/
+ @XmlElement(name="component-family",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public String getFamily() {
return family;
}
@@ -96,6 +92,8 @@
* <p class="changed_added_4_0"></p>
* @return the rendererClass
*/
+ @XmlElement(name="renderer-class",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ @XmlJavaTypeAdapter(ClassAdapter.class)
public ClassDescription getRendererClass() {
return rendererClass;
}
@@ -112,15 +110,13 @@
* <p class="changed_added_4_0"></p>
* @return the extension
*/
+ @XmlElement(name="renderer-extension",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public RendererExtension getExtension() {
- return extension;
+ return super.getExtension();
}
- /**
- * <p class="changed_added_4_0"></p>
- * @param extension the extension to set
- */
+ @Override
public void setExtension(RendererExtension extension) {
- this.extension = extension;
+ super.setExtension(extension);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -11,16 +11,18 @@
namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE ) })
@XmlJavaTypeAdapters({(a)XmlJavaTypeAdapter(type=Property.class,value=PropertyAdapter.class),
@XmlJavaTypeAdapter(type=Attribute.class,value=AttributeAdapter.class),
+ @XmlJavaTypeAdapter(type=ClassDescription.class,value=ClassAdapter.class),
@XmlJavaTypeAdapter(type=ComponentLibrary.class,value=FacesConfigAdapter.class)
})
package org.richfaces.cdk.xmlconfig.model;
+import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
+import org.richfaces.cdk.model.Attribute;
+import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.Attribute;
import org.richfaces.cdk.model.Property;
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2009-08-28 00:25:48 UTC (rev 15382)
@@ -1,3 +1,8 @@
+<#macro concat seq delimiter=",">
+<#list seq as item>
+ <#nested item/><#if item_has_next>${delimiter}</#if>
+</#list>
+</#macro>
/*
* $Id$
*
@@ -26,7 +31,7 @@
import javax.annotation.Generated;
/**
- * ${description}
+ * ${description!}
**/
@Generated({"RicFaces CDK","4.0.0-SNAPSHOT"})
public class ${componentClass.simpleName} extends ${baseClass} {
@@ -34,39 +39,34 @@
public static final String COMPONENT_TYPE="${type}";
+ <#if family?exists>
public static final String COMPONENT_FAMILY="${family}";
-
+ </#if>
protected enum Properties {
- [#list component.attributes as attribute]
- [#if attribute.exists == false ]
- ${attribute.hame},
- [/#if]
- [/#list]
+ <@concat seq=generatedAttributes ; attribute>${attribute.name}</@concat>
;
String toString;
- PropertyKeys(String toString) { this.toString = toString; }
- PropertyKeys() { }
+ Properties(String toString) { this.toString = toString; }
+ Properties() { }
public String toString() {
return ((toString != null) ? toString : super.toString());
}
}
- [#list component.attributes as attribute]
- [#if attribute.exists == false ]
+ <#list generatedAttributes as attribute>
/**
- * ${attribute.description}
+ * ${attribute.description!}
**/
- public ${attribute.type} get${attribute.name}(){
+ public ${attribute.type} ${attribute.getterName}(){
return (${attribute.type})getStateHelper().eval(Properties.${attribute.name});
}
/**
* Setter for ${attribute.name}
**/
- public void set${attribute.name}(${attribute.type} ${attribute.name}){
+ public void ${attribute.setterName}(${attribute.type} ${attribute.name}){
getStateHelper().put(Properties.${attribute.name},${attribute.name});
}
- [/#if]
- [/#list]
+ </#list>
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -45,7 +45,7 @@
}
@Override
- protected Writer getOutput(Component c) throws IOException {
+ protected Writer getOutput(Component c) throws CdkException {
return output;
}
@Override
@@ -58,6 +58,11 @@
protected boolean isMyComponent(Visitable c) {
return true;
}
+
+ @Override
+ protected OutputType getOutputType() {
+ return null;
+ }
};
CdkContext cdkContext = createMockContext();
renderer.init(cdkContext);
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -0,0 +1,104 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.generate.java;
+
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+import javax.faces.component.UIOutput;
+
+import org.junit.Test;
+import org.richfaces.cdk.CdkContext;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.CdkWriter.OutputType;
+import org.richfaces.cdk.freemarker.FreeMarkerRendererTest;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.Component;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.Property;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ComponentClassGeneratorTest extends CdkTestBase {
+
+ /**
+ * Test method for {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#isMyComponent(org.richfaces.cdk.model.Visitable)}.
+ */
+ @Test
+ public void testIsMyComponent() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.Component)}.
+ * @throws Exception
+ */
+ @Test
+ public void testGetOutputFileComponent() throws Exception {
+ final StringWriter output = new StringWriter();
+ ComponentClassGenerator generator = new ComponentClassGenerator(){
+ @Override
+ protected Writer getOutput(Component c) throws CdkException {
+ return output;
+ }
+ };
+ CdkContext mockContext = createMockContext();
+ generator.init(mockContext);
+ ComponentLibrary library = new ComponentLibrary();
+ Component component = library.findOrCreateComponent("foo.bar");
+ component.setGenerate(true);
+ component.setBaseClass(new ClassDescription(UIOutput.class));
+ component.setComponentClass(new ClassDescription("foo.bar.UIBar"));
+ Property attribute = component.findOrCreateAttribute("testValue");
+ attribute.setType(new ClassDescription(Object.class));
+ attribute.setGenerate(true);
+ attribute = component.findOrCreateAttribute("testFlag");
+ attribute.setType(new ClassDescription(boolean.class));
+ attribute.setGenerate(true);
+ attribute = component.findOrCreateAttribute("id");
+ attribute.setType(new ClassDescription(String.class));
+ attribute.setGenerate(false);
+ generator.visit(component, library);
+ System.out.println(output);
+ verify(mockContext);
+ }
+
+ private CdkContext createMockContext() {
+ CdkContext cdkContext = createMock(CdkContext.class);
+ expect(cdkContext.getSourceFolders(StandardSources.JAVA_SOURCES)).andStubReturn(testSourceDirectory);
+ expect(cdkContext.getOutputFolder((OutputType) anyObject())).andStubReturn(null);
+ expect(cdkContext.getLoader()).andStubReturn(
+ FreeMarkerRendererTest.class.getClassLoader());
+ replay(cdkContext);
+ return cdkContext;
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ComponentLibraryTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ComponentLibraryTest.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ComponentLibraryTest.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -31,6 +31,7 @@
import javax.faces.render.RenderKitFactory;
import org.junit.Test;
+import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
@@ -57,9 +58,10 @@
/**
* Test method for {@link org.richfaces.cdk.model.ComponentLibrary#accept(org.richfaces.cdk.model.LibraryVisitor, java.lang.Object)}.
+ * @throws Exception
*/
@Test
- public void testAcceptLibraryVisitorOfRPP() {
+ public void testAcceptLibraryVisitorOfRPP() throws Exception {
ComponentLibrary lib = new ComponentLibrary();
final Component component = lib.findOrCreateComponent("foo.Bar");
LibraryVisitor<Boolean, Boolean> visitor = new LibraryVisitor<Boolean, Boolean>() {
@@ -122,9 +124,10 @@
/**
* Test method for {@link org.richfaces.cdk.model.ComponentLibrary#accept(java.lang.Iterable, org.richfaces.cdk.model.LibraryVisitor, java.lang.Object, java.lang.Object)}.
+ * @throws Exception
*/
@Test
- public void testAcceptIterableOfTLibraryVisitorOfRPPR() {
+ public void testAcceptIterableOfTLibraryVisitorOfRPPR() throws Exception {
List<ModelBean> beans = new ArrayList<ModelBean>();
ModelBean foo = new ModelBean("foo");
foo.setResult("foo");
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.model;
+import org.richfaces.cdk.CdkException;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -152,7 +154,7 @@
}
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
vizited = true;
return (R) visitor.visit(this, param);
}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -28,7 +28,7 @@
import java.util.Collection;
import org.junit.Test;
-import org.richfaces.cdk.AbstractCdkContext;
+import org.richfaces.cdk.CdkContextBase;
import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.model.Component;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -49,7 +49,7 @@
@Test
public void testComponentUnmarshal() throws Exception {
- JAXBBinding jaxbBinding = JAXBBinding.getInstance(new AbstractCdkContext(this.getClass().getClassLoader()));
+ JAXBBinding jaxbBinding = JAXBBinding.getInstance(new CdkContextBase(this.getClass().getClassLoader()));
FacesConfigBean library = jaxbBinding.unmarshal("urn:resource:org/richfaces/cdk/xmlconfig/component.xml", ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION, FacesConfigBean.class);
assertEquals(1,library.getComponents().size());
Component component = library.getComponents().get(0);
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -30,7 +30,7 @@
import java.util.Set;
import org.junit.Test;
-import org.richfaces.cdk.AbstractCdkContext;
+import org.richfaces.cdk.CdkContextBase;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.Property;
@@ -46,21 +46,21 @@
@Test
public void parserTest() throws Exception {
- FragmentParser parser = FragmentParser.getInstance(new AbstractCdkContext(this.getClass().getClassLoader()));
+ FragmentParser parser = FragmentParser.getInstance(new CdkContextBase(this.getClass().getClassLoader()));
Collection<Property> properties = parser.parseProperties("urn:resource:org/richfaces/cdk/xmlconfig/fragment.xml");
assertEquals(3,properties.size());
}
@Test
public void xincludeTest() throws Exception {
- FragmentParser parser = FragmentParser.getInstance(new AbstractCdkContext(this.getClass().getClassLoader()));
+ FragmentParser parser = FragmentParser.getInstance(new CdkContextBase(this.getClass().getClassLoader()));
Collection<Property> properties = parser.parseProperties("urn:resource:org/richfaces/cdk/xmlconfig/parent.xml");
assertEquals(1,properties.size());
}
@Test
public void propertyTest() throws Exception {
- FragmentParser parser = FragmentParser.getInstance(new AbstractCdkContext(this.getClass().getClassLoader()));
+ FragmentParser parser = FragmentParser.getInstance(new CdkContextBase(this.getClass().getClassLoader()));
Collection<Property> properties = parser.parseProperties("urn:resource:org/richfaces/cdk/xmlconfig/include.xml");
assertEquals(1,properties.size());
Property property = Iterables.getOnlyElement(properties);
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JaxbMarshalTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JaxbMarshalTest.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/JaxbMarshalTest.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -7,7 +7,7 @@
import javax.xml.transform.stream.StreamResult;
import org.junit.Test;
-import org.richfaces.cdk.AbstractCdkContext;
+import org.richfaces.cdk.CdkContextBase;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.model.Component;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -18,7 +18,7 @@
@Test
public void testMarshalResultStringT() throws Exception {
- JAXBBinding jaxbBinding = JAXBBinding.getInstance(new AbstractCdkContext(this.getClass().getClassLoader()));
+ JAXBBinding jaxbBinding = JAXBBinding.getInstance(new CdkContextBase(this.getClass().getClassLoader()));
ComponentLibrary library = new ComponentLibrary();
Component component = library.findOrCreateComponent("foo.bar");
RenderKit renderKit = library.findOrCreateRenderKit("HTML");
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -21,13 +21,13 @@
package org.richfaces.builder.maven;
-import org.richfaces.cdk.AbstractCdkContext;
+import org.richfaces.cdk.CdkContextBase;
/**
* @author shura
*
*/
-public class MavenCompilationContext extends AbstractCdkContext {
+public class MavenCompilationContext extends CdkContextBase {
private MavenLogger logger;
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-08-28 00:23:22 UTC (rev 15381)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-08-28 00:25:48 UTC (rev 15382)
@@ -30,7 +30,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.richfaces.cdk.AbstractCdkContext;
+import org.richfaces.cdk.CdkContextBase;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.LibraryBuilder;
import org.richfaces.cdk.ModelValidator;
@@ -60,7 +60,7 @@
public void execute() throws MojoExecutionException, MojoFailureException {
// TODO set logging.
checkLibraryConfig();
- AbstractCdkContext context = new AbstractCdkContext(this
+ CdkContextBase context = new CdkContextBase(this
.createProjectClassLoader(project));
ArrayList<File> folders = new ArrayList<File>(compileSourceRoots.size());
for (String sourceFolder : compileSourceRoots) {
15 years, 4 months
JBoss Rich Faces SVN: r15381 - in root/docs/trunk/guides: migrationguide and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-08-27 20:23:22 -0400 (Thu, 27 Aug 2009)
New Revision: 15381
Added:
root/docs/trunk/guides/migrationguide/
root/docs/trunk/guides/migrationguide/en/
root/docs/trunk/guides/migrationguide/en/pom.xml
root/docs/trunk/guides/migrationguide/en/src/
root/docs/trunk/guides/migrationguide/en/src/main/
root/docs/trunk/guides/migrationguide/en/src/main/docbook/
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/actionparam.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/ajaxSingleFacets.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/binding.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/calendarDate.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/contextMenuDisablement.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerFor.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerPaired.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/explicitId.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/fileUploadListener.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/i18n.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/immediate.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/menuJSF.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/myfaces.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/resource.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/seamMultipartFilter.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/master.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/
root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/intro.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/req.xml
root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/scope.xml
root/docs/trunk/guides/migrationguide/pom.xml
Modified:
root/docs/trunk/guides/pom.xml
Log:
https://jira.jboss.org/jira/browse/RF-7335 - Migration Guide is added to the 4.0 build
Added: root/docs/trunk/guides/migrationguide/en/pom.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/pom.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/pom.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.richfaces.docs.guides</groupId>
+ <artifactId>migrationGuide</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.docs.migrationGuide</groupId>
+ <artifactId>en</artifactId>
+ <packaging>jar</packaging>
+ <name>RichFaces Migration Guide (${translation})</name>
+ <build>
+ <finalName>
+ ${project.parent.artifactId}_${translation}-${version}
+ </finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Property changes on: root/docs/trunk/guides/migrationguide/en/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/actionparam.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/actionparam.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/actionparam.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="actionparam" role="NotInToc">
+ <?dbhtml filename="actionparam.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>a4j:actionparam</keyword>
+ <keyword>actionListener</keyword>
+ <keyword>JSP</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Action listeners calling problem with <a4j:actionparam> on JSP page</title>
+ <section>
+ <title>Description</title>
+ <para>
+ As it has been mentioned above we've migrated to <property>JSF 1.2</property> standard in <property>RichFaces 3.2.0</property>.
+ The order of calling action listeners has been changed in <property>JSF 1.2</property>: first the listener of the component itself is called then the other listeners are called.
+ </para>
+ <para>
+ This is why the <emphasis role="bold"><property><a4j:actionparam></property></emphasis> component setter is called after
+ <emphasis><property>"actionListener"</property></emphasis> of the component itself.
+ In the following example <code>#{bean.action}</code> is called before <code>#{bean.value}</code>:
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<a4:support actionListener="#{bean.action}" event="onclick">
+ <a4j:actionparam assignTo="#{bean.value}" value="John"/>
+</a4j:support>
+...]]></programlisting>
+ <para>
+ This issue occurs in JSP pages only.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-3110">Jira</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <programlisting role="XML"><![CDATA[...
+<f:view>
+ <h:form>
+ <h:panelGrid width="120" border="5">
+ <a4j:support event="onclick" reRender="rep" actionListener="#{actionPlanBean.actionListener}">
+ <a4j:actionparam name="username" value="John" assignTo="#{actionPlanBean.name}" />
+ </a4j:support>
+ <h:outputLabel value="Panel 1 - John"/>
+ </h:panelGrid>
+ <rich:panel>
+ <h:outputText id="rep" value="I say: #{actionPlanBean.helloLabel}"/>
+ </rich:panel>
+ </h:form>
+</f:view>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Please, see <ulink url="http://jira.jboss.com/jira/browse/RF-3080">Jira</ulink>.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ The solution is to use <emphasis role="bold"><property><a4j:actionParam></property></emphasis> before:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<f:actionListener binding="#{skin.binding}"/>
+...]]></programlisting>
+
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/actionparam.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/ajaxSingleFacets.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/ajaxSingleFacets.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/ajaxSingleFacets.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="ajaxSingleFacets" role="NotInToc">
+ <?dbhtml filename="ajaxSingleFacets.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>ajaxSingle</keyword>
+ <keyword>facet</keyword>
+ <keyword>static</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>The ajaxSingle/region components in facets of <h:dataTable></title>
+ <section>
+ <title>Description</title>
+ <para>
+ The <property>RichFaces</property> components that have
+ <emphasis><property>"ajaxSingle"</property></emphasis> set to "true" does not work in
+ <emphasis><property>"header"</property></emphasis> or <emphasis><property>"footer"</property></emphasis> facets
+ of <emphasis role="bold"><property><h:dataTable></property></emphasis>, e.g.
+ <emphasis role="bold"><property><rich:datascroller></property></emphasis> - scrolling doesn't work.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2696">Jira</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The described above problem occurs if the following code is used. As a result the <emphasis role="bold"><property><rich:datascroller></property></emphasis> component stops working.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:dataTable>
+ <f:facet name="header">
+ <rich:datascroller ajaxSingle="true"/>
+ </f:facet>
+ ...
+</h:dataTable>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ The ajaxSingle/region requires <code>invokeOnComponent()</code> to work properly. For more details, please,
+ see <ulink url="https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=718">JavaServer Faces issues reporting</ulink> page.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ The solution is to use <emphasis role="bold"><property><rich:dataTable></property></emphasis> component.
+ </para>
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/ajaxSingleFacets.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/binding.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/binding.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/binding.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="binding" role="NotInToc">
+ <?dbhtml filename="binding.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>binding</keyword>
+ <keyword>JSP</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Binding problem in JSP</title>
+ <section>
+ <title>Description</title>
+ <para>
+ Binding does not work for all components in JSP: it is impossible to use the<emphasis><property>"binding"</property></emphasis> attribute for
+ RichFaces components, since wrong class-name is used in TLD generated from XML configuration files.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2918 ">Jira</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140368#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The described above problem occurs if binding attribute is used with RichFaces components.
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ There was a wrong <code><classname>java.lang.String</classname></code> specified instead of <code><classname>javax.faces.component.UIComponent</classname></code> in configuration files.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ The solution is to use <property>Facelets</property> upgrade to <ulink url=" http://www.jboss.org/jbossrichfaces/downloads/">RichFaces 3.2.0 SP1</ulink>
+ </para>
+ </section>
+
+</section>
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/binding.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/calendarDate.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/calendarDate.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/calendarDate.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="calendarDate" role="NotInToc">
+ <?dbhtml filename="calendarDate.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>calendar</keyword>
+ <keyword>date</keyword>
+ <keyword>ondateselected</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title><rich:calendar> and "ondateselected" event problem</title>
+ <section>
+ <title>Description</title>
+ <para>
+ The <emphasis role="bold"><property><rich:calendar></property></emphasis> date selected event is fired before input update.
+ </para>
+ <para>
+ If <property>time</property> and <property>apply</property> elements are added to the calendar,
+ <emphasis><property>"ondateselected"</property></emphasis> gets fired when a date is selected but before it's updated in input.
+ Now we have three events instead of one. But it causes compatibility problem because this event was used by customers to save selected value via Ajax.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=132914">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The described above problem occurs when <emphasis role="bold"><property><a4j:support></property></emphasis>is put inside <emphasis role="bold"><property><rich:calendar></property></emphasis>.
+ If the <emphasis><property>"event"</property></emphasis> property is set to "ondateselected"
+ previous value of the <emphasis role="bold"><property><rich:calendar></property></emphasis> is stored after selection.
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Events firing sequence was changed.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ You need <emphasis><property>"onchanged"</property></emphasis> event to be fired after any change which causes input to be updated, both date and time.
+ </para>
+ <para>
+ Note, that
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis><property>"ondateselected"</property></emphasis> event is fired after a date is selected in popup
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis><property>"ontimechanged"</property></emphasis> event is fired after new time is selected.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/calendarDate.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/contextMenuDisablement.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/contextMenuDisablement.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/contextMenuDisablement.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="contextMenuDisablement" role="NotInToc">
+ <?dbhtml filename="contextMenuDisablement.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>contextMenu</keyword>
+
+ </keywordset>
+ </sectioninfo>
+ <title>The <rich:contextMenu> if rendered completely disables right mouse click on a page</title>
+ <section>
+ <title>Description</title>
+ <para>
+ The <emphasis role="bold"><property><rich:contextMenu></property></emphasis> component
+ if rendered disables a right mouse click on a page by default in <property>RichFaces</property> 3.3.0.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.org/jira/browse/RF-5225">Jira</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ Checkout RichFaces Live Demo 3.3.0, run it, and proceed to the Context Menu page.
+ If you right click on the image
+ <emphasis role="bold"><property><rich:contextMenu></property></emphasis> appears.
+ If you click anywhere else, the right click will be non functional.
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ The <emphasis role="bold"><property><rich:contextMenu></property></emphasis> in <property>RichFaces</property> 3.3.0 completely disables
+ right mouse click on a page by default.
+ </para>
+ </section>
+ <section>
+ <title>Workarounds</title>
+ <para>
+ Update to <property>RichFaces</property> 3.3.1.
+ By default, the <emphasis role="bold"><property><rich:contextMenu></property></emphasis> in <property>RichFaces</property> 3.3.1 completely disables
+ right mouse click in the Context Menu area only.
+ </para>
+ </section>
+</section>
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/contextMenuDisablement.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/dataTableAjax.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/dataTableAjax.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="dataTableAjax" role="new">
+ <?dbhtml filename="dataTableAjax.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>dataTable</keyword>
+ <keyword>ajax</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Ajax request calls encode() methods of <rich:dataTable> even if it is not necessary</title>
+ <section>
+ <title>Description</title>
+ <para>
+ Any Ajax request reloads the list that is related to the <emphasis role="bold"><property><rich:dataTable></property></emphasis> component even if the Ajax request is related to another bean.
+It happens because the Ajax request checks whether the <emphasis role="bold"><property><rich:dataTable></property></emphasis> has nested <emphasis role="bold"><property><rich:outputPanel></property></emphasis> or <emphasis role="bold"><property><rich:messages></property></emphasis> components that should be updated.
+If there are no <emphasis role="bold"><property><rich:outputPanel></property></emphasis>, <emphasis role="bold"><property><rich:messages></property></emphasis> components inside the <emphasis role="bold"><property><rich:dataTable></property></emphasis> will not be updated, but anyway the <code>encode()</code> methods is called by the Ajax request.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.org/jira/browse/RF-3341">Jira</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4197996#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ Place the following code on a page and click the button. The list in <code>myBean1.myList</code> will be reloaded.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:form id="form1">
+ <rich:dataTable id="myTable" value="#{myBean1.myList}" var="comp">
+ ...
+ </rich:dataTable>
+</h:form>
+<h:form id="form2">
+ <h:outputText value="#{myBean2.test}"/>
+ <a4j:commandButton event="onclick" reRender="form2" />
+</h:form>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Bug is caused by <emphasis role="bold"><property><rich:dataTable></property></emphasis> implementation peculiarity.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ Wrap the zone of a page that should be processed and updated in the <emphasis role="bold"><property><a4j:region></property></emphasis> component with <code>renderRegionOnly="true"</code>. The <emphasis role="bold"><property><rich:dataTable></property></emphasis> should be outside of the <emphasis role="bold"><property><a4j:region></property></emphasis>.
+ </para>
+ </section>
+</section>
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerFor.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerFor.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerFor.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="datascrollerFor" role="NotInToc">
+ <?dbhtml filename="datascrollerFor.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>datascroller</keyword>
+ <keyword>for</keyword>
+ <keyword>static</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Static "for" attribute in <rich:datascroller></title>
+ <section>
+ <title>Description</title>
+ <para>
+ The <emphasis><property>"for"</property></emphasis>attribute of <emphasis role="bold"><property><rich:datascroller></property></emphasis> component
+ doesn't allow EL expressions in 3.2.0.GA.
+ </para>
+ <para>
+ Custom tags exploiting the ability of the <emphasis role="bold"><property><rich:datascroller></property></emphasis> to have dynamic
+ <emphasis><property>"for"</property></emphasis> attribute doesn't work.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2923">Jira</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The described above problem occurs if the following code is used:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:datascroller for="#{bean.property}"/>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Please, see <ulink url="http://jira.jboss.com/jira/browse/RF-1133">Jira</ulink>
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ None, so far.
+ </para>
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerFor.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerPaired.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerPaired.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerPaired.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="datascrollerPaired" role="NotInToc">
+ <?dbhtml filename="datascrollerPaired.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>datascroller</keyword>
+ <keyword>paired</keyword>
+ <keyword>page</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Paired <rich:datascroller> components do not work</title>
+ <section>
+ <title>Description</title>
+ <para>
+ Two <emphasis role="bold"><property><rich:datascroller></property></emphasis> components bound to the same table aren't synchronized.
+ Having two <emphasis role="bold"><property><rich:datascroller></property></emphasis>components on a page, session-scoped beans saves the data for only one <emphasis role="bold"><property><rich:datascroller></property></emphasis> component.
+ It is a common pattern to have 2 <emphasis role="bold"><property><rich:datascroller></property></emphasis> components:
+ the first in the header, the second in the footer. In this case the first one will not work.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2970">Jira</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141786#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The described above problem occurs if two <emphasis role="bold"><property><rich:datascroller></property></emphasis> components are added to any table.
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ The <emphasis role="bold"><property><rich:datascroller></property></emphasis> component does not manage the scroll state of a data table.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ The solution is to use <emphasis><property>"page"</property></emphasis> attribute and bind it to the same property for all
+ <emphasis role="bold"><property><rich:datascroller></property></emphasis> components.
+ </para>
+ </section>
+
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/datascrollerPaired.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/explicitId.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/explicitId.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/explicitId.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="explicitId" role="NotInToc">
+ <?dbhtml filename="explicitId.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>explicit</keyword>
+ <keyword>id</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Ajax requests in JSF 1.2</title>
+ <section>
+ <title>Description</title>
+ <para>
+ Ajax requests stop to work without any errors messages displayed, when intensive Ajax traffic is expected. No errors or other messages to detect cause of the defect are shown.
+ </para>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The described above problem occurs if an <property>id</property> for Ajax command component is not defined.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:inputText id="myinput" value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="outtext" />
+ </h:inputText>
+ <h:outputText id="outtext" value="#{userBean.name}" />
+ </h:panelGrid>
+ </h:form>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ The problem occurred due to specific usage of the dynamic id generation implementing JSF 1.2.
+ In case of simultaneous request processing, the id of the command component becomes <property>out-of-sync</property>
+ with id of the same component on the page. After that any Ajax requests of the component with old id is not processed.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ You should define the <property>id</property> for the command component and parent namespace components
+ (<emphasis role="bold"><property><h:form></property></emphasis>,
+ <emphasis role="bold"><property><f:subview></property></emphasis>,
+ <emphasis role="bold"><property><h:dataTable></property></emphasis> and so on) explicitly.
+ As soon as this is a core JSF 1.2 functionality, the problem cannot be solved on the <property>RichFaces</property> level.
+ </para>
+ </section>
+
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/explicitId.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/fileUploadListener.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/fileUploadListener.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/fileUploadListener.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="fileUploadListener" role="NotInToc">
+ <?dbhtml filename="fileUploadListener.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>fileUpload</keyword>
+ <keyword>listener</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>The "fileUploadListener" with MyFaces or JSF-RI 1.2_04</title>
+ <section>
+ <title>Description</title>
+ <para>
+ The <emphasis><property>"fileUploadListener"</property></emphasis>(<emphasis><property>"UploadEvent"</property></emphasis> event) is not invoked
+ when <property>MyFaces</property> or <property>JSF-RI 1.2_04</property> is used. But file is uploaded successfully.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2935">Jira(for MyFaces)</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=132530&a...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ <property>MyFaces</property> or <property>JSF-RI 1.2_04</property> with default configuration
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ In case <property>MyFaces</property> <code>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</code> parameter is set to "true", the parameter checks if the extensions-filter has been properly configured.
+ </para>
+ <para>
+ The reason why usage of <property>JSF-RI 1.2_04</property> causes the problem is not yet identified.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ To avoid generation of errors from <property>MyFaces</property> in case of invalid filter configuration
+ you can set up the following parameters in <property>web.xml</property>:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+ <param-value>false</param-value>
+</context-param>
+...]]></programlisting>
+ <para>
+ In case of JSF 1.2_04, upgrading to <ulink url="https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderI...">JSF-RI 1.2_07</ulink>
+ (last stable version) works.
+ </para>
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/fileUploadListener.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/i18n.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/i18n.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/i18n.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="i18n" role="NotInToc">
+ <?dbhtml filename="i18n.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>i18n</keyword>
+ <keyword>internationalization</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>non-ASCII characters in application with i18n</title>
+ <section>
+ <title>Description</title>
+ <para>
+ An application with i18n does not work correctly due to the validation error that occurs when non-ASCII characters are used.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2962">Jira</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141302#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <programlisting role="XML"><![CDATA[...
+<select id="j_id27:cbxUser" name="j_id27:cbxUser" size="1" style="width:120px">
+ <option value="Al Korbeli& #269;o">Al Korbeli& #269;o</option>
+ <option value="Al Nagyov& aacute;">Al Nagyov& aacute;</option>
+ <option value="Al Tothov& aacute;">Al Tothov& aacute;</option>
+ <option value="An Gajdov& aacute;">An Gajdov& aacute;</option>
+ ...
+</select>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Bug is caused by the<emphasis role="bold"><property><rich:fileUpload></property></emphasis> component
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ You need to update to <ulink url="http://www.jboss.org/jbossrichfaces/downloads/">RichFaces 3.2.0 SP1</ulink>
+ </para>
+ </section>
+
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/i18n.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/immediate.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/immediate.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/immediate.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="immediate" role="NotInToc">
+ <?dbhtml filename="immediate.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>a4j:support</keyword>
+ <keyword>immediate</keyword>
+ <keyword>JSP</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Behavior of the "immediate" attribute is changed</title>
+ <section>
+ <title>Description</title>
+ <para>
+ Since we've migrated to the <property>JSF 1.2</property> standard in <property>RichFaces 3.2.0</property> the
+ <emphasis><property>"immediate"</property></emphasis> attribute works exactly like it should according to the JSF 1.2 specification:
+ the default ActionListener stops execution after the Apply Request Values phase, so there is no interaction with a model any more.
+ We could not use the standard JSF API before as soon as we had to support not only JSF 1.2, but JSF 1.1 as well.
+ We used our own hack that emulated the behavior of the attribute.
+ This approach had a side effect that allowed interacting with a model but now this side effect is gone.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=133031">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <programlisting role="XML"><![CDATA[...
+<h:form>
+ <h:inputText id="oneA" value="#{bean.name}" size="8">
+ <a4j:support event="onkeyup" reRender="three" immediate="true" focus="oneA" action="#{bean.actionOne}"/>
+ </h:inputText>
+ <h:selectBooleanCheckbox id="twoA" value="#{bean.option}">
+ <a4j:support event="onclick" reRender="three" immediate="true" focus="twoA" action="#{bean.actionOne}"/>
+ </h:selectBooleanCheckbox>
+ <h:commandButton id="go" value="Submit"/>
+</h:form>
+<h:outputText id="three" value="#{bean.name} #{bean.option}"/>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Behavior of the <emphasis><property>"immediate"</property></emphasis> attribute is changed according to to JSF 1.2 specification.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ The solution includes the following steps:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ replace <emphasis><property>"immediate"</property></emphasis> attribute with <code>ajaxSingle="true"</code>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ add <emphasis><property>"process"</property></emphasis> attribute.
+ This attribute points to the components that should be processed together with the command component.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/immediate.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/menuJSF.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/menuJSF.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/menuJSF.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="menuJSF" role="NotInToc">
+ <?dbhtml filename="menuJSF.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>JSF-RI-1.2_08</keyword>
+ <keyword>menu</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Menu components and JSF-RI-1.2_08</title>
+ <section>
+ <title>Description</title>
+ <para>
+ Menu components do not work with JSF-RI-1.2_08:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The <emphasis role="bold"><property><rich:contextMenu></property></emphasis> component is not invoked by the right mouse click
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <emphasis role="bold"><property><rich:dropDownMenu></property></emphasis> component causes the exception, displaying a XHTML invalid output message
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=717 ">JavaServer Faces issues</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2637 ">Jira</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140689#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The described above problems occur if JSF-RI 1.2_08 and menu components are used on a page
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ It is a critical bug in JSF-RI 1.2_08 which has been already fixed in the further releases.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ Upgrade to <ulink url="https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderI...">JSF-RI 1.2_09</ulink> or above
+ </para>
+ </section>
+
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/menuJSF.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/myfaces.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/myfaces.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/myfaces.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="myfaces" role="NotInToc">
+ <?dbhtml filename="myfaces.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>MyFaces</keyword>
+ <keyword>RichFaces</keyword>
+ <keyword>WebLogic</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>RichFaces 3.2.0 with MyFaces 1.2.2 on WebLogic 10 MP1</title>
+ <section>
+ <title>Description</title>
+ <para>
+ If you try to use <property>RichFaces 3.2.0</property> with <property>MyFaces 1.2.2</property> on a
+ <property>WebLogic 10 MP1</property> server the following error appears:
+ </para>
+ <programlisting role="JAVA"><![CDATA[java.lang.IllegalStateException: Servlet response already use stream, Writer not possible
+...]]></programlisting>
+
+
+ <para>
+ The same project works on <property>Tomcat 6.016</property>, <property>Tomcat 5.5.25</property>
+ <property>WebLogic 10MP1</property> with <property>RichFaces 3.1.4</property>.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141659#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The problem occurs if the environment mentioned above is set.
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Unknown. Possible problem with <property>MyFaces</property> on <property>WebLogic 10MP1</property>.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ Switching to <ulink url="https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderI...">JSF-RI 1.2_07</ulink>
+ fixes the problem (see forum post)
+ </para>
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/myfaces.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/resource.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/resource.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/resource.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="resource" role="NotInToc">
+ <?dbhtml filename="resource.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>resource</keyword>
+ <keyword>skinning</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Resources for standard skinning classes</title>
+ <section>
+ <title>Description</title>
+ <para>
+ When standard skinning classes or background images are inaccessible
+ <code>"Resource not registered : org.richfaces.renderkit.html.images.InputBackgroundImage"</code> (another name is possible) exception appears in server log.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/RF-2944 ">Jira</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140846#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>The described above problem usually occurs after server restart when user refreshes the page</para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ The problem is caused when resources for standard skinning classes are not available to be registered during <property>RichFaces</property> library build
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ Switch off standard skinning classes by setting initial parameter in <property>web.xml</property>:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
+ <param-value>disable</param-value>
+</context-param>
+...]]></programlisting>
+<para>
+ Add <ulink url="http://docs.google.com/View?docid=dqk93fg_3ggsznfz5">META-INF/resources-config.xml</ulink> to the application classpath.
+</para>
+ </section>
+
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/resource.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/seamMultipartFilter.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/seamMultipartFilter.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/seamMultipartFilter.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="seamMultipartFilter" role="NotInToc">
+ <?dbhtml filename="seamMultipartFilter.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:fileUpload</keyword>
+ <keyword>Seam</keyword>
+ <keyword>multi-part</keyword>
+ <keyword>filter</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title><rich:fileUpload> with Seam multi-part filter</title>
+ <section>
+ <title>Description</title>
+ <para>
+ The <emphasis role="bold"><property><rich:fileUpload></property></emphasis> component does not work with <property>Seam</property> multi-part filter.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141587#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ The problem occurs if you use the <emphasis role="bold"><property><rich:fileUpload></property></emphasis> component and <property>Seam</property> multi-part filter at the same time.
+ </para>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Lack of specification on the <property>Servlet</property> level does not allow to use stuff doing the same thing. One of them should be turned off.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ The solution is turn the <property>Seam</property> multi-part filter off.
+ </para>
+ </section>
+</section>
\ No newline at end of file
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/included/seamMultipartFilter.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/master.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/master.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/master.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+"http://www.docbook.org/xml/4.3CR3/docbookx.dtd" [
+ <!ENTITY intro SYSTEM "modules/intro.xml">
+ <!ENTITY scope SYSTEM "modules/scope.xml">
+ <!ENTITY req SYSTEM "modules/req.xml">
+
+ <!ENTITY i18n SYSTEM "included/i18n.xml">
+ <!ENTITY menuJSF SYSTEM "included/menuJSF.xml">
+ <!ENTITY binding SYSTEM "included/binding.xml">
+ <!ENTITY explicitId SYSTEM "included/explicitId.xml">
+ <!ENTITY resource SYSTEM "included/resource.xml">
+
+ <!ENTITY calendarDate SYSTEM "included/calendarDate.xml">
+ <!ENTITY datascrollerPaired SYSTEM "included/datascrollerPaired.xml">
+ <!ENTITY datascrollerFor SYSTEM "included/datascrollerFor.xml">
+ <!ENTITY ajaxSingleFacets SYSTEM "included/ajaxSingleFacets.xml">
+ <!ENTITY actionparam SYSTEM "included/actionparam.xml">
+ <!ENTITY immediate SYSTEM "included/immediate.xml">
+
+
+ <!ENTITY fileUploadListener SYSTEM "included/fileUploadListener.xml">
+ <!ENTITY myfaces SYSTEM "included/myfaces.xml">
+ <!ENTITY seamMultipartFilter SYSTEM "included/seamMultipartFilter.xml">
+ <!ENTITY contextMenuDisablement SYSTEM "included/contextMenuDisablement.xml">
+
+
+ <!ENTITY dataTableAjax SYSTEM "included/dataTableAjax.xml">
+
+ <!ENTITY cdkguide "../../cdkguide/html_single/index.html">
+ <!ENTITY devguide "../../devguide/html_single/index.html">
+ <!ENTITY migrationguide "../../migrationguide/html_single/index.html">
+ <!ENTITY photoalbumguide "../../realworld/html_single/index.html">
+ <!ENTITY realworld "../../realworld/html_single/index.html">
+ <!ENTITY tlddoc "../../tlddoc/index.html">
+ <!ENTITY apidoc "../../apidoc/index.html">
+ <!ENTITY apidoc_framework "../../apidoc_framework/index.html">
+
+]>
+<book>
+ <bookinfo>
+ <title>RichFaces Migration Guide</title>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject role="fo">
+ <imagedata format="PNG" fileref="images/richfaces_logo.png" />
+ </imageobject>
+ <imageobject role="html">
+ <imagedata/>
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <author>
+ <firstname>Gleb</firstname>
+ <surname>Galkin</surname>
+ <email>ggalkin(a)exadel.com</email>
+ </author>
+ <copyright>
+ <year>2008, 2009</year>
+ <holder>Red Hat</holder>
+ </copyright>
+<abstract>
+ <title/>
+ <para>
+ <ulink url="../pdf/richfaces_migration_guide.pdf">PDF version</ulink>
+ </para>
+</abstract>
+
+ </bookinfo>
+
+ <toc/>
+
+ &intro;
+ &scope;
+ &req;
+
+ <chapter id="RichFacesMigrationIssues31to32" xreflabel="RichFacesMigrationIssues31to32">
+ <?dbhtml filename="RichFacesMigrationIssues31to32.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+ <keyword>Migration Guide</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>The RichFaces Migration Issues 3.1.x - 3.2.0</title>
+
+ <para>
+ This chapter includes only those issues that concern migration from from 3.1.x versions to 3.2.0.
+ Issues, related to the new components and other problems are not covered here.
+ However, <ulink url="http://jira.jboss.com/jira/browse/RF">Jira</ulink> contains all issues
+ and if you can not find your case there, please, feel free to report it.
+ </para>
+ <section id="MostImportant31to32">
+ <?dbhtml filename="MostImportant31to32.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>important</keyword>
+ <keyword>issues</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Most important issues</title>
+ <para>
+ Migrating to <property>RichFaces 3.2.0</property> you can encounter
+ with malfunction of the components caused by a number of reasons.
+ However, most of the problems can be positively solved.
+ This section covers the most significant issues you can potentially encounter, providing ways to handle the cases.
+ </para>
+ &i18n;
+ &menuJSF;
+ &binding;
+ &explicitId;
+ &resource;
+ </section>
+
+ <section id="PreviousVersions31to32">
+ <?dbhtml filename="PreviousVersions31to32.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>upgrade</keyword>
+ <keyword>previous</keyword>
+ <keyword>version</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Issues with upgrading from previous versions</title>
+ <para>This section covers issues you can encounter upgrading to <property>RichFaces 3.2.0</property> from previous versions.</para>
+ &calendarDate;
+ &datascrollerPaired;
+ &datascrollerFor;
+ &ajaxSingleFacets;
+ &actionparam;
+ &immediate;
+ </section>
+
+ <section id="ThirdPartyFrameworks31to32">
+ <?dbhtml filename="ThirdPartyFrameworks31to32.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>third</keyword>
+ <keyword>party</keyword>
+ <keyword>frameworks</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Issues with compatibility with third party frameworks</title>
+ <para>This section covers issues related to compatibility with third party frameworks. </para>
+ &fileUploadListener;
+ &myfaces;
+ &seamMultipartFilter;
+ </section>
+ </chapter>
+
+ <chapter id="RichFacesMigrationIssues32to33" xreflabel="RichFacesMigrationIssues32to33">
+ <?dbhtml filename="RichFacesMigrationIssues32to33.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+ <keyword>Migration Guide</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>The RichFaces Migration Issues 3.2.x - 3.3.0</title>
+ <para>
+ This chapter includes only those issues that concern migration from from 3.2.x versions to 3.3.0.
+ Issues, that are related to the new components and other problems are not covered here.
+ However, <ulink url="http://jira.jboss.com/jira/browse/RF">Jira</ulink> contains all issues
+ and if you can not find your case there, please, feel free to report it.
+ </para>
+
+
+&dataTableAjax;
+ </chapter>
+ <chapter id="RichFacesMigrationIssues330to331" xreflabel="RichFacesMigrationIssues330to331">
+ <?dbhtml filename="RichFacesMigrationIssues330to331.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+ <keyword>Migration Guide</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>The RichFaces Migration Issues 3.3.0 - 3.3.1</title>
+ <para>
+ This chapter includes only those issues that concern migration from from 3.3.0 versions to 3.3.1.
+ Issues, that are related to the new components and other problems are not covered here.
+ However, <ulink url="http://jira.jboss.com/jira/browse/RF">Jira</ulink> contains all issues
+ and if you can not find your case there, please, feel free to report it.
+ </para>
+ &contextMenuDisablement;
+ </chapter>
+</book>
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/master.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/intro.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/intro.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/intro.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="introduction" xreflabel="introduction">
+ <?dbhtml filename="intro.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+ <keyword>Migration Guide</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Introduction</title>
+ <para>
+ This document is aimed to provide guidelines for migrating <property>RichFaces</property> projects.
+ </para>
+ <para>
+ <property>RichFaces</property> Migration Guide covers troublesome issues caused by migration and provides
+ suitable workarounds and examples.
+ </para>
+</chapter>
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/intro.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/req.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/req.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/req.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="req" xreflabel="req">
+ <?dbhtml filename="requirements.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+ <keyword>Migration Guide</keyword>
+ <keyword>requirements</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Minimum requirements for the project with RichFaces 3.2.0</title>
+ <para>
+ You can find all technical requirements to start working with <property>RichFaces</property>
+ in the <ulink url="http://www.jboss.org/jbossrichfaces/docs/index.html">Developer Guide</ulink>.
+ </para>
+
+</chapter>
+
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/req.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/scope.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/scope.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/scope.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="scope" xreflabel="scope">
+ <?dbhtml filename="scope.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>RichFaces</keyword>
+ <keyword>Migration Guide</keyword>
+ <keyword>scope</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Scope of the document</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ This document should not be used as a tutorial for <property>RichFaces</property> framework
+ since it is created to describe the issues caused by migration process
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ It is assumed that you are familiar with basic tenets of <property>RichFaces</property> framework.
+ If you are newbie in <property>RichFaces</property> you can find
+ <property>RichFaces</property> documentation on <ulink url="http://www.jboss.org/jbossrichfaces/docs/index.html">RichFaces project page</ulink>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Concepts related to Web or application servers configuration, JSF, JSF implementations are beyond the scope of this document
+ </para>
+ </listitem>
+ </itemizedlist>
+
+</chapter>
Property changes on: root/docs/trunk/guides/migrationguide/en/src/main/docbook/modules/scope.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: root/docs/trunk/guides/migrationguide/pom.xml
===================================================================
--- root/docs/trunk/guides/migrationguide/pom.xml (rev 0)
+++ root/docs/trunk/guides/migrationguide/pom.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -0,0 +1,243 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.richfaces.docs</groupId>
+ <artifactId>guides</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.docs.guides</groupId>
+ <artifactId>migrationGuide</artifactId>
+ <packaging>pom</packaging>
+ <name>RichFaces Migration Guide</name>
+ <modules>
+ <module>${docs.translation}</module>
+ </modules>
+
+ <!--version>3.3.2-SNAPSHOT</version>
+ <name>Migration Guide</name>
+ <description>RichFaces Migration Guide from 3.1.* to 3.2.0 version</description>
+ <pluginRepositories>
+ <pluginRepository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </pluginRepository>
+ </pluginRepositories>
+ <profiles>
+ <profile>
+ <id>html</id>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin
+ </artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8
+ </version>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource> ${xsl_html}</stylesheetResource>
+ <finalName> index.html</finalName>
+ <imageCopyingRequired> true</imageCopyingRequired>
+ <imagePathSettingRequired> false</imagePathSettingRequired>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ <profile>
+ <id>html_single</id>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin
+ </artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8
+ </version>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource> ${xsl_html_single}</stylesheetResource>
+ <imageCopyingRequired> true</imageCopyingRequired>
+ <imagePathSettingRequired> false</imagePathSettingRequired>
+ <finalName> index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ </profiles>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>
+ org.richfaces.docs.common-resources
+ </groupId>
+ <artifactId>
+ ${translation}
+ </artifactId>
+ <version>
+ ${project.version}
+ </version>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>
+ ${project.build.directory}
+ </outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ <overWriteReleases>
+ false
+ </overWriteReleases>
+ <overWriteSnapshots>
+ true
+ </overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+ <executions>
+ <execution>
+ <id>jdocbook:generate</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>jdocbook:resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>jdocbook:bundle</id>
+ <phase>package</phase>
+ <goals>
+ <goal>bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.docs.common-resources</groupId>
+ <artifactId>${translation}</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>fop</artifactId>
+ <version>0.95</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDirectory>
+ ${basedir}/src/main/docbook
+ </sourceDirectory>
+ <imageResource>
+ <directory>
+ ${project.build.directory}/common-resources
+ </directory>
+ </imageResource>
+ <cssResource>
+ <directory>
+ ${project.build.directory}/common-resources
+ </directory>
+ </cssResource>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/common-resources/xslt/pdf-common.xsl</stylesheetResource>
+ <finalName>richfaces_migration_guide.pdf</finalName>
+ <imagePathSettingRequired>true</imagePathSettingRequired>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>
+ ${xsl_html}
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ <imageCopyingRequired>
+ true
+ </imageCopyingRequired>
+ <imagePathSettingRequired>
+ false
+ </imagePathSettingRequired>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>
+ ${xsl_html_single}
+ </stylesheetResource>
+ <imageCopyingRequired>true</imageCopyingRequired>
+ <imagePathSettingRequired>false</imagePathSettingRequired>
+ <finalName>index.html </finalName>
+ </format>
+ </formats>
+ <xincludeSupported>true</xincludeSupported>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <useRelativeImageUris> true </useRelativeImageUris>
+ <xmlTransformerType> saxon </xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <modules>
+ <module>en</module>
+ </modules-->
+</project>
Property changes on: root/docs/trunk/guides/migrationguide/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: root/docs/trunk/guides/pom.xml
===================================================================
--- root/docs/trunk/guides/pom.xml 2009-08-27 23:30:30 UTC (rev 15380)
+++ root/docs/trunk/guides/pom.xml 2009-08-28 00:23:22 UTC (rev 15381)
@@ -18,7 +18,8 @@
<!-- all deployed modules should be reflected in version-matrix also -->
<modules>
- <module>testguide</module>
+ <module>testguide</module>
+ <module>migrationguide</module>
</modules>
<build>
@@ -232,4 +233,4 @@
</build>
</profile>
</profiles>
-</project>
\ No newline at end of file
+</project>
15 years, 4 months
JBoss Rich Faces SVN: r15380 - root/examples/trunk/richfaces-demo.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-27 19:30:30 -0400 (Thu, 27 Aug 2009)
New Revision: 15380
Modified:
root/examples/trunk/richfaces-demo/pom.xml
Log:
Build name for richfaces-demo updated
Modified: root/examples/trunk/richfaces-demo/pom.xml
===================================================================
--- root/examples/trunk/richfaces-demo/pom.xml 2009-08-27 23:07:36 UTC (rev 15379)
+++ root/examples/trunk/richfaces-demo/pom.xml 2009-08-27 23:30:30 UTC (rev 15380)
@@ -66,22 +66,7 @@
</dependencies>
<build>
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webappDirectory>${project.build.directory}/${project.build.finalName}-tomcat6</webappDirectory>
- <classifier>tomcat6</classifier>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <configuration>
- <webApp>${project.build.directory}/${project.build.finalName}-tomcat6.war</webApp>
- </configuration>
- </plugin>
- </plugins>
+ <finalName>richfaces-demo</finalName>
</build>
<profiles>
@@ -106,6 +91,9 @@
</configuration>
</execution>
</executions>
+ <configuration>
+ <classifier>tomcat6</classifier>
+ </configuration>
</plugin>
</plugins>
</build>
@@ -118,7 +106,6 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee5</webappDirectory>
- <classifier>jee5</classifier>
</configuration>
</plugin>
</plugins>
15 years, 4 months
JBoss Rich Faces SVN: r15379 - root/examples/trunk/richfaces-demo.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-27 19:07:36 -0400 (Thu, 27 Aug 2009)
New Revision: 15379
Modified:
root/examples/trunk/richfaces-demo/pom.xml
Log:
Removed extra tomcat6 invocation configuration for release profile
Modified: root/examples/trunk/richfaces-demo/pom.xml
===================================================================
--- root/examples/trunk/richfaces-demo/pom.xml 2009-08-27 23:01:25 UTC (rev 15378)
+++ root/examples/trunk/richfaces-demo/pom.xml 2009-08-27 23:07:36 UTC (rev 15379)
@@ -105,17 +105,6 @@
<warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/jta-*</warSourceExcludes>
</configuration>
</execution>
- <execution>
- <id>tomcat6</id>
- <phase>package</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webappDirectory>${project.build.directory}/${project.build.finalName}-tomcat6</webappDirectory>
- <classifier>tomcat6</classifier>
- </configuration>
- </execution>
</executions>
</plugin>
</plugins>
15 years, 4 months
JBoss Rich Faces SVN: r15378 - in root: examples/trunk and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-27 19:01:25 -0400 (Thu, 27 Aug 2009)
New Revision: 15378
Added:
root/readme-examples.txt
root/readme-ui.txt
Removed:
root/examples/trunk/readme.txt
root/ui/trunk/readme-ui.txt
Modified:
root/richfaces-examples.xml
root/richfaces.xml
Log:
readme.txt integrated into distribution
Deleted: root/examples/trunk/readme.txt
===================================================================
--- root/examples/trunk/readme.txt 2009-08-27 22:46:49 UTC (rev 15377)
+++ root/examples/trunk/readme.txt 2009-08-27 23:01:25 UTC (rev 15378)
@@ -1,14 +0,0 @@
-This demo application should be built using Maven 2.1.0
-
-tomcat6/jetty targetted build:
-1) execute "mvn install" in root application folder(examples/richfaces-demo)
-2) Deploy to tomcat 6.x or just run using maven on jetty using "mvn jetty:run-war"
-
-For JEE5 application server:
-1) execute "mvn install -P jee5" in root application folder(examples/richfaces-demo)
-2) Deploy to Jboss 4.x or higher or some other jee5 application server.
-3) Do not forget to change the JSF implementation shipped with application server to JSF 2 (latest SNAPSHOT)
-
-To Build both archives execute "mvn install -P release"
-
-Type http://localhost:8080/richfaces-demo in your browser command line after starting server.
\ No newline at end of file
Copied: root/readme-examples.txt (from rev 15376, root/examples/trunk/readme.txt)
===================================================================
--- root/readme-examples.txt (rev 0)
+++ root/readme-examples.txt 2009-08-27 23:01:25 UTC (rev 15378)
@@ -0,0 +1,14 @@
+This demo application should be built using Maven 2.1.0
+
+tomcat6/jetty targetted build:
+1) execute "mvn install" in root application folder(richfaces-examples-4.x.y.z/richfaces-demo)
+2) Deploy to tomcat 6.x or just run using maven on jetty using "mvn jetty:run-war"
+
+For JEE5 application server:
+1) execute "mvn install -P jee5" in root application folder(richfaces-examples-4.x.y.z/richfaces-demo)
+2) Deploy to Jboss 4.x or higher or some other jee5 application server.
+3) Do not forget to change the JSF implementation shipped with application server to JSF 2 (latest SNAPSHOT)
+
+To Build both archives execute "mvn install -P release"
+
+Type http://localhost:8080/richfaces-demo in your browser command line after starting server.
\ No newline at end of file
Copied: root/readme-ui.txt (from rev 15377, root/ui/trunk/readme-ui.txt)
===================================================================
--- root/readme-ui.txt (rev 0)
+++ root/readme-ui.txt 2009-08-27 23:01:25 UTC (rev 15378)
@@ -0,0 +1,30 @@
+1) Put RichFaces libraries and its dependencies to your application libraries folder:
+ 1.1) richfaces-api
+ 1.2) richfaces-impl
+ 1.3) core-ui
+ 1.4) commons-logging
+ 1.5) commons-beanutils
+ 1.6) slf4j-api
+ 1.7) slf4j-log4j12 (or whatever else - select the implementation according to logging framework that you use)
+
+ JBoss Cache is recommended for optimal performance.
+
+
+2) As opposed to the previous 3.x.y versions of RichFaces, no special configuration steps are necessary.
+You don't need to modify web.xml/faces-config.xml
+
+3) Add RichFaces namespace/taglib declaration to your Facelets pages which will use RichFaces components
+ Use xmlns:a4j="http://richfaces.org/a4j" namespace
+
+4) Add one of the available RichFaces 4.0.A1 components to your page and try it!
+
+Components Available:
+a4j:ajax
+a4j:commandLink
+a4j:commandButton
+a4j:push
+a4j:mediaOutput
+a4j:status
+a4j:jsFunction
+a4j:log
+a4j:outputPanel
\ No newline at end of file
Modified: root/richfaces-examples.xml
===================================================================
--- root/richfaces-examples.xml 2009-08-27 22:46:49 UTC (rev 15377)
+++ root/richfaces-examples.xml 2009-08-27 23:01:25 UTC (rev 15378)
@@ -8,6 +8,10 @@
<source>lgpl.txt</source>
</file>
<file>
+ <source>readme-examples.txt</source>
+ <destName>readme.txt</destName>
+ </file>
+ <file>
<source>JBossORG-EULA.txt</source>
</file>
</files>
Modified: root/richfaces.xml
===================================================================
--- root/richfaces.xml 2009-08-27 22:46:49 UTC (rev 15377)
+++ root/richfaces.xml 2009-08-27 23:01:25 UTC (rev 15378)
@@ -8,6 +8,10 @@
<source>lgpl.txt</source>
</file>
<file>
+ <source>readme-ui.txt</source>
+ <destName>readme.txt</destName>
+ </file>
+ <file>
<source>JBossORG-EULA.txt</source>
</file>
</files>
Deleted: root/ui/trunk/readme-ui.txt
===================================================================
--- root/ui/trunk/readme-ui.txt 2009-08-27 22:46:49 UTC (rev 15377)
+++ root/ui/trunk/readme-ui.txt 2009-08-27 23:01:25 UTC (rev 15378)
@@ -1,30 +0,0 @@
-1) Put RichFaces libraries and its dependencies to your application libraries folder:
- 1.1) richfaces-api
- 1.2) richfaces-impl
- 1.3) core-ui
- 1.4) commons-logging
- 1.5) commons-beanutils
- 1.6) slf4j-api
- 1.7) slf4j-log4j12 (or whatever else - select the implementation according to logging framework that you use)
-
- JBoss Cache is recommended for optimal performance.
-
-
-2) As opposed to the previous 3.x.y versions of RichFaces, no special configuration steps are necessary.
-You don't need to modify web.xml/faces-config.xml
-
-3) Add RichFaces namespace/taglib declaration to your Facelets pages which will use RichFaces components
- Use xmlns:a4j="http://richfaces.org/a4j" namespace
-
-4) Add one of the available RichFaces 4.0.A1 components to your page and try it!
-
-Components Available:
-a4j:ajax
-a4j:commandLink
-a4j:commandButton
-a4j:push
-a4j:mediaOutput
-a4j:status
-a4j:jsFunction
-a4j:log
-a4j:outputPanel
\ No newline at end of file
15 years, 4 months
JBoss Rich Faces SVN: r15377 - root/ui/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-27 18:46:49 -0400 (Thu, 27 Aug 2009)
New Revision: 15377
Modified:
root/ui/trunk/readme-ui.txt
Log:
Updated readme-ui.txt
Modified: root/ui/trunk/readme-ui.txt
===================================================================
--- root/ui/trunk/readme-ui.txt 2009-08-27 22:30:29 UTC (rev 15376)
+++ root/ui/trunk/readme-ui.txt 2009-08-27 22:46:49 UTC (rev 15377)
@@ -4,16 +4,19 @@
1.3) core-ui
1.4) commons-logging
1.5) commons-beanutils
+ 1.6) slf4j-api
+ 1.7) slf4j-log4j12 (or whatever else - select the implementation according to logging framework that you use)
+
+ JBoss Cache is recommended for optimal performance.
2) As opposed to the previous 3.x.y versions of RichFaces, no special configuration steps are necessary.
You don't need to modify web.xml/faces-config.xml
-3) Add RichFaces namespace/taglib declaration to your VDL/JSP pages which will use RichFaces components
- 3.1) for VDL use xmlns:a4j="http://richfaces.org/a4j" namespace
- 3.2) for JSP use <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> taglib declaration
+3) Add RichFaces namespace/taglib declaration to your Facelets pages which will use RichFaces components
+ Use xmlns:a4j="http://richfaces.org/a4j" namespace
-4) Add one of the available RichFaces 4 A1 components to your page and try it!
+4) Add one of the available RichFaces 4.0.A1 components to your page and try it!
Components Available:
a4j:ajax
15 years, 4 months
JBoss Rich Faces SVN: r15376 - root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-27 18:30:29 -0400 (Thu, 27 Aug 2009)
New Revision: 15376
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java
Log:
ChoicesBean: commented System.out statements
Modified: root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2009-08-27 22:27:47 UTC (rev 15375)
+++ root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2009-08-27 22:30:29 UTC (rev 15376)
@@ -4,10 +4,8 @@
import java.util.Date;
import java.util.EventListener;
import java.util.EventObject;
-import java.util.HashSet;
import java.util.List;
import java.util.Random;
-import java.util.Set;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@@ -96,7 +94,7 @@
for (Choice choice : lastVotes) {
choice.setVotesCount(rand(0, 3));
}
- System.out.println("New Event!");
+ //System.out.println("New Event!");
listener.onEvent(new EventObject(this));
Thread.sleep(5000);
} catch (InterruptedException e) {
@@ -117,7 +115,7 @@
updateInfo+=choice.getVotesCount()+" ";
}
updateInfo+="] ";
- System.out.println("ChoicesBean.processUpdates()");
+ //System.out.println("ChoicesBean.processUpdates()");
}
public Thread getThread() {
@@ -125,8 +123,8 @@
}
public boolean isEnabled() {
- System.out.println("ChoicesBean.isEnabled()");
- System.out.println(enabled);
+ //System.out.println("ChoicesBean.isEnabled()");
+ //System.out.println(enabled);
return enabled;
}
15 years, 4 months