1 package org.paneris.jal.controller;
2
3 import org.paneris.jal.model.DBConnectionManager;
4 import org.webmacro.Template;
5 import org.webmacro.servlet.HandlerException;
6 import org.webmacro.servlet.PanerisPage;
7 import org.webmacro.servlet.WebContext;
8
9
10
11
12
13 public class AdministrationDatasources extends PanerisPage {
14
15 private static final long serialVersionUID = 1L;
16 private DBConnectionManager connMgr = DBConnectionManager.getInstance();
17
18
19
20
21
22
23
24
25 public Template handle(WebContext context) throws HandlerException {
26 context.put("datasources",connMgr.getPools());
27
28
29 String templateName = (String) context.getForm("wmtemplate");
30 if (templateName == null) templateName = "jal/view/AdministrationDatasources.wm";
31 context.put("wmtemplate",templateName);
32 try {
33 return (Template) context.getBroker().get("template",templateName);
34 } catch (Exception e) {
35 throw new HandlerException("Could not locate template: " + templateName);
36 }
37 }
38
39 }
40