<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 08/04/2010 01:31 AM, luca bianconi wrote:
<blockquote
cite="mid:AANLkTi=amfencKUwo+LGTEER9kuCpqVKSR9jETfOFOKx@mail.gmail.com"
type="cite">Hi all,<br>
<br>
it has past some time since I've started studying gvSIG DAL providing
system and, even if I've received many useful explanations (thanks kind
Cèsar!), read longly the documentation [1] about it, read other DAL
providers code, made coding tests, I'm unfortunately still plenty of
doubts.<br>
<br>
I'd like asking the community some help to understand some things (I'm
very sorry if some of them could sound very trivial to some of you).<br>
<br>
First of all, just a curiosity I'd like to ask Spanish speaking people
: <br>
I understand the word "almacèn" as "provider", referred in
documentation as the DAL provider. Is it correct ?<br>
</blockquote>
<br>
I'm not completely agree. An "Almacén" is a "DataStore" that uses a
provider (DataStoreProvider) to retrieve data from a data source. <br>
<br>
The "Almacen o DataStore" is the API of DAL that can be used by a data
consumer to retrieve data. Providers are a part of the Service Provider
Interface (SPI) and they register in DAL new formats that can be
managed using the DAL API.<br>
<br>
<blockquote
cite="mid:AANLkTi=amfencKUwo+LGTEER9kuCpqVKSR9jETfOFOKx@mail.gmail.com"
type="cite"><br>
If this is correct, and I want to register a new DAL provider I guess,
after having of course read the whole available (as much as I know)
documentation [1] on fmap.dal, I should use as main reference the
chapter "<span>Creación de un nuevo almacén</span>" [2] .<br>
</blockquote>
<br>
This document explains how you can create a new DataStore using the
API. In this example it is creating a new DBF. The "DBF provider" has
to be previously registered with a name or the line
"serverExplorer.getAddParameters("DBF")" will send an exception. <br>
<br>
<blockquote
cite="mid:AANLkTi=amfencKUwo+LGTEER9kuCpqVKSR9jETfOFOKx@mail.gmail.com"
type="cite"><br>
I've been suggested to give a glance, as example, at the extDwg
extension for better understanding how the registration of a DAL
provider works.<br>
I see that in this provider, as in other ones, four classes are always
implemented:<br>
<br>
DWGLibrary -> Does it register the provider ? Does it in
doPostInitialize() method ? <br>
</blockquote>
<br>
Thats right. It registers the DWG provider and the DWG explorer that is
used to browse by a directory tree for searching DWG's of creating new
DWG's<br>
<br>
<blockquote
cite="mid:AANLkTi=amfencKUwo+LGTEER9kuCpqVKSR9jETfOFOKx@mail.gmail.com"
type="cite">DWGFilesystemServerProvider, DWGStoreParameters,
DWGStoreProvider -> How do they work exactly ? What do they do ? <br>
</blockquote>
<br>
DWGFilesystemServerProvider -> It is used to browse by a directory
tree and search DWG resources. It can be used to get the
DataStoreParameters that are used to open an existing DWG creating a
new DataStore or it also can be used to get the NewDataStoreParameters
that are used to create a new DWG.<br>
<br>
DWGStoreParameters -> Defines the parameters that are needed to open
a DWG<br>
<br>
DWGStoreProvider -> This provider is created from a
DWGStoreParameters and it is able to read (or write) a DWG.<br>
<br>
<blockquote
cite="mid:AANLkTi=amfencKUwo+LGTEER9kuCpqVKSR9jETfOFOKx@mail.gmail.com"
type="cite"><br>
After having implemented it, how can I register the provider with a
plugin ?<br>
</blockquote>
<br>
The project xxx.app.extension is the responsible to add a new plugin in
gvSIG. It will contain the new provider.<br>
<blockquote
cite="mid:AANLkTi=amfencKUwo+LGTEER9kuCpqVKSR9jETfOFOKx@mail.gmail.com"
type="cite"><br>
Which class among those provided by the plugin structure should I use ?<br>
<br>
These are the classes:<br>
<br>
- A xxxManager: is the entry point to the API. Provides the main
services of the library.
<br>
- A xxxLocator: the responsible to provide access to the single Manager
instance.
<br>
- A xxxLibrary: initialization and configuration of the library.
<br>
- A xxxService: another interface for the API. You may use it or not
depending on your library's functionality.
<br>
</blockquote>
Well, it depends on any project. The Library class is normally located
in all the projects, but the other classes will be contained depending
on what are you developing. (e.g. extDWG is a DAL provider and it don't
need any Manager) <br>
<br>
I Hope I clarify you some doubts.<br>
<br>
Regards,<br>
Jorge<br>
<br>
<blockquote
cite="mid:AANLkTi=amfencKUwo+LGTEER9kuCpqVKSR9jETfOFOKx@mail.gmail.com"
type="cite"><br>
Thanks a lot for the help,<br>
Luca<br>
<br>
<br>
[1] <a moz-do-not-send="true"
href="http://www.gvsig.org/web/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/featurestore">http://www.gvsig.org/web/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/featurestore</a><br>
[2] <a moz-do-not-send="true"
href="http://www.gvsig.org/web/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/featurestore/consumer-services/creacion-de-un-nuevo-almacen">http://www.gvsig.org/web/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/featurestore/consumer-services/creacion-de-un-nuevo-almacen</a><br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Gvsig_internacional mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a>
<a class="moz-txt-link-freetext" href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:jpiera@prodevelop.es">jpiera@prodevelop.es</a>
<a class="moz-txt-link-freetext" href="http://www.prodevelop.es">http://www.prodevelop.es</a>
<a class="moz-txt-link-freetext" href="http://www.gvsig.org">http://www.gvsig.org</a>
</pre>
</body>
</html>