use of org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat in project syncope by apache.
the class WorkflowServiceImpl method set.
@Override
public void set(final String anyType, final String key, final String definition) {
WorkflowDefinitionFormat format = messageContext.getHttpHeaders().getMediaType().equals(MediaType.APPLICATION_JSON_TYPE) ? WorkflowDefinitionFormat.JSON : WorkflowDefinitionFormat.XML;
logic.importDefinition(anyType, key, format, definition);
}
use of org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat in project syncope by apache.
the class WorkflowServiceImpl method get.
@Override
public Response get(final String anyType, final String key) {
WorkflowDefinitionFormat format = messageContext.getHttpHeaders().getAcceptableMediaTypes().contains(MediaType.APPLICATION_JSON_TYPE) ? WorkflowDefinitionFormat.JSON : WorkflowDefinitionFormat.XML;
StreamingOutput sout = (os) -> logic.exportDefinition(anyType, key, format, os);
return Response.ok(sout).type(format == WorkflowDefinitionFormat.JSON ? MediaType.APPLICATION_JSON_TYPE : MediaType.APPLICATION_XHTML_XML_TYPE).build();
}
Aggregations