public final class Module extends Object
Constructor and Description |
---|
Module(String name)
Simple constructor
|
Module(String name,
String moduleId,
String packageName,
String author,
String description,
String version)
Main constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addRequiredModule(String requiredModule,
String version) |
void |
clearStartupError() |
void |
disposeAdvicePointsClassInstance() |
boolean |
equals(Object obj) |
String |
getActivatorName() |
List<AdvicePoint> |
getAdvicePoints() |
String |
getAuthor() |
List<String> |
getAwareOfModules()
This list of strings is just what is included in the config.xml file, the full package names:
e.g. org.openmrs.module.formentry, for the modules that this module is aware of.
|
String |
getAwareOfModuleVersion(String awareOfModule) |
List<ModuleConditionalResource> |
getConditionalResources() |
Document |
getConfig() |
String |
getDescription() |
String |
getDownloadURL() |
List<Extension> |
getExtensions()
Expands (i.e. creates instances of)
Extension s defined by their class name in setExtensionNames(Map) . |
File |
getFile() |
List<GlobalProperty> |
getGlobalProperties() |
List<String> |
getMappingFiles() |
Map<String,Properties> |
getMessages()
Deprecated.
as of 2.0 because messages are automatically loaded from the classpath
|
ModuleActivator |
getModuleActivator() |
String |
getModuleId() |
String |
getModuleIdAsPath() |
String |
getName() |
String |
getPackageName() |
Set<String> |
getPackagesWithMappedClasses()
Packages to scan for classes with JPA annotated classes.
|
List<Privilege> |
getPrivileges() |
String |
getRequireDatabaseVersion() |
List<String> |
getRequiredModules()
This list of strings is just what is included in the config.xml file, the full package names:
e.g. org.openmrs.module.formentry
|
Map<String,String> |
getRequiredModulesMap()
Get the modules that are required for this module.
|
String |
getRequiredModuleVersion(String moduleName)
Convenience method to get the version of this given module that is required
|
String |
getRequireOpenmrsVersion() |
Document |
getSqldiff() |
List<String> |
getStartBeforeModules()
Gets names of modules which should start after this
|
Map<String,String> |
getStartBeforeModulesMap()
Gets modules which should start after this
|
String |
getStartupErrorMessage() |
String |
getUpdateURL() |
String |
getUpdateVersion() |
String |
getVersion() |
int |
hashCode() |
Boolean |
hasStartupError() |
boolean |
isCore() |
boolean |
isCoreModule()
This is a convenience method to know whether this module is core to OpenMRS.
|
boolean |
isMandatory()
This property is set by the module owner to tell OpenMRS that once it is installed, it must
always startup.
|
boolean |
isStarted() |
void |
setActivatorName(String activatorName) |
void |
setAdvicePoints(List<AdvicePoint> advicePoints) |
void |
setAuthor(String author) |
void |
setAwareOfModulesMap(Map<String,String> awareOfModulesMap)
Sets the modules that this module is aware of.
|
void |
setConditionalResources(List<ModuleConditionalResource> conditionalResources) |
void |
setConfig(Document config) |
void |
setDescription(String description) |
void |
setDownloadURL(String downloadURL) |
void |
setExtensionNames(Map<String,String> map)
A map of pointId to classname.
|
void |
setExtensions(List<Extension> extensions) |
void |
setFile(File file) |
void |
setGlobalProperties(List<GlobalProperty> globalProperties) |
void |
setMandatory(boolean mandatory) |
void |
setMappingFiles(List<String> mappingFiles) |
void |
setMessages(Map<String,Properties> messages)
Deprecated.
as of 2.0 because messages are automatically loaded from the classpath
|
void |
setModuleActivator(ModuleActivator moduleActivator) |
void |
setModuleId(String moduleId) |
void |
setName(String name) |
void |
setPackageName(String packageName) |
void |
setPackagesWithMappedClasses(Set<String> packagesToScan) |
void |
setPrivileges(List<Privilege> privileges) |
void |
setRequireDatabaseVersion(String requireDatabaseVersion) |
void |
setRequiredModules(List<String> requiredModules)
This is a convenience method to set all the required modules without any version requirements
|
void |
setRequiredModulesMap(Map<String,String> requiredModulesMap) |
void |
setRequireOpenmrsVersion(String requireOpenmrsVersion) |
void |
setSqldiff(Document sqldiff) |
void |
setStartBeforeModulesMap(Map<String,String> startBeforeModulesMap)
Sets modules that must start after this module
|
void |
setStartupErrorMessage(String e) |
void |
setStartupErrorMessage(String exceptionMessage,
Throwable t)
Add the given exceptionMessage and throwable as the startup error for this module.
|
void |
setUpdateURL(String updateURL) |
void |
setUpdateVersion(String updateVersion) |
void |
setVersion(String version) |
String |
toString() |
public Module(String name)
name
- public ModuleActivator getModuleActivator()
public void setModuleActivator(ModuleActivator moduleActivator)
moduleActivator
- the moduleActivator to setpublic String getActivatorName()
public void setActivatorName(String activatorName)
activatorName
- the activatorName to setpublic String getAuthor()
public void setAuthor(String author)
author
- the author to setpublic String getDescription()
public void setDescription(String description)
description
- the description to setpublic String getName()
public void setName(String name)
name
- the name to setpublic String getRequireDatabaseVersion()
public void setRequireDatabaseVersion(String requireDatabaseVersion)
requireDatabaseVersion
- the requireDatabaseVersion to setpublic List<String> getRequiredModules()
public String getRequiredModuleVersion(String moduleName)
public void setRequiredModules(List<String> requiredModules)
requiredModules
- the requiredModules to set for this module
Should set modules when there is a null required modules mappublic void addRequiredModule(String requiredModule, String version)
requiredModule
- the requiredModule to add for this moduleversion
- version requiredModule
Should add module to required modules mappublic void setRequiredModulesMap(Map<String,String> requiredModulesMap)
requiredModulesMap
- Map<String,String>
of the requiredModule
s
to setpublic Map<String,String> getRequiredModulesMap()
public void setStartBeforeModulesMap(Map<String,String> startBeforeModulesMap)
startBeforeModulesMap
- the startedBefore modules to setpublic Map<String,String> getStartBeforeModulesMap()
public List<String> getStartBeforeModules()
public void setAwareOfModulesMap(Map<String,String> awareOfModulesMap)
awareOfModulesMap
- Map<String,String>
of the
awareOfModulesMap
s to setpublic List<String> getAwareOfModules()
public String getRequireOpenmrsVersion()
public void setRequireOpenmrsVersion(String requireOpenmrsVersion)
requireOpenmrsVersion
- the requireOpenmrsVersion to setpublic String getModuleId()
public String getModuleIdAsPath()
public void setModuleId(String moduleId)
moduleId
- the module id to setpublic String getPackageName()
public void setPackageName(String packageName)
packageName
- the packageName to setpublic String getVersion()
public void setVersion(String version)
version
- the version to setpublic String getUpdateURL()
public void setUpdateURL(String updateURL)
updateURL
- the updateURL to setpublic String getDownloadURL()
public void setDownloadURL(String downloadURL)
downloadURL
- the downloadURL to setpublic String getUpdateVersion()
public void setUpdateVersion(String updateVersion)
updateVersion
- the updateVersion to setpublic List<Extension> getExtensions()
Extension
s defined by their class name in setExtensionNames(Map)
.public void setExtensions(List<Extension> extensions)
extensions
- the extensions to setpublic void setExtensionNames(Map<String,String> map)
Extension
object.
getExtensions()
is called.
The map is a direct representation of extension
tags in a module's config.xml. For example
<extension>
<point>org.openmrs.admin.list</point>
<class>org.openmrs.module.reporting.web.extension.ManageAdminListExt</class>
</extension>
map
- from pointid to classname of an extensionModuleFileParser
public List<AdvicePoint> getAdvicePoints()
public void setAdvicePoints(List<AdvicePoint> advicePoints)
advicePoints
- the advicePoints to setpublic File getFile()
public void setFile(File file)
@Deprecated public Map<String,Properties> getMessages()
@Deprecated public void setMessages(Map<String,Properties> messages)
messages
- map of locale to properties for that localepublic List<GlobalProperty> getGlobalProperties()
public void setGlobalProperties(List<GlobalProperty> globalProperties)
public Document getConfig()
public void setConfig(Document config)
public Document getSqldiff()
public void setSqldiff(Document sqldiff)
public Set<String> getPackagesWithMappedClasses()
public void setPackagesWithMappedClasses(Set<String> packagesToScan)
packagesToScan
- getPackagesWithMappedClasses()
public boolean isMandatory()
public void setMandatory(boolean mandatory)
public boolean isCoreModule()
ModuleConstants.CORE_MODULES
public boolean isStarted()
public void setStartupErrorMessage(String e)
e
- string to set as startup error message
Should throw exception when message is nullpublic void setStartupErrorMessage(String exceptionMessage, Throwable t)
exceptionMessage
- optional. the default message to show on the first line of the error
messaget
- throwable stacktrace to include in the error message
Should throw exception when throwable is null
Should set StartupErrorMessage when exceptionMessage is null
Should append throwable's message to exceptionMessagepublic String getStartupErrorMessage()
public Boolean hasStartupError()
public void clearStartupError()
public void disposeAdvicePointsClassInstance()
public List<ModuleConditionalResource> getConditionalResources()
public void setConditionalResources(List<ModuleConditionalResource> conditionalResources)
public boolean isCore()
Copyright © 2024 OpenMRS Inc.. All rights reserved.