001: /*
002: * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/database/CmsDatabaseImportReport.java,v $
003: * Date : $Date: 2008-02-27 12:05:51 $
004: * Version: $Revision: 1.8 $
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.jsp.CmsJspActionElement;
035: import org.opencms.main.OpenCms;
036: import org.opencms.report.I_CmsReportThread;
037: import org.opencms.workplace.list.A_CmsListReport;
038: import org.opencms.workplace.threads.CmsDatabaseImportThread;
039:
040: import javax.servlet.http.HttpServletRequest;
041: import javax.servlet.http.HttpServletResponse;
042: import javax.servlet.jsp.PageContext;
043:
044: /**
045: * Provides a report for importing zipped files or folder to the OpenCms VFS.<p>
046: *
047: * @author Andreas Zahner
048: *
049: * @version $Revision: 1.8 $
050: *
051: * @since 6.0.0
052: */
053: public class CmsDatabaseImportReport extends A_CmsListReport {
054:
055: /** The keep permissions flag. */
056: private String m_keepPermissions;
057:
058: /** Request parameter for the file name to import. */
059: private String m_paramFile;
060:
061: /**
062: * Public constructor with JSP action element.<p>
063: *
064: * @param jsp an initialized JSP action element
065: */
066: public CmsDatabaseImportReport(CmsJspActionElement jsp) {
067:
068: super (jsp);
069: }
070:
071: /**
072: * Public constructor with JSP variables.<p>
073: *
074: * @param context the JSP page context
075: * @param req the JSP request
076: * @param res the JSP response
077: */
078: public CmsDatabaseImportReport(PageContext context,
079: HttpServletRequest req, HttpServletResponse res) {
080:
081: this (new CmsJspActionElement(context, req, res));
082: }
083:
084: /**
085: * Returns the keepPermissions parameter.<p>
086: *
087: * @return the keepPermissions parameter
088: */
089: public String getKeepPermissions() {
090:
091: return m_keepPermissions;
092: }
093:
094: /**
095: * Returns the request parameter value for the file name to import.<p>
096: *
097: * @return the request parameter value for the file name to import
098: */
099: public String getParamFile() {
100:
101: return m_paramFile;
102: }
103:
104: /**
105: *
106: * @see org.opencms.workplace.list.A_CmsListReport#initializeThread()
107: */
108: public I_CmsReportThread initializeThread() {
109:
110: String importFile = OpenCms.getSystemInfo()
111: .getPackagesRfsPath()
112: + getParamFile();
113: boolean keepPermissions = Boolean.valueOf(getKeepPermissions())
114: .booleanValue();
115:
116: I_CmsReportThread importThread = new CmsDatabaseImportThread(
117: getCms(), importFile, keepPermissions);
118:
119: return importThread;
120: }
121:
122: /**
123: * Sets the keepPermissions parameter.<p>
124: *
125: * @param keepPermissions the keepPermissions parameter
126: */
127: public void setKeepPermissions(String keepPermissions) {
128:
129: m_keepPermissions = keepPermissions;
130: }
131:
132: /**
133: * Sets the request parameter value for the file name to import.<p>
134: *
135: * @param file the request parameter value for the file name to import
136: */
137: public void setParamFile(String file) {
138:
139: m_paramFile = file;
140: }
141:
142: }
|