Author: nbelaevski
Date: 2009-12-29 14:11:56 -0500 (Tue, 29 Dec 2009)
New Revision: 16224
Added:
root/examples/trunk/components/core-demo/src/main/webapp/queue.xhtml
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIQueue.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlQueue.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java
Modified:
root/examples/trunk/components/core-demo/src/main/webapp/welcome.xhtml
root/ui/trunk/components/core/src/main/config/faces-config.xml
root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml
Log:
https://jira.jboss.org/jira/browse/RF-7896
Added: root/examples/trunk/components/core-demo/src/main/webapp/queue.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/queue.xhtml
(rev 0)
+++ root/examples/trunk/components/core-demo/src/main/webapp/queue.xhtml 2009-12-29
19:11:56 UTC (rev 16224)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j">
+<f:view>
+ <h:head>
+ </h:head>
+ <h:body>
+ <a4j:queue />
+
+ <h:form>
+ <h:commandLink value="Common link" />
+ </h:form>
+ </h:body>
+</f:view>
+</html>
\ No newline at end of file
Modified: root/examples/trunk/components/core-demo/src/main/webapp/welcome.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/welcome.xhtml 2009-12-29
18:05:21 UTC (rev 16223)
+++ root/examples/trunk/components/core-demo/src/main/webapp/welcome.xhtml 2009-12-29
19:11:56 UTC (rev 16224)
@@ -39,6 +39,9 @@
<li>
<h:outputLink
value="#{facesContext.externalContext.requestContextPath}/dynamicExecute.jsf">Server
side execute/render</h:outputLink>
</li>
+<li>
+<h:outputLink
value="#{facesContext.externalContext.requestContextPath}/queue.jsf">a4j:queue</h:outputLink>
+</li>
</ul>
</center>
</h:body>
Modified: root/ui/trunk/components/core/src/main/config/faces-config.xml
===================================================================
--- root/ui/trunk/components/core/src/main/config/faces-config.xml 2009-12-29 18:05:21 UTC
(rev 16223)
+++ root/ui/trunk/components/core/src/main/config/faces-config.xml 2009-12-29 19:11:56 UTC
(rev 16224)
@@ -67,6 +67,14 @@
</component-extension>
</component>
+ <component>
+ <component-type>org.richfaces.Queue</component-type>
+ <component-class>org.richfaces.component.html.HtmlQueue</component-class>
+ <component-extension>
+ <cdk:generate
xmlns:cdk="http://richfaces.org/cdk/extensions">false</cd...
+ </component-extension>
+ </component>
+
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
<renderer>
@@ -89,5 +97,10 @@
<renderer-type>org.richfaces.StatusRenderer</renderer-type>
<renderer-class>org.richfaces.renderkit.html.AjaxStatusRenderer</renderer-class>
</renderer>
+ <renderer>
+ <component-family>org.richfaces.Queue</component-family>
+ <renderer-type>org.richfaces.QueueRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.QueueRenderer</renderer-class>
+ </renderer>
</render-kit>
</faces-config>
\ No newline at end of file
Added: root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIQueue.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIQueue.java
(rev 0)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIQueue.java 2009-12-29
19:11:56 UTC (rev 16224)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class UIQueue extends UIComponentBase {
+
+ public static final String GLOBAL_QUEUE_NAME =
"org.richfaces.queue.global";
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Queue";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Queue";
+
+ private enum PropertyKeys {
+ requestDelay, status
+ }
+
+ public UIQueue() {
+ setRendererType("org.richfaces.QueueRenderer");
+ }
+
+ public int getRequestDelay() {
+ return (Integer) getStateHelper().eval(PropertyKeys.requestDelay,
Integer.MIN_VALUE);
+ }
+
+ public void setRequestDelay(int requestDelay) {
+ getStateHelper().put(PropertyKeys.requestDelay, requestDelay);
+ }
+
+ public String getStatus() {
+ return (String) getStateHelper().eval(PropertyKeys.status);
+ }
+
+ public void setStatus(String status) {
+ getStateHelper().put(PropertyKeys.status, status);
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+}
Added:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlQueue.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlQueue.java
(rev 0)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlQueue.java 2009-12-29
19:11:56 UTC (rev 16224)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.component.html;
+
+import org.richfaces.component.UIQueue;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class HtmlQueue extends UIQueue {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Queue";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Queue";
+
+ private enum PropertyKeys {
+ onsubmit, oncomplete, onbeforedomupdate, onerror, onevent, onrequestqueue,
onrequestdequeue
+ }
+
+ public HtmlQueue() {
+ setRendererType("org.richfaces.QueueRenderer");
+ }
+
+ public String getOnsubmit() {
+ return (String) getStateHelper().eval(PropertyKeys.onsubmit);
+ }
+
+ public void setOnsubmit(String onsubmit) {
+ getStateHelper().put(PropertyKeys.onsubmit, onsubmit);
+ }
+
+ public String getOncomplete() {
+ return (String) getStateHelper().eval(PropertyKeys.oncomplete);
+ }
+
+ public void setOncomplete(String oncomplete) {
+ getStateHelper().put(PropertyKeys.oncomplete, oncomplete);
+ }
+
+ public String getOnbeforedomupdate() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforedomupdate);
+ }
+
+ public void setOnbeforedomupdate(String onbeforedomupdate) {
+ getStateHelper().put(PropertyKeys.onbeforedomupdate, onbeforedomupdate);
+ }
+
+ public String getOnerror() {
+ return (String) getStateHelper().eval(PropertyKeys.onerror);
+ }
+
+ public void setOnerror(String onerror) {
+ getStateHelper().put(PropertyKeys.onerror, onerror);
+ }
+
+ public String getOnevent() {
+ return (String) getStateHelper().eval(PropertyKeys.onevent);
+ }
+
+ public void setOnevent(String onevent) {
+ getStateHelper().put(PropertyKeys.onevent, onevent);
+ }
+
+ public String getOnrequestqueue() {
+ return (String) getStateHelper().eval(PropertyKeys.onrequestqueue);
+ }
+
+ public void setOnrequestqueue(String onrequestqueue) {
+ getStateHelper().put(PropertyKeys.onrequestqueue, onrequestqueue);
+ }
+
+ public String getOnrequestdequeue() {
+ return (String) getStateHelper().eval(PropertyKeys.onrequestdequeue);
+ }
+
+ public void setOnrequestdequeue(String onrequestdequeue) {
+ getStateHelper().put(PropertyKeys.onrequestdequeue, onrequestdequeue);
+ }
+
+}
Added:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java
(rev 0)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java 2009-12-29
19:11:56 UTC (rev 16224)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.renderkit.html;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ComponentSystemEventListener;
+import javax.faces.event.ListenerFor;
+import javax.faces.event.PostAddToViewEvent;
+import javax.faces.render.Renderer;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ResourceDependencies( { @ResourceDependency(library = "javax.faces", name =
"jsf.js"),
+ @ResourceDependency(name = "jquery.js"), @ResourceDependency(name =
"richfaces.js"),
+ @ResourceDependency(name = "richfaces-queue.js")
+ })
+@ListenerFor(systemEventClass = PostAddToViewEvent.class)
+public class QueueRenderer extends Renderer implements ComponentSystemEventListener {
+
+ public void processEvent(ComponentSystemEvent event) throws AbortProcessingException
{
+ //TODO encode queue settings
+ }
+}
Modified: root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml 2009-12-29
18:05:21 UTC (rev 16223)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml 2009-12-29
19:11:56 UTC (rev 16224)
@@ -61,6 +61,13 @@
<renderer-type>org.richfaces.CommandButtonRenderer</renderer-type>
</component>
</tag>
+ <tag>
+ <tag-name>queue</tag-name>
+ <component>
+ <component-type>org.richfaces.Queue</component-type>
+ <renderer-type>org.richfaces.QueueRenderer</renderer-type>
+ </component>
+ </tag>
<tag>
<tag-name>ajax</tag-name>