Changeset 3385
- Timestamp:
- 02/14/08 15:37:53 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/dss/src/org/openmrs/module/dss/DssActivator.java
r3261 r3385 8 8 import org.openmrs.api.AdministrationService; 9 9 import org.openmrs.api.context.Context; 10 import org.openmrs.api.context.ContextAuthenticationException; 10 11 import org.openmrs.module.Activator; 11 12 … … 31 32 private void checkGlobalProperties() 32 33 { 33 AdministrationService adminService = Context.getAdministrationService(); 34 Iterator<GlobalProperty> properties = adminService 35 .getGlobalProperties().iterator(); 36 GlobalProperty currProperty = null; 37 String currValue = null; 38 String currName = null; 34 try 35 { 36 AdministrationService adminService = Context.getAdministrationService(); 37 Context.authenticate(adminService 38 .getGlobalProperty("scheduler.username"), adminService 39 .getGlobalProperty("scheduler.password")); 40 Iterator<GlobalProperty> properties = adminService 41 .getGlobalProperties().iterator(); 42 GlobalProperty currProperty = null; 43 String currValue = null; 44 String currName = null; 39 45 40 while (properties.hasNext()) 41 { 42 currProperty = properties.next(); 43 currName = currProperty.getProperty(); 44 if (currName.startsWith("dss")) 46 while (properties.hasNext()) 45 47 { 46 currValue = currProperty.getPropertyValue(); 47 if (currValue == null || currValue.length() == 0) 48 currProperty = properties.next(); 49 currName = currProperty.getProperty(); 50 if (currName.startsWith("dss")) 48 51 { 49 this.log.error("You must set a value for global property: " 50 + currName); 52 currValue = currProperty.getPropertyValue(); 53 if (currValue == null || currValue.length() == 0) 54 { 55 this.log.error("You must set a value for global property: " 56 + currName); 57 } 51 58 } 52 59 } 60 } catch (ContextAuthenticationException e) 61 { 62 this.log.error("Error checking global properties for dss module"); 63 53 64 } 54 65 }