Revision 2166
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Wed May 15 12:27:18 CEST 2013 |
|
3 |
buildNumber=44 |
|
0 | 4 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/java/org/gvsig/raster/postgis/app/postgisrasterclient/gui/LayerLoaderManager.java | ||
---|---|---|
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 |
package org.gvsig.raster.postgis.app.postgisrasterclient.gui; |
|
23 |
|
|
24 |
import java.util.List; |
|
25 |
|
|
26 |
import javax.swing.JOptionPane; |
|
27 |
|
|
28 |
import org.gvsig.andami.PluginServices; |
|
29 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
30 |
import org.gvsig.fmap.dal.DALLocator; |
|
31 |
import org.gvsig.fmap.dal.DataManager; |
|
32 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
33 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
|
34 |
import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters; |
|
35 |
import org.gvsig.fmap.dal.exception.DataException; |
|
36 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
37 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
38 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
39 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
40 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorerParameters; |
|
41 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
42 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
43 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
44 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
45 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
46 |
import org.gvsig.raster.fmap.layers.DefaultFLyrRaster; |
|
47 |
import org.gvsig.raster.fmap.layers.FLyrRaster; |
|
48 |
import org.gvsig.raster.postgis.io.PostGISRasterCoreException; |
|
49 |
import org.gvsig.raster.postgis.io.PostGISRasterServerExplorer; |
|
50 |
import org.gvsig.raster.postgis.io.PostGISRasterServerExplorerParameters; |
|
51 |
import org.gvsig.raster.postgis.swing.AddLayerUI; |
|
52 |
import org.gvsig.raster.util.RasterNotLoadException; |
|
53 |
import org.slf4j.Logger; |
|
54 |
import org.slf4j.LoggerFactory; |
|
55 |
|
|
56 |
/** |
|
57 |
* Manager to load layers in TOC. There are some strategies, load a entire layer |
|
58 |
* or load subdatasets depending on the user selection or the layer structure. |
|
59 |
* |
|
60 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
61 |
*/ |
|
62 |
public class LayerLoaderManager { |
|
63 |
private static int ALL_SUBDATASETS = -2; |
|
64 |
private static int ENTIRE = -1; |
|
65 |
|
|
66 |
private static Logger logger = LoggerFactory.getLogger(AddPostGISRasterLayerWizard.class.getName()); |
|
67 |
private AddLayerUI apiUI = null; |
|
68 |
private DBServerExplorerParameters dbExplorerParameters = null; |
|
69 |
private MapContext mapContext = null; |
|
70 |
|
|
71 |
public LayerLoaderManager(AddLayerUI ui) { |
|
72 |
this.apiUI = ui; |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* Assigns a {@link DBServerExplorerParameters} |
|
77 |
* @param params |
|
78 |
*/ |
|
79 |
public void setDBServerExplorerParameters(DBServerExplorerParameters params) { |
|
80 |
this.dbExplorerParameters = params; |
|
81 |
} |
|
82 |
|
|
83 |
/** |
|
84 |
* Gets the {@link DBServerExplorerParameters} |
|
85 |
* @return {@link DBServerExplorerParameters} |
|
86 |
*/ |
|
87 |
public DBServerExplorerParameters getDBServerExplorerParameters() { |
|
88 |
return this.dbExplorerParameters; |
|
89 |
} |
|
90 |
|
|
91 |
/** |
|
92 |
* Return FLayers if user performs multi selection. |
|
93 |
*/ |
|
94 |
public void loadLayers() { |
|
95 |
if(dbExplorerParameters == null) |
|
96 |
return; |
|
97 |
|
|
98 |
List<Object> tables = apiUI.getSelectedTables(); |
|
99 |
|
|
100 |
//Para una tabla seleccionada |
|
101 |
if(tables.size() == 1) { |
|
102 |
TableListItem item = (TableListItem)tables.get(0); |
|
103 |
String schema = item.getSchema(); |
|
104 |
String table = item.getTableName(); |
|
105 |
|
|
106 |
//Sin subdatasets |
|
107 |
if(getNumberOfColumns(schema, table) == 1) { |
|
108 |
loadOneLayer(item, ENTIRE); |
|
109 |
} |
|
110 |
//Con subdatasets |
|
111 |
else { |
|
112 |
int[] subdatasets = apiUI.getSelectedSubdatasets(); |
|
113 |
if(subdatasets == null || subdatasets.length <= 0) { |
|
114 |
loadOneLayer(item, ALL_SUBDATASETS); |
|
115 |
} else { |
|
116 |
long cols = getNumberOfColumns(schema, table); |
|
117 |
for (int i = 0; i < cols; i++) { |
|
118 |
loadOneLayer(item, i + 1); |
|
119 |
} |
|
120 |
} |
|
121 |
} |
|
122 |
} |
|
123 |
|
|
124 |
//Para m?s de una tabla seleccionada (se usan todos los subdatasets) |
|
125 |
if(tables.size() > 1) { |
|
126 |
for (int i = 0; i < tables.size(); i++) { |
|
127 |
TableListItem item = (TableListItem)tables.get(i); |
|
128 |
String schema = item.getSchema(); |
|
129 |
String table = item.getTableName(); |
|
130 |
long subdatasets = getNumberOfColumns(schema, table); |
|
131 |
if(subdatasets == 1) { |
|
132 |
loadOneLayer(item, ENTIRE); |
|
133 |
} |
|
134 |
if(subdatasets > 1) { |
|
135 |
loadOneLayer(item, ALL_SUBDATASETS); |
|
136 |
} |
|
137 |
} |
|
138 |
} |
|
139 |
|
|
140 |
} |
|
141 |
|
|
142 |
/** |
|
143 |
* Loads only one layer |
|
144 |
* @param item |
|
145 |
* @param subdataset |
|
146 |
*/ |
|
147 |
private void loadOneLayer(TableListItem item, int subdataset) { |
|
148 |
String host = dbExplorerParameters.getHost(); |
|
149 |
if(host.compareTo("localhost") == 0) |
|
150 |
host = "127.0.0.1"; |
|
151 |
Integer port = dbExplorerParameters.getPort(); |
|
152 |
String dbname = dbExplorerParameters.getDBName(); |
|
153 |
String user = dbExplorerParameters.getUser(); |
|
154 |
String password = dbExplorerParameters.getPassword(); |
|
155 |
String schema = item.getSchema(); |
|
156 |
String table = item.getTableName(); |
|
157 |
String connString = null; |
|
158 |
if(schema == null) |
|
159 |
connString = "PG:host='" + host + "' port='" + port + "' dbname='" + dbname + "' user='" + user + "' password='" + password + "' table='" + table + "'"; |
|
160 |
else |
|
161 |
connString = "PG:host='" + host + "' port='" + port + "' dbname='" + dbname + "' user='" + user + "' password='" + password + "' schema='" + schema + "' table='" + table + "'"; |
|
162 |
|
|
163 |
if(subdataset == ALL_SUBDATASETS) |
|
164 |
connString += " mode='2'"; |
|
165 |
|
|
166 |
if(subdataset >= 0) |
|
167 |
connString += " column='rast' where='rid = "+ subdataset + "'"; |
|
168 |
|
|
169 |
try { |
|
170 |
FLayer layer = createLayer(getFormatedRasterFileName(connString), connString, item, getNumberOfColumns(schema, table)); |
|
171 |
|
|
172 |
//Adds the layer to the view |
|
173 |
getMapContext().beginAtomicEvent(); |
|
174 |
layer.setVisible(true); |
|
175 |
getMapContext().getLayers().addLayer(layer); |
|
176 |
getMapContext().callLegendChanged(); |
|
177 |
getMapContext().endAtomicEvent(); |
|
178 |
getMapContext().invalidate(); |
|
179 |
} catch (LoadLayerException e) { |
|
180 |
logger.info("Error creating layer: " + e.getMessage(), e); |
|
181 |
//showConnectionErrorMessage(PluginServices.getText(this, "error_creating_layer") + ""); |
|
182 |
} |
|
183 |
} |
|
184 |
|
|
185 |
/** |
|
186 |
* Gets the MapContext |
|
187 |
* @return |
|
188 |
*/ |
|
189 |
private MapContext getMapContext() { |
|
190 |
if(mapContext == null) { |
|
191 |
IWindow[] w = PluginServices.getMDIManager().getAllWindows(); |
|
192 |
for (int i = 0; i < w.length; i++) { |
|
193 |
if (w[i] instanceof org.gvsig.app.project.documents.view.gui.AbstractViewPanel) { |
|
194 |
mapContext = ((org.gvsig.app.project.documents.view.gui.AbstractViewPanel)w[i]).getMapControl().getMapContext(); |
|
195 |
} |
|
196 |
} |
|
197 |
} |
|
198 |
return mapContext; |
|
199 |
} |
|
200 |
|
|
201 |
/** |
|
202 |
* Builds a new raster layer |
|
203 |
* @param fileName |
|
204 |
* @return |
|
205 |
* @throws RasterNotLoadException |
|
206 |
* @throws LoadLayerException |
|
207 |
*/ |
|
208 |
@SuppressWarnings("deprecation") |
|
209 |
public FLyrRaster createLayer(String layerName, String conn, TableListItem item, long nColumns) throws LoadLayerException { |
|
210 |
DataManager dataManager = DALLocator.getDataManager(); |
|
211 |
DefaultFLyrRaster lyr = null; |
|
212 |
try { |
|
213 |
PostGISRasterServerExplorerParameters explorerParams = (PostGISRasterServerExplorerParameters) dataManager.createServerExplorerParameters(PostGISRasterServerExplorer.NAME); |
|
214 |
explorerParams.setHost(conn); |
|
215 |
PostGISRasterServerExplorer explorer = (PostGISRasterServerExplorer) dataManager.createServerExplorer(explorerParams); |
|
216 |
RasterDataParameters storeParameters = (RasterDataParameters)explorer.getStoreParameters(); |
|
217 |
storeParameters.setURI(conn); |
|
218 |
storeParameters.setDynValue("BLOCKS", nColumns); |
|
219 |
storeParameters.setDynValue("DBPARAMS", item.getDBStoreParameters()); |
|
220 |
storeParameters.setDynValue("DBEXPLORER", item.getExplorer()); |
|
221 |
|
|
222 |
MapContextManager mcm = MapContextLocator.getMapContextManager(); |
|
223 |
|
|
224 |
if(apiUI.isLayerTiled()) { |
|
225 |
DataManager manager = DALLocator.getDataManager(); |
|
226 |
TileDataParameters tileParams = null; |
|
227 |
try { |
|
228 |
tileParams = (TileDataParameters) manager.createStoreParameters("Tile Store"); |
|
229 |
} catch (InitializeException e) { |
|
230 |
throw new LoadLayerException("", e); |
|
231 |
} catch (ProviderNotRegisteredException e) { |
|
232 |
throw new LoadLayerException("", e); |
|
233 |
} |
|
234 |
tileParams.setDataParameters(storeParameters); |
|
235 |
lyr = (DefaultFLyrRaster) mcm.createLayer(layerName, tileParams); |
|
236 |
//dataStore = dataManager.createStore(tileParams); |
|
237 |
} else { |
|
238 |
lyr = (DefaultFLyrRaster) mcm.createLayer(layerName, storeParameters); |
|
239 |
//dataStore = dataManager.createStore(storeParameters); |
|
240 |
} |
|
241 |
} catch (ValidateDataParametersException e) { |
|
242 |
throw new LoadLayerException("Error validating parameters", e); |
|
243 |
} catch (InitializeException e) { |
|
244 |
throw new LoadLayerException("Error initializating layer.", e); |
|
245 |
} catch (ProviderNotRegisteredException e) { |
|
246 |
throw new LoadLayerException("Provider not registered.", e); |
|
247 |
} catch (PostGISRasterCoreException e) { |
|
248 |
throw new LoadLayerException("", e); |
|
249 |
} |
|
250 |
|
|
251 |
return lyr; |
|
252 |
} |
|
253 |
|
|
254 |
/** |
|
255 |
* Gets the number of column of the selected table |
|
256 |
* @param schema |
|
257 |
* @param table |
|
258 |
* @return |
|
259 |
*/ |
|
260 |
@SuppressWarnings("deprecation") |
|
261 |
public long getNumberOfColumns(String schema, String table) { |
|
262 |
DataManager manager = DALLocator.getDataManager(); |
|
263 |
try { |
|
264 |
DataStoreParameters params = manager.createStoreParameters("PostgreSQL"); |
|
265 |
|
|
266 |
params.setDynValue("host", dbExplorerParameters.getHost()); |
|
267 |
params.setDynValue("port", dbExplorerParameters.getPort()); |
|
268 |
params.setDynValue("dbuser", dbExplorerParameters.getUser()); |
|
269 |
params.setDynValue("password", dbExplorerParameters.getPassword()); |
|
270 |
params.setDynValue("schema", schema); |
|
271 |
params.setDynValue("dbname", dbExplorerParameters.getDBName()); |
|
272 |
params.setDynValue("table", table); |
|
273 |
|
|
274 |
FeatureStore store = (FeatureStore)manager.createStore(params); |
|
275 |
long size = store.getFeatureCount(); |
|
276 |
store.dispose(); |
|
277 |
return size; |
|
278 |
} catch (DataException e) { |
|
279 |
return 0; |
|
280 |
} catch (ValidateDataParametersException e) { |
|
281 |
return 0; |
|
282 |
} |
|
283 |
} |
|
284 |
|
|
285 |
/** |
|
286 |
* Gets the name of a raster file |
|
287 |
*/ |
|
288 |
private String getFormatedRasterFileName(String name) { |
|
289 |
String newName = ""; |
|
290 |
String schema = null; |
|
291 |
String table = null; |
|
292 |
int index = name.indexOf(" schema='") + 8; |
|
293 |
if(index != -1) { |
|
294 |
try { |
|
295 |
schema = name.substring(index + 1, name.indexOf("'", index + 1)); |
|
296 |
newName += schema + "."; |
|
297 |
} catch (StringIndexOutOfBoundsException e) { |
|
298 |
} |
|
299 |
} |
|
300 |
index = name.indexOf(" table='") + 7; |
|
301 |
if(index != -1) { |
|
302 |
try { |
|
303 |
table = name.substring(index + 1, name.indexOf("'", index + 1)); |
|
304 |
newName += table; |
|
305 |
} catch (StringIndexOutOfBoundsException e) { |
|
306 |
} |
|
307 |
} |
|
308 |
return newName; |
|
309 |
} |
|
310 |
|
|
311 |
/** |
|
312 |
* Shows an error |
|
313 |
* @param _msg |
|
314 |
*/ |
|
315 |
public void showConnectionErrorMessage(String _msg) { |
|
316 |
String msg = (_msg.length() > 300) ? "" : (": " + _msg); |
|
317 |
String title = PluginServices.getText(this, "connection_error"); |
|
318 |
JOptionPane.showMessageDialog(apiUI.getComponent(), title + msg, title, |
|
319 |
JOptionPane.ERROR_MESSAGE); |
|
320 |
} |
|
321 |
|
|
322 |
/** |
|
323 |
* Shows a information window |
|
324 |
* @param _msg |
|
325 |
*/ |
|
326 |
public void showConnectionInfoMessage(String _msg) { |
|
327 |
String msg = (_msg.length() > 300) ? "" : (": " + _msg); |
|
328 |
String title = PluginServices.getText(this, "warning"); |
|
329 |
JOptionPane.showMessageDialog(apiUI.getComponent(), title + msg, title, |
|
330 |
JOptionPane.WARNING_MESSAGE); |
|
331 |
} |
|
332 |
} |
|
0 | 333 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/java/org/gvsig/raster/postgis/app/postgisrasterclient/gui/AddPostGISRasterLayerWizard.java | ||
---|---|---|
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 |
package org.gvsig.raster.postgis.app.postgisrasterclient.gui; |
|
23 |
|
|
24 |
import java.awt.event.ActionEvent; |
|
25 |
import java.awt.event.ActionListener; |
|
26 |
import java.util.HashMap; |
|
27 |
import java.util.Iterator; |
|
28 |
import java.util.List; |
|
29 |
import java.util.Map; |
|
30 |
import java.util.Map.Entry; |
|
31 |
|
|
32 |
import javax.swing.JComboBox; |
|
33 |
import javax.swing.JPanel; |
|
34 |
import javax.swing.event.ListSelectionEvent; |
|
35 |
import javax.swing.event.ListSelectionListener; |
|
36 |
|
|
37 |
import org.gvsig.andami.PluginServices; |
|
38 |
import org.gvsig.andami.PluginsLocator; |
|
39 |
import org.gvsig.andami.PluginsManager; |
|
40 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
41 |
import org.gvsig.app.gui.WizardPanel; |
|
42 |
import org.gvsig.app.gui.wizards.WizardListener; |
|
43 |
import org.gvsig.app.gui.wizards.WizardListenerSupport; |
|
44 |
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel; |
|
45 |
import org.gvsig.compat.net.ICancellable; |
|
46 |
import org.gvsig.fmap.dal.DALLocator; |
|
47 |
import org.gvsig.fmap.dal.DataManager; |
|
48 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
49 |
import org.gvsig.fmap.dal.exception.DataException; |
|
50 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
51 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
52 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
53 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
54 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
55 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
56 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
57 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorer; |
|
58 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorerParameters; |
|
59 |
import org.gvsig.fmap.dal.store.db.DBStoreParameters; |
|
60 |
import org.gvsig.geodb.ExtDB_Spatial; |
|
61 |
import org.gvsig.geodb.vectorialdb.wizard.MyExplorer; |
|
62 |
import org.gvsig.geodb.vectorialdb.wizard.VectorialDBConnectionParamsDialog; |
|
63 |
import org.gvsig.raster.postgis.io.PostGISRasterCoreException; |
|
64 |
import org.gvsig.raster.postgis.swing.AddLayerUI; |
|
65 |
import org.gvsig.raster.postgis.swing.PostGISRasterSwingLocator; |
|
66 |
import org.gvsig.raster.util.CancelTaskImpl; |
|
67 |
import org.gvsig.tools.dynobject.DynObject; |
|
68 |
import org.slf4j.Logger; |
|
69 |
import org.slf4j.LoggerFactory; |
|
70 |
|
|
71 |
/** |
|
72 |
* Wizard panel to add a new PostGIS raster layer |
|
73 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
74 |
*/ |
|
75 |
public class AddPostGISRasterLayerWizard extends WizardPanel implements ActionListener, ListSelectionListener { |
|
76 |
private static final long serialVersionUID = 1L; |
|
77 |
private static final String TAB_NAME = "PostGIS Raster"; |
|
78 |
private static Logger logger = LoggerFactory.getLogger(AddPostGISRasterLayerWizard.class.getName()); |
|
79 |
private AbstractViewPanel view = null; |
|
80 |
private AddLayerUI apiUI = null; |
|
81 |
private ICancellable cancel = null; |
|
82 |
private LayerLoaderManager layerLoaderManager = null; |
|
83 |
private WizardListenerSupport listenerSupport = null; |
|
84 |
|
|
85 |
/** |
|
86 |
* Thread to connect to a PostGIS raster server |
|
87 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
88 |
*/ |
|
89 |
public class ConnectThread extends Thread { |
|
90 |
private ICancellable cancel = null; |
|
91 |
|
|
92 |
public ConnectThread(ICancellable cancel) { |
|
93 |
this.cancel = cancel; |
|
94 |
} |
|
95 |
|
|
96 |
public void run() { |
|
97 |
try { |
|
98 |
layerLoaderManager.loadLayers(); |
|
99 |
} finally { |
|
100 |
((CancelTaskImpl)cancel).setCanceled(false); |
|
101 |
} |
|
102 |
} |
|
103 |
} |
|
104 |
|
|
105 |
public AddPostGISRasterLayerWizard() { |
|
106 |
super(); |
|
107 |
initialize(); |
|
108 |
} |
|
109 |
|
|
110 |
private void initialize() { |
|
111 |
setTabName(PluginServices.getText(this, TAB_NAME)); |
|
112 |
setLayout(null); |
|
113 |
|
|
114 |
IWindow iw = PluginServices.getMDIManager().getActiveWindow(); |
|
115 |
|
|
116 |
if (iw == null) { |
|
117 |
return; |
|
118 |
} |
|
119 |
|
|
120 |
if (!(iw instanceof AbstractViewPanel)) { |
|
121 |
return; |
|
122 |
} |
|
123 |
|
|
124 |
apiUI = PostGISRasterSwingLocator.getSwingManager().createAddLayerUI(); |
|
125 |
apiUI.addListenerToBDSelectionCombo(this); |
|
126 |
apiUI.addListenerToNewDBButton(this); |
|
127 |
apiUI.addListenerToTableSelector(this); |
|
128 |
|
|
129 |
view = (AbstractViewPanel) iw; |
|
130 |
setMapCtrl(view.getMapControl()); |
|
131 |
|
|
132 |
JPanel mainPanel = (JPanel)apiUI.getComponent(); |
|
133 |
mainPanel.setBounds(new java.awt.Rectangle(0, 0, 501, 350)); |
|
134 |
add(mainPanel, null); |
|
135 |
|
|
136 |
layerLoaderManager = new LayerLoaderManager(apiUI); |
|
137 |
|
|
138 |
loadVectorialDBDatasourcesCombo(null); |
|
139 |
} |
|
140 |
|
|
141 |
private WizardListenerSupport getWizardListenerSupport() { |
|
142 |
if(listenerSupport == null) |
|
143 |
listenerSupport = new WizardListenerSupport(); |
|
144 |
return listenerSupport; |
|
145 |
} |
|
146 |
|
|
147 |
/** |
|
148 |
* This method checks for the options selected within the configuration |
|
149 |
* dialog are correct. |
|
150 |
* |
|
151 |
* @return true if you're done, false if not. |
|
152 |
*/ |
|
153 |
public boolean areSettingsValid() { |
|
154 |
return (apiUI.getSelectedTables() != null && apiUI.getSelectedTables().size() > 0); |
|
155 |
} |
|
156 |
|
|
157 |
public void addWizardListener(WizardListener listener) { |
|
158 |
getWizardListenerSupport().addWizardListener(listener); |
|
159 |
getWizardListenerSupport().callStateChanged(false); |
|
160 |
} |
|
161 |
|
|
162 |
public void removeWizardListener(WizardListener listener) { |
|
163 |
getWizardListenerSupport().removeWizardListener(listener); |
|
164 |
} |
|
165 |
|
|
166 |
/** |
|
167 |
* Loads the ComboBox for listing connections |
|
168 |
* @param sel |
|
169 |
*/ |
|
170 |
@SuppressWarnings("unchecked") |
|
171 |
private void loadVectorialDBDatasourcesCombo(MyExplorer sel) { |
|
172 |
JComboBox combo = apiUI.getDBCombo(); |
|
173 |
PluginsManager manager = PluginsLocator.getManager(); |
|
174 |
DynObject values = manager.getPlugin(ExtDB_Spatial.class).getPluginProperties(); |
|
175 |
Map connections = (Map) values.getDynValue("db_connections"); |
|
176 |
if (connections != null){ |
|
177 |
Iterator it = connections.entrySet().iterator(); |
|
178 |
combo.removeAllItems(); |
|
179 |
combo.addItem(""); |
|
180 |
while (it.hasNext()){ |
|
181 |
Map.Entry entry = (Entry) it.next(); |
|
182 |
MyExplorer myExplorer = new MyExplorer(); |
|
183 |
myExplorer.setDbExplorerParameters((DBServerExplorerParameters) entry.getValue()); |
|
184 |
myExplorer.setName((String) entry.getKey()); |
|
185 |
combo.addItem(myExplorer); |
|
186 |
if(sel!=null && sel.getName().equalsIgnoreCase(myExplorer.getName())){ |
|
187 |
combo.setSelectedItem(myExplorer); |
|
188 |
} |
|
189 |
} |
|
190 |
} else { |
|
191 |
connections = new HashMap(); |
|
192 |
values.setDynValue("db_connections", connections); |
|
193 |
} |
|
194 |
} |
|
195 |
|
|
196 |
@Override |
|
197 |
public void close() { |
|
198 |
|
|
199 |
} |
|
200 |
|
|
201 |
@Override |
|
202 |
public void execute() { |
|
203 |
layerLoaderManager.showConnectionInfoMessage(PluginServices.getText(this, "loading_postgis_raster_layer")); |
|
204 |
cancel = new CancelTaskImpl(); |
|
205 |
new ConnectThread(cancel).start(); |
|
206 |
} |
|
207 |
|
|
208 |
@Override |
|
209 |
public DataStoreParameters[] getParameters() { |
|
210 |
return null; |
|
211 |
} |
|
212 |
|
|
213 |
@Override |
|
214 |
public void initWizard() { |
|
215 |
|
|
216 |
} |
|
217 |
|
|
218 |
/** |
|
219 |
* Updates the JList component with the list of tables of |
|
220 |
* the selected database. |
|
221 |
* |
|
222 |
* @param dbSeverExplorerParameters2 |
|
223 |
*/ |
|
224 |
@SuppressWarnings("unchecked") |
|
225 |
private void updateTableList( |
|
226 |
DBServerExplorerParameters dbSeverExplorerParameters2) { |
|
227 |
if (dbSeverExplorerParameters2 == null) { |
|
228 |
return; |
|
229 |
} |
|
230 |
DataManager dm = DALLocator.getDataManager(); |
|
231 |
DBServerExplorer dbExplorer = null; |
|
232 |
try { |
|
233 |
dbExplorer = (DBServerExplorer) dm.openServerExplorer(dbSeverExplorerParameters2.getExplorerName(), dbSeverExplorerParameters2); |
|
234 |
|
|
235 |
if(dbExplorer == null) { |
|
236 |
throw new Exception(); |
|
237 |
} |
|
238 |
|
|
239 |
List parameters = dbExplorer.list(); |
|
240 |
|
|
241 |
Iterator iter = parameters.iterator(); |
|
242 |
DBStoreParameters param = null; |
|
243 |
apiUI.clearList(); |
|
244 |
while (iter.hasNext()) { |
|
245 |
param = (DBStoreParameters) iter.next(); |
|
246 |
|
|
247 |
//Criterios para a๏ฟฝadir la tabla a la lista |
|
248 |
try { |
|
249 |
if(isTableNamePreffixValid(param) && isRasterTable(param)) { |
|
250 |
apiUI.addElementToTable(new TableListItem(dbExplorer, param)); |
|
251 |
} |
|
252 |
} catch (PostGISRasterCoreException e) { |
|
253 |
logger.info("While getting table names: " + e.getMessage(), e); |
|
254 |
} |
|
255 |
} |
|
256 |
|
|
257 |
} catch (ReadException e) { |
|
258 |
logger.info("While getting table names: " + e.getMessage(), e); |
|
259 |
layerLoaderManager.showConnectionErrorMessage(PluginServices.getText(this, "error_getting_tables")); |
|
260 |
return; |
|
261 |
} catch (Exception e) { |
|
262 |
logger.info("While getting table names: " + e.getMessage(), e); |
|
263 |
layerLoaderManager.showConnectionErrorMessage(PluginServices.getText(this, "error_getting_tables")); |
|
264 |
return; |
|
265 |
} |
|
266 |
} |
|
267 |
|
|
268 |
private boolean isTableNamePreffixValid(DBStoreParameters param) { |
|
269 |
return !param.getTable().startsWith("o_"); |
|
270 |
} |
|
271 |
|
|
272 |
/** |
|
273 |
* Checks is the table has the structure to contain a raster |
|
274 |
* @param param |
|
275 |
* @return |
|
276 |
* @throws PostGISRasterCoreException |
|
277 |
*/ |
|
278 |
private boolean isRasterTable(DBStoreParameters param) throws PostGISRasterCoreException { |
|
279 |
DataManager dm = DALLocator.getDataManager(); |
|
280 |
FeatureStore store; |
|
281 |
try { |
|
282 |
store = (FeatureStore)dm.openStore(param.getDataStoreName(), param); |
|
283 |
|
|
284 |
FeatureType featureType = store.getDefaultFeatureType(); |
|
285 |
if(featureType.size() == 2) { |
|
286 |
if(existsAttr(featureType, "rid") && existsAttr(featureType, "rast")) |
|
287 |
return true; |
|
288 |
} |
|
289 |
store.dispose(); |
|
290 |
} catch (ValidateDataParametersException e) { |
|
291 |
throw new PostGISRasterCoreException(e); |
|
292 |
} catch (InitializeException e) { |
|
293 |
throw new PostGISRasterCoreException(e); |
|
294 |
} catch (ProviderNotRegisteredException e) { |
|
295 |
throw new PostGISRasterCoreException(e); |
|
296 |
} catch (DataException e) { |
|
297 |
throw new PostGISRasterCoreException(e); |
|
298 |
} |
|
299 |
return false; |
|
300 |
} |
|
301 |
|
|
302 |
@SuppressWarnings("unchecked") |
|
303 |
private boolean existsAttr(FeatureType featureType, String attr) { |
|
304 |
Iterator it = featureType.iterator(); |
|
305 |
while( it.hasNext() ) { |
|
306 |
FeatureAttributeDescriptor attribute = (FeatureAttributeDescriptor)it.next(); |
|
307 |
if(attribute.getName().compareTo(attr) == 0) { |
|
308 |
return true; |
|
309 |
} |
|
310 |
} |
|
311 |
return false; |
|
312 |
} |
|
313 |
|
|
314 |
public void actionPerformed(ActionEvent e) { |
|
315 |
if (apiUI.isAddDBEventObject(e.getSource())) { |
|
316 |
MyExplorer sel = addNewConnection(); |
|
317 |
|
|
318 |
if (sel != null) { |
|
319 |
DBServerExplorerParameters dbExplorerParameters = sel.getDbSeverExplorerParameters(); |
|
320 |
layerLoaderManager.setDBServerExplorerParameters(dbExplorerParameters); |
|
321 |
loadVectorialDBDatasourcesCombo(sel); |
|
322 |
apiUI.getDBCombo().setSelectedItem(sel); |
|
323 |
} |
|
324 |
} |
|
325 |
|
|
326 |
if(e.getSource() == apiUI.getDBCombo()) { |
|
327 |
JComboBox dbCombo = apiUI.getDBCombo(); |
|
328 |
if(dbCombo.getItemCount() == 0) { |
|
329 |
apiUI.clearList(); |
|
330 |
} else { |
|
331 |
Object selected = dbCombo.getSelectedItem(); |
|
332 |
if(selected == null) |
|
333 |
return; |
|
334 |
if (selected instanceof MyExplorer) { |
|
335 |
MyExplorer sel_obj = (MyExplorer) selected; |
|
336 |
dbCombo.repaint(); |
|
337 |
DBServerExplorerParameters dbExplorerParameters = sel_obj.getDbSeverExplorerParameters(); |
|
338 |
layerLoaderManager.setDBServerExplorerParameters(dbExplorerParameters); |
|
339 |
updateTableList(dbExplorerParameters); |
|
340 |
} |
|
341 |
} |
|
342 |
} |
|
343 |
} |
|
344 |
|
|
345 |
/** |
|
346 |
* Adds a new connection using the generic dialog. This function |
|
347 |
* is used when the button add new connection is pressed by the user |
|
348 |
* @return |
|
349 |
*/ |
|
350 |
@SuppressWarnings("unchecked") |
|
351 |
private MyExplorer addNewConnection() { |
|
352 |
MyExplorer myExplorer = new MyExplorer(); |
|
353 |
DBServerExplorerParameters resp = null; |
|
354 |
|
|
355 |
VectorialDBConnectionParamsDialog newco = new VectorialDBConnectionParamsDialog(); |
|
356 |
newco.showDialog(); |
|
357 |
|
|
358 |
if (newco.isOkPressed()) { |
|
359 |
try { |
|
360 |
resp = newco.getParameters(); |
|
361 |
} catch (Exception e) { |
|
362 |
layerLoaderManager.showConnectionErrorMessage(e.getMessage()); |
|
363 |
return null; |
|
364 |
} |
|
365 |
PluginsManager manager = PluginsLocator.getManager(); |
|
366 |
DynObject values = manager.getPlugin(ExtDB_Spatial.class).getPluginProperties(); |
|
367 |
Map connections = (Map) values.getDynValue("db_connections"); |
|
368 |
if(connections == null){ |
|
369 |
connections = new HashMap(); |
|
370 |
values.setDynValue("db_connections", connections); |
|
371 |
} |
|
372 |
connections.put(newco.getConnectionName(), resp); |
|
373 |
|
|
374 |
myExplorer.setDbExplorerParameters(resp); |
|
375 |
myExplorer.setName(newco.getConnectionName()); |
|
376 |
return myExplorer; |
|
377 |
} else { |
|
378 |
return null; |
|
379 |
} |
|
380 |
} |
|
381 |
|
|
382 |
public void valueChanged(ListSelectionEvent e) { |
|
383 |
if (apiUI.isAddTableEvent(e.getSource())) { |
|
384 |
List<Object> tables = apiUI.getSelectedTables(); |
|
385 |
apiUI.clearSubdatasetList(); |
|
386 |
|
|
387 |
if(tables.size() == 1) { |
|
388 |
TableListItem item = (TableListItem)tables.get(0); |
|
389 |
String schema = item.getSchema(); |
|
390 |
String table = item.getTableName(); |
|
391 |
long columns = layerLoaderManager.getNumberOfColumns(schema, table); |
|
392 |
for (int i = 0; i < columns; i++) { |
|
393 |
apiUI.addSubdatasetToTable(schema + "." + table + " rid = " + i); |
|
394 |
} |
|
395 |
} |
|
396 |
getWizardListenerSupport().callStateChanged(areSettingsValid()); |
|
397 |
} |
|
398 |
} |
|
399 |
|
|
400 |
} |
|
0 | 401 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/java/org/gvsig/raster/postgis/app/postgisrasterclient/gui/TableListItem.java | ||
---|---|---|
1 |
package org.gvsig.raster.postgis.app.postgisrasterclient.gui; |
|
2 |
|
|
3 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorer; |
|
4 |
import org.gvsig.fmap.dal.store.db.DBStoreParameters; |
|
5 |
|
|
6 |
/** |
|
7 |
* Represents an element in the list of tables. |
|
8 |
* |
|
9 |
* @author Nacho Brodin (nachobrodin@gmail.org) |
|
10 |
*/ |
|
11 |
public class TableListItem { |
|
12 |
private DBStoreParameters parameters = null; |
|
13 |
private DBServerExplorer explorer = null; |
|
14 |
private String tableName = ""; |
|
15 |
|
|
16 |
public TableListItem(DBServerExplorer explorer, |
|
17 |
DBStoreParameters param) { |
|
18 |
tableName = param.getTable(); |
|
19 |
this.parameters = param; |
|
20 |
this.explorer = explorer; |
|
21 |
} |
|
22 |
|
|
23 |
public String toString() { |
|
24 |
return tableName; |
|
25 |
} |
|
26 |
|
|
27 |
public String getTableName() { |
|
28 |
return tableName; |
|
29 |
} |
|
30 |
|
|
31 |
public String getSchema() { |
|
32 |
return (String)parameters.getDynValue("Schema"); |
|
33 |
} |
|
34 |
|
|
35 |
public DBStoreParameters getDBStoreParameters() { |
|
36 |
return parameters; |
|
37 |
} |
|
38 |
|
|
39 |
public DBServerExplorer getExplorer() { |
|
40 |
return explorer; |
|
41 |
} |
|
42 |
} |
|
0 | 43 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/java/org/gvsig/raster/postgis/app/postgisrasterclient/PostGISRasterExtension.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
*/ |
|
19 |
package org.gvsig.raster.postgis.app.postgisrasterclient; |
|
20 |
|
|
21 |
import org.gvsig.about.AboutManager; |
|
22 |
import org.gvsig.about.AboutParticipant; |
|
23 |
import org.gvsig.andami.plugins.Extension; |
|
24 |
import org.gvsig.app.ApplicationLocator; |
|
25 |
import org.gvsig.app.ApplicationManager; |
|
26 |
import org.gvsig.app.extension.AddLayer; |
|
27 |
import org.gvsig.raster.postgis.app.postgisrasterclient.gui.AddPostGISRasterLayerWizard; |
|
28 |
|
|
29 |
/** |
|
30 |
* Entry point for PostGISRaster extension |
|
31 |
* |
|
32 |
* @author Nacho Brodin (nachobrodin@gmail.org) |
|
33 |
*/ |
|
34 |
public class PostGISRasterExtension extends Extension { |
|
35 |
/** |
|
36 |
* Initializes the wizard panel |
|
37 |
* |
|
38 |
*/ |
|
39 |
public void initialize() { |
|
40 |
initializeIcons(); |
|
41 |
} |
|
42 |
|
|
43 |
/** |
|
44 |
* @see com.iver.andami.plugins.IExtension#postInitialize() |
|
45 |
*/ |
|
46 |
@Override |
|
47 |
public void postInitialize() { |
|
48 |
super.postInitialize(); |
|
49 |
addAboutInfo(); |
|
50 |
|
|
51 |
AddLayer.addWizard(AddPostGISRasterLayerWizard.class); |
|
52 |
} |
|
53 |
|
|
54 |
private void addAboutInfo() { |
|
55 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
56 |
|
|
57 |
AboutManager about = application.getAbout(); |
|
58 |
about.addDeveloper("PRODEVELOP", getClass().getClassLoader() |
|
59 |
.getResource("about/postgisraster-about.html"), 2); |
|
60 |
|
|
61 |
AboutParticipant participant = about.getDeveloper("PRODEVELOP"); |
|
62 |
participant.addContribution( |
|
63 |
"PostGIS Raster", |
|
64 |
"Soporte para BBDD r?ster usando PostGIS", |
|
65 |
2011,12,1, |
|
66 |
2011,12,31 |
|
67 |
); |
|
68 |
} |
|
69 |
|
|
70 |
public void execute(String actionCommand) { |
|
71 |
//Removes Gdal dependency |
|
72 |
/*try { |
|
73 |
test(); |
|
74 |
} catch (GdalException e) { |
|
75 |
e.printStackTrace(); |
|
76 |
} catch (IOException e) { |
|
77 |
e.printStackTrace(); |
|
78 |
}*/ |
|
79 |
} |
|
80 |
|
|
81 |
//Removes Gdal dependency |
|
82 |
/*private void test() throws GdalException, IOException{ |
|
83 |
Gdal gdal = new Gdal(); |
|
84 |
gdal.open("PG:host='130.0.2.122' port='5432' dbname='testgis' user='postgres' password='postgres' schema='public' table='small_world_1tile'", Gdal.GA_ReadOnly); |
|
85 |
int w = gdal.getRasterXSize(); |
|
86 |
int h = gdal.getRasterYSize(); |
|
87 |
System.out.println(w + " " + h); |
|
88 |
GdalRasterBand[] b = new GdalRasterBand[3]; |
|
89 |
b[0] = gdal.getRasterBand(1); |
|
90 |
b[1] = gdal.getRasterBand(2); |
|
91 |
b[2] = gdal.getRasterBand(3); |
|
92 |
|
|
93 |
int dt = b[0].getRasterDataType(); |
|
94 |
GdalBuffer buf = b[0].readRaster(0, 0, w, h, w, h, dt); |
|
95 |
byte[] bb = buf.buffByte; |
|
96 |
for(int i = 0; i < 10; i++) { |
|
97 |
System.out.print(bb[i] + " "); |
|
98 |
} |
|
99 |
gdal.close(); |
|
100 |
}*/ |
|
101 |
|
|
102 |
|
|
103 |
public boolean isEnabled() { |
|
104 |
return true; |
|
105 |
} |
|
106 |
|
|
107 |
public boolean isVisible() { |
|
108 |
return true; |
|
109 |
} |
|
110 |
|
|
111 |
void initializeIcons(){ |
|
112 |
|
|
113 |
} |
|
114 |
} |
|
0 | 115 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/java/TestReadBandData.java | ||
---|---|---|
1 |
|
|
2 |
|
|
3 |
import java.io.IOException; |
|
4 |
|
|
5 |
import org.gvsig.jgdal.Gdal; |
|
6 |
import org.gvsig.jgdal.GdalRasterBand; |
|
7 |
import org.gvsig.jgdal.GdalException; |
|
8 |
import org.gvsig.jgdal.GdalBuffer; |
|
9 |
|
|
10 |
public class TestReadBandData { |
|
11 |
private Gdal gdal = null; |
|
12 |
private GdalRasterBand band = null; |
|
13 |
private String file1 = "PG:host='130.0.2.122' port='5432' dbname='testgis' user='postgres' password='postgres' schema='public' table='small_world_1tile'"; |
|
14 |
private String file = "/home/nacho/prueba.png"; |
|
15 |
|
|
16 |
public TestReadBandData() throws GdalException, IOException{ |
|
17 |
gdal = new Gdal(); |
|
18 |
gdal.open(file1, 0); |
|
19 |
testStack(); |
|
20 |
} |
|
21 |
|
|
22 |
public void testStack() throws GdalException, IOException{ |
|
23 |
String[] metadata = gdal.getMetadata(); |
|
24 |
for (int i = 0 ; i<metadata.length ; i++){ |
|
25 |
System.out.println("Metadato: " + metadata[i]); |
|
26 |
} |
|
27 |
|
|
28 |
metadata = gdal.getMetadata("Image Structure Metadata"); |
|
29 |
for (int i = 0 ; i<metadata.length ; i++){ |
|
30 |
System.out.println("Metadato: " + metadata[i]); |
|
31 |
} |
|
32 |
|
|
33 |
int w = gdal.getRasterXSize(); |
|
34 |
int h = gdal.getRasterYSize(); |
|
35 |
System.out.println(w + " " + h); |
|
36 |
GdalRasterBand[] b = new GdalRasterBand[3]; |
|
37 |
b[0] = gdal.getRasterBand(1); |
|
38 |
b[1] = gdal.getRasterBand(2); |
|
39 |
b[2] = gdal.getRasterBand(3); |
|
40 |
|
|
41 |
int dt = b[0].getRasterDataType(); |
|
42 |
System.out.println("-- " + dt); |
|
43 |
//GdalBuffer buf = b[0].readRaster(50, 50, 100, 100, 100, 100, dt); |
|
44 |
GdalBuffer buf = b[0].readRaster(0, 0, w, h, w, h, dt); |
|
45 |
byte[] bb = buf.buffByte; |
|
46 |
for(int i = 0; i < /*bb.length*/500; i++) { |
|
47 |
System.out.print(bb[i] + " "); |
|
48 |
} |
|
49 |
//while(true); |
|
50 |
|
|
51 |
} |
|
52 |
|
|
53 |
public static void main(String[] s) { |
|
54 |
try { |
|
55 |
TestReadBandData t = new TestReadBandData(); |
|
56 |
} catch (Exception e) { |
|
57 |
} |
|
58 |
} |
|
59 |
} |
|
0 | 60 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/resources-plugin/text.properties | ||
---|---|---|
1 |
error_getting_tables=Error conectando a la BBDD u obteniendo las tablas |
|
2 |
error_creating_layer=Error creando la capa PostGIS |
|
3 |
loading_postgis_raster_layer=La capa se est? cargando.\n. Esta operaci?n puede tardar un poco.\n Por favor, espere a que aparezca en la vista. |
|
4 |
warning=Aviso |
|
0 | 5 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/resources-plugin/text_en.properties | ||
---|---|---|
1 |
error_getting_tables=Error connecting to database or getting the tables |
|
2 |
error_creating_layer=Error creating PostGIS layer |
|
3 |
loading_postgis_raster_layer=The layer is loading.\n. This operation could last a little.\n Please, wait. |
|
4 |
warning=Warning |
|
0 | 5 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<depends plugin-name="org.gvsig.raster.gdal.app" /> |
|
4 |
<depends plugin-name="org.gvsig.geodb"/> |
|
5 |
<libraries library-dir="./lib"/> |
|
6 |
<resourceBundle name="text"/> |
|
7 |
<extensions> |
|
8 |
<extension class-name="org.gvsig.raster.postgis.app.postgisrasterclient.PostGISRasterExtension" |
|
9 |
description="M?dulo de PostGIS Raster." |
|
10 |
active="true" |
|
11 |
priority="1"> |
|
12 |
<!--test<tool-bar name="Test" position="40000"> |
|
13 |
<action-tool icon="none" action-command="" tooltip="" position="1"/> |
|
14 |
</tool-bar>--> |
|
15 |
</extension> |
|
16 |
</extensions> |
|
17 |
</plugin-config> |
|
0 | 18 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/resources-plugin/plugin.dtd | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO_8859-1"?> |
|
2 |
<!ELEMENT class EMPTY > |
|
3 |
<!ATTLIST class name NMTOKEN #REQUIRED > |
|
4 |
|
|
5 |
<!ELEMENT extension ( class | menu | toolBar | toolBoxItem | popupMenu)* > |
|
6 |
<!ATTLIST extension enabled NMTOKEN #IMPLIED > |
|
7 |
<!ATTLIST extension position NMTOKEN #IMPLIED > |
|
8 |
|
|
9 |
<!ELEMENT fileExtension ( class ) > |
|
10 |
<!ATTLIST fileExtension description CDATA #REQUIRED > |
|
11 |
<!ATTLIST fileExtension enabled NMTOKEN #IMPLIED > |
|
12 |
<!ATTLIST fileExtension endsWith CDATA #REQUIRED > |
|
13 |
<!ATTLIST fileExtension dialog CDATA #REQUIRED > |
|
14 |
|
|
15 |
<!ELEMENT import EMPTY > |
|
16 |
<!ATTLIST import plugin NMTOKEN #REQUIRED > |
|
17 |
|
|
18 |
<!ELEMENT libraries ( library+ ) > |
|
19 |
|
|
20 |
<!ELEMENT library EMPTY > |
|
21 |
<!ATTLIST library file NMTOKEN #REQUIRED > |
|
22 |
|
|
23 |
<!ELEMENT menu EMPTY > |
|
24 |
<!ATTLIST menu actionCommand NMTOKEN #IMPLIED > |
|
25 |
<!ATTLIST menu enableText CDATA #IMPLIED > |
|
26 |
<!ATTLIST menu key NMTOKEN #IMPLIED > |
|
27 |
<!ATTLIST menu mnemonic NMTOKEN #IMPLIED > |
|
28 |
<!ATTLIST menu icon CDATA #IMPLIED > |
|
29 |
<!ATTLIST menu text CDATA #REQUIRED > |
|
30 |
<!ATTLIST menu tooltip CDATA #IMPLIED > |
|
31 |
|
|
32 |
<!ELEMENT plugin ( import*, libraries, resourceBundle, labelSet*, extension*, fileExtension*, icon*) > |
|
33 |
|
|
34 |
<!ELEMENT icon EMPTY > |
|
35 |
<!ATTLIST icon src CDATA #REQUIRED > |
|
36 |
<!ATTLIST icon text CDATA #REQUIRED > |
|
37 |
|
|
38 |
<!ELEMENT resourceBundle EMPTY > |
|
39 |
<!ATTLIST resourceBundle name NMTOKEN #REQUIRED > |
|
40 |
|
|
41 |
<!ELEMENT tool EMPTY > |
|
42 |
<!ATTLIST tool actionCommand NMTOKEN #IMPLIED > |
|
43 |
<!ATTLIST tool enableText CDATA #IMPLIED > |
|
44 |
<!ATTLIST tool icon CDATA #IMPLIED > |
|
45 |
<!ATTLIST tool text NMTOKEN #IMPLIED > |
|
46 |
<!ATTLIST tool tooltip CDATA #IMPLIED > |
|
47 |
|
|
48 |
<!ELEMENT toolBar ( tool+ ) > |
|
49 |
<!ATTLIST toolBar name NMTOKEN #IMPLIED > |
|
50 |
|
|
51 |
<!ELEMENT entry EMPTY > |
|
52 |
<!ATTLIST entry text CDATA #IMPLIED > |
|
53 |
<!ATTLIST entry enableText CDATA #IMPLIED > |
|
54 |
<!ATTLIST entry tooltip CDATA #IMPLIED > |
|
55 |
<!ATTLIST entry actionCommand NMTOKEN #IMPLIED > |
|
56 |
|
|
57 |
<!ELEMENT popupMenu ( entry+ ) > |
|
58 |
<!ATTLIST popupMenu name NMTOKEN #IMPLIED > |
|
59 |
|
|
60 |
<!ELEMENT labelSet ( label+ ) > |
|
61 |
<!ATTLIST labelSet class NMTOKEN #REQUIRED > |
|
62 |
|
|
63 |
<!ELEMENT label EMPTY > |
|
64 |
<!ATTLIST label text NMTOKEN #REQUIRED > |
|
65 |
<!ATTLIST label size NMTOKEN #IMPLIED> |
|
66 |
|
|
67 |
<!ELEMENT toolBoxItem EMPTY > |
|
68 |
<!ATTLIST toolBoxItem default NMTOKEN #IMPLIED > |
|
69 |
<!ATTLIST toolBoxItem actionCommand NMTOKEN #IMPLIED > |
|
70 |
<!ATTLIST toolBoxItem icon CDATA #IMPLIED > |
|
71 |
<!ATTLIST toolBoxItem text CDATA #IMPLIED > |
|
72 |
<!ATTLIST toolBoxItem tooltip CDATA #IMPLIED > |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/resources-plugin/about/postgisraster-about.html | ||
---|---|---|
1 |
<html> |
|
2 |
<head> |
|
3 |
<style type="text/css"> |
|
4 |
BODY { background-image: url(logo.png); background-repeat: no-repeat; background-position: 100% 0% } |
|
5 |
</style> |
|
6 |
</head> |
|
7 |
<body> |
|
8 |
<h2>Soporte PostGIS Raster para gvSIG</h2> |
|
9 |
<p><b>Prodevelop S.L.</b> ha incorporado el soporte al formato raster en |
|
10 |
base de datos <b>PostGres</b></p> |
|
11 |
|
|
12 |
<p><b>Desarrollo:</b></p> |
|
13 |
|
|
14 |
<p>Director del proyecto:</p> |
|
15 |
<ul> |
|
16 |
<li>Miguel Montesinos Lajara</li> |
|
17 |
</ul> |
|
18 |
<p>Equipo de desarrollo:</p> |
|
19 |
<ul> |
|
20 |
<li>Nacho Brodin</li> |
|
21 |
</ul> |
|
22 |
|
|
23 |
<p><b>Colaboradores:</b></p> |
|
24 |
|
|
25 |
<p>Deimos:</p> |
|
26 |
<ul> |
|
27 |
<li>Jorge Arevalo</li> |
|
28 |
</ul> |
|
29 |
|
|
30 |
<p>Build Number de la extensión: 1</p> |
|
31 |
<center> |
|
32 |
<p><b><a href="http://www.prodevelop.es" title="Prodevelop">http://www.prodevelop.es</a></b></p> |
|
33 |
</center> |
|
34 |
|
|
35 |
</body> |
|
36 |
</html> |
|
0 | 37 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
<id>gvsig-plugin-package</id> |
|
3 |
<formats> |
|
4 |
<format>zip</format> |
|
5 |
</formats> |
|
6 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
7 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
8 |
<files> |
|
9 |
<file> |
|
10 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
11 |
<outputDirectory>lib</outputDirectory> |
|
12 |
</file> |
|
13 |
<file> |
|
14 |
<source>target/package.info</source> |
|
15 |
</file> |
|
16 |
</files> |
|
17 |
|
|
18 |
<fileSets> |
|
19 |
<fileSet> |
|
20 |
<directory>src/main/resources-plugin</directory> |
|
21 |
<outputDirectory>.</outputDirectory> |
|
22 |
</fileSet> |
|
23 |
</fileSets> |
|
24 |
|
|
25 |
|
|
26 |
<dependencySets> |
|
27 |
<dependencySet> |
|
28 |
<useProjectArtifact>false</useProjectArtifact> |
|
29 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
30 |
<outputDirectory>lib</outputDirectory> |
|
31 |
<includes> |
|
32 |
<include>org.gvsig:org.gvsig.raster.postgis.app.postgisrasterclient:jar</include> |
|
33 |
<include>org.gvsig:org.gvsig.raster.postgis.io:jar</include> |
|
34 |
<include>org.gvsig:org.gvsig.raster.postgis.swing.api:jar</include> |
|
35 |
<include>org.gvsig:org.gvsig.raster.postgis.swing.impl:jar</include> |
|
36 |
</includes> |
|
37 |
</dependencySet> |
|
38 |
</dependencySets> |
|
39 |
</assembly> |
|
0 | 40 |
org.gvsig.raster.postgis/tags/tagdate_30092013_17_11/org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.raster.postgis.app.postgisrasterclient</artifactId> |
|
6 |
<packaging>jar</packaging> |
|
7 |
<name>Format: PostGIS raster format support</name> |
|
8 |
<description>PostGIS raster adapter for gvSIG</description> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.raster.postgis</artifactId> |
|
12 |
<version>2.1.0-SNAPSHOT</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<scm> |
|
16 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.postgis/trunk/org.gvsig.raster.postgis</connection> |
|
17 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.postgis/trunk/org.gvsig.raster.postgis</developerConnection> |
|
18 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.postgis/trunk/org.gvsig.raster.postgis</url> |
|
19 |
</scm> |
|
20 |
|
|
21 |
<dependencies> |
|
22 |
<dependency> |
|
23 |
<groupId>org.gvsig</groupId> |
|
24 |
<artifactId>org.gvsig.about.api</artifactId> |
|
25 |
<scope>compile</scope> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>org.gvsig</groupId> |
|
29 |
<artifactId>org.gvsig.raster.lib.api</artifactId> |
|
30 |
<scope>compile</scope> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.raster.postgis.swing.api</artifactId> |
|
35 |
<scope>compile</scope> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.raster.postgis.swing.impl</artifactId> |
|
40 |
<scope>runtime</scope> |
|
41 |
</dependency> |
|
42 |
<dependency> |
|
43 |
<groupId>org.gvsig</groupId> |
|
44 |
<artifactId>org.gvsig.raster.postgis.io</artifactId> |
|
45 |
<scope>compile</scope> |
|
46 |
</dependency> |
|
47 |
<dependency> |
|
48 |
<groupId>org.gvsig</groupId> |
|
49 |
<artifactId>org.gvsig.ui</artifactId> |
|
50 |
<scope>compile</scope> |
|
51 |
</dependency> |
|
52 |
<dependency> |
|
53 |
<groupId>org.gvsig</groupId> |
|
54 |
<artifactId>org.gvsig.raster.fmap</artifactId> |
|
55 |
<scope>compile</scope> |
|
56 |
</dependency> |
|
57 |
<dependency> |
|
58 |
<groupId>org.gvsig</groupId> |
|
59 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
60 |
<scope>compile</scope> |
|
61 |
</dependency> |
|
62 |
|
|
63 |
<dependency> |
|
64 |
<groupId>org.gvsig</groupId> |
|
65 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
66 |
<scope>compile</scope> |
|
67 |
</dependency> |
|
68 |
<dependency> |
|
69 |
<groupId>org.gvsig</groupId> |
|
70 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
71 |
<scope>compile</scope> |
|
72 |
</dependency> |
|
73 |
<dependency> |
|
74 |
<groupId>org.gvsig</groupId> |
|
75 |
<artifactId>org.gvsig.i18n</artifactId> |
|
76 |
<scope>compile</scope> |
|
77 |
</dependency> |
|
78 |
<dependency> |
|
79 |
<groupId>org.gvsig</groupId> |
|
80 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
81 |
<scope>compile</scope> |
|
82 |
</dependency> |
|
83 |
<dependency> |
|
84 |
<groupId>org.slf4j</groupId> |
|
85 |
<artifactId>slf4j-api</artifactId> |
|
86 |
<scope>compile</scope> |
|
87 |
</dependency> |
|
88 |
<dependency> |
|
89 |
<groupId>org.slf4j</groupId> |
|
90 |
<artifactId>slf4j-log4j12</artifactId> |
|
91 |
<scope>runtime</scope> |
|
92 |
</dependency> |
|
93 |
<dependency> |
|
94 |
<groupId>org.gvsig</groupId> |
|
95 |
<artifactId>org.gvsig.andami</artifactId> |
|
96 |
<scope>compile</scope> |
|
97 |
</dependency> |
|
98 |
|
|
99 |
<dependency> |
|
100 |
<groupId>org.gvsig</groupId> |
|
101 |
<artifactId>org.gvsig.geodb.app.mainplugin</artifactId> |
|
102 |
<scope>compile</scope> |
|
103 |
</dependency> |
|
104 |
<dependency> |
|
105 |
<groupId>org.gvsig</groupId> |
|
106 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
107 |
<scope>compile</scope> |
|
108 |
</dependency> |
|
109 |
<dependency> |
|
110 |
<groupId>org.gvsig</groupId> |
|
111 |
<artifactId>org.gvsig.fmap.mapcontext.impl</artifactId> |
|
112 |
<scope>runtime</scope> |
|
113 |
</dependency> |
|
114 |
<dependency> |
|
115 |
<groupId>org.gvsig</groupId> |
|
116 |
<artifactId>org.gvsig.fmap.mapcontext.operation</artifactId> |
|
117 |
<scope>runtime</scope> |
|
118 |
</dependency> |
|
119 |
|
|
120 |
<dependency> |
|
121 |
<groupId>org.gvsig</groupId> |
|
122 |
<artifactId>org.gvsig.projection.api</artifactId> |
|
123 |
<scope>compile</scope> |
|
124 |
</dependency> |
|
125 |
<dependency> |
|
126 |
<groupId>org.gvsig</groupId> |
|
127 |
<artifactId>org.gvsig.projection.cresques.impl</artifactId> |
|
128 |
<scope>runtime</scope> |
|
129 |
</dependency> |
|
130 |
<dependency> |
|
131 |
<groupId>org.gvsig</groupId> |
|
132 |
<artifactId>org.gvsig.compat.api</artifactId> |
|
133 |
<scope>compile</scope> |
|
134 |
</dependency> |
|
135 |
<dependency> |
|
136 |
<groupId>org.gvsig</groupId> |
|
137 |
<artifactId>org.gvsig.compat.se</artifactId> |
|
138 |
<scope>compile</scope> |
|
139 |
</dependency> |
|
140 |
<dependency> |
|
141 |
<groupId>org.gvsig</groupId> |
|
142 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
143 |
<scope>compile</scope> |
|
144 |
</dependency> |
|
145 |
<dependency> |
|
146 |
<groupId>org.gvsig</groupId> |
|
147 |
<artifactId>org.gvsig.fmap.dal.impl</artifactId> |
|
148 |
<scope>compile</scope> |
|
149 |
</dependency> |
|
150 |
<dependency> |
|
151 |
<groupId>org.gvsig</groupId> |
|
152 |
<artifactId>org.gvsig.fmap.dal.file.lib</artifactId> |
|
153 |
<scope>compile</scope> |
|
154 |
</dependency> |
|
155 |
<dependency> |
|
156 |
<groupId>org.gvsig</groupId> |
|
157 |
<artifactId>org.gvsig.fmap.dal.spi</artifactId> |
|
158 |
<scope>compile</scope> |
|
159 |
</dependency> |
|
160 |
<dependency> |
|
161 |
<groupId>org.gvsig</groupId> |
|
162 |
<artifactId>org.gvsig.fmap.dal.db.lib</artifactId> |
|
163 |
<scope>compile</scope> |
|
164 |
</dependency> |
|
165 |
<dependency> |
|
166 |
<groupId>org.gvsig</groupId> |
|
167 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
168 |
<scope>compile</scope> |
|
169 |
</dependency> |
|
170 |
<dependency> |
|
171 |
<groupId>org.gvsig</groupId> |
|
172 |
<artifactId>org.gvsig.fmap.geometry.impl</artifactId> |
|
173 |
<scope>runtime</scope> |
|
174 |
</dependency> |
|
175 |
<dependency> |
|
176 |
<groupId>org.gvsig</groupId> |
|
177 |
<artifactId>org.gvsig.fmap.geometry.operation</artifactId> |
|
178 |
<scope>runtime</scope> |
|
179 |
</dependency> |
|
180 |
</dependencies> |
|
181 |
<build> |
|
182 |
<plugins> |
|
183 |
<!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION |
|
184 |
<plugin> |
|
185 |
<groupId>org.apache.maven.plugins</groupId> |
|
186 |
<artifactId>maven-surefire-plugin</artifactId> |
|
187 |
<configuration> |
|
188 |
<excludes> |
|
189 |
<exclude>**/TestReadBandData.java</exclude> |
|
190 |
</excludes> |
|
191 |
</configuration> |
|
192 |
</plugin> --> |
|
193 |
</plugins> |
|
194 |
</build> |
|
195 |
<properties> |
|
196 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
197 |
<gvsig.package.info.dependencies>required: org.gvsig.raster.tilecache.app -ge 2, required: org.gvsig.raster.gdal.app -ge 2</gvsig.package.info.dependencies> |
|
198 |
<gvsig.package.info.poolURL>http://devel.gvsig.org/download/projects/Raster/pool</gvsig.package.info.poolURL> |
|
199 |
<gvsig.package.info.categories>Database,Raster,Formats</gvsig.package.info.categories> |
|
200 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
201 |
</properties> |
|
202 |
</project> |
|
0 | 203 |
Also available in: Unified diff