jiveforums | 6 Oct 18:00

[RestAPI] create a new Restlet

Hi,

I try to create a new restlet in the last release of Nuxeo.
For that, I use a plugin.
First, I wrote my class (TestClass, name testClass) with the UploadRestlet model.
Second, I wrote the restlets-contrib.xml file (in the ressources/OSGI-INF directory):

<?xml version="1.0"?> 
<component name="org.nuxeo.ecm.platform.ui.web.restAPI.contrib"> 

        <extension 
        target="org.nuxeo.ecm.platform.ui.web.restAPI.service.PluggableRestletService" 
                point="restlets"> 
                <restletPlugin 
                		name="testClass" 
                        class="com.package.TestClass" 
                        enabled="true" 
                        useSeam="true"
                        useConversation="true"> 
                        <urlPatterns> 
                                <urlPattern> 
                                        /testClass
                                </urlPattern> 
                        </urlPatterns> 
                </restletPlugin> 
        </extension> 
</component> 

I've deployed my plugin and tried the following URL:
http://localhost:8080/nuxeo/restAPI/testClass
(Continue reading)

Tiry | 6 Oct 16:08

Re: [RestAPI] create a new Restlet

Did you declare your contribution in the jar MANIFEST ?

For example, in your MANIFEST, you should have something like :
Nuxeo-Component: OSGI-INF/restlets-contrib.xml

jiveforums-ecm <at> nuxeo.com a écrit :
> Hi,
>
> I try to create a new restlet in the last release of Nuxeo.
> For that, I use a plugin.
> First, I wrote my class (TestClass, name testClass) with the UploadRestlet model.
> Second, I wrote the restlets-contrib.xml file (in the ressources/OSGI-INF directory):
>
> <?xml version="1.0"?> 
> <component name="org.nuxeo.ecm.platform.ui.web.restAPI.contrib"> 
>
>         <extension 
>         target="org.nuxeo.ecm.platform.ui.web.restAPI.service.PluggableRestletService" 
>                 point="restlets"> 
>                 <restletPlugin 
>                 		name="testClass" 
>                         class="com.package.TestClass" 
>                         enabled="true" 
>                         useSeam="true"
>                         useConversation="true"> 
>                         <urlPatterns> 
>                                 <urlPattern> 
>                                         /testClass
>                                 </urlPattern> 
>                         </urlPatterns> 
(Continue reading)


Gmane