On Wed, Apr 8, 2015 at 3:40 PM, Emanuele Tajariol <e...@geo-solutions.it>
wrote:

> Hi Niels,
>
> GeoFence used to provide a REST interface,
>
> https://github.com/geoserver/geofence/tree/master/src/services/modules/rest
> but, after the last improvements and refactoring, it needs some review and
> fixing.
> You can find the (old) related doc here:
>     http://goo.gl/NjkvGn
> (it was partially ported into github wiki pages, but the paragraph
> formatting
> is awful there).
>
> REST services are implemented using CXF, so it is also to be seen if CXF
> (and
> its transitive deps) will not present any conflict when running inside
> GeoServer.
>
> It's also to be checked/decided if the GeoServer dispatcher could/should be
> used to route such REST calls.
> I guess Andrea could give some hints about how to publish the API.
>

Hi,
I guess it depends on where you want to expose the REST api.

If we are talking about adding it below the geoserver/rest endpoint, then
I'm afraid you will have to re-code the geofence rest api using restlet.

If however it's ok to have them under geoserver/geofence/rest (a parallel
to geoserver/gwc/... urls) then there is a chance it can be done without
too much
effort, assuming CXF and its dependencies can be mixed in the GeoServer
classpath without problems.

The GeoWebCache own dispatcher is a Spring AbstractController, it's declared
as a bean in the GeoServer app context and then mapped to its own
url subset as follows:

<bean id="gwcUrlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="alwaysUseFullPath" value="true"/>
    <property name="mappings">
      <props>
        <!-- prop key="/gwc/service/**">geowebcacheDispatcher</prop-->
        <prop key="/gwc/demo/**">geowebcacheDispatcher</prop>
    <prop key="/gwc/proxy/**">gwcProxyDispatcher</prop>
    <prop key="/gwc/**">geowebcacheDispatcher</prop>
      </props>
    </property>
  </bean>

Now, in GeoFence CXF is enabled using this declaration in web.xml:

<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>

Spring provides a particular AbstractController subclass
called ServletForwardingController
that can forward to a servlet... it's not exactly what we need, but should
be close enough.
So, I guess one could create a special AbstractController wrapping the
CXFServlet, and
 then binding it to /geofence/rest
That is hopefully going to do the trick

Cheers
Andrea

-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to