001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/portal/context/AbstractModule.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004    This file is part of deegree.
005    Copyright (C) 2001-2008 by:
006    EXSE, Department of Geography, University of Bonn
007    http://www.giub.uni-bonn.de/deegree/
008    lat/lon GmbH
009    http://www.lat-lon.de
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    You should have received a copy of the GNU Lesser General Public
022    License along with this library; if not, write to the Free Software
023    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024    
025    Contact:
026    
027    Andreas Poth
028    lat/lon GmbH
029    Aennchenstr. 19
030    53115 Bonn
031    Germany
032    E-Mail: poth@lat-lon.de
033    
034    Prof. Dr. Klaus Greve
035    Department of Geography
036    University of Bonn
037    Meckenheimer Allee 166
038    53115 Bonn
039    Germany
040    E-Mail: greve@giub.uni-bonn.de
041    
042                     
043     ---------------------------------------------------------------------------*/
044    package org.deegree.portal.context;
045    
046    
047    
048    
049    /**
050     * describes the common access to modules embedded into the GUI described by 
051     * general extension section of a web map context document within the deegree
052     * framework.<p/>
053     * a module encapsulates GUI elements and/or functions that are used by the
054     * GUI. The concrete implementation of the GUI (e.g. as JSP pages) is responsible
055     * for enabling the commuication between the different modules of a context.
056     *
057     * @version $Revision: 9346 $
058     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
059     */
060    public abstract class AbstractModule {
061        private ModuleConfiguration moduleConfiguration = null;
062        private String name = null;
063        private String content = null;
064        private boolean hidden = false;
065    
066        /**
067         * Creates a new AbstractModule object.
068         *
069         * @param name 
070         * @param hidden 
071         * @param moduleConfiguration 
072         */
073        public AbstractModule( String name, String content, boolean hidden, 
074                               ModuleConfiguration moduleConfiguration ) {
075            setName( name );
076            setContent( content );
077            setHidden( hidden );
078            setModuleConfiguration( moduleConfiguration );
079        }
080    
081        /**
082         * returns the name of a module
083         *
084         * @return 
085         */
086        public String getName() {
087            return name;
088        }
089    
090        /**
091         * sets the name of a module
092         *
093         * @param name 
094         */
095        public void setName( String name ) {
096            this.name = name;
097        }
098        
099        /**
100         * returns the name of the page/class/file etc. containing the content
101         * of the module
102         */
103        public String getContent() {
104            return content;
105        }
106    
107        /**
108         * sets the name of the page/class/file etc. containing the content
109         * of the module
110         *
111         * @param content 
112         */
113        public void setContent( String content ) {
114            this.content = content;
115        }
116    
117        /**
118         * returns true if the module is hidden. this will always be the case
119         * for modules that just offers functions to the context. visible modules
120         * may offere the capability to be turned to visible or not.
121         *
122         * @return 
123         */
124        public boolean isHidden() {
125            return hidden;
126        }
127    
128        /**
129         * sets the module to be hidden or visible. modules that only adds functions
130         * to a context will ignore this because they are always hidden
131         *
132         * @param hidden 
133         */
134        public void setHidden( boolean hidden ) {
135            this.hidden = hidden;
136        }
137    
138        /**
139         * returns the a specific confguration for a module. This may be <tt>null</tt>
140         * if the module doesn't need to be configured.
141         *
142         * @return 
143         */
144        public ModuleConfiguration getModuleConfiguration() {
145            return moduleConfiguration;
146        }
147    
148        /**
149         * sets the specific configuration for a module.
150         *
151         * @param configuration 
152         */
153        public void setModuleConfiguration( ModuleConfiguration configuration ) {
154            this.moduleConfiguration = configuration;
155        }
156    }