JBoss Rich Faces SVN: r11250 - in trunk/ui/core/src/test: resources/org/ajax4jsf/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-19 12:45:32 -0500 (Wed, 19 Nov 2008)
New Revision: 11250
Added:
trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueSizeTest.java
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-disabled.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-discovery-base.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-both.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-form.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-view.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-implicit-global.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-legacy.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-size.xhtml
Removed:
trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml
Modified:
trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java
Log:
Queue test resources refactored
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java 2008-11-19 17:45:32 UTC (rev 11250)
@@ -39,7 +39,7 @@
}
protected void checkForm(String formName) throws Exception {
- renderView("/ajax-form.xhtml");
+ renderView("/queue-ajax-form.xhtml");
executeJavaScript("$('" + formName + ":link').click()");
executeTimer();
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java 2008-11-19 17:45:32 UTC (rev 11250)
@@ -61,7 +61,7 @@
}
public void testLegacyQueuesRequestDelay() throws Exception {
- renderView("/legacy.xhtml");
+ renderView("/queue-legacy.xhtml");
executeAfterDelay("$('form:buttonDelayed').click()");
delay(500);
@@ -81,7 +81,7 @@
}
public void testLegacyQueuesIgnoreDupResponces() throws Exception {
- renderView("/legacy.xhtml");
+ renderView("/queue-legacy.xhtml");
executeAfterDelay("$('form:buttonIgnoreDupResponces').click()");
delay(500);
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java 2008-11-19 17:45:32 UTC (rev 11250)
@@ -67,7 +67,7 @@
}
public void testGlobalViewQueue() throws Exception {
- renderView("/global-view.xhtml");
+ renderView("/queue-global-view.xhtml");
List<String> list = new ArrayList<String>();
assertListsEqual(list, getResults(page));
@@ -95,7 +95,7 @@
}
public void testGlobalFormQueue() throws Exception {
- renderView("/global-form.xhtml");
+ renderView("/queue-global-form.xhtml");
List<String> list = new ArrayList<String>();
assertListsEqual(list, getResults(page));
@@ -136,7 +136,7 @@
}
public void testGlobalFormBoth() throws Exception {
- renderView("/global-both.xhtml");
+ renderView("/queue-global-both.xhtml");
List<String> list = new ArrayList<String>();
assertListsEqual(list, getResults(page));
@@ -175,7 +175,7 @@
}
public void testDisabled() throws Exception {
- renderView("/disabled.xhtml");
+ renderView("/queue-disabled.xhtml");
List<String> list = new ArrayList<String>();
assertListsEqual(list, getResults(page));
Added: trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueSizeTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueSizeTest.java (rev 0)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueSizeTest.java 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public class QueueSizeTest extends AbstractQueueComponentTest {
+
+ public QueueSizeTest(String name) {
+ super(name);
+ }
+
+
+
+}
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,46 +0,0 @@
-<html
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
- <head>
- <title>a4j:form check page</title>
- </head>
- <body>
- <f:view>
- <script type="text/javascript">
- function $(name) {
- return document.getElementById(name);
- }
-
- window.testResults = {};
- </script>
-
- <a4j:status startText="...running..." startStyle="color: green" />
-
- <a4j:queue oncomplete="window.testResults.viewDefault = true"/>
-
- <a4j:form ajaxSubmit="true" id="viewDefault">
- <h:commandButton value="view default queue" id="link" />
- </a4j:form>
-
- <a4j:queue oncomplete="window.testResults.viewNamed = true" name="viewNamed" />
-
- <a4j:form ajaxSubmit="true" eventsQueue="viewNamed" id="viewNamed">
- <h:commandButton value="view named queue" id="link" />
- </a4j:form>
-
- <a4j:form ajaxSubmit="true" id="formDefault">
- <a4j:queue oncomplete="window.testResults.formDefault = true" />
-
- <h:commandButton value="form default queue" id="link" />
- </a4j:form>
-
- <a4j:form ajaxSubmit="true" eventsQueue="formQueue" id="formNamed">
- <a4j:queue oncomplete="window.testResults.formNamed = true" name="formQueue" />
-
- <h:commandButton value="form named queue" id="link" />
- </a4j:form>
- </f:view>
- </body>
-</html>
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,59 +0,0 @@
-<html
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
- <body>
- <f:view>
- <ui:include src="discovery-base.xhtml" />
-
- <h:form id="form">
- <a4j:commandButton id="button" oncomplete="addResult('button')">
- <f:param name="data" value="button" />
- </a4j:commandButton>
- <a4j:commandButton id="formQueueButton" oncomplete="addResult('formQueueButton')" eventsQueue="form">
- <f:param name="data" value="formQueueButton" />
- </a4j:commandButton>
-
- <a4j:queue oncomplete="addResult('disabled')" disabled="true" />
- <a4j:queue oncomplete="addResult('disabledForm')" name="form" disabled="true" />
- </h:form>
-
- <h:form id="form2">
- <a4j:commandButton id="button2" oncomplete="addResult('button2')">
- <f:param name="data" value="button2" />
- </a4j:commandButton>
- <a4j:commandButton id="formQueueButton2" oncomplete="addResult('formQueueButton2')" eventsQueue="form2">
- <f:param name="data" value="formQueueButton2" />
- </a4j:commandButton>
-
- <a4j:queue oncomplete="addResult('disabledA')" disabled="true" />
- <a4j:queue oncomplete="addResult('form2-global:' + request.options.parameters.data)" />
- <a4j:queue oncomplete="addResult('disabledB')" disabled="true" />
-
- <a4j:queue oncomplete="addResult('disabledA1')" disabled="true" name="form2" />
- <a4j:queue oncomplete="addResult('form2-queue:' + request.options.parameters.data)" name="form2"/>
- <a4j:queue oncomplete="addResult('disabledB1')" disabled="true" name="form2" />
- </h:form>
-
- <h:form id="form3">
- <a4j:commandButton id="global" oncomplete="addResult('global')">
- <f:param name="data" value="global" />
- </a4j:commandButton>
- <a4j:commandButton id="globalNamed" oncomplete="addResult('globalNamed')" eventsQueue="viewNamed">
- <f:param name="data" value="globalNamed" />
- </a4j:commandButton>
- <a4j:commandButton id="globalNamedX" oncomplete="addResult('globalNamedX')" eventsQueue="viewNamedX">
- <f:param name="data" value="globalNamedX" />
- </a4j:commandButton>
- </h:form>
-
- <a4j:queue oncomplete="addResult('disabled:' + request.options.parameters.data)" disabled="true" />
- <a4j:queue oncomplete="addResult('viewNamed:' + request.options.parameters.data)" name="viewNamed" disabled="true" />
-
- <a4j:queue oncomplete="addResult('viewNamedXA:' + request.options.parameters.data)" name="viewNamedX" disabled="true" />
- <a4j:queue oncomplete="addResult('viewNamedX:' + request.options.parameters.data)" name="viewNamedX" />
- <a4j:queue oncomplete="addResult('viewNamedXB:' + request.options.parameters.data)" name="viewNamedX" disabled="true" />
- </f:view>
- </body>
-</html>
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,22 +0,0 @@
-<ui:composition xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
-
- <script type="text/javascript">
- function $(id) {
- return document.getElementById(id);
- }
-
- window.testResult = new Array();
-
- function addResult(value) {
- window.testResult.push(value);
- }
-
- function stub() {
- }
- </script>
-
- <a4j:status startText="...running..." startStyle="color: green" />
-</ui:composition>
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,65 +0,0 @@
-<html
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
- <body>
- <f:view>
- <ui:include src="discovery-base.xhtml" />
-
- <a4j:queue oncomplete="addResult(request.options.parameters.data)"/>
-
- <h:form id="form">
- <a4j:queue oncomplete="addResult('buttonFormQueue')"/>
-
- <a4j:commandButton id="button" oncomplete="stub()">
- <f:param name="data" value="button" />
- </a4j:commandButton>
-
- <a4j:commandButton id="viewQueueButton" oncomplete="stub()" eventsQueue="viewQueue">
- <f:param name="data" value="viewQueueButton" />
- </a4j:commandButton>
-
- <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
- eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
- <f:param name="data" value="implicitDelayedQueue" />
- </a4j:commandButton>
- </h:form>
-
- <h:form id="form2">
- <a4j:commandButton id="formQueueButton" eventsQueue="formQueue" requestDelay="1000" oncomplete="stub()">
- <f:param name="data" value="formQueueButton" />
- </a4j:commandButton>
-
- <a4j:queue oncomplete="addResult('formQueue:' + request.options.parameters.data)" name="formQueue"/>
-
- <a4j:commandButton id="button" requestDelay="1000" oncomplete="stub()">
- <f:param name="data" value="form2Button" />
- </a4j:commandButton>
-
- <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
- <f:param name="data" value="implicitQueue" />
- </a4j:commandButton>
- </h:form>
-
- <h:form id="form3">
-
- <a4j:commandButton id="button">
- <f:param name="data" value="form3Button" />
- </a4j:commandButton>
-
- <a4j:commandButton id="anotherImplicitQueue" ignoreDupResponses="true" eventsQueue="anotherImplicitQueue" oncomplete="addResult('anotherImplicitQueue')">
- <f:param name="data" value="anotherImplicitQueue" />
- </a4j:commandButton>
- </h:form>
-
- <h:form>
- <a4j:queue oncomplete="addResult('functionFormQueue')"/>
-
- <a4j:jsFunction name="ajaxFunction" />
- </h:form>
-
- <a4j:queue oncomplete="addResult('viewQueue:' + request.options.parameters.data)" name="viewQueue"/>
- </f:view>
- </body>
-</html>
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,53 +0,0 @@
-<html
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
- <body>
- <f:view>
- <ui:include src="discovery-base.xhtml" />
-
- <h:form id="form">
- <a4j:queue oncomplete="addResult('alt1:' + request.options.parameters.data)" name="alternativeQueue1" />
- <a4j:queue oncomplete="addResult('buttonFormQueue')"/>
-
- <a4j:commandButton id="button" oncomplete="stub()">
- <f:param name="data" value="button" />
- </a4j:commandButton>
-
- <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
- <f:param name="data" value="implicitQueue" />
- </a4j:commandButton>
-
- <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
- <f:param name="data" value="alternativeQueueButton" />
- </a4j:commandButton>
-
- <a4j:commandButton id="alternativeQueue1Button" eventsQueue="alternativeQueue1" oncomplete="addResult('alternativeQueue1Button')">
- <f:param name="data" value="alternativeQueue1Button" />
- </a4j:commandButton>
-
- </h:form>
-
- <h:form>
- <a4j:jsFunction name="ajaxFunction" oncomplete="addResult('ajaxFunction')"/>
- </h:form>
-
-
- <h:form id="form2">
- <a4j:commandButton id="button" requestDelay="1000" oncomplete="stub()" />
- <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
- eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
- <f:param name="data" value="implicitDelayedQueue" />
- </a4j:commandButton>
-
- <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
- <f:param name="data" value="alternativeQueueButton" />
- </a4j:commandButton>
-
- <a4j:queue oncomplete="addResult('buttonForm2Queue')"/>
- <a4j:queue oncomplete="addResult('alt:' + request.options.parameters.data)" name="alternativeQueue" />
- </h:form>
- </f:view>
- </body>
-</html>
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,40 +0,0 @@
-<html
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
- <body>
- <f:view>
- <ui:include src="discovery-base.xhtml" />
-
- <h:form id="form">
- <a4j:commandButton id="button" oncomplete="stub()" requestDelay="100">
- <f:param name="data" value="button" />
- </a4j:commandButton>
-
- <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
- <f:param name="data" value="alternativeQueueButton" />
- </a4j:commandButton>
-
- <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
- <f:param name="data" value="implicitQueue" />
- </a4j:commandButton>
- </h:form>
-
- <h:form id="form2">
- <a4j:jsFunction name="ajaxFunction" oncomplete="stub()">
- <f:param name="data" value="function" />
- </a4j:jsFunction>
-
- <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
- eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
- <f:param name="data" value="implicitDelayedQueue" />
- </a4j:commandButton>
- </h:form>
-
- <a4j:queue oncomplete="addResult(request.options.parameters.data)"/>
- <a4j:queue oncomplete="addResult('alt:' + request.options.parameters.data)" name="alternativeQueue" />
-
- </f:view>
- </body>
-</html>
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,10 +0,0 @@
-<html
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
- <body>
- <f:view>
- </f:view>
- </body>
-</html>
Deleted: trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml 2008-11-19 17:07:07 UTC (rev 11249)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -1,24 +0,0 @@
-<html
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
- <body>
- <f:view>
- <script type="text/javascript">
- XMLHttpRequest.defaultRequestTime = 5000;
-
- function $(id) {
- return document.getElementById(id);
- }
-
- var counter = 0;
- var time = 0;
- </script>
- <h:form id="form">
- <a4j:commandButton id="buttonDelayed" requestDelay="1000" />
- <a4j:commandButton id="buttonIgnoreDupResponces" ignoreDupResponses="true" oncomplete="counter++;time = Timer.currentTime;"/>
- </h:form>
- </f:view>
- </body>
-</html>
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,46 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <head>
+ <title>a4j:form check page</title>
+ </head>
+ <body>
+ <f:view>
+ <script type="text/javascript">
+ function $(name) {
+ return document.getElementById(name);
+ }
+
+ window.testResults = {};
+ </script>
+
+ <a4j:status startText="...running..." startStyle="color: green" />
+
+ <a4j:queue oncomplete="window.testResults.viewDefault = true"/>
+
+ <a4j:form ajaxSubmit="true" id="viewDefault">
+ <h:commandButton value="view default queue" id="link" />
+ </a4j:form>
+
+ <a4j:queue oncomplete="window.testResults.viewNamed = true" name="viewNamed" />
+
+ <a4j:form ajaxSubmit="true" eventsQueue="viewNamed" id="viewNamed">
+ <h:commandButton value="view named queue" id="link" />
+ </a4j:form>
+
+ <a4j:form ajaxSubmit="true" id="formDefault">
+ <a4j:queue oncomplete="window.testResults.formDefault = true" />
+
+ <h:commandButton value="form default queue" id="link" />
+ </a4j:form>
+
+ <a4j:form ajaxSubmit="true" eventsQueue="formQueue" id="formNamed">
+ <a4j:queue oncomplete="window.testResults.formNamed = true" name="formQueue" />
+
+ <h:commandButton value="form named queue" id="link" />
+ </a4j:form>
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-disabled.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-disabled.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-disabled.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,59 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="queue-discovery-base.xhtml" />
+
+ <h:form id="form">
+ <a4j:commandButton id="button" oncomplete="addResult('button')">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+ <a4j:commandButton id="formQueueButton" oncomplete="addResult('formQueueButton')" eventsQueue="form">
+ <f:param name="data" value="formQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('disabled')" disabled="true" />
+ <a4j:queue oncomplete="addResult('disabledForm')" name="form" disabled="true" />
+ </h:form>
+
+ <h:form id="form2">
+ <a4j:commandButton id="button2" oncomplete="addResult('button2')">
+ <f:param name="data" value="button2" />
+ </a4j:commandButton>
+ <a4j:commandButton id="formQueueButton2" oncomplete="addResult('formQueueButton2')" eventsQueue="form2">
+ <f:param name="data" value="formQueueButton2" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('disabledA')" disabled="true" />
+ <a4j:queue oncomplete="addResult('form2-global:' + request.options.parameters.data)" />
+ <a4j:queue oncomplete="addResult('disabledB')" disabled="true" />
+
+ <a4j:queue oncomplete="addResult('disabledA1')" disabled="true" name="form2" />
+ <a4j:queue oncomplete="addResult('form2-queue:' + request.options.parameters.data)" name="form2"/>
+ <a4j:queue oncomplete="addResult('disabledB1')" disabled="true" name="form2" />
+ </h:form>
+
+ <h:form id="form3">
+ <a4j:commandButton id="global" oncomplete="addResult('global')">
+ <f:param name="data" value="global" />
+ </a4j:commandButton>
+ <a4j:commandButton id="globalNamed" oncomplete="addResult('globalNamed')" eventsQueue="viewNamed">
+ <f:param name="data" value="globalNamed" />
+ </a4j:commandButton>
+ <a4j:commandButton id="globalNamedX" oncomplete="addResult('globalNamedX')" eventsQueue="viewNamedX">
+ <f:param name="data" value="globalNamedX" />
+ </a4j:commandButton>
+ </h:form>
+
+ <a4j:queue oncomplete="addResult('disabled:' + request.options.parameters.data)" disabled="true" />
+ <a4j:queue oncomplete="addResult('viewNamed:' + request.options.parameters.data)" name="viewNamed" disabled="true" />
+
+ <a4j:queue oncomplete="addResult('viewNamedXA:' + request.options.parameters.data)" name="viewNamedX" disabled="true" />
+ <a4j:queue oncomplete="addResult('viewNamedX:' + request.options.parameters.data)" name="viewNamedX" />
+ <a4j:queue oncomplete="addResult('viewNamedXB:' + request.options.parameters.data)" name="viewNamedX" disabled="true" />
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-disabled.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-discovery-base.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-discovery-base.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-discovery-base.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,22 @@
+<ui:composition xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+ <script type="text/javascript">
+ function $(id) {
+ return document.getElementById(id);
+ }
+
+ window.testResult = new Array();
+
+ function addResult(value) {
+ window.testResult.push(value);
+ }
+
+ function stub() {
+ }
+ </script>
+
+ <a4j:status startText="...running..." startStyle="color: green" />
+</ui:composition>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-discovery-base.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-both.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-both.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-both.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,65 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="queue-discovery-base.xhtml" />
+
+ <a4j:queue oncomplete="addResult(request.options.parameters.data)"/>
+
+ <h:form id="form">
+ <a4j:queue oncomplete="addResult('buttonFormQueue')"/>
+
+ <a4j:commandButton id="button" oncomplete="stub()">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="viewQueueButton" oncomplete="stub()" eventsQueue="viewQueue">
+ <f:param name="data" value="viewQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
+ eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
+ <f:param name="data" value="implicitDelayedQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form id="form2">
+ <a4j:commandButton id="formQueueButton" eventsQueue="formQueue" requestDelay="1000" oncomplete="stub()">
+ <f:param name="data" value="formQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('formQueue:' + request.options.parameters.data)" name="formQueue"/>
+
+ <a4j:commandButton id="button" requestDelay="1000" oncomplete="stub()">
+ <f:param name="data" value="form2Button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
+ <f:param name="data" value="implicitQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form id="form3">
+
+ <a4j:commandButton id="button">
+ <f:param name="data" value="form3Button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="anotherImplicitQueue" ignoreDupResponses="true" eventsQueue="anotherImplicitQueue" oncomplete="addResult('anotherImplicitQueue')">
+ <f:param name="data" value="anotherImplicitQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form>
+ <a4j:queue oncomplete="addResult('functionFormQueue')"/>
+
+ <a4j:jsFunction name="ajaxFunction" />
+ </h:form>
+
+ <a4j:queue oncomplete="addResult('viewQueue:' + request.options.parameters.data)" name="viewQueue"/>
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-both.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-form.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-form.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-form.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,53 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="queue-discovery-base.xhtml" />
+
+ <h:form id="form">
+ <a4j:queue oncomplete="addResult('alt1:' + request.options.parameters.data)" name="alternativeQueue1" />
+ <a4j:queue oncomplete="addResult('buttonFormQueue')"/>
+
+ <a4j:commandButton id="button" oncomplete="stub()">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
+ <f:param name="data" value="implicitQueue" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
+ <f:param name="data" value="alternativeQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueue1Button" eventsQueue="alternativeQueue1" oncomplete="addResult('alternativeQueue1Button')">
+ <f:param name="data" value="alternativeQueue1Button" />
+ </a4j:commandButton>
+
+ </h:form>
+
+ <h:form>
+ <a4j:jsFunction name="ajaxFunction" oncomplete="addResult('ajaxFunction')"/>
+ </h:form>
+
+
+ <h:form id="form2">
+ <a4j:commandButton id="button" requestDelay="1000" oncomplete="stub()" />
+ <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
+ eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
+ <f:param name="data" value="implicitDelayedQueue" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
+ <f:param name="data" value="alternativeQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('buttonForm2Queue')"/>
+ <a4j:queue oncomplete="addResult('alt:' + request.options.parameters.data)" name="alternativeQueue" />
+ </h:form>
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-form.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-view.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-view.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-view.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,40 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="queue-discovery-base.xhtml" />
+
+ <h:form id="form">
+ <a4j:commandButton id="button" oncomplete="stub()" requestDelay="100">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
+ <f:param name="data" value="alternativeQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
+ <f:param name="data" value="implicitQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form id="form2">
+ <a4j:jsFunction name="ajaxFunction" oncomplete="stub()">
+ <f:param name="data" value="function" />
+ </a4j:jsFunction>
+
+ <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
+ eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
+ <f:param name="data" value="implicitDelayedQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <a4j:queue oncomplete="addResult(request.options.parameters.data)"/>
+ <a4j:queue oncomplete="addResult('alt:' + request.options.parameters.data)" name="alternativeQueue" />
+
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-global-view.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-implicit-global.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-implicit-global.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-implicit-global.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,10 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-implicit-global.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-legacy.xhtml (from rev 11246, trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml)
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-legacy.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-legacy.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,24 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <script type="text/javascript">
+ XMLHttpRequest.defaultRequestTime = 5000;
+
+ function $(id) {
+ return document.getElementById(id);
+ }
+
+ var counter = 0;
+ var time = 0;
+ </script>
+ <h:form id="form">
+ <a4j:commandButton id="buttonDelayed" requestDelay="1000" />
+ <a4j:commandButton id="buttonIgnoreDupResponces" ignoreDupResponses="true" oncomplete="counter++;time = Timer.currentTime;"/>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-legacy.xhtml
___________________________________________________________________
Name: svn:mergeinfo
+
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-size.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-size.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/queue-size.xhtml 2008-11-19 17:45:32 UTC (rev 11250)
@@ -0,0 +1,11 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <a4j:queue name="defaultSizeQueue" />
+ </f:view>
+ </body>
+</html>
17 years, 8 months
JBoss Rich Faces SVN: r11248 - in trunk/samples: queue-sample and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-19 12:06:16 -0500 (Wed, 19 Nov 2008)
New Revision: 11248
Added:
trunk/samples/queue-sample/
Modified:
trunk/samples/pom.xml
trunk/samples/queue-sample/pom.xml
trunk/samples/queue-sample/src/main/webapp/pages/events.xhtml
trunk/samples/queue-sample/src/main/webapp/pages/form-queue.xhtml
trunk/samples/queue-sample/src/main/webapp/pages/index.xhtml
trunk/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml
trunk/samples/queue-sample/src/main/webapp/pages/view-queue.xhtml
trunk/samples/queue-sample/src/main/webapp/templates/index.xhtml
trunk/samples/queue-sample/src/main/webapp/templates/navigation.xhtml
Log:
Queue moved to ui.core
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2008-11-19 16:55:55 UTC (rev 11247)
+++ trunk/samples/pom.xml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -483,6 +483,7 @@
<module>beanValidatorSample</module>
<module>state-sample</module>
<module>extendedDataTable-sample</module>
+ <module>queue-sample</module>
</modules>
</profile>
</profiles>
Copied: trunk/samples/queue-sample (from rev 11239, trunk/sandbox/samples/queue-sample)
Property changes on: trunk/samples/queue-sample
___________________________________________________________________
Name: svn:ignore
+ .project
.settings
.classpath
target
Name: svn:mergeinfo
+
Modified: trunk/samples/queue-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/queue-sample/pom.xml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/pom.xml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -1,7 +1,7 @@
<?xml version="1.0"?><project>
<parent>
<artifactId>samples</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces</groupId>
<version>3.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -23,11 +23,6 @@
</plugins>
</build>
<dependencies>
- <dependency>
- <groupId>org.richfaces.sandbox.ui</groupId>
- <artifactId>queue</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>core</artifactId>
Modified: trunk/samples/queue-sample/src/main/webapp/pages/events.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/pages/events.xhtml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/src/main/webapp/pages/events.xhtml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -2,8 +2,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:q="http://labs.jboss.com/jbossrichfaces/ui/ui/queue">
+ xmlns:a4j="http://richfaces.org/a4j">
<head>
<title>Events check page</title>
</head>
@@ -80,7 +79,7 @@
handlers["component:" + handlerName] = Function.constructor.apply(this, [args, argCheck + "my$('" + handlerName + "Elt').innerHTML += 'C'"]);
}
//]]></script>
- <q:queue name="queue" onsubmit="handlers['queue:onsubmit'](request)" onerror="handlers['queue:onerror'](request, status, message)"
+ <a4j:queue name="queue" onsubmit="handlers['queue:onsubmit'](request)" onerror="handlers['queue:onerror'](request, status, message)"
oncomplete="handlers['queue:oncomplete'](request, event, data)" onbeforedomupdate="handlers['queue:onbeforedomupdate'](request, event, data)" />
<h:form>
Modified: trunk/samples/queue-sample/src/main/webapp/pages/form-queue.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/pages/form-queue.xhtml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/src/main/webapp/pages/form-queue.xhtml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -2,8 +2,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:q="http://labs.jboss.com/jbossrichfaces/ui/ui/queue">
+ xmlns:a4j="http://richfaces.org/a4j">
<head>
<title></title>
<script type="text/javascript">
@@ -31,7 +30,7 @@
</ui:define>
<ui:define name="formQueue">
- <q:queue requestDelay="#{bean.queueRequestDelay}" />
+ <a4j:queue requestDelay="#{bean.queueRequestDelay}" />
</ui:define>
<ui:define name="title">Global form queue</ui:define>
Modified: trunk/samples/queue-sample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.xhtml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/src/main/webapp/pages/index.xhtml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -2,8 +2,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:q="http://labs.jboss.com/jbossrichfaces/ui/ui/queue">
+ xmlns:a4j="http://richfaces.org/a4j">
<head>
<title></title>
<script type="text/javascript">
@@ -28,11 +27,11 @@
<ui:decorate template="/templates/index.xhtml">
<ui:define name="viewQueue">
- <q:queue name="queue" requestDelay="#{bean.queueRequestDelay}" oncomplete="window.status = 'queue handler'"/>
+ <a4j:queue name="queue" requestDelay="#{bean.queueRequestDelay}" oncomplete="window.status = 'queue handler'"/>
</ui:define>
<ui:define name="formQueue">
- <q:queue name="formQueue" requestDelay="#{bean.queueRequestDelay}" />
+ <a4j:queue name="formQueue" requestDelay="#{bean.queueRequestDelay}" />
</ui:define>
<ui:define name="title">No global queues</ui:define>
Modified: trunk/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -3,8 +3,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jstl/core"
- xmlns:q="http://labs.jboss.com/jbossrichfaces/ui/ui/queue">
+ xmlns:c="http://java.sun.com/jstl/core">
<head>
<title></title>
<script type="text/javascript">
@@ -31,7 +30,7 @@
<c:set var="requestDelay" value="#{bean.queueRequestDelay}" />
<c:forEach items="#{oversizeBean.queueNames}" var="queueName">
- <q:queue requestDelay="#{requestDelay}" size="#{size}" name="#{queueName}"
+ <a4j:queue requestDelay="#{requestDelay}" size="#{size}" name="#{queueName}"
sizeExceededBehavior="#{queueName}"/>
</c:forEach>
Modified: trunk/samples/queue-sample/src/main/webapp/pages/view-queue.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/pages/view-queue.xhtml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/src/main/webapp/pages/view-queue.xhtml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -2,8 +2,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:q="http://labs.jboss.com/jbossrichfaces/ui/ui/queue">
+ xmlns:a4j="http://richfaces.org/a4j">
<head>
<title></title>
<script type="text/javascript">
@@ -28,7 +27,7 @@
<ui:decorate template="/templates/index.xhtml">
<ui:define name="viewQueue">
- <q:queue requestDelay="#{bean.queueRequestDelay}" oncomplete="window.status = 'queue handler'"/>
+ <a4j:queue requestDelay="#{bean.queueRequestDelay}" oncomplete="window.status = 'queue handler'"/>
</ui:define>
<ui:define name="formQueue">
Modified: trunk/samples/queue-sample/src/main/webapp/templates/index.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/templates/index.xhtml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/src/main/webapp/templates/index.xhtml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -2,8 +2,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:q="http://labs.jboss.com/jbossrichfaces/ui/ui/queue">
+ xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
<!-- script src="#{facesContext.externalContext.requestContextPath}/faces/a4j/g/3_3_0-SNAPSHOT/org/ajax4jsf/framework.pack.js"></script -->
Modified: trunk/samples/queue-sample/src/main/webapp/templates/navigation.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/templates/navigation.xhtml 2008-11-19 16:31:41 UTC (rev 11239)
+++ trunk/samples/queue-sample/src/main/webapp/templates/navigation.xhtml 2008-11-19 17:06:16 UTC (rev 11248)
@@ -2,8 +2,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:q="http://labs.jboss.com/jbossrichfaces/ui/ui/queue">
+ xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
<h:outputLink value="index.jsf">No global queues page</h:outputLink>
17 years, 8 months
JBoss Rich Faces SVN: r11247 - trunk/sandbox/ui.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-19 11:55:55 -0500 (Wed, 19 Nov 2008)
New Revision: 11247
Removed:
trunk/sandbox/ui/queue/
Modified:
trunk/sandbox/ui/pom.xml
Log:
Queue moved to ui.core
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2008-11-19 16:53:45 UTC (rev 11246)
+++ trunk/sandbox/ui/pom.xml 2008-11-19 16:55:55 UTC (rev 11247)
@@ -19,6 +19,5 @@
<!--module>rex-button</module-->
<module>sortableHeader</module>
<module>editor</module>
- <module>queue</module>
</modules>
</project>
\ No newline at end of file
17 years, 8 months
JBoss Rich Faces SVN: r11246 - in trunk/ui/core: src/main/config/component and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-19 11:53:45 -0500 (Wed, 19 Nov 2008)
New Revision: 11246
Added:
trunk/ui/core/src/main/config/component/queue.xml
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRegistry.java
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRendererData.java
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScript.java
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/ScriptTest.java
trunk/ui/core/src/test/resources/META-INF/
trunk/ui/core/src/test/resources/META-INF/resources-config.xml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/root
trunk/ui/core/src/test/resources/org/ajax4jsf/component/script.xhtml
trunk/ui/core/src/test/resources/org/ajax4jsf/component/simulation.js
Modified:
trunk/ui/core/pom.xml
Log:
Queue moved to ui.core
Modified: trunk/ui/core/pom.xml
===================================================================
--- trunk/ui/core/pom.xml 2008-11-19 16:47:07 UTC (rev 11245)
+++ trunk/ui/core/pom.xml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -40,6 +40,16 @@
</library>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- TODO uncomment this -->
+ <exclude>**/ImplicitQueuesTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
<dependencies>
Added: trunk/ui/core/src/main/config/component/queue.xml
===================================================================
--- trunk/ui/core/src/main/config/component/queue.xml (rev 0)
+++ trunk/ui/core/src/main/config/component/queue.xml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
+<components>
+ <component>
+ <name>org.ajax4jsf.Queue</name>
+ <family>org.ajax4jsf.Queue</family>
+ <classname>org.ajax4jsf.component.html.HtmlQueue</classname>
+ <superclass>org.ajax4jsf.component.UIQueue</superclass>
+ <description>
+ <![CDATA[The <a4j:queue> tag.]]>
+ </description>
+ <tag generate="true" bodyContent="empty">
+ <name>queue</name>
+ <classname>org.ajax4jsf.taglib.html.jsp.QueueTag</classname>
+ <superclass>org.ajax4jsf.webapp.taglib.HtmlComponentTagBase</superclass>
+ <test/>
+ </tag>
+ <renderer generate="false">
+ <name>org.ajax4jsf.QueueRenderer</name>
+ <classname>org.ajax4jsf.renderkit.html.QueueRenderer</classname>
+ </renderer>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.taglib.html.facelets.QueueHandler</classname>
+ </taghandler>
+ -->
+ <property>
+ <name>enabled</name>
+ <classname>java.lang.Boolean</classname>
+ </property>
+ <property>
+ <name>size</name>
+ <classname>java.lang.Integer</classname>
+ </property>
+ <property>
+ <name>name</name>
+ <classname>java.lang.String</classname>
+ <defaultvalue>""</defaultvalue>
+ </property>
+
+ <property>
+ <name>limitToList</name>
+ <classname>java.lang.Boolean</classname>
+ </property>
+ <property >
+ <name>requestDelay</name>
+ <classname>java.lang.Integer</classname>
+ </property>
+ <property>
+ <name>ignoreDupResponses</name>
+ <classname>java.lang.Boolean</classname>
+ </property>
+ <property>
+ <name>timeout</name>
+ <classname>java.lang.Integer</classname>
+ </property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ </property>
+
+ <property>
+ <name>onsubmit</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>onbeforedomupdate</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>oncomplete</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>onerror</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>sizeExceededBehavior</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>onSizeExceeded</name>
+ <classname>java.lang.String</classname>
+ </property>
+ </component>
+</components>
Added: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRegistry.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRegistry.java (rev 0)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRegistry.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,64 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.renderkit.html;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class QueueRegistry {
+
+ private static final String REGISTRY_ATTRIBUTE_NAME = QueueRegistry.class.getName();
+
+ public static void registerQueue(FacesContext context, String clientName, QueueRendererData data) {
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+
+ Map<String, QueueRendererData> registryMap = (Map<String, QueueRendererData>)
+ requestMap.get(REGISTRY_ATTRIBUTE_NAME);
+
+ if (registryMap == null) {
+ registryMap = new LinkedHashMap<String, QueueRendererData>();
+ requestMap.put(REGISTRY_ATTRIBUTE_NAME, registryMap);
+ }
+
+ if (!registryMap.containsKey(clientName)) {
+ registryMap.put(clientName, data);
+ } else {
+ context.getExternalContext().log("Queue with name '" + clientName + "' has already been registered");
+ }
+ }
+
+ public static Map<String, QueueRendererData> getRegisteredQueues(FacesContext context) {
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+
+ return (Map<String, QueueRendererData>) requestMap.get(REGISTRY_ATTRIBUTE_NAME);
+ }
+}
Added: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java (rev 0)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,182 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.component.UIQueue;
+import org.ajax4jsf.javascript.AjaxScript;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.renderkit.html.scripts.QueueScript;
+import org.ajax4jsf.resource.InternetResource;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class QueueRenderer extends HeaderResourcesRendererBase {
+
+ private static final String QUEUE_ONSUBMIT_ATTRIBUTE = "queueonsubmit";
+
+ private static final String QUEUE_ONBEFOREDOMUPDATE_ATTRIBUTE = "queueonbeforedomupdate";
+
+ private static final String QUEUE_ONCOMPLETE_ATTRIBUTE = "queueoncomplete";
+
+ private static final String QUEUE_ONERROR_ATTRIBUTE = "queueonerror";
+
+ private static final String[] QUEUE_ATTRIBUTES = new String[] {
+ "enabled",
+ "size",
+ "sizeExceededBehavior"
+ };
+
+ private static final String[] QUEUE_FUNCTION_ATTRIBUTES = new String[] {
+ "onSizeExceeded",
+ "onError",
+ "onExpired"
+ };
+
+ private static final String[] REQUEST_ATTRIBUTES = new String[] {
+ "requestDelay",
+ "timeout",
+ "ignoreDupResponses",
+ "limitToList"
+ };
+
+ private volatile InternetResource[] scripts;
+
+ @Override
+ protected InternetResource[] getScripts() {
+ if (scripts == null) {
+ synchronized (this) {
+ if (scripts == null) {
+ scripts = new InternetResource[] {
+ getResource(AjaxScript.class.getName()),
+ getResource(QueueScript.class.getName())
+ };
+ }
+ }
+ }
+
+ return scripts;
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIQueue.class;
+ }
+
+ private boolean isNotEmpty(Object object) {
+ if (object == null) {
+ return false;
+ }
+
+ if (object instanceof String) {
+ String s = (String) object;
+ if (s.length() == 0) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private QueueRendererData createRendererData(FacesContext context, UIQueue queue) {
+ Map<String, Object> attributes = queue.getAttributes();
+
+ QueueRendererData data = new QueueRendererData();
+
+ for (String attributeName : QUEUE_ATTRIBUTES) {
+ Object value = attributes.get(attributeName);
+ if (isNotEmpty(value)) {
+ data.addQueueAttribute(attributeName, value);
+ }
+ }
+
+ for (String attributeName : REQUEST_ATTRIBUTES) {
+ Object value = attributes.get(attributeName);
+ if (isNotEmpty(value)) {
+ data.addRequestAttribute(attributeName, value);
+ }
+ }
+
+ for (String attributeName : QUEUE_FUNCTION_ATTRIBUTES) {
+ Object value = attributes.get(attributeName);
+ if (isNotEmpty(value)) {
+ //TODO nick - apply proper functions signature
+ data.addQueueAttribute(attributeName, new JSFunctionDefinition("event").addToBody(value));
+ }
+ }
+
+ String oncomplete = queue.getOncomplete();
+ if (oncomplete != null) {
+ data.addRequestAttribute(QUEUE_ONCOMPLETE_ATTRIBUTE, AjaxRendererUtils.buildAjaxOncomplete(oncomplete));
+ }
+
+ String onBeforeDomUpdate = queue.getOnbeforedomupdate();
+ if (onBeforeDomUpdate != null) {
+ data.addRequestAttribute(QUEUE_ONBEFOREDOMUPDATE_ATTRIBUTE, AjaxRendererUtils.buildAjaxOnBeforeDomUpdate(onBeforeDomUpdate));
+ }
+
+ String onsubmit = queue.getOnsubmit();
+ if (onsubmit != null) {
+ JSFunctionDefinition onsubmitFunction = new JSFunctionDefinition("request");
+ onsubmitFunction.addToBody(onsubmit);
+
+ data.addRequestAttribute(QUEUE_ONSUBMIT_ATTRIBUTE, onsubmitFunction);
+ }
+
+ String onerror = queue.getOnerror();
+ if (onerror != null) {
+ JSFunctionDefinition onerrorFunction = new JSFunctionDefinition("request", "status", "message");
+ onerrorFunction.addToBody(onerror);
+
+ data.addRequestAttribute(QUEUE_ONERROR_ATTRIBUTE, onerrorFunction);
+ }
+
+ return data;
+ }
+
+ @Override
+ public void encodeBegin(FacesContext context, UIComponent component)
+ throws IOException {
+ super.encodeBegin(context, component);
+ }
+
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException {
+ super.encodeEnd(context, component);
+
+ UIQueue queue = (UIQueue) component;
+ if (!queue.isDisabled()) {
+ QueueRegistry.registerQueue(context, queue.getClientName(context),
+ createRendererData(context, queue));
+ }
+ }
+}
Added: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRendererData.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRendererData.java (rev 0)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRendererData.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,61 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.renderkit.html;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Denis Morozov
+ * @since 3.3.0
+ */
+public class QueueRendererData {
+
+ private Map<String, Object> queueAttributes;
+
+ private Map<String, Object> requestAttributes;
+
+ public void addQueueAttribute(String key, Object value) {
+ if (queueAttributes == null) {
+ queueAttributes = new HashMap<String, Object>();
+ }
+
+ queueAttributes.put(key, value);
+ }
+
+ public void addRequestAttribute(String key, Object value) {
+ if (requestAttributes == null) {
+ requestAttributes = new HashMap<String, Object>();
+ }
+
+ requestAttributes.put(key, value);
+ }
+
+ public Map<String, Object> getQueueAttributes() {
+ return queueAttributes;
+ }
+
+ public Map<String, Object> getRequestAttributes() {
+ return requestAttributes;
+ }
+}
Added: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScript.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScript.java (rev 0)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScript.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,52 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html.scripts;
+
+import org.ajax4jsf.resource.InternetResourceBase;
+import org.ajax4jsf.resource.ResourceContext;
+import org.ajax4jsf.resource.ResourceRenderer;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class QueueScript extends InternetResourceBase {
+
+ private static final ResourceRenderer renderer = new QueueScriptResourceRenderer();
+
+ private String key = getClass().getName();
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public ResourceRenderer getRenderer(ResourceContext resourceContext) {
+ return renderer;
+ }
+
+ @Override
+ public boolean isCacheable(ResourceContext resourceContext) {
+ return false;
+ }
+}
Added: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java (rev 0)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/scripts/QueueScriptResourceRenderer.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,148 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.renderkit.html.scripts;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.component.UIQueue;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.renderkit.html.QueueRegistry;
+import org.ajax4jsf.renderkit.html.QueueRendererData;
+import org.ajax4jsf.resource.BaseResourceRenderer;
+import org.ajax4jsf.resource.InternetResource;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class QueueScriptResourceRenderer extends BaseResourceRenderer {
+
+ private void encodeQueue(ResponseWriter writer, String queueName, QueueRendererData queueData)
+ throws IOException {
+
+ Map<String, Object> queueAttributes = null;
+ Map<String, Object> requestAttributes = null;
+
+ if (queueData != null) {
+ queueAttributes = queueData.getQueueAttributes();
+ requestAttributes = queueData.getRequestAttributes();
+ }
+
+ writer.writeText("A4J.AJAX.EventQueue.addQueue(", null);
+ writer.writeText(
+ new JSObject("A4J.AJAX.EventQueue",
+ queueName,
+ queueAttributes,
+ requestAttributes
+ ).toScript(), null);
+ writer.writeText(");", null);
+ }
+
+ @Override
+ protected void customEncode(InternetResource resource,
+ FacesContext context, Object data) throws IOException {
+ super.customEncode(resource, context, data);
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ Map<String, QueueRendererData> queues = QueueRegistry.getRegisteredQueues(context);
+
+ ExternalContext externalContext = context.getExternalContext();
+ if (Boolean.valueOf(externalContext.getInitParameter("org.richfaces.queue.global.enabled"))) {
+ String encodedGlobalQueueName = externalContext.encodeNamespace(UIQueue.GLOBAL_QUEUE_NAME);
+
+ if (queues == null || !queues.containsKey(encodedGlobalQueueName)) {
+ encodeQueue(writer, encodedGlobalQueueName, null);
+ }
+ }
+
+ if (queues != null && !queues.isEmpty()) {
+ for (Entry<String, QueueRendererData> entry : queues.entrySet()) {
+ encodeQueue(writer, entry.getKey(), entry.getValue());
+ }
+ }
+ }
+
+ protected void doEncode(InternetResource resource, FacesContext context,
+ Object data, Map<String, Object> attributes) throws IOException {
+
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ //TODO nick - what if ajax request?
+ if (!ajaxContext.isAjaxRequest(context)) {
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+
+ String resourceKey = resource.getKey();
+ if (requestMap.get(resourceKey) == null) {
+ requestMap.put(resourceKey, Boolean.TRUE);
+
+ super.encode(resource, context, data, attributes);
+ }
+ }
+ }
+
+ @Override
+ public void encode(InternetResource resource, FacesContext context,
+ Object data, Map<String, Object> attributes) throws IOException {
+
+ doEncode(resource, context, data, attributes);
+ }
+
+ @Override
+ public void encode(InternetResource resource, FacesContext context,
+ Object data) throws IOException {
+
+ doEncode(resource, context, data, Collections.EMPTY_MAP);
+ }
+
+ @Override
+ protected String[][] getCommonAttrs() {
+ return new String[][] {
+ {HTML.TYPE_ATTR, getContentType()},
+ };
+ }
+
+ @Override
+ protected String getHrefAttr() {
+ return null;
+ }
+
+ @Override
+ protected String getTag() {
+ return HTML.SCRIPT_ELEM;
+ }
+
+ public String getContentType() {
+ return "text/javascript";
+ }
+
+}
Added: trunk/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java (rev 0)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,475 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.component;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.UserResourceRenderer2;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.mozilla.javascript.NativeArray;
+import org.mozilla.javascript.NativeObject;
+import org.mozilla.javascript.Undefined;
+
+import com.gargoylesoftware.htmlunit.AlertHandler;
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.ScriptPreProcessor;
+import com.gargoylesoftware.htmlunit.ScriptResult;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine;
+import com.sun.facelets.Facelet;
+import com.sun.facelets.FaceletFactory;
+import com.sun.facelets.compiler.Compiler;
+import com.sun.facelets.compiler.SAXCompiler;
+import com.sun.facelets.impl.DefaultFaceletFactory;
+import com.sun.facelets.impl.ResourceResolver;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public abstract class AbstractQueueComponentTest extends AbstractAjax4JsfTestCase {
+
+ private static final String COMPONENT_TYPE = AjaxSubmitFunctionComponent.class.getName();
+
+ private static final String AJAX_SUBMIT = "ajaxSubmit";
+
+ protected HtmlPage page;
+
+ public final static class AjaxSubmitFunctionComponent extends UIComponentBase {
+
+ @Override
+ public String getRendererType() {
+ return COMPONENT_TYPE;
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_TYPE;
+ }
+
+ }
+
+ private final static class AjaxSubmitFunctionResourceRenderer extends
+ Renderer implements UserResourceRenderer2 {
+
+ public void encodeToHead(FacesContext facesContext, UIComponent component)
+ throws IOException {
+ JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, facesContext);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(facesContext, component);
+ options.put("requestDelay", new JSReference("parameters.requestDelay"));
+ options.put("requestId", new JSReference("parameters.requestId || '" + component.getClientId(facesContext) + "'"));
+ options.put("data", new JSReference("data"));
+ options.put("requestTime", new JSReference("parameters.requestTime || 1000"));
+ options.put("timeout", new JSReference("parameters.timeout"));
+ options.put("eventsQueue", new JSReference("parameters.eventsQueue"));
+ options.put("implicitEventsQueue", new JSReference("parameters.implicitEventsQueue"));
+
+ ajaxFunction.addParameter(options);
+
+ ResponseWriter responseWriter = facesContext.getResponseWriter();
+ responseWriter.startElement(HTML.SCRIPT_ELEM, component);
+ responseWriter.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
+ responseWriter.writeText("var " + AJAX_SUBMIT + " = function(data, parameters) {" + ajaxFunction.toScript() + "};", null);
+ responseWriter.endElement(HTML.SCRIPT_ELEM);
+ }
+
+ }
+
+ public AbstractQueueComponentTest(String name) {
+ super(name);
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ UIViewRoot viewRoot = facesContext.getViewRoot();
+ UIResource resource;
+
+ UIComponent form = application.createComponent(UIForm.COMPONENT_TYPE);
+ viewRoot.getChildren().add(form);
+ final UIComponent commandButton = application.createComponent(UIAjaxCommandButton.COMPONENT_TYPE);
+ form.getChildren().add(commandButton);
+
+ facesContext.getRenderKit().addRenderer(COMPONENT_TYPE, COMPONENT_TYPE, new AjaxSubmitFunctionResourceRenderer());
+ form.getChildren().add(new AjaxSubmitFunctionComponent());
+
+ resource = (UIResource) application.createComponent("org.ajax4jsf.LoadScript");
+ resource.setSrc("resource:///org/ajax4jsf/component/simulation.js");
+ viewRoot.getChildren().add(resource);
+
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ this.page = null;
+ super.tearDown();
+ }
+
+ protected static final class ParametersBuilder {
+ private Map<String, Object> parameters;
+
+ private ParametersBuilder() {
+ this.parameters = new HashMap<String, Object>();
+ }
+
+ private ParametersBuilder(Map<String, Object> parameters) {
+ this.parameters = new HashMap<String, Object>(parameters);
+ }
+
+ private ParametersBuilder put(String key, Object value) {
+ this.parameters.put(key, value);
+ return this;
+ }
+
+ private String getParamatersString() {
+ return ScriptUtils.toScript(parameters);
+ }
+
+ public ParametersBuilder requestDelay(double value) {
+ return new ParametersBuilder(this.parameters).put("requestDelay", value);
+ }
+ public ParametersBuilder requestId(Object id) {
+ return new ParametersBuilder(this.parameters).put("requestId", id);
+ }
+ public ParametersBuilder requestTime(double value) {
+ return new ParametersBuilder(this.parameters).put("requestTime", value);
+ }
+ public ParametersBuilder timeout(double value) {
+ return new ParametersBuilder(this.parameters).put("timeout", value);
+ }
+ public ParametersBuilder eventsQueue(String name) {
+ return new ParametersBuilder(this.parameters).put("eventsQueue", name);
+ }
+ public ParametersBuilder implicitEventsQueue(String name) {
+ return new ParametersBuilder(this.parameters).put("implicitEventsQueue", name);
+ }
+ }
+
+ protected ParametersBuilder createAjaxParameters() {
+ return new ParametersBuilder();
+ }
+
+ protected static final class TestsResult {
+ private List<RequestData> dataList = new ArrayList<RequestData>();
+
+ private double currentTime;
+
+ public void addData(RequestData data) {
+ this.dataList.add(data);
+ }
+
+ public List<RequestData> getDataList() {
+ return dataList;
+ }
+
+ public void setCurrentTime(double number) {
+ this.currentTime = number;
+ }
+
+ public double getCurrentTime() {
+ return currentTime;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+
+ builder.append("[\n");
+ for (RequestData data : dataList) {
+ builder.append(" ");
+ builder.append(data);
+ builder.append("\n");
+ }
+ builder.append("]\n");
+ builder.append("Current time: " + this.currentTime);
+
+ return builder.toString();
+ }
+ }
+
+ protected static final class RequestData {
+ private boolean aborted;
+
+ private double startTime;
+
+ private double endTime;
+
+ private String data;
+
+ public RequestData(String data, double startTime, double endTime,
+ boolean aborted) {
+ super();
+ this.data = data;
+ this.startTime = startTime;
+ this.endTime = endTime;
+ this.aborted = aborted;
+ }
+
+ public boolean isAborted() {
+ return aborted;
+ }
+
+ public double getStartTime() {
+ return startTime;
+ }
+
+ public double getEndTime() {
+ return endTime;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+
+ builder.append("data: ");
+ builder.append(data);
+ builder.append(", ");
+
+ builder.append("startTime: ");
+ builder.append(startTime);
+ builder.append(", ");
+
+ builder.append("endTime: ");
+ builder.append(endTime);
+
+ if (isAborted()) {
+ builder.append(", aborted: ");
+ builder.append(true);
+ }
+
+ return builder.toString();
+ }
+ };
+
+ protected void assertRequestData(RequestData requestData, String data,
+ double startTime, double endTime, boolean aborted) {
+
+ assertEquals("Data check failed for " + requestData, data, requestData.getData());
+ assertEquals("Start time check failed for " + requestData, startTime, requestData.getStartTime());
+ assertEquals("End time check failed for " + requestData, endTime, requestData.getEndTime());
+ assertEquals("Aborted check failed for " + requestData, aborted, requestData.isAborted());
+
+ }
+
+ protected void ajax(String data, String parameters) {
+ page.executeJavaScript("simulationContext.ajax('" + data + "', " + parameters + ");");
+ }
+
+ protected void ajax(String data, ParametersBuilder builder) {
+ ajax(data, builder.getParamatersString());
+ }
+
+ protected void executeAfterDelay(String expression) {
+ page.executeJavaScript("simulationContext.executeAfterDelay(function(){" + expression + "});");
+ }
+
+ protected void delay(int delayValue) {
+ page.executeJavaScript("simulationContext.wait(" + delayValue + ");");
+ }
+
+ protected String getRootContextPath() {
+ return this.getClass().getPackage().getName().replace('.', '/');
+ }
+
+ protected ResourceResolver createResourceResolver() {
+ return new ResourceResolver() {
+
+ public URL resolveUrl(String path) {
+ return Thread.currentThread().getContextClassLoader().getResource(getRootContextPath() + path);
+ }
+
+ };
+ }
+
+ private static final Compiler compiler = new SAXCompiler();
+
+ protected void buildView(String viewId) throws IOException {
+ FaceletFactory factory = new DefaultFaceletFactory(compiler, createResourceResolver());
+ FaceletFactory.setInstance(factory);
+
+ FaceletFactory f = FaceletFactory.getInstance();
+ Facelet at = f.getFacelet(viewId);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ root.setViewId(viewId);
+ at.apply(facesContext, root);
+ }
+
+ protected void preRenderView() throws Exception {
+ StringBuilder builder = new StringBuilder("<script type='text/javascript'>");
+ builder.append("window.simulationContext = new SimulationContext(");
+ builder.append(AJAX_SUBMIT);
+ builder.append(");</script>");
+
+ HtmlOutputText text = new HtmlOutputText();
+ text.setEscape(false);
+ text.setValue(builder.toString());
+
+ List<UIComponent> childList = facesContext.getViewRoot().getChildren();
+ childList.add(childList.size(), text);
+ }
+
+ protected HtmlPage renderView(String viewId) throws Exception {
+ buildView(viewId);
+ preRenderView();
+ this.page = super.renderView();
+
+ return this.page;
+ }
+
+ @Override
+ protected HtmlPage renderView() throws Exception {
+ preRenderView();
+ this.page = super.renderView();
+
+ return this.page;
+ }
+
+ protected Object executeJavaScript(String expression) {
+ return page.executeJavaScript(expression).getJavaScriptResult();
+ }
+
+ protected void executeTimer() {
+ page.executeJavaScript("Timer.execute();");
+ }
+
+ protected TestsResult getTestsResult() {
+ TestsResult result = new TestsResult();
+
+ executeTimer();
+ ScriptResult scriptResult = page.executeJavaScript("window.simulationContext.results");
+ NativeArray array = (NativeArray) scriptResult.getJavaScriptResult();
+
+ for (int i = 0; i < array.getLength(); i++) {
+ NativeObject object = (NativeObject) array.get(i, array);
+
+ String data = null;
+
+ Object dataObject = object.get("data", object);
+ if (!(dataObject instanceof Undefined)) {
+ data = (String) dataObject;
+ }
+
+ Double startTime = (Double) object.get("startTime", object);
+ Double endTime = (Double) object.get("endTime", object);
+
+ Object aborted = object.get("aborted", object);
+ boolean abortedBoolean = aborted instanceof Boolean && (Boolean) aborted;
+
+ result.addData(new RequestData(data, startTime, endTime, abortedBoolean));
+ }
+
+ scriptResult = page.executeJavaScript("Timer.currentTime");
+ result.setCurrentTime((Double) scriptResult.getJavaScriptResult());
+
+ return result;
+ }
+
+ @Override
+ protected void setupWebClient() {
+ super.setupWebClient();
+ webClient.setJavaScriptEngine(new JavaScriptEngine(webClient));
+ webClient.setScriptPreProcessor(new UnescapingScriptPreprocessor());
+ webClient.setThrowExceptionOnScriptError(true);
+ webClient.setAlertHandler(new AlertHandler() {
+
+ public void handleAlert(Page page, String message) {
+ fail(message);
+ }
+
+ });
+ }
+}
+
+class UnescapingScriptPreprocessor implements ScriptPreProcessor {
+
+ private static final Map<String, String> ENTITIES_MAP = new HashMap<String, String>();
+
+ static {
+ ENTITIES_MAP.put("'", "\"");
+ ENTITIES_MAP.put(""", "'");
+ }
+
+ private static final Pattern ENTITIES_PATTERN;
+
+ static {
+ StringBuilder sb = new StringBuilder();
+
+ for (String entity : ENTITIES_MAP.keySet()) {
+ if (sb.length() != 0) {
+ sb.append('|');
+ }
+
+ sb.append(Pattern.quote(entity));
+ }
+
+ ENTITIES_PATTERN = Pattern.compile("(" + sb.toString() + ")");
+ }
+
+ public String preProcess(HtmlPage htmlPage, String sourceCode,
+ String sourceName, HtmlElement htmlElement) {
+
+ if (sourceName != null && !sourceName.startsWith("http:/")) {
+ Matcher m = ENTITIES_PATTERN.matcher(sourceCode);
+ StringBuffer sb = new StringBuffer();
+ while (m.find()) {
+ String entity = m.group(1);
+ m.appendReplacement(sb, ENTITIES_MAP.get(entity));
+ }
+
+ m.appendTail(sb);
+
+ return sb.toString();
+ } else {
+ return sourceCode;
+ }
+
+ }
+}
Added: trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java (rev 0)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/AjaxFormQueuesTest.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,66 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.component;
+
+
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ *
+ */
+public class AjaxFormQueuesTest extends AbstractQueueComponentTest {
+
+ /**
+ * @param name
+ */
+ public AjaxFormQueuesTest(String name) {
+ super(name);
+ }
+
+ protected void checkForm(String formName) throws Exception {
+ renderView("/ajax-form.xhtml");
+ executeJavaScript("$('" + formName + ":link').click()");
+ executeTimer();
+
+ Object resultObject = executeJavaScript("window.testResults." + formName);
+
+ assertTrue(formName, resultObject instanceof Boolean && (Boolean) resultObject);
+ }
+
+ public void testViewDefault() throws Exception {
+ checkForm("viewDefault");
+ }
+
+ public void testViewNamed() throws Exception {
+ checkForm("viewNamed");
+ }
+
+ public void testFormDefault() throws Exception {
+ checkForm("formDefault");
+ }
+
+ public void testFormNamed() throws Exception {
+ checkForm("formNamed");
+ }
+}
Added: trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java (rev 0)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/ImplicitQueuesTest.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,112 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import java.util.List;
+
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ *
+ */
+public class ImplicitQueuesTest extends AbstractQueueComponentTest {
+
+ /**
+ * @param name
+ */
+ public ImplicitQueuesTest(String name) {
+ super(name);
+ }
+
+ public void testImplicitGlobalQueueEnabled() throws Exception {
+ servletContext.addInitParameter("org.richfaces.queue.global.enabled", "true");
+
+ renderView();
+
+ ajax("a", createAjaxParameters().requestTime(1000));
+ ajax("b", createAjaxParameters().requestTime(1000));
+
+ TestsResult result = getTestsResult();
+ assertEquals(2000d, result.getCurrentTime());
+ }
+
+ public void testImplicitGlobalQueueDefault() throws Exception {
+ renderView();
+
+ ajax("a", createAjaxParameters().requestTime(1000));
+ ajax("b", createAjaxParameters().requestTime(1000));
+
+ TestsResult result = getTestsResult();
+ assertEquals(1000d, result.getCurrentTime());
+ }
+
+ public void testLegacyQueuesRequestDelay() throws Exception {
+ renderView("/legacy.xhtml");
+
+ executeAfterDelay("$('form:buttonDelayed').click()");
+ delay(500);
+ executeAfterDelay("$('form:buttonDelayed').click()");
+ delay(250);
+ executeAfterDelay("$('form:buttonDelayed').click()");
+
+ TestsResult result = getTestsResult();
+ List<RequestData> dataList = result.getDataList();
+ assertEquals(1, dataList.size());
+
+ //request time set to 5000 in .xhtml file
+ RequestData data = dataList.get(0);
+ assertRequestData(data, null, 1750, 6750, false);
+
+ assertEquals(6750d, result.getCurrentTime());
+ }
+
+ public void testLegacyQueuesIgnoreDupResponces() throws Exception {
+ renderView("/legacy.xhtml");
+
+ executeAfterDelay("$('form:buttonIgnoreDupResponces').click()");
+ delay(500);
+
+ executeAfterDelay("$('form:buttonIgnoreDupResponces').click()");
+ delay(250);
+
+ executeAfterDelay("$('form:buttonIgnoreDupResponces').click()");
+
+ executeTimer();
+ TestsResult result = getTestsResult();
+ List<RequestData> dataList = result.getDataList();
+ assertEquals(3, dataList.size());
+
+ //request time set to 5000 in .xhtml file
+ assertRequestData(dataList.get(0), null, 0, 5000, false);
+ assertRequestData(dataList.get(1), null, 500, 5500, false);
+ assertRequestData(dataList.get(2), null, 750, 5750, false);
+
+ assertEquals(5750d, result.getCurrentTime());
+
+ Double requestsCompletedCounter = (Double) executeJavaScript("counter");
+ assertEquals(1d, requestsCompletedCounter);
+
+ Double requestsCompletionTime = (Double) executeJavaScript("time");
+ assertEquals(5750d, requestsCompletionTime);
+ }
+}
Added: trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java (rev 0)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueDiscoveryTest.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,215 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.mozilla.javascript.NativeArray;
+
+import com.gargoylesoftware.htmlunit.ScriptResult;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ *
+ */
+public class QueueDiscoveryTest extends AbstractQueueComponentTest {
+
+ /**
+ * @param name
+ */
+ public QueueDiscoveryTest(String name) {
+ super(name);
+ }
+
+ protected void assertListsEqual(List<String> list1, List<String> list2)
+ throws Exception {
+
+ System.out.println(list1);
+ System.out.println(list2);
+ System.out.println("xxx");
+ assertEquals(list1, list2);
+ }
+
+ protected List<String> getResults(HtmlPage page) {
+ List<String> result = new ArrayList<String>();
+
+ page.executeJavaScript("Timer.execute()");
+ ScriptResult scriptResult = page.executeJavaScript("window.testResult");
+ NativeArray array = (NativeArray) scriptResult.getJavaScriptResult();
+ for (int i = 0; i < array.getLength(); i++) {
+ result.add((String) array.get(i, array));
+ }
+
+ return result;
+ }
+
+ public void testGlobalViewQueue() throws Exception {
+ renderView("/global-view.xhtml");
+
+ List<String> list = new ArrayList<String>();
+ assertListsEqual(list, getResults(page));
+
+ list.add("button");
+ page.executeJavaScript("$('form:button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("implicitQueue");
+ page.executeJavaScript("$('form:implicitQueue').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("alternativeQueueButton");
+ list.add("alt:alternativeQueueButton");
+ page.executeJavaScript("$('form:alternativeQueueButton').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("function");
+ page.executeJavaScript("ajaxFunction()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("implicitDelayedQueue");
+ page.executeJavaScript("$('form2:implicitDelayedQueue').click()");
+ assertListsEqual(list, getResults(page));
+ }
+
+ public void testGlobalFormQueue() throws Exception {
+ renderView("/global-form.xhtml");
+
+ List<String> list = new ArrayList<String>();
+ assertListsEqual(list, getResults(page));
+
+ list.add("alternativeQueueButton");
+ list.add("alt:alternativeQueueButton");
+ page.executeJavaScript("$('form2:alternativeQueueButton').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("alternativeQueueButton");
+ page.executeJavaScript("$('form:alternativeQueueButton').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("buttonFormQueue");
+ page.executeJavaScript("$('form:button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("implicitQueue");
+ page.executeJavaScript("$('form:implicitQueue').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("alternativeQueue1Button");
+ list.add("alt1:alternativeQueue1Button");
+ page.executeJavaScript("$('form:alternativeQueue1Button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("buttonForm2Queue");
+ page.executeJavaScript("$('form2:button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("implicitDelayedQueue");
+ page.executeJavaScript("$('form2:implicitDelayedQueue').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("ajaxFunction");
+ page.executeJavaScript("ajaxFunction()");
+ assertListsEqual(list, getResults(page));
+ }
+
+ public void testGlobalFormBoth() throws Exception {
+ renderView("/global-both.xhtml");
+
+ List<String> list = new ArrayList<String>();
+ assertListsEqual(list, getResults(page));
+
+ list.add("buttonFormQueue");
+ page.executeJavaScript("$('form:button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("implicitDelayedQueue");
+ page.executeJavaScript("$('form:implicitDelayedQueue').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("implicitQueue");
+ page.executeJavaScript("$('form2:implicitQueue').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("viewQueue:viewQueueButton");
+ page.executeJavaScript("$('form:viewQueueButton').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("form2Button");
+ page.executeJavaScript("$('form2:button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("anotherImplicitQueue");
+ page.executeJavaScript("$('form3:anotherImplicitQueue').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("form3Button");
+ page.executeJavaScript("$('form3:button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("functionFormQueue");
+ page.executeJavaScript("ajaxFunction()");
+ assertListsEqual(list, getResults(page));
+ }
+
+ public void testDisabled() throws Exception {
+ renderView("/disabled.xhtml");
+
+ List<String> list = new ArrayList<String>();
+ assertListsEqual(list, getResults(page));
+
+ list.add("button");
+ page.executeJavaScript("$('form:button').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("formQueueButton");
+ page.executeJavaScript("$('form:formQueueButton').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("button2");
+ list.add("form2-global:button2");
+ page.executeJavaScript("$('form2:button2').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("formQueueButton2");
+ list.add("form2-queue:formQueueButton2");
+ page.executeJavaScript("$('form2:formQueueButton2').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("global");
+ page.executeJavaScript("$('form3:global').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("globalNamed");
+ page.executeJavaScript("$('form3:globalNamed').click()");
+ assertListsEqual(list, getResults(page));
+
+ list.add("globalNamedX");
+ list.add("viewNamedX:globalNamedX");
+ page.executeJavaScript("$('form3:globalNamedX').click()");
+ assertListsEqual(list, getResults(page));
+ }
+
+}
Added: trunk/ui/core/src/test/java/org/ajax4jsf/component/ScriptTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/ScriptTest.java (rev 0)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/ScriptTest.java 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,111 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.component;
+
+import java.util.List;
+
+/**
+ * @author Denis Morozov
+ * @author Nick Belaevski
+ */
+public class ScriptTest extends AbstractQueueComponentTest {
+
+ private static final String QUEUE_NAME = "testQueue";
+
+ private static final String VIEW_NAME = "/script.xhtml";
+
+ public ScriptTest(String name) {
+ super(name);
+ }
+
+ public void testSimpleAjax() throws Exception {
+ renderView(VIEW_NAME);
+
+ delay(50);
+ ajax("a", createAjaxParameters().requestTime(100));
+ ajax("b", createAjaxParameters().requestTime(150));
+
+ TestsResult result = getTestsResult();
+ List<RequestData> dataList = result.getDataList();
+ assertEquals(2, dataList.size());
+ assertRequestData(dataList.get(0), "a", 50, 150, false);
+ assertRequestData(dataList.get(1), "b", 50, 200, false);
+
+ assertEquals(200d, result.getCurrentTime());
+ }
+
+ public void testSimpleQueuedAjax() throws Exception {
+ renderView(VIEW_NAME);
+
+ delay(50);
+ ParametersBuilder queueParameters = createAjaxParameters().requestTime(500).eventsQueue(QUEUE_NAME);
+ ajax("a", queueParameters.requestId(0));
+ delay(200);
+ ajax("b", queueParameters.requestId(1));
+
+ TestsResult result = getTestsResult();
+ List<RequestData> dataList = result.getDataList();
+ assertEquals(2, dataList.size());
+ assertRequestData(dataList.get(0), "a", 50, 550, false);
+ assertRequestData(dataList.get(1), "b", 550, 1050, false);
+
+ assertEquals(1050d, result.getCurrentTime());
+ }
+
+ public void testScript() throws Exception {
+ renderView(VIEW_NAME);
+
+ delay(500);
+ ajax("a", "{requestDelay: 100, requestId: '12', requestTime: 100, eventsQueue: 'q'}");
+ delay(4100);
+ ajax("b", "{requestDelay: 4400, requestId: '12', requestTime: 101, timeout: 10, eventsQueue: 'q'}");
+ ajax("c", "{requestDelay: 0, requestId: '123', requestTime: 1, timeout: 10, eventsQueue: 'q'}");
+
+ System.out.println(getTestsResult());
+ }
+
+ public void testImplicitQueue() throws Exception {
+ renderView(VIEW_NAME);
+
+ ParametersBuilder parameters = createAjaxParameters().
+ requestDelay(100).
+ implicitEventsQueue("myqueue").
+ requestTime(10);
+
+ ajax("a", parameters);
+ delay(10);
+ ajax("b", parameters);
+ delay(10);
+ ajax("c", parameters.requestDelay(50));
+
+ TestsResult result = getTestsResult();
+ List<RequestData> dataList = result.getDataList();
+ assertEquals(1, dataList.size());
+
+ RequestData requestData = dataList.get(0);
+ assertRequestData(requestData, "c", 70, 80, false);
+
+ assertEquals(80d, result.getCurrentTime());
+
+ }
+}
Added: trunk/ui/core/src/test/resources/META-INF/resources-config.xml
===================================================================
--- trunk/ui/core/src/test/resources/META-INF/resources-config.xml (rev 0)
+++ trunk/ui/core/src/test/resources/META-INF/resources-config.xml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource-config>
+
+ <resource>
+ <name>org/ajax4jsf/simulation.js</name>
+ <path>org/ajax4jsf/simulation.js</path>
+ </resource>
+
+ <resource>
+ <name>org.ajax4jsf.AbstractQueueComponentTest</name>
+ <path>org.ajax4jsf.AbstractQueueComponentTest</path>
+ </resource>
+
+</resource-config>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/ajax-form.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,46 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <head>
+ <title>a4j:form check page</title>
+ </head>
+ <body>
+ <f:view>
+ <script type="text/javascript">
+ function $(name) {
+ return document.getElementById(name);
+ }
+
+ window.testResults = {};
+ </script>
+
+ <a4j:status startText="...running..." startStyle="color: green" />
+
+ <a4j:queue oncomplete="window.testResults.viewDefault = true"/>
+
+ <a4j:form ajaxSubmit="true" id="viewDefault">
+ <h:commandButton value="view default queue" id="link" />
+ </a4j:form>
+
+ <a4j:queue oncomplete="window.testResults.viewNamed = true" name="viewNamed" />
+
+ <a4j:form ajaxSubmit="true" eventsQueue="viewNamed" id="viewNamed">
+ <h:commandButton value="view named queue" id="link" />
+ </a4j:form>
+
+ <a4j:form ajaxSubmit="true" id="formDefault">
+ <a4j:queue oncomplete="window.testResults.formDefault = true" />
+
+ <h:commandButton value="form default queue" id="link" />
+ </a4j:form>
+
+ <a4j:form ajaxSubmit="true" eventsQueue="formQueue" id="formNamed">
+ <a4j:queue oncomplete="window.testResults.formNamed = true" name="formQueue" />
+
+ <h:commandButton value="form named queue" id="link" />
+ </a4j:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/disabled.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,59 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="discovery-base.xhtml" />
+
+ <h:form id="form">
+ <a4j:commandButton id="button" oncomplete="addResult('button')">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+ <a4j:commandButton id="formQueueButton" oncomplete="addResult('formQueueButton')" eventsQueue="form">
+ <f:param name="data" value="formQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('disabled')" disabled="true" />
+ <a4j:queue oncomplete="addResult('disabledForm')" name="form" disabled="true" />
+ </h:form>
+
+ <h:form id="form2">
+ <a4j:commandButton id="button2" oncomplete="addResult('button2')">
+ <f:param name="data" value="button2" />
+ </a4j:commandButton>
+ <a4j:commandButton id="formQueueButton2" oncomplete="addResult('formQueueButton2')" eventsQueue="form2">
+ <f:param name="data" value="formQueueButton2" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('disabledA')" disabled="true" />
+ <a4j:queue oncomplete="addResult('form2-global:' + request.options.parameters.data)" />
+ <a4j:queue oncomplete="addResult('disabledB')" disabled="true" />
+
+ <a4j:queue oncomplete="addResult('disabledA1')" disabled="true" name="form2" />
+ <a4j:queue oncomplete="addResult('form2-queue:' + request.options.parameters.data)" name="form2"/>
+ <a4j:queue oncomplete="addResult('disabledB1')" disabled="true" name="form2" />
+ </h:form>
+
+ <h:form id="form3">
+ <a4j:commandButton id="global" oncomplete="addResult('global')">
+ <f:param name="data" value="global" />
+ </a4j:commandButton>
+ <a4j:commandButton id="globalNamed" oncomplete="addResult('globalNamed')" eventsQueue="viewNamed">
+ <f:param name="data" value="globalNamed" />
+ </a4j:commandButton>
+ <a4j:commandButton id="globalNamedX" oncomplete="addResult('globalNamedX')" eventsQueue="viewNamedX">
+ <f:param name="data" value="globalNamedX" />
+ </a4j:commandButton>
+ </h:form>
+
+ <a4j:queue oncomplete="addResult('disabled:' + request.options.parameters.data)" disabled="true" />
+ <a4j:queue oncomplete="addResult('viewNamed:' + request.options.parameters.data)" name="viewNamed" disabled="true" />
+
+ <a4j:queue oncomplete="addResult('viewNamedXA:' + request.options.parameters.data)" name="viewNamedX" disabled="true" />
+ <a4j:queue oncomplete="addResult('viewNamedX:' + request.options.parameters.data)" name="viewNamedX" />
+ <a4j:queue oncomplete="addResult('viewNamedXB:' + request.options.parameters.data)" name="viewNamedX" disabled="true" />
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/discovery-base.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,22 @@
+<ui:composition xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+ <script type="text/javascript">
+ function $(id) {
+ return document.getElementById(id);
+ }
+
+ window.testResult = new Array();
+
+ function addResult(value) {
+ window.testResult.push(value);
+ }
+
+ function stub() {
+ }
+ </script>
+
+ <a4j:status startText="...running..." startStyle="color: green" />
+</ui:composition>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-both.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,65 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="discovery-base.xhtml" />
+
+ <a4j:queue oncomplete="addResult(request.options.parameters.data)"/>
+
+ <h:form id="form">
+ <a4j:queue oncomplete="addResult('buttonFormQueue')"/>
+
+ <a4j:commandButton id="button" oncomplete="stub()">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="viewQueueButton" oncomplete="stub()" eventsQueue="viewQueue">
+ <f:param name="data" value="viewQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
+ eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
+ <f:param name="data" value="implicitDelayedQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form id="form2">
+ <a4j:commandButton id="formQueueButton" eventsQueue="formQueue" requestDelay="1000" oncomplete="stub()">
+ <f:param name="data" value="formQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('formQueue:' + request.options.parameters.data)" name="formQueue"/>
+
+ <a4j:commandButton id="button" requestDelay="1000" oncomplete="stub()">
+ <f:param name="data" value="form2Button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
+ <f:param name="data" value="implicitQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form id="form3">
+
+ <a4j:commandButton id="button">
+ <f:param name="data" value="form3Button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="anotherImplicitQueue" ignoreDupResponses="true" eventsQueue="anotherImplicitQueue" oncomplete="addResult('anotherImplicitQueue')">
+ <f:param name="data" value="anotherImplicitQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form>
+ <a4j:queue oncomplete="addResult('functionFormQueue')"/>
+
+ <a4j:jsFunction name="ajaxFunction" />
+ </h:form>
+
+ <a4j:queue oncomplete="addResult('viewQueue:' + request.options.parameters.data)" name="viewQueue"/>
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-form.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,53 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="discovery-base.xhtml" />
+
+ <h:form id="form">
+ <a4j:queue oncomplete="addResult('alt1:' + request.options.parameters.data)" name="alternativeQueue1" />
+ <a4j:queue oncomplete="addResult('buttonFormQueue')"/>
+
+ <a4j:commandButton id="button" oncomplete="stub()">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
+ <f:param name="data" value="implicitQueue" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
+ <f:param name="data" value="alternativeQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueue1Button" eventsQueue="alternativeQueue1" oncomplete="addResult('alternativeQueue1Button')">
+ <f:param name="data" value="alternativeQueue1Button" />
+ </a4j:commandButton>
+
+ </h:form>
+
+ <h:form>
+ <a4j:jsFunction name="ajaxFunction" oncomplete="addResult('ajaxFunction')"/>
+ </h:form>
+
+
+ <h:form id="form2">
+ <a4j:commandButton id="button" requestDelay="1000" oncomplete="stub()" />
+ <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
+ eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
+ <f:param name="data" value="implicitDelayedQueue" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
+ <f:param name="data" value="alternativeQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:queue oncomplete="addResult('buttonForm2Queue')"/>
+ <a4j:queue oncomplete="addResult('alt:' + request.options.parameters.data)" name="alternativeQueue" />
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/global-view.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,40 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <ui:include src="discovery-base.xhtml" />
+
+ <h:form id="form">
+ <a4j:commandButton id="button" oncomplete="stub()" requestDelay="100">
+ <f:param name="data" value="button" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="alternativeQueueButton" eventsQueue="alternativeQueue" oncomplete="addResult('alternativeQueueButton')">
+ <f:param name="data" value="alternativeQueueButton" />
+ </a4j:commandButton>
+
+ <a4j:commandButton id="implicitQueue" eventsQueue="implicitQueue" oncomplete="addResult('implicitQueue')">
+ <f:param name="data" value="implicitQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <h:form id="form2">
+ <a4j:jsFunction name="ajaxFunction" oncomplete="stub()">
+ <f:param name="data" value="function" />
+ </a4j:jsFunction>
+
+ <a4j:commandButton id="implicitDelayedQueue" requestDelay="500"
+ eventsQueue="implicitDelayedQueue" oncomplete="addResult('implicitDelayedQueue')">
+ <f:param name="data" value="implicitDelayedQueue" />
+ </a4j:commandButton>
+ </h:form>
+
+ <a4j:queue oncomplete="addResult(request.options.parameters.data)"/>
+ <a4j:queue oncomplete="addResult('alt:' + request.options.parameters.data)" name="alternativeQueue" />
+
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/implicit-global-queue.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,10 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/legacy.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,24 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <body>
+ <f:view>
+ <script type="text/javascript">
+ XMLHttpRequest.defaultRequestTime = 5000;
+
+ function $(id) {
+ return document.getElementById(id);
+ }
+
+ var counter = 0;
+ var time = 0;
+ </script>
+ <h:form id="form">
+ <a4j:commandButton id="buttonDelayed" requestDelay="1000" />
+ <a4j:commandButton id="buttonIgnoreDupResponces" ignoreDupResponses="true" oncomplete="counter++;time = Timer.currentTime;"/>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/root
===================================================================
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/script.xhtml
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/script.xhtml (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/script.xhtml 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,18 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:c="http://java.sun.com/jstl/core">
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <a4j:status startText="...running..." stopText="stopped" startStyle="color: green" />
+
+ <a4j:queue size="2" sizeExceededBehavior="fireNext" name="testQueue" />
+
+ </f:view>
+ </body>
+</html>
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/simulation.js
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/simulation.js (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/simulation.js 2008-11-19 16:53:45 UTC (rev 11246)
@@ -0,0 +1,173 @@
+var Timer = {
+
+ _eventCounter: 0,
+
+ currentTime: 0,
+
+ maxTime: 100000,
+
+ events: new Array(),
+
+ addEventToTimer: function(callback, delay) {
+ var eventTime = this.currentTime + delay;
+
+ var i = 0;
+
+ while (this.events[i] && (this.events[i].eventTime <= eventTime)) {
+ i++;
+ }
+
+ var eventId = this._eventCounter++;
+
+ this.events.splice(i, 0, {eventTime: eventTime, callback: callback, eventId: eventId});
+
+ return eventId;
+ },
+
+ removeEventFromTimer: function(eventId) {
+ for ( var i = 0; i < this.events.length; i++) {
+ if (this.events[i].eventId == eventId) {
+ this.events.splice(i, 1);
+
+ break;
+ }
+ }
+ },
+
+ execute: function() {
+ while (this.events.length > 0) {
+ var eventData = this.events.shift();
+
+ this.currentTime = eventData.eventTime;
+ if (this.currentTime > this.maxTime) {
+ throw "Maximum execution time reached, aborting timer";
+ }
+
+ try {
+
+ eventData.callback();
+ } catch (e) {
+ alert(e.message);
+ }
+ }
+ },
+
+ isEmpty: function() {
+ return this.events.length == 0;
+ }
+};
+
+window.setTimeout = function(callback, delay) {
+ return Timer.addEventToTimer(callback, delay);
+}
+
+window.clearTimeout = function(timerId) {
+ Timer.removeEventFromTimer(timerId);
+}
+
+var SimulationContext = function(submitFunction) {
+ this.results = new Array();
+ this.time = 0;
+
+ this.submitFunction = submitFunction;
+};
+
+SimulationContext.prototype.wait = function(delay) {
+ this.time += delay;
+};
+
+SimulationContext.prototype.ajax = function() {
+ var args = arguments;
+ var _this = this;
+
+ Timer.addEventToTimer(function() {
+ _this.submitFunction(args[0], args[1]);
+ }, this.time);
+};
+
+SimulationContext.prototype.executeAfterDelay = function(code) {
+ Timer.addEventToTimer(function() {
+ code();
+ }, this.time);
+};
+
+window.simulationContext = undefined;
+
+window.XMLHttpRequest = function() {
+ this.requestTime = XMLHttpRequest.requestTime || 0;
+ this.data = XMLHttpRequest.data;
+
+ this.responseText = null;
+ this.responseXML = null;
+
+ this.readyState = 0;
+}
+
+window.XMLHttpRequest.UNSENT = 0;
+window.XMLHttpRequest.OPENED = 1;
+window.XMLHttpRequest.HEADERS_RECEIVED = 2;
+window.XMLHttpRequest.LOADING = 3;
+window.XMLHttpRequest.DONE = 4;
+
+XMLHttpRequest.prototype.abort = function() {
+ if (this.timerId) {
+ clearTimeout(this.timerId);
+ }
+
+ window.simulationContext.results[this.requestId].endTime = Timer.currentTime;
+ window.simulationContext.results[this.requestId].aborted = true;
+};
+
+XMLHttpRequest.prototype.getAllResponseHeaders = function() {
+ return "";
+};
+XMLHttpRequest.prototype.getResponseHeader = function(name) {
+ if ("Ajax-Response" == name) {
+ return "true";
+ }
+ return "";
+};
+XMLHttpRequest.prototype.open = function(method, url, async, user, password) {
+ this.readyState = XMLHttpRequest.OPENED;
+};
+
+XMLHttpRequest.prototype.send = function(contentType) {
+ var length = window.simulationContext.results.push({data: this.data, startTime: Timer.currentTime});
+ this.requestId = length - 1;
+
+ var _this = this;
+ this.timerId = setTimeout(function() {
+ _this.status = 200;
+ _this.statusText = "Success";
+ _this.readyState = window.XMLHttpRequest.DONE;
+ _this.responseText = "<?xml version='1.0'?><html />";
+
+ var doc = new ActiveXObject("MSXML.DOMDocument");
+ doc.loadXML(_this.responseText);
+ _this.responseXML = doc;
+
+ window.simulationContext.results[_this.requestId].endTime = Timer.currentTime;
+ _this.onreadystatechange();
+ }, this.requestTime);
+};
+
+XMLHttpRequest.prototype.setRequestHeader = function(name, value) {
+
+};
+
+var oldSubmitQuery = A4J.AJAX.SubmitQuery;
+
+A4J.AJAX.SubmitQuery = function(query, options) {
+ XMLHttpRequest.requestTime = options.requestTime || XMLHttpRequest.defaultRequestTime;
+ XMLHttpRequest.data = options.data;
+
+ try {
+ var req = oldSubmitQuery.apply(this, arguments);
+
+ return req;
+ } finally {
+ XMLHttpRequest.requestTime = undefined;
+ XMLHttpRequest.data = undefined;
+ }
+}
+
17 years, 8 months
JBoss Rich Faces SVN: r11245 - in trunk/sandbox/samples/editorSeam-sample/src/main: resources and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-19 11:47:07 -0500 (Wed, 19 Nov 2008)
New Revision: 11245
Modified:
trunk/sandbox/samples/editorSeam-sample/src/main/java/org/richfaces/EditorBean.java
trunk/sandbox/samples/editorSeam-sample/src/main/resources/editorParameters.properties
trunk/sandbox/samples/editorSeam-sample/src/main/webapp/pages/editor.jsp
trunk/sandbox/samples/editorSeam-sample/src/main/webapp/pages/editor.xhtml
Log:
seam dev. demo
Modified: trunk/sandbox/samples/editorSeam-sample/src/main/java/org/richfaces/EditorBean.java
===================================================================
--- trunk/sandbox/samples/editorSeam-sample/src/main/java/org/richfaces/EditorBean.java 2008-11-19 16:45:36 UTC (rev 11244)
+++ trunk/sandbox/samples/editorSeam-sample/src/main/java/org/richfaces/EditorBean.java 2008-11-19 16:47:07 UTC (rev 11245)
@@ -7,9 +7,22 @@
public class EditorBean {
- private String value = "It's easy to make *emphasis*, |monospace|,\n ~deleted text~, super^scripts^ or _underlines_.";
+ private String value = "It's easy to make *emphasis*, |monospace|,~deleted text~, super^scripts^ or _underlines_.\n\n" +
+ "+This is a big heading\n" +
+ "You /must/ have some text following a heading!\n\n" +
+ "++This is a smaller heading\n" +
+ "This is the first paragraph. We can split it across multiple" +
+ "lines, but we must end it with a blank line.\n\n" +
+ "This is the second paragraph.\n\n" +
+ "An ordered list:\n\n" +
+ "#first item\n" + "#second item\n" +
+ "#and even the /third/ item\n\n" + "An unordered list:\n\n" +
+ "=an item\n" + "=another item\n\n" +
+ "[Slashdot - News for nerds, stuff that matters link=>http://slashdot.org]"
+ ;
private UIEditor editor;
private boolean rendered = true;
+ private boolean useSeamText = true;
private Map<String, Object> dataMap;
@@ -26,16 +39,6 @@
this.value = value;
}
- public String action1(){
- value += "1";
- return null;
- }
-
- public String action2(){
- editor.setValue(editor.getValue() + "1");
- return null;
- }
-
public String changeRendered(){
if(rendered) {
rendered = false;
@@ -67,6 +70,14 @@
public void setRendered(boolean rendered) {
this.rendered = rendered;
}
+
+ public boolean isUseSeamText() {
+ return useSeamText;
+ }
+
+ public void setUseSeamText(boolean useSeamText) {
+ this.useSeamText = useSeamText;
+ }
}
Modified: trunk/sandbox/samples/editorSeam-sample/src/main/resources/editorParameters.properties
===================================================================
--- trunk/sandbox/samples/editorSeam-sample/src/main/resources/editorParameters.properties 2008-11-19 16:45:36 UTC (rev 11244)
+++ trunk/sandbox/samples/editorSeam-sample/src/main/resources/editorParameters.properties 2008-11-19 16:47:07 UTC (rev 11245)
@@ -1,3 +1,5 @@
+skin ='o2k7'
+plugins ="safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template"
theme_advanced_buttons1="save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect"
theme_advanced_buttons2="cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor"
theme_advanced_buttons3="tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen"
@@ -5,4 +7,4 @@
theme_advanced_toolbar_location="top"
theme_advanced_toolbar_align="left"
theme_advanced_statusbar_location="bottom"
-theme_advanced_resizing=true
\ No newline at end of file
+theme_advanced_resizing=true
Modified: trunk/sandbox/samples/editorSeam-sample/src/main/webapp/pages/editor.jsp
===================================================================
--- trunk/sandbox/samples/editorSeam-sample/src/main/webapp/pages/editor.jsp 2008-11-19 16:45:36 UTC (rev 11244)
+++ trunk/sandbox/samples/editorSeam-sample/src/main/webapp/pages/editor.jsp 2008-11-19 16:47:07 UTC (rev 11245)
@@ -12,8 +12,8 @@
<ed:editor id="editorId"
value="#{editorBean.value}"
- width="300"
- height="175"
+ width="320"
+ height="270"
rendered="#{editorBean.rendered}"
binding="#{editorBean.editor}"
theme="advanced"
@@ -23,18 +23,17 @@
configuration="editorParameters"
/>
- <h:outputText value="Editor value: #{editorBean.value}" />
- <br/>
- <h:commandButton value="h:commandButton" action="#{editorBean.action1}"/>
- <a4j:commandButton value="a4j:commandButton" action="#{editorBean.action1}"
- reRender="editorId"/>
+ <h:commandButton value="h:commandButton"/>
+ <a4j:commandButton value="a4j:commandButton" reRender="editorId, seamtext"/>
<br/>
- <h:commandButton value="h:commandButton2" action="#{editorBean.action2}"/>
- <a4j:commandButton value="a4j:commandButton2" action="#{editorBean.action2}"
- reRender="editorId"/>
-
<br/>
- <h:commandButton value="change rendered" action="#{editorBean.changeRendered}"/>
+ <h:commandButton value="change rendered" action="#{editorBean.changeRendered}"/>
+ <h:panelGrid columns="1" id="seamtext">
+ <f:facet name="header">
+ <h:outputText value="Generated Seam Text"/>
+ </f:facet>
+ <h:inputTextarea readonly="true" cols="80" rows="20" value="#{editorBean.value}"/>
+ </h:panelGrid>
</h:form>
</f:view>
</body>
Modified: trunk/sandbox/samples/editorSeam-sample/src/main/webapp/pages/editor.xhtml
===================================================================
(Binary files differ)
17 years, 8 months
JBoss Rich Faces SVN: r11244 - in trunk/sandbox/ui/editor/src/main/java/org/richfaces: convert and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-11-19 11:45:36 -0500 (Wed, 19 Nov 2008)
New Revision: 11244
Modified:
trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/convert/SeamTextConverter.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorAdvancedThemeIcons.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorIcons.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorSimpleThemeIcons.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java
Log:
Editor: add javadocs
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-11-19 16:43:52 UTC (rev 11243)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-11-19 16:45:36 UTC (rev 11244)
@@ -39,10 +39,13 @@
*/
public abstract class UIEditor extends UIInput {
+ /** Editor component type */
public static final String COMPONENT_TYPE = "org.richfaces.Editor";
+ /** Editor component family */
public static final String COMPONENT_FAMILY = "org.richfaces.Editor";
+ /** Id suffix of textarea which used as target element for tinyMCE scripts*/
public static final String EDITOR_TEXT_AREA_ID_SUFFIX = "TextArea";
public abstract void setType(String type);
@@ -121,10 +124,16 @@
public abstract String getDialogType();
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponentBase#getRendersChildren()
+ */
public boolean getRendersChildren() {
return true;
}
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIOutput#getConverter()
+ */
@Override
public Converter getConverter() {
Converter converter = super.getConverter();
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/convert/SeamTextConverter.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/convert/SeamTextConverter.java 2008-11-19 16:43:52 UTC (rev 11243)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/convert/SeamTextConverter.java 2008-11-19 16:45:36 UTC (rev 11244)
@@ -47,25 +47,21 @@
import antlr.TokenStream;
/**
- * Seam Text Converter
+ * Seam Text Converter class. Provides converting html to seam text and vice versa.
*
* @author Alexandr Levkovsky
*
*/
public class SeamTextConverter implements Converter {
+ /** log4j instance for converter class */
private static final Log _log = LogFactory.getLog(SeamTextConverter.class);
- /**
- * <p>
- * The standard converter id for this converter.
- * </p>
- */
+ /** The converter id for this converter. */
public static final String CONVERTER_ID = SeamTextConverter.class.getName();
- /**
- * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent, java.lang.String)
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
*/
@SuppressWarnings("unchecked")
public Object getAsObject(FacesContext context, UIComponent component,
@@ -87,9 +83,8 @@
return null;
}
- /**
- * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent, java.lang.Object)
+ /* (non-Javadoc)
+ * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
*/
@SuppressWarnings("unchecked")
public String getAsString(FacesContext context, UIComponent component,
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-11-19 16:43:52 UTC (rev 11243)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-11-19 16:45:36 UTC (rev 11244)
@@ -41,21 +41,32 @@
import org.richfaces.component.UIEditor;
/**
- * @author Pavel Yaschenko - mailto:pyaschenko@exadel.com created 09.17.2008
+ * Editor component renderer base class.
*
+ * @author Alexandr Levkovsky
+ *
*/
public class EditorRendererBase extends InputRendererBase {
+ /** Specific script resource name which will be used to get server suffix */
private final static String SPECIFIC_SCRIPT_RESOURCE_NAME = "org/richfaces/renderkit/html/1$1.js";
+ /** Specific xcss resource name which will be used to get server suffix */
private final static String SPECIFIC_XCSS_RESOURCE_NAME = "org/richfaces/renderkit/html/1$1.xcss";
+ /** Editor viewMode attribute value which should disable rendering tinyMCE initialization */
private final static String TINY_MCE_DISABLED_MODE = "source";
+ /* (non-Javadoc)
+ * @see org.richfaces.renderkit.InputRendererBase#getComponentClass()
+ */
@Override
protected Class<? extends UIComponent> getComponentClass() {
return UIEditor.class;
}
+ /* (non-Javadoc)
+ * @see org.richfaces.renderkit.InputRendererBase#getConvertedValue(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
+ */
@Override
public Object getConvertedValue(FacesContext context,
UIComponent component, Object submittedValue)
@@ -63,11 +74,22 @@
return InputUtils.getConvertedValue(context, component, submittedValue);
}
+ /**
+ * Method to get converted to String model value for component
+ *
+ * @param context - faces context instance
+ * @param component - component for which method is applied
+ * @param value - component value
+ * @return converted to String model value
+ */
protected String getConvertedStringValue(FacesContext context,
UIEditor component, Object value) {
return InputUtils.getConvertedStringValue(context, component, value);
}
+ /* (non-Javadoc)
+ * @see org.richfaces.renderkit.InputRendererBase#doDecode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
@SuppressWarnings("unchecked")
@Override
protected void doDecode(FacesContext context, UIComponent component) {
@@ -81,6 +103,13 @@
}
+ /**
+ * Method to get converted to String model value or if validation not passed submitted value for component
+ *
+ * @param context - faces context instance
+ * @param component - component for which method is applied
+ * @return converted to String component value
+ */
protected String getFormattedComponentStringValue(FacesContext context,
UIEditor component) {
String fieldValue = (String) component.getSubmittedValue();
@@ -91,14 +120,33 @@
return fieldValue;
}
+ /**
+ * Method to get exact script resource URI suffix
+ *
+ * @param context - faces context instance
+ * @return string with script resource URI suffix
+ */
protected String getSriptMappingSuffix(FacesContext context) {
return getResourceSuffix(context, SPECIFIC_SCRIPT_RESOURCE_NAME);
}
+ /**
+ * Method to get exact xcss resource URI suffix
+ *
+ * @param context - faces context instance
+ * @return string with xcss resource URI suffix
+ */
protected String getCssMappingSuffix(FacesContext context) {
return getResourceSuffix(context, SPECIFIC_XCSS_RESOURCE_NAME);
}
+ /**
+ * Method to get resource URI suffix which was added due to web.xml mappings
+ *
+ * @param context - faces context instance
+ * @param resourceName - name of the resource which should be checked
+ * @return string with resource URI suffix which was added after resource name
+ */
private String getResourceSuffix(FacesContext context, String resourceName){
InternetResource resource = getResource(resourceName);
String resourceUri = resource.getUri(context, null);
@@ -109,6 +157,14 @@
return suffix;
}
+ /**
+ * Method to write tinyMCE configuration script parameters from property
+ * file if it was determined through Editor configuration attribute.
+ *
+ * @param context - faces context instance
+ * @param component - Editor component instance
+ * @throws IOException
+ */
public void writeEditorConfigurationParameters(FacesContext context,
UIEditor component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
@@ -140,6 +196,14 @@
}
}
+ /**
+ * Method to write custom plugins script parameters from property
+ * file if it was determined through Editor configuration attribute.
+ *
+ * @param context - faces context instance
+ * @param component - Editor component instance
+ * @throws IOException
+ */
public void writeEditorCustomPluginsParameters(FacesContext context,
UIEditor component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
@@ -169,6 +233,12 @@
}
}
+ /**
+ * Method to build string with parameters from property file
+ *
+ * @param map - map with properties
+ * @return string with parameters in valid form for script
+ */
@SuppressWarnings("unchecked")
private String convertProperties(Map map) {
StringBuilder ret = new StringBuilder("{");
@@ -188,6 +258,13 @@
return ret.append("} ").toString();
}
+ /**
+ * Method to write script for loading custom plugins
+ *
+ * @param context - faces context instance
+ * @param map - properties map
+ * @return string with script
+ */
@SuppressWarnings("unchecked")
private String getCustomPluginsCode(FacesContext context, Map map) {
StringBuilder ret = new StringBuilder();
@@ -204,6 +281,13 @@
return ret.toString();
}
+ /**
+ * Method to write tinyMCE configuration script parameters from Editor component attributes.
+ *
+ * @param context - faces context instance
+ * @param component - Editor component instance
+ * @throws IOException
+ */
public void writeEditorConfigurationAttributes(FacesContext context,
UIEditor component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
@@ -278,6 +362,13 @@
}
}
+ /**
+ * Method to write tinyMCE configuration script parameters which was defined as <f:param> children for Editor
+ *
+ * @param context - faces context instance
+ * @param component - Editor component instance
+ * @throws IOException
+ */
public void writeEditorParameters(FacesContext context,
UIComponent component) throws IOException {
@@ -297,6 +388,12 @@
}
}
+ /**
+ * Method to check if rendering of tinyMCE scripts needed.
+ *
+ * @param component - Editor component instance
+ * @return true if needed or false if only target textarea should be rendered
+ */
public boolean shouldRenderTinyMCE(UIEditor component) {
if (component.getViewMode() != null
&& component.getViewMode().equalsIgnoreCase(
@@ -307,6 +404,12 @@
}
}
+ /**
+ * Method to get target textarea style if width or height attributes was determined
+ *
+ * @param component - Editor component instance
+ * @return string with style properties
+ */
public String getTextAreaStyle(UIEditor component) {
StringBuilder b = new StringBuilder();
if (component.getWidth() != null) {
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorAdvancedThemeIcons.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorAdvancedThemeIcons.java 2008-11-19 16:43:52 UTC (rev 11243)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorAdvancedThemeIcons.java 2008-11-19 16:45:36 UTC (rev 11244)
@@ -33,14 +33,21 @@
import org.ajax4jsf.resource.ResourceContext;
/**
+ * Class for advanced theme icons resource image of tinyMCE editor.
+ * Used for richfaces custom skin of tinyMCE editor.
+ *
* @author Alexandr Levkovsky
*
*/
public class EditorAdvancedThemeIcons extends EditorIcons{
+ /** icons image dimensions */
private Dimension dimension = new Dimension(88, 66);
+ /**
+ * Class constructor
+ */
public EditorAdvancedThemeIcons() {
super();
@@ -49,16 +56,23 @@
.getStartTime()));
}
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.Java2Dresource#getDimensions(javax.faces.context.FacesContext, java.lang.Object)
+ */
public Dimension getDimensions(FacesContext facesContext, Object data) {
return dimension;
}
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.Java2Dresource#getDimensions(org.ajax4jsf.resource.ResourceContext)
+ */
protected Dimension getDimensions(ResourceContext resourceContext) {
return dimension;
}
- /**
- *
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.Java2Dresource#paint(org.ajax4jsf.resource.ResourceContext, java.awt.Graphics2D)
*/
@Override
public void paint(ResourceContext context, Graphics2D graphics) {
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorIcons.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorIcons.java 2008-11-19 16:43:52 UTC (rev 11243)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorIcons.java 2008-11-19 16:45:36 UTC (rev 11244)
@@ -42,18 +42,28 @@
import org.richfaces.skin.SkinFactory;
/**
+ * Class with basic methods for drawing skinable icons for tinyMCE editor.
+ *
* @author Alexandr Levkovsky
*
*/
public abstract class EditorIcons extends Java2Dresource {
+ /** Additional background color parameter name in skin */
private final String ADDITIONAL_BACKGROUND_COLOR = "additionalBackgroundColor";
+ /** SelectControl color parameter name in skin */
private final String SELECT_CONTROL_COLOR = "selectControlColor";
+ /** Panel border color parameter name in skin */
private final String PANEL_BORDER_COLOR = "panelBorderColor";
+ /** General text color parameter name in skin */
private final String GENERAL_TEXT_COLOR = "generalTextColor";
+ /** Icon sub border transparency value */
private final int SUB_BORDER_TRANSPARENCY = 150;
+ /**
+ * Constructor
+ */
public EditorIcons() {
super();
@@ -62,6 +72,9 @@
.getStartTime()));
}
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.InternetResourceBase#getDataToStore(javax.faces.context.FacesContext, java.lang.Object)
+ */
protected Object getDataToStore(FacesContext context, Object data) {
String additionalBackgroundColor = getSkinParameter(context,
ADDITIONAL_BACKGROUND_COLOR);
@@ -80,11 +93,13 @@
return ret;
}
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.InternetResourceBase#deserializeData(byte[])
+ */
protected Object deserializeData(byte[] objectArray) {
if (objectArray == null) {
return null;
}
-
Object[] colors = new Object[5];
Zipper2 z = new Zipper2(objectArray);
colors[0] = z.nextColor();
@@ -95,6 +110,13 @@
return colors;
}
+ /**
+ * Method to get skin parameter value by parameter name
+ *
+ * @param context - faces context instance
+ * @param parameterName - name of the skin parameter
+ * @return string value of parameter
+ */
private String getSkinParameter(FacesContext context, String parameterName) {
Skin skin = SkinFactory.getInstance().getSkin(context);
Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
@@ -106,6 +128,14 @@
}
+ /**
+ * Method to paint icon background
+ *
+ * @param colors - icon colors
+ * @param selected - flag which defines either main or selected background color should be used in drawing
+ * @param withoutSubBorders - flag which defines either sub borders should be painted in icon
+ * @return buffered image
+ */
protected BufferedImage paintMainBlock(Object[] colors, boolean selected, boolean withoutSubBorders) {
int w = 22;
@@ -152,6 +182,12 @@
return image;
}
+ /**
+ * Method to paint icons background separator
+ *
+ * @param colors - icon colors
+ * @return buffered image
+ */
protected BufferedImage paintSeparatorBlock(Object[] colors) {
int w = 5;
@@ -178,6 +214,13 @@
return image;
}
+ /**
+ * Method to paint expand/collapse icon for some control
+ *
+ * @param colors - icon colors
+ * @param selected - flag which defines either main or selected background color should be used in drawing
+ * @return buffered image
+ */
protected BufferedImage paintFirstTriangleBlock(Object[] colors, boolean selected) {
int w = 11;
@@ -228,6 +271,16 @@
return image;
}
+ /**
+ * Method to paint arrow triangle for expand/collapse icon
+ *
+ * @param g2d - Graphics2D instance
+ * @param x - x coordinate of the triangle
+ * @param y - y coordinate of the triangle
+ * @param main - main color of the triangle
+ * @param shadow - shadow color of the triangle
+ * @param shadowNeeded - defines if needed to draw triangle shadow
+ */
private void paintTriangle(Graphics2D g2d, int x, int y, Color main,
Color shadow, boolean shadowNeeded) {
int w = 4;
@@ -244,6 +297,13 @@
}
+ /**
+ * Method to paint expand/collapse icon for dropdown list
+ *
+ * @param colors - icon colors
+ * @param selected - flag which defines either main or selected background color should be used in drawing
+ * @return buffered image
+ */
protected BufferedImage paintSecondTriangleBlock(Object[] colors, boolean selected) {
int w = 14;
@@ -296,6 +356,14 @@
return image;
}
+ /**
+ * Method to fill icon body with gradient
+ *
+ * @param g2d - Graphics2D instance
+ * @param w - body width
+ * @param h - body height
+ * @param color - body color
+ */
private void fillBodyWithGradient(Graphics2D g2d, int w, int h, Color color) {
Color halfColor = new Color(color.getRed(), color.getGreen(), color
.getBlue(), 90);
@@ -323,6 +391,11 @@
}
+ /**
+ * Method to prepare image for painting
+ * @param image
+ * @return Graphics2D instance for image
+ */
private Graphics2D prepareImage(BufferedImage image) {
Graphics2D g2d = image.createGraphics();
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorSimpleThemeIcons.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorSimpleThemeIcons.java 2008-11-19 16:43:52 UTC (rev 11243)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/html/images/EditorSimpleThemeIcons.java 2008-11-19 16:45:36 UTC (rev 11244)
@@ -33,14 +33,20 @@
import org.ajax4jsf.resource.ResourceContext;
/**
+ * Class for simple theme icons resource image of tinyMCE editor.
+ * Used for richfaces custom skin of tinyMCE editor.
+ *
* @author Alexandr Levkovsky
*
*/
public class EditorSimpleThemeIcons extends EditorIcons{
+ /** icons image dimensions */
private Dimension dimension = new Dimension(40, 66);
-
+ /**
+ * Class constructor
+ */
public EditorSimpleThemeIcons() {
super();
@@ -49,16 +55,22 @@
.getStartTime()));
}
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.Java2Dresource#getDimensions(javax.faces.context.FacesContext, java.lang.Object)
+ */
public Dimension getDimensions(FacesContext facesContext, Object data) {
return dimension;
}
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.Java2Dresource#getDimensions(org.ajax4jsf.resource.ResourceContext)
+ */
protected Dimension getDimensions(ResourceContext resourceContext) {
return dimension;
}
- /**
- *
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.resource.Java2Dresource#paint(org.ajax4jsf.resource.ResourceContext, java.awt.Graphics2D)
*/
@Override
public void paint(ResourceContext context, Graphics2D graphics) {
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java 2008-11-19 16:43:52 UTC (rev 11243)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java 2008-11-19 16:45:36 UTC (rev 11244)
@@ -39,18 +39,23 @@
import org.ajax4jsf.resource.ResourceContext;
/**
- * Editor html pages renderer - used for correcting scripts/images/css src
+ * Tiny_mce html resource pages renderer.
+ * Used for correcting scripts/images/css/irame src or href for normal loading by Resource Builder
+ *
* @author Alexandr Levkovsky
*
*/
public class EditorHTMLRenderer extends BaseResourceRenderer {
+ /** Specific script resource name which will be used to get server suffix */
private final static String SPECIFIC_SCRIPT_RESOURCE_NAME = "org/richfaces/renderkit/html/1$1.js";
+ /** Specific xcss resource name which will be used to get server suffix */
private final static String SPECIFIC_XCSS_RESOURCE_NAME = "org/richfaces/renderkit/html/1$1.xcss";
-
+
+ /** Regular expression pattern for finding elements for replacing and correcting */
private final static Pattern REGEXP = Pattern.compile("\\<(script|link|img|iframe)\\s+.*(?:src|href)\\s*=\\s*[\"']([^'\"]+)\\.([^\\'\"]+)[\"'][^>]*\\>", Pattern.CASE_INSENSITIVE);
- /**
+ /* (non-Javadoc)
* @see org.ajax4jsf.resource.BaseResourceRenderer#getCommonAttrs()
*/
@Override
@@ -58,7 +63,7 @@
return null;
}
- /**
+ /* (non-Javadoc)
* @see org.ajax4jsf.resource.BaseResourceRenderer#getHrefAttr()
*/
@Override
@@ -66,7 +71,7 @@
return null;
}
- /**
+ /* (non-Javadoc)
* @see org.ajax4jsf.resource.BaseResourceRenderer#getTag()
*/
@Override
@@ -74,14 +79,14 @@
return "span";
}
- /**
+ /* (non-Javadoc)
* @see org.ajax4jsf.resource.ResourceRenderer#getContentType()
*/
public String getContentType() {
return "text/html";
}
- /**
+ /* (non-Javadoc)
* @see org.ajax4jsf.resource.BaseResourceRenderer#send(org.ajax4jsf.resource.InternetResource, org.ajax4jsf.resource.ResourceContext)
*/
@Override
@@ -104,8 +109,9 @@
}
/**
- * Method to correct scripts src
- * @param resource
+ * Method to correct included resources src
+ *
+ * @param resource - html page to be checked
*/
private int updateAndSendResource(InputStream in, OutputStream out) throws IOException {
@@ -159,14 +165,30 @@
return total;
}
- private String getSriptMappingSuffix() {
+ /**
+ * Method to get exact script resource URI suffix
+ *
+ * @return string with script resource URI suffix
+ */
+ protected String getSriptMappingSuffix() {
return getResourceSuffix(SPECIFIC_SCRIPT_RESOURCE_NAME);
}
-
- private String getCssMappingSuffix() {
+
+ /**
+ * Method to get exact xcss resource URI suffix
+ *
+ * @return string with xcss resource URI suffix
+ */
+ protected String getCssMappingSuffix() {
return getResourceSuffix(SPECIFIC_XCSS_RESOURCE_NAME);
}
-
+
+ /**
+ * Method to get resource URI suffix which was added due to web.xml mappings
+ *
+ * @param resourceName - name of the resource which should be checked
+ * @return string with resource URI suffix which was added after resource name
+ */
private String getResourceSuffix(String resourceName) {
InternetResourceBuilder builder = InternetResourceBuilder.getInstance();
InternetResource resource = builder.getResource(resourceName);
@@ -179,7 +201,7 @@
return suffix;
}
- /**
+ /* (non-Javadoc)
* @see org.ajax4jsf.resource.BaseResourceRenderer#requireFacesContext()
*/
@Override
17 years, 8 months
JBoss Rich Faces SVN: r11243 - trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-11-19 11:43:52 -0500 (Wed, 19 Nov 2008)
New Revision: 11243
Modified:
trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
Log:
Modified: trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
===================================================================
--- trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2008-11-19 16:42:20 UTC (rev 11242)
+++ trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2008-11-19 16:43:52 UTC (rev 11243)
@@ -26,8 +26,8 @@
import org.jboss.seam.text.SeamTextLexer;
import org.jboss.seam.text.SeamTextParser;
-import org.richfaces.HtmlSeamTextLexer;
-import org.richfaces.HtmlSeamTextParser;
+import org.richfaces.antlr.HtmlSeamTextLexer;
+import org.richfaces.antlr.HtmlSeamTextParser;
/**
* HtmlSeamParser Junit Test
17 years, 8 months
JBoss Rich Faces SVN: r11242 - trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-19 11:42:20 -0500 (Wed, 19 Nov 2008)
New Revision: 11242
Modified:
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
Log:
add Tiny MCE options when useSeamText==true
Modified: trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
===================================================================
--- trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-11-19 16:33:53 UTC (rev 11241)
+++ trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-11-19 16:42:20 UTC (rev 11242)
@@ -59,7 +59,11 @@
synchronizeConfiguration: function(){
if(this.params.useSeamText){
this.tinyparams.plugins = Richfaces.Editor.SeamTextConfiguration.plugins;
+ this.tinyparams.convert_fonts_to_spans = false;
+ this.tinyparams.inline_styles = false;
+ this.tinyparams.verify_html = false;
+ //this.tinyparams.trim_span_elements = false;
//this.tinyparams.theme_advanced_buttons1 = Richfaces.Editor.SeamTextConfiguration.theme_advanced_buttons1;
//this.tinyparams.theme_advanced_buttons2 = Richfaces.Editor.SeamTextConfiguration.theme_advanced_buttons2;
//this.tinyparams.theme_advanced_buttons3 = Richfaces.Editor.SeamTextConfiguration.theme_advanced_buttons3;
17 years, 8 months
JBoss Rich Faces SVN: r11241 - trunk/sandbox/ui/queue/src/test/resources/META-INF.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-19 11:33:53 -0500 (Wed, 19 Nov 2008)
New Revision: 11241
Modified:
trunk/sandbox/ui/queue/src/test/resources/META-INF/resources-config.xml
Log:
Queue refactored to org.ajax4jsf.*
Modified: trunk/sandbox/ui/queue/src/test/resources/META-INF/resources-config.xml
===================================================================
--- trunk/sandbox/ui/queue/src/test/resources/META-INF/resources-config.xml 2008-11-19 16:33:07 UTC (rev 11240)
+++ trunk/sandbox/ui/queue/src/test/resources/META-INF/resources-config.xml 2008-11-19 16:33:53 UTC (rev 11241)
@@ -2,13 +2,13 @@
<resource-config>
<resource>
- <name>org/richfaces/simulation.js</name>
- <path>org/richfaces/simulation.js</path>
+ <name>org/ajax4jsf/simulation.js</name>
+ <path>org/ajax4jsf/simulation.js</path>
</resource>
<resource>
- <name>org.richfaces.AbstractQueueComponentTest</name>
- <path>org.richfaces.AbstractQueueComponentTest</path>
+ <name>org.ajax4jsf.AbstractQueueComponentTest</name>
+ <path>org.ajax4jsf.AbstractQueueComponentTest</path>
</resource>
</resource-config>
17 years, 8 months