JBoss Rich Faces SVN: r20394 - trunk/examples/misc-demo/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 19:50:27 -0500 (Fri, 03 Dec 2010)
New Revision: 20394
Modified:
trunk/examples/misc-demo/src/main/webapp/index.jsp
Log:
RF-9921
Modified: trunk/examples/misc-demo/src/main/webapp/index.jsp
===================================================================
--- trunk/examples/misc-demo/src/main/webapp/index.jsp 2010-12-03 22:04:14 UTC (rev 20393)
+++ trunk/examples/misc-demo/src/main/webapp/index.jsp 2010-12-04 00:50:27 UTC (rev 20394)
@@ -6,6 +6,7 @@
<body>
<a href="pages/index.jsf">Facelets</a><br />
+ <a href="pages/fileupload.jsf">FileUpload Demo</a><br />
</body>
</html>
\ No newline at end of file
14 years, 1 month
JBoss Rich Faces SVN: r20393 - in trunk/ui/iteration/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-03 17:04:14 -0500 (Fri, 03 Dec 2010)
New Revision: 20393
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
Log:
https://jira.jboss.org/browse/RF-9828
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-03 20:46:13 UTC (rev 20392)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-03 22:04:14 UTC (rev 20393)
@@ -196,6 +196,19 @@
public abstract Object getRender();
+ public abstract boolean isLimitRender();
+
+ @Attribute(events = @EventName("begin"))
+ public abstract String getOnbegin();
+
+ @Attribute(events = @EventName("beforedomupdate"))
+ public abstract String getOnbeforedomupdate();
+
+ @Attribute(events = @EventName("complete"))
+ public abstract String getOncomplete();
+
+ public abstract String getStatus();
+
@Override
public String getFamily() {
return COMPONENT_FAMILY;
Modified: trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-12-03 20:46:13 UTC (rev 20392)
+++ trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-12-03 22:04:14 UTC (rev 20393)
@@ -25,7 +25,8 @@
<cdk:call expression="addClientEventHandlers(facesContext, component)" />
- <div class="#{concatClasses('rf-trn', component.attributes['styleClass'], tree.attributes['nodeClass'])}">
+ <div class="#{concatClasses('rf-trn', component.attributes['styleClass'], tree.attributes['nodeClass'])}"
+ cdk:passThroughWithExclusions="">
<cdk:object name="loadingFacet" type="UIComponent" value="#{getLoadingFacetIfApplicable(component)}" />
<c:if test="#{not empty loadingFacet and loadingFacet.isRendered()}">
14 years, 1 month
JBoss Rich Faces SVN: r20392 - trunk/ui/misc.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:46:13 -0500 (Fri, 03 Dec 2010)
New Revision: 20392
Modified:
trunk/ui/misc/pom.xml
Log:
RF-9921
Modified: trunk/ui/misc/pom.xml
===================================================================
--- trunk/ui/misc/pom.xml 2010-12-03 20:45:51 UTC (rev 20391)
+++ trunk/ui/misc/pom.xml 2010-12-03 20:46:13 UTC (rev 20392)
@@ -36,6 +36,7 @@
<name>Richfaces UI Components: Miscellanous Aggregator</name>
<modules>
+ <module>api</module>
<module>ui</module>
</modules>
@@ -45,4 +46,4 @@
<url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
-</project>
\ No newline at end of file
+</project>
14 years, 1 month
JBoss Rich Faces SVN: r20391 - trunk/bom.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:45:51 -0500 (Fri, 03 Dec 2010)
New Revision: 20391
Modified:
trunk/bom/pom.xml
Log:
RF-9921
Modified: trunk/bom/pom.xml
===================================================================
--- trunk/bom/pom.xml 2010-12-03 20:44:47 UTC (rev 20390)
+++ trunk/bom/pom.xml 2010-12-03 20:45:51 UTC (rev 20391)
@@ -97,6 +97,11 @@
</dependency>
<dependency>
<groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-ui</artifactId>
<version>${project.version}</version>
</dependency>
14 years, 1 month
JBoss Rich Faces SVN: r20390 - in sandbox/trunk/examples/fileupload-demo/src/main: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:44:47 -0500 (Fri, 03 Dec 2010)
New Revision: 20390
Removed:
sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/SkinBean.java
sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml
Log:
RF-9921
Deleted: sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-12-03 20:41:52 UTC (rev 20389)
+++ sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-12-03 20:44:47 UTC (rev 20390)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.demo;
-
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-import javax.faces.component.UIComponent;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.AjaxBehaviorEvent;
-
-import org.richfaces.event.UploadEvent;
-import org.richfaces.model.UploadItem;
-
-/**
- * @author Konstantin Mishin
- *
- */
-@ManagedBean
-@SessionScoped
-public class FileUploadBean {
-
- private String acceptedTypes;
- private boolean enabled = true;
- private boolean noDuplicate = false;
- private UploadItem item;
-
- public UploadItem getItem() {
- return item;
- }
-
-// public void paint(OutputStream stream, Object object) throws IOException {
-// stream.write(item.getData());
-// }
-
- public void listener(UploadEvent event) throws Exception {
- item = event.getUploadItem();
- if (item != null) {
- item.getFile().delete();
- }
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public void setNoDuplicate(boolean noDuplicate) {
- this.noDuplicate = noDuplicate;
- }
-
- public boolean isNoDuplicate() {
- return noDuplicate;
- }
-
- public void setAcceptedTypes(String acceptedTypes) {
- this.acceptedTypes = acceptedTypes;
- }
-
- public String getAcceptedTypes() {
- return acceptedTypes;
- }
-
- public void updateAttribute(AjaxBehaviorEvent event) throws AbortProcessingException {
- UIComponent component = (UIComponent) event.getSource();
- String attributeName = (String) component.findComponent("name").getAttributes().get("value");
- Object attributeValue = component.findComponent("value").getAttributes().get("value");
- component.findComponent("fu").getAttributes().put(attributeName, attributeValue);
- }
-}
Deleted: sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/SkinBean.java
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/SkinBean.java 2010-12-03 20:41:52 UTC (rev 20389)
+++ sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/SkinBean.java 2010-12-03 20:44:47 UTC (rev 20390)
@@ -1,29 +0,0 @@
-package org.richfaces.demo;
-
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-
-@ManagedBean(name = "skinBean")
-@SessionScoped
-public class SkinBean {
-
- private static final String[] SKINS = {"blueSky", "deepMarine", "emeraldTown", "NULL", "ruby", "classic",
- "DEFAULT", "japanCherry", "plain", "wine" };
-
- private String skin = "blueSky";
-
- public SkinBean() {
- skin = "blueSky";
- }
- public String getSkin() {
- return skin;
- }
-
- public void setSkin(String skin) {
- this.skin = skin;
- }
-
- public String[] getSkins() {
- return SKINS;
- }
-}
Deleted: sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml 2010-12-03 20:41:52 UTC (rev 20389)
+++ sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml 2010-12-03 20:44:47 UTC (rev 20390)
@@ -1,101 +0,0 @@
-<?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: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:fu="http://richfaces.org/fileUpload">
-<!--
-JBoss, Home of Professional Open Source
-Copyright ${year}, 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.
--->
- <h:head>
- <title>Richfaces FileUpload Demo</title>
- <style>
- <!--
- .fu .rf-fu-lst {
- height: 500px;
- }
- -->
- </style>
- </h:head>
- <h:body>
- <h:form id="form">
- <h:outputText value="Skin: "/>
- <h:selectOneMenu value="#{skinBean.skin}" onchange="submit();">
- <f:selectItems value="#{skinBean.skins}"/>
- </h:selectOneMenu>
- <br />
- <script type="text/javascript">
- <!--
- var onfilesubmit = function (event) {
- var data = event.rf.data;
- RichFaces.log.info(jQuery("<span><b>onfilesubmit: </b>" + data.name + " " + data.state + "</span>"));
- };
-
- var onuploadcomplete = function (event) {
- var data = event.rf.data;
- var str = "";
- RichFaces.log.info(jQuery("<b>onuploadcomplete:</b>"));
- for (var i in data) {
- var item = data[i];
- RichFaces.log.info(" " + item.name + " " + item.state);
- }
- };
- //-->
- </script>
- <fu:fileUpload id="fu" acceptedTypes="#{fileUploadBean.acceptedTypes}" enabled="#{fileUploadBean.enabled}"
- fileUploadListener="#{fileUploadBean.listener}" noDuplicate="#{fileUploadBean.noDuplicate}"
- onfilesubmit="onfilesubmit(event)" onuploadcomplete="onuploadcomplete(event)"/>
- <h:outputText value="File name:" />
- <a4j:outputPanel ajaxRendered="true">#{fileUploadBean.item.fileName}</a4j:outputPanel>
- <br />
- <h:outputText value="Attribute name: "/>
- <h:inputText id="name"/>
- <h:outputText value="Attribute value: "/>
- <h:inputText id="value"/>
- <h:commandButton value="Update attribute">
- <f:ajax render="fu" execute="name value" listener="#{fileUploadBean.updateAttribute}"/>
- </h:commandButton>
- <br />
- <h:outputText value="AcceptedTypes: " />
- <h:inputText value="#{fileUploadBean.acceptedTypes}">
- <f:ajax render="fu"/>
- </h:inputText>
- <br />
- <h:outputText value="Enabled: " />
- <h:selectBooleanCheckbox value="#{fileUploadBean.enabled}">
- <f:ajax render="fu"/>
- </h:selectBooleanCheckbox>
- <br />
- <h:outputText value="NoDuplicate: " />
- <h:selectBooleanCheckbox value="#{fileUploadBean.noDuplicate}">
- <f:ajax render="fu"/>
- </h:selectBooleanCheckbox>
- <br />
- <input type="submit" />
- <a4j:log />
- </h:form>
- </h:body>
-</html>
14 years, 1 month
JBoss Rich Faces SVN: r20389 - in trunk: examples/misc-demo/src/main/java/org/richfaces/demo and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:41:52 -0500 (Fri, 03 Dec 2010)
New Revision: 20389
Added:
trunk/examples/misc-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
trunk/examples/misc-demo/src/main/java/org/richfaces/demo/SkinBean.java
trunk/examples/misc-demo/src/main/webapp/pages/fileupload.xhtml
trunk/ui/misc/ui/src/main/java/org/richfaces/context/
Removed:
trunk/ui/misc/ui/src/main/java/org/richfaces/cotext/
Modified:
trunk/examples/misc-demo/pom.xml
trunk/examples/misc-demo/src/main/webapp/WEB-INF/web.xml
trunk/ui/misc/api/pom.xml
trunk/ui/misc/ui/pom.xml
trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
Log:
RF-9921
Modified: trunk/examples/misc-demo/pom.xml
===================================================================
--- trunk/examples/misc-demo/pom.xml 2010-12-03 20:34:04 UTC (rev 20388)
+++ trunk/examples/misc-demo/pom.xml 2010-12-03 20:41:52 UTC (rev 20389)
@@ -47,6 +47,10 @@
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-ui</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-ui</artifactId>
+ </dependency>
<!-- todo remove this dependency -->
<dependency>
<groupId>org.richfaces.ui.core</groupId>
Copied: trunk/examples/misc-demo/src/main/java/org/richfaces/demo/FileUploadBean.java (from rev 20280, sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java)
===================================================================
--- trunk/examples/misc-demo/src/main/java/org/richfaces/demo/FileUploadBean.java (rev 0)
+++ trunk/examples/misc-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-12-03 20:41:52 UTC (rev 20389)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.component.UIComponent;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.AjaxBehaviorEvent;
+
+import org.richfaces.event.UploadEvent;
+import org.richfaces.model.UploadItem;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+@ManagedBean
+@SessionScoped
+public class FileUploadBean {
+
+ private String acceptedTypes;
+ private boolean enabled = true;
+ private boolean noDuplicate = false;
+ private UploadItem item;
+
+ public UploadItem getItem() {
+ return item;
+ }
+
+// public void paint(OutputStream stream, Object object) throws IOException {
+// stream.write(item.getData());
+// }
+
+ public void listener(UploadEvent event) throws Exception {
+ item = event.getUploadItem();
+ if (item != null) {
+ item.getFile().delete();
+ }
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setNoDuplicate(boolean noDuplicate) {
+ this.noDuplicate = noDuplicate;
+ }
+
+ public boolean isNoDuplicate() {
+ return noDuplicate;
+ }
+
+ public void setAcceptedTypes(String acceptedTypes) {
+ this.acceptedTypes = acceptedTypes;
+ }
+
+ public String getAcceptedTypes() {
+ return acceptedTypes;
+ }
+
+ public void updateAttribute(AjaxBehaviorEvent event) throws AbortProcessingException {
+ UIComponent component = (UIComponent) event.getSource();
+ String attributeName = (String) component.findComponent("name").getAttributes().get("value");
+ Object attributeValue = component.findComponent("value").getAttributes().get("value");
+ component.findComponent("fu").getAttributes().put(attributeName, attributeValue);
+ }
+}
Copied: trunk/examples/misc-demo/src/main/java/org/richfaces/demo/SkinBean.java (from rev 20241, sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/SkinBean.java)
===================================================================
--- trunk/examples/misc-demo/src/main/java/org/richfaces/demo/SkinBean.java (rev 0)
+++ trunk/examples/misc-demo/src/main/java/org/richfaces/demo/SkinBean.java 2010-12-03 20:41:52 UTC (rev 20389)
@@ -0,0 +1,29 @@
+package org.richfaces.demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+@ManagedBean(name = "skinBean")
+@SessionScoped
+public class SkinBean {
+
+ private static final String[] SKINS = {"blueSky", "deepMarine", "emeraldTown", "NULL", "ruby", "classic",
+ "DEFAULT", "japanCherry", "plain", "wine" };
+
+ private String skin = "blueSky";
+
+ public SkinBean() {
+ skin = "blueSky";
+ }
+ public String getSkin() {
+ return skin;
+ }
+
+ public void setSkin(String skin) {
+ this.skin = skin;
+ }
+
+ public String[] getSkins() {
+ return SKINS;
+ }
+}
Modified: trunk/examples/misc-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/examples/misc-demo/src/main/webapp/WEB-INF/web.xml 2010-12-03 20:34:04 UTC (rev 20388)
+++ trunk/examples/misc-demo/src/main/webapp/WEB-INF/web.xml 2010-12-03 20:41:52 UTC (rev 20389)
@@ -4,6 +4,15 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>misc-demo</display-name>
+ <context-param>
+ <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
+ <param-value>268435456</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+
<filter>
<filter-name>Test Identity Filter</filter-name>
<filter-class>org.richfaces.demo.TestIdentityFilter</filter-class>
Copied: trunk/examples/misc-demo/src/main/webapp/pages/fileupload.xhtml (from rev 20280, sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml)
===================================================================
--- trunk/examples/misc-demo/src/main/webapp/pages/fileupload.xhtml (rev 0)
+++ trunk/examples/misc-demo/src/main/webapp/pages/fileupload.xhtml 2010-12-03 20:41:52 UTC (rev 20389)
@@ -0,0 +1,101 @@
+<?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: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:fu="http://richfaces.org/misc">
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, 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.
+-->
+ <h:head>
+ <title>Richfaces FileUpload Demo</title>
+ <style>
+ <!--
+ .fu .rf-fu-lst {
+ height: 500px;
+ }
+ -->
+ </style>
+ </h:head>
+ <h:body>
+ <h:form id="form">
+ <h:outputText value="Skin: "/>
+ <h:selectOneMenu value="#{skinBean.skin}" onchange="submit();">
+ <f:selectItems value="#{skinBean.skins}"/>
+ </h:selectOneMenu>
+ <br />
+ <script type="text/javascript">
+ <!--
+ var onfilesubmit = function (event) {
+ var data = event.rf.data;
+ RichFaces.log.info(jQuery("<span><b>onfilesubmit: </b>" + data.name + " " + data.state + "</span>"));
+ };
+
+ var onuploadcomplete = function (event) {
+ var data = event.rf.data;
+ var str = "";
+ RichFaces.log.info(jQuery("<b>onuploadcomplete:</b>"));
+ for (var i in data) {
+ var item = data[i];
+ RichFaces.log.info(" " + item.name + " " + item.state);
+ }
+ };
+ //-->
+ </script>
+ <fu:fileUpload id="fu" acceptedTypes="#{fileUploadBean.acceptedTypes}" enabled="#{fileUploadBean.enabled}"
+ fileUploadListener="#{fileUploadBean.listener}" noDuplicate="#{fileUploadBean.noDuplicate}"
+ onfilesubmit="onfilesubmit(event)" onuploadcomplete="onuploadcomplete(event)"/>
+ <h:outputText value="File name:" />
+ <a4j:outputPanel ajaxRendered="true">#{fileUploadBean.item.fileName}</a4j:outputPanel>
+ <br />
+ <h:outputText value="Attribute name: "/>
+ <h:inputText id="name"/>
+ <h:outputText value="Attribute value: "/>
+ <h:inputText id="value"/>
+ <h:commandButton value="Update attribute">
+ <f:ajax render="fu" execute="name value" listener="#{fileUploadBean.updateAttribute}"/>
+ </h:commandButton>
+ <br />
+ <h:outputText value="AcceptedTypes: " />
+ <h:inputText value="#{fileUploadBean.acceptedTypes}">
+ <f:ajax render="fu"/>
+ </h:inputText>
+ <br />
+ <h:outputText value="Enabled: " />
+ <h:selectBooleanCheckbox value="#{fileUploadBean.enabled}">
+ <f:ajax render="fu"/>
+ </h:selectBooleanCheckbox>
+ <br />
+ <h:outputText value="NoDuplicate: " />
+ <h:selectBooleanCheckbox value="#{fileUploadBean.noDuplicate}">
+ <f:ajax render="fu"/>
+ </h:selectBooleanCheckbox>
+ <br />
+ <input type="submit" />
+ <a4j:log />
+ </h:form>
+ </h:body>
+</html>
Modified: trunk/ui/misc/api/pom.xml
===================================================================
--- trunk/ui/misc/api/pom.xml 2010-12-03 20:34:04 UTC (rev 20388)
+++ trunk/ui/misc/api/pom.xml 2010-12-03 20:41:52 UTC (rev 20389)
@@ -27,19 +27,16 @@
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
- <groupId>org.richfaces.ui.fileupload</groupId>
- <artifactId>richfaces-ui-fileupload-api</artifactId>
- <name>Richfaces UI Components: FileUpload API</name>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-api</artifactId>
+ <name>Richfaces UI Components: Misc API</name>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
- <plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
Modified: trunk/ui/misc/ui/pom.xml
===================================================================
--- trunk/ui/misc/ui/pom.xml 2010-12-03 20:34:04 UTC (rev 20388)
+++ trunk/ui/misc/ui/pom.xml 2010-12-03 20:41:52 UTC (rev 20389)
@@ -59,6 +59,10 @@
<groupId>org.richfaces.ui.core</groupId>
<artifactId>richfaces-ui-core-ui</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-api</artifactId>
+ </dependency>
</dependencies>
<profiles>
Modified: trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
===================================================================
--- trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-03 20:34:04 UTC (rev 20388)
+++ trunk/ui/misc/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-03 20:41:52 UTC (rev 20389)
@@ -23,6 +23,7 @@
import java.util.Map;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
@@ -72,8 +73,12 @@
Map<String, UIComponent> facets = getFacets();
UIComponent component = facets.get("progress");
if (component == null) {
- component = context.getApplication().createComponent(context, "org.richfaces.ProgressBar",
- "org.richfaces.ProgressBarRenderer");
+ try {
+ component = context.getApplication().createComponent(context, "org.richfaces.ProgressBar",
+ "org.richfaces.ProgressBarRenderer");
+ } catch (FacesException e) {
+ // To work without ProgressBar.
+ }
if (component != null) {
component.setId(getId() + "_pb");
facets.put("progress", component);
Copied: trunk/ui/misc/ui/src/main/java/org/richfaces/context (from rev 20382, trunk/ui/misc/ui/src/main/java/org/richfaces/cotext)
14 years, 1 month
JBoss Rich Faces SVN: r20388 - in trunk: examples/iteration-demo/src/main/webapp/images and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-03 15:34:04 -0500 (Fri, 03 Dec 2010)
New Revision: 20388
Added:
trunk/examples/iteration-demo/src/main/webapp/images/loading.gif
Modified:
trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
Log:
https://jira.jboss.org/browse/RF-9838
- IE7:
-- visual fixes
-- selection was not submitted correctly
- Improved trees & queues compatibility
- Default treeNode was not working
Added: trunk/examples/iteration-demo/src/main/webapp/images/loading.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/iteration-demo/src/main/webapp/images/loading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-12-03 20:34:04 UTC (rev 20388)
@@ -27,6 +27,11 @@
border: 1px solid green;
}
+ .loadingWithoutFacet .rf-trn-ldn .rf-trn-hnd {
+ cursor: default;
+ background-image: url(#{facesContext.externalContext.requestContextPath}/images/loading.gif);
+ }
+
/*]]>*/</h:outputStylesheet>
</h:head>
@@ -244,6 +249,22 @@
</h:panelGroup>
</h:panelGrid>
+ 'loading' facet:
+ <it:tree value="#{treeBean.rootNodes}" toggleType="ajax" var="node">
+ <it:treeNode>
+ <f:facet name="loading">
+ <h:graphicImage value="/images/loading.gif" />
+ </f:facet>
+
+ #{node}
+ </it:treeNode>
+ </it:tree>
+
+ 'loading' without facet:
+ <it:tree value="#{treeBean.rootNodes}" toggleType="ajax" var="node" styleClass="loadingWithoutFacet" />
+
+ <a4j:queue />
+
<a4j:log />
</h:form>
</h:body>
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-03 20:34:04 UTC (rev 20388)
@@ -256,10 +256,6 @@
}
public AbstractTreeNode findTreeNodeComponent() {
- if (getRowKey() == null) {
- return null;
- }
-
FacesContext facesContext = getFacesContext();
String nodeType = getNodeType();
@@ -280,6 +276,7 @@
return null;
}
+ //TODO default TreeNode is created when getRowKey() == null but it's not used for presentational purposes
Application application = facesContext.getApplication();
AbstractTreeNode treeNode = (AbstractTreeNode) application.createComponent(AbstractTreeNode.COMPONENT_TYPE);
treeNode.setId("__defaultTreeNode");
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-12-03 20:34:04 UTC (rev 20388)
@@ -162,8 +162,7 @@
writeTreeNodeEndElement();
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ throw new FacesException(e.getMessage(), e);
}
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-12-03 20:34:04 UTC (rev 20388)
@@ -53,6 +53,8 @@
private static final String TRIGGER_NODE_AJAX_UPDATE = "__TRIGGER_NODE_AJAX_UPDATE";
+ private static final String LOADING_FACET_NAME = "loading";
+
@Override
public void decode(FacesContext context, UIComponent component) {
super.decode(context, component);
@@ -168,4 +170,21 @@
TreeRenderingContext renderingContext = TreeRenderingContext.get(facesContext);
renderingContext.addHandlers(treeNode);
}
+
+ protected UIComponent getLoadingFacetIfApplicable(UIComponent component) {
+ AbstractTreeNode treeNode = (AbstractTreeNode) component;
+
+ AbstractTree tree = treeNode.findTreeComponent();
+
+ if (tree.getToggleType() != SwitchType.ajax) {
+ return null;
+ }
+
+ UIComponent facet = treeNode.getFacet(LOADING_FACET_NAME);
+ if (facet == null) {
+ facet = tree.getFacet(LOADING_FACET_NAME);
+ }
+
+ return facet;
+ }
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-12-03 20:34:04 UTC (rev 20388)
@@ -23,7 +23,6 @@
import static org.richfaces.component.AbstractTree.SELECTION_META_COMPONENT_ID;
import static org.richfaces.renderkit.util.AjaxRendererUtils.AJAX_FUNCTION_NAME;
-import static org.richfaces.renderkit.util.AjaxRendererUtils.buildAjaxFunction;
import static org.richfaces.renderkit.util.AjaxRendererUtils.buildEventOptions;
import java.io.IOException;
@@ -66,8 +65,11 @@
private static final JSReference SOURCE_JS_REF = new JSReference("source");
+ private static final JSReference COMPLETE_JS_REF = new JSReference("complete");
+
private static final String SELECTION_STATE = "__SELECTION_STATE";
+
/**
* @author Nick Belaevski
*
@@ -98,10 +100,15 @@
return null;
}
- JSFunction ajaxFunction = buildAjaxFunction(context, component, AJAX_FUNCTION_NAME);
+ JSFunction ajaxFunction = new JSFunction(AJAX_FUNCTION_NAME);
+
+ ajaxFunction.addParameter(SOURCE_JS_REF);
+ ajaxFunction.addParameter(JSReference.EVENT);
+
AjaxEventOptions eventOptions = buildEventOptions(context, component);
- eventOptions.setAjaxComponent(SOURCE_JS_REF);
+ eventOptions.set("complete", COMPLETE_JS_REF);
+
eventOptions.setClientParameters(PARAMS_JS_REF);
if (!eventOptions.isEmpty()) {
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-12-03 20:34:04 UTC (rev 20388)
@@ -27,6 +27,7 @@
.rf-tr-nd {
background: "url(#{resource['org.richfaces.images:line.png']}) repeat-y";
+ min-height: 0px;
}
.rf-tr-nd-last {
@@ -37,7 +38,7 @@
margin-left: 16px;
}
-.rf-trn-ico, .rf-trn-hnd {
+.rf-trn-ico, .rf-trn-hnd, .rf-trn-ldn-fct {
vertical-align: middle;
margin: 0px;
cursor: pointer;
@@ -78,3 +79,16 @@
.rf-tr-nd.rf-tr-nd-colps .rf-tr-nd {
display: none;
}
+
+.rf-trn-ldn-fct {
+ cursor: default;
+ display: none;
+}
+
+.rf-trn-ldn > .rf-trn-ldn-fct {
+ display: inline-block;
+}
+
+.rf-trn-ldn > .rf-trn-ldn-fct + .rf-trn-hnd {
+ display: none;
+}
\ No newline at end of file
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-12-03 20:34:04 UTC (rev 20388)
@@ -89,12 +89,16 @@
}
},
+ __getNodeContainer: function() {
+ return this.__rootElt.find(" > .rf-trn:first");
+ },
+
__getHandle: function() {
- return this.__rootElt.find(" > .rf-trn:first > .rf-trn-hnd:first");
+ return this.__getNodeContainer().find(" > .rf-trn-hnd:first");
},
__getContent: function() {
- return this.__rootElt.find(" > .rf-trn:first > .rf-trn-cnt:first");
+ return this.__getNodeContainer().find(" > .rf-trn-cnt:first");
},
__getIcons: function() {
@@ -156,7 +160,7 @@
},
__canBeToggled: function() {
- return !this.isLeaf() && !this.__rootElt.hasClass("rf-tr-nd-exp-nc");
+ return !this.isLeaf() && !this.__rootElt.hasClass("rf-tr-nd-exp-nc") && !this.__loading;
},
toggle: function() {
@@ -189,6 +193,16 @@
richfaces.Event.callHandler(this.__rootElt, "toggle");
},
+ __makeLoading: function() {
+ this.__loading = true;
+ this.__getNodeContainer().addClass("rf-trn-ldn");
+ },
+
+ __resetLoading: function() {
+ this.__loading = false;
+ this.__getNodeContainer().removeClass("rf-trn-ldn");
+ },
+
__changeToggleState: function(newState) {
if (!this.isLeaf()) {
if (newState ^ this.isExpanded()) {
@@ -216,7 +230,7 @@
case 'ajax':
case 'server':
//TODO - event?
- tree.__sendToggleRequest(null, this.getId(), newState);
+ tree.__sendToggleRequest(null, this, newState);
break;
}
}
@@ -314,7 +328,7 @@
this.__selectionType = options.selectionType || 'client';
if (options.ajaxSubmitFunction) {
- this.__ajaxSubmitFunction = new Function("event", "source", "params", options.ajaxSubmitFunction);
+ this.__ajaxSubmitFunction = new Function("event", "source", "params", "complete", options.ajaxSubmitFunction);
}
if (options.onbeforeselectionchange) {
@@ -387,15 +401,23 @@
},
__sendToggleRequest: function(event, toggleSource, newNodeState) {
+ var toggleSourceId = toggleSource.getId();
+
var clientParams = {};
- clientParams[toggleSource + NEW_NODE_TOGGLE_STATE] = newNodeState;
+ clientParams[toggleSourceId + NEW_NODE_TOGGLE_STATE] = newNodeState;
if (this.getToggleType() == 'server') {
var form = this.__treeRootElt.closest('form');
richfaces.submitForm(form, clientParams);
} else {
- clientParams[toggleSource + TRIGGER_NODE_AJAX_UPDATE] = newNodeState;
- this.__ajaxSubmitFunction(event, toggleSource, clientParams);
+ toggleSource.__makeLoading();
+ clientParams[toggleSourceId + TRIGGER_NODE_AJAX_UPDATE] = newNodeState;
+ this.__ajaxSubmitFunction(event, toggleSourceId, clientParams, function() {
+ var treeNode = richfaces.$(toggleSourceId);
+ if (treeNode) {
+ treeNode.__resetLoading();
+ }
+ });
}
},
@@ -425,7 +447,7 @@
return;
}
- this.__selectionInput.val(newSelection.toString());
+ this.__selectionInput.val(newSelection.getNodeString());
if (this.getSelectionType() == 'client') {
this.__updateSelection(newSelection);
Modified: trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-12-03 20:09:51 UTC (rev 20387)
+++ trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-12-03 20:34:04 UTC (rev 20388)
@@ -26,6 +26,16 @@
<cdk:call expression="addClientEventHandlers(facesContext, component)" />
<div class="#{concatClasses('rf-trn', component.attributes['styleClass'], tree.attributes['nodeClass'])}">
+ <cdk:object name="loadingFacet" type="UIComponent" value="#{getLoadingFacetIfApplicable(component)}" />
+
+ <c:if test="#{not empty loadingFacet and loadingFacet.isRendered()}">
+ <span class="rf-trn-ldn-fct">
+ <cdk:call>
+ loadingFacet.encodeAll(facesContext);
+ </cdk:call>
+ </span>
+ </c:if>
+
<span class="#{concatClasses(nodeState.handleClass, component.attributes['handleClass'], tree.attributes['handleClass'])}"></span>
<span class="rf-trn-cnt">
14 years, 1 month
JBoss Rich Faces SVN: r20387 - in sandbox/trunk/ui/fileupload/ui/src/main: java/org/richfaces/view and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:09:51 -0500 (Fri, 03 Dec 2010)
New Revision: 20387
Removed:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/request/
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/view/facelets/
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/fileupload.faces-config.xml
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add-dis.gif
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-upl.gif
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/richfaces/
Log:
RF-9921
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/fileupload.faces-config.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/fileupload.faces-config.xml 2010-12-03 20:08:40 UTC (rev 20386)
+++ sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/fileupload.faces-config.xml 2010-12-03 20:09:51 UTC (rev 20387)
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-JBoss, Home of Professional Open Source
-Copyright ${year}, 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.
--->
-<faces-config version="2.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <factory>
- <partial-view-context-factory>org.richfaces.context.FileUploadPartialViewContextFactory</partial-view-context-factory>
- </factory>
-</faces-config>
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss 2010-12-03 20:08:40 UTC (rev 20386)
+++ sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss 2010-12-03 20:09:51 UTC (rev 20387)
@@ -1,176 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-.rf-fu {
- background: '#{richSkin.generalBackgroundColor}';
- border-color: '#{richSkin.panelBorderColor}';
- border-style: solid;
- border-width: 1px;
- width: 400px; /*TODO Remove it*/
-}
-
-.rf-fu-hdr {
- background-color: '#{richSkin.headerBackgroundColor}';
- background-image: url("#{resource['org.richfaces.renderkit.html.GradientA']}");
- border-color: '#{richSkin.headerBackgroundColor}';
- border-style: solid;
- border-width: 1px;
- margin-left: 1px;
- margin-top: 1px;
- white-space: nowrap;
-}
-
-.rf-fu-lst {
- height: 210px; /*TODO Remove it*/
- overflow-x: hidden;
- overflow-y: auto;
-}
-
-.rf-fu-cntr-hdn {
- display: none;
-}
-
-.rf-fu-btns-lft, .rf-fu-btns-rgh, .rf-fu-itm-lft, .rf-fu-itm-rgh {
- display: inline-block;
- overflow: hidden;
-}
-
-.rf-fu-btns-lft {
- width: 66%;
-}
-
-.rf-fu-btns-rgh {
- text-align: right;
- width: 34%;
-}
-
-.rf-fu-btn-add, .rf-fu-btn-add-dis, .rf-fu-btn-upl, .rf-fu-btn-clr {
- background-position:left top;
- background-repeat:repeat-x;
- border-style: solid;
- border-width: 1px;
- cursor: default;
- display: inline-block;
- margin: 4px;
- vertical-align: top;
-}
-
-.rf-fu-btn-add, .rf-fu-btn-upl, .rf-fu-btn-clr {
- background-color: '#{richSkin.trimColor}';
- background-image: url("#{resource['org.richfaces.images:fuBtnGrad.png']}");
- border-color: '#{richSkin.panelBorderColor}';
-}
-
-.rf-fu-btn-add-dis {
- background-color: '#{richSkin.tableFooterBackgroundColor}';
- background-image: url("#{resource['org.richfaces.images:fuBtnDisGrad.png']}");
- border-color: '#{richSkin.tableFooterBackgroundColor}';
-}
-
-.rf-fu-btn-upl, .rf-fu-btn-clr {
- display: none;
-}
-
-.rf-fu-btn-cnt-add, .rf-fu-btn-cnt-add-dis, .rf-fu-btn-cnt-upl, .rf-fu-btn-cnt-clr, .rf-fu-itm-lbl, .rf-fu-itm-st, .rf-fu-itm-lnk {
- font-family: '#{richSkin.generalFamilyFont}';
- font-size: '#{richSkin.generalSizeFont}';
-}
-
-.rf-fu-btn-cnt-add, .rf-fu-btn-cnt-upl, .rf-fu-btn-cnt-clr, .rf-fu-itm-lbl, .rf-fu-itm-st {
- color: '#{richSkin.generalTextColor}';
-}
-
-.rf-fu-btn-cnt-add, .rf-fu-btn-cnt-add-dis, .rf-fu-btn-cnt-upl, .rf-fu-btn-cnt-clr {
- background-position: 2px 2px;
- background-repeat: no-repeat;
- display: inline-block;
- padding: 3px 5px 3px 21px;
-}
-
-.rf-fu-btn-cnt-add {
- background-image: url("#{resource['org.richfaces:fu-add.gif']}");
- overflow: hidden;
- position: relative;
-}
-
-.rf-fu-btn-cnt-add-dis {
- background-image: url("#{resource['org.richfaces:fu-add-dis.gif']}");
- color: '#{richSkin.tabDisabledTextColor}';
-}
-
-.rf-fu-btn-cnt-upl, .rf-fu-itm-st {
- font-weight: bold;
-}
-
-.rf-fu-btn-cnt-upl {
- background-image: url("#{resource['org.richfaces:fu-upl.gif']}");
-}
-
-.rf-fu-btn-cnt-clr {
- background-image: url("#{resource['org.richfaces:fu-clr.gif']}");
-}
-
-.rf-fu-inp-cntr {
- display: block;
- height: 1px;
- position: absolute;
- right: 0;
- top: 0;
-}
-
-.rf-fu-inp {
- filter: "alpha(opacity=0)";
- font-size: 10em;
- margin: 0;
- opacity: 0;
- position: absolute;
- right: 0;
- top: 0;
-}
-
-.rf-fu-itm {
- border-bottom-color: '#{richSkin.panelBorderColor}';
- border-bottom-style: solid;
- border-bottom-width: 1px;
- padding: 12px;
- white-space: nowrap;
-}
-
-.rf-fu-itm-lft, .rf-fu-itm-rgh {
- vertical-align: middle;
-}
-
-.rf-fu-itm-lft {
- width: 85%;
-}
-
-.rf-fu-itm-rgh {
- width: 14%;
-}
-
-.rf-fu-itm-lnk {
- color: '#{richSkin.generalLinkColor}';
-}
-
-.rf-fu-itm-st {
- display: none;
- margin-top: 5px;
-}
\ No newline at end of file
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-03 20:08:40 UTC (rev 20386)
+++ sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-03 20:09:51 UTC (rev 20387)
@@ -1,274 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-(function(richfaces, jQuery) {
-
- var UID = "rf_fu_uid";
-
- var ITEM_HTML = '<div class="rf-fu-itm">'
- + '<span class="rf-fu-itm-lft"><span class="rf-fu-itm-lbl"/><span class="rf-fu-itm-st"/></span>'
- + '<span class="rf-fu-itm-rgh"><a href="javascript:void(0)" class="rf-fu-itm-lnk"/></span></div>';
-
- var ITEM_STATE = {
- NEW: "new",
- UPLOADING: "uploading",
- DONE: "done",
- SIZE_EXCEEDED: "sizeExceeded",
- STOPPED: "stopped",
- SERVER_ERROR: "serverError"
- };
-
- var pressButton = function(event) {
- jQuery(this).children(":first").css("background-position", "3px 3px").css("padding", "4px 4px 2px 22px");
- };
-
- var unpressButton = function(event) {
- jQuery(this).children(":first").css("background-position", "2px 2px").css("padding", "3px 5px 3px 21px");
- };
-
- richfaces.ui = richfaces.ui || {};
-
- richfaces.ui.FileUpload = richfaces.BaseComponent.extendClass({
-
- name: "FileUpload",
-
- items: [],
- submitedItems: [],
-
- doneLabel: "Done",
- sizeExceededLabel: "File size is exceeded",
- stoppedLabel: "",
- serverErrorLabel: "Server error",
- clearLabel: "Clear",
- deleteLabel: "Delete",
-
- init: function(id, options) {
- this.id = id;
- jQuery.extend(this, options);
- if (this.acceptedTypes) {
- this.acceptedTypes = jQuery.trim(this.acceptedTypes).split(/\s*,\s*/);
- }
- this.element = jQuery(this.attachToDom());
- this.form = this.element.parents("form:first");
- var header = this.element.children(".rf-fu-hdr:first");
- var leftButtons = header.children(".rf-fu-btns-lft:first");
- this.addButton = leftButtons.children(".rf-fu-btn-add:first");
- this.uploadButton = this.addButton.next();
- this.clearButton = leftButtons.next().children(".rf-fu-btn-clr:first");
- this.inputContainer = this.addButton.find(".rf-fu-inp-cntr:first");
- this.input = this.inputContainer.children("input");
- this.list = header.next();
- this.hiddenContainer = this.list.next();
- this.iframe = this.hiddenContainer.children("iframe:first");
- this.progressBarElement = this.iframe.next();
- this.progressBar = richfaces.$(this.progressBarElement);
- this.cleanInput = this.input.clone();
- this.addProxy = jQuery.proxy(this.__addItem, this);
- this.input.change(this.addProxy);
- this.addButton.mousedown(pressButton).mouseup(unpressButton).mouseout(unpressButton);
- this.uploadButton.click(jQuery.proxy(this.__startUpload, this)).mousedown(pressButton)
- .mouseup(unpressButton).mouseout(unpressButton);
- this.clearButton.click(jQuery.proxy(this.__removeAllItems, this)).mousedown(pressButton)
- .mouseup(unpressButton).mouseout(unpressButton);
- this.iframe.load(jQuery.proxy(this.__load, this));
- if (this.onfilesubmit) {
- richfaces.Event.bind(this.element, "onfilesubmit", new Function("event", this.onfilesubmit));
- }
- if (this.onuploadcomplete) {
- richfaces.Event.bind(this.element, "onuploadcomplete", new Function("event", this.onuploadcomplete));
- }
- },
-
- __addItem: function() {
- var fileName = this.input.val();
- if (this.__accept(fileName) && (!this.noDuplicate || !this.__isFileAlreadyAdded(fileName))) {
- this.input.hide();
- this.input.unbind("change", this.addProxy);
- var item = new Item(this);
- this.list.append(item.getJQuery());
- this.items.push(item);
- this.input = this.cleanInput.clone();
- this.inputContainer.append(this.input);
- this.input.change(this.addProxy);
- this.__updateButtons();
- }
- },
-
- __removeItem: function(item) {
- this.items.splice(this.items.indexOf(item), 1);
- this.submitedItems.splice(this.submitedItems.indexOf(item), 1);
- this.__updateButtons();
- },
-
- __removeAllItems: function(item) {
- this.inputContainer.children(":not(:visible)").remove();
- this.list.empty();
- this.items.splice(0);
- this.submitedItems.splice(0);
- this.__updateButtons();
- },
-
- __updateButtons: function() {
- if (!this.loadableItem && this.list.children(".rf-fu-itm").size()) {
- if (this.items.length) {
- this.uploadButton.css("display", "inline-block");
- } else {
- this.uploadButton.hide();
- }
- this.clearButton.css("display", "inline-block");
- } else {
- this.uploadButton.hide();
- this.clearButton.hide();
- }
- },
-
- __startUpload: function() {
- this.loadableItem = this.items.shift();
- this.__updateButtons();
- this.loadableItem.startUploading();
- },
-
- __submit: function() {
- var originalAction = this.form.attr("action");
- var originalEncoding = this.form.attr("encoding");
- var originalEnctype = this.form.attr("enctype");
- try {
- this.form.attr("action", originalAction + "?" + UID + "=" + this.loadableItem.uid);
- this.form.attr("encoding", "multipart/form-data");
- this.form.attr("enctype", "multipart/form-data");
- richfaces.submitForm(this.form, {"org.richfaces.ajax.component": this.id}, this.id);
- richfaces.Event.fire(this.element, "onfilesubmit", this.loadableItem.model);
- } finally {
- this.form.attr("action", originalAction);
- this.form.attr("encoding", originalEncoding);
- this.form.attr("enctype", originalEnctype);
- this.loadableItem.input.removeAttr("name");
- }
- },
-
- __load: function(event) {
- if (this.loadableItem) {
- var contentDocument = event.target.contentWindow.document;
- contentDocument = contentDocument.XMLDocument || contentDocument;
- var documentElement = contentDocument.documentElement;
- var responseStatus, id;
- if (documentElement.tagName.toUpperCase() == "PARTIAL-RESPONSE") {
- responseStatus = ITEM_STATE.DONE;
- } else if ((id = documentElement.id) && id.indexOf(UID + this.loadableItem.uid + ":") == 0) {
- responseStatus = id.split(":")[1];
- }
- if (responseStatus) {
- responseStatus == ITEM_STATE.DONE && jsf.ajax.response({responseXML: contentDocument}, {});
- this.loadableItem.finishUploading(responseStatus);
- this.submitedItems.push(this.loadableItem);
- if (responseStatus == ITEM_STATE.DONE && this.items.length) {
- this.__startUpload();
- } else {
- this.loadableItem = null;
- this.__updateButtons();
- var items = [];
- for (var i in this.submitedItems) {
- items.push(this.submitedItems[i].model);
- }
- for (var i in this.items) {
- items.push(this.items[i].model);
- }
- richfaces.Event.fire(this.element, "onuploadcomplete", items);
- }
- }
- }
- },
-
- __accept: function(fileName) {
- var result = !this.acceptedTypes;
- for (var i = 0; !result && i < this.acceptedTypes.length; i++) {
- var extension = this.acceptedTypes[i];
- result = fileName.indexOf(extension, fileName.length - extension.length) !== -1;
- }
- return result;
- },
-
- __isFileAlreadyAdded: function(fileName) {
- var result = false;
- for (var i = 0; !result && i < this.items.length; i++) {
- result = this.items[i].model.name == fileName;
- }
- result = result || (this.loadableItem && this.loadableItem.model.name == fileName);
- for (var i = 0; !result && i < this.submitedItems.length; i++) {
- result = this.submitedItems[i].model.name == fileName;
- }
- return result;
- }
- });
-
- var Item = function(fileUpload) {
- this.fileUpload = fileUpload;
- this.input = fileUpload.input;
- this.model = {name: this.input.val(), state: ITEM_STATE.NEW};
- };
-
- jQuery.extend(Item.prototype, {
- getJQuery: function() {
- this.element = jQuery(ITEM_HTML);
- var leftArea = this.element.children(".rf-fu-itm-lft:first");
- this.label = leftArea.children(".rf-fu-itm-lbl:first");
- this.state = this.label.nextAll(".rf-fu-itm-st:first");
- this.link = leftArea.next().children("a");
- this.label.html(this.model.name);
- this.link.html(this.fileUpload["deleteLabel"]);
- this.link.click(jQuery.proxy(this.removeOrStop, this));
- return this.element;
- },
-
- removeOrStop: function() {
- this.input.remove();
- this.element.remove();
- this.fileUpload.__removeItem(this);
- },
-
- startUploading: function() {
- this.state.css("display", "block");
- this.link.html("");
- this.input.attr("name", this.fileUpload.id);
- this.model.state = ITEM_STATE.UPLOADING;
- this.uid = Math.random();
- this.fileUpload.__submit();
- var params = {};
- params[UID] = this.uid;
- if (this.fileUpload.progressBar) {
- this.fileUpload.progressBar.setValue(0);
- this.state.html(this.fileUpload.progressBarElement.detach());
- this.fileUpload.progressBar.enable(params);
- }
- },
-
- finishUploading: function(state) {
- if (this.fileUpload.progressBar) {
- this.fileUpload.progressBar.disable();
- this.fileUpload.hiddenContainer.append(this.fileUpload.progressBarElement.detach());
- }
- this.input.remove();
- this.state.html(this.fileUpload[state + "Label"]);
- this.link.html(this.fileUpload["clearLabel"]);
- this.model.state = state;
- }
- });
-}(window.RichFaces, jQuery));
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add-dis.gif
===================================================================
(Binary files differ)
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif
===================================================================
(Binary files differ)
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif
===================================================================
(Binary files differ)
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-upl.gif
===================================================================
(Binary files differ)
14 years, 1 month
JBoss Rich Faces SVN: r20386 - in trunk/ui/misc/ui/src/main: java/org/richfaces/view and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:08:40 -0500 (Fri, 03 Dec 2010)
New Revision: 20386
Added:
trunk/ui/misc/ui/src/main/java/org/richfaces/request/
trunk/ui/misc/ui/src/main/java/org/richfaces/view/
trunk/ui/misc/ui/src/main/java/org/richfaces/view/facelets/
trunk/ui/misc/ui/src/main/resources/META-INF/fileupload.faces-config.xml
trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss
trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add-dis.gif
trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif
trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif
trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-upl.gif
trunk/ui/misc/ui/src/main/resources/META-INF/richfaces/
Log:
RF-9921
Copied: trunk/ui/misc/ui/src/main/java/org/richfaces/request (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/request)
Copied: trunk/ui/misc/ui/src/main/java/org/richfaces/view/facelets (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/view/facelets)
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/fileupload.faces-config.xml (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/fileupload.faces-config.xml)
===================================================================
--- trunk/ui/misc/ui/src/main/resources/META-INF/fileupload.faces-config.xml (rev 0)
+++ trunk/ui/misc/ui/src/main/resources/META-INF/fileupload.faces-config.xml 2010-12-03 20:08:40 UTC (rev 20386)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, 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.
+-->
+<faces-config version="2.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <factory>
+ <partial-view-context-factory>org.richfaces.context.FileUploadPartialViewContextFactory</partial-view-context-factory>
+ </factory>
+</faces-config>
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss)
===================================================================
--- trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss (rev 0)
+++ trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss 2010-12-03 20:08:40 UTC (rev 20386)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+.rf-fu {
+ background: '#{richSkin.generalBackgroundColor}';
+ border-color: '#{richSkin.panelBorderColor}';
+ border-style: solid;
+ border-width: 1px;
+ width: 400px; /*TODO Remove it*/
+}
+
+.rf-fu-hdr {
+ background-color: '#{richSkin.headerBackgroundColor}';
+ background-image: url("#{resource['org.richfaces.renderkit.html.GradientA']}");
+ border-color: '#{richSkin.headerBackgroundColor}';
+ border-style: solid;
+ border-width: 1px;
+ margin-left: 1px;
+ margin-top: 1px;
+ white-space: nowrap;
+}
+
+.rf-fu-lst {
+ height: 210px; /*TODO Remove it*/
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+.rf-fu-cntr-hdn {
+ display: none;
+}
+
+.rf-fu-btns-lft, .rf-fu-btns-rgh, .rf-fu-itm-lft, .rf-fu-itm-rgh {
+ display: inline-block;
+ overflow: hidden;
+}
+
+.rf-fu-btns-lft {
+ width: 66%;
+}
+
+.rf-fu-btns-rgh {
+ text-align: right;
+ width: 34%;
+}
+
+.rf-fu-btn-add, .rf-fu-btn-add-dis, .rf-fu-btn-upl, .rf-fu-btn-clr {
+ background-position:left top;
+ background-repeat:repeat-x;
+ border-style: solid;
+ border-width: 1px;
+ cursor: default;
+ display: inline-block;
+ margin: 4px;
+ vertical-align: top;
+}
+
+.rf-fu-btn-add, .rf-fu-btn-upl, .rf-fu-btn-clr {
+ background-color: '#{richSkin.trimColor}';
+ background-image: url("#{resource['org.richfaces.images:fuBtnGrad.png']}");
+ border-color: '#{richSkin.panelBorderColor}';
+}
+
+.rf-fu-btn-add-dis {
+ background-color: '#{richSkin.tableFooterBackgroundColor}';
+ background-image: url("#{resource['org.richfaces.images:fuBtnDisGrad.png']}");
+ border-color: '#{richSkin.tableFooterBackgroundColor}';
+}
+
+.rf-fu-btn-upl, .rf-fu-btn-clr {
+ display: none;
+}
+
+.rf-fu-btn-cnt-add, .rf-fu-btn-cnt-add-dis, .rf-fu-btn-cnt-upl, .rf-fu-btn-cnt-clr, .rf-fu-itm-lbl, .rf-fu-itm-st, .rf-fu-itm-lnk {
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+}
+
+.rf-fu-btn-cnt-add, .rf-fu-btn-cnt-upl, .rf-fu-btn-cnt-clr, .rf-fu-itm-lbl, .rf-fu-itm-st {
+ color: '#{richSkin.generalTextColor}';
+}
+
+.rf-fu-btn-cnt-add, .rf-fu-btn-cnt-add-dis, .rf-fu-btn-cnt-upl, .rf-fu-btn-cnt-clr {
+ background-position: 2px 2px;
+ background-repeat: no-repeat;
+ display: inline-block;
+ padding: 3px 5px 3px 21px;
+}
+
+.rf-fu-btn-cnt-add {
+ background-image: url("#{resource['org.richfaces:fu-add.gif']}");
+ overflow: hidden;
+ position: relative;
+}
+
+.rf-fu-btn-cnt-add-dis {
+ background-image: url("#{resource['org.richfaces:fu-add-dis.gif']}");
+ color: '#{richSkin.tabDisabledTextColor}';
+}
+
+.rf-fu-btn-cnt-upl, .rf-fu-itm-st {
+ font-weight: bold;
+}
+
+.rf-fu-btn-cnt-upl {
+ background-image: url("#{resource['org.richfaces:fu-upl.gif']}");
+}
+
+.rf-fu-btn-cnt-clr {
+ background-image: url("#{resource['org.richfaces:fu-clr.gif']}");
+}
+
+.rf-fu-inp-cntr {
+ display: block;
+ height: 1px;
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.rf-fu-inp {
+ filter: "alpha(opacity=0)";
+ font-size: 10em;
+ margin: 0;
+ opacity: 0;
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.rf-fu-itm {
+ border-bottom-color: '#{richSkin.panelBorderColor}';
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ padding: 12px;
+ white-space: nowrap;
+}
+
+.rf-fu-itm-lft, .rf-fu-itm-rgh {
+ vertical-align: middle;
+}
+
+.rf-fu-itm-lft {
+ width: 85%;
+}
+
+.rf-fu-itm-rgh {
+ width: 14%;
+}
+
+.rf-fu-itm-lnk {
+ color: '#{richSkin.generalLinkColor}';
+}
+
+.rf-fu-itm-st {
+ display: none;
+ margin-top: 5px;
+}
\ No newline at end of file
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js)
===================================================================
--- trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js (rev 0)
+++ trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-03 20:08:40 UTC (rev 20386)
@@ -0,0 +1,274 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+(function(richfaces, jQuery) {
+
+ var UID = "rf_fu_uid";
+
+ var ITEM_HTML = '<div class="rf-fu-itm">'
+ + '<span class="rf-fu-itm-lft"><span class="rf-fu-itm-lbl"/><span class="rf-fu-itm-st"/></span>'
+ + '<span class="rf-fu-itm-rgh"><a href="javascript:void(0)" class="rf-fu-itm-lnk"/></span></div>';
+
+ var ITEM_STATE = {
+ NEW: "new",
+ UPLOADING: "uploading",
+ DONE: "done",
+ SIZE_EXCEEDED: "sizeExceeded",
+ STOPPED: "stopped",
+ SERVER_ERROR: "serverError"
+ };
+
+ var pressButton = function(event) {
+ jQuery(this).children(":first").css("background-position", "3px 3px").css("padding", "4px 4px 2px 22px");
+ };
+
+ var unpressButton = function(event) {
+ jQuery(this).children(":first").css("background-position", "2px 2px").css("padding", "3px 5px 3px 21px");
+ };
+
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.FileUpload = richfaces.BaseComponent.extendClass({
+
+ name: "FileUpload",
+
+ items: [],
+ submitedItems: [],
+
+ doneLabel: "Done",
+ sizeExceededLabel: "File size is exceeded",
+ stoppedLabel: "",
+ serverErrorLabel: "Server error",
+ clearLabel: "Clear",
+ deleteLabel: "Delete",
+
+ init: function(id, options) {
+ this.id = id;
+ jQuery.extend(this, options);
+ if (this.acceptedTypes) {
+ this.acceptedTypes = jQuery.trim(this.acceptedTypes).split(/\s*,\s*/);
+ }
+ this.element = jQuery(this.attachToDom());
+ this.form = this.element.parents("form:first");
+ var header = this.element.children(".rf-fu-hdr:first");
+ var leftButtons = header.children(".rf-fu-btns-lft:first");
+ this.addButton = leftButtons.children(".rf-fu-btn-add:first");
+ this.uploadButton = this.addButton.next();
+ this.clearButton = leftButtons.next().children(".rf-fu-btn-clr:first");
+ this.inputContainer = this.addButton.find(".rf-fu-inp-cntr:first");
+ this.input = this.inputContainer.children("input");
+ this.list = header.next();
+ this.hiddenContainer = this.list.next();
+ this.iframe = this.hiddenContainer.children("iframe:first");
+ this.progressBarElement = this.iframe.next();
+ this.progressBar = richfaces.$(this.progressBarElement);
+ this.cleanInput = this.input.clone();
+ this.addProxy = jQuery.proxy(this.__addItem, this);
+ this.input.change(this.addProxy);
+ this.addButton.mousedown(pressButton).mouseup(unpressButton).mouseout(unpressButton);
+ this.uploadButton.click(jQuery.proxy(this.__startUpload, this)).mousedown(pressButton)
+ .mouseup(unpressButton).mouseout(unpressButton);
+ this.clearButton.click(jQuery.proxy(this.__removeAllItems, this)).mousedown(pressButton)
+ .mouseup(unpressButton).mouseout(unpressButton);
+ this.iframe.load(jQuery.proxy(this.__load, this));
+ if (this.onfilesubmit) {
+ richfaces.Event.bind(this.element, "onfilesubmit", new Function("event", this.onfilesubmit));
+ }
+ if (this.onuploadcomplete) {
+ richfaces.Event.bind(this.element, "onuploadcomplete", new Function("event", this.onuploadcomplete));
+ }
+ },
+
+ __addItem: function() {
+ var fileName = this.input.val();
+ if (this.__accept(fileName) && (!this.noDuplicate || !this.__isFileAlreadyAdded(fileName))) {
+ this.input.hide();
+ this.input.unbind("change", this.addProxy);
+ var item = new Item(this);
+ this.list.append(item.getJQuery());
+ this.items.push(item);
+ this.input = this.cleanInput.clone();
+ this.inputContainer.append(this.input);
+ this.input.change(this.addProxy);
+ this.__updateButtons();
+ }
+ },
+
+ __removeItem: function(item) {
+ this.items.splice(this.items.indexOf(item), 1);
+ this.submitedItems.splice(this.submitedItems.indexOf(item), 1);
+ this.__updateButtons();
+ },
+
+ __removeAllItems: function(item) {
+ this.inputContainer.children(":not(:visible)").remove();
+ this.list.empty();
+ this.items.splice(0);
+ this.submitedItems.splice(0);
+ this.__updateButtons();
+ },
+
+ __updateButtons: function() {
+ if (!this.loadableItem && this.list.children(".rf-fu-itm").size()) {
+ if (this.items.length) {
+ this.uploadButton.css("display", "inline-block");
+ } else {
+ this.uploadButton.hide();
+ }
+ this.clearButton.css("display", "inline-block");
+ } else {
+ this.uploadButton.hide();
+ this.clearButton.hide();
+ }
+ },
+
+ __startUpload: function() {
+ this.loadableItem = this.items.shift();
+ this.__updateButtons();
+ this.loadableItem.startUploading();
+ },
+
+ __submit: function() {
+ var originalAction = this.form.attr("action");
+ var originalEncoding = this.form.attr("encoding");
+ var originalEnctype = this.form.attr("enctype");
+ try {
+ this.form.attr("action", originalAction + "?" + UID + "=" + this.loadableItem.uid);
+ this.form.attr("encoding", "multipart/form-data");
+ this.form.attr("enctype", "multipart/form-data");
+ richfaces.submitForm(this.form, {"org.richfaces.ajax.component": this.id}, this.id);
+ richfaces.Event.fire(this.element, "onfilesubmit", this.loadableItem.model);
+ } finally {
+ this.form.attr("action", originalAction);
+ this.form.attr("encoding", originalEncoding);
+ this.form.attr("enctype", originalEnctype);
+ this.loadableItem.input.removeAttr("name");
+ }
+ },
+
+ __load: function(event) {
+ if (this.loadableItem) {
+ var contentDocument = event.target.contentWindow.document;
+ contentDocument = contentDocument.XMLDocument || contentDocument;
+ var documentElement = contentDocument.documentElement;
+ var responseStatus, id;
+ if (documentElement.tagName.toUpperCase() == "PARTIAL-RESPONSE") {
+ responseStatus = ITEM_STATE.DONE;
+ } else if ((id = documentElement.id) && id.indexOf(UID + this.loadableItem.uid + ":") == 0) {
+ responseStatus = id.split(":")[1];
+ }
+ if (responseStatus) {
+ responseStatus == ITEM_STATE.DONE && jsf.ajax.response({responseXML: contentDocument}, {});
+ this.loadableItem.finishUploading(responseStatus);
+ this.submitedItems.push(this.loadableItem);
+ if (responseStatus == ITEM_STATE.DONE && this.items.length) {
+ this.__startUpload();
+ } else {
+ this.loadableItem = null;
+ this.__updateButtons();
+ var items = [];
+ for (var i in this.submitedItems) {
+ items.push(this.submitedItems[i].model);
+ }
+ for (var i in this.items) {
+ items.push(this.items[i].model);
+ }
+ richfaces.Event.fire(this.element, "onuploadcomplete", items);
+ }
+ }
+ }
+ },
+
+ __accept: function(fileName) {
+ var result = !this.acceptedTypes;
+ for (var i = 0; !result && i < this.acceptedTypes.length; i++) {
+ var extension = this.acceptedTypes[i];
+ result = fileName.indexOf(extension, fileName.length - extension.length) !== -1;
+ }
+ return result;
+ },
+
+ __isFileAlreadyAdded: function(fileName) {
+ var result = false;
+ for (var i = 0; !result && i < this.items.length; i++) {
+ result = this.items[i].model.name == fileName;
+ }
+ result = result || (this.loadableItem && this.loadableItem.model.name == fileName);
+ for (var i = 0; !result && i < this.submitedItems.length; i++) {
+ result = this.submitedItems[i].model.name == fileName;
+ }
+ return result;
+ }
+ });
+
+ var Item = function(fileUpload) {
+ this.fileUpload = fileUpload;
+ this.input = fileUpload.input;
+ this.model = {name: this.input.val(), state: ITEM_STATE.NEW};
+ };
+
+ jQuery.extend(Item.prototype, {
+ getJQuery: function() {
+ this.element = jQuery(ITEM_HTML);
+ var leftArea = this.element.children(".rf-fu-itm-lft:first");
+ this.label = leftArea.children(".rf-fu-itm-lbl:first");
+ this.state = this.label.nextAll(".rf-fu-itm-st:first");
+ this.link = leftArea.next().children("a");
+ this.label.html(this.model.name);
+ this.link.html(this.fileUpload["deleteLabel"]);
+ this.link.click(jQuery.proxy(this.removeOrStop, this));
+ return this.element;
+ },
+
+ removeOrStop: function() {
+ this.input.remove();
+ this.element.remove();
+ this.fileUpload.__removeItem(this);
+ },
+
+ startUploading: function() {
+ this.state.css("display", "block");
+ this.link.html("");
+ this.input.attr("name", this.fileUpload.id);
+ this.model.state = ITEM_STATE.UPLOADING;
+ this.uid = Math.random();
+ this.fileUpload.__submit();
+ var params = {};
+ params[UID] = this.uid;
+ if (this.fileUpload.progressBar) {
+ this.fileUpload.progressBar.setValue(0);
+ this.state.html(this.fileUpload.progressBarElement.detach());
+ this.fileUpload.progressBar.enable(params);
+ }
+ },
+
+ finishUploading: function(state) {
+ if (this.fileUpload.progressBar) {
+ this.fileUpload.progressBar.disable();
+ this.fileUpload.hiddenContainer.append(this.fileUpload.progressBarElement.detach());
+ }
+ this.input.remove();
+ this.state.html(this.fileUpload[state + "Label"]);
+ this.link.html(this.fileUpload["clearLabel"]);
+ this.model.state = state;
+ }
+ });
+}(window.RichFaces, jQuery));
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add-dis.gif (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add-dis.gif)
===================================================================
(Binary files differ)
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif)
===================================================================
(Binary files differ)
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif)
===================================================================
(Binary files differ)
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/fu-upl.gif (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-upl.gif)
===================================================================
(Binary files differ)
Copied: trunk/ui/misc/ui/src/main/resources/META-INF/richfaces (from rev 20384, sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/richfaces)
14 years, 1 month
JBoss Rich Faces SVN: r20385 - in sandbox/trunk/ui/fileupload/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-03 15:03:23 -0500 (Fri, 03 Dec 2010)
New Revision: 20385
Removed:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
Log:
RF-9921
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2010-12-03 20:00:01 UTC (rev 20384)
+++ sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2010-12-03 20:03:23 UTC (rev 20385)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.event.UploadEvent;
-import org.richfaces.request.MultipartRequest;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public class FileUploadRendererBase extends RendererBase {
-
- @Override
- protected void doDecode(FacesContext context, UIComponent component) {
- ExternalContext externalContext = context.getExternalContext();
- Object request = externalContext.getRequest();
- if (request instanceof MultipartRequest
- && externalContext.getRequestParameterMap().containsKey(component.getClientId(context))) {
- component.queueEvent(new UploadEvent(component, ((MultipartRequest) request).getUploadItems()));
- }
- }
-}
Deleted: sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-12-03 20:00:01 UTC (rev 20384)
+++ sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-12-03 20:03:23 UTC (rev 20385)
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-JBoss, Home of Professional Open Source
-Copyright ${year}, 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.
--->
-<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
- xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite" xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
- xmlns:xi="http://www.w3.org/2001/XInclude">
- <cc:interface>
- <cdk:class>org.richfaces.renderkit.html.FileUploadRenderer</cdk:class>
- <cdk:superclass>org.richfaces.renderkit.FileUploadRendererBase</cdk:superclass>
- <cdk:component-family>org.richfaces.FileUpload</cdk:component-family>
- <cdk:renderer-type>org.richfaces.FileUploadRenderer</cdk:renderer-type>
- <cdk:resource-dependency library="org.richfaces" name="fileupload.ecss" />
- <cdk:resource-dependency library="org.richfaces" name="ajax.reslib" />
- <cdk:resource-dependency library="org.richfaces" name="base-component.reslib" />
- <cdk:resource-dependency name="richfaces-event.js" />
- <cdk:resource-dependency library="org.richfaces" name="fileupload.js" />
- </cc:interface>
- <cc:implementation>
- <cdk:object name="attributes" value="#{component.attributes}"/>
- <cdk:object name="enabled" value="#{attributes['enabled']}"/>
- <div id="#{clientId}" class="rf-fu #{attributes['styleClass']}"
- cdk:passThroughWithExclusions="">
- <div class="rf-fu-hdr">
- <span class="rf-fu-btns-lft">
- <span class="rf-fu-btn-add#{enabled ? '' : '-dis'}">
- <span class="rf-fu-btn-cnt-add#{enabled ? '' : '-dis'}">
- <c:if test="#{enabled}">
- <span class="rf-fu-inp-cntr"> <!-- This span is needed for IE7 only. -->
- <input type="file" class="rf-fu-inp"/>
- </span>
- </c:if>
- <cdk:object name="addLabel" value="#{attributes['addLabel']}"/>
- #{addLabel != null ? addLabel : 'Add...'}
- </span>
- </span>
- <c:if test="#{enabled}">
- <span class="rf-fu-btn-upl">
- <cdk:object name="uploadLabel" value="#{attributes['uploadLabel']}"/>
- <span class="rf-fu-btn-cnt-upl">#{uploadLabel != null ? uploadLabel : 'Upload'}</span>
- </span>
- </c:if>
- </span>
- <c:if test="#{enabled}">
- <span class="rf-fu-btns-rgh">
- <span class="rf-fu-btn-clr">
- <cdk:object name="clearAllLabel" value="#{attributes['clearAllLabel']}"/>
- <span class="rf-fu-btn-cnt-clr">#{clearAllLabel != null ? clearAllLabel : 'Clear All'}</span>
- </span>
- </span>
- </c:if>
- </div>
- <div class="rf-fu-lst"/>
- <c:if test="#{enabled}">
- <div class="rf-fu-cntr-hdn">
- <iframe name="#{clientId}"/>
- <cdk:object name="progressBar" value="#{component.facets['progress']}"/>
- <c:if test="#{progressBar != null and progressBar.isRendered()}">
- <cdk:call expression="progressBar.encodeAll(facesContext)" />
- </c:if>
- </div>
- <cdk:scriptObject name="options">
- <cdk:scriptOption attributes="acceptedTypes noDuplicate onfilesubmit onuploadcomplete doneLabel
- sizeExceededLabel stoppedLabel serverErrorLabel clearLabel deleteLabel"/>
- </cdk:scriptObject>
- <script type="text/javascript">new RichFaces.ui.FileUpload(#{toScriptArgs(clientId, options)});</script>
- </c:if>
- </div>
- </cc:implementation>
-</cdk:root>
14 years, 1 month