1 package com.genimen.djeneric.web.controller; 2 3 import java.io.IOException ; 4 5 import javax.servlet.ServletException ; 6 import javax.servlet.http.HttpServletRequest ; 7 import javax.servlet.http.HttpServletResponse ; 8 9 import org.w3c.dom.Document ; 10 11 import com.genimen.djeneric.repository.DjExtent; 12 import com.genimen.djeneric.repository.exceptions.DjenericException; 13 import com.genimen.djeneric.web.renderers.FilterRenderer; 14 import com.genimen.djeneric.web.renderers.tree.WebTree; 15 import com.genimen.djeneric.web.util.DjenericSessionManager; 16 import com.genimen.djeneric.web.util.DjenericXSLTransform; 17 18 public class ChooseCommand 19 { 20 FilterRenderer _renderer = new FilterRenderer(); 21 22 public void get(DjenericSessionManager sessionManager, HttpServletRequest request, HttpServletResponse response) 23 throws IOException , ServletException , DjenericException 24 { 25 try 26 { 27 WebTree tree = sessionManager.getTree(); 28 29 response.setContentType("text/html; charset=UTF-8"); 30 31 String extentName = request.getParameter("extent"); 32 if (extentName != null) 33 { 34 DjExtent extent = sessionManager.getExtent(extentName); 35 36 DjenericXSLTransform xsl = sessionManager.getTransformer(); 37 38 Document doc = _renderer.asXml(extent, sessionManager.getPrimarySession(), null); 39 40 String page = xsl.transform(doc, "dialogs/choose.xsl"); 41 response.getWriter().print(page); 42 } 43 else throw new DjenericException("No nodeid parameter specified"); 44 } 45 catch (Exception e) 46 { 47 throw new ServletException (e); 48 } 49 } 50 51 public void post(DjenericSessionManager sessionManager, HttpServletRequest request, HttpServletResponse response) 52 { 53 54 } 55 } 56 | Popular Tags |