JBoss Rich Faces SVN: r11350 - in trunk/test-applications/realworld: web/src/main/java/org/richfaces/realworld/fileupload and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-11-25 05:31:53 -0500 (Tue, 25 Nov 2008)
New Revision: 11350
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-11-25 09:39:51 UTC (rev 11349)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-11-25 10:31:53 UTC (rev 11350)
@@ -29,4 +29,6 @@
@Destroy
public abstract void destroy();
+ public abstract void addImage(Image image);
+
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-11-25 09:39:51 UTC (rev 11349)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-11-25 10:31:53 UTC (rev 11350)
@@ -72,4 +72,9 @@
}
em.flush();
}
+
+ public void addImage(Image image) {
+ em.persist(image);
+ em.flush();
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-11-25 09:39:51 UTC (rev 11349)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-11-25 10:31:53 UTC (rev 11350)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Date;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
@@ -34,7 +35,10 @@
import org.jboss.seam.faces.FacesMessages;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
+import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.tree.TreeSelectionManager;
/**
* @author $Autor$
@@ -45,6 +49,15 @@
@Synchronized(timeout=2000)
public class FileUploadBean {
+ @In @Out
+ private User user;
+
+ @In
+ TreeSelectionManager treeSelectionManager;
+
+ @In
+ TreeActionManager treeActionManager;
+
@In(create=true)
private FileManager fileManager;
@@ -90,20 +103,44 @@
public void storeSelectedData() {
for(FileItem file:files){
if(file.isSelected()){
- //TODO
//Save file to disk
- //Update tree
+ String fileName = user.getLogin() + fileManager.getFileSeparator() + treeSelectionManager.getSelectedAlbumItem().getAlbum().getName() + fileManager.getFileSeparator() + file.getName();
+ try {
+ fileManager.addImage(fileName , file.getData());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
//Update domain model
+ Image image = new Image();
+ image.setCreated(new Date());
+ image.setPath(file.getName());
+ image.setName("TODO");
+ image.setDescription("TODO");
+ image.setAlbum(treeSelectionManager.getSelectedAlbumItem().getAlbum());
+ treeActionManager.addImage(image);
}
}
}
public void storeAll() {
for(FileItem file:files){
- //TODO
- //Save file to disk
- //Update tree
- //Update domain model
+ //Save file to disk
+ String fileName = user.getLogin() + fileManager.getFileSeparator() + treeSelectionManager.getSelectedAlbumItem().getAlbum().getName() + fileManager.getFileSeparator() + file.getName();
+ try {
+ fileManager.addImage(fileName , file.getData());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ //Update domain model
+ Image image = new Image();
+ image.setCreated(new Date());
+ image.setPath(file.getName());
+ image.setName("TODO");
+ image.setDescription("TODO");
+ image.setAlbum(treeSelectionManager.getSelectedAlbumItem().getAlbum());
+ treeActionManager.addImage(image);
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-11-25 09:39:51 UTC (rev 11349)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-11-25 10:31:53 UTC (rev 11350)
@@ -107,4 +107,13 @@
imageItem.setImage(image);
}
}
+
+ public void addImage(Image image) {
+ imageAction.addImage(image);
+ TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
+ TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
+ albumItem.addChild(image.getId(), imageItem);
+ treeSelectionManager.setSelectedImage(imageItem);
+ treeSelectionManager.setSelectedAlbumItem(albumItem);
+ }
}
17 years, 1 month
JBoss Rich Faces SVN: r11349 - trunk/ui/extendedDataTable/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-11-25 04:39:51 -0500 (Tue, 25 Nov 2008)
New Revision: 11349
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java
Log:
https://jira.jboss.org/jira/browse/RF-5041
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java 2008-11-25 09:39:37 UTC (rev 11348)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java 2008-11-25 09:39:51 UTC (rev 11349)
@@ -316,7 +316,7 @@
public String getColumnSize(UIComponent column){
if (value == null)
return getDefaultColumnSize(column);
- String res = value.get(column.getId()).toString();
+ String res = (String)value.get(column.getId());
if (res == null){
res = getDefaultColumnSize(column);
}
17 years, 1 month
JBoss Rich Faces SVN: r11348 - in trunk/test-applications/jsp/src/main: webapp/Message and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tromanovich
Date: 2008-11-25 04:39:37 -0500 (Tue, 25 Nov 2008)
New Revision: 11348
Modified:
trunk/test-applications/jsp/src/main/java/message/Message.java
trunk/test-applications/jsp/src/main/webapp/Message/Message.jsp
trunk/test-applications/jsp/src/main/webapp/Message/MessageProperty.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/java/message/Message.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/message/Message.java 2008-11-25 08:27:03 UTC (rev 11347)
+++ trunk/test-applications/jsp/src/main/java/message/Message.java 2008-11-25 09:39:37 UTC (rev 11348)
@@ -6,7 +6,7 @@
import util.componentInfo.ComponentInfo;
public class Message {
- private String msg;
+ private String msgs;
private String layout;
private String title;
private boolean showDetail;
@@ -43,7 +43,7 @@
}
public Message() {
- msg = "select1";
+ msgs = "select1";
layout = "table";
title = "Title";
showDetail = true;
@@ -56,12 +56,12 @@
select5 = "error";
}
- public String getMsg() {
- return msg;
+ public String getMsgs() {
+ return msgs;
}
- public void setMsg(String msg) {
- this.msg = msg;
+ public void setMsgs(String msg) {
+ this.msgs = msg;
}
public String getLayout() {
@@ -146,7 +146,7 @@
public void bTest1(){
setLayout("table");
- setMsg("fatal");
+ setMsgs("fatal");
setShowDetail(true);
setShowSummary(true);
setTitle("Test1");
@@ -160,7 +160,7 @@
public void bTest2(){
setLayout("table");
- setMsg("error");
+ setMsgs("error");
setShowDetail(false);
setShowSummary(true);
setTitle("Test2");
@@ -174,7 +174,7 @@
public void bTest3(){
setLayout("table");
- setMsg("passed");
+ setMsgs("passed");
setShowDetail(true);
setShowSummary(false);
setTitle("Test3");
@@ -188,7 +188,7 @@
public void bTest4(){
setLayout("table");
- setMsg("passed");
+ setMsgs("passed");
setShowDetail(true);
setShowSummary(true);
setTitle("Test4");
@@ -202,7 +202,7 @@
public void bTest5(){
setLayout("table");
- setMsg("warn");
+ setMsgs("warn");
setShowDetail(false);
setShowSummary(false);
setTitle("Test5");
Modified: trunk/test-applications/jsp/src/main/webapp/Message/Message.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Message/Message.jsp 2008-11-25 08:27:03 UTC (rev 11347)
+++ trunk/test-applications/jsp/src/main/webapp/Message/Message.jsp 2008-11-25 09:39:37 UTC (rev 11348)
@@ -11,7 +11,7 @@
<br />
</f:verbatim>
- <rich:message for="#{message.msg}" binding="#{message.htmlMessage}" tooltip="#{message.tooltip}" showDetail="#{message.showDetail}"
+ <rich:message for="#{message.msgs}" binding="#{message.htmlMessage}" tooltip="#{message.tooltip}" showDetail="#{message.showDetail}"
showSummary="#{message.showSummary}" passedLabel="No Error" errorLabelClass="errorLabel" fatalLabelClass="warnLabel"
infoLabelClass="infoLabel" warnLabelClass="fatalLabel" title="#{message.title}" id="messageID">
Modified: trunk/test-applications/jsp/src/main/webapp/Message/MessageProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Message/MessageProperty.jsp 2008-11-25 08:27:03 UTC (rev 11347)
+++ trunk/test-applications/jsp/src/main/webapp/Message/MessageProperty.jsp 2008-11-25 09:39:37 UTC (rev 11348)
@@ -57,7 +57,7 @@
</h:selectOneMenu>
<h:outputText value="Rich Message Demo:" />
- <h:selectOneMenu value="#{message.msg}">
+ <h:selectOneMenu value="#{message.msgs}">
<f:selectItem itemValue="no" itemLabel="no" />
<f:selectItem itemValue="select1" itemLabel="1" />
<f:selectItem itemValue="select2" itemLabel="2" />
@@ -87,8 +87,8 @@
<h:commandButton value="submit" />
<a4j:commandButton value="submit ajax" />
</h:panelGrid>
+ <%--br />
<br />
- <br />
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
<rich:column>
@@ -103,5 +103,5 @@
<rich:column id="findID2">
<h:outputText value="#{rich:findComponent('messagesID').rendererType}" />
</rich:column>
- </h:panelGrid>
+ </h:panelGrid--%>
</f:subview>
\ No newline at end of file
17 years, 1 month
JBoss Rich Faces SVN: r11347 - in trunk/ui: dataFilterSlider/src/main/config/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-11-25 03:27:03 -0500 (Tue, 25 Nov 2008)
New Revision: 11347
Modified:
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml
trunk/ui/datascroller/src/main/config/component/datascroller.xml
Log:
RF-2220 - default value for calendar, dataFilterSlider and datascroller attributes has been added
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2008-11-25 08:25:33 UTC (rev 11346)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2008-11-25 08:27:03 UTC (rev 11347)
@@ -121,14 +121,14 @@
<classname>java.lang.Object</classname>
<description>Defines time that will be used:
1) to set time when the value is empty
- 2) to set time when date changes and flag "resetTimeOnDateSelect" is true </description>
+ 2) to set time when date changes and flag "resetTimeOnDateSelect" is true. Default value is "getDefaultValueOfDefaultTime()" </description>
<defaultvalue>getDefaultValueOfDefaultTime()</defaultvalue>
</property>
<property>
<name>resetTimeOnDateSelect</name>
<classname>boolean</classname>
- <description>If value is true then calendar should change time to defaultTime for newly-selected dates.</description>
+ <description>If value is true then calendar should change time to defaultTime for newly-selected dates. Default value is "false"</description>
<defaultvalue>false</defaultvalue>
</property>
@@ -444,6 +444,7 @@
<classname>boolean</classname>
<description>
boolean attribute which provides possibility to limit JSF tree processing(decoding, conversion/validation, value applying) to the component which send the request only.
+ Default value is "true"
</description>
<defaultvalue>true</defaultvalue>
</property>
Modified: trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml
===================================================================
--- trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml 2008-11-25 08:25:33 UTC (rev 11346)
+++ trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml 2008-11-25 08:27:03 UTC (rev 11347)
@@ -130,7 +130,8 @@
<classname>boolean</classname>
<description>
False value for this attribute makes text field "read-only" and "hidden".
- Hence, the value can be changed only from a handle
+ Hence, the value can be changed only from a handle.
+ Default value is "true"
</description>
<defaultvalue>true</defaultvalue>
</property>
@@ -221,7 +222,7 @@
<name>onchange</name>
<classname>java.lang.String</classname>
<description>
- Event occur on chage
+ Event occur on change
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
Modified: trunk/ui/datascroller/src/main/config/component/datascroller.xml
===================================================================
--- trunk/ui/datascroller/src/main/config/component/datascroller.xml 2008-11-25 08:25:33 UTC (rev 11346)
+++ trunk/ui/datascroller/src/main/config/component/datascroller.xml 2008-11-25 08:27:03 UTC (rev 11347)
@@ -199,6 +199,7 @@
<classname>boolean</classname>
<description>
Boolean attribute which provides possibility to limit JSF tree processing(decoding, conversion/validation, value applying) to the component which send the request only.
+ Default value is "true"
</description>
<defaultvalue>true</defaultvalue>
</property>
17 years, 1 month
JBoss Rich Faces SVN: r11346 - trunk/cdk/generator/src/main/resources/META-INF/schema/entities.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-11-25 03:25:33 -0500 (Tue, 25 Nov 2008)
New Revision: 11346
Modified:
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_component_attributes.ent
Log:
RF-696 - similarityGroupingID attribute description has been added
Modified: trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_component_attributes.ent
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_component_attributes.ent 2008-11-25 00:46:49 UTC (rev 11345)
+++ trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_component_attributes.ent 2008-11-25 08:25:33 UTC (rev 11346)
@@ -104,6 +104,7 @@
<property>
<name>similarityGroupingId</name>
<classname>java.lang.String</classname>
+ <description>If there are any component requests with identical IDs then these requests will be grouped.</description>
</property>
<!--
<property >
17 years, 1 month
JBoss Rich Faces SVN: r11345 - in trunk/samples/queue-sample/src/main: webapp and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-24 19:46:49 -0500 (Mon, 24 Nov 2008)
New Revision: 11345
Added:
trunk/samples/queue-sample/src/main/java/org/richfaces/MojarraBean.java
trunk/samples/queue-sample/src/main/webapp/mojarra.xhtml
trunk/samples/queue-sample/src/main/webapp/resources/
trunk/samples/queue-sample/src/main/webapp/resources/bgblack18.jpg
trunk/samples/queue-sample/src/main/webapp/resources/button2.gif
trunk/samples/queue-sample/src/main/webapp/resources/button3.gif
trunk/samples/queue-sample/src/main/webapp/resources/stylesheet.css
trunk/samples/queue-sample/src/main/webapp/resources/ui.js
Modified:
trunk/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/queue-sample/src/main/webapp/WEB-INF/web.xml
Log:
JSF 2.0 queue demo rewritten
Added: trunk/samples/queue-sample/src/main/java/org/richfaces/MojarraBean.java
===================================================================
--- trunk/samples/queue-sample/src/main/java/org/richfaces/MojarraBean.java (rev 0)
+++ trunk/samples/queue-sample/src/main/java/org/richfaces/MojarraBean.java 2008-11-25 00:46:49 UTC (rev 11345)
@@ -0,0 +1,25 @@
+package org.richfaces;
+
+
+import java.util.Random;
+
+import javax.faces.event.ActionEvent;
+
+/**
+ * <p>This simple bean conains one <code>ActionEvent</code>
+ * handler to simulate random processing times for
+ * requests on the server.
+ * <p/>
+ *
+ */
+public class MojarraBean {
+
+ public void process(ActionEvent ae) {
+ Random generator2 = new Random(System.currentTimeMillis());
+ int delay = generator2.nextInt(6001) + 1;
+ try {
+ Thread.sleep(delay);
+ } catch (Exception e) {
+ }
+ }
+}
Modified: trunk/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-11-24 23:02:49 UTC (rev 11344)
+++ trunk/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-11-25 00:46:49 UTC (rev 11345)
@@ -13,6 +13,11 @@
<managed-bean-class>org.richfaces.OversizeBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>mojarraBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.MojarraBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
Modified: trunk/samples/queue-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/WEB-INF/web.xml 2008-11-24 23:02:49 UTC (rev 11344)
+++ trunk/samples/queue-sample/src/main/webapp/WEB-INF/web.xml 2008-11-25 00:46:49 UTC (rev 11345)
@@ -24,10 +24,10 @@
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>DEFAULT</param-value>
</context-param>
- <!-- context-param>
+ <context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
- <param-value>NONE</param-value>
- </context-param -->
+ <param-value>DEFAULT</param-value>
+ </context-param>
<!--
-->
Added: trunk/samples/queue-sample/src/main/webapp/mojarra.xhtml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/mojarra.xhtml (rev 0)
+++ trunk/samples/queue-sample/src/main/webapp/mojarra.xhtml 2008-11-25 00:46:49 UTC (rev 11345)
@@ -0,0 +1,78 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jstl/core">
+<f:view contentType="text/html" />
+
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Ajax</title>
+ <link type="text/css" href="resources/stylesheet.css" rel="stylesheet" />
+ <script src="resources/ui.js"></script>
+</head>
+
+
+<body>
+
+ <h:form id="form1" prependId="false">
+ <a4j:queue />
+
+ <h:panelGrid styleClass="title-panel">
+ <h:panelGrid columns="2" cellpadding="20">
+ <h:outputText value="a j a x R e q u e s t"
+ styleClass="title-panel-text" />
+ <h:outputText value="Q u e u e" styleClass="title-panel-text" />
+ </h:panelGrid>
+ <h:outputText value="Powered By RichFaces 3.3.0 "
+ styleClass="title-panel-subtext" />
+ </h:panelGrid>
+
+ <h:panelGrid border="1">
+ <f:facet name="header">
+ <h:outputText value="Instructions" styleClass="keytitle" />
+ </f:facet>
+ The <b>Ajax Requests</b> area represent individual Ajax requests that can be fired by clicking the green images. Each click fires a <br />
+ <i>jsf.ajaxRequest</i>. A <i>JSF managed bean</i> on the server causes a random sleep time (4 seconds or less) to simulate <br />
+ different processing times for each request. The JSF 2.0 Ajax request queue on the client uses the <i>observer</i> pattern to "record" queue events as they happen.<br />
+ The demo JavaScript on the client includes a function that subscribes to these queue events, so the UI is updated as queue events happen.<br />
+ Just click on any sequence of green images (any number, any order) and you will see that each request is handled in the order they were fired.
+ </h:panelGrid>
+
+ <h:panelGrid columns="2" cellspacing="5">
+ <h:panelGrid id="board1" columns="6" border="1">
+ <f:facet name="header">
+ <h:outputText value="Ajax Requests" styleClass="keytitle" />
+ </f:facet>
+
+ <c:forEach begin="0" end="17" step="1" var="i">
+ <h:panelGrid>
+ <a4j:commandButton id="_#{i}" image="resources/button2.gif"
+ style="height:50px;width:50px;"
+ onclick="buttonpush('_#{i}');"
+ oncomplete="buttonpop('_#{i}');"
+ actionListener="#{mojarraBean.process}" />
+ <h:panelGrid cellpadding="5">
+ <h:outputText value="_#{i}" />
+ </h:panelGrid>
+ </h:panelGrid>
+ </c:forEach>
+ </h:panelGrid>
+ <h:panelGrid>
+ <f:facet name="header">
+ <h:outputText value="Request Queue" styleClass="keytitle" />
+ </f:facet>
+ <table id="queuetable" border="1">
+ <tr id="tr1">
+ </tr>
+ </table>
+ </h:panelGrid>
+ </h:panelGrid>
+
+ </h:form>
+
+</body>
+
+</html>
Added: trunk/samples/queue-sample/src/main/webapp/resources/bgblack18.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/samples/queue-sample/src/main/webapp/resources/bgblack18.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/queue-sample/src/main/webapp/resources/button2.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/queue-sample/src/main/webapp/resources/button2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/queue-sample/src/main/webapp/resources/button3.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/queue-sample/src/main/webapp/resources/button3.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/queue-sample/src/main/webapp/resources/stylesheet.css
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/resources/stylesheet.css (rev 0)
+++ trunk/samples/queue-sample/src/main/webapp/resources/stylesheet.css 2008-11-25 00:46:49 UTC (rev 11345)
@@ -0,0 +1,90 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+.title-panel {
+ background-image: url('bgblack18.jpg');
+ height: 80px;
+ width: 900px;
+}
+
+.title-panel-text {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 24px;
+ font-weight: bold;
+}
+
+.title-panel-subtext {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 14px;
+ font-style: italic
+}
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.panel-input-border {
+ border: 2px outset blue;
+ background-color: #e0eeee;
+}
+
+.panel-data-border {
+ border: 3px outset blue;
+ background-color: #e0eeee;
+}
+
+.keytitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: #330066;
+}
+
+.ticker {
+ position: relative;
+ visibility: hidden;
+ font-size: 16px;
+}
+
+.serialize-border {
+ border: 4px outset red;
+}
+
+.queueCell {
+ background-color: #00ffff;
+}
Added: trunk/samples/queue-sample/src/main/webapp/resources/ui.js
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/resources/ui.js (rev 0)
+++ trunk/samples/queue-sample/src/main/webapp/resources/ui.js 2008-11-25 00:46:49 UTC (rev 11345)
@@ -0,0 +1,50 @@
+var disabledImage = 'resources/button3.gif';
+var enabledImage = 'resources/button2.gif';
+
+function buttonpush(buttonName) {
+ var button = document.getElementById(buttonName);
+ if (!button.disabled) {
+ button.src = disabledImage;
+ button.disabled = true;
+ }
+ var txt = document.createTextNode(buttonName);
+ addCell(txt);
+}
+
+function buttonpop(buttonName) {
+ var txt = document.createTextNode(buttonName);
+ removeCell(txt);
+}
+
+function addCell(cellData) {
+ var cell = document.getElementById("tr1").insertCell(0);
+ cell.setAttribute("height", "50px");
+ cell.setAttribute("width", "50px");
+ cell.innerHTML = cellData.nodeValue;
+ cell.className = "queueCell";
+}
+
+function removeCell(cellData) {
+ var row = document.getElementById("tr1");
+ var cells = row.getElementsByTagName("td");
+ if (typeof cells != 'undefined' || cells != null) {
+ for (var i=0; i<cells.length; i++) {
+ if (cells[i].firstChild.nodeValue == cellData.nodeValue) {
+ row.deleteCell(i);
+ var button = document.getElementById(cellData.nodeValue);
+ button.disabled = false;
+ button.src = enabledImage;
+ break;
+ }
+ }
+ }
+}
+
+function errorMsg(eventName, data) {
+ alert("Name: "+eventName+" Error Status: "+data.statusMessage);
+}
+
+// Listen for all queue events
+//OpenAjax.hub.subscribe("javax.faces.Event.**",msg);
+// Listen for all error events
+//OpenAjax.hub.subscribe("javax.faces.Error.**",errorMsg);
\ No newline at end of file
17 years, 1 month
JBoss Rich Faces SVN: r11344 - trunk/samples/queue-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-24 18:02:49 -0500 (Mon, 24 Nov 2008)
New Revision: 11344
Modified:
trunk/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml
Log:
removed from demo
Modified: trunk/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml 2008-11-24 23:01:33 UTC (rev 11343)
+++ trunk/samples/queue-sample/src/main/webapp/pages/sized-queue.xhtml 2008-11-24 23:02:49 UTC (rev 11344)
@@ -59,7 +59,7 @@
<tr>
<a4j:repeat value="#{oversizeBean.queueNames}" var="queueName">
<td>
- #{oversizeBean.queueData[queueName]} 
+ #{oversizeBean.queueData[queueName]}
</td>
</a4j:repeat>
</tr>
@@ -83,7 +83,6 @@
<a4j:actionparam name="queueName" value="#{queueName}"/>
</a4j:jsFunction>
</c:forEach>
-   
</c:forEach>
<br />
17 years, 1 month
JBoss Rich Faces SVN: r11343 - trunk/samples/queue-sample/src/main/webapp/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-24 18:01:33 -0500 (Mon, 24 Nov 2008)
New Revision: 11343
Modified:
trunk/samples/queue-sample/src/main/webapp/templates/index.xhtml
Log:
removed from demo
Modified: trunk/samples/queue-sample/src/main/webapp/templates/index.xhtml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/templates/index.xhtml 2008-11-24 22:56:57 UTC (rev 11342)
+++ trunk/samples/queue-sample/src/main/webapp/templates/index.xhtml 2008-11-24 23:01:33 UTC (rev 11343)
@@ -14,11 +14,9 @@
<ui:insert name="formQueue" />
<a4j:outputPanel ajaxRendered="true" layout="inline">
- <h:outputText value="#{empty ajaxRequestsCount ? 0 : ajaxRequestsCount}" />
+ <h:outputText value="#{empty ajaxRequestsCount ? 0 : ajaxRequestsCount} " />
</a4j:outputPanel>
-  
-
<a4j:commandLink eventsQueue="resetCounterQueue" value="Reset ajax counter" action="#{bean.resetAjaxCounter}" onclick="hideLog()" oncomplete="LOG.clear();showLog();"/>
<br /><br />
17 years, 1 month
JBoss Rich Faces SVN: r11342 - trunk/ui/assembly.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-24 17:56:57 -0500 (Mon, 24 Nov 2008)
New Revision: 11342
Modified:
trunk/ui/assembly/pom.xml
Log:
Editor scripts excluded from aggregate ui script
Modified: trunk/ui/assembly/pom.xml
===================================================================
--- trunk/ui/assembly/pom.xml 2008-11-24 22:46:07 UTC (rev 11341)
+++ trunk/ui/assembly/pom.xml 2008-11-24 22:56:57 UTC (rev 11342)
@@ -210,6 +210,7 @@
<include>
${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/common-scrollable-data-table-min.js
</include>
+
<include>**/*-min.js</include>
</includes>
<!-- files to exclude, path relative to output's directory -->
@@ -220,6 +221,19 @@
${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery.jcarousel-min.js
</exclude>
-->
+
+ <!-- rich:editor configuration -->
+ <exclude>**/tiny_mce/**</exclude>
+ <exclude>**/editor-min.js</exclude>
+
+ <!-- include>
+ ${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src-min.js
+ </include>
+ <include>
+ ${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/editor-min.js
+ </include -->
+ <!-- -->
+
<exclude>**/scriptaculo*</exclude>
<exclude>**/scriptaculo*/**</exclude>
</excludes>
17 years, 1 month
JBoss Rich Faces SVN: r11341 - in trunk/framework/impl/src/main/java/org/ajax4jsf: context and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-24 17:46:07 -0500 (Mon, 24 Nov 2008)
New Revision: 11341
Removed:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIQueue.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
Log:
Queue code refactored
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java 2008-11-24 22:45:49 UTC (rev 11340)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java 2008-11-24 22:46:07 UTC (rev 11341)
@@ -34,31 +34,51 @@
*/
public class QueueRegistry {
+ //TODO move to appropriate place
+ public static final String GLOBAL_QUEUE_NAME = "org.richfaces.queue.global";
+
private static final String REGISTRY_ATTRIBUTE_NAME = QueueRegistry.class.getName();
- public static void registerQueue(FacesContext context, String clientName, Object data) {
+ private Map<String, Object> queuesData = new LinkedHashMap<String, Object>();
+
+ private QueueRegistry() {
+ }
+
+ public static QueueRegistry getInstance(FacesContext context) {
ExternalContext externalContext = context.getExternalContext();
Map<String, Object> requestMap = externalContext.getRequestMap();
- Map<String, Object> registryMap = (Map<String, Object>)
+ QueueRegistry registry = (QueueRegistry)
requestMap.get(REGISTRY_ATTRIBUTE_NAME);
- if (registryMap == null) {
- registryMap = new LinkedHashMap<String, Object>();
- requestMap.put(REGISTRY_ATTRIBUTE_NAME, registryMap);
+ if (registry == null) {
+ registry = new QueueRegistry();
+ requestMap.put(REGISTRY_ATTRIBUTE_NAME, registry);
}
- if (!registryMap.containsKey(clientName)) {
- registryMap.put(clientName, data);
+ return registry;
+ }
+
+ public void registerQueue(FacesContext context, String clientName, Object data) {
+ if (!queuesData.containsKey(clientName)) {
+ queuesData.put(clientName, data);
} else {
context.getExternalContext().log("Queue with name '" + clientName + "' has already been registered");
}
}
- public static Map<String, Object> getRegisteredQueues(FacesContext context) {
- ExternalContext externalContext = context.getExternalContext();
- Map<String, Object> requestMap = externalContext.getRequestMap();
-
- return (Map<String, Object>) requestMap.get(REGISTRY_ATTRIBUTE_NAME);
+ public Map<String, Object> getRegisteredQueues(FacesContext context) {
+ return queuesData;
}
+
+ public void createGlobalDefaultQueue(FacesContext context) {
+ String encodedGlobalQueueName = context.getExternalContext().encodeNamespace(GLOBAL_QUEUE_NAME);
+ if (!queuesData.containsKey(encodedGlobalQueueName)) {
+ queuesData.put(encodedGlobalQueueName, null);
+ }
+ }
+
+ public boolean hasRegisteredQueues() {
+ return !queuesData.isEmpty();
+ }
}
Deleted: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIQueue.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-11-24 22:45:49 UTC (rev 11340)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-11-24 22:46:07 UTC (rev 11341)
@@ -1,118 +0,0 @@
-/**
- * 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 javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.component.UIForm;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.0
- */
-public abstract class UIQueue extends UIComponentBase {
-
- public static final String COMPONENT_TYPE = "org.ajax4jsf.Queue";
-
- public static final String COMPONENT_FAMILY = "org.ajax4jsf.Queue";
-
- //TODO rename to org.ajax4jsf?
- public static final String GLOBAL_QUEUE_NAME = "org.richfaces.queue.global";
-
- public abstract String getName();
- public abstract void setName(String name);
-
- public abstract String getOnsubmit();
- public abstract void setOnsubmit(String onsubmit);
-
- public abstract String getOncomplete();
- public abstract void setOncomplete(String oncomplete);
-
- public abstract String getOnbeforedomupdate();
- public abstract void setOnbeforedomupdate(String onbeforedomupdate);
-
- public abstract String getOnerror();
- public abstract void setOnerror(String onerror);
-
- public abstract String getOnsizeexceeded();
- public abstract void setOnsizeexceeded(String onsizeexceeded);
-
- public abstract boolean isDisabled();
- public abstract void setDisabled(boolean disabled);
-
- public abstract int getSize();
- public abstract void setSize(int size);
-
- public abstract String getSizeExceededBehavior();
- public abstract void setSizeExceededBehavior(String behavior);
-
- public abstract int getTimeout();
- public abstract void setTimeout(int timeout);
-
- public abstract int getRequestDelay();
- public abstract void setRequestDelay(int requestDelay);
-
- public abstract boolean isIgnoreDupResponses();
- public abstract void setIgnoreDupResponses(boolean ignoreDupResponses);
-
-
-
- @Override
- public String getFamily() {
- return COMPONENT_FAMILY;
- }
-
- private UIComponent findParentForm() {
- UIComponent component = getParent();
- while (component != null && !(component instanceof UIForm)) {
- component = component.getParent();
- }
-
- return component;
- }
-
- public String getClientName(FacesContext context) {
- UIComponent form = findParentForm();
- String name = getName();
- String clientName;
-
- if (form != null) {
- String formClientId = form.getClientId(context);
-
- if (name != null && name.length() != 0) {
- clientName = formClientId + NamingContainer.SEPARATOR_CHAR + name;
- } else {
- clientName = formClientId;
- }
- } else {
- if (name == null || name.length() == 0) {
- name = UIQueue.GLOBAL_QUEUE_NAME;
- }
-
- clientName = context.getExternalContext().encodeNamespace(name);
- }
-
- return clientName;
- }
-}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2008-11-24 22:45:49 UTC (rev 11340)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2008-11-24 22:46:07 UTC (rev 11341)
@@ -42,7 +42,6 @@
import javax.faces.render.Renderer;
import org.ajax4jsf.component.QueueRegistry;
-import org.ajax4jsf.component.UIQueue;
import org.ajax4jsf.io.SAXResponseWriter;
import org.ajax4jsf.renderkit.HeaderResourceProducer;
import org.ajax4jsf.renderkit.HeaderResourceProducer2;
@@ -456,20 +455,14 @@
context.setResponseWriter(componentWriter);
- Map<String, Object> queues = QueueRegistry.getRegisteredQueues(context);
+ QueueRegistry queueRegistry = QueueRegistry.getInstance(context);
if (Boolean.valueOf(getInitParameterValue(context, "org.richfaces.queue.global.enabled"))) {
- String encodedGlobalQueueName = context.getExternalContext().encodeNamespace(UIQueue.GLOBAL_QUEUE_NAME);
-
- //TODO opimize this
- if (queues == null || !queues.containsKey(encodedGlobalQueueName)) {
- QueueRegistry.registerQueue(context, encodedGlobalQueueName, null);
- }
+ queueRegistry.createGlobalDefaultQueue(context);
}
- queues = QueueRegistry.getRegisteredQueues(context);
- if (queues != null && !queues.isEmpty()) {
+ if (queueRegistry.hasRegisteredQueues()) {
InternetResource queueScriptResource = resourceBuilder.getResource(QUEUE_SCRIPT_RESOURCE);
- queueScriptResource.encode(context, queues);
+ queueScriptResource.encode(context, null);
}
// Append Skin StyleSheet after a
17 years, 1 month