Statistics
| Revision:

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

History | View | Annotate | Download (1.52 KB)

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

    
3
public class TestGeoserver {
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(){
12
                InfoSHAPE i=new InfoSHAPE(confDir+"/featureTypes/"+dataStoreId+"_"+layer+"/"
13
                                ,dataStoreId,layer,"23030","/","8","false"
14
                                ,"line","false","",-1.55,37.82,0.43,40.61);
15
                
16
                CatalogSHAPE g=new CatalogSHAPE(confDir
17
                                ,"topp","namespace",dataStoreId
18
                                ,"file:data/"+dataStoreId+"/"+layer+".shp","true");
19
                i.toXML();
20
                i.close();
21
                g.toXML();
22
                g.close();
23
                System.out.println("notificando cambios a geoserver ...");
24
                g.update(hostURL, "admin","geoserver");
25
                System.out.println("hecho.");
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); 
35
                CatalogPOSTGIS g=new CatalogPOSTGIS(confDir
36
                                ,"topp","namespace",dataStoreId,"true",
37
                                "autopistas gv","true","david","chkdsk","true","localhost","public",
38
                                "5432","betel","postgis");
39
                i.toXML();
40
                i.close();
41
                g.toXML();
42
                g.close();
43
                System.out.println("notificando cambios a geoserver ...");
44
                g.update(hostURL, "admin","geoserver");
45
                System.out.println("hecho.");
46
        }
47
        
48
public static void main(String args[]) {
49
                
50
                
51
                testSHAPE();
52
                //testPOSTGIS();
53
                
54
        }
55
}