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')")
@PostMapping("/selfRegistrationOrgUnit")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setSelfRegistrationOrgUnit(@RequestBody String uid) throws NotFoundException {
uid = trim(uid);
OrganisationUnit orgunit = identifiableObjectManager.get(OrganisationUnit.class, uid);
if (orgunit == null) {
throw new NotFoundException("Organisation unit", uid);
}
Configuration configuration = configurationService.getConfiguration();
configuration.setSelfRegistrationOrgUnit(orgunit);
configurationService.setConfiguration(configuration);
}
use of org.hisp.dhis.webapi.controller.exception.NotFoundException in project dhis2-core by dhis2.
the class ConfigurationController method setSystemUpdateNotificationRecipients.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@PostMapping("/systemUpdateNotificationRecipients")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setSystemUpdateNotificationRecipients(@RequestBody String uid) throws NotFoundException {
uid = trim(uid);
UserGroup group = identifiableObjectManager.get(UserGroup.class, uid);
if (group == null) {
throw new NotFoundException("User group", uid);
}
Configuration configuration = configurationService.getConfiguration();
configuration.setSystemUpdateNotificationRecipients(group);
configurationService.setConfiguration(configuration);
}
use of org.hisp.dhis.webapi.controller.exception.NotFoundException in project dhis2-core by dhis2.
the class ConfigurationController method setInfrastructuralIndicators.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@PostMapping("/infrastructuralIndicators")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setInfrastructuralIndicators(@RequestBody String uid) throws NotFoundException {
uid = trim(uid);
IndicatorGroup group = identifiableObjectManager.get(IndicatorGroup.class, uid);
if (group == null) {
throw new NotFoundException("Indicator group", uid);
}
Configuration configuration = configurationService.getConfiguration();
configuration.setInfrastructuralIndicators(group);
configurationService.setConfiguration(configuration);
}
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')")
@PostMapping("/offlineOrganisationUnitLevel")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setOfflineOrganisationUnitLevel(@RequestBody String uid) throws NotFoundException {
uid = trim(uid);
OrganisationUnitLevel organisationUnitLevel = identifiableObjectManager.get(OrganisationUnitLevel.class, uid);
if (organisationUnitLevel == null) {
throw new NotFoundException("Organisation unit level", uid);
}
Configuration configuration = configurationService.getConfiguration();
configuration.setOfflineOrganisationUnitLevel(organisationUnitLevel);
configurationService.setConfiguration(configuration);
}
use of org.hisp.dhis.webapi.controller.exception.NotFoundException in project dhis2-core by dhis2.
the class ConfigurationController method setFacilityOrgUnitLevel.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@PostMapping("/facilityOrgUnitLevel")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setFacilityOrgUnitLevel(@RequestBody String uid) throws NotFoundException {
uid = trim(uid);
OrganisationUnitLevel level = identifiableObjectManager.get(OrganisationUnitLevel.class, uid);
if (level == null) {
throw new NotFoundException("Organisation unit level", uid);
}
Configuration configuration = configurationService.getConfiguration();
configuration.setFacilityOrgUnitLevel(level);
configurationService.setConfiguration(configuration);
}
Aggregations