use of org.hisp.dhis.webapi.controller.exception.NotFoundException in project dhis2-core by dhis2.
the class ConfigurationController method setOfflineOrganisationUnitLevel.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@RequestMapping(value = "/offlineOrganisationUnitLevel", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setOfflineOrganisationUnitLevel(@RequestBody String uid) throws NotFoundException {
OrganisationUnitLevel organisationUnitLevel = identifiableObjectManager.get(OrganisationUnitLevel.class, uid);
if (organisationUnitLevel == null) {
throw new NotFoundException("Organisation unit level", uid);
}
Configuration config = configurationService.getConfiguration();
config.setOfflineOrganisationUnitLevel(organisationUnitLevel);
configurationService.setConfiguration(config);
}
use of org.hisp.dhis.webapi.controller.exception.NotFoundException in project dhis2-core by dhis2.
the class ConfigurationController method setSelfRegistrationOrgUnit.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@RequestMapping(value = "/selfRegistrationOrgUnit", method = RequestMethod.POST)
public void setSelfRegistrationOrgUnit(@RequestBody String uid) throws NotFoundException {
OrganisationUnit orgunit = identifiableObjectManager.get(OrganisationUnit.class, uid);
if (orgunit == null) {
throw new NotFoundException("Organisation unit", uid);
}
Configuration config = configurationService.getConfiguration();
config.setSelfRegistrationOrgUnit(orgunit);
configurationService.setConfiguration(config);
}
Aggregations