import mir.config.MirPropertiesConfiguration;
import mir.config.MirPropertiesConfiguration.PropertiesConfigExc;
+import mir.core.service.storage.ArticleTypeService;
+import mir.core.service.storage.LanguageService;
+import mir.core.service.storage.TopicService;
import mir.servlet.ServletModuleExc;
import mir.util.GeneratorDateTimeFunctions;
import mir.util.GeneratorExpressionFunctions;
import mircoders.global.MirGlobal;
import mircoders.servlet.ServletHelper;
import multex.Failure;
+import net.sf.hibernate.SessionFactory;
import org.apache.struts.util.MessageResources;
/**
* TemplateServlet
* @author idefix
- * @version $Id: TemplateServlet.java,v 1.3 2003/09/18 21:42:17 idfx Exp $
+ * @version $Id: TemplateServlet.java,v 1.4 2003/12/20 20:27:10 idfx Exp $
*/
public class TemplateServlet extends HttpServlet {
private MirPropertiesConfiguration _configuration;
protected void process(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try {
- setLoginLanguages(this.getServletContext());
+ //setting some data which are needed often
+ //should be done a bit smarter
+ setLoginLanguages(getServletContext());
+ ServletContext context = getServletContext();
+ TopicService topicService =
+ new TopicService((SessionFactory)context
+ .getAttribute(ServletConstants.SESSION_FACTORY));
+ LanguageService languageService =
+ new LanguageService((SessionFactory)context
+ .getAttribute(ServletConstants.SESSION_FACTORY));
+ ArticleTypeService articleTypeService =
+ new ArticleTypeService((SessionFactory)context
+ .getAttribute(ServletConstants.SESSION_FACTORY));
+ context.setAttribute(ServletConstants.TOPICS, topicService.list());
+ context.setAttribute(ServletConstants.LANGUAGES, languageService.list());
+ context.setAttribute(ServletConstants.ARTICLE_TYPES, articleTypeService.list());
+
Map requestData = new HashMap();
Enumeration keys = request.getAttributeNames();