Revision 7617 trunk/extensions/extPublish/src/org/gvsig/remoteservices/conf/geoserver/TestGeoserver.java

View differences:

TestGeoserver.java
1 1
package org.gvsig.remoteservices.conf.geoserver;
2 2

  
3 3
public class TestGeoserver {
4
	public static void main(String args[]) {
5
		String hostURL = "http://localhost:8080/geoserver";
6
		String layer = "autopistas";
7
		String dataStoreId = "cv300";
8
		String confDir = "/usr/local/geoserver/webapps/geoserver/conf/";
9
		InfoPOSTGIS i=new InfoPOSTGIS(confDir+"/featureTypes/"+dataStoreId+"_"+layer+"/"
10
				,dataStoreId,layer,"23030","/","8","false"
11
				,"line","false","",-1.55,37.82,0.43,40.61);
12
		/*
4
	
5
	
6
	public static String hostURL = "http://localhost:8080/geoserver";
7
	public static String layer = "autopistas";
8
	public static String dataStoreId = "cv300";
9
	public static String confDir = "/usr/local/geoserver/webapps/geoserver/conf/";
10
	
11
	public static void testSHAPE(){
13 12
		InfoSHAPE i=new InfoSHAPE(confDir+"/featureTypes/"+dataStoreId+"_"+layer+"/"
14 13
				,dataStoreId,layer,"23030","/","8","false"
15 14
				,"line","false","",-1.55,37.82,0.43,40.61);
16
		*/
15
		
16
		CatalogSHAPE g=new CatalogSHAPE(confDir
17
				,"topp","namespace",dataStoreId
18
				,"file:data/"+dataStoreId+"/"+layer+".shp","true");
17 19
		i.toXML();
18 20
		i.close();
21
		g.toXML();
22
		g.close();
19 23
		System.out.println("notificando cambios a geoserver ...");
20
		//i.update(hostURL, "admin","geoserver");
24
		g.update(hostURL, "admin","geoserver");
25
		System.out.println("hecho.");
21 26
		
27
		
28
	}
29
	
30
	public static void testPOSTGIS(){
31
		
32
		InfoPOSTGIS i=new InfoPOSTGIS(confDir+"/featureTypes/"+dataStoreId+"_"+layer+"/"
33
				,dataStoreId,layer,"23030","/","8","false"
34
				,"line","false","",-1.55,37.82,0.43,40.61); 
22 35
		CatalogPOSTGIS g=new CatalogPOSTGIS(confDir
23 36
				,"topp","namespace",dataStoreId,"true",
24 37
				"autopistas gv","true","david","chkdsk","true","localhost","public",
25 38
				"5432","betel","postgis");
26
		
27
		/*
28
		CatalogSHAPE g=new CatalogSHAPE(confDir
29
				,"topp","namespace",dataStoreId
30
				,"file:data/"+dataStoreId+"/"+layer+".shp","true");
31
		*/
39
		i.toXML();
40
		i.close();
32 41
		g.toXML();
33 42
		g.close();
34 43
		System.out.println("notificando cambios a geoserver ...");
......
36 45
		System.out.println("hecho.");
37 46
	}
38 47
	
39

  
48
public static void main(String args[]) {
49
		
50
		
51
		testSHAPE();
52
		//testPOSTGIS();
53
		
54
	}
40 55
}

Also available in: Unified diff