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.editors; 029 030import org.opencms.configuration.I_CmsConfigurationParameterHandler; 031import org.opencms.file.CmsResource; 032import org.opencms.file.types.I_CmsResourceType; 033import org.opencms.workplace.CmsDialog; 034 035/** 036 * Defines an action to be performed before the workplace editor is opened for the first time.<p> 037 * 038 * @since 6.5.4 039 */ 040public interface I_CmsPreEditorActionDefinition extends I_CmsConfigurationParameterHandler { 041 042 /** 043 * Returns if an action has to be performed before opening the editor depending on the resource to edit 044 * and eventual request parameter values.<p> 045 * 046 * @param resource the resource to be edited 047 * @param dialog the dialog instance 048 * @param originalParams the original request parameters as String passed to the editor 049 * @return true if an action has to be performed before opening the editor 050 * @throws Exception if something goes wrong 051 */ 052 boolean doPreAction(CmsResource resource, CmsDialog dialog, String originalParams) throws Exception; 053 054 /** 055 * Returns the resource type for which the action should be performed.<p> 056 * 057 * @return the resource type 058 */ 059 I_CmsResourceType getResourceType(); 060 061 /** 062 * Returns the resource type name for which the action should be performed.<p> 063 * 064 * @return the resource type name 065 */ 066 String getResourceTypeName(); 067 068 /** 069 * Sets the resource type name for which the action should be performed.<p> 070 * 071 * @param resourceTypeName the resource type name 072 */ 073 void setResourceTypeName(String resourceTypeName); 074}