use of org.olat.modules.docpool.DocumentPoolModule in project OpenOLAT by OpenOLAT.
the class DocumentPoolModuleWebService method getModuleConfiguration.
/**
* Return the configuration of the taxonomy module.
*
* @response.representation.200.qname {http://www.example.com}taxonomyModuleConfigurationVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc The configuration of the taxonomy module
* @response.representation.200.example {@link org.olat.modules.docpool.restapi.Examples#SAMPLE_DOCUMENTPOOLMODULECONFIGURATIONVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param httpRequest The HTTP request
* @return The module configuration
*/
@GET
@Path("module/configuration")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getModuleConfiguration(@Context HttpServletRequest httpRequest) {
Roles roles = getRoles(httpRequest);
if (!roles.isOLATAdmin()) {
return Response.serverError().status(Status.UNAUTHORIZED).build();
}
DocumentPoolModule taxonomyModule = CoreSpringFactory.getImpl(DocumentPoolModule.class);
DocumentPoolModuleConfigurationVO configVO = new DocumentPoolModuleConfigurationVO();
configVO.setEnabled(taxonomyModule.isEnabled());
configVO.setTaxonomyTreeKey(taxonomyModule.getTaxonomyTreeKey());
return Response.ok(configVO).build();
}
use of org.olat.modules.docpool.DocumentPoolModule in project openolat by klemens.
the class DocumentPoolModuleWebService method getModuleConfiguration.
/**
* Return the configuration of the taxonomy module.
*
* @response.representation.200.qname {http://www.example.com}taxonomyModuleConfigurationVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc The configuration of the taxonomy module
* @response.representation.200.example {@link org.olat.modules.docpool.restapi.Examples#SAMPLE_DOCUMENTPOOLMODULECONFIGURATIONVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param httpRequest The HTTP request
* @return The module configuration
*/
@GET
@Path("module/configuration")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getModuleConfiguration(@Context HttpServletRequest httpRequest) {
Roles roles = getRoles(httpRequest);
if (!roles.isOLATAdmin()) {
return Response.serverError().status(Status.UNAUTHORIZED).build();
}
DocumentPoolModule taxonomyModule = CoreSpringFactory.getImpl(DocumentPoolModule.class);
DocumentPoolModuleConfigurationVO configVO = new DocumentPoolModuleConfigurationVO();
configVO.setEnabled(taxonomyModule.isEnabled());
configVO.setTaxonomyTreeKey(taxonomyModule.getTaxonomyTreeKey());
return Response.ok(configVO).build();
}
Aggregations