Revision 338
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
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 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.catalog</artifactId> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
|
|
10 |
<version>2.0.55</version> |
|
11 |
|
|
12 |
<description>Web Catalog Service support</description> |
|
13 |
|
|
14 |
<parent> |
|
15 |
<groupId>org.gvsig</groupId> |
|
16 |
<artifactId>org.gvsig.desktop</artifactId> |
|
17 |
<version>2.0.202</version> |
|
18 |
</parent> |
|
19 |
|
|
20 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-catalog</url> |
|
21 |
<scm> |
|
22 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-catalog/org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55</connection> |
|
23 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-catalog/org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55</developerConnection> |
|
24 |
<url>scm:svn:https://devel.gvsig.org/svn/gvsig-catalog/org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55</url> |
|
25 |
</scm> |
|
26 |
<repositories> |
|
27 |
<repository> |
|
28 |
<id>gvsig-public-http-repository</id> |
|
29 |
<name>gvSIG maven public HTTP repository</name> |
|
30 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
31 |
<releases> |
|
32 |
<enabled>true</enabled> |
|
33 |
<updatePolicy>daily</updatePolicy> |
|
34 |
<checksumPolicy>warn</checksumPolicy> |
|
35 |
</releases> |
|
36 |
<snapshots> |
|
37 |
<enabled>true</enabled> |
|
38 |
<updatePolicy>daily</updatePolicy> |
|
39 |
<checksumPolicy>warn</checksumPolicy> |
|
40 |
</snapshots> |
|
41 |
</repository> |
|
42 |
</repositories> |
|
43 |
<properties> |
|
44 |
<org.gvsig.raster.wcs.app.wcsclient.version>2.2.59</org.gvsig.raster.wcs.app.wcsclient.version> |
|
45 |
<org.gvsig.raster.wcs.io.version>2.2.59</org.gvsig.raster.wcs.io.version> |
|
46 |
</properties> |
|
47 |
<dependencyManagement> |
|
48 |
<dependencies> |
|
49 |
<dependency> |
|
50 |
<groupId>org.gvsig</groupId> |
|
51 |
<artifactId>org.gvsig.raster.wcs.app.wcsclient</artifactId> |
|
52 |
<version>${org.gvsig.raster.wcs.app.wcsclient.version}</version> |
|
53 |
<scope>compile</scope> |
|
54 |
</dependency> |
|
55 |
<dependency> |
|
56 |
<groupId>org.gvsig</groupId> |
|
57 |
<artifactId>org.gvsig.raster.wcs.io</artifactId> |
|
58 |
<version>${org.gvsig.raster.wcs.io.version}</version> |
|
59 |
<scope>compile</scope> |
|
60 |
</dependency> |
|
61 |
</dependencies> |
|
62 |
</dependencyManagement> |
|
63 |
|
|
64 |
<build> |
|
65 |
<plugins> |
|
66 |
<plugin> |
|
67 |
<groupId>org.apache.maven.plugins</groupId> |
|
68 |
<artifactId>maven-release-plugin</artifactId> |
|
69 |
<configuration> |
|
70 |
<tagBase>https://devel.gvsig.org/svn/gvsig-catalog/org.gvsig.catalog/tags</tagBase> |
|
71 |
</configuration> |
|
72 |
</plugin> |
|
73 |
</plugins> |
|
74 |
</build> |
|
75 |
|
|
76 |
<modules> |
|
77 |
<module>org.gvsig.catalog.extension</module> |
|
78 |
<module>org.gvsig.catalog.lib</module> |
|
79 |
</modules> |
|
80 |
|
|
81 |
</project> |
|
0 | 82 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
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 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.catalog.lib</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
|
|
10 |
<description>Web Catalog Service library (geodata search)</description> |
|
11 |
|
|
12 |
<parent> |
|
13 |
<groupId>org.gvsig</groupId> |
|
14 |
<artifactId>org.gvsig.catalog</artifactId> |
|
15 |
<version>2.0.55</version> |
|
16 |
</parent> |
|
17 |
|
|
18 |
<dependencies> |
|
19 |
|
|
20 |
<dependency> |
|
21 |
<groupId>org.slf4j</groupId> |
|
22 |
<artifactId>slf4j-api</artifactId> |
|
23 |
<scope>compile</scope> |
|
24 |
</dependency> |
|
25 |
<dependency> |
|
26 |
<groupId>org.gvsig</groupId> |
|
27 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
28 |
<scope>compile</scope> |
|
29 |
</dependency> |
|
30 |
<dependency> |
|
31 |
<groupId>org.gvsig</groupId> |
|
32 |
<artifactId>org.gvsig.compat.api</artifactId> |
|
33 |
<scope>compile</scope> |
|
34 |
</dependency> |
|
35 |
<dependency> |
|
36 |
<groupId>org.gvsig</groupId> |
|
37 |
<artifactId>org.gvsig.i18n</artifactId> |
|
38 |
<scope>compile</scope> |
|
39 |
</dependency> |
|
40 |
<dependency> |
|
41 |
<groupId>org.gvsig</groupId> |
|
42 |
<artifactId>org.gvsig.utils</artifactId> |
|
43 |
<scope>compile</scope> |
|
44 |
</dependency> |
|
45 |
<dependency> |
|
46 |
<groupId>org.gvsig</groupId> |
|
47 |
<artifactId>org.gvsig.remoteclient</artifactId> |
|
48 |
<scope>compile</scope> |
|
49 |
</dependency> |
|
50 |
<dependency> |
|
51 |
<groupId>com.vividsolutions</groupId> |
|
52 |
<artifactId>jts</artifactId> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>xerces</groupId> |
|
56 |
<artifactId>xercesImpl</artifactId> |
|
57 |
<scope>compile</scope> |
|
58 |
</dependency> |
|
59 |
<dependency> |
|
60 |
<groupId>org.dspace</groupId> |
|
61 |
<artifactId>cql-java</artifactId> |
|
62 |
</dependency> |
|
63 |
<dependency> |
|
64 |
<groupId>jdom</groupId> |
|
65 |
<artifactId>jdom</artifactId> |
|
66 |
</dependency> |
|
67 |
<dependency> |
|
68 |
<groupId>commons-beanutils</groupId> |
|
69 |
<artifactId>commons-beanutils</artifactId> |
|
70 |
<scope>compile</scope> |
|
71 |
</dependency> |
|
72 |
<dependency> |
|
73 |
<groupId>commons-httpclient</groupId> |
|
74 |
<artifactId>commons-httpclient</artifactId> |
|
75 |
<scope>compile</scope> |
|
76 |
</dependency> |
|
77 |
<dependency> |
|
78 |
<groupId>soap</groupId> |
|
79 |
<artifactId>soap</artifactId> |
|
80 |
<scope>compile</scope> |
|
81 |
</dependency> |
|
82 |
<dependency> |
|
83 |
<groupId>org.jzkit</groupId> |
|
84 |
<artifactId>jzkit2-core</artifactId> |
|
85 |
<scope>compile</scope> |
|
86 |
</dependency> |
|
87 |
<dependency> |
|
88 |
<groupId>org.jzkit</groupId> |
|
89 |
<artifactId>jzkit2-z3950</artifactId> |
|
90 |
<scope>compile</scope> |
|
91 |
</dependency> |
|
92 |
<dependency> |
|
93 |
<groupId>org.jzkit</groupId> |
|
94 |
<artifactId>jzkit2-origin</artifactId> |
|
95 |
</dependency> |
|
96 |
<dependency> |
|
97 |
<groupId>org.jzkit</groupId> |
|
98 |
<artifactId>a2j-runtime</artifactId> |
|
99 |
</dependency> |
|
100 |
<dependency> |
|
101 |
<groupId>org.jzkit</groupId> |
|
102 |
<artifactId>a2j</artifactId> |
|
103 |
<scope>compile</scope> |
|
104 |
</dependency> |
|
105 |
<dependency> |
|
106 |
<groupId>org.springframework</groupId> |
|
107 |
<artifactId>spring</artifactId> |
|
108 |
<scope>compile</scope> |
|
109 |
</dependency> |
|
110 |
<dependency> |
|
111 |
<groupId>net.swing</groupId> |
|
112 |
<artifactId>amic-util</artifactId> |
|
113 |
<scope>compile</scope> |
|
114 |
</dependency> |
|
115 |
|
|
116 |
</dependencies> |
|
117 |
|
|
118 |
<build> |
|
119 |
|
|
120 |
<!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION --> |
|
121 |
<plugins> |
|
122 |
<plugin> |
|
123 |
<groupId>org.apache.maven.plugins</groupId> |
|
124 |
<artifactId>maven-surefire-plugin</artifactId> |
|
125 |
<configuration> |
|
126 |
<skipTests>true</skipTests> |
|
127 |
</configuration> |
|
128 |
</plugin> |
|
129 |
</plugins> |
|
130 |
|
|
131 |
</build> |
|
132 |
|
|
133 |
</project> |
|
0 | 134 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/test/java/org/gvsig/catalog/catalog/drivers/ExampleNewPanel.java | ||
---|---|---|
1 |
package org.gvsig.catalog.catalog.drivers; |
|
2 |
|
|
3 |
import java.util.Properties; |
|
4 |
|
|
5 |
import javax.swing.JLabel; |
|
6 |
import javax.swing.JTextField; |
|
7 |
|
|
8 |
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel; |
|
9 |
|
|
10 |
|
|
11 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
12 |
* |
|
13 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
14 |
* |
|
15 |
* This program is free software; you can redistribute it and/or |
|
16 |
* modify it under the terms of the GNU General Public License |
|
17 |
* as published by the Free Software Foundation; either version 2 |
|
18 |
* of the License, or (at your option) any later version. |
|
19 |
* |
|
20 |
* This program is distributed in the hope that it will be useful, |
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
23 |
* GNU General Public License for more details. |
|
24 |
* |
|
25 |
* You should have received a copy of the GNU General Public License |
|
26 |
* along with this program; if not, write to the Free Software |
|
27 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
28 |
* |
|
29 |
* For more information, contact: |
|
30 |
* |
|
31 |
* Generalitat Valenciana |
|
32 |
* Conselleria d'Infraestructures i Transport |
|
33 |
* Av. Blasco Ib??ez, 50 |
|
34 |
* 46010 VALENCIA |
|
35 |
* SPAIN |
|
36 |
* |
|
37 |
* +34 963862235 |
|
38 |
* gvsig@gva.es |
|
39 |
* www.gvsig.gva.es |
|
40 |
* |
|
41 |
* or |
|
42 |
* |
|
43 |
* IVER T.I. S.A |
|
44 |
* Salamanca 50 |
|
45 |
* 46005 Valencia |
|
46 |
* Spain |
|
47 |
* |
|
48 |
* +34 963163400 |
|
49 |
* dac@iver.es |
|
50 |
*/ |
|
51 |
/* CVS MESSAGES: |
|
52 |
* |
|
53 |
* $Id: ExampleNewPanel.java 537 2007-07-26 11:21:10Z jpiera $ |
|
54 |
* $Log$ |
|
55 |
* Revision 1.1.2.1 2007/07/13 12:00:35 jorpiell |
|
56 |
* Add the posibility to add a new panel |
|
57 |
* |
|
58 |
* |
|
59 |
*/ |
|
60 |
/** |
|
61 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
62 |
*/ |
|
63 |
public class ExampleNewPanel extends SearchAditionalPropertiesPanel{ |
|
64 |
JLabel label = null; |
|
65 |
JTextField text = null; |
|
66 |
|
|
67 |
public ExampleNewPanel(){ |
|
68 |
label = new JLabel(); |
|
69 |
text = new JTextField(); |
|
70 |
setLayout(new java.awt.BorderLayout()); |
|
71 |
label.setText("Label"); |
|
72 |
add(label, java.awt.BorderLayout.WEST); |
|
73 |
add(text, java.awt.BorderLayout.CENTER); |
|
74 |
} |
|
75 |
|
|
76 |
/* |
|
77 |
* (non-Javadoc) |
|
78 |
* @see es.gva.cit.gazetteer.ui.search.SearchAditionalPropertiesPanel#getProperties() |
|
79 |
*/ |
|
80 |
public Properties getProperties() { |
|
81 |
Properties properties = new Properties(); |
|
82 |
properties.put("PROP1", text.getText()); |
|
83 |
return properties; |
|
84 |
} |
|
85 |
|
|
86 |
} |
|
0 | 87 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/test/java/org/gvsig/catalog/catalog/drivers/ExampleNewDriver.java | ||
---|---|---|
1 |
package org.gvsig.catalog.catalog.drivers; |
|
2 |
|
|
3 |
import java.net.URI; |
|
4 |
|
|
5 |
import org.gvsig.catalog.CatalogLocator; |
|
6 |
import org.gvsig.catalog.CatalogManager; |
|
7 |
import org.gvsig.catalog.drivers.AbstractCatalogServiceDriver; |
|
8 |
import org.gvsig.catalog.drivers.CatalogCapabilities; |
|
9 |
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities; |
|
10 |
import org.gvsig.catalog.drivers.GetRecordsReply; |
|
11 |
import org.gvsig.catalog.querys.CatalogQuery; |
|
12 |
import org.gvsig.catalog.schemas.Record; |
|
13 |
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel; |
|
14 |
|
|
15 |
|
|
16 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
17 |
* |
|
18 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
19 |
* |
|
20 |
* This program is free software; you can redistribute it and/or |
|
21 |
* modify it under the terms of the GNU General Public License |
|
22 |
* as published by the Free Software Foundation; either version 2 |
|
23 |
* of the License, or (at your option) any later version. |
|
24 |
* |
|
25 |
* This program is distributed in the hope that it will be useful, |
|
26 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
27 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
28 |
* GNU General Public License for more details. |
|
29 |
* |
|
30 |
* You should have received a copy of the GNU General Public License |
|
31 |
* along with this program; if not, write to the Free Software |
|
32 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
33 |
* |
|
34 |
* For more information, contact: |
|
35 |
* |
|
36 |
* Generalitat Valenciana |
|
37 |
* Conselleria d'Infraestructures i Transport |
|
38 |
* Av. Blasco Ib??ez, 50 |
|
39 |
* 46010 VALENCIA |
|
40 |
* SPAIN |
|
41 |
* |
|
42 |
* +34 963862235 |
|
43 |
* gvsig@gva.es |
|
44 |
* www.gvsig.gva.es |
|
45 |
* |
|
46 |
* or |
|
47 |
* |
|
48 |
* IVER T.I. S.A |
|
49 |
* Salamanca 50 |
|
50 |
* 46005 Valencia |
|
51 |
* Spain |
|
52 |
* |
|
53 |
* +34 963163400 |
|
54 |
* dac@iver.es |
|
55 |
*/ |
|
56 |
/* CVS MESSAGES: |
|
57 |
* |
|
58 |
* $Id: ExampleNewDriver.java 537 2007-07-26 11:21:10Z jpiera $ |
|
59 |
* $Log$ |
|
60 |
* Revision 1.1.2.1 2007/07/13 12:00:35 jorpiell |
|
61 |
* Add the posibility to add a new panel |
|
62 |
* |
|
63 |
* |
|
64 |
*/ |
|
65 |
/** |
|
66 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
67 |
*/ |
|
68 |
public class ExampleNewDriver extends AbstractCatalogServiceDriver { |
|
69 |
private static final CatalogManager catalogManager = CatalogLocator.getCatalogManager(); |
|
70 |
|
|
71 |
/* |
|
72 |
* (non-Javadoc) |
|
73 |
* @see es.gva.cit.catalogClient.drivers.IDiscoveryServiceDriver#getCapabilities(java.net.URI) |
|
74 |
*/ |
|
75 |
public DiscoveryServiceCapabilities getCapabilities(URI uri) { |
|
76 |
return new CatalogCapabilities(); |
|
77 |
} |
|
78 |
|
|
79 |
/* |
|
80 |
* (non-Javadoc) |
|
81 |
* @see es.gva.cit.catalog.drivers.ICatalogServiceDriver#getRecords(java.net.URI, es.gva.cit.catalog.querys.CatalogQuery, int) |
|
82 |
*/ |
|
83 |
public GetRecordsReply getRecords(URI uri, CatalogQuery query, |
|
84 |
int firstRecord) { |
|
85 |
GetRecordsReply reply = new GetRecordsReply(1); |
|
86 |
Record record = catalogManager.createRecord(uri, null); |
|
87 |
record.setTitle("Record example"); |
|
88 |
record.setAbstract_("Just for testing"); |
|
89 |
reply.addRecord(record); |
|
90 |
return reply; |
|
91 |
} |
|
92 |
|
|
93 |
/* |
|
94 |
* (non-Javadoc) |
|
95 |
* @see es.gva.cit.catalog.drivers.IDiscoveryServiceDriver#getServiceName() |
|
96 |
*/ |
|
97 |
public String getServiceName() { |
|
98 |
return "My catalog service"; |
|
99 |
} |
|
100 |
|
|
101 |
/* |
|
102 |
* (non-Javadoc) |
|
103 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#getAditionalSearchPanel() |
|
104 |
*/ |
|
105 |
public SearchAditionalPropertiesPanel getAditionalSearchPanel(){ |
|
106 |
return new ExampleNewPanel(); |
|
107 |
} |
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
} |
|
0 | 113 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/test/java/org/gvsig/catalog/catalog/drivers/ExampleNewDriverTest.java | ||
---|---|---|
1 |
package org.gvsig.catalog.catalog.drivers; |
|
2 |
|
|
3 |
import javax.swing.UIManager; |
|
4 |
import javax.swing.UnsupportedLookAndFeelException; |
|
5 |
|
|
6 |
import org.gvsig.catalog.CatalogLocator; |
|
7 |
import org.gvsig.catalog.ui.serverconnect.ServerConnectDialog; |
|
8 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
9 |
|
|
10 |
|
|
11 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
12 |
* |
|
13 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
14 |
* |
|
15 |
* This program is free software; you can redistribute it and/or |
|
16 |
* modify it under the terms of the GNU General Public License |
|
17 |
* as published by the Free Software Foundation; either version 2 |
|
18 |
* of the License, or (at your option) any later version. |
|
19 |
* |
|
20 |
* This program is distributed in the hope that it will be useful, |
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
23 |
* GNU General Public License for more details. |
|
24 |
* |
|
25 |
* You should have received a copy of the GNU General Public License |
|
26 |
* along with this program; if not, write to the Free Software |
|
27 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
28 |
* |
|
29 |
* For more information, contact: |
|
30 |
* |
|
31 |
* Generalitat Valenciana |
|
32 |
* Conselleria d'Infraestructures i Transport |
|
33 |
* Av. Blasco Ib??ez, 50 |
|
34 |
* 46010 VALENCIA |
|
35 |
* SPAIN |
|
36 |
* |
|
37 |
* +34 963862235 |
|
38 |
* gvsig@gva.es |
|
39 |
* www.gvsig.gva.es |
|
40 |
* |
|
41 |
* or |
|
42 |
* |
|
43 |
* IVER T.I. S.A |
|
44 |
* Salamanca 50 |
|
45 |
* 46005 Valencia |
|
46 |
* Spain |
|
47 |
* |
|
48 |
* +34 963163400 |
|
49 |
* dac@iver.es |
|
50 |
*/ |
|
51 |
/* CVS MESSAGES: |
|
52 |
* |
|
53 |
* $Id: ExampleNewDriverTest.java 512 2007-07-24 11:25:43Z jorpiell $ |
|
54 |
* $Log$ |
|
55 |
* Revision 1.1.2.2 2007/07/24 11:25:42 jorpiell |
|
56 |
* The registers has been refactorized |
|
57 |
* |
|
58 |
* Revision 1.1.2.1 2007/07/13 12:00:35 jorpiell |
|
59 |
* Add the posibility to add a new panel |
|
60 |
* |
|
61 |
* |
|
62 |
*/ |
|
63 |
/** |
|
64 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
65 |
*/ |
|
66 |
public class ExampleNewDriverTest { |
|
67 |
|
|
68 |
/** |
|
69 |
* @param args |
|
70 |
*/ |
|
71 |
public static void main(String[] args) { |
|
72 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
73 |
// DefaultCatalogLibrary library = new DefaultCatalogLibrary(); |
|
74 |
// library.initialize(); |
|
75 |
// library.postInitialize(); |
|
76 |
|
|
77 |
CatalogLocator.getCatalogManager().register("My catalog service", ExampleNewDriver.class); |
|
78 |
//Get the currently installed look and feel |
|
79 |
UIManager.getLookAndFeel(); |
|
80 |
// Install a different look and feel; specifically, the Windows look and feel |
|
81 |
try { |
|
82 |
UIManager.setLookAndFeel( |
|
83 |
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); |
|
84 |
} catch (InstantiationException e) { |
|
85 |
} catch (ClassNotFoundException e) { |
|
86 |
} catch (UnsupportedLookAndFeelException e) { |
|
87 |
} catch (IllegalAccessException e) { |
|
88 |
} |
|
89 |
|
|
90 |
new ServerConnectDialog(); |
|
91 |
} |
|
92 |
|
|
93 |
} |
|
0 | 94 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/test/java/org/gvsig/catalog/catalog/utils/URIUtilsTest.java | ||
---|---|---|
1 |
package org.gvsig.catalog.catalog.utils; |
|
2 |
|
|
3 |
import java.net.URI; |
|
4 |
import java.net.URISyntaxException; |
|
5 |
|
|
6 |
import junit.framework.TestCase; |
|
7 |
|
|
8 |
import org.gvsig.catalog.utils.URIUtils; |
|
9 |
|
|
10 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
11 |
* |
|
12 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
13 |
* |
|
14 |
* This program is free software; you can redistribute it and/or |
|
15 |
* modify it under the terms of the GNU General Public License |
|
16 |
* as published by the Free Software Foundation; either version 2 |
|
17 |
* of the License, or (at your option) any later version. |
|
18 |
* |
|
19 |
* This program is distributed in the hope that it will be useful, |
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
22 |
* GNU General Public License for more details. |
|
23 |
* |
|
24 |
* You should have received a copy of the GNU General Public License |
|
25 |
* along with this program; if not, write to the Free Software |
|
26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
27 |
* |
|
28 |
* For more information, contact: |
|
29 |
* |
|
30 |
* Generalitat Valenciana |
|
31 |
* Conselleria d'Infraestructures i Transport |
|
32 |
* Av. Blasco Ib??ez, 50 |
|
33 |
* 46010 VALENCIA |
|
34 |
* SPAIN |
|
35 |
* |
|
36 |
* +34 963862235 |
|
37 |
* gvsig@gva.es |
|
38 |
* www.gvsig.gva.es |
|
39 |
* |
|
40 |
* or |
|
41 |
* |
|
42 |
* IVER T.I. S.A |
|
43 |
* Salamanca 50 |
|
44 |
* 46005 Valencia |
|
45 |
* Spain |
|
46 |
* |
|
47 |
* +34 963163400 |
|
48 |
* dac@iver.es |
|
49 |
*/ |
|
50 |
/* CVS MESSAGES: |
|
51 |
* |
|
52 |
* $Id: URIUtilsTest.java,v 1.1.2.1 2007/07/10 11:18:04 jorpiell Exp $ |
|
53 |
* $Log: URIUtilsTest.java,v $ |
|
54 |
* Revision 1.1.2.1 2007/07/10 11:18:04 jorpiell |
|
55 |
* Added the registers |
|
56 |
* |
|
57 |
* |
|
58 |
*/ |
|
59 |
/** |
|
60 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
61 |
*/ |
|
62 |
public class URIUtilsTest extends TestCase { |
|
63 |
|
|
64 |
public void test1() throws URISyntaxException{ |
|
65 |
URI uri = URIUtils.createUri("http://www.upv.es", "http", 80); |
|
66 |
assertEquals(uri.getHost(), "www.upv.es"); |
|
67 |
assertEquals(uri.getScheme(), "http"); |
|
68 |
assertEquals(uri.getPort(), 80); |
|
69 |
assertEquals(uri.getPath(), ""); |
|
70 |
} |
|
71 |
|
|
72 |
public void test2() throws URISyntaxException{ |
|
73 |
URI uri = URIUtils.createUri("www.upv.es", "http", 80); |
|
74 |
assertEquals(uri.getHost(), "www.upv.es"); |
|
75 |
assertEquals(uri.getScheme(), "http"); |
|
76 |
assertEquals(uri.getPort(), 80); |
|
77 |
assertEquals(uri.getPath(), ""); |
|
78 |
} |
|
79 |
|
|
80 |
public void test3() throws URISyntaxException{ |
|
81 |
URI uri = URIUtils.createUri("www.upv.es", "z3950", 2100); |
|
82 |
assertEquals(uri.getHost(), "www.upv.es"); |
|
83 |
assertEquals(uri.getScheme(), "z3950"); |
|
84 |
assertEquals(uri.getPort(), 2100); |
|
85 |
assertEquals(uri.getPath(), ""); |
|
86 |
} |
|
87 |
|
|
88 |
public void test4() throws URISyntaxException{ |
|
89 |
URI uri = URIUtils.createUri("http://193.144.250.29/webservices/services/IDEC_GeoServeisPort", "http", 80); |
|
90 |
assertEquals(uri.getHost(), "193.144.250.29"); |
|
91 |
assertEquals(uri.getScheme(), "http"); |
|
92 |
assertEquals(uri.getPort(), 80); |
|
93 |
assertEquals(uri.getPath(), "/webservices/services/IDEC_GeoServeisPort"); |
|
94 |
} |
|
95 |
} |
|
0 | 96 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/CatalogClient.java | ||
---|---|---|
1 |
|
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
package org.gvsig.catalog; |
|
43 |
|
|
44 |
import org.gvsig.catalog.drivers.AbstractCatalogServiceDriver; |
|
45 |
import org.gvsig.catalog.drivers.GetRecordsReply; |
|
46 |
import org.gvsig.catalog.drivers.ICatalogServiceDriver; |
|
47 |
import org.gvsig.catalog.querys.CatalogQuery; |
|
48 |
import org.gvsig.utils.swing.jcomboServer.ServerData; |
|
49 |
|
|
50 |
/** |
|
51 |
* This class represents a catalogClient. It must be created to |
|
52 |
* use the catalog service |
|
53 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
|
54 |
*/ |
|
55 |
public class CatalogClient extends DiscoveryServiceClient{ |
|
56 |
|
|
57 |
/** |
|
58 |
* Constructor |
|
59 |
* @param sUri |
|
60 |
* The URI typed by the user |
|
61 |
* @param database |
|
62 |
* The selected database |
|
63 |
* @param driver |
|
64 |
* The selected catalog driver |
|
65 |
*/ |
|
66 |
public CatalogClient(String sUri, String database, ICatalogServiceDriver driver) { |
|
67 |
super(sUri,driver); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* @return Node array with the retrieved records |
|
72 |
* @param query It contains the values to do the query (title="XXX",abstract="YYY",...) |
|
73 |
* @param firstRecord Number of the first record to retrieve |
|
74 |
*/ |
|
75 |
public GetRecordsReply getRecords(CatalogQuery query, int firstRecord) { |
|
76 |
return ((ICatalogServiceDriver)getDriver()).getRecords(getUri(),query,firstRecord); |
|
77 |
} |
|
78 |
|
|
79 |
/** |
|
80 |
* This method is used to create a new Query |
|
81 |
* @return |
|
82 |
*/ |
|
83 |
public CatalogQuery createNewQuery() { |
|
84 |
return new CatalogQuery(); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* @return the serverData |
|
89 |
*/ |
|
90 |
public ServerData getServerData() { |
|
91 |
return ((AbstractCatalogServiceDriver)getDriver()).getServerData(); |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* @param serverData the serverData to set |
|
96 |
*/ |
|
97 |
public void setServerData(ServerData serverData) { |
|
98 |
((AbstractCatalogServiceDriver)getDriver()).setServerData(serverData); |
|
99 |
} |
|
100 |
} |
|
0 | 101 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/loaders/LayerLoaderException.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and 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 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package org.gvsig.catalog.loaders; |
|
42 |
|
|
43 |
|
|
44 |
public class LayerLoaderException extends Exception { |
|
45 |
private String windowMessage; |
|
46 |
|
|
47 |
public LayerLoaderException(String message, String windowMessage) { |
|
48 |
super(message); |
|
49 |
this.windowMessage = windowMessage; |
|
50 |
} |
|
51 |
|
|
52 |
public LayerLoaderException(String message, Throwable cause, String windowMessage) { |
|
53 |
super(message, cause); |
|
54 |
this.windowMessage = windowMessage; |
|
55 |
} |
|
56 |
|
|
57 |
public String getWindowMessage() { |
|
58 |
return windowMessage; |
|
59 |
} |
|
60 |
|
|
61 |
} |
|
0 | 62 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/loaders/LayerLoader.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 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 {Iver T.I.} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.catalog.loaders; |
|
29 |
|
|
30 |
import org.gvsig.catalog.schemas.Resource; |
|
31 |
|
|
32 |
/** |
|
33 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
34 |
*/ |
|
35 |
public abstract class LayerLoader { |
|
36 |
private Resource resource = null; |
|
37 |
|
|
38 |
public LayerLoader(Resource resource){ |
|
39 |
this.resource = resource; |
|
40 |
} |
|
41 |
|
|
42 |
abstract public void loadLayer() throws LayerLoaderException; |
|
43 |
|
|
44 |
/** |
|
45 |
* It returns the error message |
|
46 |
* @return |
|
47 |
* Error Message |
|
48 |
*/ |
|
49 |
abstract protected String getErrorMessage(); |
|
50 |
|
|
51 |
/** |
|
52 |
* It returns the window title for an window error message |
|
53 |
* @return |
|
54 |
* Window title |
|
55 |
*/ |
|
56 |
abstract protected String getWindowMessage(); |
|
57 |
|
|
58 |
public Resource getResource() { |
|
59 |
return resource; |
|
60 |
} |
|
61 |
|
|
62 |
public void setResource(Resource resource) { |
|
63 |
this.resource = resource; |
|
64 |
} |
|
65 |
} |
|
0 | 66 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/z3950/drivers/Z3950CatalogServiceDriver.java | ||
---|---|---|
1 |
|
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
package org.gvsig.catalog.z3950.drivers; |
|
43 |
import java.io.ByteArrayInputStream; |
|
44 |
import java.net.URI; |
|
45 |
import java.util.ArrayList; |
|
46 |
import java.util.Collection; |
|
47 |
|
|
48 |
import org.gvsig.catalog.drivers.AbstractCatalogServiceDriver; |
|
49 |
import org.gvsig.catalog.drivers.CatalogCapabilities; |
|
50 |
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities; |
|
51 |
import org.gvsig.catalog.drivers.GetRecordsReply; |
|
52 |
import org.gvsig.catalog.metadataxml.XMLNode; |
|
53 |
import org.gvsig.catalog.metadataxml.XMLTree; |
|
54 |
import org.gvsig.catalog.protocols.Z3950Protocol; |
|
55 |
import org.gvsig.catalog.querys.CatalogQuery; |
|
56 |
import org.gvsig.utils.swing.jcomboServer.ServerData; |
|
57 |
|
|
58 |
/** |
|
59 |
* This class implements the Z39.50 protocol. |
|
60 |
* |
|
61 |
* |
|
62 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
|
63 |
* @see http://www.loc.gov/z3950/agency/ |
|
64 |
*/ |
|
65 |
public class Z3950CatalogServiceDriver extends AbstractCatalogServiceDriver { |
|
66 |
|
|
67 |
/* |
|
68 |
* (non-Javadoc) |
|
69 |
* @see es.gva.cit.catalogClient.drivers.IDiscoveryServiceDriver#getCapabilities(java.net.URI) |
|
70 |
*/ |
|
71 |
public DiscoveryServiceCapabilities getCapabilities(URI uri) { |
|
72 |
Collection nodes = new ArrayList();; |
|
73 |
Z3950Messages messages = new Z3950Messages(this); |
|
74 |
String message = messages.getCapabilities(new Z3950Protocol().openConnection( |
|
75 |
uri)); |
|
76 |
ByteArrayInputStream buffer = new ByteArrayInputStream(message.getBytes()); |
|
77 |
nodes.add(XMLTree.xmlToTree(buffer)); |
|
78 |
|
|
79 |
setServerAnswerReady(XMLTree.searchNodeValue((XMLNode)nodes.toArray()[0], "Servidor")); |
|
80 |
CatalogCapabilities capabilities = new CatalogCapabilities(); |
|
81 |
capabilities.setVersion("3.0"); |
|
82 |
return capabilities; |
|
83 |
} |
|
84 |
|
|
85 |
/* |
|
86 |
* (non-Javadoc) |
|
87 |
* @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getRecords(java.net.URI, es.gva.cit.catalogClient.querys.Query, int) |
|
88 |
*/ |
|
89 |
public GetRecordsReply getRecords(URI uri, CatalogQuery query, int firstRecord) { |
|
90 |
setQuery(query); |
|
91 |
Z3950Messages messages = new Z3950Messages(this); |
|
92 |
String message = messages.getRecords(getQuery(),Z3950Protocol.getDatabase(uri)); |
|
93 |
System.out.println(message); |
|
94 |
new Z3950Protocol().doQuery(getRecordsReply(), uri, message, firstRecord); |
|
95 |
return getRecordsReply(); |
|
96 |
} |
|
97 |
|
|
98 |
/* |
|
99 |
* (non-Javadoc) |
|
100 |
* @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#isProtocolSupported(java.net.URI) |
|
101 |
*/ |
|
102 |
public boolean isProtocolSupported(URI uri) { |
|
103 |
return new Z3950Protocol().isProtocolSupported(uri); |
|
104 |
} |
|
105 |
|
|
106 |
/** |
|
107 |
* @return |
|
108 |
*/ |
|
109 |
public String getQueryProfile() { |
|
110 |
return "Z3950"; |
|
111 |
} |
|
112 |
|
|
113 |
/* |
|
114 |
* (non-Javadoc) |
|
115 |
* @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getServiceName() |
|
116 |
*/ |
|
117 |
public String getServiceName() { |
|
118 |
return ServerData.SERVER_SUBTYPE_CATALOG_Z3950; |
|
119 |
} |
|
120 |
|
|
121 |
/* |
|
122 |
* (non-Javadoc) |
|
123 |
* @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getDefaultPort() |
|
124 |
*/ |
|
125 |
public int getDefaultPort() { |
|
126 |
return 2100; |
|
127 |
} |
|
128 |
|
|
129 |
/* |
|
130 |
* (non-Javadoc) |
|
131 |
* @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getDefaultSchema() |
|
132 |
*/ |
|
133 |
public String getDefaultSchema() { |
|
134 |
return "z3950"; |
|
135 |
} |
|
136 |
} |
|
0 | 137 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/z3950/drivers/Z3950Messages.java | ||
---|---|---|
1 |
|
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
/* |
|
43 |
* CVS MESSAGES: |
|
44 |
* |
|
45 |
* $Id: Z3950Messages.java 585 2007-09-03 10:21:55 +0000 (Mon, 03 Sep 2007) jpiera $ |
|
46 |
* $Log$ |
|
47 |
* Revision 1.4.10.2 2006/11/15 00:08:08 jjdelcerro |
|
48 |
* *** empty log message *** |
|
49 |
* |
|
50 |
* Revision 1.6 2006/10/02 08:29:07 jorpiell |
|
51 |
* Modificados los cambios del Branch 10 al head |
|
52 |
* |
|
53 |
* Revision 1.4.10.1 2006/09/20 12:01:18 jorpiell |
|
54 |
* Se ha cambiado la versi?n de la jzkit, se ha incorporado la funcionalidad de cargar arcims |
|
55 |
* |
|
56 |
* Revision 1.5 2006/09/20 11:22:43 jorpiell |
|
57 |
* Se ha cambiado la versi?n de la librer?a jzkit de la 1 a la 2.0 |
|
58 |
* |
|
59 |
* Revision 1.4 2006/01/12 13:52:24 jorpiell |
|
60 |
* Se ha a?adido un boton close en las dos pantallas de connect. Adem?s se ha cambiado el comportamiento de las ventanas para adaptarlo a la nueva forma de buscar multihilo |
|
61 |
* |
|
62 |
* Revision 1.3 2006/01/10 17:23:23 jorpiell |
|
63 |
* Se ha hecho una peque?a modificaci?n en el gazeteer: ahora funcionan las b?squedas restringiendo el ?rea en el WFSG. Hay muchos cambios porque se ha hecho un CONTROL+SHIFT+O sobre todo el proyecto para eliminar los imports y para ordenarlos |
|
64 |
* |
|
65 |
* Revision 1.2 2006/01/10 09:32:49 jorpiell |
|
66 |
* Se ha echo un commit de las versiones modificadas del catalogo y del gazetteer usando el Poseidon. Se han renombrado algunas clases por considerar que tenian un nombre confuso y se han cambiado algunas relaciones entre clases (con la intenci?n de separar GUI de la parte de control). Han habido clases que no han sido tocadas, pero como han sido formateadas usando el Poseidon TODAS las CLASES del proyecto han cambiado de versi?n. |
|
67 |
* |
|
68 |
* Revision 1.1 2005/12/22 08:31:43 jorpiell |
|
69 |
* Aqui tambien se han producido muchos cambis, porque hemos acabado de cambiar la estructura del cat?logo: Se han creado todas las clases "XXXMessages", que sacan toda la parte de los mensajes de los drivers. Ademas se ha incluido en "CatalogClient" la operaci?n "getCapabilities", que libera a la interfaz de algunas operaciones que hac?a anteriormente. |
|
70 |
* |
|
71 |
* |
|
72 |
*/ |
|
73 |
package org.gvsig.catalog.z3950.drivers; |
|
74 |
import org.gvsig.catalog.querys.CatalogQuery; |
|
75 |
import org.gvsig.catalog.z3950.filters.Z3950Filter; |
|
76 |
|
|
77 |
/** |
|
78 |
* This class is used to create all the Z3950 protocol |
|
79 |
* messages |
|
80 |
* |
|
81 |
* |
|
82 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
|
83 |
*/ |
|
84 |
public class Z3950Messages { |
|
85 |
/** |
|
86 |
* |
|
87 |
* |
|
88 |
*/ |
|
89 |
private Z3950CatalogServiceDriver driver = null; |
|
90 |
|
|
91 |
/** |
|
92 |
* |
|
93 |
* |
|
94 |
* |
|
95 |
* @param driver |
|
96 |
*/ |
|
97 |
public Z3950Messages(Z3950CatalogServiceDriver driver) { |
|
98 |
this.driver = driver; |
|
99 |
} |
|
100 |
|
|
101 |
/** |
|
102 |
* |
|
103 |
* |
|
104 |
* |
|
105 |
* @return |
|
106 |
* @param message |
|
107 |
*/ |
|
108 |
public String getCapabilities(String message) { |
|
109 |
return "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "<Z3950> " + |
|
110 |
"<Servidor>" + message + "</Servidor>" + "</Z3950>"; |
|
111 |
|
|
112 |
} |
|
113 |
|
|
114 |
/** |
|
115 |
* |
|
116 |
* |
|
117 |
* |
|
118 |
* @return |
|
119 |
* @param query |
|
120 |
*/ |
|
121 |
public String getRecords(CatalogQuery query,String database) { |
|
122 |
return new Z3950Filter(database).getQuery(query); |
|
123 |
} |
|
124 |
} |
|
0 | 125 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/z3950/filters/Z3950Filter.java | ||
---|---|---|
1 |
|
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
package org.gvsig.catalog.z3950.filters; |
|
43 |
import org.gvsig.catalog.filters.AbstractFilter; |
|
44 |
import org.gvsig.catalog.languages.BasicEncodingRules; |
|
45 |
import org.gvsig.i18n.Messages; |
|
46 |
|
|
47 |
/** |
|
48 |
* |
|
49 |
* |
|
50 |
* |
|
51 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
|
52 |
*/ |
|
53 |
public class Z3950Filter extends AbstractFilter { |
|
54 |
private String database = null; |
|
55 |
|
|
56 |
public Z3950Filter(String database) { |
|
57 |
super(); |
|
58 |
this.database = database; |
|
59 |
} |
|
60 |
|
|
61 |
|
|
62 |
/* |
|
63 |
* (non-Javadoc) |
|
64 |
* @see es.gva.cit.catalog.filters.IFilter#getQuery(es.gva.cit.catalog.querys.CatalogQuery) |
|
65 |
*/ |
|
66 |
public String getQuery(org.gvsig.catalog.querys.CatalogQuery query) { |
|
67 |
// Create a RemoteBooleanQuery |
|
68 |
BasicEncodingRules filter = new BasicEncodingRules(); |
|
69 |
|
|
70 |
//Title (title, 4), Word List (6) |
|
71 |
if (query.getTitle() != null) { |
|
72 |
filter.addClauses("4", "6", "3", query.getTitle(), |
|
73 |
query.getTitleFilter(),"and"); |
|
74 |
} |
|
75 |
|
|
76 |
|
|
77 |
if (query.isMinimized()){ |
|
78 |
if (query.getAbstract() != null) { |
|
79 |
filter.addClauses("62", "6", "3", query.getAbstract(), "E", "or"); |
|
80 |
} |
|
81 |
}else{ |
|
82 |
if (query.getAbstract() != null) { |
|
83 |
filter.addClauses("62", "6", "3", query.getAbstract(), "E", "and"); |
|
84 |
} |
|
85 |
// Theme Keyword (themekey, 2002), Word List (6) |
|
86 |
if (query.getThemeKey() != null) { |
|
87 |
filter.addClauses("2002", "6", "3", query.getThemeKey(), "Y","and"); |
|
88 |
} |
|
89 |
// Source Scale Denominator (srcscale, 1024), Numeric String (109) |
|
90 |
if (query.getScale() != null) { |
|
91 |
if (query.getMinScale() != null){ |
|
92 |
filter.addClauses("1024", "109", "4", query.getMinScale(),"E","and"); |
|
93 |
} |
|
94 |
if (query.getMaxScale() != null){ |
|
95 |
filter.addClauses("1024", "109", "2", query.getMaxScale(),"E","and"); |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
if (query.getProvider() != null) { |
|
100 |
filter.addClauses("1005", "6", "3", query.getProvider(), "E","and"); |
|
101 |
} |
|
102 |
// Beginning Date (begdate, 1012), Date(210) |
|
103 |
if (query.getDateFrom() != null) { |
|
104 |
filter.addClauses("1012", "210", "18", query.getDateFrom(), "E","and"); |
|
105 |
} |
|
106 |
// Ending Date (date, 1012 ), Date(210) |
|
107 |
if (query.getDateTo() != null) { |
|
108 |
filter.addClauses("1012", "210", "14", query.getDateTo(), "E","and"); |
|
109 |
} |
|
110 |
} |
|
111 |
|
|
112 |
if ((query.getCoordenates() != null) && (query.isCoordinatesClicked())){ |
|
113 |
String sNorth = query.getCoordenates().getUly(); |
|
114 |
String sWest = query.getCoordenates().getUlx(); |
|
115 |
String sSouth = query.getCoordenates().getBry(); |
|
116 |
String sEast = query.getCoordenates().getBrx(); |
|
117 |
String sBounding = sNorth + " " + sWest + " " + sSouth + " " + |
|
118 |
sEast; |
|
119 |
String sRelation = getRelation(query.getCoordenatesFilter()); |
|
120 |
// Bounding Coordinates (bounding, 2060), Coordinate String (201) |
|
121 |
filter.addClauses("2060", "201", sRelation, sBounding, "E","and"); |
|
122 |
} |
|
123 |
//return query |
|
124 |
return filter.toString(database); |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* Return a value for the option of the 'Coordenates Filter' |
|
129 |
* |
|
130 |
* @param relation String in the combo. Possible values: |
|
131 |
* encloses |
|
132 |
* overlaps |
|
133 |
* fullyOutsideOf |
|
134 |
* equals |
|
135 |
* |
|
136 |
* @return String |
|
137 |
* Possible values: |
|
138 |
* 9 -> encloses |
|
139 |
* 7 -> overlaps |
|
140 |
* 10 -> fullyOutsideOf |
|
141 |
* 3 -> equals |
|
142 |
* @param translator |
|
143 |
* @param relacion |
|
144 |
*/ |
|
145 |
private String getRelation(String relacion) { |
|
146 |
if (relacion.equals(Messages.getText("coordinatesEqual"))) { |
|
147 |
return "3"; |
|
148 |
} |
|
149 |
if (relacion.equals(Messages.getText("coordinatesContains"))) { |
|
150 |
return "7"; |
|
151 |
} |
|
152 |
if (relacion.equals(Messages.getText("coordinatesEnclose"))) { |
|
153 |
return "9"; |
|
154 |
} else { |
|
155 |
return "10"; |
|
156 |
} |
|
157 |
} |
|
158 |
} |
|
0 | 159 |
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.55/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/csw/drivers/CSWebRIMCatalogServiceDriver.java | ||
---|---|---|
1 |
package org.gvsig.catalog.csw.drivers; |
|
2 |
|
|
3 |
import java.net.URL; |
|
4 |
|
|
5 |
import org.apache.commons.httpclient.NameValuePair; |
|
6 |
import org.gvsig.catalog.csw.drivers.profiles.CSWebRIMProfile; |
|
7 |
import org.gvsig.catalog.csw.parsers.CSWConstants; |
|
8 |
import org.gvsig.catalog.drivers.profiles.IProfile; |
|
9 |
import org.gvsig.catalog.metadataxml.XMLNode; |
|
10 |
import org.gvsig.catalog.protocols.HTTPGetProtocol; |
|
11 |
|
|
12 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
13 |
* |
|
14 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
15 |
* |
|
16 |
* This program is free software; you can redistribute it and/or |
|
17 |
* modify it under the terms of the GNU General Public License |
|
18 |
* as published by the Free Software Foundation; either version 2 |
|
19 |
* of the License, or (at your option) any later version. |
|
20 |
* |
|
21 |
* This program is distributed in the hope that it will be useful, |
|
22 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
23 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
24 |
* GNU General Public License for more details. |
|
25 |
* |
|
26 |
* You should have received a copy of the GNU General Public License |
|
27 |
* along with this program; if not, write to the Free Software |
|
28 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
29 |
* |
|
30 |
* For more information, contact: |
|
31 |
* |
|
32 |
* Generalitat Valenciana |
|
33 |
* Conselleria d'Infraestructures i Transport |
|
34 |
* Av. Blasco Ib??ez, 50 |
|
35 |
* 46010 VALENCIA |
|
36 |
* SPAIN |
|
37 |
* |
|
38 |
* +34 963862235 |
|
39 |
* gvsig@gva.es |
|
40 |
* www.gvsig.gva.es |
|
41 |
* |
|
42 |
* or |
|
43 |
* |
|
44 |
* IVER T.I. S.A |
|
45 |
* Salamanca 50 |
|
46 |
* 46005 Valencia |
|
47 |
* Spain |
|
48 |
* |
|
49 |
* +34 963163400 |
|
50 |
* dac@iver.es |
|
51 |
*/ |
|
52 |
/* CVS MESSAGES: |
|
53 |
* |
|
54 |
* $Id$ |
|
55 |
* $Log$ |
|
56 |
* |
|
57 |
*/ |
|
58 |
/** |
|
59 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
60 |
*/ |
|
61 |
public class CSWebRIMCatalogServiceDriver extends CSWCatalogServiceDriver{ |
|
62 |
public static String SERVICE_NAME = "CSW/ebRIM"; |
|
63 |
|
|
64 |
/* |
|
65 |
* (non-Javadoc) |
|
66 |
* @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getServiceName() |
|
67 |
*/ |
|
68 |
public String getServiceName() { |
|
69 |
return SERVICE_NAME; |
|
70 |
} |
|
71 |
|
|
72 |
/* |
|
73 |
* (non-Javadoc) |
|
74 |
* @see es.gva.cit.catalog.drivers.AbstractCatalogServiceDriver#getProfile() |
|
75 |
*/ |
|
76 |
public IProfile getProfile() { |
|
77 |
return new CSWebRIMProfile(); |
|
78 |
} |
|
79 |
|
|
80 |
/* |
|
81 |
* (non-Javadoc) |
|
82 |
* @see es.gva.cit.catalog.csw.drivers.CSWCatalogServiceDriver#retrieveResults(es.gva.cit.catalog.metadataxml.XMLNode) |
|
83 |
*/ |
|
84 |
protected XMLNode[] retrieveResults(XMLNode root) { |
|
85 |
XMLNode resultNode = root.searchNode(CSWConstants.SEARCH_RESULTS); |
|
86 |
if (resultNode == null){ |
|
87 |
return new XMLNode[0]; |
|
88 |
} |
|
89 |
XMLNode[] results = new XMLNode[resultNode.getNumSubNodes()]; |
|
90 |
for (int i=0 ; i<resultNode.getNumSubNodes() ; i++){ |
|
91 |
results[i] = resultNode.getSubNode(i); |
|
92 |
} |
|
93 |
return getEbRIMNodes(results); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* This function retrieve the nodes for one ebRIM answer |
|
98 |
* @return Medatada Nodes. |
|
99 |
* @param nodes Server URL |
|
100 |
* @param url |
|
101 |
*/ |
|
102 |
private XMLNode[] getEbRIMNodes(XMLNode[] nodes) { |
|
103 |
//if the getExtrinsincContentOperation is not supported |
|
104 |
if (capabilities.getOperations().getGetExtrinsicContent().size() == 0){ |
|
105 |
return nodes; |
|
106 |
} |
|
107 |
XMLNode[] auxNodes = new XMLNode[nodes.length]; |
|
108 |
for (int i = 0; i < nodes.length; i++) { |
|
109 |
String id = nodes[i].searchAtribute(CSWConstants.ID); |
|
110 |
URL url = (URL)capabilities.getOperations().getGetExtrinsicContent().get(CSWConstants.GET); |
|
111 |
auxNodes[i] = (XMLNode)new HTTPGetProtocol().doQuery(url, |
|
112 |
getEbRIMRequestParameters(id), 0).toArray()[0]; |
|
113 |
} |
|
114 |
return auxNodes; |
|
115 |
} |
|
116 |
|
|
117 |
/** |
|
118 |
* It Returns the parameters needed by getExtrinsicContent |
|
119 |
* @return |
|
120 |
* @param id Record id |
Also available in: Unified diff