[Geoserver-devel] App-schema store: any way to directly refer to a local store?

Hi,
I was wondering, is there any way to make the app-schema store refer to
an already configured GeoServer store instead of adding all in the info
inline in the xml file?

Afaik the pre-generalized store is already able to do this using some geotools
repository classes as a bridge between the gt2 api and the geoserver catalog.

It would be nice because of a few reasons:
- one can configure the store visually
- if the same store is used for simple and comlex features it
  can be shared (otherwise the efficient way would be to use JNDI pools
  which are a pain to setup over and over in the different web containers)

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

+1

it would alos allow previewing the connection with the standard UI!

Rob

On Wed, Oct 13, 2010 at 6:50 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

Hi,
I was wondering, is there any way to make the app-schema store refer to
an already configured GeoServer store instead of adding all in the info
inline in the xml file?

Afaik the pre-generalized store is already able to do this using some geotools
repository classes as a bridge between the gt2 api and the geoserver catalog.

It would be nice because of a few reasons:
- one can configure the store visually
- if the same store is used for simple and comlex features it
can be shared (otherwise the efficient way would be to use JNDI pools
which are a pain to setup over and over in the different web containers)

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Andrea- I assume when you mean “all the info inline in the xml file” you mean the mapping file and schema (because the other xml files can already be configured with the existing GUI).

I am planning for my master’s dissertation to develop a specialized app-schema extension that handles the configuration of the schema and mappings file for one-to-one mappings from a single resource, and then allows the user to add ClientProperties of observable and unit-of-measure or code-space. My plan is to have the user set up a conventional datastore, and then set up a derived data access - the GUI backend would extract a basic schema and mappings file from the preconfigured datastore resource, as you have suggested. Then the GUI would allow minor modifications for individual fields.

My motivation for developing this extension is to query across multiple feature/coverage stores by observable, and return a “harmonized” result (as wms, wfs or wcs), and draws on the thinklab opensource project. The GUI is just a bonus to lower the barrier for users to set up data accesses with semantic content.

Following a recent request, I am thinking that including attribute aliases would be a minor addition, and useful from my perspective as well, allowing attributes labels to be more readable.

Also based on Andrea’s recent patches for mapping app-schema, I am working on getting the Openlayers view in layer preview working for app-schema, but I’m not quite there yet. The map preview should be possible for any app-schema layer, once I track the last few bugs down- its another qualified/unqualified name mismatch.

I was going to keep quiet about this until I had made a little more progress, but if Andrea keeps fixing bugs and suggesting improvements, it will all get done and I will have to change my dissertation topic :frowning:

Tara

Rob Atkinson wrote:

···
-- 
Tara Athan
Owner, Athan Ecological Reconciliation Services
tara_athan at alt2is.com
707-272-2115 (cell, preferred)
707-485-1198 (office)
249 W. Gobbi St. #A
Ukiah, CA 95482

On Thu, Oct 14, 2010 at 5:26 AM, Tara Athan <taraathan@anonymised.com> wrote:

Andrea- I assume when you mean "all the info inline in the xml file" you
mean the mapping file and schema (because the other xml files can already be
configured with the existing GUI).

I mean being able to refer a data store already known to the GeoServer
catalog either by name or by id.

Instead of setting up something like:

<sourceDataStores>
    <DataStore>
      <id>mypg</id>
      <parameters>
        <Parameter>
          <name>dbtype</name>
          <value>postgisng</value>
        </Parameter>
        <Parameter>
          <name>host</name>
          <value>localhost</value>
        </Parameter>
        <Parameter>
          <name>port</name>
          <value>5432</value>
        </Parameter>
                               ....
      </parameters>
    </DataStore>
  </sourceDataStores>

Use something like:

<sourceDataStores>
    <DataStore>
      <id>mypg</id>
      <repositoryStore>postgis-test</repositoryStore>
    </DataStore>
</sourceDataStores>

where "postgis-test" is the name of a store I've already configured
via the GUI.

I haven't seen a way to do this so far, maybe I've missed it? :slight_smile:

I am planning for my master's dissertation to develop a specialized
app-schema extension that handles the configuration of the schema and
mappings file for one-to-one mappings from a single resource, and then
allows the user to add ClientProperties of observable and unit-of-measure or
code-space. My plan is to have the user set up a conventional datastore,
and then set up a derived data access - the GUI backend would extract a
basic schema and mappings file from the preconfigured datastore resource, as
you have suggested. Then the GUI would allow minor modifications for
individual fields.

Hum, nice! The GUI would be the current GeoServer wicket GUI or are
you referring to another program?

My motivation for developing this extension is to query across multiple
feature/coverage stores by observable, and return a "harmonized" result (as
wms, wfs or wcs), and draws on the thinklab opensource project. The GUI is
just a bonus to lower the barrier for users to set up data accesses with
semantic content.

Following a recent request, I am thinking that including attribute aliases
would be a minor addition, and useful from my perspective as well, allowing
attributes labels to be more readable.

Also based on Andrea's recent patches for mapping app-schema, I am working
on getting the Openlayers view in layer preview working for app-schema, but
I'm not quite there yet. The map preview should be possible for any
app-schema layer, once I track the last few bugs down- its another
qualified/unqualified name mismatch.

The preview was working for me with all the patches I issued last week
applied. But I did not try very hard, just had two very simple examples
(as simple as a complex feature can get :wink: )

I was going to keep quiet about this until I had made a little more
progress, but if Andrea keeps fixing bugs and suggesting improvements, it
will all get done and I will have to change my dissertation topic :frowning:

Don't worry, what I did last week was a weekend project, I'm not going
to push very much on this in the next few weeks (unless I get paid work
lining up in this direction, if that happens I won't have much of a choice).

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

I recently had this problem as well, i am developing an xy datastore that wraps an existing datastore. I took the same approach as pregeneralized-features and used the REpository class. There is a class org.geoserver.catalog.CatalogRepository that implements the interface and looks up datastores out of the local catalog.

Then I use a DataSToreFactoryINitializer to set the repository on the data store factory. And then my datastore parameter is just a qualified name. When the factory creates the data store it uses the repository to look it up.

It works great except for one problem. It adds a dependency on startup. If the xy datastore gets loaded before its dependent datastore it will not load and becomes disabled.

I am not sure the best way to solve… if we do allow for references then we need to scan all the files to figure out what he startup dependencies are. Or perhaps we can add a “lazy” flag to datastores that will prevent the startup from actually trying to connect to the datastore.

With dbconfig this is not an issue since datastore loaded on demand.

Some random thoughts :slight_smile:

On Wed, Oct 13, 2010 at 1:50 AM, Andrea Aime <andrea.aime@anonymised.com…> wrote:

Hi,
I was wondering, is there any way to make the app-schema store refer to
an already configured GeoServer store instead of adding all in the info
inline in the xml file?

Afaik the pre-generalized store is already able to do this using some geotools
repository classes as a bridge between the gt2 api and the geoserver catalog.

It would be nice because of a few reasons:

  • one can configure the store visually
  • if the same store is used for simple and comlex features it
    can be shared (otherwise the efficient way would be to use JNDI pools
    which are a pain to setup over and over in the different web containers)

Cheers
Andrea


Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf



Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Thu, Oct 14, 2010 at 4:20 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

I recently had this problem as well, i am developing an xy datastore that
wraps an existing datastore. I took the same approach as
pregeneralized-features and used the REpository class. There is a class
org.geoserver.catalog.CatalogRepository that implements the interface and
looks up datastores out of the local catalog.
Then I use a DataSToreFactoryINitializer to set the repository on the data
store factory. And then my datastore parameter is just a qualified name.
When the factory creates the data store it uses the repository to look it
up.
It works great except for one problem. It adds a dependency on startup. If
the xy datastore gets loaded before its dependent datastore it will not load
and becomes disabled.
I am not sure the best way to solve... if we do allow for references then we
need to scan all the files to figure out what he startup dependencies are.
Or perhaps we can add a "lazy" flag to datastores that will prevent the
startup from actually trying to connect to the datastore.
With dbconfig this is not an issue since datastore loaded on demand.
Some random thoughts :slight_smile:

Nice. Random by random... why not "just" extract the part that makes stores
load on demand out of the dbconfig and make it default? :-p

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

Ha, sure that would be easy :slight_smile:

Another alternative would be to simply not connect to datasatores on startup. There is actually a jira for this:

http://jira.codehaus.org/browse/GEOS-3712

-Justin

On Thu, Oct 14, 2010 at 8:34 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Thu, Oct 14, 2010 at 4:20 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

I recently had this problem as well, i am developing an xy datastore that
wraps an existing datastore. I took the same approach as
pregeneralized-features and used the REpository class. There is a class
org.geoserver.catalog.CatalogRepository that implements the interface and
looks up datastores out of the local catalog.
Then I use a DataSToreFactoryINitializer to set the repository on the data
store factory. And then my datastore parameter is just a qualified name.
When the factory creates the data store it uses the repository to look it
up.
It works great except for one problem. It adds a dependency on startup. If
the xy datastore gets loaded before its dependent datastore it will not load
and becomes disabled.
I am not sure the best way to solve… if we do allow for references then we
need to scan all the files to figure out what he startup dependencies are.
Or perhaps we can add a “lazy” flag to datastores that will prevent the
startup from actually trying to connect to the datastore.
With dbconfig this is not an issue since datastore loaded on demand.
Some random thoughts :slight_smile:

Nice. Random by random… why not “just” extract the part that makes stores
load on demand out of the dbconfig and make it default? :-p

Cheers
Andrea


Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf



Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.