001: /*
002: * File :
003: * Date :
004: * Version:
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.content.check;
033:
034: import org.opencms.file.CmsObject;
035: import org.opencms.main.CmsLog;
036: import org.opencms.report.A_CmsReportThread;
037:
038: import org.apache.commons.logging.Log;
039:
040: /**
041: * Thread for content checks. <p>
042: *
043: * @author Michael Emmerich
044: *
045: * @version $Revision: 1.4 $
046: *
047: * @since 6.1.2
048: */
049: public class CmsContentCheckThread extends A_CmsReportThread {
050:
051: /** The log object for this class. */
052: private static final Log LOG = CmsLog
053: .getLog(CmsContentCheckThread.class);
054:
055: /** the CmsObject to use. */
056: private CmsObject m_cms;
057:
058: /** reference to the CmsContentCheckObject. */
059: private CmsContentCheck m_contentCheck;
060:
061: /**
062: * Constructor, creates a new CmsContentCheckThread.<p>
063: *
064: * @param cms the current CmsObject
065: * @param contentCheck the CmsContentCheck objectt
066: */
067: public CmsContentCheckThread(CmsObject cms,
068: CmsContentCheck contentCheck) {
069:
070: super (cms, "contentcheck");
071: initHtmlReport(cms.getRequestContext().getLocale());
072: m_cms = cms;
073: m_cms.getRequestContext().setUpdateSessionEnabled(false);
074: m_contentCheck = contentCheck;
075: }
076:
077: /**
078: * @see org.opencms.report.A_CmsReportThread#getReportUpdate()
079: */
080: public String getReportUpdate() {
081:
082: return getReport().getReportUpdate();
083: }
084:
085: /**
086: * The run method which starts the import process.<p>
087: */
088: public void run() {
089:
090: try {
091: // do the content check
092: m_contentCheck.startContentCheck(m_cms, getReport());
093: } catch (Exception e) {
094: getReport().println(e);
095: if (LOG.isErrorEnabled()) {
096: LOG.error(e.getLocalizedMessage());
097: }
098: }
099: }
100: }
|