Revision 22616 branches/v10/extensions/extPublishMapserver/src/org/gvsig/publish/mapserver/model/wcs/MapserverWCS.java
MapserverWCS.java | ||
---|---|---|
45 | 45 |
import java.util.Hashtable; |
46 | 46 |
|
47 | 47 |
import org.gvsig.publish.PublishLogger; |
48 |
import org.gvsig.publish.exceptions.LayerInfoNotAvailableException; |
|
49 | 48 |
import org.gvsig.publish.exceptions.PublishException; |
50 | 49 |
import org.gvsig.publish.infoproject.FilterProjectInfo; |
51 | 50 |
import org.gvsig.publish.infoproject.IDataSourceInfo; |
... | ... | |
67 | 66 |
*/ |
68 | 67 |
public class MapserverWCS extends Service implements IOGCServiceMetadata{ |
69 | 68 |
public static String REGISTER_TAG="WCS 1.0.0"; |
70 |
|
|
69 |
|
|
71 | 70 |
//Associations |
72 | 71 |
private OGCServiceMetadata ogcMetadata= null; |
73 | 72 |
|
... | ... | |
90 | 89 |
public void publish() throws PublishException { |
91 | 90 |
//publish all the remote resources |
92 | 91 |
super.publish(); |
93 |
|
|
94 | 92 |
//gets the mapfile from the server |
95 | 93 |
ConfigFile mapfile = getMapServer().getConfigFile(); |
96 | 94 |
//generate outputformats |
97 |
try { |
|
98 |
generateOutputformats(); |
|
99 |
} catch (LayerInfoNotAvailableException e) { |
|
100 |
throw new PublishException("publish_infolayer_not_available"); |
|
101 |
} |
|
102 |
|
|
95 |
generateOutputformats(); |
|
103 | 96 |
//generates the code into the MAP->WEB->METADATA |
104 | 97 |
mapfile.web.metadata.wcs_label = getTitle(); |
105 | 98 |
mapfile.web.metadata.wcs_description = getAbstract(); |
... | ... | |
107 | 100 |
mapfile.web.metadata.wcs_encoding ="utf8"; |
108 | 101 |
} |
109 | 102 |
|
110 |
|
|
103 |
|
|
111 | 104 |
/** |
112 | 105 |
* Generate the outputformat objects in the mapfile. |
113 | 106 |
* <p> |
114 | 107 |
* we put the datasources in a hashmap in order to avoid duplicated outputformats |
115 |
* @throws LayerInfoNotAvailableException
|
|
108 |
* |
|
116 | 109 |
*/ |
117 |
private void generateOutputformats() throws LayerInfoNotAvailableException {
|
|
110 |
private void generateOutputformats() { |
|
118 | 111 |
Hashtable table = new Hashtable(); |
119 | 112 |
for (int i= 0; i < getRemoteResourcesCount(); i++){ |
120 | 113 |
RemoteResource r = getRemoteResource(i); |
... | ... | |
130 | 123 |
String mimetype = MapserverUtilities.getOutputformatMimetype(ds); |
131 | 124 |
String imagemode = MapserverUtilities.getOutputformatImageMode(ds); |
132 | 125 |
String extension = MapserverUtilities.getOuputformatExtension(ds); |
133 |
|
|
126 |
|
|
134 | 127 |
if (name !=null && driver !=null){ |
135 | 128 |
OutputFormat of = new OutputFormat(name,driver,imagemode,extension,mimetype); |
136 | 129 |
getMapServer().getConfigFile().add(of); |
137 | 130 |
} |
138 |
|
|
131 |
|
|
139 | 132 |
} |
140 | 133 |
|
141 | 134 |
} |
... | ... | |
174 | 167 |
//put version and name |
175 | 168 |
xml.setName(getClassName()); |
176 | 169 |
xml.putProperty("version", getVersion()); |
177 |
|
|
170 |
|
|
178 | 171 |
//p?t its associations |
179 | 172 |
XMLEntity child = new XMLEntity(); |
180 | 173 |
child.setName("ogcmetadata"); |
... | ... | |
200 | 193 |
* @see org.gvsig.publish.serversmodel.Service#getId() |
201 | 194 |
*/ |
202 | 195 |
public String getId() { |
203 |
|
|
196 |
|
|
204 | 197 |
return "mapserver_wcs"; |
205 | 198 |
} |
206 | 199 |
|
... | ... | |
209 | 202 |
* @see org.gvsig.publish.serversmodel.Service#getRegisterTag() |
210 | 203 |
*/ |
211 | 204 |
public String getRegisterTag() { |
212 |
|
|
205 |
|
|
213 | 206 |
return REGISTER_TAG; |
214 | 207 |
} |
215 | 208 |
/* |
... | ... | |
217 | 210 |
* @see org.gvsig.publish.ogcmetadata.IOGCServiceMetadata#getOnlineResource() |
218 | 211 |
*/ |
219 | 212 |
public URL getOnlineResource() { |
220 |
|
|
213 |
|
|
221 | 214 |
return ogcMetadata.getOnlineResource(); |
222 | 215 |
} |
223 | 216 |
/* |
... | ... | |
226 | 219 |
*/ |
227 | 220 |
public void setOnlineResource(URL url) { |
228 | 221 |
ogcMetadata.setOnlineResource(url); |
229 |
|
|
222 |
|
|
230 | 223 |
} |
231 | 224 |
/* |
232 | 225 |
* (non-Javadoc) |
... | ... | |
255 | 248 |
*/ |
256 | 249 |
public void setName(String name) { |
257 | 250 |
ogcMetadata.setName(name); |
258 |
|
|
251 |
|
|
259 | 252 |
} |
260 | 253 |
/* |
261 | 254 |
* (non-Javadoc) |
... | ... | |
263 | 256 |
*/ |
264 | 257 |
public void setTitle(String title) { |
265 | 258 |
ogcMetadata.setTitle(title); |
266 |
|
|
259 |
|
|
267 | 260 |
} |
268 | 261 |
/* |
269 | 262 |
* (non-Javadoc) |
... | ... | |
279 | 272 |
* @see org.gvsig.publish.ogcmetadata.IOGCCommonMetadata#getTitle() |
280 | 273 |
*/ |
281 | 274 |
public String getTitle() { |
282 |
|
|
275 |
|
|
283 | 276 |
return ogcMetadata.getTitle(); |
284 | 277 |
} |
285 | 278 |
/* |
Also available in: Unified diff