org.openmrs.messagesource
Interface MessageSourceService

All Superinterfaces:
org.springframework.context.HierarchicalMessageSource, org.springframework.context.MessageSource, MutableMessageSource
All Known Implementing Classes:
MessageSourceServiceImpl

@Transactional
public interface MessageSourceService
extends MutableMessageSource

Interface for a service which expands on the basic capabilities of a message source.


Method Summary
 MutableMessageSource getActiveMessageSource()
          Gets the message source service which is currently providing services.
 java.lang.String getMessage(java.lang.String s)
          Get the message with the given code from the current user's selected locale.
 java.util.Set<MutableMessageSource> getMessageSources()
           
 void publishProperties(java.util.Properties props, java.lang.String locale, java.lang.String namespace, java.lang.String name, java.lang.String version)
          Deprecated. use MutableMessageSource.merge(MutableMessageSource, boolean)
 void setActiveMessageSource(MutableMessageSource activeMessageSource)
          Sets the message source service which will actually provide services.
 void setMessageSources(java.util.Set<MutableMessageSource> availableMessageSources)
           
 
Methods inherited from interface org.openmrs.messagesource.MutableMessageSource
addPresentation, getLocales, getPresentation, getPresentations, getPresentationsInLocale, merge, removePresentation
 
Methods inherited from interface org.springframework.context.HierarchicalMessageSource
getParentMessageSource, setParentMessageSource
 
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
 

Method Detail

getMessage

@Transactional(readOnly=true)
java.lang.String getMessage(java.lang.String s)
Get the message with the given code from the current user's selected locale.

Parameters:
s - message code to retrieve
Returns:
the translated message
See Also:
MessageSource.getMessage(String arg0, Object[] arg1, java.util.Locale arg2)

getActiveMessageSource

@Transactional(readOnly=true)
MutableMessageSource getActiveMessageSource()
Gets the message source service which is currently providing services.

Returns:
the activeMessageSource

setActiveMessageSource

void setActiveMessageSource(MutableMessageSource activeMessageSource)
Sets the message source service which will actually provide services.

Parameters:
activeMessageSource - the MutableMessageSource to set

publishProperties

void publishProperties(java.util.Properties props,
                       java.lang.String locale,
                       java.lang.String namespace,
                       java.lang.String name,
                       java.lang.String version)
Deprecated. use MutableMessageSource.merge(MutableMessageSource, boolean)

Presumes to append the messages to a message.properties file which is already being monitored by the super ReloadableResourceBundleMessageSource. This is a blind, trusting hack.

Specified by:
publishProperties in interface MutableMessageSource
Parameters:
props - key/value properties for the messages
locale - locale in which the messages are expressed
namespace - namespace within which the properties are valid ("" for generic, "module" for modules, etc)
name - unique name for the properties within the namespace
version - version of the properties
See Also:
publishProperties(Properties, String, String, String, String)

getMessageSources

@Transactional(readOnly=true)
java.util.Set<MutableMessageSource> getMessageSources()
Returns:
the availableMessageSources

setMessageSources

void setMessageSources(java.util.Set<MutableMessageSource> availableMessageSources)
Parameters:
availableMessageSources - the availableMessageSources to set

OpenMRS-1.7.x

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