@@ -264,9 +264,9 @@ public Response getComponents(@CookieParam(value = "user") Cookie userc, @Cookie
264264 * @return JSON
265265 */
266266 @ GET
267- @ Path ("/{uri : .+}" )
268- @ Produces (MediaType .APPLICATION_JSON )
269- public Response getComponent (@ PathParam ("uri " ) String uri ,
267+ @ Path ("/{id : .+}" )
268+ @ Produces ({ MediaType .APPLICATION_JSON , MediaType . TEXT_PLAIN } )
269+ public Response getComponent (@ PathParam ("id " ) String id ,
270270 @ CookieParam (value = "user" ) Cookie userc , @ CookieParam (value = "token" ) String token ) {
271271
272272 FrameworkUserManager frameworkUserManager ;
@@ -288,7 +288,7 @@ public Response getComponent(@PathParam("uri") String uri,
288288 try {
289289 ComponentManager manager =
290290 new ComponentManager (FrameworkConfiguration .getInstance ().getSystemRdfStoreManager ());
291- Component component = manager .getComponent (uri );
291+ Component component = manager .getComponent (id );
292292 // in fact not all properties should be accessible by any user
293293 if (!frameworkUserManager .isAdmin (user .getAccountURI ())) {
294294 for (Service s : component .getServices ())
@@ -301,10 +301,12 @@ public Response getComponent(@PathParam("uri") String uri,
301301
302302 } catch (ResourceNotFoundException e ) {
303303 log .error (e );
304- return Response .status (Response .Status .NOT_FOUND ).entity (e .getMessage ()).build ();
304+ return Response .status (Response .Status .NOT_FOUND ).entity (e .getMessage ())
305+ .type (MediaType .TEXT_PLAIN ).build ();
305306 } catch (Exception e ) {
306307 log .error (e );
307- return Response .status (Response .Status .INTERNAL_SERVER_ERROR ).entity (e .getMessage ()).build ();
308+ return Response .status (Response .Status .INTERNAL_SERVER_ERROR ).entity (e .getMessage ())
309+ .type (MediaType .TEXT_PLAIN ).build ();
308310 }
309311
310312 }
0 commit comments