KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > clipbuilder > sql > struts > BaseAction


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 sqlBuilder
10  *
11  *@author ktlili
12  */

13 public abstract class BaseAction extends LookupDispatchAction {
14     /**
15      * Gets the DefaultConfigurationManager attribute of the BaseAction object
16      *
17      *@return The DefaultConfigurationManager value
18      */

19     public DefaultConfiguationManager getDefaultConfigurationManager() {
20         ApplicationContext cxt = org.jahia.clipbuilder.util.JahiaUtils.getSpringApplicationContext();
21         if (cxt == null) {
22                     // clip builder is not part of jahia
23
cxt = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext());
24         }
25         return (DefaultConfiguationManager) cxt.getBean("sqlClipperDefaultConfigurationManager");
26     }
27
28 }
29
Popular Tags