001: /*
002: * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/database/CmsRemovePubLocksReport.java,v $
003: * Date : $Date: 2008-02-27 12:05:51 $
004: * Version: $Revision: 1.3 $
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.report.I_CmsReportThread;
036: import org.opencms.util.CmsFileUtil;
037: import org.opencms.util.CmsStringUtil;
038: import org.opencms.workplace.list.A_CmsListReport;
039:
040: import java.util.ArrayList;
041: import java.util.List;
042:
043: import javax.servlet.http.HttpServletRequest;
044: import javax.servlet.http.HttpServletResponse;
045: import javax.servlet.jsp.PageContext;
046:
047: /**
048: * A report for displaying the remove publish lock process.<p>
049: *
050: * @author Michael Moossen
051: *
052: * @version $Revision: 1.3 $
053: *
054: * @since 7.0.2
055: */
056: public class CmsRemovePubLocksReport extends A_CmsListReport {
057:
058: /** Resources parameter: Value is a list of comma separated resources. */
059: public static final String PARAM_RESOURCES = "resources";
060:
061: /** The request parameter value for resources: comma-separated names. **/
062: private String m_paramResources;
063:
064: /**
065: * Public constructor with JSP action element.<p>
066: *
067: * @param jsp an initialized JSP action element
068: */
069: public CmsRemovePubLocksReport(CmsJspActionElement jsp) {
070:
071: super (jsp);
072:
073: }
074:
075: /**
076: * Public constructor with JSP variables.<p>
077: *
078: * @param context the JSP page context
079: * @param req the JSP request
080: * @param res the JSP response
081: */
082: public CmsRemovePubLocksReport(PageContext context,
083: HttpServletRequest req, HttpServletResponse res) {
084:
085: super (context, req, res);
086:
087: }
088:
089: /**
090: * Returns the comma-separated list of resources.<p>
091: *
092: * @return the comma-separated list of resources
093: */
094: public String getParamResources() {
095:
096: return m_paramResources;
097: }
098:
099: /**
100: * Returns the <b>unstarted</b> <code>Thread</code> that will do the work.<p>
101: *
102: * @return the <b>unstarted</b> <code>Thread</code> that will do the work
103: *
104: * @see org.opencms.workplace.list.A_CmsListReport#initializeThread()
105: */
106: public I_CmsReportThread initializeThread() {
107:
108: List resources = new ArrayList();
109: if (CmsStringUtil
110: .isNotEmptyOrWhitespaceOnly(getParamResources())) {
111: resources = CmsStringUtil.splitAsList(getParamResources(),
112: ",");
113: }
114: resources = CmsFileUtil.removeRedundancies(resources);
115:
116: CmsRemovePubLocksThread thread = new CmsRemovePubLocksThread(
117: getCms(), resources);
118: return thread;
119: }
120:
121: /**
122: * Sets the comma-separated list of resources.<p>
123: *
124: * @param paramIndexes the comma-separated list of resources
125: */
126: public void setParamResources(String paramIndexes) {
127:
128: m_paramResources = paramIndexes;
129: }
130: }
|