/** * This method knows about all the filters that openmrs uses for setup. Currently those are the * {@link InitializationFilter} and the {@link UpdateFilter}. If either of these have to do * something, openmrs won't start in this Listener. * * @return true if one of the filters needs to take some action */ private boolean setupNeeded() throws Exception { if (!runtimePropertiesFound) { return true; } return DatabaseUpdater.updatesRequired() && !DatabaseUpdater.allowAutoUpdate(); }
/** * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig) */ @Override public void init(ServletConfig config) throws ServletException { super.init(config); // hacky way to know if one of the startup filters needs to be run if (UpdateFilter.updatesRequired() && !DatabaseUpdater.allowAutoUpdate()) { log.info("DB updates are required, the update wizard must be run"); } if (InitializationFilter.initializationRequired()) { log.info("Runtime properties were not found or the database is empty, so initialization is required"); } }
if (DatabaseUpdater.allowAutoUpdate()) { DatabaseUpdater.executeChangelog(); } else {