001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/portal/standard/wfs/configuration/DigitizerClientConfiguration.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    
037    package org.deegree.portal.standard.wfs.configuration;
038    
039    import java.util.HashMap;
040    import java.util.Map;
041    
042    import org.deegree.datatypes.QualifiedName;
043    import org.deegree.framework.log.ILogger;
044    import org.deegree.framework.log.LoggerFactory;
045    
046    /**
047     * TODO describe function and usage of the class here.
048     *
049     * @author <a href="mailto:mays@lat-lon.de">Judit Mays</a>
050     * @author last edited by: $Author: mschneider $
051     *
052     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
053     */
054    public class DigitizerClientConfiguration {
055    
056        private static final ILogger LOG = LoggerFactory.getLogger( DigitizerClientConfiguration.class );
057    
058        protected Map<QualifiedName, String> featureTypeToAddressMap;
059    
060        protected Map<QualifiedName, String> featureTypeToFormTemplateMap;
061    
062        protected Map<QualifiedName, String> featureTypeToInsertTemplateMap;
063    
064        protected Map<QualifiedName, String> featureTypeToUpdateTemplateMap;
065    
066        protected Map<QualifiedName, String> featureTypeToDeleteTemplateMap;
067    
068        /**
069         * create a new DigitizeClientConfiguration object
070         */
071        public DigitizerClientConfiguration() {
072            featureTypeToAddressMap = new HashMap<QualifiedName, String>( 5 );
073            featureTypeToFormTemplateMap = new HashMap<QualifiedName, String>( 5 );
074            featureTypeToInsertTemplateMap = new HashMap<QualifiedName, String>( 5 );
075            featureTypeToUpdateTemplateMap = new HashMap<QualifiedName, String>( 5 );
076            featureTypeToDeleteTemplateMap = new HashMap<QualifiedName, String>( 5 );
077            LOG.logDebug( "initializing digitizer client configuration" );
078        }
079    
080        /**
081         * @param featureType
082         *            as qualified name
083         * @param wfsAddress
084         */
085        public void addFeatureTypeAddress( QualifiedName featureType, String wfsAddress ) {
086            LOG.logDebug( "add wfsAddress: " + wfsAddress );
087            this.featureTypeToAddressMap.put( featureType, wfsAddress );
088        }
089    
090        /**
091         * @param featureType
092         *            as qualified name
093         * @param formTemplate
094         */
095        public void addFeatureTypeFormTemplate( QualifiedName featureType, String formTemplate ) {
096            LOG.logDebug( "add formTemplate: " + formTemplate );
097            this.featureTypeToFormTemplateMap.put( featureType, formTemplate );
098        }
099    
100        /**
101         * @param featureType
102         *            as qualified name
103         * @param insertTemplate
104         */
105        public void addFeatureTypeInsertTemplate( QualifiedName featureType, String insertTemplate ) {
106            LOG.logDebug( "add insertTemplate: " + insertTemplate );
107            this.featureTypeToInsertTemplateMap.put( featureType, insertTemplate );
108        }
109    
110        /**
111         * @param featureType
112         *            as qualified name
113         * @param updateTemplate
114         */
115        public void addFeatureTypeUpdateTemplate( QualifiedName featureType, String updateTemplate ) {
116            LOG.logDebug( "add updateTemplate: " + updateTemplate );
117            this.featureTypeToUpdateTemplateMap.put( featureType, updateTemplate );
118        }
119    
120        /**
121         * @param featureType
122         *            as qualified name
123         * @param deleteTemplate
124         */
125        public void addFeatureTypeDeleteTemplate( QualifiedName featureType, String deleteTemplate ) {
126            LOG.logDebug( "add deleteTemplate: " + deleteTemplate );
127            this.featureTypeToDeleteTemplateMap.put( featureType, deleteTemplate );
128        }
129    
130        /**
131         * @param featureType
132         *            the name of the featureType
133         * @return Returns the wfs address for a given featureType. May be null, if the passed
134         *         featureType is unknown.
135         */
136        public String getFeatureTypeAddress( QualifiedName featureType ) {
137            return featureTypeToAddressMap.get( featureType );
138        }
139    
140        /**
141         * @param featureType
142         *            the name of the featureType
143         * @return Returns the form template for a given featureType. May be null, if the passed
144         *         featureType is unknown.
145         */
146        public String getFeatureTypeFormTemplate( QualifiedName featureType ) {
147            return featureTypeToFormTemplateMap.get( featureType );
148        }
149    
150        /**
151         * @param featureType
152         *            the name of the featureType
153         * @return Returns the insert template for a given featureType. May be null, if the passed
154         *         featureType is unknown.
155         */
156        public String getFeatureTypeInsertTemplate( QualifiedName featureType ) {
157            return featureTypeToInsertTemplateMap.get( featureType );
158        }
159    
160        /**
161         * @param featureType
162         *            the name of the featureType
163         * @return Returns the update template for a given featureType. May be null, if the passed
164         *         featureType is unknown.
165         */
166        public String getFeatureTypeUpdateTemplate( QualifiedName featureType ) {
167            return featureTypeToUpdateTemplateMap.get( featureType );
168        }
169    
170        /**
171         * @param featureType
172         *            the name of the featureType
173         * @return Returns the delete template for a given featureType. May be null, if the passed
174         *         featureType is unknown.
175         */
176        public String getFeatureTypeDeleteTemplate( QualifiedName featureType ) {
177            return featureTypeToDeleteTemplateMap.get( featureType );
178        }
179    
180        /**
181         * @return Returns the featureTypeToAddressMap.
182         */
183        public Map getFeatureTypeToAddressMap() {
184            return featureTypeToAddressMap;
185        }
186    
187        /**
188         * @return Returns the featureTypeToFormTemplateMap.
189         */
190        public Map getFeatureTypeToFormTemplateMap() {
191            return featureTypeToFormTemplateMap;
192        }
193    
194        /**
195         * @return Returns the featureTypeToInsertTemplateMap.
196         */
197        public Map getFeatureTypeToInsertTemplateMap() {
198            return featureTypeToInsertTemplateMap;
199        }
200    
201        /**
202         * @return Returns the featureTypeToInsertTemplateMap.
203         */
204        public Map getFeatureTypeToUpdateTemplateMap() {
205            return featureTypeToUpdateTemplateMap;
206        }
207    
208    }