Commit f77bbe38 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

[CRV-302] Fixed REST interface for import from CHOReVOLUTION studio

parent c4f1a57d
......@@ -26,7 +26,7 @@ public class ChoreographyRestClient extends BaseRestClient {
private static final long serialVersionUID = -2018208424159468912L;
public ChoreographyTO getChoreography(final String choreographyKey) {
return getService(ChoreographyService.class).read(choreographyKey);
return getService(ChoreographyService.class).read(choreographyKey).readEntity(ChoreographyTO.class);
}
public void deleteChoreography(final String choreographyKey) {
......
......@@ -15,14 +15,12 @@
*/
package org.apache.syncope.common.rest.api.service;
import eu.chorevolution.idm.common.to.ChoreographyTO;
import eu.chorevolution.idm.common.types.ChoreographyAction;
import eu.chorevolution.idm.common.types.ChoreographyOperation;
import eu.chorevolution.idm.common.types.SecurityFilterInfo;
import eu.chorevolution.idm.common.types.ServiceAction;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
......@@ -52,7 +50,7 @@ public interface ChoreographyService extends JAXRSService {
@Path("{key}")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ChoreographyTO read(@NotNull @PathParam("key") String choreographyKey);
Response read(@NotNull @PathParam("key") String choreographyKey);
/**
* Retrieves choreography list
......@@ -61,7 +59,7 @@ public interface ChoreographyService extends JAXRSService {
*/
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ChoreographyTO> list();
Response list();
/**
* Creates a choreography.
......
......@@ -24,6 +24,7 @@ import org.apache.syncope.core.logic.ChoreographyLogic;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.rest.api.RESTHeaders;
......@@ -47,13 +48,13 @@ public class ChoreographyServiceImpl extends AbstractServiceImpl implements Chor
}
@Override
public ChoreographyTO read(final String choreographyKey) {
return logic.getChoreography(choreographyKey);
public Response read(final String choreographyKey) {
return Response.ok(logic.getChoreography(choreographyKey)).build();
}
@Override
public List<ChoreographyTO> list() {
return logic.getChoreographyList();
public Response list() {
return Response.ok(new GenericEntity<List<ChoreographyTO>>(logic.getChoreographyList()) { }).build();
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment