/** * @see org.openmrs.api.AdministrationService#purgeGlobalProperties(java.util.List) */ @Override public void purgeGlobalProperties(List<GlobalProperty> globalProperties) throws APIException { for (GlobalProperty globalProperty : globalProperties) { Context.getAdministrationService().purgeGlobalProperty(globalProperty); } }
public void purgeGlobalProperty(String propertyName) { GlobalProperty globalProperty = administrationService.getGlobalPropertyObject(propertyName); if (globalProperty != null) { administrationService.purgeGlobalProperty(globalProperty); } Assert.assertNull(administrationService.getGlobalProperty(propertyName)); }
@Test public void getAllowedLocales_shouldNotFailIfNotGlobalPropertyForLocalesAllowedDefinedYet() { adminService.purgeGlobalProperty( new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST)); adminService.getAllowedLocales(); }
@Test public void purgeGlobalProperty_shouldDeleteGlobalPropertyFromDatabase() { executeDataSet(ADMIN_INITIAL_DATA_XML); int allGlobalPropertiesSize = adminService.getAllGlobalProperties().size(); adminService.purgeGlobalProperty(adminService.getGlobalPropertyObject("a_valid_gp_key")); assertEquals(allGlobalPropertiesSize -1, adminService.getAllGlobalProperties().size()); }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#delete(java.lang.Object, * java.lang.String, org.openmrs.module.webservices.rest.web.RequestContext) */ @Override protected void delete(GlobalProperty property, String reason, RequestContext context) throws ResponseException { if (property == null) { return; } Context.getAdministrationService().purgeGlobalProperty(property); }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#purge(java.lang.Object, * org.openmrs.module.webservices.rest.web.RequestContext) */ @Override public void purge(GlobalProperty property, RequestContext context) throws ResponseException { if (property == null) { return; } Context.getAdministrationService().purgeGlobalProperty(property); }