01: /*
02: * File : $Source: /usr/local/cvs/alkacon/com.alkacon.opencms.registration/src/com/alkacon/opencms/registration/CmsRegistrationModuleAction.java,v $
03: * Date : $Date: 2008-02-19 13:22:30 $
04: * Version: $Revision: 1.1 $
05: *
06: * This file is part of the Alkacon OpenCms Add-On Module Package
07: *
08: * Copyright (c) 2007 Alkacon Software GmbH (http://www.alkacon.com)
09: *
10: * The Alkacon OpenCms Add-On Module Package is free software:
11: * you can redistribute it and/or modify
12: * it under the terms of the GNU General Public License as published by
13: * the Free Software Foundation, either version 3 of the License, or
14: * (at your option) any later version.
15: *
16: * The Alkacon OpenCms Add-On Module Package is distributed
17: * in the hope that it will be useful,
18: * but WITHOUT ANY WARRANTY; without even the implied warranty of
19: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20: * GNU General Public License for more details.
21: *
22: * You should have received a copy of the GNU General Public License
23: * along with the Alkacon OpenCms Add-On Module Package.
24: * If not, see http://www.gnu.org/licenses/.
25: *
26: * For further information about Alkacon Software GmbH, please see the
27: * company website: http://www.alkacon.com.
28: *
29: * For further information about OpenCms, please see the
30: * project website: http://www.opencms.org.
31: */
32:
33: package com.alkacon.opencms.registration;
34:
35: import org.opencms.configuration.CmsConfigurationManager;
36: import org.opencms.file.CmsObject;
37: import org.opencms.main.CmsException;
38: import org.opencms.main.OpenCms;
39: import org.opencms.module.A_CmsModuleAction;
40: import org.opencms.module.CmsModule;
41:
42: /**
43: * This class is used to get an admin cms object.<p>
44: *
45: * @author Michael Moossen
46: *
47: * @version $Revision: 1.1 $
48: *
49: * @since 7.0.4
50: */
51: public class CmsRegistrationModuleAction extends A_CmsModuleAction {
52:
53: /** The admin cms context. */
54: private static CmsObject m_cms;
55:
56: /**
57: * Returns the admin cms context.<p>
58: *
59: * @return the admin cms context
60: */
61: public static CmsObject getAdminCms() {
62:
63: return m_cms;
64: }
65:
66: /**
67: * @see org.opencms.module.A_CmsModuleAction#initialize(org.opencms.file.CmsObject, org.opencms.configuration.CmsConfigurationManager, org.opencms.module.CmsModule)
68: */
69: public void initialize(CmsObject adminCms,
70: CmsConfigurationManager configurationManager,
71: CmsModule module) {
72:
73: super .initialize(adminCms, configurationManager, module);
74: try {
75: m_cms = OpenCms.initCmsObject(adminCms);
76: } catch (CmsException e) {
77: // initialization failed
78: e.printStackTrace();
79: }
80: }
81: }
|