Statistics
| Revision:

root / org.gvsig.wfs.app / trunk / org.gvsig.wfs.app / org.gvsig.wfs.app.mainplugin / src / main / java / org / gvsig / fmap / dal / serverexplorer / wfs / WFSServerExplorerParameters.java @ 10

History | View | Annotate | Download (3.34 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2009 {Iver T.I.}   {Task}
26
 */
27

    
28
package org.gvsig.fmap.dal.serverexplorer.wfs;
29

    
30
import org.gvsig.fmap.dal.DataServerExplorerParameters;
31
import org.gvsig.fmap.dal.DataTypes;
32
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
33
import org.gvsig.tools.ToolsLocator;
34
import org.gvsig.tools.dynobject.DelegatedDynObject;
35
import org.gvsig.tools.dynobject.DynClass;
36
import org.gvsig.tools.dynobject.DynField;
37
import org.gvsig.tools.dynobject.DynObjectManager;
38

    
39
/**
40
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
41
 */
42
public class WFSServerExplorerParameters extends AbstractDataParameters
43
implements DataServerExplorerParameters {
44
        public static final String DYNCLASS_NAME = "WFSServerExplorerParameters";
45
        public static final String DYNFIELDNAME_URL = "url";
46
        public static final String DYNFIELDNAME_VERSION = "version";
47
        private DelegatedDynObject delegatedDynObject;
48

    
49
        public WFSServerExplorerParameters() {
50
                super();
51
                this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
52
                .getDynObjectManager()
53
                .createDynObject(this.registerDynClass());
54
        }
55
        
56
        @Override
57
        protected DelegatedDynObject getDelegatedDynObject() {
58
                return delegatedDynObject;
59
        }
60

    
61
        private DynClass registerDynClass() {
62
                   DynObjectManager dynman = ToolsLocator.getDynObjectManager();
63
            DynClass dynClass = dynman.get(DYNCLASS_NAME);
64
            DynField field;
65
            if (dynClass == null) {
66
                    dynClass = dynman.add(DYNCLASS_NAME);
67

    
68
                    field = dynClass.addDynField(DYNFIELDNAME_URL);
69
                    field.setType(DataTypes.STRING);
70
                    field.setDescription("Path of the remote service");
71
                    field.setTheTypeOfAvailableValues(DynField.ANY);
72
                    field.setMandatory(true);
73
                    
74
                    field = dynClass.addDynField(DYNFIELDNAME_VERSION);
75
                    field.setType(DataTypes.STRING);
76
                    field.setDescription("Version of the remote service");
77
                    field.setTheTypeOfAvailableValues(DynField.ANY);
78
                    field.setMandatory(false);
79
            }
80
            return dynClass;
81
        }
82

    
83
        /* (non-Javadoc)
84
         * @see org.gvsig.fmap.dal.DataServerExplorerParameters#getExplorerName()
85
         */
86
        public String getExplorerName() {
87
                return WFSServerExplorer.NAME;
88
        }
89

    
90
        public String getUrl(){
91
                return (String) this.getDynValue(DYNFIELDNAME_URL);
92
        }
93

    
94
        public void setUrl(String url){
95
                this.setDynValue(DYNFIELDNAME_URL, url);
96
        }
97
        
98
        public String getVersion(){
99
                return (String) this.getDynValue(DYNFIELDNAME_VERSION);
100
        }
101

    
102
        public void setVersion(String version){
103
                this.setDynValue(DYNFIELDNAME_VERSION, version);
104
        }
105

    
106
}
107