Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / org.gvsig.arcims.feature.extension / src / main / java / org / gvsig / fmap / dal / serverexplorer / arcims / ArcImsServerExplorerParameters.java @ 32356

History | View | Annotate | Download (3 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
 * 2010 Prodevelop S.L. main development
26
 * http://www.prodevelop.es
27
 */
28

    
29
package org.gvsig.fmap.dal.serverexplorer.arcims;
30

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

    
40
/**
41
 * @author vsanjaime
42
 */
43
public class ArcImsServerExplorerParameters extends AbstractDataParameters
44
implements DataServerExplorerParameters {
45
        
46
        public static final String DYNCLASS_NAME = "ArcIMSServerExplorerParameters";
47
        public static final String DYNFIELDNAME_URL = "url";
48
        private DelegatedDynObject delegatedDynObject;
49

    
50
        /**
51
         * Constructor
52
         */
53
        public ArcImsServerExplorerParameters() {
54
                super();
55
                this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
56
                .getDynObjectManager()
57
                .createDynObject(this.registerDynClass());
58
        }
59
        
60
        /**
61
         * 
62
         */
63
        @Override
64
        protected DelegatedDynObject getDelegatedDynObject() {
65
                return delegatedDynObject;
66
        }
67

    
68
        /**
69
         * 
70
         * @return
71
         */
72
        private DynClass registerDynClass() {
73
                   DynObjectManager dynman = ToolsLocator.getDynObjectManager();
74
            DynClass dynClass = dynman.get(DYNCLASS_NAME);
75
            DynField field;
76
            if (dynClass == null) {
77
                    dynClass = dynman.add(DYNCLASS_NAME);
78

    
79
                    field = dynClass.addDynField(DYNFIELDNAME_URL);
80
                    field.setType(DataTypes.STRING);
81
                    field.setDescription("Path of the remote service");
82
                    field.setTheTypeOfAvailableValues(DynField.ANY);
83
                    field.setMandatory(true);                     
84
            }
85
            return dynClass;
86
        }
87

    
88
        /* (non-Javadoc)
89
         * @see org.gvsig.fmap.dal.DataServerExplorerParameters#getExplorerName()
90
         */
91
        public String getExplorerName() {
92
                return ArcImsServerExplorer.NAME;
93
        }
94

    
95
        /**
96
         * get Url
97
         * @return
98
         */
99
        public String getUrl(){
100
                return (String) this.getDynValue(DYNFIELDNAME_URL);
101
        }
102

    
103
        /**
104
         * Set Url
105
         * @param url
106
         */
107
        public void setUrl(String url){
108
                this.setDynValue(DYNFIELDNAME_URL, url);
109
        }
110

    
111
}
112