Revision 477

View differences:

org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/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.83/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.83/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.83/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.83/org.gvsig.catalog.lib/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.catalog.CatalogLibrary
2
org.gvsig.catalog.impl.DefaultCatalogLibrary
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/querys/Search.java
1
package org.gvsig.catalog.querys;
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
/* CVS MESSAGES:
43
 *
44
 * $Id: Search.java 561 2007-07-27 06:49:30 +0000 (Fri, 27 Jul 2007) jpiera $
45
 * $Log$
46
 * Revision 1.1.2.1  2007/07/11 13:01:50  jorpiell
47
 * Catalog UI updated
48
 *
49
 *
50
 */
51
/**
52
 * This class represents a search service (data or services)
53
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
54
 */
55
public class Search {
56
	private String name = null;
57
		
58
	public Search(String name){
59
		this.name = name;
60
	}
61

  
62
	/**
63
	 * @return the name
64
	 */
65
	public String getName() {
66
		return name;
67
	}
68

  
69
	/*
70
	 * (non-Javadoc)
71
	 * @see java.lang.Object#toString()
72
	 */
73
	public String toString(){
74
		return name;
75
	}
76
}
0 77

  
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/querys/MetadataSearch.java
1
package org.gvsig.catalog.querys;
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
/* CVS MESSAGES:
43
 *
44
 * $Id: MetadataSearch.java 561 2007-07-27 06:49:30 +0000 (Fri, 27 Jul 2007) jpiera $
45
 * $Log$
46
 * Revision 1.1.2.1  2007/07/11 13:01:50  jorpiell
47
 * Catalog UI updated
48
 *
49
 *
50
 */
51
/**
52
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
53
 */
54
public class MetadataSearch extends Search{
55

  
56
	public MetadataSearch(String name) {
57
		super(name);		
58
	}
59

  
60
}
0 61

  
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/querys/ServicesSearch.java
1
package org.gvsig.catalog.querys;
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
/* CVS MESSAGES:
43
 *
44
 * $Id: ServicesSearch.java 561 2007-07-27 06:49:30 +0000 (Fri, 27 Jul 2007) jpiera $
45
 * $Log$
46
 * Revision 1.1.2.1  2007/07/11 13:01:50  jorpiell
47
 * Catalog UI updated
48
 *
49
 *
50
 */
51
/**
52
 * This class implements a services search
53
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
54
 */
55
public class ServicesSearch extends Search {
56

  
57
	public ServicesSearch(String name) {
58
		super(name);		
59
	}
60

  
61
}
0 62

  
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/querys/Coordinates.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.querys;
43

  
44
/**
45
 * This class represents a symple double pair of coordinates
46
 * 
47
 * 
48
 * @author Jorge Piera Llodra (piera_jor@gva.es)
49
 */
50
public class Coordinates {
51
	public String ulx;
52
	public String uly;
53
	public String brx;
54
	public String bry;
55

  
56
	/**
57
	 * @param ulx 
58
	 * @param uly 
59
	 * @param brx 
60
	 * @param bry 
61
	 */
62
	public  Coordinates(String ulx, String uly, String brx, String bry) {        
63
		this.ulx = ulx;
64
		this.uly = uly;
65
		this.brx = brx;
66
		this.bry = bry;
67
	} 
68

  
69
	/**
70
	 * 
71
	 * 
72
	 * 
73
	 * @param ulx 
74
	 * @param uly 
75
	 * @param brx 
76
	 * @param bry 
77
	 */
78
	public  Coordinates(double ulx, double uly, double brx, double bry) {        
79
		this.ulx = String.valueOf(ulx);
80
		this.uly = String.valueOf(uly);
81
		this.brx = String.valueOf(brx);
82
		this.bry = String.valueOf(bry);
83
	} 
84

  
85
	/**
86
	 * 
87
	 * 
88
	 * 
89
	 * @return Returns the brx.
90
	 */
91
	public String getBrx() {        
92
		return brx;
93
	} 
94

  
95
	/**
96
	 * 
97
	 * 
98
	 * 
99
	 * @return 
100
	 */
101
	public double getDoubleBrx() {        
102
		return Double.valueOf(brx).doubleValue();
103
	} 
104

  
105
	/**
106
	 * 
107
	 * 
108
	 * 
109
	 * @param brx The brx to set.
110
	 */
111
	public void setBrx(String brx) {        
112
		this.brx = brx;
113
	} 
114

  
115
	/**
116
	 * 
117
	 * 
118
	 * 
119
	 * @return Returns the bry.
120
	 */
121
	public String getBry() {        
122
		return bry;
123
	} 
124

  
125
	/**
126
	 * 
127
	 * 
128
	 * 
129
	 * @return 
130
	 */
131
	public double getDoubleBry() {        
132
		return Double.valueOf(bry).doubleValue();
133
	} 
134

  
135
	/**
136
	 * 
137
	 * 
138
	 * 
139
	 * @param bry The bry to set.
140
	 */
141
	public void setBry(String bry) {        
142
		this.bry = bry;
143
	} 
144

  
145
	/**
146
	 * 
147
	 * 
148
	 * 
149
	 * @return Returns the ulx.
150
	 */
151
	public String getUlx() {        
152
		return ulx;
153
	} 
154

  
155
	/**
156
	 * 
157
	 * 
158
	 * 
159
	 * @return 
160
	 */
161
	public double getDoubleUlx() {        
162
		return Double.valueOf(ulx).doubleValue();
163
	} 
164

  
165
	/**
166
	 * 
167
	 * 
168
	 * 
169
	 * @param ulx The ulx to set.
170
	 */
171
	public void setUlx(String ulx) {        
172
		this.ulx = ulx;
173
	} 
174

  
175
	/**
176
	 * 
177
	 * 
178
	 * 
179
	 * @return Returns the uly.
180
	 */
181
	public String getUly() {        
182
		return uly;
183
	} 
184

  
185
	/**
186
	 * 
187
	 * 
188
	 * 
189
	 * @return 
190
	 */
191
	public double getDoubleUly() {        
192
		return Double.valueOf(uly).doubleValue();
193
	} 
194

  
195
	/**
196
	 * 
197
	 * 
198
	 * 
199
	 * @param uly The uly to set.
200
	 */
201
	public void setUly(String uly) {        
202
		this.uly = uly;
203
	} 
204
}
0 205

  
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/querys/DiscoveryServiceQuery.java
1
package org.gvsig.catalog.querys;
2

  
3
import java.util.Properties;
4

  
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 *
50
 */
51
/**
52
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
53
 */
54
public class DiscoveryServiceQuery {
55
	private Properties properties = null;
56
	
57
	public DiscoveryServiceQuery(){
58
		this.properties = new Properties();
59
	}
60

  
61
	/**
62
	 * @return a property
63
	 */
64
	public Object getProperty(String propertyName) {
65
		return properties.get(propertyName);
66
	}
67

  
68
	/**
69
	 * Set the properties
70
	 * @param properties
71
	 * The properties to set
72
	 */
73
	public void setProperties(Properties properties) {
74
		this.properties = properties;
75
	}
76

  
77

  
78
}
0 79

  
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/org.gvsig.catalog.lib/src/main/java/org/gvsig/catalog/querys/CatalogQuery.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.querys;
43

  
44
import org.gvsig.catalog.utils.CatalogConstants;
45

  
46
/**
47
 * This class implements a general query. It contains an attribute
48
 * for each parameter that can be showed in the search form.
49
 * 
50
 * 
51
 * @author Jorge Piera Llodra (piera_jor@gva.es)
52
 */
53
public class CatalogQuery extends DiscoveryServiceQuery{
54
	private Search service = null;
55
	private String title;
56
	private String titleFilter;
57
	private String abstract_;
58
	private String themeKey;
59
	private String topic;
60
	private String scale;
61
	private String provider;
62
	private String DateFrom;
63
	private String DateTo;
64
	private Coordinates coordinates;
65
	private String coordinatesFilter;
66
	private boolean isMinimized;
67
	private boolean isCoordinatesClicked;
68

  
69
	public  CatalogQuery() {        
70
		super();
71
	} 
72

  
73
	/**
74
	 * @param title 
75
	 * @param titleFilter 
76
	 * @param abstract_ 
77
	 * @param themeKey 
78
	 * @param topic 
79
	 * @param scale 
80
	 * @param provider 
81
	 * @param dateFrom 
82
	 * @param dateTo 
83
	 * @param coordinates 
84
	 * @param coordinatesFilter 
85
	 * @param translator 
86
	 */
87
	public  CatalogQuery(String title, String titleFilter, String abstract_, String themeKey, String topic, String scale, String provider, String dateFrom, String dateTo, Coordinates coordinates, String coordinatesFilter) {        
88
		super();
89
		this.title = title;
90
		this.titleFilter = titleFilter;
91
		this.abstract_ = abstract_;
92
		this.themeKey = themeKey;
93
		this.topic = topic;
94
		this.scale = scale;
95
		this.provider = provider;
96
		//Date
97
		this.DateFrom = dateFrom;
98
		this.DateTo = dateTo;
99
		//Coordinates
100
		this.coordinates = coordinates;
101
		if (this.coordinates != null) {
102
			if (this.coordinates.getUlx().equals("") ||
103
					this.coordinates.getUlx().equals("") ||
104
					this.coordinates.getBrx().equals("") ||
105
					this.coordinates.getBry().equals("")) {
106
				this.coordinates = null;
107
			} else {
108
				try {
109
					Double.parseDouble(this.coordinates.getUlx());
110
					Double.parseDouble(this.coordinates.getUlx());
111
					Double.parseDouble(this.coordinates.getBrx());
112
					Double.parseDouble(this.coordinates.getBry());
113
					this.coordinates = coordinates;
114
				} catch (Exception e) {
115
					this.coordinates = null;
116

  
117
				}
118
			}
119
		}
120
		this.coordinatesFilter = coordinatesFilter;
121

  
122
		setMinimized(false);
123
	} 
124

  
125
	/**
126
	 * Return logic operators
127
	 * 
128
	 * @param titleKeys E,A o Y --> Exact, All, anY
129
	 * 
130
	 * @return String
131
	 * @param concordancia 
132
	 */
133
	public String getOperator(String concordancia) {        
134
		if (concordancia.equals(CatalogConstants.ANY_WORD)) {
135
			return CatalogConstants.OR;
136
		} else {
137
			return CatalogConstants.OR;
138
		}
139
	} 
140

  
141
	/**
142
	 * 
143
	 * 
144
	 * 
145
	 * @return Returns the abstract_.
146
	 */
147
	public String getAbstract() {        
148
		return abstract_;
149
	} 
150

  
151
	/**
152
	 * 
153
	 * 
154
	 * 
155
	 * @param abstract_ The abstract_ to set.
156
	 */
157
	public void setAbstract(String abstract_) {        
158
		this.abstract_ = abstract_;
159
	} 
160

  
161
	/**
162
	 * 
163
	 * 
164
	 * 
165
	 * @return Returns the coordinates.
166
	 */
167
	public Coordinates getCoordenates() {        
168
		return coordinates;
169
	} 
170

  
171
	/**
172
	 * 
173
	 * 
174
	 * 
175
	 * @param coordenates The coordinates to set.
176
	 */
177
	public void setCoordenates(Coordinates coordenates) {        
178
		this.coordinates = coordenates;
179
	} 
180

  
181
	/**
182
	 * 
183
	 * 
184
	 * 
185
	 * @return Returns the coordinatesFilter.
186
	 */
187
	public String getCoordenatesFilter() {        
188
		return coordinatesFilter;
189
	} 
190

  
191
	/**
192
	 * 
193
	 * 
194
	 * 
195
	 * @param coordenatesFilter The coordenatesFilter to set.
196
	 */
197
	public void setCoordenatesFilter(String coordenatesFilter) {        
198
		this.coordinatesFilter = coordenatesFilter;
199
	} 
200

  
201
	/**
202
	 * 
203
	 * 
204
	 * 
205
	 * @return Returns the dateFrom.
206
	 */
207
	public String getDateFrom() {        
208
		return DateFrom;
209
	} 
210

  
211
	/**
212
	 * 
213
	 * 
214
	 * 
215
	 * @param dateFrom The dateFrom to set.
216
	 */
217
	public void setDateFrom(String dateFrom) {        
218
		DateFrom = dateFrom;
219
	} 
220

  
221
	/**
222
	 * 
223
	 * 
224
	 * 
225
	 * @return Returns the dateTo.
226
	 */
227
	public String getDateTo() {        
228
		return DateTo;
229
	} 
230

  
231
	/**
232
	 * 
233
	 * 
234
	 * 
235
	 * @param dateTo The dateTo to set.
236
	 */
237
	public void setDateTo(String dateTo) {        
238
		DateTo = dateTo;
239
	} 
240

  
241
	/**
242
	 * 
243
	 * 
244
	 * 
245
	 * @return Returns the provider.
246
	 */
247
	public String getProvider() {        
248
		return provider;
249
	} 
250

  
251
	/**
252
	 * 
253
	 * 
254
	 * 
255
	 * @param provider The provider to set.
256
	 */
257
	public void setProvider(String provider) {        
258
		this.provider = provider;
259
	} 
260

  
261
	/**
262
	 * 
263
	 * 
264
	 * 
265
	 * @return Returns the scale.
266
	 */
267
	public String getScale() {        
268
		return scale;
269
	} 
270

  
271
	/**
272
	 * 
273
	 * 
274
	 * 
275
	 * @param scale The scale to set.
276
	 */
277
	public void setScale(String scale) {        
278
		this.scale = scale;
279
	} 
280

  
281
	/**
282
	 * 
283
	 * 
284
	 * 
285
	 * @return Returns the themeKey.
286
	 */
287
	public String getThemeKey() {        
288
		return themeKey;
289
	} 
290

  
291
	/**
292
	 * 
293
	 * 
294
	 * 
295
	 * @param themeKey The themeKey to set.
296
	 */
297
	public void setThemeKey(String themeKey) {        
298
		this.themeKey = themeKey;
299
	} 
300

  
301
	/**
302
	 * 
303
	 * 
304
	 * 
305
	 * @return Returns the title.
306
	 */
307
	public String getTitle() {        
308
		return title;
309
	} 
310

  
311
	/**
312
	 * 
313
	 * 
314
	 * 
315
	 * @param title The title to set.
316
	 */
317
	public void setTitle(String title) {        
318
		this.title = title;
319
	} 
320

  
321
	/**
322
	 * 
323
	 * 
324
	 * 
325
	 * @return Returns the titleFilter.
326
	 */
327
	public String getTitleFilter() {        
328
		return titleFilter;
329
	} 
330

  
331
	/**
332
	 * 
333
	 * 
334
	 * 
335
	 * @param titleFilter The titleFilter to set.
336
	 */
337
	public void setTitleFilter(String titleFilter) {        
338
		this.titleFilter = titleFilter;
339
	} 
340

  
341
	/**
342
	 * 
343
	 * 
344
	 * 
345
	 * @return Returns the topic.
346
	 */
347
	public String getTopic() {        
348
		return topic;
349
	} 
350

  
351
	/**
352
	 * 
353
	 * 
354
	 * 
355
	 * @param topic The topic to set.
356
	 */
357
	public void setTopic(String topic) {        
358
		this.topic = topic;
359
	} 
360

  
361
	/**
362
	 * 
363
	 * 
364
	 * 
365
	 * @return Returns the isMinimized.
366
	 */
367
	public boolean isMinimized() {        
368
		return isMinimized;
369
	} 
370

  
371
	/**
372
	 * 
373
	 * 
374
	 * 
375
	 * @param isMinimized The isMinimized to set.
376
	 */
377
	public void setMinimized(boolean isMinimized) {        
378
		this.isMinimized = isMinimized;
379
		if (isMinimized){
380
			this.setAbstract(getTitle());
381
		}
382
	} 
383

  
384
	/**
385
	 * 
386
	 * 
387
	 * 
388
	 * @return Returns the isCoordinatesClicked.
389
	 */
390
	public boolean isCoordinatesClicked() {        
391
		return isCoordinatesClicked;
392
	} 
393

  
394
	/**
395
	 * 
396
	 * 
397
	 * 
398
	 * @param isCoordinatesClicked The isCoordinatesClicked to set.
399
	 */
400
	public void setCoordinatesClicked(boolean isCoordinatesClicked) {        
401
		this.isCoordinatesClicked = isCoordinatesClicked;
402
	} 
403

  
404

  
405
	/**
406
	 * It returns the lower scale
407
	 * 
408
	 * 
409
	 * @return String or Null if ther is not a low value (0)
410
	 */
411
	public String getMinScale() {        
412
		if (scale.equals(">1.000.000")){
413
			return "1000000";
414
		}
415

  
416
		if (scale.equals("1.000.000 - 250.000")){
417
			return "250000";
418
		}
419

  
420
		if (scale.equals("250.000 - 50.000")){
421
			return "50000";
422
		}
423

  
424
		if (scale.equals("50.000 - 10.000")){
425
			return "10000";
426
		}
427

  
428
		if (scale.equals("10.000 - 5000")){
429
			return "5000";
430
		}
431

  
432
		return null;        
433
	} 
434

  
435
	/**
436
	 * It returns the upper scale
437
	 * 
438
	 * 
439
	 * @return String or Null if ther is not a value (infinity)
440
	 */
441
	public String getMaxScale() {        
442
		if (scale.equals("1.000.000 - 250.000")){
443
			return "1000000";
444
		}
445

  
446
		if (scale.equals("250.000 - 50.000")){
447
			return "250000";
448
		}	
449

  
450
		if (scale.equals("50.000 - 10.000")){
451
			return "50000";
452
		}
453

  
454
		if (scale.equals("10.000 - 5000")){
455
			return "10000";
456
		}
457

  
458
		if (scale.equals("<5.000")){
459
			return "5000";
460
		}   
461
		return null;        
462
	}
463

  
464
	/**
465
	 * @return the service
466
	 */
467
	public Search getService() {
468
		return service;
469
	}
470

  
471
	/**
472
	 * @param service the service to set
473
	 */
474
	public void setService(Search service) {
475
		this.service = service;
476
	} 
477
	
478
}
0 479

  
org.gvsig.catalog/tags/org.gvsig.catalog-2.0.83/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
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff