001: /*
002: * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/database/CmsDatabaseExportReport.java,v $
003: * Date : $Date: 2008-02-27 12:05:51 $
004: * Version: $Revision: 1.9 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010: *
011: * This library is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public
013: * License as published by the Free Software Foundation; either
014: * version 2.1 of the License, or (at your option) any later version.
015: *
016: * This library is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: * Lesser General Public License for more details.
020: *
021: * For further information about Alkacon Software GmbH, please see the
022: * company website: http://www.alkacon.com
023: *
024: * For further information about OpenCms, please see the
025: * project website: http://www.opencms.org
026: *
027: * You should have received a copy of the GNU Lesser General Public
028: * License along with this library; if not, write to the Free Software
029: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
030: */
031:
032: package org.opencms.workplace.tools.database;
033:
034: import org.opencms.importexport.CmsExportParameters;
035: import org.opencms.importexport.CmsVfsImportExportHandler;
036: import org.opencms.jsp.CmsJspActionElement;
037: import org.opencms.report.I_CmsReportThread;
038: import org.opencms.workplace.list.A_CmsListReport;
039: import org.opencms.workplace.threads.CmsExportThread;
040:
041: import java.util.Map;
042:
043: import javax.servlet.http.HttpServletRequest;
044: import javax.servlet.http.HttpServletResponse;
045: import javax.servlet.jsp.PageContext;
046:
047: /**
048: * Provides a report for exporting VFS resources to zipped files of the OpenCms server.<p>
049: *
050: * @author Andreas Zahner
051: *
052: * @version $Revision: 1.9 $
053: *
054: * @since 6.0.0
055: */
056: public class CmsDatabaseExportReport extends A_CmsListReport {
057:
058: /** Request parameter name for the class name to get the dialog object from. */
059: public static final String PARAM_CLASSNAME = "classname";
060:
061: /** Request parameter for the class name to get the dialog object from. */
062: private String m_paramClassname;
063:
064: /**
065: * Public constructor with JSP action element.<p>
066: *
067: * @param jsp an initialized JSP action element
068: */
069: public CmsDatabaseExportReport(CmsJspActionElement jsp) {
070:
071: super (jsp);
072: }
073:
074: /**
075: * Public constructor with JSP variables.<p>
076: *
077: * @param context the JSP page context
078: * @param req the JSP request
079: * @param res the JSP response
080: */
081: public CmsDatabaseExportReport(PageContext context,
082: HttpServletRequest req, HttpServletResponse res) {
083:
084: this (new CmsJspActionElement(context, req, res));
085: }
086:
087: /**
088: * Returns the request parameter value for the class name to get the dialog object from.<p>
089: *
090: * @return the request parameter value for the class name to get the dialog object from
091: */
092: public String getParamClassname() {
093:
094: return m_paramClassname;
095: }
096:
097: /**
098: * @see org.opencms.workplace.list.A_CmsListReport#initializeThread()
099: */
100: public I_CmsReportThread initializeThread() {
101:
102: CmsExportParameters params = (CmsExportParameters) ((Map) getSettings()
103: .getDialogObject()).get(getParamClassname());
104: CmsVfsImportExportHandler handler = new CmsVfsImportExportHandler();
105: handler.setExportParams(params);
106: I_CmsReportThread exportThread = new CmsExportThread(getCms(),
107: handler, false);
108:
109: return exportThread;
110: }
111:
112: /**
113: * Sets the request parameter value for the class name to get the dialog object from.<p>
114: *
115: * @param className the request parameter value for the class name to get the dialog object from
116: */
117: public void setParamClassname(String className) {
118:
119: m_paramClassname = className;
120: }
121:
122: }
|