Commit ec30e557 authored by Jörg Richter's avatar Jörg Richter

REST API: change 4 get/query-assocs requests (#341)

BREAKING CHANGE

change 4 assoc requests:

## getAssoc()

    GET /core/association/{id}
    ->
    GET /core/assoc/{id}

## getAssocByValue

    GET /core/assoc/by_value/{uri}/{value}
    ->
    GET /core/assoc/type/{uri}/{value}

## queryAssocs

    GET /core/assoc/multi/by_value/{uri}/{value}
    ->
    GET /core/assocs/type/{uri}/query/{value}

## getAssoc(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2)

    GET /core/association/{assoc_type_uri}/{topic1_id}/{topic2_id}/{role_type1_uri}/{role_type2_uri}
    ->
    GET /core/assoc/{assoc_type_uri}/{topic1_id}/{topic2_id}/{role_type1_uri}/{role_type2_uri}
parent 55f15e16
Pipeline #9964 passed with stages
in 8 minutes and 1 second
......@@ -140,6 +140,8 @@ public interface CoreService {
* If no such association exists <code>null</code> is returned.
* If more than one association exist, a runtime exception is thrown.
*
* TODO: rename to "getAssocBetweenTopicAndTopic"
*
* @param assocTypeUri Assoc type filter. Pass <code>null</code> to switch filter off.
*/
Assoc getAssoc(String assocTypeUri, long topic1Id, long topic2Id, String roleTypeUri1, String roleTypeUri2);
......
......@@ -151,32 +151,29 @@ public class WebservicePlugin extends PluginActivator {
// === Associations ===
// Note: the "children" query parameter is handled by the core's JerseyResponseFilter
// ### TODO: change URI template "/assoc"
@GET
@Path("/association/{id}")
@Path("/assoc/{id}")
public Assoc getAssoc(@PathParam("id") long assocId) {
return dmx.getAssoc(assocId);
}
// Note: the "children" query parameter is handled by the core's JerseyResponseFilter
// ### TODO: change URI template
@GET
@Path("/assoc/by_value/{uri}/{value}")
@Path("/assoc/type/{uri}/{value}")
public Assoc getAssocByValue(@PathParam("uri") String typeUri, @PathParam("value") SimpleValue value) {
return dmx.getAssocByValue(typeUri, value);
}
// Note: the "children" query parameter is handled by the core's JerseyResponseFilter
// ### TODO: change URI template
@GET
@Path("/assoc/multi/by_value/{uri}/{value}")
@Path("/assocs/type/{uri}/query/{value}")
public List<Assoc> queryAssocs(@PathParam("uri") String typeUri, @PathParam("value") SimpleValue value) {
return dmx.queryAssocs(typeUri, value);
}
// Note: the "children" query parameter is handled by the core's JerseyResponseFilter
@GET
@Path("/association/{assoc_type_uri}/{topic1_id}/{topic2_id}/{role_type1_uri}/{role_type2_uri}")
@Path("/assoc/{assoc_type_uri}/{topic1_id}/{topic2_id}/{role_type1_uri}/{role_type2_uri}")
public Assoc getAssoc(@PathParam("assoc_type_uri") String assocTypeUri,
@PathParam("topic1_id") long topic1Id, @PathParam("topic2_id") long topic2Id,
@PathParam("role_type1_uri") String roleTypeUri1, @PathParam("role_type2_uri") String roleTypeUri2) {
......
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