KickJava   Java API By Example, From Geeks To Geeks.

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


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.workplace.CmsWorkplace;
35
36 /**
37  * Generates a CSV file for a list.<p>
38  *
39  * @author Michael Moossen
40  *
41  * @version $Revision$
42  *
43  * @since 6.0.0
44  */

45 public class CmsListCsvExportIAction extends A_CmsListIndependentJsAction {
46
47     /** List independent action id constant. */
48     public static final String JavaDoc LIST_ACTION_ID = "iac";
49
50     /**
51      * Default constructor.<p>
52      */

53     public CmsListCsvExportIAction() {
54
55         super(LIST_ACTION_ID);
56         setName(Messages.get().container(Messages.GUI_LIST_ACTION_CSV_NAME_0));
57         setHelpText(Messages.get().container(Messages.GUI_LIST_ACTION_CSV_HELP_0));
58         setConfirmationMessage(Messages.get().container(Messages.GUI_LIST_ACTION_CSV_CONF_0));
59         setIconPath("list/csv.png");
60         setEnabled(true);
61         setVisible(true);
62     }
63
64     /**
65      * @see org.opencms.workplace.list.A_CmsListIndependentJsAction#jsCode(CmsWorkplace)
66      */

67     public String JavaDoc jsCode(CmsWorkplace wp) {
68
69         String JavaDoc url = wp.getJsp().link("/system/workplace/commons/list-csv.jsp?" + CmsListCsvExportDialog.PARAM_LISTCLASS + "=" + wp.getClass().getName());
70         String JavaDoc title = "CSV - " + ((A_CmsListDialog)wp).getList().getName().key(wp.getLocale());
71         String JavaDoc opts = "toolbar=no,location=no,directories=no,status=yes,menubar=0,scrollbars=yes,resizable=yes,top=150,left=660,width=450,height=450";
72         StringBuffer JavaDoc js = new StringBuffer JavaDoc(512);
73         js.append("window.open('");
74         js.append(url);
75         js.append("', '");
76         js.append(title);
77         js.append("', '");
78         js.append(opts);
79         js.append("');");
80         return js.toString();
81     }
82 }
83
Popular Tags