Hi all, wanted to throw my two cents in about the IndexController.  The
IndexController currently builds the list of links from a private method
inside of the IndexController, which makes it impossible to extend,
override, or append to.  Any logic or code that produces dynamic content
should really not be inside of a controller, as the controller should only
serve to define the interface or entry point to the code base.  That being
said, I would recommend another service class (something like
RestIndexUrlService) that is responsible for building the links that get
generated for the REST index page.

The only endpoints currently displayed on the page are those discovered from
Spring MVC's RequestMappingHandlerMapping.  It would be nice to provide an
interface such as "RestIndexUrlProvider" that defines a single method
"Set<String> getLinks();".  The RestIndexUrlService could potentially call
"GeoServerExtensions.extension(RestIndexUlrProvider)" to get all objects
that implement the interface then aggregate all of the results in a new
Set<String> that gets returned to the index controller.   
 This would allow other extensions or plugins the ability to provide their
own endpoints to be displayed on the page without the need for them to be
implemented via Spring, without the odd possibility that they aren't in the
same web context as the IndexController itself, or to provide any other
customization that may be necessary.

The list of endpoints on the rest page have grown quite a bit.  To take it
one step further, instead of providing Set of strings with urls, the page
could be updated to group related links under some sort of category, ie, GWC
endpoints would all appear under a GWC header element.  In that case, the
RestIndexUrlProvider would define a Map<String, String> vs a Set, where the
key is the "title" and the value is the URL path.

None of this obviously is a release blocker, but it seems it would be a very
nice improvement and I just wanted to share my thoughts.

Cheers

Josh



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to