org.openmrs.api.impl
Class AdministrationServiceImpl

java.lang.Object
  extended by org.openmrs.api.impl.BaseOpenmrsService
      extended by org.openmrs.api.impl.AdministrationServiceImpl
All Implemented Interfaces:
AdministrationService, GlobalPropertyListener, OpenmrsService

public class AdministrationServiceImpl
extends BaseOpenmrsService
implements AdministrationService, GlobalPropertyListener

Default implementation of the administration services. This class should not be used on its own. The current OpenMRS implementation should be fetched from the Context

See Also:
AdministrationService, Context

Field Summary
protected  AdministrationDAO dao
           
protected  org.apache.commons.logging.Log log
           
protected  java.util.SortedMap<java.lang.String,java.lang.String> systemVariables
          Static-ish variable used to cache the system variables.
 
Constructor Summary
AdministrationServiceImpl()
          Default empty constructor
 
Method Summary
 void addGlobalProperty(GlobalProperty gp)
          Deprecated.  
 void addGlobalProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Deprecated.  
 void addGlobalPropertyListener(GlobalPropertyListener listener)
          Allows code to be notified when a global property is created/edited/deleted.
 void createConceptClass(ConceptClass cc)
          Deprecated. moved to ConceptService
 void createConceptDatatype(ConceptDatatype cd)
          Deprecated. moved to ConceptService
 void createConceptProposal(ConceptProposal cp)
          Deprecated. moved to ConceptService
 void createEncounterType(EncounterType encounterType)
          Deprecated.  
 void createFieldType(FieldType fieldType)
          Deprecated.  
 void createLocation(Location location)
          Deprecated.  
 void createMimeType(MimeType mimeType)
          Deprecated. use ObsService.saveMimeType(MimeType)
 void createPatientIdentifierType(PatientIdentifierType patientIdentifierType)
          Deprecated. replaced by PatientService.savePatientIdentifierType(PatientIdentifierType)
 void createPrivilege(Privilege privilege)
          Deprecated.  
 void createReport(Report report)
          Deprecated. see reportingcompatibility module
 void createReportObject(AbstractReportObject reportObject)
          Deprecated. see reportingcompatibility module
 void createRole(Role role)
          Deprecated.  
 void createTribe(Tribe tribe)
          Deprecated.  
 void deleteConceptClass(ConceptClass cc)
          Deprecated. moved to ConceptService
 void deleteConceptDatatype(ConceptDatatype cd)
          Deprecated. moved to ConceptService
 void deleteEncounterType(EncounterType encounterType)
          Deprecated.  
 void deleteFieldType(FieldType fieldType)
          Deprecated.  
 void deleteGlobalProperty(java.lang.String propertyName)
          Deprecated.  
 void deleteLocation(Location location)
          Deprecated.  
 void deleteMimeType(MimeType mimeType)
          Deprecated. use ObsService.purgeMimeType(MimeType)
 void deletePatientIdentifierType(PatientIdentifierType patientIdentifierType)
          Deprecated. replaced by PatientService.purgePatientIdentifierType(PatientIdentifierType)
 void deletePrivilege(Privilege privilege)
          Deprecated.  
 void deleteReport(Report report)
          Deprecated. see reportingcompatibility module
 void deleteReportObject(java.lang.Integer reportObjectId)
          Deprecated. see reportingcompatibility module
 void deleteRole(Role role)
          Deprecated.  
 void deleteTribe(Tribe tribe)
          Deprecated.  
 java.util.List<java.util.List<java.lang.Object>> executeSQL(java.lang.String sql, boolean selectOnly)
          Runs the sql on the database.
 java.util.List<GlobalProperty> getAllGlobalProperties()
          Get a list of all global properties in the system
 java.util.List<java.util.Locale> getAllowedLocales()
          Gets the list of locales which the administrator has allowed for use on the system.
 java.util.List<GlobalProperty> getGlobalProperties()
          Deprecated.  
 java.util.List<GlobalProperty> getGlobalPropertiesByPrefix(java.lang.String prefix)
          Gets all global properties that begin with prefix.
 java.util.List<GlobalProperty> getGlobalPropertiesBySuffix(java.lang.String suffix)
          Gets all global properties that end with suffix.
 java.lang.String getGlobalProperty(java.lang.String propertyName)
          Gets the global property that has the given propertyName.
 java.lang.String getGlobalProperty(java.lang.String propertyName, java.lang.String defaultValue)
          Gets the global property that has the given propertyName
 GlobalProperty getGlobalPropertyByUuid(java.lang.String uuid)
          Get a global property by its uuid.
 GlobalProperty getGlobalPropertyObject(java.lang.String propertyName)
          Gets the global property that has the given propertyName
<T> T
getGlobalPropertyValue(java.lang.String propertyName, T defaultValue)
          Returns a global property according to the type specified
 ImplementationId getImplementationId()
          Get the implementation id stored for this server Returns null if no implementation id has been successfully set yet
 java.util.Collection<?> getMRNGeneratorLog()
          Deprecated.  
 java.util.Set<java.util.Locale> getPresentationLocales()
          Gets the list of locales for which localized messages are available for the user interface (presentation layer).
 java.util.SortedMap<java.lang.String,java.lang.String> getSystemVariables()
          Get a listing or important variables used in openmrs
 void globalPropertyChanged(GlobalProperty newValue)
          Called after a global property is created or updated
 void globalPropertyDeleted(java.lang.String propertyName)
          Called after a global property is deleted
 void mapConceptProposalToConcept(ConceptProposal cp, Concept mappedConcept)
          Deprecated. moved to ConceptService
 void mrnGeneratorLog(java.lang.String site, java.lang.Integer start, java.lang.Integer count)
          Deprecated.  
 void purgeGlobalProperties(java.util.List<GlobalProperty> globalProperties)
          Completely remove the given global properties from the database
 void purgeGlobalProperty(GlobalProperty globalProperty)
          Completely remove the given global property from the database
 void rejectConceptProposal(ConceptProposal cp)
          Deprecated. moved to ConceptService
 void removeGlobalPropertyListener(GlobalPropertyListener listener)
          Removes a GlobalPropertyListener previously registered by AdministrationService.addGlobalPropertyListener(GlobalPropertyListener)
 void retireTribe(Tribe tribe)
          Deprecated.  
 java.util.List<GlobalProperty> saveGlobalProperties(java.util.List<GlobalProperty> props)
          Save the given list of global properties to the database overwriting all values with the given values.
 GlobalProperty saveGlobalProperty(GlobalProperty gp)
          Save the given global property to the database
 void setAdministrationDAO(AdministrationDAO dao)
          Used by Spring to set the specific/chosen database access implementation
 void setEventListeners(EventListeners eventListeners)
           
 void setGlobalProperties(java.util.List<GlobalProperty> props)
          Deprecated.  
 void setGlobalProperty(GlobalProperty gp)
          Deprecated.  
 void setGlobalProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Deprecated.  
 void setImplementationId(ImplementationId implementationId)
          Set the given implementationId as this implementation's unique id
 boolean supportsPropertyName(java.lang.String propertyName)
          Asks this listener whether it wants to be notified about the given property name
 void unretireTribe(Tribe tribe)
          Deprecated.  
 void updateConceptClass(ConceptClass cc)
          Deprecated. moved to ConceptService
 void updateConceptDatatype(ConceptDatatype cd)
          Deprecated. moved to ConceptService
 void updateConceptProposal(ConceptProposal cp)
          Deprecated. moved to ConceptService
 void updateConceptSetDerived()
          Deprecated. moved to ConceptService
 void updateConceptSetDerived(Concept concept)
          Deprecated. moved to ConceptService
 void updateConceptWord(Concept concept)
          Deprecated. moved to ConceptServiceImpl
 void updateConceptWords()
          Deprecated. moved to ConceptServiceImpl
 void updateConceptWords(java.lang.Integer conceptIdStart, java.lang.Integer conceptIdEnd)
          Deprecated. moved to ConceptService
 void updateEncounterType(EncounterType encounterType)
          Deprecated.  
 void updateFieldType(FieldType fieldType)
          Deprecated.  
 void updateLocation(Location location)
          Deprecated.  
 void updateMimeType(MimeType mimeType)
          Deprecated. use ObsService.saveMimeType(MimeType)
 void updatePatientIdentifierType(PatientIdentifierType patientIdentifierType)
          Deprecated. replaced by PatientService.savePatientIdentifierType(PatientIdentifierType)
 void updatePrivilege(Privilege privilege)
          Deprecated.  
 void updateReport(Report report)
          Deprecated. see reportingcompatibility module
 void updateReportObject(AbstractReportObject reportObject)
          Deprecated. see reportingcompatibility module
 void updateRole(Role role)
          Deprecated.  
 void updateTribe(Tribe tribe)
          Deprecated.  
 
Methods inherited from class org.openmrs.api.impl.BaseOpenmrsService
onShutdown, onStartup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Field Detail

log

protected org.apache.commons.logging.Log log

dao

protected AdministrationDAO dao

systemVariables

protected java.util.SortedMap<java.lang.String,java.lang.String> systemVariables
Static-ish variable used to cache the system variables. This is not static so that every time a module is loaded or removed the variable is destroyed (along with the administration service) and recreated the next time it is called

Constructor Detail

AdministrationServiceImpl

public AdministrationServiceImpl()
Default empty constructor

Method Detail

setAdministrationDAO

public void setAdministrationDAO(AdministrationDAO dao)
Description copied from interface: AdministrationService
Used by Spring to set the specific/chosen database access implementation

Specified by:
setAdministrationDAO in interface AdministrationService
Parameters:
dao - The dao implementation to use
See Also:
AdministrationService.setAdministrationDAO(org.openmrs.api.db.AdministrationDAO)

setEventListeners

public void setEventListeners(EventListeners eventListeners)

createEncounterType

@Deprecated
public void createEncounterType(EncounterType encounterType)
                         throws APIException
Deprecated. 

Specified by:
createEncounterType in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.createEncounterType(org.openmrs.EncounterType)

updateEncounterType

@Deprecated
public void updateEncounterType(EncounterType encounterType)
                         throws APIException
Deprecated. 

Specified by:
updateEncounterType in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.updateEncounterType(org.openmrs.EncounterType)

deleteEncounterType

@Deprecated
public void deleteEncounterType(EncounterType encounterType)
                         throws APIException
Deprecated. 

Specified by:
deleteEncounterType in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.deleteEncounterType(org.openmrs.EncounterType)

createPatientIdentifierType

@Deprecated
public void createPatientIdentifierType(PatientIdentifierType patientIdentifierType)
                                 throws APIException
Deprecated. replaced by PatientService.savePatientIdentifierType(PatientIdentifierType)

Specified by:
createPatientIdentifierType in interface AdministrationService
Throws:
APIException
See Also:
PatientService.savePatientIdentifierType(PatientIdentifierType)

updatePatientIdentifierType

@Deprecated
public void updatePatientIdentifierType(PatientIdentifierType patientIdentifierType)
                                 throws APIException
Deprecated. replaced by PatientService.savePatientIdentifierType(PatientIdentifierType)

Specified by:
updatePatientIdentifierType in interface AdministrationService
Throws:
APIException
See Also:
PatientService.savePatientIdentifierType(PatientIdentifierType)

deletePatientIdentifierType

@Deprecated
public void deletePatientIdentifierType(PatientIdentifierType patientIdentifierType)
                                 throws APIException
Deprecated. replaced by PatientService.purgePatientIdentifierType(PatientIdentifierType)

Specified by:
deletePatientIdentifierType in interface AdministrationService
Throws:
APIException
See Also:
PatientService.purgePatientIdentifierType(PatientIdentifierType)

createTribe

@Deprecated
public void createTribe(Tribe tribe)
                 throws APIException
Deprecated. 

Create a new Tribe

Specified by:
createTribe in interface AdministrationService
Parameters:
tribe - Tribe to create
Throws:
APIException

updateTribe

@Deprecated
public void updateTribe(Tribe tribe)
                 throws APIException
Deprecated. 

Update Tribe

Specified by:
updateTribe in interface AdministrationService
Parameters:
tribe - Tribe to update
Throws:
APIException

deleteTribe

@Deprecated
public void deleteTribe(Tribe tribe)
                 throws APIException
Deprecated. 

Delete Tribe

Specified by:
deleteTribe in interface AdministrationService
Parameters:
tribe - Tribe to delete
Throws:
APIException

retireTribe

@Deprecated
public void retireTribe(Tribe tribe)
                 throws APIException
Deprecated. 

Retire Tribe

Specified by:
retireTribe in interface AdministrationService
Parameters:
tribe - Tribe to retire
Throws:
APIException

unretireTribe

@Deprecated
public void unretireTribe(Tribe tribe)
                   throws APIException
Deprecated. 

Unretire Tribe

Specified by:
unretireTribe in interface AdministrationService
Parameters:
tribe - Tribe to unretire
Throws:
APIException

createFieldType

@Deprecated
public void createFieldType(FieldType fieldType)
                     throws APIException
Deprecated. 

Specified by:
createFieldType in interface AdministrationService
Throws:
APIException

updateFieldType

@Deprecated
public void updateFieldType(FieldType fieldType)
                     throws APIException
Deprecated. 

Specified by:
updateFieldType in interface AdministrationService
Throws:
APIException

deleteFieldType

@Deprecated
public void deleteFieldType(FieldType fieldType)
                     throws APIException
Deprecated. 

Specified by:
deleteFieldType in interface AdministrationService
Throws:
APIException

createMimeType

@Deprecated
public void createMimeType(MimeType mimeType)
                    throws APIException
Deprecated. use ObsService.saveMimeType(MimeType)

Specified by:
createMimeType in interface AdministrationService
Throws:
APIException

updateMimeType

@Deprecated
public void updateMimeType(MimeType mimeType)
                    throws APIException
Deprecated. use ObsService.saveMimeType(MimeType)

Specified by:
updateMimeType in interface AdministrationService
Throws:
APIException

deleteMimeType

@Deprecated
public void deleteMimeType(MimeType mimeType)
                    throws APIException
Deprecated. use ObsService.purgeMimeType(MimeType)

Specified by:
deleteMimeType in interface AdministrationService
Throws:
APIException

createLocation

@Deprecated
public void createLocation(Location location)
                    throws APIException
Deprecated. 

Specified by:
createLocation in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.createLocation(org.openmrs.Location)

updateLocation

@Deprecated
public void updateLocation(Location location)
                    throws APIException
Deprecated. 

Specified by:
updateLocation in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.updateLocation(org.openmrs.Location)

deleteLocation

@Deprecated
public void deleteLocation(Location location)
                    throws APIException
Deprecated. 

Specified by:
deleteLocation in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.deleteLocation(org.openmrs.Location)

createRole

@Deprecated
public void createRole(Role role)
                throws APIException
Deprecated. 

Specified by:
createRole in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.createRole(org.openmrs.Role)

updateRole

@Deprecated
public void updateRole(Role role)
                throws APIException
Deprecated. 

Specified by:
updateRole in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.updateRole(org.openmrs.Role)

deleteRole

@Deprecated
public void deleteRole(Role role)
                throws APIException
Deprecated. 

Specified by:
deleteRole in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.deleteRole(org.openmrs.Role)

createPrivilege

@Deprecated
public void createPrivilege(Privilege privilege)
                     throws APIException
Deprecated. 

Specified by:
createPrivilege in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.createPrivilege(org.openmrs.Privilege)

updatePrivilege

@Deprecated
public void updatePrivilege(Privilege privilege)
                     throws APIException
Deprecated. 

Specified by:
updatePrivilege in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.updatePrivilege(org.openmrs.Privilege)

deletePrivilege

@Deprecated
public void deletePrivilege(Privilege privilege)
                     throws APIException
Deprecated. 

Specified by:
deletePrivilege in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.deletePrivilege(org.openmrs.Privilege)

createConceptClass

@Deprecated
public void createConceptClass(ConceptClass cc)
                        throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Create a new ConceptClass

Specified by:
createConceptClass in interface AdministrationService
Parameters:
cc - ConceptClass to create
Throws:
APIException

updateConceptClass

@Deprecated
public void updateConceptClass(ConceptClass cc)
                        throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Update ConceptClass

Specified by:
updateConceptClass in interface AdministrationService
Parameters:
cc - ConceptClass to update
Throws:
APIException

deleteConceptClass

@Deprecated
public void deleteConceptClass(ConceptClass cc)
                        throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Delete ConceptClass

Specified by:
deleteConceptClass in interface AdministrationService
Parameters:
cc - ConceptClass to delete
Throws:
APIException

createConceptDatatype

@Deprecated
public void createConceptDatatype(ConceptDatatype cd)
                           throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Create a new ConceptDatatype

Specified by:
createConceptDatatype in interface AdministrationService
Parameters:
cd - ConceptDatatype to create
Throws:
APIException

updateConceptDatatype

@Deprecated
public void updateConceptDatatype(ConceptDatatype cd)
                           throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Update ConceptDatatype

Specified by:
updateConceptDatatype in interface AdministrationService
Parameters:
cd - ConceptDatatype to update
Throws:
APIException

deleteConceptDatatype

@Deprecated
public void deleteConceptDatatype(ConceptDatatype cd)
                           throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Delete ConceptDatatype

Specified by:
deleteConceptDatatype in interface AdministrationService
Parameters:
cd - ConceptDatatype to delete
Throws:
APIException

createReport

@Deprecated
public void createReport(Report report)
                  throws APIException
Deprecated. see reportingcompatibility module

Create a new Report

Specified by:
createReport in interface AdministrationService
Parameters:
report - Report to create
Throws:
APIException

updateReport

@Deprecated
public void updateReport(Report report)
                  throws APIException
Deprecated. see reportingcompatibility module

Update Report

Specified by:
updateReport in interface AdministrationService
Parameters:
report - Report to update
Throws:
APIException

deleteReport

@Deprecated
public void deleteReport(Report report)
                  throws APIException
Deprecated. see reportingcompatibility module

Delete Report

Specified by:
deleteReport in interface AdministrationService
Parameters:
report - Report to delete
Throws:
APIException

createReportObject

@Deprecated
public void createReportObject(AbstractReportObject reportObject)
                        throws APIException
Deprecated. see reportingcompatibility module

Create a new Report Object

Specified by:
createReportObject in interface AdministrationService
Parameters:
reportObject - Report Object to create
Throws:
APIException

updateReportObject

@Deprecated
public void updateReportObject(AbstractReportObject reportObject)
                        throws APIException
Deprecated. see reportingcompatibility module

Update Report Object

Specified by:
updateReportObject in interface AdministrationService
Parameters:
reportObject - Report Object to update
Throws:
APIException

deleteReportObject

@Deprecated
public void deleteReportObject(java.lang.Integer reportObjectId)
                        throws APIException
Deprecated. see reportingcompatibility module

Delete Report Object

Specified by:
deleteReportObject in interface AdministrationService
Parameters:
reportObjectId - Internal Integer identifier of Report Object to delete
Throws:
APIException

updateConceptWord

@Deprecated
public void updateConceptWord(Concept concept)
                       throws APIException
Deprecated. moved to ConceptServiceImpl

Description copied from interface: AdministrationService
Iterates over the words in names and synonyms (for each locale) and updates the concept word business table

Specified by:
updateConceptWord in interface AdministrationService
Throws:
APIException

updateConceptWords

@Deprecated
public void updateConceptWords()
                        throws APIException
Deprecated. moved to ConceptServiceImpl

Description copied from interface: AdministrationService
Iterates over all concepts calling updateConceptWord(concept)

Specified by:
updateConceptWords in interface AdministrationService
Throws:
APIException

updateConceptWords

@Deprecated
public void updateConceptWords(java.lang.Integer conceptIdStart,
                                          java.lang.Integer conceptIdEnd)
                        throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Iterates over all concepts with conceptIds between conceptIdStart and conceptIdEnd (inclusive) calling updateConceptWord(concept)

Specified by:
updateConceptWords in interface AdministrationService
Throws:
APIException

updateConceptSetDerived

@Deprecated
public void updateConceptSetDerived(Concept concept)
                             throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Updates the concept set derived business table for this concept (bursting the concept sets)

Specified by:
updateConceptSetDerived in interface AdministrationService
Throws:
APIException

updateConceptSetDerived

@Deprecated
public void updateConceptSetDerived()
                             throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Iterates over all concepts calling updateConceptSetDerived(concept)

Specified by:
updateConceptSetDerived in interface AdministrationService
Throws:
APIException

createConceptProposal

@Deprecated
public void createConceptProposal(ConceptProposal cp)
                           throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Create a concept proposal

Specified by:
createConceptProposal in interface AdministrationService
Throws:
APIException

updateConceptProposal

@Deprecated
public void updateConceptProposal(ConceptProposal cp)
                           throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
Update a concept proposal

Specified by:
updateConceptProposal in interface AdministrationService
Throws:
APIException

mapConceptProposalToConcept

@Deprecated
public void mapConceptProposalToConcept(ConceptProposal cp,
                                                   Concept mappedConcept)
                                 throws APIException
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
maps a concept proposal to a concept

Specified by:
mapConceptProposalToConcept in interface AdministrationService
Throws:
APIException

rejectConceptProposal

@Deprecated
public void rejectConceptProposal(ConceptProposal cp)
Deprecated. moved to ConceptService

Description copied from interface: AdministrationService
rejects a concept proposal

Specified by:
rejectConceptProposal in interface AdministrationService
See Also:
AdministrationService.rejectConceptProposal(org.openmrs.ConceptProposal)

mrnGeneratorLog

@Deprecated
public void mrnGeneratorLog(java.lang.String site,
                                       java.lang.Integer start,
                                       java.lang.Integer count)
                     throws APIException
Deprecated. 

Specified by:
mrnGeneratorLog in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.mrnGeneratorLog(java.lang.String, java.lang.Integer, java.lang.Integer)

getMRNGeneratorLog

@Deprecated
public java.util.Collection<?> getMRNGeneratorLog()
                                           throws APIException
Deprecated. 

Specified by:
getMRNGeneratorLog in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.getMRNGeneratorLog()

getSystemVariables

public java.util.SortedMap<java.lang.String,java.lang.String> getSystemVariables()
                                                                          throws APIException
Description copied from interface: AdministrationService
Get a listing or important variables used in openmrs

Specified by:
getSystemVariables in interface AdministrationService
Returns:
a map from variable name to variable value
Throws:
APIException
See Also:
AdministrationService.getSystemVariables()

getGlobalProperty

public java.lang.String getGlobalProperty(java.lang.String propertyName)
                                   throws APIException
Description copied from interface: AdministrationService
Gets the global property that has the given propertyName.

If propertyName is not found in the list of Global Properties currently in the database, a null value is returned. This method should not have any authorization check.

Specified by:
getGlobalProperty in interface AdministrationService
Parameters:
propertyName - property key to look for
Returns:
value of property returned or null if none
Throws:
APIException
See Also:
AdministrationService.getGlobalProperty(java.lang.String)

getGlobalProperty

public java.lang.String getGlobalProperty(java.lang.String propertyName,
                                          java.lang.String defaultValue)
                                   throws APIException
Description copied from interface: AdministrationService
Gets the global property that has the given propertyName

If propertyName is not found in the list of Global Properties currently in the database, a defaultValue is returned

This method should not have any authorization check

Specified by:
getGlobalProperty in interface AdministrationService
Parameters:
propertyName - property key to look for
defaultValue - value to return if propertyName is not found
Returns:
value of propertyName property or defaultValue if none
Throws:
APIException
See Also:
AdministrationService.getGlobalProperty(java.lang.String, java.lang.String)

getGlobalPropertyObject

public GlobalProperty getGlobalPropertyObject(java.lang.String propertyName)
Description copied from interface: AdministrationService
Gets the global property that has the given propertyName

Specified by:
getGlobalPropertyObject in interface AdministrationService
Parameters:
propertyName - property key to look for
Returns:
the global property that matches the given propertyName
See Also:
AdministrationService.getGlobalPropertyObject(java.lang.String)

getGlobalProperties

@Deprecated
public java.util.List<GlobalProperty> getGlobalProperties()
                                                   throws APIException
Deprecated. 

Specified by:
getGlobalProperties in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.getGlobalProperties()

setGlobalProperties

@Deprecated
public void setGlobalProperties(java.util.List<GlobalProperty> props)
                         throws APIException
Deprecated. 

Specified by:
setGlobalProperties in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.setGlobalProperties(java.util.List)

deleteGlobalProperty

@Deprecated
public void deleteGlobalProperty(java.lang.String propertyName)
                          throws APIException
Deprecated. 

Description copied from interface: AdministrationService
Use
 purgeGlobalProperty(new GlobalProperty(propertyName));
 

Specified by:
deleteGlobalProperty in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.deleteGlobalProperty(java.lang.String)

setGlobalProperty

@Deprecated
public void setGlobalProperty(java.lang.String propertyName,
                                         java.lang.String propertyValue)
                       throws APIException
Deprecated. 

Description copied from interface: AdministrationService
Use
 purgeGlobalProperty(new GlobalProperty(propertyName, propertyValue));
 

Specified by:
setGlobalProperty in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.setGlobalProperty(java.lang.String, java.lang.String)

setGlobalProperty

@Deprecated
public void setGlobalProperty(GlobalProperty gp)
                       throws APIException
Deprecated. 

Specified by:
setGlobalProperty in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.setGlobalProperty(org.openmrs.GlobalProperty)

addGlobalProperty

@Deprecated
public void addGlobalProperty(GlobalProperty gp)
Deprecated. 

Specified by:
addGlobalProperty in interface AdministrationService
See Also:
AdministrationService.addGlobalProperty(org.openmrs.GlobalProperty)

addGlobalProperty

@Deprecated
public void addGlobalProperty(java.lang.String propertyName,
                                         java.lang.String propertyValue)
                       throws APIException
Deprecated. 

Specified by:
addGlobalProperty in interface AdministrationService
Throws:
APIException
See Also:
AdministrationService.addGlobalProperty(java.lang.String, java.lang.String)

getAllGlobalProperties

public java.util.List<GlobalProperty> getAllGlobalProperties()
                                                      throws APIException
Description copied from interface: AdministrationService
Get a list of all global properties in the system

Specified by:
getAllGlobalProperties in interface AdministrationService
Returns:
list of global properties
Throws:
APIException
See Also:
AdministrationService.getAllGlobalProperties()

getGlobalPropertiesByPrefix

public java.util.List<GlobalProperty> getGlobalPropertiesByPrefix(java.lang.String prefix)
Description copied from interface: AdministrationService
Gets all global properties that begin with prefix.

Specified by:
getGlobalPropertiesByPrefix in interface AdministrationService
Parameters:
prefix - The beginning of the property name to match.
Returns:
a List of GlobalPropertys that match prefix
See Also:
AdministrationService.getGlobalPropertiesByPrefix(java.lang.String)

getGlobalPropertiesBySuffix

public java.util.List<GlobalProperty> getGlobalPropertiesBySuffix(java.lang.String suffix)
Description copied from interface: AdministrationService
Gets all global properties that end with suffix.

Specified by:
getGlobalPropertiesBySuffix in interface AdministrationService
Returns:
a List of GlobalPropertys that match .*suffix
See Also:
AdministrationService.getGlobalPropertiesBySuffix(java.lang.String)

purgeGlobalProperty

public void purgeGlobalProperty(GlobalProperty globalProperty)
                         throws APIException
Description copied from interface: AdministrationService
Completely remove the given global property from the database

Specified by:
purgeGlobalProperty in interface AdministrationService
Parameters:
globalProperty - the global property to delete/remove from the database
Throws:
APIException
See Also:
AdministrationService.purgeGlobalProperty(org.openmrs.GlobalProperty)

saveGlobalProperties

public java.util.List<GlobalProperty> saveGlobalProperties(java.util.List<GlobalProperty> props)
                                                    throws APIException
Description copied from interface: AdministrationService
Save the given list of global properties to the database overwriting all values with the given values.

Specified by:
saveGlobalProperties in interface AdministrationService
Parameters:
props - list of GlobalProperty objects to save
Returns:
the saved global properties
Throws:
APIException
See Also:
AdministrationService.saveGlobalProperties(java.util.List)

saveGlobalProperty

public GlobalProperty saveGlobalProperty(GlobalProperty gp)
                                  throws APIException
Description copied from interface: AdministrationService
Save the given global property to the database

Specified by:
saveGlobalProperty in interface AdministrationService
Parameters:
gp - global property to save
Returns:
the saved global property
Throws:
APIException
See Also:
AdministrationService.saveGlobalProperty(org.openmrs.GlobalProperty)

executeSQL

public java.util.List<java.util.List<java.lang.Object>> executeSQL(java.lang.String sql,
                                                                   boolean selectOnly)
                                                            throws APIException
Description copied from interface: AdministrationService
Runs the sql on the database. If selectOnly is flagged then any non-select sql statements will be rejected.

Specified by:
executeSQL in interface AdministrationService
Returns:
ResultSet
Throws:
APIException
See Also:
AdministrationService.executeSQL(java.lang.String, boolean)

addGlobalPropertyListener

public void addGlobalPropertyListener(GlobalPropertyListener listener)
Description copied from interface: AdministrationService
Allows code to be notified when a global property is created/edited/deleted.

Specified by:
addGlobalPropertyListener in interface AdministrationService
Parameters:
listener - The listener to register
See Also:
AdministrationService.addGlobalPropertyListener(GlobalPropertyListener)

removeGlobalPropertyListener

public void removeGlobalPropertyListener(GlobalPropertyListener listener)
Description copied from interface: AdministrationService
Removes a GlobalPropertyListener previously registered by AdministrationService.addGlobalPropertyListener(GlobalPropertyListener)

Specified by:
removeGlobalPropertyListener in interface AdministrationService
See Also:
AdministrationService.removeGlobalPropertyListener(GlobalPropertyListener)

getImplementationId

public ImplementationId getImplementationId()
                                     throws APIException
Description copied from interface: AdministrationService
Get the implementation id stored for this server Returns null if no implementation id has been successfully set yet

Specified by:
getImplementationId in interface AdministrationService
Returns:
ImplementationId object that is this implementation's unique id
Throws:
APIException
See Also:
AdministrationService.getImplementationId()

setImplementationId

public void setImplementationId(ImplementationId implementationId)
                         throws APIException
Description copied from interface: AdministrationService
Set the given implementationId as this implementation's unique id

Specified by:
setImplementationId in interface AdministrationService
Parameters:
implementationId - the ImplementationId to save
Throws:
APIException - if implementationId is empty or is invalid according to central id server
See Also:
AdministrationService.setImplementationId(org.openmrs.ImplementationId)

getAllowedLocales

public java.util.List<java.util.Locale> getAllowedLocales()
Description copied from interface: AdministrationService
Gets the list of locales which the administrator has allowed for use on the system. This is specified with a global property named OpenmrsConstants.GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST.

Specified by:
getAllowedLocales in interface AdministrationService
Returns:
list of allowed locales
See Also:
AdministrationService.getAllowedLocales()

getPresentationLocales

public java.util.Set<java.util.Locale> getPresentationLocales()
Description copied from interface: AdministrationService
Gets the list of locales for which localized messages are available for the user interface (presentation layer). This set includes all the available locales (as indicated by the MessageSourceService) filtered by the allowed locales (as indicated by this AdministrationService).

Specified by:
getPresentationLocales in interface AdministrationService
Returns:
list of allowed presentation locales TODO change this return type to list?
See Also:
AdministrationService.getPresentationLocales()

globalPropertyChanged

public void globalPropertyChanged(GlobalProperty newValue)
Description copied from interface: GlobalPropertyListener
Called after a global property is created or updated

Specified by:
globalPropertyChanged in interface GlobalPropertyListener
Parameters:
newValue - the new value of the property that was just saved
See Also:
GlobalPropertyListener.globalPropertyChanged(org.openmrs.GlobalProperty)

globalPropertyDeleted

public void globalPropertyDeleted(java.lang.String propertyName)
Description copied from interface: GlobalPropertyListener
Called after a global property is deleted

Specified by:
globalPropertyDeleted in interface GlobalPropertyListener
Parameters:
propertyName - the name of the property that was just deleted
See Also:
GlobalPropertyListener.globalPropertyDeleted(java.lang.String)

supportsPropertyName

public boolean supportsPropertyName(java.lang.String propertyName)
Description copied from interface: GlobalPropertyListener
Asks this listener whether it wants to be notified about the given property name

Specified by:
supportsPropertyName in interface GlobalPropertyListener
Returns:
whether this listener wants its action methods to be notified of properties with the given name
See Also:
GlobalPropertyListener.supportsPropertyName(java.lang.String)

getGlobalPropertyByUuid

public GlobalProperty getGlobalPropertyByUuid(java.lang.String uuid)
Description copied from interface: AdministrationService
Get a global property by its uuid. There should be only one of these in the database (well, in the world actually). If multiple are found, an error is thrown.

Specified by:
getGlobalPropertyByUuid in interface AdministrationService
Returns:
the global property matching the given uuid
See Also:
AdministrationService.getGlobalPropertyByUuid(java.lang.String)

getGlobalPropertyValue

public <T> T getGlobalPropertyValue(java.lang.String propertyName,
                                    T defaultValue)
                         throws APIException
Description copied from interface: AdministrationService
Returns a global property according to the type specified

Specified by:
getGlobalPropertyValue in interface AdministrationService
Returns:
property value in the type of the default value
Throws:
APIException
See Also:
AdministrationService.getGlobalPropertyValue(java.lang.String, java.lang.Object)

purgeGlobalProperties

public void purgeGlobalProperties(java.util.List<GlobalProperty> globalProperties)
                           throws APIException
Description copied from interface: AdministrationService
Completely remove the given global properties from the database

Specified by:
purgeGlobalProperties in interface AdministrationService
Parameters:
globalProperties - the global properties to delete/remove from the database
Throws:
APIException
See Also:
AdministrationService.purgeGlobalProperties(java.util.List)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change