JBoss Rich Faces SVN: r21275 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 08:16:30 -0500 (Thu, 27 Jan 2011)
New Revision: 21275
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
Log:
added issue tracking for RF-10333 and increased bound for maxDeviation to 250
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-01-27 13:15:50 UTC (rev 21274)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-01-27 13:16:30 UTC (rev 21275)
@@ -181,12 +181,12 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10333")
public void testExecute() {
attributes.setExecute("@this executeChecker");
attributes.setMode(TooltipMode.ajax);
tooltip.recall();
-
phaseInfo.assertListener(UPDATE_MODEL_VALUES, "executeChecker");
}
@@ -223,7 +223,7 @@
delay = System.currentTimeMillis() - delay;
long deviation = Math.abs(presetDelay - delay);
- long maxDeviation = Math.max(200, presetDelay / 2);
+ long maxDeviation = Math.max(250, presetDelay / 2);
assertTrue(deviation < maxDeviation,
format("deviation '{0}' is greater than maxDeviation '{1}'", deviation, maxDeviation));
13 years, 11 months
JBoss Rich Faces SVN: r21274 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richList and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 08:15:50 -0500 (Thu, 27 Jan 2011)
New Revision: 21274
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java
Log:
AbstractComponentAttributes - removed special convertor for enum values - needs to be in same letter-case like the original enum - fixed for rich:list
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-27 13:15:00 UTC (rev 21273)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-27 13:15:50 UTC (rev 21274)
@@ -26,8 +26,6 @@
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.referenceInferred;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.WordUtils;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
@@ -86,15 +84,6 @@
String valueAsString = value.toString();
- if (value.getClass().isEnum()) {
- if ("select".equals(inputType) && !selenium.getSelectOptions(locator).contains(valueAsString)) {
- valueAsString = valueAsString.toLowerCase();
- valueAsString = WordUtils.capitalizeFully(valueAsString, new char[] { '_' });
- valueAsString = valueAsString.replace("_", "");
- valueAsString = StringUtils.uncapitalize(valueAsString);
- }
- }
-
if ("text".equals(inputType)) {
applyText(locator, valueAsString);
} else if ("checkbox".equals(inputType)) {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-01-27 13:15:00 UTC (rev 21273)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-01-27 13:15:50 UTC (rev 21274)
@@ -21,11 +21,11 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest;
+import static org.jboss.test.selenium.encapsulated.JavaScript.js;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.LocatorFactory.id;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.encapsulated.JavaScript.js;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
import static org.testng.Assert.assertEquals;
@@ -52,7 +52,6 @@
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.jboss.test.selenium.waiting.retrievers.Retriever;
import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
-import org.richfaces.tests.metamer.Phase;
import org.richfaces.tests.metamer.TemplatesList;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Templates;
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java 2011-01-27 13:15:00 UTC (rev 21273)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java 2011-01-27 13:15:50 UTC (rev 21274)
@@ -13,19 +13,16 @@
import static org.jboss.test.selenium.dom.Event.MOUSEOVER;
import static org.jboss.test.selenium.dom.Event.MOUSEUP;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.richfaces.tests.metamer.ftest.richList.ListAttributes.Type.ORDERED;
import static org.testng.Assert.assertEquals;
-import java.net.URL;
import java.util.List;
import org.jboss.test.selenium.dom.Event;
+import org.richfaces.component.ListType;
import org.richfaces.tests.metamer.bean.Model;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.richfaces.tests.metamer.ftest.richList.ListAttributes.Type;
import org.richfaces.tests.metamer.model.Employee;
import org.testng.annotations.BeforeMethod;
@@ -52,7 +49,7 @@
@Use(empty = true)
Event event;
- Type type = ORDERED;
+ ListType type = ListType.ordered;
int expectedBegin;
int displayedRows;
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java 2011-01-27 13:15:00 UTC (rev 21273)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java 2011-01-27 13:15:50 UTC (rev 21274)
@@ -23,6 +23,7 @@
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.component.ListType;
import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
/**
@@ -82,12 +83,8 @@
setProperty("title", title);
}
- public void setType(Type type) {
+ public void setType(ListType type) {
setProperty("type", type);
}
- public enum Type {
- DEFINITIONS, ORDERED, UNORDERED;
- }
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java 2011-01-27 13:15:00 UTC (rev 21273)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListModel.java 2011-01-27 13:15:50 UTC (rev 21274)
@@ -28,8 +28,8 @@
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+import org.richfaces.component.ListType;
import org.richfaces.tests.metamer.ftest.model.AbstractModel;
-import org.richfaces.tests.metamer.ftest.richList.ListAttributes.Type;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
@@ -41,17 +41,17 @@
super(root);
}
- Type type;
+ ListType type;
ReferencedLocator<JQueryLocator> rows = ref(root, "li");
private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- public Type getType() {
+ public ListType getType() {
return type;
}
- public void setType(Type type) {
+ public void setType(ListType type) {
this.type = type;
}
@@ -77,11 +77,11 @@
private JQueryLocator getInnerElement() {
switch (type) {
- case ORDERED:
+ case ordered:
return jq("li.rf-olst-itm");
- case UNORDERED:
+ case unordered:
return jq("li.rf-ulst-itm");
- case DEFINITIONS:
+ case definitions:
return jq("dd.rf-dlst-dfn");
}
throw new IllegalStateException();
13 years, 11 months
JBoss Rich Faces SVN: r21273 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richExtendedDataTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 08:15:00 -0500 (Thu, 27 Jan 2011)
New Revision: 21273
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java
Log:
extended issue tracking for RF-9932
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java 2011-01-27 13:14:22 UTC (rev 21272)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java 2011-01-27 13:15:00 UTC (rev 21273)
@@ -67,6 +67,8 @@
@Test
@Override
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
+ "http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
public void testSortModeSingleRerenderAll() {
super.testSortModeSingleRerenderAll();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java 2011-01-27 13:14:22 UTC (rev 21272)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java 2011-01-27 13:15:00 UTC (rev 21273)
@@ -67,6 +67,8 @@
@Test
@Override
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
+ "http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
public void testSortModeSingleRerenderAll() {
super.testSortModeSingleRerenderAll();
}
@@ -97,7 +99,8 @@
@Test
@Override
- @IssueTracking("https://issues.jboss.org/browse/RF-9932")
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
+ "http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
public void testSortModeMultiRerenderAll() {
super.testSortModeMultiRerenderAll();
}
13 years, 11 months
JBoss Rich Faces SVN: r21272 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 08:14:22 -0500 (Thu, 27 Jan 2011)
New Revision: 21272
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
Log:
AbstractComponentAttributes - fixed general locator to support radios, but match only input types including selects
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-27 13:13:48 UTC (rev 21271)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-27 13:14:22 UTC (rev 21272)
@@ -50,7 +50,7 @@
protected AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
LocatorReference<ExtendedLocator<JQueryLocator>> root = new LocatorReference<ExtendedLocator<JQueryLocator>>(
pjq(""));
- ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, "*[id$=\\:{0}Input]{1}");
+ ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, ":input[id*=:{0}Input]{1}");
RequestType requestType = RequestType.HTTP;
13 years, 11 months
JBoss Rich Faces SVN: r21271 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 08:13:48 -0500 (Thu, 27 Jan 2011)
New Revision: 21271
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/DataScrollerAttributes.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java
Log:
rich:dataScroller - attributes based on ID rewritten to use AbstractComponentAttributes
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java 2011-01-27 13:13:12 UTC (rev 21270)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java 2011-01-27 13:13:48 UTC (rev 21271)
@@ -21,15 +21,12 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richDataScroller;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
-import static org.jboss.test.selenium.locator.LocatorFactory.id;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import java.net.URL;
-import org.jboss.test.selenium.locator.IdLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
@@ -58,6 +55,8 @@
DataScroller dataScroller1 = PaginationTester.DATA_SCROLLER_OUTSIDE_TABLE;
DataScroller dataScroller2 = PaginationTester.DATA_SCROLLER_IN_TABLE_FOOTER;
+ DataScrollerAttributes attributes = new DataScrollerAttributes();
+
PaginationTester paginationTester = new PaginationTester() {
@Override
@@ -72,9 +71,6 @@
}
};
- IdLocator attributeFastStep = id("form:attributes:fastStepInput");
- IdLocator attributeMaxPages = id("form:attributes:maxPagesInput");
-
ExtendedDataTable dataTable = new ExtendedDataTable(pjq("table.rf-dt[id$=richDataTable]"));
String tableText;
@@ -86,8 +82,8 @@
@BeforeMethod
public void prepareComponent() {
- guardHttp(selenium).type(attributeFastStep, String.valueOf(fastStep));
- guardHttp(selenium).type(attributeMaxPages, String.valueOf(maxPages));
+ attributes.setFastStep(fastStep);
+ attributes.setMaxPages(maxPages);
paginationTester.setDataScroller(dataScroller);
dataScroller.setFastStep(fastStep);
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/DataScrollerAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/DataScrollerAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/DataScrollerAttributes.java 2011-01-27 13:13:48 UTC (rev 21271)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richDataScroller;
+
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class DataScrollerAttributes extends AbstractComponentAttributes {
+ public void setFastStep(Integer fastStep) {
+ setProperty("fastStep", fastStep);
+ }
+
+ public void setMaxPages(Integer maxPages) {
+ setProperty("maxPages", maxPages);
+ }
+}
13 years, 11 months
JBoss Rich Faces SVN: r21270 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 08:13:12 -0500 (Thu, 27 Jan 2011)
New Revision: 21270
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
Log:
AbstractComponentAttributes - fixed locator for attributes to do not match attributes which are ending on same string as wanted attribute
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-27 11:47:36 UTC (rev 21269)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-27 13:13:12 UTC (rev 21270)
@@ -50,7 +50,7 @@
protected AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
LocatorReference<ExtendedLocator<JQueryLocator>> root = new LocatorReference<ExtendedLocator<JQueryLocator>>(
pjq(""));
- ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, "*[id*={0}Input]{1}");
+ ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, "*[id$=\\:{0}Input]{1}");
RequestType requestType = RequestType.HTTP;
@@ -67,8 +67,8 @@
}
protected void setProperty(String propertyName, Object value) {
- ExtendedLocator<JQueryLocator> locator = propertyLocator.format(propertyName);
- final AttributeLocator<?> typeLocator = locator.format("").getAttribute(Attribute.TYPE);
+ ExtendedLocator<JQueryLocator> locator = propertyLocator.format(propertyName, "");
+ final AttributeLocator<?> typeLocator = locator.getAttribute(Attribute.TYPE);
final ExtendedLocator<JQueryLocator> optionLocator = locator.getChild(jq("option"));
String inputType = null;
13 years, 11 months
JBoss Rich Faces SVN: r21268 - trunk/examples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-27 06:26:04 -0500 (Thu, 27 Jan 2011)
New Revision: 21268
Modified:
trunk/examples/pom.xml
Log:
https://issues.jboss.org/browse/RF-9160
Modified: trunk/examples/pom.xml
===================================================================
--- trunk/examples/pom.xml 2011-01-27 11:25:38 UTC (rev 21267)
+++ trunk/examples/pom.xml 2011-01-27 11:26:04 UTC (rev 21268)
@@ -50,7 +50,8 @@
<module>push-demo</module>
<module>richfaces-showcase</module>
<module>validator-demo</module>
- <module>dnd-demo</module>
+ <module>dnd-demo</module>
+ <module>irc-client</module>
</modules>
<scm>
@@ -59,4 +60,4 @@
<url>http://fisheye.jboss.org/browse/richfaces/trunk/examples</url>
</scm>
-</project>
\ No newline at end of file
+</project>
13 years, 11 months
JBoss Rich Faces SVN: r21266 - in trunk/examples: irc-client and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-27 06:24:20 -0500 (Thu, 27 Jan 2011)
New Revision: 21266
Added:
trunk/examples/irc-client/
trunk/examples/irc-client/.checkstyle
trunk/examples/irc-client/pom.xml
trunk/examples/irc-client/readme.txt
trunk/examples/irc-client/src/
trunk/examples/irc-client/src/main/
trunk/examples/irc-client/src/main/java/
trunk/examples/irc-client/src/main/java/org/
trunk/examples/irc-client/src/main/java/org/ircclient/
trunk/examples/irc-client/src/main/java/org/ircclient/controller/
trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java
trunk/examples/irc-client/src/main/java/org/ircclient/listeners/
trunk/examples/irc-client/src/main/java/org/ircclient/listeners/TopicsInitializer.java
trunk/examples/irc-client/src/main/java/org/ircclient/view/
trunk/examples/irc-client/src/main/java/org/ircclient/view/SkinBean.java
trunk/examples/irc-client/src/main/webapp/
trunk/examples/irc-client/src/main/webapp/WEB-INF/
trunk/examples/irc-client/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/irc-client/src/main/webapp/WEB-INF/web.xml
trunk/examples/irc-client/src/main/webapp/index.jsp
trunk/examples/irc-client/src/main/webapp/templates/
trunk/examples/irc-client/src/main/webapp/templates/includes/
trunk/examples/irc-client/src/main/webapp/templates/includes/skin-chooser.xhtml
trunk/examples/irc-client/src/main/webapp/templates/template.xhtml
trunk/examples/irc-client/src/main/webapp/welcome.xhtml
Log:
https://issues.jboss.org/browse/RF-9160
Added: trunk/examples/irc-client/.checkstyle
===================================================================
--- trunk/examples/irc-client/.checkstyle (rev 0)
+++ trunk/examples/irc-client/.checkstyle 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="rf" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
Added: trunk/examples/irc-client/pom.xml
===================================================================
--- trunk/examples/irc-client/pom.xml (rev 0)
+++ trunk/examples/irc-client/pom.xml 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>irc-client</artifactId>
+ <name>Richfaces Examples: Richfaces IRC Client Application</name>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+
+ <url>http://jboss.org/richfaces</url>
+
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <finalName>irc-client</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.atmosphere</groupId>
+ <artifactId>atmosphere-runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>pircbot</groupId>
+ <artifactId>pircbot</artifactId>
+ <version>1.4.2</version>
+ </dependency>
+ <!-- Tests -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.10</version>
+ <classifier>jdk15</classifier>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: trunk/examples/irc-client/readme.txt
===================================================================
--- trunk/examples/irc-client/readme.txt (rev 0)
+++ trunk/examples/irc-client/readme.txt 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,3 @@
+IRC Client Application is a sample which shows RichFaces Push in action.
+
+Targetted to JBoss AS 6
Added: trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java
===================================================================
--- trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java (rev 0)
+++ trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,188 @@
+package org.ircclient.controller;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.text.MessageFormat;
+import java.util.Date;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ValueChangeEvent;
+
+import org.jibble.pircbot.IrcException;
+import org.jibble.pircbot.NickAlreadyInUseException;
+import org.jibble.pircbot.PircBot;
+import org.jibble.pircbot.User;
+import org.richfaces.application.push.MessageException;
+import org.richfaces.application.push.TopicKey;
+import org.richfaces.application.push.TopicsContext;
+import org.richfaces.log.LogFactory;
+import org.richfaces.log.Logger;
+
+@ManagedBean
+@SessionScoped
+public class ChatBean extends PircBot implements Serializable {
+
+ private static final long serialVersionUID = -4945680041914388092L;
+ private static final String SERVER_URL = "irc.freenode.org";
+ private static final int SERVER_PORT = 6667;
+ private static final String CHANNEL_PREFIX = "#";
+ private static final String SUBTOPIC_SEPARATOR = "_";
+ private static final String DEFAULT_CHANNEL = "richfaces";
+ private static final Logger LOGGER = LogFactory.getLogger(ChatBean.class);
+
+ private String channelName;
+ private String message;
+ private transient TopicsContext topicsContext;
+
+ public void connect() {
+ try {
+ this.connect(SERVER_URL, SERVER_PORT);
+ this.joinChannel(CHANNEL_PREFIX + DEFAULT_CHANNEL);
+ channelName = DEFAULT_CHANNEL;
+ } catch (NickAlreadyInUseException e) {
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, this.getName() + " nick already in use", this.getName()
+ + " nick already in use"));
+ } catch (IOException e) {
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Sorry, server unresponsible. Try again later.",
+ "Sorry, server unresponsible. Try again later."));
+ } catch (IrcException e) {
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR,
+ "Sorry, we encountered IRC services problems. Try again later.",
+ "Sorry, we encountered IRC services problems. Try again later."));
+ }
+ }
+
+ public void leave() {
+ this.disconnect();
+ }
+
+ private TopicsContext getTopicsContext() {
+ if (topicsContext == null) {
+ topicsContext = TopicsContext.lookup();
+ }
+ return topicsContext;
+ }
+
+ @Override
+ protected void onMessage(String channel, String sender, String login, String hostname, String message) {
+ String channelName = channel.replace(CHANNEL_PREFIX, "");
+ try {
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName),
+ MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), sender, message));
+ } catch (MessageException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void onUserList(String channel, User[] users) {
+ try {
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName + "List"), null);
+ } catch (MessageException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void onJoin(String channel, String sender, String login, String hostname) {
+ try {
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName),
+ MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), sender, "joined channel"));
+ } catch (MessageException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void onPart(String channel, String sender, String login, String hostname) {
+ try {
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName),
+ MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), sender, "left channel"));
+ } catch (MessageException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void onNickChange(String oldNick, String login, String hostname, String newNick) {
+ try {
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName),
+ MessageFormat.format("{0,time,medium} {1}", new Date(), oldNick + " changed nick to " + newNick));
+ } catch (MessageException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void onQuit(String sourceNick, String sourceLogin, String sourceHostname, String reason) {
+ try {
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName),
+ MessageFormat.format("{0,time,medium} {1}: {2} {3}", new Date(), sourceNick, "joined channel", reason));
+ } catch (MessageException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+
+ public User[] getUsers() {
+ return this.getUsers(CHANNEL_PREFIX + channelName);
+ }
+
+ public void send() {
+ this.sendMessage(CHANNEL_PREFIX + channelName, message);
+ try {
+ getTopicsContext().publish(new TopicKey("chat", this.getUserName() + SUBTOPIC_SEPARATOR + channelName),
+ MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), this.getName(), message));
+ } catch (MessageException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+
+ public void changeNick(ValueChangeEvent event) {
+ this.changeNick((String) event.getNewValue());
+ }
+
+ public String getServerName() {
+ return SERVER_URL;
+ }
+
+ public void setUserName(String userName) {
+ this.setName(userName);
+ }
+
+ public String getUserName() {
+ if (this.getName().equalsIgnoreCase("PircBot")) {
+ return "";
+ } else {
+ return this.getName();
+ }
+ }
+
+ public String getChannelName() {
+ return channelName;
+ }
+
+ public void setChannelName(String channelName) {
+ this.channelName = channelName;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
Added: trunk/examples/irc-client/src/main/java/org/ircclient/listeners/TopicsInitializer.java
===================================================================
--- trunk/examples/irc-client/src/main/java/org/ircclient/listeners/TopicsInitializer.java (rev 0)
+++ trunk/examples/irc-client/src/main/java/org/ircclient/listeners/TopicsInitializer.java 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ircclient.listeners;
+
+import java.text.MessageFormat;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
+import javax.servlet.http.HttpServletRequest;
+
+import org.ircclient.controller.ChatBean;
+import org.richfaces.application.push.EventAbortedException;
+import org.richfaces.application.push.Session;
+import org.richfaces.application.push.SessionPreSubscriptionEvent;
+import org.richfaces.application.push.SessionSubscriptionEvent;
+import org.richfaces.application.push.SessionTopicListener;
+import org.richfaces.application.push.SessionUnsubscriptionEvent;
+import org.richfaces.application.push.Topic;
+import org.richfaces.application.push.TopicKey;
+import org.richfaces.application.push.TopicsContext;
+import org.richfaces.application.push.impl.DefaultMessageDataSerializer;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class TopicsInitializer implements SystemEventListener {
+
+ public void processEvent(SystemEvent event) throws AbortProcessingException {
+ TopicsContext topicsContext = TopicsContext.lookup();
+
+ Topic topic = topicsContext.getOrCreateTopic(new TopicKey("chat"));
+
+ topic.setMessageDataSerializer(DefaultMessageDataSerializer.instance());
+
+ topic.addTopicListener(new SessionTopicListener() {
+
+ public void processUnsubscriptionEvent(SessionUnsubscriptionEvent event) throws EventAbortedException {
+ TopicKey topicKey = event.getTopicKey();
+ Session session = event.getSession();
+ System.out.println(MessageFormat.format("Session {0} disconnected from {1}", session.getId(),
+ topicKey.getTopicAddress()));
+ }
+
+ public void processSubscriptionEvent(SessionSubscriptionEvent event) throws EventAbortedException {
+ TopicKey topicKey = event.getTopicKey();
+ Session session = event.getSession();
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ HttpServletRequest hsr = (HttpServletRequest) facesContext.getExternalContext().getRequest();
+
+ System.out.println(MessageFormat.format("Session {0} connected to {1} from {2}", session.getId(),
+ topicKey.getTopicAddress(), hsr.getRemoteAddr()));
+ }
+
+ public void processPreSubscriptionEvent(SessionPreSubscriptionEvent event) throws EventAbortedException {
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ ChatBean chatBean = (ChatBean) externalContext.getSessionMap().get("chatBean");
+ if (chatBean == null || !(chatBean.isConnected())) {
+ throw new EventAbortedException("We are not connected to IRC");
+ }
+ }
+ });
+ }
+
+ public boolean isListenerForSource(Object source) {
+ return true;
+ }
+
+}
Added: trunk/examples/irc-client/src/main/java/org/ircclient/view/SkinBean.java
===================================================================
--- trunk/examples/irc-client/src/main/java/org/ircclient/view/SkinBean.java (rev 0)
+++ trunk/examples/irc-client/src/main/java/org/ircclient/view/SkinBean.java 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,70 @@
+/**
+ *
+ */
+package org.ircclient.view;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author ishaikovsky
+ */
+@ManagedBean(name = "skinBean")
+@SessionScoped
+public class SkinBean implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2399884208294434812L;
+ private static final String SKIN_VIEW_PARAMETER = "skin";
+ @ManagedProperty(value = "blueSky")
+ private String skin;
+ private List<String> skins;
+
+ @PostConstruct
+ public void initialize() {
+ skins = new ArrayList<String>();
+ skins.add("blueSky");
+ skins.add("classic");
+ skins.add("deepMarine");
+ skins.add("emeraldTown");
+ skins.add("japanCherry");
+ skins.add("ruby");
+ skins.add("wine");
+ }
+
+ // TODO: move to utility class. used in navigator also.
+ private String getViewParameter(String name) {
+ FacesContext fc = FacesContext.getCurrentInstance();
+ String param = (String) fc.getExternalContext().getRequestParameterMap().get(name);
+ if (param != null && param.trim().length() > 0) {
+ return param;
+ } else {
+ return null;
+ }
+ }
+
+ public String getSkin() {
+ String currentSkin = getViewParameter(SKIN_VIEW_PARAMETER);
+ if (currentSkin != null) {
+ skin = currentSkin;
+ }
+ return skin;
+ }
+
+ public void setSkin(String skin) {
+ this.skin = skin;
+ }
+
+ public List<String> getSkins() {
+ return skins;
+ }
+
+}
Added: trunk/examples/irc-client/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/irc-client/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/examples/irc-client/src/main/webapp/WEB-INF/faces-config.xml 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+ <application>
+ <system-event-listener>
+ <system-event-listener-class>org.ircclient.listeners.TopicsInitializer</system-event-listener-class>
+ <system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
+ </system-event-listener>
+ </application>
+
+</faces-config>
Added: trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r07.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Added: trunk/examples/irc-client/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/examples/irc-client/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/examples/irc-client/src/main/webapp/WEB-INF/web.xml 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+ id="WebApp_ID" version="3.0">
+ <display-name>IRC-Client Application</display-name>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.push.jms.connectionUsername</param-name>
+ <param-value>guest</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.push.jms.connectionPassword</param-name>
+ <param-value>guest</param-value>
+ </context-param>
+ <filter>
+ <filter-name>PushFilter</filter-name>
+ <filter-class>org.richfaces.webapp.PushFilter</filter-class>
+ <async-supported>true</async-supported>
+ </filter>
+ <filter-mapping>
+ <filter-name>PushFilter</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+ <mime-mapping>
+ <extension>ecss</extension>
+ <mime-type>text/css</mime-type>
+ </mime-mapping>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/examples/irc-client/src/main/webapp/index.jsp
===================================================================
--- trunk/examples/irc-client/src/main/webapp/index.jsp (rev 0)
+++ trunk/examples/irc-client/src/main/webapp/index.jsp 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,7 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head></head>
+ <body>
+ <jsp:forward page="/welcome.jsf" />
+ </body>
+</html>
\ No newline at end of file
Added: trunk/examples/irc-client/src/main/webapp/templates/includes/skin-chooser.xhtml
===================================================================
--- trunk/examples/irc-client/src/main/webapp/templates/includes/skin-chooser.xhtml (rev 0)
+++ trunk/examples/irc-client/src/main/webapp/templates/includes/skin-chooser.xhtml 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ 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:rich="http://richfaces.org/rich">
+
+<ui:composition>
+ <h:form>
+ <rich:panel styleClass="skin-chooser">
+ <a4j:repeat var="skin" value="#{skinBean.skins}"
+ iterationStatusVar="iterStatus">
+ <h:link value="#{skin}" includeViewParams="true">
+ <f:param name="skin" value="#{skin}" />
+ <f:attribute name="style"
+ value="#{(skin==skinBean.skin) ? 'color:orange' : ''}" />
+ </h:link>
+ <h:outputText value=" | " rendered="#{not iterStatus.last}" />
+ </a4j:repeat>
+ </rich:panel>
+ </h:form>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added: trunk/examples/irc-client/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/irc-client/src/main/webapp/templates/template.xhtml (rev 0)
+++ trunk/examples/irc-client/src/main/webapp/templates/template.xhtml 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ 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">
+<f:view contentType="text/html">
+ <f:metadata>
+ <f:viewParam name="skin" value="#{skinBean.skin}" />
+ </f:metadata>
+ <h:head>
+ <title><ui:define name="title">Application Title</ui:define></title>
+ <meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" />
+ </h:head>
+
+ <h:body>
+ <ui:include src="/templates/includes/skin-chooser.xhtml" />
+ <ui:insert name="body">Default content</ui:insert>
+ </h:body>
+</f:view>
+</html>
Added: trunk/examples/irc-client/src/main/webapp/welcome.xhtml
===================================================================
--- trunk/examples/irc-client/src/main/webapp/welcome.xhtml (rev 0)
+++ trunk/examples/irc-client/src/main/webapp/welcome.xhtml 2011-01-27 11:24:20 UTC (rev 21266)
@@ -0,0 +1,80 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns: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:rich="http://richfaces.org/rich"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ template="/templates/template.xhtml">
+ <ui:define name="body">
+ <style>
+.chatOutput {
+ overflow: auto;
+ width: 80%;
+ height: 200px;
+ float: left;
+}
+
+.chatList {
+ float: right;
+ width: 19%;
+ height: 200px;
+ overflow: auto;
+}
+</style>
+ <rich:panel header="Connect to IRC"
+ rendered="#{not chatBean.connected}">
+ <h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages style="color:red" />
+ </a4j:outputPanel>
+ <h:panelGrid columns="2">
+ <h:outputText value="Your nickname:" />
+ <h:inputText required="true" id="name" value="#{chatBean.userName}" />
+ <h:outputText value="Channel:" />
+ <h:outputText value="RichFaces" style="font-weight:bold"/>
+ <h:outputText value="Server:" />
+ <h:outputText value="irc.freenode.org" style="font-weight:bold"/>
+ </h:panelGrid>
+ <a4j:commandButton value="Connect" execute="@form" render="@all"
+ action="#{chatBean.connect}" />
+ </h:form>
+ </rich:panel>
+ <rich:panel
+ header="Welcome to #{chatBean.channelName} channel at #{chatBean.serverName}"
+ rendered="#{chatBean.connected}" id="chatpanel">
+ <rich:panel styleClass="chatOutput"
+ bodyClass="#{chatBean.channelName}Output" />
+ <rich:panel styleClass="chatList">
+ <rich:list value="#{chatBean.users}" var="user" id="users"
+ type="unordered">
+ #{user.nick}
+ </rich:list>
+ </rich:panel>
+ <br clear="all" />
+ <hr />
+ <h:form>
+ <a4j:push address="#{chatBean.userName}_#{chatBean.channelName}List@chat"
+ onerror="alert(event.rf.data)">
+ <a4j:ajax event="dataavailable" render="users" execute="@none" />
+ </a4j:push>
+ <a4j:push address="#{chatBean.userName}_#{chatBean.channelName}@chat"
+ onerror="alert(event.rf.data)"
+ ondataavailable="jQuery('<div />').prependTo('.#{chatBean.channelName}Output').text(event.rf.data)" />
+ <h:inputTextarea value="#{chatBean.message}" rows="3"
+ style="width:80%" id="nm" />
+ <a4j:commandButton value="Send" action="#{chatBean.send}"
+ render="@none" execute="@form" />
+ </h:form>
+ <hr />
+ <h:form>
+ <rich:panel header="Change nickname:">
+ <h:inputText valueChangeListener="#{chatBean.changeNick}" id="cn" />
+ <a4j:commandButton value="Change" execute="@form" render="@none"/>
+ </rich:panel>
+ <a4j:commandButton value="disconnect" action="#{chatBean.leave}" execute="@none" render="@all"/>
+ </h:form>
+ </rich:panel>
+ </ui:define>
+</ui:composition>
\ No newline at end of file
13 years, 11 months