[Geoserver-devel] XStream reference converters

Hi,
in GSS the service configuration needs to know which datastore
is holding the synchronized layer as well as the synchronization
metadata tables.

Now, I can reference it by name, but code wise it's just better to
actually reference a real StoreInfo.

The issue I'm experiencing is that when storing the service configuration, gss.xml, the whole datastore config is stored along
the service:

<gss>
   ...
   <verbose>false</verbose>
   <versioningDataStore>
     <id>synchStore</id>
     <name>synch</name>
     <enabled>true</enabled>
     <workspace>
       <id>sfWorkspace</id>
     </workspace>
     <connectionParameters>
       <entry key="namespace">http://www.openplans.org/spearfish&lt;/entry&gt;
       <entry key="loose bbox">true</entry>
       <entry key="user">cite</entry>
       <entry key="passwd">cite</entry>
       <entry key="wkb enabled">true</entry>
       <entry key="host">localhost</entry>
       <entry key="version enable all">false</entry>
       <entry key="port">5432</entry>
       <entry key="database">synch</entry>
       <entry key="dbtype">postgis-versioned</entry>
     </connectionParameters>
   </versioningDataStore>
   <mode>Central</mode>
</gss>

I want a reference instead. And there are ready made converters too,
but they are non static inner classes of XStreamPersister, so I cannot
really use them as is.

What about exposing a factory method out of the XStreamPersister that
would create such reference converters?
I've tried adding the following to XStreamPersister:

public ReferenceConverter buildReferenceConverter(Class clazz) {
         return new ReferenceConverter(clazz);
     }

     public ReferenceCollectionConverter buildReferenceCollectionConverter(Class clazz) {
         return new ReferenceCollectionConverter(clazz);
     }

and as far as I can see it's working fine (once I register a local
converter for the versioningDataStore property in the GSSXStreamLoader
of course)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Seems reasonable. +1.

On 4/13/10 10:12 AM, Andrea Aime wrote:

Hi,
in GSS the service configuration needs to know which datastore
is holding the synchronized layer as well as the synchronization
metadata tables.

Now, I can reference it by name, but code wise it's just better to
actually reference a real StoreInfo.

The issue I'm experiencing is that when storing the service
configuration, gss.xml, the whole datastore config is stored along
the service:

<gss>
    ...
    <verbose>false</verbose>
    <versioningDataStore>
      <id>synchStore</id>
      <name>synch</name>
      <enabled>true</enabled>
      <workspace>
        <id>sfWorkspace</id>
      </workspace>
      <connectionParameters>
        <entry key="namespace">http://www.openplans.org/spearfish&lt;/entry&gt;
        <entry key="loose bbox">true</entry>
        <entry key="user">cite</entry>
        <entry key="passwd">cite</entry>
        <entry key="wkb enabled">true</entry>
        <entry key="host">localhost</entry>
        <entry key="version enable all">false</entry>
        <entry key="port">5432</entry>
        <entry key="database">synch</entry>
        <entry key="dbtype">postgis-versioned</entry>
      </connectionParameters>
    </versioningDataStore>
    <mode>Central</mode>
</gss>

I want a reference instead. And there are ready made converters too,
but they are non static inner classes of XStreamPersister, so I cannot
really use them as is.

What about exposing a factory method out of the XStreamPersister that
would create such reference converters?
I've tried adding the following to XStreamPersister:

public ReferenceConverter buildReferenceConverter(Class clazz) {
          return new ReferenceConverter(clazz);
      }

      public ReferenceCollectionConverter
buildReferenceCollectionConverter(Class clazz) {
          return new ReferenceCollectionConverter(clazz);
      }

and as far as I can see it's working fine (once I register a local
converter for the versioningDataStore property in the GSSXStreamLoader
of course)

Cheers
Andrea

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