karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-3827) Cave rest service doesn't retrieve the repositories
Date Wed, 15 Nov 2017 06:43:00 GMT

    [ https://issues.apache.org/jira/browse/KARAF-3827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16253027#comment-16253027
] 

ASF GitHub Bot commented on KARAF-3827:
---------------------------------------

fpapon commented on a change in pull request #6: [KARAF-3827] - Fix Cave rest service doesn't
retrieve the repositories
URL: https://github.com/apache/karaf-cave/pull/6#discussion_r151044250
 
 

 ##########
 File path: server/rest/src/main/java/org/apache/karaf/cave/server/rest/Service.java
 ##########
 @@ -47,9 +48,9 @@ public Service(CaveRepositoryService service) {
      * @throws Exception in case of creation failure.
      */
     @POST
-    @Consumes("application/xml")
-    @Produces("application/xml")
-    public Repository create(String name, boolean scan) throws Exception {
+    @Path("/repositories")
+    @Produces("application/json")
 
 Review comment:
   We need to add a JSONProvider to the Servlet implementing CFXNonSpringServlet :
   ```
           String alias = getString("cave.rest.alias", "/cave/rest");
           Hashtable<String, String> config = new Hashtable<>();
           if (getConfiguration() != null) {
               for (Enumeration<String> e = getConfiguration().keys(); e.hasMoreElements();)
{
                   String key = e.nextElement();
                   String val = getConfiguration().get(key).toString();
                   config.put(key, val);
               }
           }
           this.alias = alias;
           this.servlet = new CaveRestServlet(service);
           this.httpService.registerServlet(this.alias, this.servlet, config, null);
   ```
   I've already done this with blueprint but not in a java way, I can try to do it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Cave rest service doesn't retrieve the repositories
> ---------------------------------------------------
>
>                 Key: KARAF-3827
>                 URL: https://issues.apache.org/jira/browse/KARAF-3827
>             Project: Karaf
>          Issue Type: Bug
>          Components: cave-rest
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>             Fix For: cave-4.0.1
>
>
> Even if a repository exists:
> {code}
> karaf@root()> cave:repositories 
> Name          | Location
> -----------------------------------------------------------------------------
> my-repository | /home/jbonofre/bin/apache-karaf-4.0.0/data/cave/my-repository
> {code}
> accessing the Cave REST API on:
> {code}
> http://localhost:8181/cave/rest/repositories
> {code}
> just give:
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <cave-repositorys><cave-repository/></cave-repositorys>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message