root / trunk / applications / appCatalogAndGazetteerClient / src / es / gva / cit / catalog / drivers / profiles / AbstractProfile.java @ 15558
History | View | Annotate | Download (4.42 KB)
1 |
package es.gva.cit.catalog.drivers.profiles; |
---|---|
2 |
|
3 |
import com.iver.utiles.swing.jcomboServer.ServerData; |
4 |
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
6 |
*
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
8 |
*
|
9 |
* This program is free software; you can redistribute it and/or
|
10 |
* modify it under the terms of the GNU General Public License
|
11 |
* as published by the Free Software Foundation; either version 2
|
12 |
* of the License, or (at your option) any later version.
|
13 |
*
|
14 |
* This program is distributed in the hope that it will be useful,
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
* GNU General Public License for more details.
|
18 |
*
|
19 |
* You should have received a copy of the GNU General Public License
|
20 |
* along with this program; if not, write to the Free Software
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
22 |
*
|
23 |
* For more information, contact:
|
24 |
*
|
25 |
* Generalitat Valenciana
|
26 |
* Conselleria d'Infraestructures i Transport
|
27 |
* Av. Blasco Ib??ez, 50
|
28 |
* 46010 VALENCIA
|
29 |
* SPAIN
|
30 |
*
|
31 |
* +34 963862235
|
32 |
* gvsig@gva.es
|
33 |
* www.gvsig.gva.es
|
34 |
*
|
35 |
* or
|
36 |
*
|
37 |
* IVER T.I. S.A
|
38 |
* Salamanca 50
|
39 |
* 46005 Valencia
|
40 |
* Spain
|
41 |
*
|
42 |
* +34 963163400
|
43 |
* dac@iver.es
|
44 |
*/
|
45 |
/* CVS MESSAGES:
|
46 |
*
|
47 |
* $Id$
|
48 |
* $Log$
|
49 |
*
|
50 |
*/
|
51 |
/**
|
52 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
53 |
*/
|
54 |
public abstract class AbstractProfile implements IProfile{ |
55 |
private ServerData serverData = null; |
56 |
|
57 |
/**
|
58 |
* @param serverData
|
59 |
*/
|
60 |
public AbstractProfile(ServerData serverData) {
|
61 |
super();
|
62 |
this.serverData = serverData;
|
63 |
} |
64 |
|
65 |
/**
|
66 |
* @param serverData
|
67 |
*/
|
68 |
public AbstractProfile() {
|
69 |
super();
|
70 |
} |
71 |
|
72 |
/**
|
73 |
* @return the abstract property name
|
74 |
*/
|
75 |
public String getAbstract() { |
76 |
String property = getProperty(IProfile.ABSTRACT);
|
77 |
if (property != null){ |
78 |
return property;
|
79 |
} |
80 |
return getAbstractProperty();
|
81 |
} |
82 |
|
83 |
/**
|
84 |
* @return the coordinates property name
|
85 |
*/
|
86 |
public String getCoordinates() { |
87 |
String property = getProperty(IProfile.COORDINATES);
|
88 |
if (property != null){ |
89 |
return property;
|
90 |
} |
91 |
return getCoordinatesProperty();
|
92 |
} |
93 |
|
94 |
/**
|
95 |
* @return the date from property
|
96 |
*/
|
97 |
public String getDateFrom() { |
98 |
String property = getProperty(IProfile.DATEFROM);
|
99 |
if (property != null){ |
100 |
return property;
|
101 |
} |
102 |
return getDateFromProperty();
|
103 |
} |
104 |
|
105 |
/**
|
106 |
* @return the date to property
|
107 |
*/
|
108 |
public String getDateTo() { |
109 |
String property = getProperty(IProfile.DATETO);
|
110 |
if (property != null){ |
111 |
return property;
|
112 |
} |
113 |
return getDateToProperty();
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* @return the keyword property
|
118 |
*/
|
119 |
public String getKeywords() { |
120 |
String property = getProperty(IProfile.KEYWORDS);
|
121 |
if (property != null){ |
122 |
return property;
|
123 |
} |
124 |
return getKeywordsProperty();
|
125 |
} |
126 |
|
127 |
/**
|
128 |
* @return the provider property
|
129 |
*/
|
130 |
public String getProvider() { |
131 |
String property = getProperty(IProfile.PROVIDER);
|
132 |
if (property != null){ |
133 |
return property;
|
134 |
} |
135 |
return getProviderProperty();
|
136 |
} |
137 |
|
138 |
/**
|
139 |
* @return the scale property
|
140 |
*/
|
141 |
public String getScale() { |
142 |
String property = getProperty(IProfile.SCALE);
|
143 |
if (property != null){ |
144 |
return property;
|
145 |
} |
146 |
return getScaleProperty();
|
147 |
} |
148 |
|
149 |
/**
|
150 |
* @return the title property name
|
151 |
*/
|
152 |
public String getTitle() { |
153 |
String property = getProperty(IProfile.TITLE);
|
154 |
if (property != null){ |
155 |
return property;
|
156 |
} |
157 |
return getTitleProperty();
|
158 |
} |
159 |
|
160 |
/**
|
161 |
* @return the element name property
|
162 |
*/
|
163 |
public String getElementName(){ |
164 |
String property = getProperty(IProfile.ELEMENT_NAME);
|
165 |
if (property != null){ |
166 |
return property;
|
167 |
} |
168 |
return getElementNameProperty();
|
169 |
} |
170 |
|
171 |
/**
|
172 |
* Return a property with a concrete name
|
173 |
* @param propertyName
|
174 |
* The property name
|
175 |
* @return
|
176 |
*/
|
177 |
private String getProperty(String propertyName){ |
178 |
if ((serverData != null) && (serverData.getProperies() != null)){ |
179 |
Object obj = serverData.getProperies().getProperty(propertyName);
|
180 |
if (!((obj == null) || (((String)obj).compareTo("") == 0))){ |
181 |
return (String)obj; |
182 |
} |
183 |
} |
184 |
return null; |
185 |
} |
186 |
|
187 |
/**
|
188 |
* @return the topic property
|
189 |
*/
|
190 |
public String getTopic() { |
191 |
String property = getProperty(IProfile.CATHEGORY);
|
192 |
if (property != null){ |
193 |
return property;
|
194 |
} |
195 |
return getTopicProperty();
|
196 |
} |
197 |
|
198 |
/**
|
199 |
* @return the serverData
|
200 |
*/
|
201 |
public ServerData getServerData() {
|
202 |
return serverData;
|
203 |
} |
204 |
|
205 |
/**
|
206 |
* @param serverData the serverData to set
|
207 |
*/
|
208 |
public void setServerData(ServerData serverData) { |
209 |
this.serverData = serverData;
|
210 |
} |
211 |
|
212 |
} |