[Geoserver-devel] [jira] Created: (GEOS-265) Support Views as FeatureSource

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/GEOS-265

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: GEOS-265
    Summary: Support Views as FeatureSource
       Type: Improvement

     Status: Open
   Priority: Major

Original Estimate: 1 day
Time Spent: Unknown
  Remaining: 1 day

    Project: GeoServer
Components:
             Global
   Versions:
             1.3.0

   Assignee: Chris Holmes
   Reporter: Thijs Brentjens

    Created: Tue, 21 Dec 2004 10:36 AM
    Updated: Tue, 21 Dec 2004 10:36 AM
Environment: -

Description:
It would be nice if Geoserver would support Views as a FeatureSource in addition to tables.

For Oracle, Geoserver can be configured manually to use views (accidently), but the web admin tool doens't list Views.

Views could be configured as read-only featuresources (or maybe even updatable or whatever is supported by the database with respect to views.)

This is the emaildiscussion in two parts:

*******************
Part I
*******************

Hi,

Several times I've noticed that there is a need to use views (as a
'datasource') in addition to tables on an Oracle database. Now, one has to
configure this manually, by making an info.xml file for the view
(identical to one for a table). This isn't very difficult, but the fact
that a user can't use the web admin tool to configure new featureTypes
based on a view, makes users think they can't use views at all.

Hi Brentjens:

Interestingly enough it is kind of accidental that views are supported
:slight_smile: My impression is the Oracle support written on the Geotools side
could provide both views and tables as the available FeatureTypes for
the Oracle DataStore.

But right now it just lists the table ... so I am CCing the devel list
with and idea.

What do people think of listing both Views and Tables from the JDBC
DataStores. The views can show up as read only FeaturesSources and the
tables can be Read/Write FeatureStores.

So just to add to your list ...

a) a user can use the web admin tool to configure featuretypes from views
b) the FeatureId can be specified (using the web admin tool :)), or be detected somehow, so that 'neat' FeatureIds are returned?

c) Detect views and provide read/only access to them as FeatureSources.

Cheers and thanks for the email,
Jody

********************
Part II
********************

Hi,

Several times I've noticed that there is a need to use views (as a
'datasource') in addition to tables on an Oracle database. Now, one has to
configure this manually, by making an info.xml file for the view
(identical to one for a table). This isn't very difficult, but the fact
that a user can't use the web admin tool to configure new featureTypes
based on a view, makes users think they can't use views at all.

Ok, this should not be too hard. I think all we need to do is add "VIEW"
as a type to our loadTypeNamesFromDatabase method in
http://gtsvn.refractions.net/geotools/trunk/gt/module/main/src/org/geotools/data/jdbc/FeatureTypeInfo.java
Could you make a jira in geoserver for me? And if you're feeling nice
make it in geotools too and link the geos one to i?

Anyway, the 'trick' with the manually defined info.xml works fine, but it
isn't possible to define what the primary key is. That is, Geoserver gives
back (random) values for the FeatureId.

Wouldn't it be nice if:
a) a user can use the web admin tool to configure featuretypes from views
b) the FeatureId can be specified (using the web admin tool :)), or be
detected somehow, so that 'neat' FeatureIds are returned?

Maybe b) asks for a thorough revision, but it would be nice to have better
support for views.

This would be nice. And we actually have the hooks for it, since Andrea
made a nice FIDMapper, which could do things just like this. It would be
easier if there was a nice default behaviour we had for views, but then I
don't know what that would be. Making it user configurable is harder,
since we would need to set up a better framework and use the web admin
tool.

As a side note, I am looking to fully support views, and arbitrary
mappings, expanding on the work sco did, for geoserver 1.3. It would
allow you to configure in geoserver directly, instead of having to make
views in your db. Though better support for normal views would be a good
first step.

Chris

---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira