JBoss Rich Faces SVN: r18833 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-08-19 19:24:46 -0400 (Thu, 19 Aug 2010)
New Revision: 18833
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestReferencedUsage.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/referencedUsage.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java
modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js
Log:
a4j:status - added tests for referenced usage (RFPL-735)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/referencedUsage.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/referencedUsage.xhtml 2010-08-19 23:23:34 UTC (rev 18832)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/referencedUsage.xhtml 2010-08-19 23:24:46 UTC (rev 18833)
@@ -46,7 +46,7 @@
<h:panelGrid columns="2">
<h:commandButton id="button1" value="Named status 1" onclick="statusFunction1(); return false;" />
- <a4j:status name="status1">
+ <a4j:status id="status1" name="status1">
<f:facet name="start">
<h:outputText id="status1TextStart" style="font-size: large; color: red;" value="START" />
</f:facet>
@@ -61,7 +61,7 @@
</a4j:status>
<h:commandButton id="button2" value="Named status 2" onclick="statusFunction2(); return false;" />
- <a4j:status name="status2">
+ <a4j:status id="status2" name="status2">
<f:facet name="start">
<h:outputText id="status2TextStart" style="font-size: large; color: red;" value="START" />
</f:facet>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java 2010-08-19 23:23:34 UTC (rev 18832)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java 2010-08-19 23:24:46 UTC (rev 18833)
@@ -64,11 +64,11 @@
}
void waitForHalt() {
- selenium.waitForCondition(js("selenium.browserbot.getCurrentWindow().Metamer.halt == true"));
+ selenium.waitForCondition(js("selenium.browserbot.getCurrentWindow().Metamer.waitForHalt()"));
}
void unhalt() {
- selenium.getEval(js("selenium.browserbot.getCurrentWindow().Metamer.halt = false"));
+ selenium.getEval(js("selenium.browserbot.getCurrentWindow().Metamer.unhalt()"));
}
void enableHalt() {
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestReferencedUsage.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestReferencedUsage.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestReferencedUsage.java 2010-08-19 23:24:46 UTC (rev 18833)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jStatus;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestReferencedUsage extends AbstracStatusTest {
+
+ JQueryLocator status1 = pjq("span[id$=status1]");
+ JQueryLocator status2 = pjq("span[id$=status2]");
+
+ TextRetriever retrieveStatus1 = retrieveText.locator(status1);
+ TextRetriever retrieveStatus2 = retrieveText.locator(status2);
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jStatus/referencedUsage.xhtml");
+ }
+
+ @BeforeMethod
+ public void installStatusExtensions() {
+ super.installStatusExtensions();
+ }
+
+ @Test
+ public void testClickBothButtonsInSequence() {
+ enableHalt();
+ selenium.click(button1);
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "START");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ unhalt();
+ waitAjax.waitForChange("START", retrieveStatus1);
+ selenium.click(button2);
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "STOP");
+ assertEquals(retrieveStatus2.retrieve(), "START");
+ unhalt();
+ waitAjax.waitForChange("START", retrieveStatus2);
+ assertEquals(retrieveStatus1.retrieve(), "STOP");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ disableHalt();
+ }
+
+ @Test
+ public void testClickBothButtonsImmediately() {
+ enableHalt();
+ selenium.click(button1);
+ selenium.click(button2);
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "START");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ unhalt();
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "STOP");
+ assertEquals(retrieveStatus2.retrieve(), "START");
+ unhalt();
+ waitAjax.waitForChange("START", retrieveStatus2);
+ assertEquals(retrieveStatus1.retrieve(), "STOP");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ disableHalt();
+ }
+
+ @Test
+ public void testClickFirstButtonThenSecondButtonThenAgainFirstButtonImmediately() {
+ enableHalt();
+ selenium.click(button1);
+ selenium.click(button2);
+ selenium.click(button1);
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "START");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ unhalt();
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "START");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ unhalt();
+ waitAjax.waitForChange("START", retrieveStatus1);
+ assertEquals(retrieveStatus1.retrieve(), "STOP");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ disableHalt();
+ }
+
+ @Test
+ public void testDoubleClick() {
+ enableHalt();
+ selenium.click(button1);
+ selenium.click(button2);
+ selenium.click(button1);
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "START");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ unhalt();
+ waitForHalt();
+ assertEquals(retrieveStatus1.retrieve(), "START");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ unhalt();
+ waitAjax.waitForChange("START", retrieveStatus1);
+ assertEquals(retrieveStatus1.retrieve(), "STOP");
+ assertEquals(retrieveStatus2.retrieve(), "STOP");
+ disableHalt();
+ }
+
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js 2010-08-19 23:23:34 UTC (rev 18832)
+++ modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js 2010-08-19 23:24:46 UTC (rev 18833)
@@ -20,31 +20,55 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
var Metamer = {
+ halts : new Array(),
+ sequenceId : 0,
+ haltIterator : 0,
haltEnabled : false,
- halt : false,
- callback : null,
- object : null,
- content : null,
- wait : function() {
- if (Metamer.haltEnabled && Metamer.halt) {
- setTimeout("Metamer.wait()", 100);
+ passes : 0,
+ wait : function(metamerHalt) {
+ Metamer.halts.push(metamerHalt);
+ Metamer._wait(metamerHalt.id);
+ },
+ _wait : function(id) {
+ var metamerHalt = Metamer.halts[id];
+ if (metamerHalt.halt) {
+ setTimeout("Metamer._wait(" + id + ")", 100);
} else {
- Metamer.halt = false;
- Metamer.callback();
+ metamerHalt.callback(metamerHalt.xhr, metamerHalt.content);
}
+ },
+ unhalt : function() {
+ var metamerHalt = Metamer.halts[Metamer.haltIterator];
+ Metamer.haltIterator += 1;
+ metamerHalt.halt = false;
+ },
+ isHalted : function() {
+ return Metamer.sequenceId > Metamer.haltIterator;
+ },
+ waitForHalt : function() {
+ return Metamer.sequenceId == 1 + Metamer.haltIterator;
}
};
+var MetamerHalt = function(xhr, content, callback) {
+ this.halt = true;
+ this.xhr = xhr;
+ this.content = content;
+ this.callback = callback;
+ this.id = Metamer.sequenceId++;
+}
+
Metamer.XHRWrapperInjection = {
send : RichFacesSelenium.XHRWrapper.prototype.send
};
RichFacesSelenium.XHRWrapper.prototype.send = function(content) {
- Metamer.halt = true;
- Metamer.object = this;
- Metamer.content = content;
- Metamer.callback = function() {
- Metamer.XHRWrapperInjection.send.call(Metamer.object, Metamer.content);
- };
- Metamer.wait();
+ if (Metamer.haltEnabled) {
+ var metamerHalt = new MetamerHalt(this, content, function(xhr, content1) {
+ Metamer.XHRWrapperInjection.send.call(xhr, content1);
+ });
+ Metamer.wait(metamerHalt);
+ } else {
+ Metamer.XHRWrapperInjection.send.call(this, content);
+ }
};
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r18832 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-08-19 19:23:34 -0400 (Thu, 19 Aug 2010)
New Revision: 18832
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
Log:
a4j:status - fixed simple facets sample and tests (RFPL-735)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml 2010-08-19 23:22:47 UTC (rev 18831)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml 2010-08-19 23:23:34 UTC (rev 18832)
@@ -39,22 +39,22 @@
<ui:define name="outOfTemplateBefore">
<fieldset>
<legend>Facets Settings</legend>
- <a4j:ajax event="change" render="status" execute="facetsSettings">
- <h:panelGrid id="facetsSettings" columns="2">
- <h:outputText value="Facet Start: " />
- <h:inputText id="facetStartTextInput" value="#{a4jStatusBean.facetStartValue}" />
-
- <h:outputText value="Facet Stop: " />
- <h:inputText id="facetStopTextInput" value="#{a4jStatusBean.facetStopValue}" />
-
- <h:outputText value="Facet Error: " />
- <h:inputText id="facetErrorTextInput" value="#{a4jStatusBean.facetErrorValue}" />
- </h:panelGrid>
- </a4j:ajax>
+ <h:panelGrid id="facetsSettings" columns="2">
+ <h:outputText value="Facet Start: " />
+ <h:inputText id="facetStartTextInput" value="#{a4jStatusBean.facetStartValue}" />
+
+ <h:outputText value="Facet Stop: " />
+ <h:inputText id="facetStopTextInput" value="#{a4jStatusBean.facetStopValue}" />
+
+ <h:outputText value="Facet Error: " />
+ <h:inputText id="facetErrorTextInput" value="#{a4jStatusBean.facetErrorValue}" />
+ </h:panelGrid>
</fieldset>
</ui:define>
<ui:define name="component">
+ <a4j:commandButton id="applyFacets" value="ApplyFacets" render="status" execute="facetsSettings" />
+
<fieldset style="height: 3em">
<legend>status (inside form)</legend>
<a4j:status id="status"
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 23:22:47 UTC (rev 18831)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 23:23:34 UTC (rev 18832)
@@ -21,8 +21,6 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest;
-import org.apache.commons.lang.Validate;
-import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.locator.AttributeLocator;
@@ -30,7 +28,6 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
/**
@@ -39,21 +36,10 @@
*/
public class AbstractComponentAttributes {
- AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+ protected AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
JQueryLocator propertyLocator = pjq("input[id$={0}Input]");
- ApplyType applyType;
-
- public AbstractComponentAttributes() {
- this(ApplyType.SERVER);
- }
-
- public AbstractComponentAttributes(ApplyType type) {
- Validate.notNull(type);
- this.applyType = type;
- }
-
protected String getProperty(String propertyName) {
final ElementLocator<?> locator = propertyLocator.format(propertyName);
return selenium.getValue(locator);
@@ -67,27 +53,21 @@
String inputType = selenium.getAttribute(typeLocator);
String valueAsString = value.toString();
- // INPUT TEXT
+
if ("text".equals(inputType)) {
- if (applyType == ApplyType.SERVER) {
- guardHttp(selenium).type(locator, valueAsString);
- } else if (applyType == ApplyType.AJAX) {
- guardXhr(selenium).type(locator, valueAsString);
- }
- // INPUT CHECKBOX
+ applyText(locator, valueAsString);
} else if ("checkbox".equals(inputType)) {
boolean checked = Boolean.valueOf(valueAsString);
- if (applyType == ApplyType.SERVER) {
- guardHttp(selenium).check(locator, checked);
- } else if (applyType == ApplyType.AJAX) {
- selenium.check(locator, checked);
- guardXhr(selenium).fireEvent(locator, Event.CHANGE);
- }
+ applyCheckbox(locator, checked);
}
}
- public static enum ApplyType {
- SERVER, AJAX
+ protected void applyText(ElementLocator<?> locator, String value) {
+ guardHttp(selenium).type(locator, value);
}
+
+ protected void applyCheckbox(ElementLocator<?> locator, boolean checked) {
+ guardHttp(selenium).check(locator, checked);
+ }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 23:22:47 UTC (rev 18831)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 23:23:34 UTC (rev 18832)
@@ -1,11 +1,45 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jStatus;
+import org.jboss.test.selenium.locator.ElementLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
public class StatusFacets extends AbstractComponentAttributes {
- public StatusFacets() {
- super(AbstractComponentAttributes.ApplyType.AJAX);
+ JQueryLocator applyFacetsButton = pjq("input[id$=applyFacets]");
+
+ @Override
+ protected void applyText(ElementLocator<?> locator, String value) {
+ selenium.type(locator, value);
+ guardXhr(selenium).click(applyFacetsButton);
}
public void setStartText(String startText) {
15 years, 9 months
JBoss Rich Faces SVN: r18831 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: a4jStatus and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-08-19 19:22:47 -0400 (Thu, 19 Aug 2010)
New Revision: 18831
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java
Log:
fixed checkstyle errors in metamer-ftest-source
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -39,31 +39,26 @@
*/
public class AbstractComponentAttributes {
- private Type type;
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- public static class Type {
- public static Type SERVER = new Type();
- public static Type AJAX = new Type();
- }
+ JQueryLocator propertyLocator = pjq("input[id$={0}Input]");
+ ApplyType applyType;
+
public AbstractComponentAttributes() {
- this(Type.SERVER);
+ this(ApplyType.SERVER);
}
- public AbstractComponentAttributes(Type type) {
+ public AbstractComponentAttributes(ApplyType type) {
Validate.notNull(type);
- this.type = type;
+ this.applyType = type;
}
- AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
-
- JQueryLocator propertyLocator = pjq("input[id$={0}Input]");
-
protected String getProperty(String propertyName) {
final ElementLocator<?> locator = propertyLocator.format(propertyName);
return selenium.getValue(locator);
}
-
+
protected void setProperty(String propertyName, Object value) {
final ElementLocator<?> locator = propertyLocator.format(propertyName);
final AttributeLocator<?> typeLocator = locator.getAttribute(new org.jboss.test.selenium.locator.Attribute(
@@ -74,21 +69,25 @@
String valueAsString = value.toString();
// INPUT TEXT
if ("text".equals(inputType)) {
- if (type == Type.SERVER) {
+ if (applyType == ApplyType.SERVER) {
guardHttp(selenium).type(locator, valueAsString);
- } else if (type == Type.AJAX) {
+ } else if (applyType == ApplyType.AJAX) {
guardXhr(selenium).type(locator, valueAsString);
}
// INPUT CHECKBOX
} else if ("checkbox".equals(inputType)) {
boolean checked = Boolean.valueOf(valueAsString);
- if (type == Type.SERVER) {
+ if (applyType == ApplyType.SERVER) {
guardHttp(selenium).check(locator, checked);
- } else if (type == Type.AJAX) {
+ } else if (applyType == ApplyType.AJAX) {
selenium.check(locator, checked);
guardXhr(selenium).fireEvent(locator, Event.CHANGE);
}
}
}
+
+ public static enum ApplyType {
+ SERVER, AJAX
+ }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -5,7 +5,7 @@
public class StatusFacets extends AbstractComponentAttributes {
public StatusFacets() {
- super(AbstractComponentAttributes.Type.AJAX);
+ super(AbstractComponentAttributes.ApplyType.AJAX);
}
public void setStartText(String startText) {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -34,13 +34,13 @@
* @version $Revision$
*/
public class TestFacets extends AbstracStatusTest {
+ StatusFacets facets = new StatusFacets();
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/a4jStatus/simple.xhtml");
}
- StatusFacets facets = new StatusFacets();
-
@BeforeMethod
public void installStatusExtensions() {
super.installStatusExtensions();
@@ -66,6 +66,8 @@
case ERROR:
facets.setErrorText(facets.getErrorText() + "*");
break;
+ default:
+ throw new IllegalStateException();
}
final String startText = facets.getStartText();
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -21,20 +21,13 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jStatus;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
import java.net.URL;
-import org.jboss.test.selenium.encapsulated.JavaScript;
-import org.jboss.test.selenium.locator.ElementLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import static org.jboss.test.selenium.utils.URLUtils.*;
-import static org.jboss.test.selenium.encapsulated.JavaScript.js;
-import static org.testng.Assert.*;
-
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java 2010-08-19 21:50:20 UTC (rev 18830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestTiming.java 2010-08-19 23:22:47 UTC (rev 18831)
@@ -36,16 +36,16 @@
* @version $Revision$
*/
public class TestTiming extends AbstractMetamerTest {
-
+
JQueryLocator button = jq("#jQueryTestButton");
-
+
+ RichJQueryAttributes attributes = new RichJQueryAttributes();
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richJQuery/simple.xhtml");
}
- RichJQueryAttributes attributes = new RichJQueryAttributes();
-
@Test
public void testImmediate() {
attributes.setTiming(JQueryTiming.immediate);
15 years, 9 months
JBoss Rich Faces SVN: r18830 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-08-19 17:50:20 -0400 (Thu, 19 Aug 2010)
New Revision: 18830
Removed:
branches/cdk-8570/
Log:
remove working branch after merging into trunk
15 years, 9 months
JBoss Rich Faces SVN: r18829 - in branches/RF-9112: parent and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 16:14:14 -0400 (Thu, 19 Aug 2010)
New Revision: 18829
Modified:
branches/RF-9112/examples/parent/pom.xml
branches/RF-9112/parent/pom.xml
branches/RF-9112/ui/common/pom.xml
branches/RF-9112/ui/core/pom.xml
branches/RF-9112/ui/dist/pom.xml
branches/RF-9112/ui/input/pom.xml
branches/RF-9112/ui/iteration/pom.xml
branches/RF-9112/ui/misc/pom.xml
branches/RF-9112/ui/output/pom.xml
branches/RF-9112/ui/parent/pom.xml
Log:
RF-9112 updates based on Nicks comments
Modified: branches/RF-9112/examples/parent/pom.xml
===================================================================
--- branches/RF-9112/examples/parent/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/examples/parent/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -135,8 +135,6 @@
</plugins>
</pluginManagement>
</build>
-
- `
<profiles>
<!--
The following profiles determine the JSF api/impl
Modified: branches/RF-9112/parent/pom.xml
===================================================================
--- branches/RF-9112/parent/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/parent/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -316,7 +316,7 @@
</dependencies>
</profile>
<profile>
- <id>jsf_ri_2_1_snapshot</id>
+ <id>jsf_ri_snapshot</id>
<activation>
<property>
<name>jsf_profile</name>
Modified: branches/RF-9112/ui/common/pom.xml
===================================================================
--- branches/RF-9112/ui/common/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/common/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -23,10 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.common</groupId>
Modified: branches/RF-9112/ui/core/pom.xml
===================================================================
--- branches/RF-9112/ui/core/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/core/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -23,12 +23,12 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
-
+
<groupId>org.richfaces.ui.core</groupId>
<artifactId>richfaces-ui-core-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
Modified: branches/RF-9112/ui/dist/pom.xml
===================================================================
--- branches/RF-9112/ui/dist/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/dist/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -20,10 +20,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui</groupId>
Modified: branches/RF-9112/ui/input/pom.xml
===================================================================
--- branches/RF-9112/ui/input/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/input/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -23,10 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.input</groupId>
Modified: branches/RF-9112/ui/iteration/pom.xml
===================================================================
--- branches/RF-9112/ui/iteration/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/iteration/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -23,10 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.iteration</groupId>
Modified: branches/RF-9112/ui/misc/pom.xml
===================================================================
--- branches/RF-9112/ui/misc/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/misc/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -25,10 +25,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.misc</groupId>
Modified: branches/RF-9112/ui/output/pom.xml
===================================================================
--- branches/RF-9112/ui/output/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/output/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -23,10 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.output</groupId>
Modified: branches/RF-9112/ui/parent/pom.xml
===================================================================
--- branches/RF-9112/ui/parent/pom.xml 2010-08-19 19:45:57 UTC (rev 18828)
+++ branches/RF-9112/ui/parent/pom.xml 2010-08-19 20:14:14 UTC (rev 18829)
@@ -54,12 +54,6 @@
<version>1.0-beta-2</version>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- <plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
<version>${project.version}</version>
15 years, 9 months
JBoss Rich Faces SVN: r18828 - in branches/RF-9112: cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 15:45:57 -0400 (Thu, 19 Aug 2010)
New Revision: 18828
Modified:
branches/RF-9112/
branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java
branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java
branches/RF-9112/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
branches/RF-9112/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
branches/RF-9112/ui/output/ui/src/test/resources/popupPanelTest.xhtml
Log:
Merged revisions 18823-18824,18826 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r18823 | amarkhel | 2010-08-19 13:08:16 -0400 (Thu, 19 Aug 2010) | 1 line
Refactor popup renderer and related to this refactoring fix couple of bugs
.......
r18824 | amarkhel | 2010-08-19 13:10:14 -0400 (Thu, 19 Aug 2010) | 1 line
RF-9102
.......
r18826 | nbelaevski | 2010-08-19 14:46:38 -0400 (Thu, 19 Aug 2010) | 4 lines
Maven resources plugin:
- fixed problems with setting up resources state
- changed level of warn messages for JavaScriptResourceProcessor to debug
.......
Property changes on: branches/RF-9112
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-18810 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
+ /trunk:1-18827 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
Modified: branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java
===================================================================
--- branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java 2010-08-19 19:45:57 UTC (rev 18828)
@@ -21,20 +21,14 @@
*/
package org.richfaces.cdk.resource.handler.impl;
-import java.io.IOException;
-
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
-import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
import org.richfaces.resource.ResourceFactory;
import org.richfaces.resource.ResourceFactoryImpl;
-import org.richfaces.resource.StateHolderResource;
+import org.richfaces.util.Util;
-import com.google.common.io.ByteArrayDataOutput;
-import com.google.common.io.ByteStreams;
-
/**
* @author Nick Belaevski
*
@@ -50,35 +44,27 @@
this.resourceFactory = new ResourceFactoryImpl(staticResourceHandler);
}
+ private void setupResourceState(Resource source, Resource target) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Object state = Util.saveResourceState(facesContext, source);
+ if (state != null) {
+ Util.restoreResourceState(facesContext, target, state);
+ }
+ }
+
@Override
public Resource createResource(String resourceName, String libraryName, String contentType) {
- Resource result = resourceFactory.createResource(resourceName, libraryName, null);
+ Resource result = resourceFactory.createResource(resourceName, libraryName, contentType);
if (result != null) {
- if (result instanceof StateHolderResource) {
- StateHolderResource stateHolderResource = (StateHolderResource) result;
- ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput();
- try {
- stateHolderResource.writeState(FacesContext.getCurrentInstance(), dataOutput);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- byte[] bs = dataOutput.toByteArray();
- //TODO use collected data
- } else if (result instanceof StateHolder) {
- StateHolder stateHolder = (StateHolder) result;
- if (!stateHolder.isTransient()) {
- Object savedData = stateHolder.saveState(FacesContext.getCurrentInstance());
- //TODO use collected data
- }
- }
-
+ Resource newResource = resourceFactory.createResource(resourceName, libraryName, contentType);
+ setupResourceState(newResource, result);
result = new DynamicResourceWrapper(result);
} else {
- result = staticResourceHandler.createResource(resourceName, libraryName);
+ result = staticResourceHandler.createResource(resourceName, libraryName, contentType);
}
return result;
}
+
}
Modified: branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java
===================================================================
--- branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java 2010-08-19 19:45:57 UTC (rev 18828)
@@ -57,7 +57,7 @@
}
if (reporter.hasWarnings()) {
- log.warn(reporter.getWarningsLog());
+ log.debug(reporter.getWarningsLog());
}
}
Modified: branches/RF-9112/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
===================================================================
--- branches/RF-9112/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-08-19 19:45:57 UTC (rev 18828)
@@ -82,7 +82,7 @@
@Attribute
public abstract String getFilterFunction();
- @Attribute(defaultValue = "rf-au-c")
+ @Attribute(defaultValue = "rf-au-s")
public abstract String getSelectedItemClass();
@Attribute
Modified: branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
--- branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-08-19 19:45:57 UTC (rev 18828)
@@ -129,7 +129,7 @@
};
var onMouseAction = function(event) {
- var element = $(event.target).closest(".rf-ac-i", event.currentTarget).get(0);
+ var element = $(event.target).closest(".rf-au-i", event.currentTarget).get(0);
if (element) {
if (event.type=="mouseover") {
@@ -146,7 +146,7 @@
};
var updateItemsList = function (value, fetchValues) {
- this.items = $(rf.getDomElement(this.id+ID.ITEMS)).find(".rf-ac-i");
+ this.items = $(rf.getDomElement(this.id+ID.ITEMS)).find(".rf-au-i");
if (this.items.length>0) {
this.cache = new rf.utils.Cache(value, this.items, fetchValues || getData);
}
@@ -343,7 +343,7 @@
var subValue = this.__getSubValue();
// called from onShow method, not actually value changed
if (this.items.length==0 && this.isFirstAjax) {
- this.options.ajaxMode && callAjax.call(this, event, subValue);
+ callAjax.call(this, event, subValue);
}
return;
},
Modified: branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-08-19 19:45:57 UTC (rev 18828)
@@ -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: branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-08-19 19:45:57 UTC (rev 18828)
@@ -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: branches/RF-9112/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
--- branches/RF-9112/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-08-19 19:45:57 UTC (rev 18828)
@@ -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: branches/RF-9112/ui/output/ui/src/test/resources/popupPanelTest.xhtml
===================================================================
--- branches/RF-9112/ui/output/ui/src/test/resources/popupPanelTest.xhtml 2010-08-19 19:33:16 UTC (rev 18827)
+++ branches/RF-9112/ui/output/ui/src/test/resources/popupPanelTest.xhtml 2010-08-19 19:45:57 UTC (rev 18828)
@@ -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: r18827 - in branches/RF-9112/examples: core-demo and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-19 15:33:16 -0400 (Thu, 19 Aug 2010)
New Revision: 18827
Added:
branches/RF-9112/examples/parent/
branches/RF-9112/examples/parent/pom.xml
Modified:
branches/RF-9112/examples/core-demo/pom.xml
branches/RF-9112/examples/input-demo/pom.xml
branches/RF-9112/examples/iteration-demo/pom.xml
branches/RF-9112/examples/misc-demo/pom.xml
branches/RF-9112/examples/output-demo/pom.xml
branches/RF-9112/examples/pom.xml
branches/RF-9112/examples/repeater-demo/pom.xml
branches/RF-9112/examples/richfaces-showcase/pom.xml
branches/RF-9112/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml
Log:
RF-9069,RF-9112 Created parent for examples
Modified: branches/RF-9112/examples/core-demo/pom.xml
===================================================================
--- branches/RF-9112/examples/core-demo/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/core-demo/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -24,9 +24,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
@@ -36,26 +37,10 @@
<name>RichFaces Examples: Core</name>
<properties>
- <!-- FIXME - these should be from the parent -->
- <snapshotRepository>dav:https://repository.jboss.org/nexus/content/repositories/snapshots/</snapshotRepository>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
- <jetty.port>8080</jetty.port>
- <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
- <org.richfaces.bom.version>4.0.0-SNAPSHOT</org.richfaces.bom.version>
</properties>
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${org.richfaces.bom.version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
-
<!--
simple logger binding: only messages of level INFO and
higher are printed
@@ -76,16 +61,7 @@
</dependencyManagement>
<dependencies>
- <!-- JSF impl should be switchable in example specific parent -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
@@ -134,18 +110,6 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <connectors>
- <connector
- implementation="org.mortbay.jetty.nio.SelectChannelConnector"
- >
- <port>${jetty.port}</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- </configuration>
</plugin>
</plugins>
</build>
@@ -254,18 +218,6 @@
</profile>
</profiles>
- <repositories>
- <!-- FIXME - should come from parent I believe -->
- <repository>
- <id>maven-repository2.dev.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/core-demo</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/core-demo</developerConnection>
Modified: branches/RF-9112/examples/input-demo/pom.xml
===================================================================
--- branches/RF-9112/examples/input-demo/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/input-demo/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -3,9 +3,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -16,37 +17,10 @@
<name>Richfaces Examples: Inputs</name>
<packaging>war</packaging>
- <url>http://jboss.org/richfaces</url>
-
- <repositories>
- <repository>
- <id>jboss-public-repository-group</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
- </repository>
- <repository>
- <id>java-net</id>
- <name>Java.net Maven Repository</name>
- <url>http://download.java.net/maven/2</url>
- </repository>
- </repositories>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <org.richfaces.ui.version>4.0.0-SNAPSHOT</org.richfaces.ui.version>
- </properties>
-
<build>
<finalName>${artifactId}-${project.version}</finalName>
<plugins>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
@@ -78,15 +52,15 @@
<dependencies>
<!-- JSF impl should be switchable in example specific parent -->
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
<dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ </dependency>
+ <dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
@@ -128,39 +102,18 @@
</build>
</profile>
</profiles>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
+
<dependencies>
<dependency>
- <groupId>org.richfaces.ui.input</groupId>
- <artifactId>richfaces-ui-input-ui</artifactId>
- </dependency>
+ <groupId>org.richfaces.ui.input</groupId>
+ <artifactId>richfaces-ui-input-ui</artifactId>
+ </dependency>
<dependency>
<groupId>org.richfaces.ui.core</groupId>
<artifactId>richfaces-ui-core-ui</artifactId>
</dependency>
- <!-- JSF impl should be switchable in example specific parent -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
@@ -194,7 +147,10 @@
<artifactId>ehcache</artifactId>
</dependency>
- <!-- simple logger binding: only messages of level INFO and higher are printed-->
+ <!--
+ simple logger binding: only messages of level INFO and
+ higher are printed
+ -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
Modified: branches/RF-9112/examples/iteration-demo/pom.xml
===================================================================
--- branches/RF-9112/examples/iteration-demo/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/iteration-demo/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -19,15 +19,15 @@
-->
<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"
->
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
@@ -37,23 +37,10 @@
<name>RichFaces Examples: Iteration</name>
<properties>
- <snapshotRepository>dav:https://repository.jboss.org/nexus/content/repositories/snapshots/</snapshotRepository>
- <jetty.port>8080</jetty.port>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${project.version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
-
<!--
simple logger binding: only messages of level INFO and
higher are printed
@@ -82,9 +69,9 @@
<groupId>org.richfaces.ui.iteration</groupId>
<artifactId>richfaces-ui-iteration-ui</artifactId>
</dependency>
- <dependency>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>richfaces-ui-misc-ui</artifactId>
+ <dependency>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-ui</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -109,16 +96,7 @@
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
- <!-- JSF -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
@@ -159,18 +137,6 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <connectors>
- <connector
- implementation="org.mortbay.jetty.nio.SelectChannelConnector"
- >
- <port>${jetty.port}</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- </configuration>
</plugin>
</plugins>
</build>
@@ -198,15 +164,4 @@
</dependencies>
</profile>
</profiles>
-
- <repositories>
- <repository>
- <id>maven-repository2.dev.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
</project>
Modified: branches/RF-9112/examples/misc-demo/pom.xml
===================================================================
--- branches/RF-9112/examples/misc-demo/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/misc-demo/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -25,9 +25,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
@@ -37,23 +38,10 @@
<name>RichFaces Examples: Miscellanous</name>
<properties>
- <snapshotRepository>dav:https://repository.jboss.org/nexus/content/repositories/snapshots/</snapshotRepository>
- <jetty.port>8080</jetty.port>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${project.version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
-
<!--
simple logger binding: only messages of level INFO and
higher are printed
@@ -87,16 +75,7 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
</dependency>
-
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
@@ -166,30 +145,7 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <connectors>
- <connector
- implementation="org.mortbay.jetty.nio.SelectChannelConnector"
- >
- <port>${jetty.port}</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- </configuration>
</plugin>
</plugins>
</build>
-
- <repositories>
- <repository>
- <id>maven-repository2.dev.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
</project>
Modified: branches/RF-9112/examples/output-demo/pom.xml
===================================================================
--- branches/RF-9112/examples/output-demo/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/output-demo/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -4,9 +4,10 @@
>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -17,36 +18,13 @@
<name>Richfaces Examples: Outputs</name>
<packaging>war</packaging>
- <url>http://jboss.org/richfaces</url>
-
- <repositories>
- <repository>
- <id>jboss-public-repository-group</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
- </repository>
- <repository>
- <id>java-net</id>
- <name>Java.net Maven Repository</name>
- <url>http://download.java.net/maven/2</url>
- </repository>
- </repositories>
-
<properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>${artifactId}-${project.version}</finalName>
<plugins>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
@@ -130,18 +108,6 @@
</profile>
</profiles>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${project.version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
<dependencies>
<dependency>
<groupId>org.richfaces.ui.output</groupId>
@@ -153,14 +119,6 @@
</dependency>
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
Added: branches/RF-9112/examples/parent/pom.xml
===================================================================
--- branches/RF-9112/examples/parent/pom.xml (rev 0)
+++ branches/RF-9112/examples/parent/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ 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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>10-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>RichFaces Examples Parent</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <jetty.port>8080</jetty.port>
+ <richfaces.checkstyle.version>2-SNAPSHOT</richfaces.checkstyle.version>
+ <org.richfaces.bom.version>4.0.0-SNAPSHOT</org.richfaces.bom.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-bom</artifactId>
+ <version>${org.richfaces.bom.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <!-- Build -->
+ <build>
+ <!--
+ PluginManagement config for all examples
+ -->
+ <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.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>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <connectors>
+ <connector
+ implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>${jetty.port}</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ `
+ <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>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ </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>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ </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>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ </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>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
Modified: branches/RF-9112/examples/pom.xml
===================================================================
--- branches/RF-9112/examples/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -38,6 +38,7 @@
<name>RichFaces Examples: Aggregator</name>
<modules>
+ <module>parent</module>
<module>core-demo</module>
<module>misc-demo</module>
<module>output-demo</module>
Modified: branches/RF-9112/examples/repeater-demo/pom.xml
===================================================================
--- branches/RF-9112/examples/repeater-demo/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/repeater-demo/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -26,9 +26,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
@@ -38,23 +39,10 @@
<name>Richfaces Examples: Repeater</name>
<properties>
- <snapshotRepository>dav:https://repository.jboss.org/nexus/content/repositories/snapshots/</snapshotRepository>
- <jetty.port>8080</jetty.port>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${project.version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
-
<!--
simple logger binding: only messages of level INFO and
higher are printed
@@ -76,14 +64,6 @@
<dependencies>
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
@@ -145,30 +125,7 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <connectors>
- <connector
- implementation="org.mortbay.jetty.nio.SelectChannelConnector"
- >
- <port>${jetty.port}</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- </configuration>
</plugin>
</plugins>
</build>
-
- <repositories>
- <repository>
- <id>maven-repository2.dev.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
</project>
Modified: branches/RF-9112/examples/richfaces-showcase/pom.xml
===================================================================
--- branches/RF-9112/examples/richfaces-showcase/pom.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/richfaces-showcase/pom.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -5,11 +5,12 @@
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-showcase</artifactId>
@@ -18,28 +19,8 @@
<name>Richfaces Examples: Richfaces Showcase Application</name>
<properties>
- <!-- FIXME these should be through the richfaces-parent -->
- <snapshotRepository>dav:https://repository.jboss.org/nexus/content/repositories/snapshots/</snapshotRepository>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
- <jetty.port>8080</jetty.port>
- <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
- <org.richfaces.bom.version>4.0.0-SNAPSHOT</org.richfaces.bom.version>
</properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${org.richfaces.bom.version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
<dependencies>
<dependency>
<groupId>org.richfaces.ui</groupId>
@@ -50,14 +31,6 @@
<artifactId>richfaces-components-ui</artifactId>
</dependency>
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
@@ -275,18 +248,6 @@
</profile>
</profiles>
- <repositories>
- <!-- FIXME - This should be set globally in parent -->
- <repository>
- <id>maven-repository2.dev.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces...</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/richfaces-sh...</developerConnection>
Modified: branches/RF-9112/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/RF-9112/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml 2010-08-19 18:46:38 UTC (rev 18826)
+++ branches/RF-9112/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml 2010-08-19 19:33:16 UTC (rev 18827)
@@ -23,9 +23,13 @@
</context-param>
<context-param>
<param-name>org.richfaces.skin</param-name>
+ <param-value>blueSky</param-value>
+ </context-param><!--
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
<param-value>#{skinBean.skin}</param-value>
</context-param>
- <context-param>
+ --><context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
15 years, 9 months
JBoss Rich Faces SVN: r18826 - in trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource: writer/impl and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-19 14:46:38 -0400 (Thu, 19 Aug 2010)
New Revision: 18826
Modified:
trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java
trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java
Log:
Maven resources plugin:
- fixed problems with setting up resources state
- changed level of warn messages for JavaScriptResourceProcessor to debug
Modified: trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java
===================================================================
--- trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java 2010-08-19 17:25:44 UTC (rev 18825)
+++ trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java 2010-08-19 18:46:38 UTC (rev 18826)
@@ -21,20 +21,14 @@
*/
package org.richfaces.cdk.resource.handler.impl;
-import java.io.IOException;
-
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
-import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
import org.richfaces.resource.ResourceFactory;
import org.richfaces.resource.ResourceFactoryImpl;
-import org.richfaces.resource.StateHolderResource;
+import org.richfaces.util.Util;
-import com.google.common.io.ByteArrayDataOutput;
-import com.google.common.io.ByteStreams;
-
/**
* @author Nick Belaevski
*
@@ -50,35 +44,27 @@
this.resourceFactory = new ResourceFactoryImpl(staticResourceHandler);
}
+ private void setupResourceState(Resource source, Resource target) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Object state = Util.saveResourceState(facesContext, source);
+ if (state != null) {
+ Util.restoreResourceState(facesContext, target, state);
+ }
+ }
+
@Override
public Resource createResource(String resourceName, String libraryName, String contentType) {
- Resource result = resourceFactory.createResource(resourceName, libraryName, null);
+ Resource result = resourceFactory.createResource(resourceName, libraryName, contentType);
if (result != null) {
- if (result instanceof StateHolderResource) {
- StateHolderResource stateHolderResource = (StateHolderResource) result;
- ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput();
- try {
- stateHolderResource.writeState(FacesContext.getCurrentInstance(), dataOutput);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- byte[] bs = dataOutput.toByteArray();
- //TODO use collected data
- } else if (result instanceof StateHolder) {
- StateHolder stateHolder = (StateHolder) result;
- if (!stateHolder.isTransient()) {
- Object savedData = stateHolder.saveState(FacesContext.getCurrentInstance());
- //TODO use collected data
- }
- }
-
+ Resource newResource = resourceFactory.createResource(resourceName, libraryName, contentType);
+ setupResourceState(newResource, result);
result = new DynamicResourceWrapper(result);
} else {
- result = staticResourceHandler.createResource(resourceName, libraryName);
+ result = staticResourceHandler.createResource(resourceName, libraryName, contentType);
}
return result;
}
+
}
Modified: trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java
===================================================================
--- trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java 2010-08-19 17:25:44 UTC (rev 18825)
+++ trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/writer/impl/JavaScriptResourceProcessor.java 2010-08-19 18:46:38 UTC (rev 18826)
@@ -57,7 +57,7 @@
}
if (reporter.hasWarnings()) {
- log.warn(reporter.getWarningsLog());
+ log.debug(reporter.getWarningsLog());
}
}
15 years, 9 months
JBoss Rich Faces SVN: r18825 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-08-19 13:25:44 -0400 (Thu, 19 Aug 2010)
New Revision: 18825
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js
Log:
a4j:status - added tests for testing live switching of facets (RFPL-735)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml 2010-08-19 17:10:14 UTC (rev 18824)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml 2010-08-19 17:25:44 UTC (rev 18825)
@@ -39,18 +39,18 @@
<ui:define name="outOfTemplateBefore">
<fieldset>
<legend>Facets Settings</legend>
- <h:panelGrid id="facetsSettings" columns="2">
- <h:outputText value="Facet Start: " />
- <h:inputText id="facetStartTextInput" value="#{a4jStatusBean.facetStartValue}" />
-
- <h:outputText value="Facet Stop: " />
- <h:inputText id="facetStopTextInput" value="#{a4jStatusBean.facetStopValue}" />
-
- <h:outputText value="Facet Error: " />
- <h:inputText id="facetErrorTextInput" value="#{a4jStatusBean.facetErrorValue}" />
-
- <a4j:commandButton id="apply" value="Apply instantly" render="status,facetGrid" execute="facetGrid" />
- </h:panelGrid>
+ <a4j:ajax event="change" render="status" execute="facetsSettings">
+ <h:panelGrid id="facetsSettings" columns="2">
+ <h:outputText value="Facet Start: " />
+ <h:inputText id="facetStartTextInput" value="#{a4jStatusBean.facetStartValue}" />
+
+ <h:outputText value="Facet Stop: " />
+ <h:inputText id="facetStopTextInput" value="#{a4jStatusBean.facetStopValue}" />
+
+ <h:outputText value="Facet Error: " />
+ <h:inputText id="facetErrorTextInput" value="#{a4jStatusBean.facetErrorValue}" />
+ </h:panelGrid>
+ </a4j:ajax>
</fieldset>
</ui:define>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 17:10:14 UTC (rev 18824)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-08-19 17:25:44 UTC (rev 18825)
@@ -30,6 +30,7 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
/**
@@ -58,6 +59,11 @@
JQueryLocator propertyLocator = pjq("input[id$={0}Input]");
+ protected String getProperty(String propertyName) {
+ final ElementLocator<?> locator = propertyLocator.format(propertyName);
+ return selenium.getValue(locator);
+ }
+
protected void setProperty(String propertyName, Object value) {
final ElementLocator<?> locator = propertyLocator.format(propertyName);
final AttributeLocator<?> typeLocator = locator.getAttribute(new org.jboss.test.selenium.locator.Attribute(
@@ -71,7 +77,7 @@
if (type == Type.SERVER) {
guardHttp(selenium).type(locator, valueAsString);
} else if (type == Type.AJAX) {
- selenium.type(locator, valueAsString);
+ guardXhr(selenium).type(locator, valueAsString);
}
// INPUT CHECKBOX
} else if ("checkbox".equals(inputType)) {
@@ -81,7 +87,7 @@
guardHttp(selenium).check(locator, checked);
} else if (type == Type.AJAX) {
selenium.check(locator, checked);
- selenium.fireEvent(locator, Event.CHANGE);
+ guardXhr(selenium).fireEvent(locator, Event.CHANGE);
}
}
}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java (from rev 18803, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java 2010-08-19 17:25:44 UTC (rev 18825)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jStatus;
+
+import static org.jboss.test.selenium.encapsulated.JavaScript.js;
+import static org.testng.Assert.assertEquals;
+
+import org.jboss.test.selenium.encapsulated.JavaScript;
+import org.jboss.test.selenium.locator.ElementLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public abstract class AbstracStatusTest extends AbstractMetamerTest {
+ JQueryLocator button1 = pjq("input[id$=button1]");
+ JQueryLocator button2 = pjq("input[id$=button2]");
+ JQueryLocator buttonError = pjq("input[id$=button3]");
+ JQueryLocator status = pjq("span[id$=status]");
+
+ StatusAttributes attributes = new StatusAttributes();
+
+ TextRetriever retrieveStatus = retrieveText.locator(status);
+
+ JavaScript extension = JavaScript.fromResource(getClass().getPackage().getName().replaceAll("\\.", "/")
+ + "/status-halt.js");
+
+ void installStatusExtensions() {
+ selenium.getPageExtensions().install();
+ selenium.runScript(extension);
+ }
+
+ void testRequestButton(ElementLocator<?> button, String startStatusText, String stopStatusText) {
+ enableHalt();
+ selenium.click(button);
+ waitForHalt();
+ assertEquals(retrieveStatus.retrieve(), startStatusText);
+ unhalt();
+ waitAjax.waitForChange(startStatusText, retrieveStatus);
+ assertEquals(retrieveStatus.retrieve(), stopStatusText);
+ disableHalt();
+ }
+
+ void waitForHalt() {
+ selenium.waitForCondition(js("selenium.browserbot.getCurrentWindow().Metamer.halt == true"));
+ }
+
+ void unhalt() {
+ selenium.getEval(js("selenium.browserbot.getCurrentWindow().Metamer.halt = false"));
+ }
+
+ void enableHalt() {
+ selenium.getEval(js("selenium.browserbot.getCurrentWindow().Metamer.haltEnabled = true"));
+ }
+
+ void disableHalt() {
+ selenium.getEval(js("selenium.browserbot.getCurrentWindow().Metamer.haltEnabled = false"));
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 17:10:14 UTC (rev 18824)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java 2010-08-19 17:25:44 UTC (rev 18825)
@@ -4,15 +4,31 @@
public class StatusFacets extends AbstractComponentAttributes {
+ public StatusFacets() {
+ super(AbstractComponentAttributes.Type.AJAX);
+ }
+
public void setStartText(String startText) {
setProperty("facetStartText", startText);
}
+ public String getStartText() {
+ return getProperty("facetStartText");
+ }
+
public void setStopText(String stopText) {
setProperty("facetStopText", stopText);
}
+ public String getStopText() {
+ return getProperty("facetStopText");
+ }
+
public void setErrorText(String errorText) {
setProperty("facetErrorText", errorText);
}
+
+ public String getErrorText() {
+ return getProperty("facetErrorText");
+ }
}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java 2010-08-19 17:25:44 UTC (rev 18825)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.a4jStatus;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.ElementLocator;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestFacets extends AbstracStatusTest {
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jStatus/simple.xhtml");
+ }
+
+ StatusFacets facets = new StatusFacets();
+
+ @BeforeMethod
+ public void installStatusExtensions() {
+ super.installStatusExtensions();
+ }
+
+ @Test
+ public void testInterleavedChangingOfFacets() {
+ for (int i = 0; i < 13; i++) {
+ ElementLocator<?> button = (i % 2 == 0) ? button2 : buttonError;
+ IterateStatus iterateStatus = IterateStatus.values()[i % IterateStatus.values().length];
+ testChangingFacet(button, iterateStatus);
+ }
+ }
+
+ void testChangingFacet(ElementLocator<?> button, IterateStatus iterateStatus) {
+ switch (iterateStatus) {
+ case START:
+ facets.setStartText(facets.getStartText() + "*");
+ break;
+ case STOP:
+ facets.setStopText(facets.getStopText() + "*");
+ break;
+ case ERROR:
+ facets.setErrorText(facets.getErrorText() + "*");
+ break;
+ }
+
+ final String startText = facets.getStartText();
+ final String stopText = (button == buttonError) ? facets.getErrorText() : facets.getStopText();
+
+ testRequestButton(button, startText, stopText);
+ }
+
+ private static enum IterateStatus {
+ START, STOP, ERROR
+ }
+}
\ No newline at end of file
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java 2010-08-19 17:10:14 UTC (rev 18824)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java 2010-08-19 17:25:44 UTC (rev 18825)
@@ -39,28 +39,15 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class TestSimple extends AbstractMetamerTest {
+public class TestSimple extends AbstracStatusTest {
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/a4jStatus/simple.xhtml");
}
- StatusAttributes attributes = new StatusAttributes();
-
- JQueryLocator button1 = pjq("input[id$=button1]");
- JQueryLocator button2 = pjq("input[id$=button2]");
- JQueryLocator buttonError = pjq("input[id$=button3]");
- JQueryLocator status = pjq("span[id$=status]");
-
- TextRetriever retrieveStatus = retrieveText.locator(status);
-
- JavaScript extension = JavaScript.fromResource(getClass().getPackage().getName().replaceAll("\\.", "/")
- + "/status-halt.js");
-
@BeforeMethod
- public void installExtensions() {
- selenium.getPageExtensions().install();
- selenium.runScript(extension);
+ public void installStatusExtensions() {
+ super.installStatusExtensions();
}
@Test
@@ -86,21 +73,4 @@
testRequestButtonError();
testRequestButton1();
}
-
- private void testRequestButton(ElementLocator<?> button, String startText, String stopText) {
- selenium.click(button);
- waitForHalt();
- assertEquals(retrieveStatus.retrieve(), startText);
- unhalt();
- waitAjax.waitForChange(startText, retrieveStatus);
- assertEquals(retrieveStatus.retrieve(), stopText);
- }
-
- private void waitForHalt() {
- selenium.waitForCondition(js("selenium.browserbot.getCurrentWindow().Metamer.halt == true"));
- }
-
- private void unhalt() {
- selenium.getEval(js("selenium.browserbot.getCurrentWindow().Metamer.halt = false"));
- }
}
\ No newline at end of file
Modified: modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js 2010-08-19 17:10:14 UTC (rev 18824)
+++ modules/tests/metamer/trunk/ftest-source/src/main/resources/org/richfaces/tests/metamer/ftest/a4jStatus/status-halt.js 2010-08-19 17:25:44 UTC (rev 18825)
@@ -20,12 +20,13 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
var Metamer = {
+ haltEnabled : false,
halt : false,
callback : null,
object : null,
content : null,
wait : function() {
- if (Metamer.halt) {
+ if (Metamer.haltEnabled && Metamer.halt) {
setTimeout("Metamer.wait()", 100);
} else {
Metamer.halt = false;
15 years, 9 months
JBoss Rich Faces SVN: r18824 - in trunk/ui/input/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-08-19 13:10:14 -0400 (Thu, 19 Aug 2010)
New Revision: 18824
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
Log:
RF-9102
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-08-19 17:08:16 UTC (rev 18823)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-08-19 17:10:14 UTC (rev 18824)
@@ -82,7 +82,7 @@
@Attribute
public abstract String getFilterFunction();
- @Attribute(defaultValue = "rf-au-c")
+ @Attribute(defaultValue = "rf-au-s")
public abstract String getSelectedItemClass();
@Attribute
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-08-19 17:08:16 UTC (rev 18823)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-08-19 17:10:14 UTC (rev 18824)
@@ -129,7 +129,7 @@
};
var onMouseAction = function(event) {
- var element = $(event.target).closest(".rf-ac-i", event.currentTarget).get(0);
+ var element = $(event.target).closest(".rf-au-i", event.currentTarget).get(0);
if (element) {
if (event.type=="mouseover") {
@@ -146,7 +146,7 @@
};
var updateItemsList = function (value, fetchValues) {
- this.items = $(rf.getDomElement(this.id+ID.ITEMS)).find(".rf-ac-i");
+ this.items = $(rf.getDomElement(this.id+ID.ITEMS)).find(".rf-au-i");
if (this.items.length>0) {
this.cache = new rf.utils.Cache(value, this.items, fetchValues || getData);
}
@@ -343,7 +343,7 @@
var subValue = this.__getSubValue();
// called from onShow method, not actually value changed
if (this.items.length==0 && this.isFirstAjax) {
- this.options.ajaxMode && callAjax.call(this, event, subValue);
+ callAjax.call(this, event, subValue);
}
return;
},
15 years, 9 months