org.openmrs.api
Interface AdministrationService

All Superinterfaces:
OpenmrsService
All Known Implementing Classes:
AdministrationServiceImpl

@Transactional
public interface AdministrationService
extends OpenmrsService

Contains methods pertaining to doing some administrative tasks in OpenMRS

Use:

 List<GlobalProperty> globalProperties = Context.getAdministrationService().getGlobalProperties();
 

See Also:
Context

Method Summary
 void addGlobalProperty(GlobalProperty gp)
          Deprecated. use saveGlobalProperty(GlobalProperty)
 void addGlobalProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Deprecated. use saveGlobalProperty(GlobalProperty)
 void addGlobalPropertyListener(GlobalPropertyListener listener)
          Allows code to be notified when a global property is created/edited/deleted.
 void createConceptClass(ConceptClass cc)
          Deprecated. use ConceptService.saveConceptClass(ConceptClass)
 void createConceptDatatype(ConceptDatatype cd)
          Deprecated. use ConceptService.saveConceptDatatype(ConceptDatatype)
 void createConceptProposal(ConceptProposal cp)
          Deprecated. use ConceptService.saveConceptProposal(ConceptProposal)
 void createEncounterType(EncounterType encounterType)
          Deprecated. use EncounterService.saveEncounterType(EncounterType)
 void createFieldType(FieldType fieldType)
          Deprecated. use FormService.saveFieldType(FieldType)
 void createLocation(Location location)
          Deprecated. see LocationService.saveLocation(Location)
 void createMimeType(MimeType mimeType)
          Deprecated. see ObsService.saveMimeType(MimeType)
 void createPatientIdentifierType(PatientIdentifierType patientIdentifierType)
          Deprecated. replaced by PatientService.savePatientIdentifierType(PatientIdentifierType)
 void createPrivilege(Privilege privilege)
          Deprecated. see UserService.savePrivilege(Privilege)
 void createReport(Report report)
          Deprecated. see reportingcompatibility module
 void createReportObject(AbstractReportObject reportObject)
          Deprecated. see reportingcompatibility module
 void createRole(Role role)
          Deprecated. see UserService.saveRole(Role)
 void createTribe(Tribe tribe)
          Deprecated. The Tribe object is no longer supported. Install the Tribe module
 void deleteConceptClass(ConceptClass cc)
          Deprecated. use ConceptService.purgeConceptClass(ConceptClass)
 void deleteConceptDatatype(ConceptDatatype cd)
          Deprecated. use org.openmrs.api
 void deleteEncounterType(EncounterType encounterType)
          Deprecated. use EncounterService.purgeEncounterType(EncounterType)
 void deleteFieldType(FieldType fieldType)
          Deprecated. use FormService.purgeFieldType(FieldType)
 void deleteGlobalProperty(java.lang.String propertyName)
          Deprecated. use purgeGlobalProperty(GlobalProperty)
 void deleteLocation(Location location)
          Deprecated. see LocationService.purgeLocation(Location)
 void deleteMimeType(MimeType mimeType)
          Deprecated. see ObsService.purgeMimeType(MimeType)
 void deletePatientIdentifierType(PatientIdentifierType patientIdentifierType)
          Deprecated. replaced by PatientService.purgePatientIdentifierType(PatientIdentifierType)
 void deletePrivilege(Privilege privilege)
          Deprecated. see UserService.purgePrivilege(Privilege)
 void deleteReport(Report report)
          Deprecated. see reportingcompatibility module
 void deleteReportObject(java.lang.Integer reportObjectId)
          Deprecated. see reportingcompatibility module
 void deleteRole(Role role)
          Deprecated. see UserService.purgeRole(Role)
 void deleteTribe(Tribe tribe)
          Deprecated. The Tribe object is no longer supported. Install the Tribe module
 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. use getAllGlobalProperties()
 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. use the mrngen module instead
 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 mapConceptProposalToConcept(ConceptProposal cp, Concept mappedConcept)
          Deprecated. moved to ConceptService.mapConceptProposalToConcept(ConceptProposal, Concept)
 void mrnGeneratorLog(java.lang.String site, java.lang.Integer start, java.lang.Integer count)
          Deprecated. use the mrngen module instead
 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.rejectConceptProposal(ConceptProposal)
 void removeGlobalPropertyListener(GlobalPropertyListener listener)
          Removes a GlobalPropertyListener previously registered by addGlobalPropertyListener(GlobalPropertyListener)
 void retireTribe(Tribe tribe)
          Deprecated. The Tribe object is no longer supported. Install the Tribe module
 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 setGlobalProperties(java.util.List<GlobalProperty> props)
          Deprecated. use saveGlobalProperties(List)
 void setGlobalProperty(GlobalProperty gp)
          Deprecated. use saveGlobalProperty(GlobalProperty)
 void setGlobalProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Deprecated. use #saveGlobalProperty(GlobalProperty)
 void setImplementationId(ImplementationId implementationId)
          Set the given implementationId as this implementation's unique id
 void unretireTribe(Tribe tribe)
          Deprecated. The Tribe object is no longer supported. Install the Tribe module
 void updateConceptClass(ConceptClass cc)
          Deprecated. use ConceptService.saveConceptClass(ConceptClass)
 void updateConceptDatatype(ConceptDatatype cd)
          Deprecated. use ConceptService.saveConceptDatatype(ConceptDatatype)
 void updateConceptProposal(ConceptProposal cp)
          Deprecated. use ConceptService.saveConceptProposal(ConceptProposal)
 void updateConceptSetDerived()
          Deprecated. moved to ConceptService.updateConceptSetDerived()
 void updateConceptSetDerived(Concept concept)
          Deprecated. moved to ConceptService.updateConceptSetDerived(Concept);
 void updateConceptWord(Concept concept)
          Deprecated. moved to ConceptService.updateConceptWord(Concept)
 void updateConceptWords()
          Deprecated. moved to ConceptService.updateConceptWords()
 void updateConceptWords(java.lang.Integer conceptIdStart, java.lang.Integer conceptIdEnd)
          Deprecated. moved to ConceptService.updateConceptWords(Integer, Integer)
 void updateEncounterType(EncounterType encounterType)
          Deprecated. use EncounterService.saveEncounterType(EncounterType)
 void updateFieldType(FieldType fieldType)
          Deprecated. use FormService.saveFieldType(FieldType)
 void updateLocation(Location location)
          Deprecated. see LocationService.saveLocation(Location)
 void updateMimeType(MimeType mimeType)
          Deprecated. see ObsService.saveMimeType(MimeType)
 void updatePatientIdentifierType(PatientIdentifierType patientIdentifierType)
          Deprecated. replaced by PatientService.savePatientIdentifierType(PatientIdentifierType)
 void updatePrivilege(Privilege privilege)
          Deprecated. see UserService.savePrivilege(Privilege)
 void updateReport(Report report)
          Deprecated. see reportingcompatibility module
 void updateReportObject(AbstractReportObject reportObject)
          Deprecated. see reportingcompatibility module
 void updateRole(Role role)
          Deprecated. see UserService.saveRole(Role)
 void updateTribe(Tribe tribe)
          Deprecated. The Tribe object is no longer supported. Install the Tribe module
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Method Detail

setAdministrationDAO

void setAdministrationDAO(AdministrationDAO dao)
Used by Spring to set the specific/chosen database access implementation

Parameters:
dao - The dao implementation to use

createEncounterType

@Deprecated
void createEncounterType(EncounterType encounterType)
                         throws APIException
Deprecated. use EncounterService.saveEncounterType(EncounterType)

Throws:
APIException

updateEncounterType

@Deprecated
void updateEncounterType(EncounterType encounterType)
                         throws APIException
Deprecated. use EncounterService.saveEncounterType(EncounterType)

Throws:
APIException

deleteEncounterType

@Deprecated
void deleteEncounterType(EncounterType encounterType)
                         throws APIException
Deprecated. use EncounterService.purgeEncounterType(EncounterType)

Throws:
APIException

createPatientIdentifierType

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

Throws:
APIException
See Also:
PatientService.savePatientIdentifierType(PatientIdentifierType)

updatePatientIdentifierType

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

Throws:
APIException
See Also:
PatientService.savePatientIdentifierType(PatientIdentifierType)

deletePatientIdentifierType

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

Throws:
APIException
See Also:
PatientService.purgePatientIdentifierType(PatientIdentifierType)

createTribe

@Deprecated
void createTribe(Tribe tribe)
                 throws APIException
Deprecated. The Tribe object is no longer supported. Install the Tribe module

Throws:
APIException

updateTribe

@Deprecated
void updateTribe(Tribe tribe)
                 throws APIException
Deprecated. The Tribe object is no longer supported. Install the Tribe module

Throws:
APIException

deleteTribe

@Deprecated
void deleteTribe(Tribe tribe)
                 throws APIException
Deprecated. The Tribe object is no longer supported. Install the Tribe module

Throws:
APIException

retireTribe

@Deprecated
void retireTribe(Tribe tribe)
                 throws APIException
Deprecated. The Tribe object is no longer supported. Install the Tribe module

Throws:
APIException

unretireTribe

@Deprecated
void unretireTribe(Tribe tribe)
                   throws APIException
Deprecated. The Tribe object is no longer supported. Install the Tribe module

Throws:
APIException

createFieldType

@Deprecated
void createFieldType(FieldType fieldType)
                     throws APIException
Deprecated. use FormService.saveFieldType(FieldType)

Throws:
APIException

updateFieldType

@Deprecated
void updateFieldType(FieldType fieldType)
                     throws APIException
Deprecated. use FormService.saveFieldType(FieldType)

Throws:
APIException

deleteFieldType

@Deprecated
void deleteFieldType(FieldType fieldType)
                     throws APIException
Deprecated. use FormService.purgeFieldType(FieldType)

Throws:
APIException

createMimeType

@Deprecated
@Authorized(value="Manage Mime Types")
void createMimeType(MimeType mimeType)
                    throws APIException
Deprecated. see ObsService.saveMimeType(MimeType)

Throws:
APIException

updateMimeType

@Deprecated
@Authorized(value="Manage Mime Types")
void updateMimeType(MimeType mimeType)
                    throws APIException
Deprecated. see ObsService.saveMimeType(MimeType)

Throws:
APIException

deleteMimeType

@Deprecated
@Authorized(value="Manage Mime Types")
void deleteMimeType(MimeType mimeType)
                    throws APIException
Deprecated. see ObsService.purgeMimeType(MimeType)

Throws:
APIException

createLocation

@Deprecated
void createLocation(Location location)
                    throws APIException
Deprecated. see LocationService.saveLocation(Location)

Throws:
APIException

updateLocation

@Deprecated
void updateLocation(Location location)
                    throws APIException
Deprecated. see LocationService.saveLocation(Location)

Throws:
APIException

deleteLocation

@Deprecated
void deleteLocation(Location location)
                    throws APIException
Deprecated. see LocationService.purgeLocation(Location)

Throws:
APIException

createRole

@Deprecated
void createRole(Role role)
                throws APIException
Deprecated. see UserService.saveRole(Role)

Throws:
APIException

updateRole

@Deprecated
void updateRole(Role role)
                throws APIException
Deprecated. see UserService.saveRole(Role)

Throws:
APIException

deleteRole

@Deprecated
void deleteRole(Role role)
                throws APIException
Deprecated. see UserService.purgeRole(Role)

Throws:
APIException

createPrivilege

@Deprecated
void createPrivilege(Privilege privilege)
                     throws APIException
Deprecated. see UserService.savePrivilege(Privilege)

Throws:
APIException

updatePrivilege

@Deprecated
void updatePrivilege(Privilege privilege)
                     throws APIException
Deprecated. see UserService.savePrivilege(Privilege)

Throws:
APIException

deletePrivilege

@Deprecated
void deletePrivilege(Privilege privilege)
                     throws APIException
Deprecated. see UserService.purgePrivilege(Privilege)

Throws:
APIException

createConceptClass

@Deprecated
void createConceptClass(ConceptClass cc)
                        throws APIException
Deprecated. use ConceptService.saveConceptClass(ConceptClass)

Create a new ConceptClass

Parameters:
cc - ConceptClass to create
Throws:
APIException

updateConceptClass

@Deprecated
void updateConceptClass(ConceptClass cc)
                        throws APIException
Deprecated. use ConceptService.saveConceptClass(ConceptClass)

Update ConceptClass

Parameters:
cc - ConceptClass to update
Throws:
APIException

deleteConceptClass

@Deprecated
void deleteConceptClass(ConceptClass cc)
                        throws APIException
Deprecated. use ConceptService.purgeConceptClass(ConceptClass)

Delete ConceptClass

Parameters:
cc - ConceptClass to delete
Throws:
APIException

createConceptDatatype

@Deprecated
void createConceptDatatype(ConceptDatatype cd)
                           throws APIException
Deprecated. use ConceptService.saveConceptDatatype(ConceptDatatype)

Create a new ConceptDatatype

Parameters:
cd - ConceptDatatype to create
Throws:
APIException

updateConceptDatatype

@Deprecated
void updateConceptDatatype(ConceptDatatype cd)
                           throws APIException
Deprecated. use ConceptService.saveConceptDatatype(ConceptDatatype)

Update ConceptDatatype

Parameters:
cd - ConceptDatatype to update
Throws:
APIException

deleteConceptDatatype

@Deprecated
void deleteConceptDatatype(ConceptDatatype cd)
                           throws APIException
Deprecated. use org.openmrs.api

Delete ConceptDatatype

Parameters:
cd - ConceptDatatype to delete
Throws:
APIException

createReport

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

Create a new Report

Parameters:
report - Report to create
Throws:
APIException

updateReport

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

Update Report

Parameters:
report - Report to update
Throws:
APIException

deleteReport

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

Delete Report

Parameters:
report - Report to delete
Throws:
APIException

createReportObject

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

Create a new Report Object

Parameters:
reportObject - Report Object to create
Throws:
APIException

updateReportObject

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

Update Report Object

Parameters:
reportObject - the Report Object to update
Throws:
APIException

deleteReportObject

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

Delete Report Object

Parameters:
reportObjectId - Internal identifier for the Report Object to delete
Throws:
APIException

updateConceptWord

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

Iterates over the words in names and synonyms (for each locale) and updates the concept word business table

Parameters:
concept -
Throws:
APIException

updateConceptWords

@Deprecated
void updateConceptWords()
                        throws APIException
Deprecated. moved to ConceptService.updateConceptWords()

Iterates over all concepts calling updateConceptWord(concept)

Throws:
APIException

updateConceptWords

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

Iterates over all concepts with conceptIds between conceptIdStart and conceptIdEnd (inclusive) calling updateConceptWord(concept)

Throws:
APIException

updateConceptSetDerived

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

Updates the concept set derived business table for this concept (bursting the concept sets)

Parameters:
concept -
Throws:
APIException

updateConceptSetDerived

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

Iterates over all concepts calling updateConceptSetDerived(concept)

Throws:
APIException

createConceptProposal

@Deprecated
void createConceptProposal(ConceptProposal cp)
                           throws APIException
Deprecated. use ConceptService.saveConceptProposal(ConceptProposal)

Create a concept proposal

Parameters:
cp -
Throws:
APIException

updateConceptProposal

@Deprecated
void updateConceptProposal(ConceptProposal cp)
                           throws APIException
Deprecated. use ConceptService.saveConceptProposal(ConceptProposal)

Update a concept proposal

Parameters:
cp -
Throws:
APIException

mapConceptProposalToConcept

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

maps a concept proposal to a concept

Parameters:
cp -
mappedConcept -
Throws:
APIException

rejectConceptProposal

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

rejects a concept proposal

Parameters:
cp -

mrnGeneratorLog

@Deprecated
void mrnGeneratorLog(java.lang.String site,
                                java.lang.Integer start,
                                java.lang.Integer count)
Deprecated. use the mrngen module instead

Parameters:
site -
start -
count -

getMRNGeneratorLog

@Deprecated
@Transactional(readOnly=true)
java.util.Collection<?> getMRNGeneratorLog()
Deprecated. use the mrngen module instead


getGlobalPropertyByUuid

@Transactional(readOnly=true)
GlobalProperty getGlobalPropertyByUuid(java.lang.String uuid)
                                       throws APIException
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.

Returns:
the global property matching the given uuid
Throws:
APIException
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getSystemVariables

@Transactional(readOnly=true)
@Authorized(value="View Administration Functions")
java.util.SortedMap<java.lang.String,java.lang.String> getSystemVariables()
                                                                          throws APIException
Get a listing or important variables used in openmrs

Returns:
a map from variable name to variable value
Throws:
APIException
Expected behavior:
return all registered system variables

getGlobalProperty

@Transactional(readOnly=true)
java.lang.String getGlobalProperty(java.lang.String propertyName)
                                   throws APIException
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.

Parameters:
propertyName - property key to look for
Returns:
value of property returned or null if none
Throws:
APIException
See Also:
getGlobalProperty(String, String)
Expected behavior:
not fail with null propertyName, get property value given valid property name, get property in case sensitive way

getGlobalProperty

@Transactional(readOnly=true)
java.lang.String getGlobalProperty(java.lang.String propertyName,
                                                 java.lang.String defaultValue)
                                   throws APIException
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

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
Expected behavior:
return default value if property name does not exist, not fail with null default value

getGlobalPropertyObject

@Transactional(readOnly=true)
GlobalProperty getGlobalPropertyObject(java.lang.String propertyName)
Gets the global property that has the given propertyName

Parameters:
propertyName - property key to look for
Returns:
the global property that matches the given propertyName
Expected behavior:
return null when no global property match given property name

getGlobalPropertiesByPrefix

@Transactional(readOnly=true)
java.util.List<GlobalProperty> getGlobalPropertiesByPrefix(java.lang.String prefix)
Gets all global properties that begin with prefix.

Parameters:
prefix - The beginning of the property name to match.
Returns:
a List of GlobalPropertys that match prefix
Since:
1.5
Expected behavior:
return all relevant global properties in the database

getGlobalPropertiesBySuffix

@Transactional(readOnly=true)
java.util.List<GlobalProperty> getGlobalPropertiesBySuffix(java.lang.String suffix)
Gets all global properties that end with suffix.

Parameters:
prefix - The end of the property name to match.
Returns:
a List of GlobalPropertys that match .*suffix
Since:
1.6
Expected behavior:
return all relevant global properties in the database

getAllGlobalProperties

@Transactional(readOnly=true)
@Authorized(value="View Global Properties")
java.util.List<GlobalProperty> getAllGlobalProperties()
                                                      throws APIException
Get a list of all global properties in the system

Returns:
list of global properties
Throws:
APIException
Expected behavior:
return all global properties in the database

getGlobalProperties

@Deprecated
@Transactional(readOnly=true)
java.util.List<GlobalProperty> getGlobalProperties()
Deprecated. use getAllGlobalProperties()


saveGlobalProperties

@Authorized(value="Manage Global Properties")
java.util.List<GlobalProperty> saveGlobalProperties(java.util.List<GlobalProperty> props)
                                                    throws APIException
Save the given list of global properties to the database overwriting all values with the given values.

Parameters:
props - list of GlobalProperty objects to save
Returns:
the saved global properties
Throws:
APIException
Expected behavior:
save all global properties to the database, not fail with empty list, assign uuid to all new properties, save properties with case difference only

setGlobalProperties

@Deprecated
void setGlobalProperties(java.util.List<GlobalProperty> props)
Deprecated. use saveGlobalProperties(List)


purgeGlobalProperty

@Authorized(value="Purge Global Properties")
void purgeGlobalProperty(GlobalProperty globalProperty)
                         throws APIException
Completely remove the given global property from the database

Parameters:
globalProperty - the global property to delete/remove from the database
Throws:
APIException
Expected behavior:
delete global property from database

purgeGlobalProperties

@Authorized(value="Purge Global Properties")
void purgeGlobalProperties(java.util.List<GlobalProperty> globalProperties)
                           throws APIException
Completely remove the given global properties from the database

Parameters:
globalProperties - the global properties to delete/remove from the database
Throws:
APIException
Expected behavior:
delete global properties from database

deleteGlobalProperty

@Deprecated
void deleteGlobalProperty(java.lang.String propertyName)
Deprecated. use purgeGlobalProperty(GlobalProperty)

Use
 purgeGlobalProperty(new GlobalProperty(propertyName));
 


setGlobalProperty

@Deprecated
void setGlobalProperty(java.lang.String propertyName,
                                  java.lang.String propertyValue)
Deprecated. use #saveGlobalProperty(GlobalProperty)

Use
 purgeGlobalProperty(new GlobalProperty(propertyName, propertyValue));
 


saveGlobalProperty

@Authorized(value="Manage Global Properties")
GlobalProperty saveGlobalProperty(GlobalProperty gp)
                                  throws APIException
Save the given global property to the database

Parameters:
gp - global property to save
Returns:
the saved global property
Throws:
APIException
Expected behavior:
create global property in database, overwrite global property if exists, allow different properties to have the same string with different case

setGlobalProperty

@Deprecated
void setGlobalProperty(GlobalProperty gp)
Deprecated. use saveGlobalProperty(GlobalProperty)


addGlobalProperty

@Deprecated
void addGlobalProperty(java.lang.String propertyName,
                                  java.lang.String propertyValue)
Deprecated. use saveGlobalProperty(GlobalProperty)


addGlobalProperty

@Deprecated
void addGlobalProperty(GlobalProperty gp)
Deprecated. use saveGlobalProperty(GlobalProperty)


addGlobalPropertyListener

void addGlobalPropertyListener(GlobalPropertyListener listener)
Allows code to be notified when a global property is created/edited/deleted.

Parameters:
listener - The listener to register
See Also:
GlobalPropertyListener

removeGlobalPropertyListener

void removeGlobalPropertyListener(GlobalPropertyListener listener)
Removes a GlobalPropertyListener previously registered by addGlobalPropertyListener(GlobalPropertyListener)

Parameters:
listener -

executeSQL

@Authorized(value="SQL Level Access")
java.util.List<java.util.List<java.lang.Object>> executeSQL(java.lang.String sql,
                                                                            boolean selectOnly)
                                                            throws APIException
Runs the sql on the database. If selectOnly is flagged then any non-select sql statements will be rejected.

Parameters:
sql -
selectOnly -
Returns:
ResultSet
Throws:
APIException
Expected behavior:
execute sql containing group by

getImplementationId

@Transactional(readOnly=true)
@Authorized(value="Manage Implementation Id")
ImplementationId getImplementationId()
                                     throws APIException
Get the implementation id stored for this server Returns null if no implementation id has been successfully set yet

Returns:
ImplementationId object that is this implementation's unique id
Throws:
APIException
Expected behavior:
return null if no implementation id is defined yet

setImplementationId

@Authorized(value="Manage Implementation Id")
void setImplementationId(ImplementationId implementationId)
                         throws APIException
Set the given implementationId as this implementation's unique id

Parameters:
implementationId - the ImplementationId to save
Throws:
APIException - if implementationId is empty or is invalid according to central id server
Expected behavior:
create implementation id in database, overwrite implementation id in database if exists, not fail if given implementationId is null, throw APIException if given empty implementationId object, throw APIException if given a caret in the implementationId code, throw APIException if given a pipe in the implementationId code, set uuid on implementation id global property

getAllowedLocales

@Transactional(readOnly=true)
java.util.List<java.util.Locale> getAllowedLocales()
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.

Returns:
list of allowed locales
Expected behavior:
return at least one locale if no locales defined in database yet, not fail if not global property for locales allowed defined yet, not return duplicates even if the global property has them

getPresentationLocales

@Transactional(readOnly=true)
java.util.Set<java.util.Locale> getPresentationLocales()
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).

Returns:
list of allowed presentation locales TODO change this return type to list?
Expected behavior:
return at least one locale if no locales defined in database yet, not return more locales than message source service locales

getGlobalPropertyValue

<T> T getGlobalPropertyValue(java.lang.String propertyName,
                             T defaultValue)
                         throws APIException
Returns a global property according to the type specified

Type Parameters:
T -
Parameters:
propertyName -
Returns:
property value in the type of the default value
Throws:
APIException
Since:
1.7
Expected behavior:
get property value in the proper type specified, return default value if property name does not exist

OpenMRS-1.7.x

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