Search in sources :

Example 1 with WorkflowRestClient

use of org.apache.syncope.client.console.rest.WorkflowRestClient in project syncope by apache.

the class WorkflowDefGETResource method newResourceResponse.

@Override
protected ResourceResponse newResourceResponse(final Attributes attributes) {
    final WorkflowDefinitionTO toGet = getWorkflowDefinition(attributes);
    ResourceResponse response = new ResourceResponse();
    response.disableCaching();
    response.setContentType(MediaType.APPLICATION_JSON);
    response.setTextEncoding(StandardCharsets.UTF_8.name());
    response.setWriteCallback(new WriteCallback() {

        @Override
        public void writeData(final Attributes attributes) throws IOException {
            IOUtils.copy(new WorkflowRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE, toGet.getKey()), attributes.getResponse().getOutputStream());
        }
    });
    return response;
}
Also used : WorkflowRestClient(org.apache.syncope.client.console.rest.WorkflowRestClient) WorkflowDefinitionTO(org.apache.syncope.common.lib.to.WorkflowDefinitionTO) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 WorkflowRestClient (org.apache.syncope.client.console.rest.WorkflowRestClient)1 WorkflowDefinitionTO (org.apache.syncope.common.lib.to.WorkflowDefinitionTO)1