001: /*
002: * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/database/CmsStaticExportReport.java,v $
003: * Date : $Date: 2008-02-27 12:05:51 $
004: * Version: $Revision: 1.10 $
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.workplace.CmsReport;
036: import org.opencms.workplace.CmsWorkplaceSettings;
037:
038: import javax.servlet.http.HttpServletRequest;
039: import javax.servlet.http.HttpServletResponse;
040: import javax.servlet.jsp.JspException;
041: import javax.servlet.jsp.PageContext;
042:
043: /**
044: * Provides an output window for a CmsReport.<p>
045: *
046: * @author Michael Emmerich
047: *
048: * @version $Revision: 1.10 $
049: *
050: * @since 6.0.0
051: */
052: public class CmsStaticExportReport extends CmsReport {
053:
054: /** The dialog type. */
055: public static final String DIALOG_TYPE = "sync";
056:
057: /**
058: * Public constructor.<p>
059: *
060: * @param jsp an initialized JSP action element
061: */
062: public CmsStaticExportReport(CmsJspActionElement jsp) {
063:
064: super (jsp);
065: }
066:
067: /**
068: * Public constructor with JSP variables.<p>
069: *
070: * @param context the JSP page context
071: * @param req the JSP request
072: * @param res the JSP response
073: */
074: public CmsStaticExportReport(PageContext context,
075: HttpServletRequest req, HttpServletResponse res) {
076:
077: this (new CmsJspActionElement(context, req, res));
078: }
079:
080: /**
081: * Performs the move report, will be called by the JSP page.<p>
082: *
083: * @throws JspException if problems including sub-elements occur
084: */
085: public void actionReport() throws JspException {
086:
087: // save initialized instance of this class in request attribute for included sub-elements
088: getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS,
089: this );
090: switch (getAction()) {
091: case ACTION_REPORT_UPDATE:
092: setParamAction(REPORT_UPDATE);
093: getJsp().include(FILE_REPORT_OUTPUT);
094: break;
095: case ACTION_REPORT_BEGIN:
096: case ACTION_CONFIRMED:
097: default:
098: CmsStaticExportThread thread = new CmsStaticExportThread(
099: getCms());
100: thread.start();
101: setParamAction(REPORT_BEGIN);
102: setParamThread(thread.getUUID().toString());
103: getJsp().include(FILE_REPORT_OUTPUT);
104: break;
105: }
106: }
107:
108: /**
109: * @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
110: */
111: protected void initWorkplaceRequestValues(
112: CmsWorkplaceSettings settings, HttpServletRequest request) {
113:
114: // fill the parameter values in the get/set methods
115: fillParamValues(request);
116: // set the dialog type
117: setParamDialogtype(DIALOG_TYPE);
118: // set the action for the JSP switch
119: if (DIALOG_CONFIRMED.equals(getParamAction())) {
120: setAction(ACTION_CONFIRMED);
121: } else if (REPORT_UPDATE.equals(getParamAction())) {
122: setAction(ACTION_REPORT_UPDATE);
123: } else if (REPORT_BEGIN.equals(getParamAction())) {
124: setAction(ACTION_REPORT_BEGIN);
125: } else if (REPORT_END.equals(getParamAction())) {
126: setAction(ACTION_REPORT_END);
127: } else if (DIALOG_CANCEL.equals(getParamAction())) {
128: setAction(ACTION_CANCEL);
129: } else {
130: setAction(ACTION_DEFAULT);
131: // add the title for the dialog
132: setParamTitle(Messages.get().getBundle(getLocale()).key(
133: Messages.GUI_TITLE_STATICEXPORT_0));
134: }
135: }
136: }
|