KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > list > CmsListCsvExportDialog


1 /*
2  * File : $Source$
3  * Date : $Date$
4  * Version: $Revision$
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.list;
33
34 import org.opencms.jsp.CmsJspActionElement;
35 import org.opencms.workplace.CmsDialog;
36
37 import javax.servlet.http.HttpServletRequest JavaDoc;
38 import javax.servlet.http.HttpServletResponse JavaDoc;
39 import javax.servlet.jsp.PageContext JavaDoc;
40
41 /**
42  * Generates a CSV file for a given list.<p>
43  *
44  * @author Michael Moossen
45  *
46  * @version $Revision$
47  *
48  * @since 6.0.0
49  */

50 public class CmsListCsvExportDialog extends CmsDialog {
51
52     /** List class parameter name constant. */
53     public static final String JavaDoc PARAM_LISTCLASS = "listclass";
54
55     /** List class paramater value. */
56     private String JavaDoc m_paramListclass;
57     
58     /**
59      * Public constructor.<p>
60      *
61      * @param jsp an initialized JSP action element
62      */

63     public CmsListCsvExportDialog(CmsJspActionElement jsp) {
64
65         super(jsp);
66     }
67
68     /**
69      * Generates the CSV file for the given list.<p>
70      *
71      * @return CSV file
72      *
73      * @throws ClassNotFoundException if the list dialog class is not found
74      */

75     public String JavaDoc generateCsv() throws ClassNotFoundException JavaDoc {
76         
77         CmsHtmlList list = A_CmsListDialog.getListObject(Class.forName(getParamListclass()), getSettings());
78         return list.listCsv(this);
79     }
80     
81     /**
82      * Public constructor with JSP variables.<p>
83      *
84      * @param context the JSP page context
85      * @param req the JSP request
86      * @param res the JSP response
87      */

88     public CmsListCsvExportDialog(PageContext JavaDoc context, HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc res) {
89
90         this(new CmsJspActionElement(context, req, res));
91     }
92
93     
94     /**
95      * Returns the value for the List class parameter.<p>
96      *
97      * @return the value for the List class parameter
98      */

99     public String JavaDoc getParamListclass() {
100     
101         return m_paramListclass;
102     }
103
104     
105     /**
106      * Sets the value for the List class parameter.<p>
107      *
108      * @param listclass the value for the List class parameter to set
109      */

110     public void setParamListclass(String JavaDoc listclass) {
111     
112         m_paramListclass = listclass;
113     }
114
115 }
Popular Tags