Revision 38557
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/IntersectsGeometryEvaluator.java | ||
---|---|---|
35 | 35 |
this.geometry = geometry; |
36 | 36 |
this.geometryTrans = geometry.cloneGeometry(); |
37 | 37 |
this.srs = projection.getAbrev(); |
38 |
ICoordTrans ct = projection.getCT(fad.getSRS()); |
|
38 |
ICoordTrans ct = null; |
|
39 |
|
|
40 |
IProjection ipro = fad.getSRS(); |
|
41 |
if (ipro != null) { |
|
42 |
ct = projection.getCT(ipro); |
|
43 |
} |
|
44 |
|
|
39 | 45 |
if (ct != null) { |
40 | 46 |
geometryTrans.reProject(ct); |
41 | 47 |
} |
branches/v2_0_0_prep/libraries/org.gvsig.exportto/pom.xml | ||
---|---|---|
65 | 65 |
<type>pom</type> |
66 | 66 |
<scope>import</scope> |
67 | 67 |
</dependency> |
68 |
<dependency> |
|
69 |
<groupId>org.gvsig</groupId> |
|
70 |
<artifactId>org.gvsig.geodb</artifactId> |
|
71 |
<version>2.0-SNAPSHOT</version> |
|
72 |
</dependency> |
|
73 | 68 |
</dependencies> |
74 | 69 |
</dependencyManagement> |
75 | 70 |
|
... | ... | |
82 | 77 |
<groupId>org.gvsig</groupId> |
83 | 78 |
<artifactId>org.gvsig.tools.lib</artifactId> |
84 | 79 |
<type>test-jar</type> |
85 |
</dependency> |
|
80 |
</dependency> |
|
81 |
|
|
82 |
<dependency> |
|
83 |
<groupId>org.gvsig</groupId> |
|
84 |
<artifactId>org.gvsig.geodb</artifactId> |
|
85 |
<version>2.0-SNAPSHOT</version> |
|
86 |
<scope>compile</scope> |
|
87 |
</dependency> |
|
88 |
|
|
86 | 89 |
</dependencies> |
87 | 90 |
|
88 | 91 |
<modules> |
branches/v2_0_0_prep/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.jdbc/src/main/java/org/gvsig/exportto/swing/prov/jdbc/AbstractExporttoJDBCProvider.java | ||
---|---|---|
24 | 24 |
import org.cresques.cts.IProjection; |
25 | 25 |
|
26 | 26 |
import org.gvsig.exportto.ExporttoService; |
27 |
import org.gvsig.exportto.swing.prov.jdbc.panel.ConnectionPanel; |
|
27 |
import org.gvsig.exportto.swing.prov.jdbc.panel.JDBCConnectionPanel;
|
|
28 | 28 |
import org.gvsig.exportto.swing.prov.jdbc.panel.SelectPkPanel; |
29 | 29 |
import org.gvsig.exportto.swing.prov.jdbc.panel.SelectTableNamePanel; |
30 | 30 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProvider; |
... | ... | |
45 | 45 |
|
46 | 46 |
protected SelectTableNamePanel selectTableNamePanel = null; |
47 | 47 |
protected SelectPkPanel selectPkPanel = null; |
48 |
protected ConnectionPanel connectionPanel = null;
|
|
48 |
protected JDBCConnectionPanel jdbcConnectionPanel = null;
|
|
49 | 49 |
|
50 | 50 |
protected FeatureStore featureStore; |
51 | 51 |
protected IProjection projection; |
... | ... | |
66 | 66 |
|
67 | 67 |
selectTableNamePanel = new SelectTableNamePanel(); |
68 | 68 |
selectPkPanel = new SelectPkPanel(); |
69 |
connectionPanel = new ConnectionPanel();
|
|
69 |
jdbcConnectionPanel = new JDBCConnectionPanel();
|
|
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
public int getPanelCount() { |
... | ... | |
80 | 80 |
case 1: |
81 | 81 |
return selectPkPanel; |
82 | 82 |
case 2: |
83 |
return connectionPanel;
|
|
83 |
return jdbcConnectionPanel;
|
|
84 | 84 |
} |
85 | 85 |
return null; |
86 | 86 |
} |
87 | 87 |
|
88 | 88 |
public ExporttoService createExporttoService() { |
89 | 89 |
ConnectionSettings connectionSettings = |
90 |
connectionPanel.getConnectionSettings();
|
|
90 |
jdbcConnectionPanel.getConnectionSettings();
|
|
91 | 91 |
|
92 | 92 |
int port = -1; |
93 | 93 |
if (connectionSettings.getPort() != null |
branches/v2_0_0_prep/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.jdbc/src/main/java/org/gvsig/exportto/swing/prov/jdbc/panel/ConnectionPanel.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.exportto.swing.prov.jdbc.panel; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.Iterator; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import org.slf4j.Logger; |
|
30 |
import org.slf4j.LoggerFactory; |
|
31 |
|
|
32 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
|
33 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
34 |
import org.gvsig.exportto.swing.spi.ExporttoPanelValidationException; |
|
35 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderPanel; |
|
36 |
import org.gvsig.fmap.dal.DALLocator; |
|
37 |
import org.gvsig.fmap.dal.DataManager; |
|
38 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
39 |
import org.gvsig.fmap.dal.exception.DataException; |
|
40 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorerParameters; |
|
41 |
import org.gvsig.geodb.vectorialdb.ConnectionSettings; |
|
42 |
|
|
43 |
/** |
|
44 |
* @author gvSIG Team |
|
45 |
* @version $Id$ |
|
46 |
* |
|
47 |
*/ |
|
48 |
public class ConnectionPanel extends ExporttoSwingProviderPanel { |
|
49 |
|
|
50 |
private static final long serialVersionUID = -3278172717881233447L; |
|
51 |
|
|
52 |
private static final Logger LOG = LoggerFactory |
|
53 |
.getLogger(ConnectionPanel.class); |
|
54 |
|
|
55 |
private static final DataManager DATA_MANAGER = DALLocator.getDataManager(); |
|
56 |
private static final ExporttoSwingManager EXPORTTO_SWING_MANAGER = |
|
57 |
ExporttoSwingLocator.getSwingManager(); |
|
58 |
|
|
59 |
private org.gvsig.geodb.vectorialdb.ConnectionPanel connectionPanel = null; |
|
60 |
|
|
61 |
public ConnectionPanel() { |
|
62 |
super(); |
|
63 |
initializeComponents(); |
|
64 |
} |
|
65 |
|
|
66 |
private void initializeComponents() { |
|
67 |
this.setLayout(new BorderLayout()); |
|
68 |
connectionPanel = new org.gvsig.geodb.vectorialdb.ConnectionPanel(); |
|
69 |
add(connectionPanel, BorderLayout.CENTER); |
|
70 |
initialiceExplorers(); |
|
71 |
} |
|
72 |
|
|
73 |
@SuppressWarnings("rawtypes") |
|
74 |
private void initialiceExplorers() { |
|
75 |
List explorers = DATA_MANAGER.getExplorerProviders(); |
|
76 |
Iterator iter = explorers.iterator(); |
|
77 |
DataServerExplorerParameters exParam = null; |
|
78 |
String name; |
|
79 |
List<String> dbExplores = new ArrayList<String>(explorers.size()); |
|
80 |
while (iter.hasNext()) { |
|
81 |
name = (String) iter.next(); |
|
82 |
try { |
|
83 |
exParam = DATA_MANAGER.createServerExplorerParameters(name); |
|
84 |
} catch (DataException e) { |
|
85 |
LOG.error("Error initilializing the explorer", e); |
|
86 |
} |
|
87 |
if (exParam instanceof DBServerExplorerParameters) { |
|
88 |
dbExplores.add(name); |
|
89 |
} |
|
90 |
} |
|
91 |
|
|
92 |
connectionPanel.setDrivers(dbExplores.toArray(new String[dbExplores |
|
93 |
.size()])); |
|
94 |
} |
|
95 |
|
|
96 |
@Override |
|
97 |
public String getPanelTitle() { |
|
98 |
return EXPORTTO_SWING_MANAGER.getTranslation("connection_params"); |
|
99 |
} |
|
100 |
|
|
101 |
@Override |
|
102 |
public boolean isValidPanel() throws ExporttoPanelValidationException { |
|
103 |
// ConnectionSettings connectionSettings = getConnectionSettings(); |
|
104 |
// Check parameters... |
|
105 |
return true; |
|
106 |
} |
|
107 |
|
|
108 |
public ConnectionSettings getConnectionSettings() { |
|
109 |
return connectionPanel.getConnectionSettings(); |
|
110 |
} |
|
111 |
|
|
112 |
} |
branches/v2_0_0_prep/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.jdbc/src/main/java/org/gvsig/exportto/swing/prov/jdbc/panel/JDBCConnectionPanel.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.exportto.swing.prov.jdbc.panel; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.Iterator; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import org.slf4j.Logger; |
|
30 |
import org.slf4j.LoggerFactory; |
|
31 |
|
|
32 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
|
33 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
34 |
import org.gvsig.exportto.swing.spi.ExporttoPanelValidationException; |
|
35 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderPanel; |
|
36 |
import org.gvsig.fmap.dal.DALLocator; |
|
37 |
import org.gvsig.fmap.dal.DataManager; |
|
38 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
39 |
import org.gvsig.fmap.dal.exception.DataException; |
|
40 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorerParameters; |
|
41 |
import org.gvsig.geodb.vectorialdb.ConnectionPanel; |
|
42 |
import org.gvsig.geodb.vectorialdb.ConnectionSettings; |
|
43 |
|
|
44 |
/** |
|
45 |
* @author gvSIG Team |
|
46 |
* @version $Id$ |
|
47 |
* |
|
48 |
*/ |
|
49 |
public class JDBCConnectionPanel extends ExporttoSwingProviderPanel { |
|
50 |
|
|
51 |
private static final long serialVersionUID = -3278172717881233447L; |
|
52 |
|
|
53 |
private static final Logger LOG = LoggerFactory |
|
54 |
.getLogger(JDBCConnectionPanel.class); |
|
55 |
|
|
56 |
private static final DataManager DATA_MANAGER = DALLocator.getDataManager(); |
|
57 |
private static final ExporttoSwingManager EXPORTTO_SWING_MANAGER = |
|
58 |
ExporttoSwingLocator.getSwingManager(); |
|
59 |
|
|
60 |
private org.gvsig.geodb.vectorialdb.ConnectionPanel connectionPanel = null; |
|
61 |
|
|
62 |
public JDBCConnectionPanel() { |
|
63 |
super(); |
|
64 |
initializeComponents(); |
|
65 |
} |
|
66 |
|
|
67 |
private void initializeComponents() { |
|
68 |
this.setLayout(new BorderLayout()); |
|
69 |
connectionPanel = new ConnectionPanel(); |
|
70 |
add(connectionPanel, BorderLayout.CENTER); |
|
71 |
initialiceExplorers(); |
|
72 |
} |
|
73 |
|
|
74 |
@SuppressWarnings("rawtypes") |
|
75 |
private void initialiceExplorers() { |
|
76 |
List explorers = DATA_MANAGER.getExplorerProviders(); |
|
77 |
Iterator iter = explorers.iterator(); |
|
78 |
DataServerExplorerParameters exParam = null; |
|
79 |
String name; |
|
80 |
List<String> dbExplores = new ArrayList<String>(explorers.size()); |
|
81 |
while (iter.hasNext()) { |
|
82 |
name = (String) iter.next(); |
|
83 |
try { |
|
84 |
exParam = DATA_MANAGER.createServerExplorerParameters(name); |
|
85 |
} catch (DataException e) { |
|
86 |
LOG.error("Error initilializing the explorer", e); |
|
87 |
} |
|
88 |
if (exParam instanceof DBServerExplorerParameters) { |
|
89 |
dbExplores.add(name); |
|
90 |
} |
|
91 |
} |
|
92 |
|
|
93 |
connectionPanel.setDrivers(dbExplores.toArray(new String[dbExplores |
|
94 |
.size()])); |
|
95 |
} |
|
96 |
|
|
97 |
@Override |
|
98 |
public String getPanelTitle() { |
|
99 |
return EXPORTTO_SWING_MANAGER.getTranslation("connection_params"); |
|
100 |
} |
|
101 |
|
|
102 |
@Override |
|
103 |
public boolean isValidPanel() throws ExporttoPanelValidationException { |
|
104 |
// ConnectionSettings connectionSettings = getConnectionSettings(); |
|
105 |
// Check parameters... |
|
106 |
return true; |
|
107 |
} |
|
108 |
|
|
109 |
public ConnectionSettings getConnectionSettings() { |
|
110 |
return connectionPanel.getConnectionSettings(); |
|
111 |
} |
|
112 |
|
|
113 |
} |
|
0 | 114 |
branches/v2_0_0_prep/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.jdbc/pom.xml | ||
---|---|---|
77 | 77 |
<artifactId>org.gvsig.fmap.dal.db</artifactId> |
78 | 78 |
<classifier>store.jdbc</classifier> |
79 | 79 |
<scope>compile</scope> |
80 |
</dependency> |
|
80 |
</dependency> |
|
81 |
|
|
82 |
<!-- |
|
81 | 83 |
<dependency> |
82 | 84 |
<groupId>org.gvsig</groupId> |
83 | 85 |
<artifactId>org.gvsig.geodb</artifactId> |
84 | 86 |
<scope>compile</scope> |
85 | 87 |
</dependency> |
88 |
--> |
|
89 |
|
|
86 | 90 |
<dependency> |
87 | 91 |
<groupId>org.gvsig</groupId> |
88 | 92 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/postgresql/PostgreSQLHelper.java | ||
---|---|---|
694 | 694 |
} |
695 | 695 |
strb.append(table); |
696 | 696 |
strb.append("', '"); |
697 |
strb.append(attr.getName()); |
|
697 |
strb.append(attr.getName().toLowerCase());
|
|
698 | 698 |
strb.append("', "); |
699 | 699 |
// strb.append("-1"); |
700 | 700 |
strb.append(getProviderSRID(attr.getSRS())); |
701 | 701 |
strb.append(", '"); |
702 |
|
|
703 |
// =========================================================================== |
|
704 |
// TODO Improve this. Keep in mind that MULTIPOLYGON will not accept POLYGON |
|
705 |
strb.append("GEOMETRY"); |
|
706 |
/* |
|
702 | 707 |
strb.append(getPostgisGeomType(attr.getGeometryType(), attr |
703 | 708 |
.getGeometrySubType())); |
709 |
*/ |
|
710 |
// =========================================================================== |
|
704 | 711 |
strb.append("', "); |
705 | 712 |
strb.append(getPostgisGeomDimensions(attr.getGeometrySubType())); |
706 | 713 |
strb.append(")"); |
branches/v2_0_0_prep/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/config.xml | ||
---|---|---|
2 | 2 |
<plugin-config> |
3 | 3 |
<depends plugin-name="org.gvsig.app" /> |
4 | 4 |
<depends plugin-name="org.gvsig.app.document.table.app.mainplugin" /> |
5 |
<depends plugin-name="org.gvsig.geodb" /> |
|
6 |
|
|
5 | 7 |
<resourceBundle name="text"/> |
6 | 8 |
<libraries library-dir="lib"/> |
7 | 9 |
<extensions> |
Also available in: Unified diff