Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Add WFS Geotools datastore programatically, not udig's

You mean that even If I were able to create a geotools WFS datastore, in the next restart the datastore to be used would be the "normal" udig WFS service?
That would not really be a problem for me, in my app I create a new catalog from scratch every time I run it. 
I am able to create the geotools WFS datastore adding an import Service dialog in my app:

Display display = Display.getCurrent();
				display.syncExec(new Runnable() {
					public void run() {
						MapImport mapImport = new MapImport();
						mapImport.getDialog().open();
					}
				});

But I dont know how to do it programatically :s

Thanks for your reply!
________________________________________
De: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx [udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] En nombre de Jesse Eichar [jesse.eichar@xxxxxxxxxxxxxx]
Enviado el: jueves, 09 de junio de 2011 10:54
Para: User-friendly Desktop Internet GIS
Asunto: Re: [udig-devel] Add WFS Geotools datastore programatically,    not udig's

Sadly this is not really possible because the params are used to recreate the datastore after a restart.  If you do that then the "normal" udig WFS service will be used after reboot.  As such we have not provided support.  Either changes to uDig are required or you need to add a new service plugin.

Jesse

2011/6/9 Joaquín Rodriguez-Guerra Urcelay <jrguerra@xxxxxxx<mailto:jrguerra@xxxxxxx>>
Hello list,

I know two ways to add a wfs layer into udig, importing from the catalog view a Web Feature Server, or a Geotools Datastore-> Web Feature Server, right?
Programatically I do it like this:

               url = new URL(MAPSERVER_GETCAPABILITIES_WFS);
               java.util.Map<String, Serializable> params = new HashMap<String, Serializable>();
               params.put(org.geotools.data.wfs.WFSDataStoreFactory.URL.key,url);
               params.put(org.geotools.data.wfs.WFSDataStoreFactory.WFS_STRATEGY.key,"mapserver");
               handle = catalog.acquire(params, new NullProgressMonitor());

But If I obtain the IService using the acquire method, then I am getting a WFSServiceImpl. My question is...  would it be possible to add a WFS service using the geotools WFS datastore instead of udig's WFS?? The reason is that Jody improved geotools WFS datastore to accpet the WFS_STRATEGY parameter to have a better support of mapserver, and this parameter is not accepted by udig's datastore. I tried using createService, expecting maybe to have different IServices (udig's and geotools's), but I only obtain udig's

               IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
               for( IService service : serviceFactory.createService( params ) ){
                    try {
                        IServiceInfo info = service.getInfo( null );  // try connecting to make sure the service works
                        System.out.println("SERVICIO "+ service.toString());
                    }
                    catch (IOException couldNotConnect ){
                    }
               }

Thanks!

Regards,

Joauqín

______________________
This message including any attachments may contain confidential
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando
prohibida su divulgacion copia o distribucion a terceros sin la
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

______________________

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


______________________
This message including any attachments may contain confidential 
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la 
Informacion siendo para uso exclusivo del destinatario, quedando 
prohibida su divulgacion copia o distribucion a terceros sin la 
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje 
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado. 
Gracias por su colaboracion.

______________________



Back to the top