Search in sources :

Example 11 with ResourceOptionsDto

use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.

the class UserRestServiceImpl method availableOperations.

public ResourceOptionsDto availableOperations(UriInfo context) {
    final IdentityService identityService = getIdentityService();
    UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(relativeRootResourcePath).path(UserRestService.PATH);
    ResourceOptionsDto resourceOptionsDto = new ResourceOptionsDto();
    // GET /
    URI baseUri = baseUriBuilder.build();
    resourceOptionsDto.addReflexiveLink(baseUri, HttpMethod.GET, "list");
    // GET /count
    URI countUri = baseUriBuilder.clone().path("/count").build();
    resourceOptionsDto.addReflexiveLink(countUri, HttpMethod.GET, "count");
    // POST /create
    if (!identityService.isReadOnly() && isAuthorized(CREATE)) {
        URI createUri = baseUriBuilder.clone().path("/create").build();
        resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");
    }
    return resourceOptionsDto;
}
Also used : IdentityService(org.camunda.bpm.engine.IdentityService) ResourceOptionsDto(org.camunda.bpm.engine.rest.dto.ResourceOptionsDto) UriBuilder(javax.ws.rs.core.UriBuilder) URI(java.net.URI)

Example 12 with ResourceOptionsDto

use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.

the class FilterRestServiceImpl method availableOperations.

public ResourceOptionsDto availableOperations(UriInfo context) {
    UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(relativeRootResourcePath).path(FilterRestService.PATH);
    ResourceOptionsDto resourceOptionsDto = new ResourceOptionsDto();
    // GET /
    URI baseUri = baseUriBuilder.build();
    resourceOptionsDto.addReflexiveLink(baseUri, HttpMethod.GET, "list");
    // GET /count
    URI countUri = baseUriBuilder.clone().path("/count").build();
    resourceOptionsDto.addReflexiveLink(countUri, HttpMethod.GET, "count");
    // POST /create
    if (isAuthorized(CREATE)) {
        URI createUri = baseUriBuilder.clone().path("/create").build();
        resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");
    }
    return resourceOptionsDto;
}
Also used : ResourceOptionsDto(org.camunda.bpm.engine.rest.dto.ResourceOptionsDto) UriBuilder(javax.ws.rs.core.UriBuilder) URI(java.net.URI)

Example 13 with ResourceOptionsDto

use of org.camunda.bpm.engine.rest.dto.ResourceOptionsDto in project camunda-bpm-platform by camunda.

the class GroupRestServiceImpl method availableOperations.

public ResourceOptionsDto availableOperations(UriInfo context) {
    final IdentityService identityService = getIdentityService();
    UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(relativeRootResourcePath).path(GroupRestService.PATH);
    ResourceOptionsDto resourceOptionsDto = new ResourceOptionsDto();
    // GET /
    URI baseUri = baseUriBuilder.build();
    resourceOptionsDto.addReflexiveLink(baseUri, HttpMethod.GET, "list");
    // GET /count
    URI countUri = baseUriBuilder.clone().path("/count").build();
    resourceOptionsDto.addReflexiveLink(countUri, HttpMethod.GET, "count");
    // POST /create
    if (!identityService.isReadOnly() && isAuthorized(CREATE)) {
        URI createUri = baseUriBuilder.clone().path("/create").build();
        resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");
    }
    return resourceOptionsDto;
}
Also used : IdentityService(org.camunda.bpm.engine.IdentityService) ResourceOptionsDto(org.camunda.bpm.engine.rest.dto.ResourceOptionsDto) UriBuilder(javax.ws.rs.core.UriBuilder) URI(java.net.URI)

Aggregations

URI (java.net.URI)13 ResourceOptionsDto (org.camunda.bpm.engine.rest.dto.ResourceOptionsDto)13 UriBuilder (javax.ws.rs.core.UriBuilder)6 IdentityService (org.camunda.bpm.engine.IdentityService)2