1 package org.jahia.clipbuilder.sql.struts;2 3 import org.apache.struts.actions.LookupDispatchAction;4 import org.springframework.web.context.support.WebApplicationContextUtils;5 import org.springframework.context.ApplicationContext;6 import org.jahia.clipbuilder.sql.database.hibernate.service.DefaultConfiguationManager;7 8 /**9 * Base Action for sqlBuilder10 *11 *@author ktlili12 */13 public abstract class BaseAction extends LookupDispatchAction {14 /**15 * Gets the DefaultConfigurationManager attribute of the BaseAction object16 *17 *@return The DefaultConfigurationManager value18 */19 public DefaultConfiguationManager getDefaultConfigurationManager() {20 ApplicationContext cxt = org.jahia.clipbuilder.util.JahiaUtils.getSpringApplicationContext();21 if (cxt == null) {22 // clip builder is not part of jahia23 cxt = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext());24 }25 return (DefaultConfiguationManager) cxt.getBean("sqlClipperDefaultConfigurationManager");26 }27 28 }29