001: /*
002: * File : $Source: /usr/local/cvs/opencms/src/org/opencms/module/I_CmsModuleAction.java,v $
003: * Date : $Date: 2008-02-27 12:05:44 $
004: * Version: $Revision: 1.12 $
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.module;
033:
034: import org.opencms.configuration.CmsConfigurationManager;
035: import org.opencms.db.CmsPublishList;
036: import org.opencms.file.CmsObject;
037: import org.opencms.main.I_CmsEventListener;
038: import org.opencms.report.I_CmsReport;
039:
040: /**
041: * Module action classes in OpenCms must implement this interface.<p>
042: *
043: * A module action class allows to perform special functions on certain
044: * OpenCms lifecycle system events, like {@link #initialize(CmsObject, CmsConfigurationManager, CmsModule)} or
045: * {@link #shutDown(CmsModule)}.<p>
046: *
047: * @author Alexander Kandzior
048: *
049: * @version $Revision: 1.12 $
050: *
051: * @since 6.0.0
052: *
053: * @see org.opencms.module.A_CmsModuleAction
054: */
055: public interface I_CmsModuleAction extends I_CmsEventListener {
056:
057: /**
058: * Will be called by the OpenCms system during server startup.<p>
059: *
060: * If a module requires special initialization code, this
061: * is a good place to to implement this functions.<p>
062: *
063: * Moreover, if the module requires special "one time" setup code,
064: * this should also be implemented here. For example if the module
065: * requires special DB tables to be created, you should implement
066: * a check if theses tables exist in this method, and if they don't
067: * exist create them as needed.<p>
068: *
069: * @param adminCms an initialized CmsObject with "Admin" permissions
070: * @param configurationManager the initialized OpenCms configuration manager
071: * @param module the module of this action instance
072: */
073: void initialize(CmsObject adminCms,
074: CmsConfigurationManager configurationManager,
075: CmsModule module);
076:
077: /**
078: * Will be called if a module is uninstalled from an OpenCms system.<p>
079: *
080: * If you require special code to be executed if a module is uninstalled,
081: * implement it in this function.<p>
082: *
083: * Please note that there is no <code>install()</code> method.
084: * This is because the class loader will not have the module class
085: * instance available after module installation/upload. If you
086: * need to execute setup/install code, do this in the {@link #initialize(CmsObject, CmsConfigurationManager, CmsModule)}
087: * method during the next server startup.<p>
088: *
089: * This method is <i>not</i> called if the module this action instance belongs to
090: * is "replaced". In this case {@link #moduleUpdate(CmsModule)} is called after the
091: * new version of the module is installed.<p>
092: *
093: * @param module the module of this action instance
094: *
095: * @see #initialize(CmsObject, CmsConfigurationManager, CmsModule)
096: */
097: void moduleUninstall(CmsModule module);
098:
099: /**
100: * Will be called if the module this action instance belongs to is updated.<p>
101: *
102: * @param module the module of this action instance with the updated values
103: */
104: void moduleUpdate(CmsModule module);
105:
106: /**
107: * Will be called during a the publish process after the resources have been published,
108: * but before the publish event is fired.<p>
109: *
110: * If you require special code to be executed after a resource is published,
111: * implement it in this function any analyze the publish list for "interesting" resources.<p>
112: *
113: * @param cms the user context the publish was executed with
114: * @param publishList the list of published resources
115: * @param publishTag the publish tag
116: * @param report the report to write messages to
117: */
118: void publishProject(CmsObject cms, CmsPublishList publishList,
119: int publishTag, I_CmsReport report);
120:
121: /**
122: * Will be called by the OpenCms system during server shutdown.<p>
123: *
124: * If a module requires special "clean up" functions,
125: * for example removing temporary files, this is a good place
126: * to implement this functions.<p>
127: *
128: * @param module the module of this action instance
129: */
130: void shutDown(CmsModule module);
131: }
|