Geoserver doesn't support postgres ENUM field type. Any chance implementing enum support and extend wfs describefeaturetype to return the values?
CodeHaus Comment From: aaime - Time: Sat, 8 Nov 2014 08:20:05 -0600
---------------------
<p>First, you need geotools checked out and building fine, and the discussion should take place on geotools-devel, where other people can help you too (I don't always have time, and when I do, it's normally spare hours during weekends, so you might be waiting responses from me for a week or more.
Anyways, should be something like this:</p>
<ul>
<li>have a look at PostgisDialect, in these areas, and add support for enum types there
<a href="https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/PostGISDialect.java#L73" class="external-link" rel="nofollow">https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/PostGISDialect.java#L73</a>
<a href="https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/PostGISDialect.java#L388" class="external-link" rel="nofollow">https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/PostGISDialect.java#L388</a>
<a href="https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/PostGISDialect.java#L459" class="external-link" rel="nofollow">https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/PostGISDialect.java#L459</a></li>
<li>add a test to cover enum types, similar to the udt ones:
<a href="https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/test/java/org/geotools/data/postgis/PostgisUDTTest.java" class="external-link" rel="nofollow">https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/test/java/org/geotools/data/postgis/PostgisUDTTest.java</a>
<a href="https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/test/java/org/geotools/data/postgis/PostgisUDTTestSetup.java" class="external-link" rel="nofollow">https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/test/java/org/geotools/data/postgis/PostgisUDTTestSetup.java</a></li>
<li>Now, we should add a way to specif the attribute restrictions, as a Filter including valid values... and the API is not there, it has to be created. This is going to need some discussion on the devel list, but I guess the following would do: have JDBCFeatureSource around like 292 call the dialect with a new method "Filter getColumnRestrictions(ColumnMetadata metadata);", that by default would return null, but in your case and for enum attributes, would build a filter to limit the possible values of the attribute</li>
<li>Extend the above tests to check the feature type and the associated restrictions</li>
</ul>
<p>This ends the GeoTools part.</p>
<p>Now, in GeoServer, modify this method to use the restrictions while generating the output schema:
<a href="https://github.com/geoserver/geoserver/blob/793476e348e906a2ee9db8fa8f73a4fb464f3288/src/wfs/src/main/java/org/geoserver/wfs/xml/FeatureTypeSchemaBuilder.java#L706" class="external-link" rel="nofollow">https://github.com/geoserver/geoserver/blob/793476e348e906a2ee9db8fa8f73a4fb464f3288/src/wfs/src/main/java/org/geoserver/wfs/xml/FeatureTypeSchemaBuilder.java#L706</a></p>
<p>As said, if you need to follow up, please do on the geotools-devel mailing list</p>
CodeHaus Comment From: atisnz - Time: Sun, 9 Nov 2014 18:12:50 -0600
---------------------
<p>Thanks for the guidelines. This will be my first geoserver project so might take a while to do it. <img class="emoticon" src="https://jira.codehaus.org/images/icons/emoticons/smile.gif" height="16" width="16" align="absmiddle" alt="" border="0"/></p>
CodeHaus Comment From: aaime - Time: Mon, 10 Nov 2014 02:19:53 -0600
---------------------
<p>No worries.The geotools-devel and geoserver-devel lists are good places to ask questions if you get in any trouble.</p>
One temporary option would be to to hide the column and avoid making the type read only, as commented in
Closing all non bug report tickets that has seen no activity in the last year. If you are interested in this ticket we encourage you to re-open it only after securing the necessary development resources.
Please to read this guide to learn how to best deal with this type of requests: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer