1 13 package com.tonbeller.jpivot.table; 14 15 import java.net.URL ; 16 17 import javax.servlet.jsp.JspException ; 18 19 import com.tonbeller.jpivot.olap.model.OlapModel; 20 import com.tonbeller.wcf.component.Component; 21 import com.tonbeller.wcf.component.ComponentTag; 22 import com.tonbeller.wcf.controller.RequestContext; 23 24 28 public class TableComponentTag extends ComponentTag { 29 String query; 30 String configXml = null; 31 32 35 public Component createComponent(RequestContext context) throws Exception { 36 OlapModel olapModel = (OlapModel) context.getModelReference(query); 38 if (olapModel == null) 39 throw new JspException ("query \"" + query + "\" not found"); 40 41 URL configUrl; 43 if (configXml != null) 44 configUrl = pageContext.getServletContext().getResource(configXml); 45 else 46 configUrl = getClass().getResource("config.xml"); 47 48 return TableComponentFactory.instance(id, configUrl, olapModel); 49 50 } 51 52 56 public String getConfigXml() { 57 return configXml; 58 } 59 60 64 public void setConfigXml(String configXml) { 65 this.configXml = configXml; 66 } 67 68 72 public String getQuery() { 73 return query; 74 } 75 76 80 public void setQuery(String query) { 81 this.query = query; 82 } 83 84 } 85 | Popular Tags |