001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software GmbH & Co. KG, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.workplace.tools.content.check; 029 030import org.opencms.file.CmsObject; 031import org.opencms.main.CmsException; 032 033import java.util.List; 034 035/** 036 * This interface defines an OpenCms content check. A content check will 037 * test the content of the properties of all resources inside of OpenCms if they 038 * follow the rules which are defined inside the test implementing this interface.<p> 039 * 040 * @since 6.1.2 041 */ 042public interface I_CmsContentCheck { 043 044 /** Parameter name for widgets. */ 045 String PARAMETER = "active"; 046 047 /** 048 * Main method of the content check. It holds the implementation of the content check.<p> 049 * 050 * @param cms the CmsObject 051 * @param testResource a CmsContentTestResource containing the results of previous tests 052 * @return the updated testResouce containing the results of the content check 053 * @throws CmsException if an error occurs 054 */ 055 CmsContentCheckResource executeContentCheck(CmsObject cms, CmsContentCheckResource testResource) 056 throws CmsException; 057 058 /** 059 * Defines the name of the parameter which is used by the CmsContentCheckDialog to enable 060 * or disable the content check.<p> 061 * 062 * @return the name of the dialog parameter. 063 */ 064 String getDialogParameterName(); 065 066 /** 067 * Gets a list of all required message bundles by this content check.<p> 068 * 069 * @return list of message bundle names 070 */ 071 List getMessageBundles(); 072 073 /** 074 * Gets the name of this content check.<p> 075 * 076 * @return name of the content check 077 */ 078 String getName(); 079 080 /** 081 * Initializer for the content check.<p> 082 * 083 * @param cms the current CmsObject 084 * @throws CmsException if an error occurs 085 */ 086 void init(CmsObject cms) throws CmsException; 087 088 /** 089 * Signals if this content check is active or not.<p> 090 * 091 * 092 * @return true if this content check is active, false otherwise. 093 */ 094 boolean isActive(); 095 096 /** 097 * Sets the active flag for the content check.<p> 098 * 099 * @param value the value for the active flag 100 */ 101 void setActive(boolean value); 102 103}