KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > module > I_CmsModuleAction


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/module/I_CmsModuleAction.java,v $
3  * Date : $Date: 2005/06/23 11:11:58 $
4  * Version: $Revision: 1.9 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.module;
33
34 import org.opencms.configuration.CmsConfigurationManager;
35 import org.opencms.db.CmsPublishList;
36 import org.opencms.file.CmsObject;
37 import org.opencms.main.I_CmsEventListener;
38 import org.opencms.report.I_CmsReport;
39
40 /**
41  * Module action classes in OpenCms must implement this interface.<p>
42  *
43  * A module action class allows to perform special functions on certain
44  * OpenCms lifecycle system events, like {@link #initialize(CmsObject, CmsConfigurationManager, CmsModule)} or
45  * {@link #shutDown(CmsModule)}.<p>
46  *
47  * @author Alexander Kandzior
48  *
49  * @version $Revision: 1.9 $
50  *
51  * @since 6.0.0
52  *
53  * @see org.opencms.module.A_CmsModuleAction
54  */

55 public interface I_CmsModuleAction extends I_CmsEventListener {
56
57     /**
58      * Will be called by the OpenCms system during server startup.<p>
59      *
60      * If a module requires special initialization code, this
61      * is a good place to to implement this functions.<p>
62      *
63      * Moreover, if the module requires special "one time" setup code,
64      * this should also be implemented here. For example if the module
65      * requires special DB tables to be created, you should implement
66      * a check if theses tables exist in this method, and if they don't
67      * exist create them as needed.<p>
68      *
69      * @param adminCms an initialized CmsObject with "Admin" permissions
70      * @param configurationManager the initialized OpenCms configuration manager
71      * @param module the module of this action instance
72      */

73     void initialize(CmsObject adminCms, CmsConfigurationManager configurationManager, CmsModule module);
74
75     /**
76      * Will be called if a module is uninstalled from an OpenCms system.<p>
77      *
78      * If you require special code to be executed if a module is uninstalled,
79      * implement it in this function.<p>
80      *
81      * Please note that there is no <code>install()</code> method.
82      * This is because the class loader will not have the module class
83      * instance available after module installation/upload. If you
84      * need to execute setup/install code, do this in the {@link #initialize(CmsObject, CmsConfigurationManager, CmsModule)}
85      * method during the next server startup.<p>
86      *
87      * This method is <i>not</i> called if the module this action instance belongs to
88      * is "replaced". In this case {@link #moduleUpdate(CmsModule)} is called after the
89      * new version of the module is installed.<p>
90      *
91      * @param module the module of this action instance
92      *
93      * @see #initialize(CmsObject, CmsConfigurationManager, CmsModule)
94      */

95     void moduleUninstall(CmsModule module);
96
97     /**
98      * Will be called if the module this action instance belongs to is updated.<p>
99      *
100      * @param module the module of this action instance with the updated values
101      */

102     void moduleUpdate(CmsModule module);
103
104     /**
105      * Will be called during a the publish process after the resources have been published,
106      * but before the publish event is fired.<p>
107      *
108      * If you require special code to be executed after a resource is published,
109      * implement it in this function any analyze the publish list for "interesting" resources.<p>
110      *
111      * @param cms the user context the publish was executed with
112      * @param publishList the list of published resources
113      * @param backupTagId the id of the backup tag
114      * @param report the report to write messages to
115      */

116     void publishProject(CmsObject cms, CmsPublishList publishList, int backupTagId, I_CmsReport report);
117
118     /**
119      * Will be called by the OpenCms system during server shutdown.<p>
120      *
121      * If a module requires special "clean up" functions,
122      * for example removing temporary files, this is a good place
123      * to implement this functions.<p>
124      *
125      * @param module the module of this action instance
126      */

127     void shutDown(CmsModule module);
128 }
129
Popular Tags