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>