/* // $Id: //guest/julian_hyde/mondrian/src/main/mondrian/web/taglib/QueryTag.java#1 $ // This software is subject to the terms of the Common Public License // Agreement, available at the following URL: // http://www.opensource.org/licenses/cpl.html. // (C) Copyright 2002 Kana Software, Inc. and others. // All Rights Reserved. // You must accept the terms of that agreement to use this software. // // Andreas Voss, 22 March, 2002 */ package mondrian.web.taglib; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.*; import mondrian.olap.Result; /** * creates a ResultCache Object and initializes it with the MDX query */ public class QueryTag extends BodyTagSupport { public QueryTag() { } public int doAfterBody() throws JspException { try { ApplResources ar = ApplResources.getInstance(pageContext.getServletContext()); ResultCache rc = ResultCache.getInstance(pageContext.getSession(), name); // if this is the first call, we have to parse the mdx query if (!resultCache || rc.getQuery() == null) { String mdx = getBodyContent().getString(); rc.parse(mdx); } return SKIP_BODY; } catch (Exception e) { e.printStackTrace(); throw new JspException(e); } } public void setName(String newName) { name = newName; } public String getName() { return name; } public void setResultCache(boolean newResultCache) { resultCache = newResultCache; } public boolean isResultCache() { return resultCache; } private String name; private boolean resultCache; } // End QueryTag.java
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 1622 | Julian Hyde | mondrian: Javadoc. | ||
#1 | 1603 | Julian Hyde |
mondrian: Add Andreas' taglib; Rename 'mondrian.rolap.Util.assert' to 'assertTrue', because 'assert' is a keyword in jdk 1.4; Fix 'NON EMPTY'; JUnit framework for tests; Add Oracle dataset. |