JBoss Rich Faces SVN: r18823 - in trunk/ui/output/ui/src: main/resources/META-INF/resources/org.richfaces and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-08-19 13:08:16 -0400 (Thu, 19 Aug 2010)
New Revision: 18823
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml
Log:
Refactor popup renderer and related to this refactoring fix couple of bugs
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-08-19 15:59:18 UTC (rev 18822)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-08-19 17:08:16 UTC (rev 18823)
@@ -5,8 +5,8 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
+import java.util.Map.Entry;
import javax.faces.FacesException;
import javax.faces.application.ResourceDependencies;
@@ -15,8 +15,9 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.AbstractPopupPanel;
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONMap;
@@ -112,14 +113,14 @@
if (panel.getMinHeight() != -1) {
if (panel.getMinHeight() < SIZE) {
- throw new IllegalArgumentException();
+ throw new FacesException("Attribbute minWidth should be greater then 10px");
}
}
if (panel.getMinWidth() != -1) {
if (panel.getMinWidth() < SIZE) {
- throw new IllegalArgumentException();
+ throw new FacesException("Attribbute minHeight should be greater then 10px");
}
}
@@ -164,84 +165,49 @@
return "";
}
- private void writeOption(StringBuilder builder, String attribbute, Object value, UIComponent component,
- boolean isString) {
-
- //TODO nick - use ScriptUtils.toScript
- if (component.getAttributes().get(attribbute) != null) {
- builder.append(attribbute + ":");
- if (isString) {
- builder.append("'");
- }
- builder.append(value);
- if (isString) {
- builder.append("'");
- }
- builder.append(",");
- }
- }
-
public String buildScript(FacesContext context, UIComponent component) throws IOException {
AbstractPopupPanel panel = (AbstractPopupPanel) component;
StringBuilder result = new StringBuilder();
result.append("new RichFaces.ui.PopupPanel('");
result.append(panel.getClientId());
- result.append("',{");
- //TODO nick - use RendererUtils.addToScriptHash(Map<String, Object>, String, Object)
- writeOption(result, "width", panel.getWidth(), component, false);
- writeOption(result, "height", panel.getHeight(), component, false);
- writeOption(result, "minWidth", panel.getMinWidth(), component, false);
- writeOption(result, "minHeight", panel.getMinHeight(), component, false);
- writeOption(result, "maxWidth", panel.getMaxWidth(), component, false);
- writeOption(result, "maxHeight", panel.getMaxHeight(), component, false);
- writeOption(result, "resizeable", panel.isResizeable(), component, false);
- writeOption(result, "moveable", panel.isMoveable(), component, false);
- writeOption(result, "left", panel.getLeft(), component, true);
- writeOption(result, "top", panel.getTop(), component, true);
- writeOption(result, "zIndex", panel.getZIndex(), component, false);
- writeOption(result, "onresize", writeEventHandlerFunction(context, panel, "onresize"), component, false);
- writeOption(result, "onmove", writeEventHandlerFunction(context, panel, "onmove"), component, false);
- writeOption(result, "onshow", writeEventHandlerFunction(context, panel, "onshow"), component, false);
- writeOption(result, "onhide", writeEventHandlerFunction(context, panel, "onhide"), component, false);
- writeOption(result, "onbeforeshow", writeEventHandlerFunction(context, panel, "onbeforeshow"), component, false);
- writeOption(result, "onbeforehide", writeEventHandlerFunction(context, panel, "onbeforehide"), component, false);
- writeOption(result, "shadowDepth", panel.getShadowDepth(), component, true);
- writeOption(result, "shadowOpacity", panel.getShadowOpacity(), component, true);
- writeOption(result, "domElementAttachment", panel.getDomElementAttachment(), component, true);
- writeOption(result, "keepVisualState", panel.isKeepVisualState(), component, false);
- writeOption(result, "show", panel.isShow(), component, false);
- writeOption(result, "modal", panel.isModal(), component, false);
- writeOption(result, "autosized", panel.isAutosized(), component, false);
- writeOption(result, "overlapEmbedObjects", panel.isOverlapEmbedObjects(), component, false);
- //TODO nick - what is deleted here?
- result.delete(result.length() - 1, result.length());
- if (component.getAttributes().get("visualOptions") != null) {
- result.append(writeVisualOptions(context, panel));
- }
- result.append("});");
+ result.append("',");
+ Map<String, Object> attributes = component.getAttributes();
+ Map<String, Object> options = new HashMap<String, Object>();
+ RendererUtils utils = getUtils();
+ utils.addToScriptHash(options, "width", panel.getWidth(), "-1");
+ utils.addToScriptHash(options, "height", panel.getHeight(), "-1");
+ utils.addToScriptHash(options, "minWidth", panel.getMinWidth(), "-1");
+ utils.addToScriptHash(options, "minHeight", panel.getMinHeight(), "-1");
+ utils.addToScriptHash(options, "maxWidth", panel.getMaxWidth(), "" +Integer.MAX_VALUE);
+ utils.addToScriptHash(options, "maxHeight", panel.getMaxHeight(), "" +Integer.MAX_VALUE);
+ utils.addToScriptHash(options, "moveable", panel.isMoveable(), "true");
+ utils.addToScriptHash(options, "followByScroll", panel.isFollowByScroll(), "true");
+ utils.addToScriptHash(options, "left", panel.getLeft(), "auto");
+ utils.addToScriptHash(options, "top", panel.getTop(), "auto");
+ utils.addToScriptHash(options, "zindex", panel.getZIndex(), "100");
+ utils.addToScriptHash(options, "shadowDepth", panel.getShadowDepth(), "2");
+ utils.addToScriptHash(options, "shadowOpacity", panel.getShadowOpacity(), "0.1");
+ utils.addToScriptHash(options, "domElementAttachment", panel.getDomElementAttachment());
+
+ utils.addToScriptHash(options, "keepVisualState", panel.isKeepVisualState(), "false");
+ utils.addToScriptHash(options, "show", panel.isShow(), "false");
+ utils.addToScriptHash(options, "modal", panel.isModal(), "true");
+ utils.addToScriptHash(options, "autosized", panel.isAutosized(), "false");
+ utils.addToScriptHash(options, "resizeable", panel.isResizeable(), "false");
+ utils.addToScriptHash(options, "overlapEmbedObjects", panel.isOverlapEmbedObjects(), "false");
+ utils.addToScriptHash(options, "visualOptions", writeVisualOptions(context, panel));
+ utils.addToScriptHash(options, "onresize", attributes.get("onresize"));
+ utils.addToScriptHash(options, "onmove", attributes.get("onmove"));
+ utils.addToScriptHash(options, "onshow", attributes.get("onshow"));
+ utils.addToScriptHash(options, "onhide", attributes.get("onhide"));
+ utils.addToScriptHash(options, "onbeforeshow", attributes.get("onbeforeshow"));
+ utils.addToScriptHash(options, "onbeforehide", attributes.get("onbeforehide"));
+
+ result.append(ScriptUtils.toScript(options));
+ result.append(");");
return result.toString();
}
- public String writeEventHandlerFunction(FacesContext context, UIComponent component, String eventName)
- throws IOException {
- String event = (String) component.getAttributes().get(eventName);
-
- if (event != null) {
- event = event.trim();
-
- if (event.length() != 0) {
- JSFunctionDefinition function = new JSFunctionDefinition();
-
- function.addParameter("event");
- function.addToBody(event);
-
- return function.toScript();
- }
- }
-
- return "";
- }
-
public Map<String, Object> getHandledVisualOptions(AbstractPopupPanel panel) {
String options = panel.getVisualOptions();
Map<String, Object> result;
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-08-19 15:59:18 UTC (rev 18822)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-08-19 17:08:16 UTC (rev 18823)
@@ -29,22 +29,40 @@
$(richfaces.getDomElement(element)).unbind( 'mousedown', selectionEventHandler);
}
}
-
+
+ var defaultOptions = {
+ width:-1,
+ height:-1,
+ minWidth:-1,
+ minHeight:-1,
+ modal:true,
+ moveable:true,
+ resizeable: false,
+ autosized: false,
+ modal:true,
+ left: "auto",
+ top : "auto",
+ zindex:100,
+ shadowDepth : 5,
+ shadowOpacity: 0.1,
+ attachToBody:true
+ };
+
+
richfaces.ui.PopupPanel = function(id, options) {
$super.constructor.call(this,id);
this.markerId = id;
this.attachToDom(id);
- this.options = options;
+ this.options = $.extend(this.options, defaultOptions, options);
this.id = $(richfaces.getDomElement(id));
this.minWidth = this.getMinimumSize(this.options.minWidth);
this.minHeight = this.getMinimumSize(this.options.minHeight);
this.maxWidth = this.options.maxWidth;
this.maxHeight = this.options.maxHeight;
- this.options = options;
- this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
+ this.baseZIndex = this.options.zindex;
this.div = $(richfaces.getDomElement(id));
this.cdiv = $(richfaces.getDomElement(id + "_container"));
@@ -185,16 +203,14 @@
setLeft: function(pos) {
if(!isNaN(pos)){
this.cdiv.css('left', pos + "px");
- var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
- this.shadowDiv.css('left', pos + depth + "px");
+ this.shadowDiv.css('left', pos + parseInt(this.options.shadowDepth) + "px");
}
},
setTop: function(pos) {
if(!isNaN(pos)){
this.cdiv.css('top', pos + "px");
- var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
- this.shadowDiv.css('top', pos + depth +"px");
+ this.shadowDiv.css('top', pos + parseInt(this.options.shadowDepth) +"px");
}
},
@@ -266,8 +282,6 @@
options.width = 300;
if (options.height && options.height == -1)
options.height = 200;
- } else{
- //options.width = $(this.div+"_headerSpan").width() +20;
}
if (options.width && options.width != -1) {
@@ -278,7 +292,7 @@
options.width = this.maxWidth;
}
$(richfaces.getDomElement(eContentElt)).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
- this.shadowDiv.css('width', options.width + 4 + (/px/.test(options.width) ? '' : 'px'));
+ this.shadowDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
this.scrollerDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
@@ -292,7 +306,7 @@
options.height = this.maxHeight;
}
$(richfaces.getDomElement(eContentElt)).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
- this.shadowDiv.css('height', options.height + 4 + (/px/.test(options.height) ? '' : 'px'));
+ this.shadowDiv.css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
var headerHeight = $(richfaces.getDomElement(this.div +"_header"))[0] ? $(richfaces.getDomElement(this.div +"_header"))[0].clientHeight : 0;
this.scrollerDiv.css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
@@ -347,12 +361,17 @@
this.setTop(Math.round(_top));
}
-
- var opacity = options.shadowOpacity ? options.shadowOpacity : 0.1;
- this.shadowDiv.css('opacity', opacity);
- this.shadowDiv.css('filter ', 'alpha(opacity='+opacity*100 +');');
+
+ this.shadowDiv.css('opacity', this.options.shadowOpacity);
+ this.shadowDiv.css('filter ', 'alpha(opacity='+this.options.shadowOpacity*100 +');');
+
element.css('visibility', '');
element.css('display', 'block');
+ if (this.options.autosized) {
+ this.shadowDiv.css('height', this.cdiv[0].clientHeight);
+ this.shadowDiv.css('width', this.cdiv[0].clientWidth);
+
+ }
var event = {};
event.parameters = opts || {};
this.shown = true;
@@ -510,7 +529,7 @@
var vetoeChange = false;
var newSize;
- var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
+ var shadowDepth = parseInt(this.options.shadowDepth);
var scrollerHeight = 22;
var scrollerWidth = 0;
var eContentElt = this.getContentElement();
@@ -541,7 +560,7 @@
vetoes.x = true;
}
- if (newSize >= this.options.maxWidth) {
+ if (newSize > this.options.maxWidth) {
if (diff.deltaWidth) {
cssHashWH.width = this.currentMaxWidth + 'px';
shadowHashWH.width = this.currentMaxWidth + shadowDepth + 'px';
@@ -594,7 +613,7 @@
vetoes.y = true;
}
- if (newSize >= this.options.maxHeight) {
+ if (newSize > this.options.maxHeight) {
if (diff.deltaHeight) {
cssHashWH.height = this.currentMaxHeight + 'px';
shadowHashWH.height = this.currentMaxHeight + shadowDepth + 'px';
@@ -671,7 +690,7 @@
},
moveTo : function (top, left){
- var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
+ var shadowDepth = parseInt(this.options.shadowDepth);
this.cdiv.css('top', top);
this.cdiv.css('left', left);
this.shadowDiv.css('top', top + shadowDepth);
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-08-19 15:59:18 UTC (rev 18822)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-08-19 17:08:16 UTC (rev 18823)
@@ -108,7 +108,7 @@
HtmlElement panelHeader = panelWithFacet.getElementById("panel_header");
assertNotNull(panelHeader);
assertEquals("rf-pp-h header", panelHeader.getAttribute("class"));
- assertEquals("cursor: move;", panelHeader.getAttribute("style"));
+ //assertEquals("cursor: move;", panelHeader.getAttribute("style"));
assertEquals("Write your own custom rich components with built-in AJAX", panelHeader.getTextContent().trim());
HtmlElement panelResizer = panelWithFacet.getElementById("panelResizerN");
assertNotNull(panelResizer);
Modified: trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml
===================================================================
--- trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml 2010-08-19 15:59:18 UTC (rev 18822)
+++ trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml 2010-08-19 17:08:16 UTC (rev 18823)
@@ -16,7 +16,7 @@
<h:commandButton id="button" value="Call the popup">
<rich2:componentControl target="panel" operation="show" />
</h:commandButton>
- <rich:popupPanel resizeable="true" styleClass="panelStyle" headerClass="header" controlsClass="control"
+ <rich:popupPanel moveable="false" resizeable="true" styleClass="panelStyle" headerClass="header" controlsClass="control"
id="panel"
15 years, 9 months
JBoss Rich Faces SVN: r18822 - in branches/RF-9112: parent and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 11:59:18 -0400 (Thu, 19 Aug 2010)
New Revision: 18822
Modified:
branches/RF-9112/core/parent/pom.xml
branches/RF-9112/parent/pom.xml
Log:
RF-9112 update to root-parent pom
Modified: branches/RF-9112/core/parent/pom.xml
===================================================================
--- branches/RF-9112/core/parent/pom.xml 2010-08-19 15:40:49 UTC (rev 18821)
+++ branches/RF-9112/core/parent/pom.xml 2010-08-19 15:59:18 UTC (rev 18822)
@@ -38,7 +38,6 @@
</description>
<properties>
- <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
Modified: branches/RF-9112/parent/pom.xml
===================================================================
--- branches/RF-9112/parent/pom.xml 2010-08-19 15:40:49 UTC (rev 18821)
+++ branches/RF-9112/parent/pom.xml 2010-08-19 15:59:18 UTC (rev 18822)
@@ -38,11 +38,8 @@
the project, and contains pluginmangement, and common testing dependency
management elements.
</description>
-
+
<properties>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <!-- Override the default 2.0.9 from jboss-parent -->
- <maven.min.version>2.1.0</maven.min.version>
<richfaces.checkstyle.version>2-SNAPSHOT</richfaces.checkstyle.version>
</properties>
@@ -60,19 +57,24 @@
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>htmlunit-client</artifactId>
- <version>1.0.3</version>
+ <version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
- <version>1.0.3</version>
+ <version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
- <version>1.0.3</version>
+ <version>1.0.4</version>
</dependency>
<dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-jetty</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
@@ -89,11 +91,92 @@
-->
<pluginManagement>
<plugins>
+ <!-- Build -->
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <index>true</index>
+ <manifest>
+ <addDefaultSpecificationEntries>
+ true
+ </addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>
+ true
+ </addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <mode>development</mode>
+ <Build-Number>${buildNumber}
+ </Build-Number>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+ <!-- reporting -->
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover2-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <configLocation>richfaces-checkstyle/richfaces-checkstyle.xml
+ </configLocation>
+ </configuration>
+ <executions>
+ <execution>
+ <id>richfaces-checkstyle-report</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle</artifactId>
+ <version>${richfaces.checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
<!--
- TODO: migrate plugin config from richfaces-parent.
- Need to be careful of what root-aggregator, and bom
- need though because they do not inherit this
+ docs TODO should move to profiles probably a "doc"
+ profile
-->
+ <plugin>
+ <groupId>gr.abiss.mvn.plugins</groupId>
+ <artifactId>maven-jstools-plugin</artifactId>
+ <version>0.7</version>
+ <configuration>
+ <jsDir>${project.basedir}/src/main/resources/META-INF/resources
+ </jsDir>
+ <includes>**/*.js</includes>
+ <caseSensitive>true</caseSensitive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -108,13 +191,83 @@
<profiles>
<profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- TODO move to doc profile? -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <javadocVersion>1.5</javadocVersion>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-javadoc</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<!--
- TODO: migrate profile config from richfaces-parent. Need
- to be careful of what root-aggregator, and bom need
- though because they do not inherit this
+ Triggers generated documentation as part of builds (
+ javadoc, jsdoc, etc...
-->
+ <id>doc</id>
+ <!-- TODO -->
</profile>
-
+ <profile>
+ <!-- Triggers clover reports to be generated -->
+ <id>clover</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover2-plugin</artifactId>
+ <configuration>
+ <licenseLocation>
+ ${clover.license.path}
+ </licenseLocation>
+ <jdk>1.5</jdk>
+ <generatePdf>false</generatePdf>
+ <generateXml>true</generateXml>
+ <generateHtml>true</generateHtml>
+ </configuration>
+ <executions>
+ <execution>
+ <id>instrument</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>instrument</goal>
+ <goal>check</goal>
+ <goal>clover</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <!--
+ Required when in JBoss hudson env to have clover reports
+ generate
+ -->
+ <id>hudson</id>
+ <properties>
+ <clover.license.path>
+ /home/hudson/config_repository/resources/richfaces/richfaces-clover-license.txt
+ </clover.license.path>
+ </properties>
+ </profile>
+
<!--
The following profiles determine the JSF api/impl
combinations that will be used in the project builds.
15 years, 9 months
JBoss Rich Faces SVN: r18821 - modules/build/resources/branches/RF-9112/faces-shade-transformers.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 11:40:49 -0400 (Thu, 19 Aug 2010)
New Revision: 18821
Modified:
modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml
Log:
RF-9112 removed unneeded config
Modified: modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml
===================================================================
--- modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml 2010-08-19 15:40:30 UTC (rev 18820)
+++ modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml 2010-08-19 15:40:49 UTC (rev 18821)
@@ -15,7 +15,6 @@
<build>
<plugins>
- <!-- For the release this parent pom -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
15 years, 9 months
JBoss Rich Faces SVN: r18820 - modules/build/resources/branches/RF-9112/faces-shade-transformers.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 11:40:30 -0400 (Thu, 19 Aug 2010)
New Revision: 18820
Modified:
modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml
Log:
RF-9112 removed unneeded config
Modified: modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml
===================================================================
--- modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml 2010-08-19 15:38:56 UTC (rev 18819)
+++ modules/build/resources/branches/RF-9112/faces-shade-transformers/pom.xml 2010-08-19 15:40:30 UTC (rev 18820)
@@ -15,13 +15,6 @@
<build>
<plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
<!-- For the release this parent pom -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
15 years, 9 months
JBoss Rich Faces SVN: r18819 - modules/build/parent/branches/RF-9112.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 11:38:56 -0400 (Thu, 19 Aug 2010)
New Revision: 18819
Modified:
modules/build/parent/branches/RF-9112/pom.xml
Log:
RF-9112 Stripped richfaces-parent - CODING IN PROGRESS
Modified: modules/build/parent/branches/RF-9112/pom.xml
===================================================================
--- modules/build/parent/branches/RF-9112/pom.xml 2010-08-19 15:32:41 UTC (rev 18818)
+++ modules/build/parent/branches/RF-9112/pom.xml 2010-08-19 15:38:56 UTC (rev 18819)
@@ -83,7 +83,6 @@
</snapshots>
</repository>
</repositories>
-
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
@@ -125,74 +124,6 @@
</configuration>
</plugin>
-
- <!-- Build -->
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <index>true</index>
- <manifest>
- <addDefaultSpecificationEntries>
- true
- </addDefaultSpecificationEntries>
- <addDefaultImplementationEntries>
- true
- </addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <mode>development</mode>
- <Build-Number>${buildNumber}
- </Build-Number>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.4</version>
- </plugin>
-
- <!-- reporting -->
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <configLocation>richfaces-checkstyle/richfaces-checkstyle.xml
- </configLocation>
- </configuration>
- <executions>
- <execution>
- <id>richfaces-checkstyle-report</id>
- <phase>process-sources</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-build-checkstyle</artifactId>
- <version>${richfaces.checkstyle.version}</version>
- </dependency>
- </dependencies>
- </plugin>
-
<!-- dev -->
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
@@ -201,26 +132,6 @@
<downloadSources>true</downloadSources>
</configuration>
</plugin>
-
- <!--
- docs TODO should move to profiles probably a "doc" profile
- -->
- <plugin>
- <groupId>gr.abiss.mvn.plugins</groupId>
- <artifactId>maven-jstools-plugin</artifactId>
- <version>0.7</version>
- <configuration>
- <jsDir>${project.basedir}/src/main/resources/META-INF/resources
- </jsDir>
- <includes>**/*.js</includes>
- <caseSensitive>true</caseSensitive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.2</version>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -232,85 +143,9 @@
</plugin>
</plugins>
</build>
-
- <!-- Profiles -->
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <!-- TODO move to doc profile? -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <javadocVersion>1.5</javadocVersion>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-javadoc</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <!--
- Triggers generated documentation as part of builds ( javadoc,
- jsdoc, etc...
- -->
- <id>doc</id>
- <!-- TODO -->
- </profile>
- <profile>
- <!-- Triggers clover reports to be generated -->
- <id>clover</id>
- <build>
- <plugins>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <configuration>
- <licenseLocation>
- ${clover.license.path}
- </licenseLocation>
- <jdk>1.5</jdk>
- <generatePdf>false</generatePdf>
- <generateXml>true</generateXml>
- <generateHtml>true</generateHtml>
- </configuration>
- <executions>
- <execution>
- <id>instrument</id>
- <phase>verify</phase>
- <goals>
- <goal>instrument</goal>
- <goal>check</goal>
- <goal>clover</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <!-- Required when in JBoss hudson env to have clover reports generate -->
- <id>hudson</id>
- <properties>
- <clover.license.path>/home/hudson/config_repository/resources/richfaces/richfaces-clover-license.txt
- </clover.license.path>
- </properties>
- </profile>
- </profiles>
<distributionManagement>
+ <!-- Other items inherited from jboss-parent -->
<downloadUrl>http://www.jboss.org/richfaces/download</downloadUrl>
</distributionManagement>
15 years, 9 months
JBoss Rich Faces SVN: r18818 - in branches/RF-7939-showcase/src/main: java/org/richfaces/demo/push and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-08-19 11:32:41 -0400 (Thu, 19 Aug 2010)
New Revision: 18818
Added:
branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java
branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/image/
branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png
Modified:
branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java
branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java
branches/RF-7939-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java
branches/RF-7939-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml
branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml
branches/RF-7939-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml
Log:
https://jira.jboss.org/browse/RF-9020
Added: branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java
===================================================================
--- branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java (rev 0)
+++ branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java 2010-08-19 15:32:41 UTC (rev 18818)
@@ -0,0 +1,46 @@
+package org.richfaces.demo.mediaOutput;
+
+/**
+ * @author Ilya Shaikovsky Class created to hold rgb properties of the color. Used in order to avoid AWT dependencies as
+ * GAE not allows them
+ */
+public class Color {
+
+ private int red;
+ private int green;
+ private int blue;
+
+ public Color(int red, int green, int blue) {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ }
+
+ public int getRed() {
+ return red;
+ }
+
+ public void setRed(int red) {
+ this.red = red;
+ }
+
+ public int getGreen() {
+ return green;
+ }
+
+ public void setGreen(int green) {
+ this.green = green;
+ }
+
+ public int getBlue() {
+ return blue;
+ }
+
+ public void setBlue(int blue) {
+ this.blue = blue;
+ }
+ @Override
+ public String toString() {
+ return String.valueOf(getRed()) + String.valueOf(getGreen()) + String.valueOf(getBlue());
+ }
+}
Modified: branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java
===================================================================
--- branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java 2010-08-19 15:11:17 UTC (rev 18817)
+++ branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java 2010-08-19 15:32:41 UTC (rev 18818)
@@ -1,86 +1,477 @@
package org.richfaces.demo.mediaOutput;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+import java.nio.charset.Charset;
+import java.util.zip.CRC32;
+import java.util.zip.Deflater;
+import java.util.zip.DeflaterOutputStream;
+import java.util.zip.Inflater;
+import java.util.zip.InflaterInputStream;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
-import javax.imageio.ImageIO;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
@ManagedBean(name = "mediaBean")
@RequestScoped
public class MediaBean {
- public void paint(OutputStream out, Object data) throws IOException {
- if (data instanceof MediaData) {
- MediaData paintData = (MediaData) data;
- BufferedImage img = new BufferedImage(paintData.width, paintData.height, BufferedImage.TYPE_INT_RGB);
- Graphics2D g2d = img.createGraphics();
+ private static final String RICHFACES_MEDIA_OUTPUT_IMAGE_SOURCE = "/richfaces/mediaOutput/image/source.png";
+ private static final int BUFFER_SIZE = 8192;
- g2d.setColor(Color.WHITE);
- g2d.fillRect(0, 0, 300, 120);
+ private Color[] colors;
+ private boolean isIndexed = false;
- int testLenght = paintData.text.length();
- int fontSize = testLenght < 8 ? 40 : 40 - (testLenght - 8);
+ private Charset asciiCharset = Charset.forName("US-ASCII");
- if (fontSize < 12) {
- fontSize = 12;
+ private int sectionLength;
+
+ private int imageWidth;
+
+ private byte[] lengthBytes = new byte[4];
+
+ private byte[] chunkTypeBytes = new byte[4];
+
+ private class Section {
+
+ protected void writeHeaderSectionData(OutputStream outChannel) throws IOException {
+ outChannel.write(lengthBytes);
+ outChannel.write(chunkTypeBytes);
+ }
+
+ protected void writeInt(OutputStream outChannel, int value) throws IOException {
+ byte[] bs = new byte[4];
+ ByteBuffer.wrap(bs).order(ByteOrder.BIG_ENDIAN).asIntBuffer().put(value);
+ outChannel.write(bs);
+ }
+
+ protected void writeSectionData(InputStream inChannel, OutputStream outChannel) throws IOException {
+ byte[] bs = new byte[BUFFER_SIZE];
+ int read = 0;
+ int remaining = sectionLength;
+
+ while ((read = inChannel.read(bs, 0, Math.min(remaining, bs.length))) > 0) {
+ outChannel.write(bs, 0, read);
+ remaining -= read;
}
- Font font = new Font("Serif", Font.HANGING_BASELINE, fontSize);
+ if (remaining > 0) {
+ throw new IllegalArgumentException();
+ }
- g2d.setFont(font);
+ byte[] crc = new byte[4];
+ if (inChannel.read(crc) < crc.length) {
+ throw new IllegalArgumentException();
+ }
- int x = 10;
- int y = fontSize * 5 / 2;
+ outChannel.write(crc);
+ }
- g2d.translate(x, y);
+ public void write(InputStream inChannel, OutputStream outChannel) throws IOException {
+ writeHeaderSectionData(outChannel);
+ writeSectionData(inChannel, outChannel);
+ }
+ };
- Color color = new Color(paintData.color);
+ private class HeaderSection extends Section {
- g2d.setPaint(new Color(color.getRed(), color.getGreen(), color.getBlue(), 30));
+ @Override
+ protected void writeSectionData(InputStream inChannel, OutputStream outChannel) throws IOException {
+ // // Width 4 bytes
+ // // Height 4 bytes
+ // // Bit depth 1 byte
+ // // Colour type 1 byte
+ // // Compression method 1 byte
+ // // Filter method 1 byte
+ // // Interlace method 1 byte
- AffineTransform origTransform = g2d.getTransform();
+ byte[] headerBytes = new byte[sectionLength];
- g2d.shear(-0.5 * paintData.scale, 0);
- g2d.scale(1, paintData.scale);
- g2d.drawString(paintData.text, 0, 0);
- g2d.setTransform(origTransform);
- g2d.setPaint(color);
- g2d.drawString(paintData.text, 0, 0);
- ImageIO.write(img, "jpeg", out);
+ if (inChannel.read(headerBytes) < headerBytes.length) {
+ throw new IllegalArgumentException();
+ }
+
+ if (headerBytes[8] != 8) {
+ throw new IllegalStateException("Color depth is not 8");
+ }
+
+ if (headerBytes[9] != 2 && headerBytes[9] != 3) {
+ throw new IllegalStateException("Unsupported color type");
+ }
+
+ imageWidth = ByteBuffer.wrap(headerBytes, 0, 4).order(ByteOrder.BIG_ENDIAN).asIntBuffer().get();
+
+ isIndexed = (headerBytes[9] == 3);
+
+ outChannel.write(headerBytes);
+
+ byte[] crc = new byte[4];
+ if (inChannel.read(crc) < crc.length) {
+ throw new IllegalArgumentException();
+ }
+
+ outChannel.write(crc);
}
- }
- private void copy(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[2048];
- int read;
+ };
- while ((read = in.read(buffer)) != -1) {
- out.write(buffer, 0, read);
+ private void transformColors(byte[] data, int offset, int length) {
+ float[] intensities = new float[3];
+
+ for (int i = offset; i < length + offset; i += 3) {
+ float weight = 0;
+ for (int j = 0; j < intensities.length; j++) {
+ intensities[j] = ((float) (data[i + j] & 0xFF)) / 255;
+ weight += intensities[j];
+ }
+
+ float r = 0;
+ float g = 0;
+ float b = 0;
+
+ for (int j = 0; j < intensities.length; j++) {
+ r += intensities[j] * colors[j].getRed();
+ g += intensities[j] * colors[j].getGreen();
+ b += intensities[j] * colors[j].getBlue();
+ }
+
+ data[i] = (byte) (r);
+ data[i + 1] = (byte) (g);
+ data[i + 2] = (byte) (b);
}
}
- public void paintFlash(OutputStream out, Object data) throws IOException {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ private class PaletteSection extends Section {
+ @Override
+ protected void writeSectionData(InputStream inChannel, OutputStream outChannel) throws IOException {
+ if (!isIndexed) {
+ super.writeSectionData(inChannel, outChannel);
+ } else {
+ byte[] data = new byte[2000 * 3];
+ int read;
+ int remaining = sectionLength;
- if (loader == null) {
- loader = getClass().getClassLoader();
+ assert (data.length < BUFFER_SIZE);
+
+ CRC32 crc32 = new CRC32();
+ crc32.update(chunkTypeBytes);
+
+ while ((read = (inChannel.read(data, 0, Math.min(remaining, data.length)))) > 0) {
+ remaining -= read;
+
+ transformColors(data, 0, read);
+
+ outChannel.write(data, 0, read);
+ crc32.update(data, 0, read);
+ }
+
+ if (remaining > 0) {
+ throw new IllegalArgumentException();
+ }
+
+ inChannel.skip(4);
+
+ writeInt(outChannel, (int) crc32.getValue());
+ }
}
+ };
- InputStream stream = loader.getResourceAsStream("org/richfaces/demo/mediaOutput/text.swf");
+ private class LimitedInputStream extends FilterInputStream {
- if (stream != null) {
- try {
- copy(stream, out);
- } finally {
- stream.close();
+ private int remaining;
+
+ protected LimitedInputStream(InputStream inChannel) {
+ super(inChannel);
+ this.remaining = sectionLength;
+ }
+
+ @Override
+ public int available() throws IOException {
+ return Math.min(super.available(), this.remaining);
+ }
+
+ @Override
+ public int read() throws IOException {
+ if (this.remaining > 0) {
+ int read = super.read();
+ if (read != -1) {
+ this.remaining--;
+ }
+
+ return read;
+ } else {
+ return -1;
}
}
+
+ @Override
+ public int read(byte[] b) throws IOException {
+ return read(b, 0, b.length);
+ }
+
+ @Override
+ public int read(byte[] b, int off, int len) throws IOException {
+ int read = super.read(b, 0, Math.min(len, this.remaining));
+ if (read > 0) {
+ this.remaining -= read;
+ }
+
+ return read;
+ }
+
+ @Override
+ public synchronized void mark(int readlimit) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean markSupported() {
+ return false;
+ }
+
+ @Override
+ public synchronized void reset() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ long toSkip = Math.min(this.remaining, n);
+ long skipped = super.skip(toSkip);
+
+ if (skipped > 0) {
+ this.remaining -= skipped;
+ }
+
+ return skipped;
+ }
+ };
+
+ private class DataSection extends Section {
+
+ private byte paeth(byte a, byte b, byte c) {
+ int p = (a & 0xFF) + (b & 0xFF) - (c & 0xFF);
+ int pa = Math.abs(p - a);
+ int pb = Math.abs(p - b);
+ int pc = Math.abs(p - c);
+
+ int pr;
+
+ if (pa <= pb && pa <= pc) {
+ pr = a;
+ } else if (pb <= pc) {
+ pr = b;
+ } else {
+ pr = c;
+ }
+
+ return (byte) pr;
+ };
+
+ private class Filter {
+ protected int idx;
+ byte a = 0;
+ byte b = 0;
+ byte c = 0;
+
+ byte oa = 0;
+ byte ob = 0;
+ byte oc = 0;
+
+ int step = 3;
+
+ byte[] bs;
+ byte[] ps;
+
+ public void setIdx(int idx) {
+ this.idx = idx;
+
+ oa = a;
+ ob = b;
+ oc = c;
+
+ b = ps[idx];
+ if (idx > step) {
+ a = bs[idx - step];
+ c = ps[idx - step];
+ }
+ }
+
+ public void next() {
+ idx = idx + step;
+ setIdx(idx);
+ }
+ };
+
+ private class SubFilter extends Filter {
+ @Override
+ public void next() {
+ bs[idx] = (byte) ((bs[idx] & 0xFF) + (a & 0xFF) - (oa & 0xFF));
+ setIdx(idx + step);
+ }
+ };
+
+ private class UpFilter extends Filter {
+ @Override
+ public void next() {
+ bs[idx] = (byte) ((bs[idx] & 0xFF) + (b & 0xFF) - (ob & 0xFF));
+ setIdx(idx + step);
+ }
+ };
+
+ private class PaethFilter extends Filter {
+ @Override
+ public void next() {
+ bs[idx] = (byte) (paeth(a, b, c) - paeth(oa, ob, oc) + (bs[idx] & 0xFF));
+ setIdx(idx + step);
+ }
+ }
+
+ private void reconstruct(byte[] bs, byte[] ps) {
+ Filter[] filters = new Filter[3];
+
+ for (int i = 0; i < filters.length; i++) {
+ switch (bs[0]) {
+ case 0:
+ filters[i] = new Filter();
+ break;
+ case 1:
+ filters[i] = new SubFilter();
+ break;
+ case 2:
+ filters[i] = new UpFilter();
+ break;
+ case 4:
+ filters[i] = new PaethFilter();
+ break;
+
+ default:
+ throw new IllegalArgumentException(Integer.toHexString(bs[0]));
+ }
+
+ filters[i].bs = bs;
+ filters[i].ps = ps;
+ filters[i].step = 3;
+
+ filters[i].setIdx(1 + i);
+ }
+
+ for (int i = 1; i < (bs.length - 1) / 3; i++) {
+ for (Filter filter : filters) {
+ filter.next();
+ }
+ }
+
+ bs[0] = 0;
+ }
+
+ @Override
+ public void write(InputStream inChannel, OutputStream outChannel) throws IOException {
+ if (isIndexed) {
+ super.write(inChannel, outChannel);
+ } else {
+ byte[] ps = new byte[imageWidth * 3 + 1];
+ byte[] bs = new byte[imageWidth * 3 + 1];
+
+ assert (bs.length < BUFFER_SIZE);
+
+ int read = 0;
+
+ InputStream inflaterInputStream = new BufferedInputStream(new InflaterInputStream(
+ new LimitedInputStream(inChannel), new Inflater(), 2048), BUFFER_SIZE);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(sectionLength);
+ DeflaterOutputStream deflaterOutputStream = new DeflaterOutputStream(baos, new Deflater(), 2048);
+
+ while ((read = (inflaterInputStream.read(bs))) > 0) {
+ reconstruct(bs, ps);
+ transformColors(bs, 1, read - 1);
+
+ deflaterOutputStream.write(bs, 0, read);
+
+ byte[] swapVar = bs;
+ bs = ps;
+ ps = swapVar;
+ }
+
+ deflaterOutputStream.finish();
+
+ byte[] compressedSectionBytes = baos.toByteArray();
+ writeInt(outChannel, compressedSectionBytes.length);
+
+ CRC32 crc32 = new CRC32();
+ outChannel.write(chunkTypeBytes);
+ crc32.update(chunkTypeBytes);
+
+ if (inChannel.skip(4) < 4) {
+ throw new IllegalArgumentException();
+ }
+
+ outChannel.write(compressedSectionBytes);
+
+ writeInt(outChannel, (int) crc32.getValue());
+ }
+ }
+
+ };
+
+ private Section readNextSection(InputStream inChannel) throws IOException {
+ int read = inChannel.read(lengthBytes);
+ if (read != -1) {
+ if (read < lengthBytes.length) {
+ throw new IllegalArgumentException();
+ }
+
+ if (inChannel.read(chunkTypeBytes) < chunkTypeBytes.length) {
+ throw new IllegalArgumentException();
+ }
+
+ IntBuffer lengthBuffer = ByteBuffer.wrap(lengthBytes).order(ByteOrder.BIG_ENDIAN).asIntBuffer();
+ sectionLength = lengthBuffer.get(0);
+ String chunkTypeString = new String(chunkTypeBytes, asciiCharset);
+
+ if ("IHDR".equals(chunkTypeString)) {
+ return new HeaderSection();
+ } else if ("PLTE".equals(chunkTypeString)) {
+ return new PaletteSection();
+ } else if ("IDAT".equals(chunkTypeString)) {
+ return new DataSection();
+ } else {
+ return new Section();
+ }
+ } else {
+ return null;
+ }
}
+
+ public void process(OutputStream outStream, Object data) throws Exception {
+ colors = ((MediaData) data).getNewColors();
+
+ ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext();
+ BufferedInputStream inStream = new BufferedInputStream(extContext
+ .getResourceAsStream(RICHFACES_MEDIA_OUTPUT_IMAGE_SOURCE), BUFFER_SIZE);
+ try {
+ // skip 8-bytes of header
+ byte[] bs = new byte[8];
+ if (inStream.read(bs) < bs.length) {
+ throw new IllegalArgumentException();
+ }
+ outStream.write(bs);
+
+ Section section = null;
+ while ((section = readNextSection(inStream)) != null) {
+ section.write(inStream, outStream);
+ }
+ } finally {
+ inStream.close();
+ outStream.close();
+ }
+ }
}
Modified: branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java
===================================================================
--- branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java 2010-08-19 15:11:17 UTC (rev 18817)
+++ branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java 2010-08-19 15:32:41 UTC (rev 18818)
@@ -3,65 +3,44 @@
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
+import javax.faces.bean.ViewScoped;
-@ManagedBean(name = "mediaData")
-@RequestScoped
+@ManagedBean
+@ViewScoped
public class MediaData implements Serializable {
-
- /**
- *
- */
+ private static final Color[] COLORS = { new Color(255, 0, 0), new Color(0, 0, 255), new Color(0, 255, 0),
+ new Color(255, 255, 0), new Color(0, 255, 255) };
private static final long serialVersionUID = 1L;
- int height = 120;
- int width = 300;
- Integer color;
- float scale;
- String text;
+ private int colorIndex1 = 0;
+ private int colorIndex2 = 1;
+ private int colorIndex3 = 2;
- public MediaData() {
- setText("RichFaces 4.0");
- setColor(1000);
- setScale(2);
+ public Color[] getNewColors() {
+ return new Color[] { COLORS[colorIndex1], COLORS[colorIndex2], COLORS[colorIndex3], };
}
- public Integer getColor() {
- return color;
+ public int getColorIndex1() {
+ return colorIndex1;
}
- public void setColor(Integer color) {
- this.color = color;
+ public void setColorIndex1(int colorIndex1) {
+ this.colorIndex1 = colorIndex1;
}
- public float getScale() {
- return scale;
+ public int getColorIndex2() {
+ return colorIndex2;
}
- public void setScale(float scale) {
- this.scale = scale;
+ public void setColorIndex2(int colorIndex2) {
+ this.colorIndex2 = colorIndex2;
}
- public String getText() {
- return text;
+ public int getColorIndex3() {
+ return colorIndex3;
}
- public void setText(String text) {
- this.text = text;
+ public void setColorIndex3(int colorIndex3) {
+ this.colorIndex3 = colorIndex3;
}
- public int getWidth() {
- return width;
- }
-
- public void setWidth(int width) {
- this.width = width;
- }
-
- public int getHeight() {
- return height;
- }
-
- public void setHeight(int height) {
- this.height = height;
- }
-}
+}
\ No newline at end of file
Modified: branches/RF-7939-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java
===================================================================
--- branches/RF-7939-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2010-08-19 15:11:17 UTC (rev 18817)
+++ branches/RF-7939-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2010-08-19 15:32:41 UTC (rev 18818)
@@ -1,27 +1,26 @@
package org.richfaces.demo.push;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.EventListener;
import java.util.EventObject;
import java.util.List;
-import java.util.Random;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import org.ajax4jsf.event.PushEventListener;
+import org.richfaces.demo.common.data.RandomHelper;
@ManagedBean(name = "choicesBean")
-@SessionScoped
-public class ChoicesBean implements Runnable {
+@ViewScoped
+public class ChoicesBean implements Serializable{
PushEventListener listener;
-
- private boolean enabled = false;
+
+ private boolean enabled = true;
private List<Choice> choices;
private List<Choice> lastVotes;
- private Date startDate;
- private Thread thread;
private String updateInfo;
public ChoicesBean() {
@@ -39,6 +38,13 @@
lastVotes.add(new Choice("Apple"));
}
+ public void initiateEvent() {
+ for (Choice choice : lastVotes) {
+ choice.setVotesCount(RandomHelper.rand(0, 3));
+ }
+ listener.onEvent(new EventObject(this));
+ }
+
public List<Choice> getChoices() {
return choices;
}
@@ -58,56 +64,13 @@
}
public synchronized void start() {
- if (thread == null) {
- setStartDate(new Date());
- setEnabled(true);
- thread = new Thread(this);
- thread.setDaemon(true);
- thread.start();
- }
+ setEnabled(true);
}
public synchronized void stop() {
- if (thread != null) {
- setStartDate(null);
- setEnabled(false);
- thread = null;
- }
+ setEnabled(false);
}
- public static int rand(int lo, int hi) {
- Random rn2 = new Random();
- int n = hi - lo + 1;
- int i = rn2.nextInt() % n;
-
- if (i < 0) {
- i = -i;
- }
-
- return lo + i;
- }
-
- public void run() {
- while (thread != null) {
- try {
- if (((new Date()).getTime() - startDate.getTime()) >= 60000) {
- stop();
- }
-
- // changing votes count
- for (Choice choice : lastVotes) {
- choice.setVotesCount(rand(0, 3));
- }
-
- // System.out.println("New Event!");
- listener.onEvent(new EventObject(this));
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
public void processUpdates() {
for (Choice choice : lastVotes) {
if (choice.getVotesCount() > 0) {
@@ -116,26 +79,14 @@
choices.get(index).increment(choice.getVotesCount());
}
}
-
updateInfo = "[ ";
-
for (Choice choice : lastVotes) {
updateInfo += choice.getVotesCount() + " ";
}
-
updateInfo += "] ";
-
- // System.out.println("ChoicesBean.processUpdates()");
}
- public Thread getThread() {
- return thread;
- }
-
public boolean isEnabled() {
-
- // System.out.println("ChoicesBean.isEnabled()");
- // System.out.println(enabled);
return enabled;
}
@@ -143,14 +94,6 @@
this.enabled = enabled;
}
- public Date getStartDate() {
- return startDate;
- }
-
- public void setStartDate(Date startDate) {
- this.startDate = startDate;
- }
-
public String getUpdateInfo() {
return updateInfo;
}
Modified: branches/RF-7939-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- branches/RF-7939-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-08-19 15:11:17 UTC (rev 18817)
+++ branches/RF-7939-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-08-19 15:32:41 UTC (rev 18818)
@@ -162,7 +162,7 @@
</sample>
</samples>
</demo>
- <demo>
+ <demo new="true">
<id>mediaOutput</id>
<name>a4j:mediaOutput</name>
<samples>
Added: branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png
===================================================================
(Binary files differ)
Property changes on: branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml
===================================================================
--- branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml 2010-08-19 15:11:17 UTC (rev 18817)
+++ branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml 2010-08-19 15:32:41 UTC (rev 18818)
@@ -9,9 +9,9 @@
other binary resources defined by a user on-the-fly.</p>
<p><b>createContent</b> attribute references to the method that
will be used for content creating. The method accepts two parameters.
- The first parameter has an OutputStream type. It is a reference to the
- steam that should be used for output. The second parameter is a
- reference to a 'value' attribute of the component.</p>
+ The first parameter has an <b>OutputStream </b>type. It is a reference
+ to the steam that should be used for output. The second parameter is a
+ reference to a '<b>value</b>' attribute of the component.</p>
<p><b>value</b> attribute references to data that can be used as
input data for a content creator method. The data should be
serializable because it is encoded to the URL of the resource.</p>
@@ -23,7 +23,10 @@
cached. If it is set to true, it will be cached and the serialized
value of 'value' attribute plays the role of a cache key.</p>
- <p>Dynamically generated JPEG file:</p>
+ <p>As <b>Google Application Engine restricts AWT classes usage</b> - in
+ this sample we <b>reading existent image and performing just re-indexing of the
+ palette</b> using colors you selected below. So try to change the color and
+ click process.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
<ui:include src="/templates/includes/source-view.xhtml">
<ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
Modified: branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml
===================================================================
--- branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml 2010-08-19 15:11:17 UTC (rev 18817)
+++ branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml 2010-08-19 15:32:41 UTC (rev 18818)
@@ -5,8 +5,38 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <a4j:mediaOutput element="img" cacheable="false" session="true"
- createContent="#{mediaBean.paint}" value="#{mediaData}"
- mimeType="image/jpeg" />
-
+ <h:form>
+ <h:panelGrid columns="6">
+ <h:outputText value="Color 1" />
+ <h:selectOneMenu value="#{mediaData.colorIndex1}">
+ <f:selectItem itemLabel="Red" itemValue="0"/>
+ <f:selectItem itemLabel="Dark Blue" itemValue="1"/>
+ <f:selectItem itemLabel="Green" itemValue="2"/>
+ <f:selectItem itemLabel="Yellow" itemValue="3"/>
+ <f:selectItem itemLabel="Blue" itemValue="4"/>
+ </h:selectOneMenu>
+ <h:outputText value="Color 1" />
+ <h:selectOneMenu value="#{mediaData.colorIndex2}">
+ <f:selectItem itemLabel="Red" itemValue="0"/>
+ <f:selectItem itemLabel="Dark Blue" itemValue="1"/>
+ <f:selectItem itemLabel="Green" itemValue="2"/>
+ <f:selectItem itemLabel="Yellow" itemValue="3"/>
+ <f:selectItem itemLabel="Blue" itemValue="4"/>
+ </h:selectOneMenu>
+ <h:outputText value="Color 1" />
+ <h:selectOneMenu value="#{mediaData.colorIndex3}">
+ <f:selectItem itemLabel="Red" itemValue="0"/>
+ <f:selectItem itemLabel="Dark Blue" itemValue="1"/>
+ <f:selectItem itemLabel="Green" itemValue="2"/>
+ <f:selectItem itemLabel="Yellow" itemValue="3"/>
+ <f:selectItem itemLabel="Blue" itemValue="4"/>
+ </h:selectOneMenu>
+ <f:facet name="footer">
+ <a4j:commandButton value="Process the image" render="img" execute="@form"/>
+ </f:facet>
+ </h:panelGrid>
+ <a4j:mediaOutput element="img" cacheable="false" session="true" id="img"
+ createContent="#{mediaBean.process}" value="#{mediaData}"
+ mimeType="image/jpeg" />
+ </h:form>
</ui:composition>
\ No newline at end of file
Modified: branches/RF-7939-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml
===================================================================
--- branches/RF-7939-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml 2010-08-19 15:11:17 UTC (rev 18817)
+++ branches/RF-7939-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml 2010-08-19 15:32:41 UTC (rev 18818)
@@ -25,27 +25,38 @@
</h:column>
</h:dataTable>
- <a4j:jsFunction name="startPush" action="#{choicesBean.start}"
- execute="@this" render="push, stop, start" />
- <a4j:jsFunction name="stopPush" action="#{choicesBean.stop}"
- execute="@this" render="push, stop, start" />
-
- <h:commandButton onclick="startPush()" value="Start" id="start"
- disabled="#{choicesBean.enabled}" type="button" />
-
- <h:commandButton onclick="stopPush()" type="button" value="Stop"
- id="stop" disabled="#{!choicesBean.enabled}" />
-
<a4j:outputPanel layout="block" id="tempResults">
<h:outputText
value="Latest update votes was: #{choicesBean.updateInfo} at #{choicesBean.timeStamp}"
rendered="#{choicesBean.enabled}" />
+ <h:outputText style="color:red"
+ value="The push has been disabled automatically after 3 minutes of working. Please refresh the page."
+ rendered="#{!choicesBean.enabled}" />
</a4j:outputPanel>
-
+
+ <fieldset>
+ <legend><b>Firing event</b></legend>
+ <a4j:commandLink style="font-weight:bold;"
+ value="Initiate server Event" id="initiate"
+ disabled="#{!choicesBean.enabled}" render="@none"
+ action="#{choicesBean.initiateEvent}" />
+ <p>Pay attention that this link has <b>@none value in render</b> so it's actually not performs any updates.
+ It's just <b>queues server side event</b> which will be <b>fetched by push</b> component and processed</p>
+ </fieldset>
+
<a4j:push enabled="#{choicesBean.enabled}" interval="1000"
eventProducer="#{choicesBean.addListener}" id="push"
- action="#{choicesBean.processUpdates}">
- <a4j:ajax render="choiceVotes push tempResults" />
- </a4j:push>
+ action="#{choicesBean.processUpdates}"
+ render="choiceVotes push tempResults" />
+
</h:form>
+
+ <h:form>
+ <!-- This poll used only to expire push after a minute of working. Done in order not
+ to flood the server with the requests from pages "forgotten" to be closed before
+ weekends :)-->
+ <a4j:poll interval="180000" action="#{choicesBean.stop}"
+ enabled="#{choicesBean.enabled}"
+ render="push start initiate poll tempResults" id="poll" />
+ </h:form>
</ui:composition>
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r18817 - modules/build/parent/branches/RF-9112.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 11:11:17 -0400 (Thu, 19 Aug 2010)
New Revision: 18817
Modified:
modules/build/parent/branches/RF-9112/pom.xml
Log:
RF-9112 Updated richfaces-parent
Modified: modules/build/parent/branches/RF-9112/pom.xml
===================================================================
--- modules/build/parent/branches/RF-9112/pom.xml 2010-08-19 15:07:09 UTC (rev 18816)
+++ modules/build/parent/branches/RF-9112/pom.xml 2010-08-19 15:11:17 UTC (rev 18817)
@@ -31,12 +31,12 @@
</parent>
<description>
- The Parent for all RichFaces sub-projects. This specifies
- build, plugin
- and project meta-data.
+ This is the parent for all RichFaces artifacts, and contains project
+ metadata, shared/stable configuration, and other common settings that
+ change very rarely.
</description>
- <url>http://www.jboss.org/richfaces</url>
+ <url>http://richfaces.org</url>
<licenses>
<license>
@@ -48,6 +48,7 @@
<developers>
<developer>
+ <!-- TODO populate -->
<name>RichFaces committers</name>
</developer>
</developers>
@@ -59,9 +60,9 @@
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
<!-- Override the default 2.0.9 from jboss-parent -->
<maven.min.version>2.1.0</maven.min.version>
- <richfaces.checkstyle.version>2-SNAPSHOT</richfaces.checkstyle.version>
</properties>
<!-- Repository management, including extra repositories if needed -->
@@ -101,44 +102,12 @@
</pluginRepository>
</pluginRepositories>
- <dependencyManagement>
- <dependencies>
- <!-- Archetypes dependency -->
- <dependency>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.7</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
<!-- Build -->
<build>
<!--
- Plugin config, including versions to use in the build. Note: some
- are inherited from jboss-parent
+ The pluginManagement section of the richfaces-parent should contain
+ and stable plugin settings, and versions to be used by all part of
+ the project.
-->
<pluginManagement>
<plugins>
@@ -153,11 +122,6 @@
<releaseProfiles>release</releaseProfiles>
<!-- Some modules (dist) need release items installed during prepare -->
<preparationGoals>clean install</preparationGoals>
- <!--
- RichFaces modules should override and set goals to
- run for release:perform
- -->
- <!-- <goals></goals> -->
</configuration>
</plugin>
@@ -347,9 +311,7 @@
</profiles>
<distributionManagement>
- <downloadUrl>
- http://www.jboss.org/richfaces/download
- </downloadUrl>
+ <downloadUrl>http://www.jboss.org/richfaces/download</downloadUrl>
</distributionManagement>
<!-- SCM and distribution management -->
15 years, 9 months
JBoss Rich Faces SVN: r18816 - sandbox/trunk/prototypes/indexed-png-transformation.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-19 11:07:09 -0400 (Thu, 19 Aug 2010)
New Revision: 18816
Modified:
sandbox/trunk/prototypes/indexed-png-transformation/source.png
Log:
Updated source.png
Modified: sandbox/trunk/prototypes/indexed-png-transformation/source.png
===================================================================
(Binary files differ)
15 years, 9 months
JBoss Rich Faces SVN: r18815 - in branches/RF-9112: cdk/parent and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 10:14:47 -0400 (Thu, 19 Aug 2010)
New Revision: 18815
Modified:
branches/RF-9112/bom/pom.xml
branches/RF-9112/cdk/parent/pom.xml
branches/RF-9112/core/parent/pom.xml
branches/RF-9112/dist/pom.xml
branches/RF-9112/examples/repeater-demo/pom.xml
branches/RF-9112/parent/pom.xml
branches/RF-9112/ui/parent/pom.xml
Log:
RF-9112 initial switch to root-parent usage
Modified: branches/RF-9112/bom/pom.xml
===================================================================
--- branches/RF-9112/bom/pom.xml 2010-08-19 14:12:52 UTC (rev 18814)
+++ branches/RF-9112/bom/pom.xml 2010-08-19 14:14:47 UTC (rev 18815)
@@ -34,12 +34,10 @@
</parent>
<description>
- The RichFaces "Bill of Materials". This defines all runtime dependency
- versions for RichFaces.
+ The RichFaces "Bill of Materials". This defines all runtime dependency
+ versions for RichFaces.
</description>
- <url>http://www.jboss.org/richfaces</url>
-
<properties>
</properties>
@@ -223,102 +221,6 @@
</dependencies>
</dependencyManagement>
- <profiles>
- <!--
- The following profiles determine the JSF api/impl
- combinations that will be used in the project builds.
-
- -Djsf_profile=<profile-name> on the mvn command line
- -->
- <profile>
- <id>jsf_ri</id>
- <activation>
- <property>
- <name>!jsf_profile</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>myfaces</id>
- <activation>
- <property>
- <name>jsf_profile</name>
- <value>myfaces</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>jsf_ri_2_1_snapshot</id>
- <activation>
- <property>
- <name>jsf_profile</name>
- <value>jsf_ri_2_1_snapshot</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>myfaces_snapshot</id>
- <activation>
- <property>
- <name>jsf_profile</name>
- <value>myfaces_snapshot</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <version>2.0.2-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <version>2.0.2-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/build/bom</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/build/bom</developerConnection>
Modified: branches/RF-9112/cdk/parent/pom.xml
===================================================================
--- branches/RF-9112/cdk/parent/pom.xml 2010-08-19 14:12:52 UTC (rev 18814)
+++ branches/RF-9112/cdk/parent/pom.xml 2010-08-19 14:14:47 UTC (rev 18815)
@@ -5,8 +5,9 @@
<parent>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: branches/RF-9112/core/parent/pom.xml
===================================================================
--- branches/RF-9112/core/parent/pom.xml 2010-08-19 14:12:52 UTC (rev 18814)
+++ branches/RF-9112/core/parent/pom.xml 2010-08-19 14:14:47 UTC (rev 18815)
@@ -28,9 +28,9 @@
<parent>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../../bom/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<description>
Modified: branches/RF-9112/dist/pom.xml
===================================================================
--- branches/RF-9112/dist/pom.xml 2010-08-19 14:12:52 UTC (rev 18814)
+++ branches/RF-9112/dist/pom.xml 2010-08-19 14:14:47 UTC (rev 18815)
@@ -23,9 +23,9 @@
<parent>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../bom/pom.xml</relativePath>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces</groupId>
Modified: branches/RF-9112/examples/repeater-demo/pom.xml
===================================================================
--- branches/RF-9112/examples/repeater-demo/pom.xml 2010-08-19 14:12:52 UTC (rev 18814)
+++ branches/RF-9112/examples/repeater-demo/pom.xml 2010-08-19 14:14:47 UTC (rev 18815)
@@ -105,6 +105,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified: branches/RF-9112/parent/pom.xml
===================================================================
--- branches/RF-9112/parent/pom.xml 2010-08-19 14:12:52 UTC (rev 18814)
+++ branches/RF-9112/parent/pom.xml 2010-08-19 14:14:47 UTC (rev 18815)
@@ -1,21 +1,24 @@
<!--
- JBoss, Home of Professional Open Source Copyright 2010, Red Hat, Inc.
- and individual contributors by the @authors tag. See the copyright.txt
- in the distribution for a full listing of individual contributors. This
- is free software; you can redistribute it and/or modify it under the
- terms of the GNU Lesser General Public License as published by the Free
- Software Foundation; either version 2.1 of the License, or (at your
- option) any later version. This software 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
- software; if not, write to the Free Software Foundation, Inc., 51
- Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- site: http://www.fsf.org.
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software 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 software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
-->
-<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">
+<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
@@ -26,16 +29,16 @@
<parent>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <artifactId>richfaces-bom</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
</parent>
<description>
- This is the root parent for the richfaces project that is released with the project, and contains pluginmangement, and common testing dependency management elements.
+ This is the root parent for the richfaces project that is released with
+ the project, and contains pluginmangement, and common testing dependency
+ management elements.
</description>
-
- <url>http://richfaces.org</url>
-
+
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Override the default 2.0.9 from jboss-parent -->
@@ -80,126 +83,17 @@
<!-- Build -->
<build>
<!--
- Plugin config, including versions to use in the build. Note: some
- are inherited from jboss-parent
+ PluginManagement config, including versions to use in the
+ build. Note: some are inherited from jboss-parent, others
+ from richfaces-parent
-->
<pluginManagement>
<plugins>
- <!-- Release -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!-- All sub-modules will have same version -->
- <autoVersionSubmodules>true</autoVersionSubmodules>
- <!-- During release:perform, enable the "release" profile -->
- <releaseProfiles>release</releaseProfiles>
- <!-- Some modules (dist) need release items installed during prepare -->
- <preparationGoals>clean install</preparationGoals>
- <!--
- RichFaces modules should override and set goals to
- run for release:perform
- -->
- <!-- <goals></goals> -->
- </configuration>
- </plugin>
-
-
- <!-- Build -->
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <index>true</index>
- <manifest>
- <addDefaultSpecificationEntries>
- true
- </addDefaultSpecificationEntries>
- <addDefaultImplementationEntries>
- true
- </addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <mode>development</mode>
- <Build-Number>${buildNumber}
- </Build-Number>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.4</version>
- </plugin>
-
- <!-- reporting -->
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <configLocation>richfaces-checkstyle/richfaces-checkstyle.xml
- </configLocation>
- </configuration>
- <executions>
- <execution>
- <id>richfaces-checkstyle-report</id>
- <phase>process-sources</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-build-checkstyle</artifactId>
- <version>${richfaces.checkstyle.version}</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <!-- dev -->
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <wtpversion>2.0</wtpversion>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
-
<!--
- docs TODO should move to profiles probably a "doc" profile
+ TODO: migrate plugin config from richfaces-parent.
+ Need to be careful of what root-aggregator, and bom
+ need though because they do not inherit this
-->
- <plugin>
- <groupId>gr.abiss.mvn.plugins</groupId>
- <artifactId>maven-jstools-plugin</artifactId>
- <version>0.7</version>
- <configuration>
- <jsDir>${project.basedir}/src/main/resources/META-INF/resources
- </jsDir>
- <includes>**/*.js</includes>
- <caseSensitive>true</caseSensitive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.2</version>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -212,83 +106,110 @@
</plugins>
</build>
- <!-- Profiles -->
<profiles>
<profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <!-- TODO move to doc profile? -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <javadocVersion>1.5</javadocVersion>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-javadoc</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
<!--
- Triggers generated documentation as part of builds ( javadoc,
- jsdoc, etc...
+ TODO: migrate profile config from richfaces-parent. Need
+ to be careful of what root-aggregator, and bom need
+ though because they do not inherit this
-->
- <id>doc</id>
- <!-- TODO -->
</profile>
+
+ <!--
+ The following profiles determine the JSF api/impl
+ combinations that will be used in the project builds.
+
+ -Djsf_profile=<profile-name> on the mvn command line
+ -->
<profile>
- <!-- Triggers clover reports to be generated -->
- <id>clover</id>
- <build>
- <plugins>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <configuration>
- <licenseLocation>
- ${clover.license.path}
- </licenseLocation>
- <jdk>1.5</jdk>
- <generatePdf>false</generatePdf>
- <generateXml>true</generateXml>
- <generateHtml>true</generateHtml>
- </configuration>
- <executions>
- <execution>
- <id>instrument</id>
- <phase>verify</phase>
- <goals>
- <goal>instrument</goal>
- <goal>check</goal>
- <goal>clover</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <id>jsf_ri</id>
+ <activation>
+ <property>
+ <name>!jsf_profile</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</profile>
<profile>
- <!-- Required when in JBoss hudson env to have clover reports generate -->
- <id>hudson</id>
- <properties>
- <clover.license.path>/home/hudson/config_repository/resources/richfaces/richfaces-clover-license.txt
- </clover.license.path>
- </properties>
+ <id>myfaces</id>
+ <activation>
+ <property>
+ <name>jsf_profile</name>
+ <value>myfaces</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</profile>
+ <profile>
+ <id>jsf_ri_2_1_snapshot</id>
+ <activation>
+ <property>
+ <name>jsf_profile</name>
+ <value>jsf_ri_2_1_snapshot</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>myfaces_snapshot</id>
+ <activation>
+ <property>
+ <name>jsf_profile</name>
+ <value>myfaces_snapshot</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
-
+
<!-- SCM and distribution management -->
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/parent
Modified: branches/RF-9112/ui/parent/pom.xml
===================================================================
--- branches/RF-9112/ui/parent/pom.xml 2010-08-19 14:12:52 UTC (rev 18814)
+++ branches/RF-9112/ui/parent/pom.xml 2010-08-19 14:14:47 UTC (rev 18815)
@@ -26,9 +26,9 @@
<parent>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../../bom/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui</groupId>
15 years, 9 months
JBoss Rich Faces SVN: r18814 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-08-19 10:12:52 -0400 (Thu, 19 Aug 2010)
New Revision: 18814
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
* rich:togglePanelItem added to the list of components
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-19 14:00:05 UTC (rev 18813)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-19 14:12:52 UTC (rev 18814)
@@ -126,6 +126,7 @@
components.put("richSubTableToggleControl", "Rich Subtable Toggle Control");
components.put("richToggleControl", "Rich Toggle Control");
components.put("richTogglePanel", "Rich Toggle Panel");
+ components.put("richTogglePanelItem", "Rich Toggle Panel Item");
}
private void createSkinList() {
15 years, 9 months