You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/04/24 01:46:15 UTC

svn commit: r651110 [2/2] - in /myfaces/tomahawk/trunk/sandbox: core/src/main/java/org/apache/myfaces/custom/excelexport/ core/src/main/java/org/apache/myfaces/custom/exporter/ core/src/main/java/org/apache/myfaces/custom/exporter/util/ core/src/main/j...

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/pdfexport/SimpleCar.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/pdfexport/SimpleCar.java?rev=651110&r1=651109&r2=651110&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/pdfexport/SimpleCar.java (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/pdfexport/SimpleCar.java Wed Apr 23 16:46:09 2008
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.examples.pdfexport;
-
-import java.io.Serializable;
-
-public class SimpleCar
-        implements Serializable
-{
-    /**
-     * serial id for serialisation versioning
-     */
-    private static final long serialVersionUID = 1L;
-    private int _id;
-    private String _type;
-    private String _color;
-
-    public SimpleCar(int id, String type, String color)
-    {
-        _id = id;
-        _type = type;
-        _color = color;
-    }
-
-    public int getId()
-    {
-        return _id;
-    }
-
-    public void setId(int id)
-    {
-        _id = id;
-    }
-
-    public String getType()
-    {
-        return _type;
-    }
-
-    public void setType(String type)
-    {
-        _type = type;
-    }
-
-    public String getColor()
-    {
-        return _color;
-    }
-
-    public void setColor(String color)
-    {
-        _color = color;
-    }
-}

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml?rev=651110&r1=651109&r2=651110&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml Wed Apr 23 16:46:09 2008
@@ -491,16 +491,11 @@
     </managed-bean>
 
     <managed-bean>
-    	<managed-bean-name>excelExportBean</managed-bean-name>
-    	<managed-bean-class>org.apache.myfaces.examples.excelexport.ExcelExportBean</managed-bean-class>
+    	<managed-bean-name>exporterBean</managed-bean-name>
+    	<managed-bean-class>org.apache.myfaces.examples.exporter.ExporterBean</managed-bean-class>
     	<managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
     
-    <managed-bean>
-    	<managed-bean-name>pdfExportBean</managed-bean-name>
-    	<managed-bean-class>org.apache.myfaces.examples.pdfexport.PDFExportBean</managed-bean-class>
-    	<managed-bean-scope>request</managed-bean-scope>
-    </managed-bean>    
 
     <!-- XMLTemplate -->
     <managed-bean>

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/exporter.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/exporter.jsp?rev=651110&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/exporter.jsp (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/exporter.jsp Wed Apr 23 16:46:09 2008
@@ -0,0 +1,93 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
+<html>
+
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<%@include file="inc/head.inc" %>
+
+<body>
+
+<f:view>
+
+    <h:form>
+    	<p>This component allows to export the datatable contents to an excel file.</p>
+		<p>Note: Currently the component does not support client side state saving.</p>
+		
+		<br>
+		
+		<t:dataTable id="tbl_cars"
+                styleClass="scrollerTable"
+                headerClass="standardTable_Header"
+                footerClass="standardTable_Header"
+                rowClasses="standardTable_Row1,standardTable_Row2"
+                columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
+                var="car"
+                value="#{exporterBean.carsList}"
+                preserveDataModel="false" 
+           >
+           <h:column>
+               <f:facet name="header">
+                   <h:outputText value="Id" />
+               </f:facet>
+               <h:outputText value="#{car.id}" />
+           </h:column>
+
+           <h:column>
+               <f:facet name="header">
+                  <h:outputText value="Type" />
+               </f:facet>
+               <h:outputText value="#{car.type}" />
+           </h:column>
+
+           <h:column>
+               <f:facet name="header">
+                  <h:outputText value="Color" />
+               </f:facet>
+               <h:outputText value="#{car.color}" />
+           </h:column>
+
+        </t:dataTable>
+
+		<br>
+		
+		<s:exporter for="tbl_cars" fileType="XLS">
+			<h:commandButton action="" value="Export as excel"/>
+		</s:exporter>
+		
+		<br>
+		
+		<s:exporter for="tbl_cars" fileType="PDF">
+			<h:commandButton action="" value="Export as pdf"/>
+		</s:exporter>
+		
+    </h:form>
+</f:view>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</body>
+
+</html>

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/exporter.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/exporter.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp?rev=651110&r1=651109&r2=651110&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp Wed Apr 23 16:46:09 2008
@@ -1,4 +1,4 @@
-<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
 <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
 
@@ -88,7 +88,7 @@
             <h:panelGrid style="padding-left:25px">
                 <h:outputLink value="dojo/splitpanejsfonly.jsf" ><f:verbatim>SplitPane - Dojos ContentPane widget to separate a page into panes of belonging content</f:verbatim></h:outputLink>
                 <h:outputLink value="dojo/titlepanejsfonly.jsf" ><f:verbatim>TitlePane - Dojos TitlePane; Displays some data with a title on top. Data can be collapsed leaving only the title shown. </f:verbatim></h:outputLink>
-                <h:outputLink value="accordionPanel.jsf" ><f:verbatim>AccordionPanel</f:verbatim></h:outputLink>
+                <h:outputLink value="accordionPnel.jsf" ><f:verbatim>AccordionPanel</f:verbatim></h:outputLink>
                 <h:outputLink value="hmenu.jsf" ><f:verbatim>Horizontal Menu</f:verbatim></h:outputLink>
 				<h:outputLink value="fieldset.jsf"><f:verbatim>FieldSet</f:verbatim></h:outputLink>
             </h:panelGrid>
@@ -107,8 +107,7 @@
                 <h:outputLink value="filterTable.jsf" ><f:verbatim>Filter Table</f:verbatim></h:outputLink>
             	<h:outputLink value="autoUpdateDataTable.jsf" ><f:verbatim>Automatically updated dataTable per AJAX</f:verbatim></h:outputLink>
             	<h:outputLink value="selectOneRow.jsf"><f:verbatim>selectOneRow - a DataTable Enhancement</f:verbatim></h:outputLink>
-            	<h:outputLink value="excelExport.jsf"><f:verbatim>ExcelExport - Export datatable contents as an excel file</f:verbatim></h:outputLink>
-            	<h:outputLink value="pdfExport.jsf"><f:verbatim>PDFExport - Export datatable contents as a PDF file</f:verbatim></h:outputLink>            	
+			<h:outputLink value="exporter.jsf"><f:verbatim>Exporter - Export datatable contents as an excel file or as a pdf file</f:verbatim></h:outputLink>
             </h:panelGrid>
 
             <h:outputText value="Selection Lists"/>
@@ -142,7 +141,7 @@
 
             <h:outputText value="Conversation"/>
             <h:panelGrid style="padding-left:25px">
-           		<h:outputLink value="conversation/index.jsf" ><f:verbatim>Conversation Tag examples</f:verbatim></h:outputLink>
+           		<h:oututLink value="conversation/index.jsf" ><f:verbatim>Conversation Tag examples</f:verbatim></h:outputLink>
 				<h:outputLink value="springConversation/index.jsf" ><f:verbatim>A new Spring "conversation" scope</f:verbatim></h:outputLink>
             </h:panelGrid>