001 //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/portal/context/AbstractModule.java $
002 /*----------------------------------------------------------------------------
003 This file is part of deegree, http://deegree.org/
004 Copyright (C) 2001-2009 by:
005 Department of Geography, University of Bonn
006 and
007 lat/lon GmbH
008
009 This library is free software; you can redistribute it and/or modify it under
010 the terms of the GNU Lesser General Public License as published by the Free
011 Software Foundation; either version 2.1 of the License, or (at your option)
012 any later version.
013 This library is distributed in the hope that it will be useful, but WITHOUT
014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016 details.
017 You should have received a copy of the GNU Lesser General Public License
018 along with this library; if not, write to the Free Software Foundation, Inc.,
019 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020
021 Contact information:
022
023 lat/lon GmbH
024 Aennchenstr. 19, 53177 Bonn
025 Germany
026 http://lat-lon.de/
027
028 Department of Geography, University of Bonn
029 Prof. Dr. Klaus Greve
030 Postfach 1147, 53001 Bonn
031 Germany
032 http://www.geographie.uni-bonn.de/deegree/
033
034 e-mail: info@deegree.org
035 ----------------------------------------------------------------------------*/
036 package org.deegree.portal.context;
037
038 /**
039 * describes the common access to modules embedded into the GUI described by general extension section of a web map
040 * context document within the deegree framework.<p/> a module encapsulates GUI elements and/or functions that are used
041 * by the GUI. The concrete implementation of the GUI (e.g. as JSP pages) is responsible for enabling the commuication
042 * between the different modules of a context.
043 *
044 * @version $Revision: 18195 $
045 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
046 */
047 public abstract class AbstractModule {
048 private ModuleConfiguration moduleConfiguration = null;
049
050 private String name = null;
051
052 private String content = null;
053
054 private boolean hidden = false;
055
056 /**
057 * Creates a new AbstractModule object.
058 *
059 * @param name
060 * @param content
061 * @param hidden
062 * @param moduleConfiguration
063 */
064 public AbstractModule( String name, String content, boolean hidden, ModuleConfiguration moduleConfiguration ) {
065 setName( name );
066 setContent( content );
067 setHidden( hidden );
068 setModuleConfiguration( moduleConfiguration );
069 }
070
071 /**
072 * @return the name of a module
073 */
074 public String getName() {
075 return name;
076 }
077
078 /**
079 * sets the name of a module
080 *
081 * @param name
082 */
083 public void setName( String name ) {
084 this.name = name;
085 }
086
087 /**
088 * @return the name of the page/class/file etc. containing the content of the module
089 */
090 public String getContent() {
091 return content;
092 }
093
094 /**
095 * sets the name of the page/class/file etc. containing the content of the module
096 *
097 * @param content
098 */
099 public void setContent( String content ) {
100 this.content = content;
101 }
102
103 /**
104 * returns true if the module is hidden. this will always be the case for modules that just offers functions to the
105 * context. visible modules may offere the capability to be turned to visible or not.
106 *
107 * @return true if the module is hidden.
108 */
109 public boolean isHidden() {
110 return hidden;
111 }
112
113 /**
114 * sets the module to be hidden or visible. modules that only adds functions to a context will ignore this because
115 * they are always hidden
116 *
117 * @param hidden
118 */
119 public void setHidden( boolean hidden ) {
120 this.hidden = hidden;
121 }
122
123 /**
124 * returns the a specific confguration for a module. This may be <tt>null</tt> if the module doesn't need to be
125 * configured.
126 *
127 * @return the a specific confguration for a module
128 */
129 public ModuleConfiguration getModuleConfiguration() {
130 return moduleConfiguration;
131 }
132
133 /**
134 * sets the specific configuration for a module.
135 *
136 * @param configuration
137 */
138 public void setModuleConfiguration( ModuleConfiguration configuration ) {
139 this.moduleConfiguration = configuration;
140 }
141 }