public class UpdateFilter extends StartupFilter
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log |
AUTO_RUN_OPENMRS, errors, filterConfig, msgs, velocityEngine
Constructor and Description |
---|
UpdateFilter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
authenticateAsSuperUser(java.lang.String usernameOrSystemId,
java.lang.String password)
Look in the users table for a user with this username and password and see if they have a
role of
OpenmrsConstants.SUPERUSER_ROLE . |
void |
checkLocaleAttributesForFirstTime(javax.servlet.http.HttpServletRequest httpRequest)
It sets locale attribute for current session when user is making first GET http request
to application.
|
protected void |
doGet(javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse)
Called by
StartupFilter.doFilter(ServletRequest, ServletResponse, FilterChain) on GET requests |
protected void |
doPost(javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse)
Called by
StartupFilter.doFilter(ServletRequest, ServletResponse, FilterChain) on POST requests |
protected java.lang.Object |
getModel()
The model that is used as the backer for all pages in this startup wizard.
|
protected java.lang.String |
getTemplatePrefix()
This string is prepended to all templateNames passed to
StartupFilter.renderTemplate(String, Map, HttpServletResponse) |
void |
init(javax.servlet.FilterConfig filterConfig) |
static java.lang.Boolean |
isLockReleased()
Indicates if database lock was released.
|
protected boolean |
isSuperUser(java.sql.Connection connection,
java.lang.Integer userId)
Checks the given user to see if they have been given the
OpenmrsConstants.SUPERUSER_ROLE role. |
static void |
setLockReleased(java.lang.Boolean lockReleased) |
protected static void |
setUpdatesRequired(boolean updatesRequired) |
boolean |
skipFilter(javax.servlet.http.HttpServletRequest httpRequest)
If this returns true, this filter fails early and quickly.
|
static boolean |
updatesRequired()
Used by the Listener to know if this filter wants to do its magic
|
destroy, doFilter, getToolContext, renderTemplate, toJSONString
protected void doGet(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws java.io.IOException, javax.servlet.ServletException
StartupFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
on GET requestsdoGet
in class StartupFilter
httpRequest
- httpResponse
- java.io.IOException
javax.servlet.ServletException
protected void doPost(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws java.io.IOException, javax.servlet.ServletException
StartupFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
on POST requestsdoPost
in class StartupFilter
java.io.IOException
javax.servlet.ServletException
StartupFilter.doPost(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
public void checkLocaleAttributesForFirstTime(javax.servlet.http.HttpServletRequest httpRequest)
Locale.ENGLISH
by defaulthttpRequest
- the http request objectprotected boolean authenticateAsSuperUser(java.lang.String usernameOrSystemId, java.lang.String password) throws javax.servlet.ServletException
OpenmrsConstants.SUPERUSER_ROLE
.usernameOrSystemId
- user entered usernamepassword
- user entered passwordjavax.servlet.ServletException
isSuperUser(Connection, Integer)
protected boolean isSuperUser(java.sql.Connection connection, java.lang.Integer userId) throws java.lang.Exception
OpenmrsConstants.SUPERUSER_ROLE
role. This method does not look at child roles.connection
- the java sql connection to useuserId
- the user id to look atjava.lang.Exception
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
init
in class StartupFilter
javax.servlet.ServletException
Filter.init(javax.servlet.FilterConfig)
protected java.lang.Object getModel()
StartupFilter
getModel
in class StartupFilter
StartupFilter.getModel()
public boolean skipFilter(javax.servlet.http.HttpServletRequest httpRequest)
StartupFilter
skipFilter
in class StartupFilter
org.openmrs.web.filter.StartupFilter#skipFilter()
public static boolean updatesRequired()
init(FilterConfig)
,
Listener.setupNeeded()
protected static void setUpdatesRequired(boolean updatesRequired)
updatesRequired
- the updatesRequired to setpublic static java.lang.Boolean isLockReleased()
public static void setLockReleased(java.lang.Boolean lockReleased)
protected java.lang.String getTemplatePrefix()
StartupFilter
StartupFilter.renderTemplate(String, Map, HttpServletResponse)
getTemplatePrefix
in class StartupFilter
StartupFilter.getTemplatePrefix()
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.