jpivot (en)

JPivot Tag Library.

Content


chart

Body ContentJSP
Description Creates a Chart component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
querytrueOlapModeltrue Name of the Session Attribute that contains the OLAP Data (query and result) for this tag.
baseDisplayURLfalseStringtrue Base link to chart display servlet. Will be parameterized with '?filename=<temp chart image file name>'
controllerURLfalseStringtrue Base link to web application controller for JPivot. Useful for complicated environments like a portal, where you would use a portlet:renderURL

chooseQuery

Body ContentJSP
Description chooses a query that has been previously created with a queryName attribute.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
queryNamefalseStringtrue name of the query to choose

Example

<jp:mondrianQuery id="query01" queryName="name1">
   SELECT ...
</jp:mondrianQuery>
<jp:mondrianQuery id="query01" queryName="name2">
   SELECT ...
</jp:mondrianQuery>
...
<jp:chooseQuery id="query01" queryName="name1"/>

clickable

Body ContentEMPTY
Description Makes all members of a dimension or level clickable (i.e. generates an anchor). The generated URL contains the unique name of the member. Must be nested inside a table or query tag.

The behaviour depends on the sessionParam attribute. If its present, then the parameter value will be written into the com.tonbeller.jpivot.param.SessionParamPool before the new page is shown. If its not present, the parameter will be coded into the hyperlink and must be treated in some way by the receiving page.

This tag must be nested either inside a table tag or inside a query tag. Inside the table tag the clickable is available for all queries, inside the query tag its only available for that query.

AttributeRequiredTypertexprDescription
urlPatternfalseStringtrue DEPRECATED - do not use in conjunction with session parameters because the browser back button does not work as expected. Use page attribute instead.

The pattern to construct the url. If sessionParam attribute is NOT present, then "{0}" will be replaced with the unique name of the member. If urlPattern starts with "/" its relative to the application context, otherwise its absolute
pagefalseStringtrue Name of the target page, must start with "/". If not set the current page is re-displayed.
uniqueNametrueStringtrue unique name of a dimension, hierarchy or level, whose members will be clickable
menuLabelfalseStringtrue if there are multiple clickables specified, they will be displayed in a popup menu, this text will be the label for the menu entry
sessionParamfalseStringtrue name of the parameter, that will be placed into the com.tonbeller.jpivot.param.SessionParamPool
propertyNamefalseStringtrue if present, the value of that member property will be taken for the com.tonbeller.jpivot.param.Parameter sqlValue property
propertyPrefixfalseStringtrue if present, multiple SessionParam will be created, one for each member property whose name starts with propertyPrefix. The name of the SessionParam will be the name of the reminder of the member properties name after the prefix. If present, the attributes sessionParam and propertyName are not allowed.
providerClassfalseStringtrue if present, an instance of this class will extract the SessionParam instances from the member. The class must implement com.tonbeller.jpivot.table.navi.ClickableMember.ParameterProvider. The attributes sessionParam, propertyName, propertyPrefix are not allowed in this case.

Example

<jp:mondrianQuery ...>
  select .. from Sales
  <jp:clickable urlPattern="/otherpage.jsp?param={0}" uniqueName="[Customers]"/>
  <jp:clickable page="/yetotherpage.jsp" uniqueName="[Products].[Category]" sessionParam="Category"/>
</jp:mondrianQuery>
    

destroyQuery

Body ContentJSP
Description destroys all queries stored with this id

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag

Example

<jp:destroyQuery id="query01"/>

mondrianQuery

Body ContentJSP
Description Creates a session attribute that allows access to a Mondrian query, its result and navigations. The attribute is always created, if the attribute already existst it will be replaced. So one has to take care that this tag creates the attribute only if it should, e.g. by using JSTL <c:if ... > tags or similar.

Its possible to use a predefined JSBC DataSource from the application server or to specify the individual JDBC parameters with this tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
jdbcDriverfalseStringtrue Java class name of the JDBC driver
jdbcUrlfalseStringtrue Connection parameters, these are database specific
jdbcUserfalseStringtrue user name to connect to the database
jdbcPasswordfalseStringtrue password to connect to the database
dataSourcefalseStringtrue JNDI name of a preconfigured JDBC DataSource, e.g. jdbc/SironTDI. Must not be used with the other JDBC attributes
catalogUritrueStringtrue Path of the Mondrian schema, relative to the application context, e.g. /WEB-INF/FoodMart.xml
configfalseStringtrue internal use only
rolefalseStringtrue Role from Mondrian Schema
dynResolverfalseStringtrue class resolving Mondrian Schema dynamic variables
dynLocalefalseStringtrue Locale for dynamic Mondrian Schema Resolver
connectionPoolingfalseStringtrue "false" will prevent Mondrian from Connection Pooling
dataSourceChangeListenerfalseStringtrue class to detect changes in datasource
queryNamefalseStringtrue Allows to keep multiple queries within this session attribute. For every queryName, the last query will be stored. Use chooseQuery tag to switch between queryName's or queries.
stackModefalsebooleantrue If set to false, all queryNames are treated equally, independent of the order they are created or shown using the chooseQuery tag.

If set to true it will keep the different queryName's in a stack. Example:
  • A query with queryName qn1 is created. Then this tag will display that query
  • A query with queryName qn2 is created next. Now there is a stack containing qn1 and qn2. qn2 will be the visible query.
  • At this point, for example, if the user switches back to qn1 using the chooseQuery tag, then qn2 will be destroyed in stack mode. It would not be destroyed in non-stackMode.
So in non-stackMode the user can arbitrary choose one of the different queries. In stackMode, if the user goes back to a previously seen query, all "younger" queries will be destroyed.

Example

<jp:mondrianQuery id="query01"
  jdbcDriver="com.mysql.jdbc.Driver"
  jdbcUrl="jdbc:mysql://localhost/foodmart"
  catalogUri="/WEB-INF/test/FoodMart.xml">
select
  {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} on columns,
  {[Product].[All Products]} ON rows
from Sales
where ([Time].[1997])
</jp:mondrianQuery>

navigator

Body ContentJSP
Description Creates the Navigator component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
querytrueOlapModeltrue Name of the Session Attribute that contains the OLAP Data (query and result) for this tag.
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.

Example

<jp:navigator id="navi01" query="#{query01}" visible="false"/>
<wcf:render ref="navi01" xslUri="/WEB-INF/jpivot/navi/navigator.xsl" xslCache="true"/>
    

print

Body ContentJSP
Description Creates the Print component. This component does not produce visible output directly, you must create a WCF form to configure and call the print servlet to render to XLS/PDF

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag

scalarQuery

Body ContentJSP
Description Creates a session attribute that contains an OLAP result consisting of a single cell. The values are provide through tag attributes.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
valuetrueStringtrue EL expression evaluating to the value (number)
formattedValuefalseStringtrue EL expression evaluating to the formatted value (String)
captionfalseStringtrue EL expression evaluating to the caption (String)
queryNamefalseStringtrue see mondrianQuery
stackModefalsebooleantrue see mondrianQuery

Example

<jp:scalarQuery
  id="query01"
  value="#{some.bean.property}">
  formattedValue="#{some.bean.otherProperty}"
  caption="Some Caption" />
 

selectproperties

Body ContentJSP
Description Creates the Select Properties component, which allows to specify which properties shall be visible and in which orderd. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
tabletrueTableComponenttrue Name of the Session Attribute that contains the Table Component for this tag.
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.

Example

<jp:selectproperties id="selectprop01" table="#{table01}" visible="false"/>
<wcf:render ref="selectprop01" xslUri="/WEB-INF/jpivot/navi/navigator.xsl" xslCache="true"/>
    

setParam

Body ContentJSP
Description Sets a mdx query parameter from an http parameter or from a session parameter. The body is evaluated only if the http parameter is present, so its a good place to contain a mondrian query. If you use the session Parameter, the body is never evaluated. Exactly one attribute either httpParam or sessionParam must be set.

AttributeRequiredTypertexprDescription
querytrueOlapModeltrue Name of the Session Attribute that contains the OLAP Data (query and result) for this tag.
httpParamfalseStringtrue Name of a http parameter. If present, its value will be parsed and set into the mdx parameter
sessionParamfalseStringtrue name of the session parameter
mdxParamtrueStringtrue Name of the MDX Parameter in the query to modify

Example

<jp:mondrianQuery id="query01"...>
  SELECT ... Parameter("Param01", ...)
  WHERE ...
</jp:mondrianQuery/>

<jp:setParam query="query01" httpParam="param" mdxParam="Param01"/>
or
<jp:setParam query="query01" sessionParam="CUSTOMER" mdxParam="Param01"/>
    

table

Body ContentJSP
Description Creates a Pivot Table component. This component does not produce visible output directly, it must be rendered via the WCF render tag.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
visiblefalsebooleantrue Sets the visible property of the component. The WCF Render tag will not show a component whose visible flag is false
rolefalseStringtrue Name of a role, optionally prefixed by '!'. Example: role='tomcat' allows members of the role tomcat to access this component, role='!tomcat' grants access to everybody except tomcat members.
querytrueOlapModeltrue Name of the Session Attribute that contains the OLAP Data (query and result) for this tag.
configXmlfalseStringtrue Path for a config file that allows to add customer specific code

Example

<jp:table id="table01" query="#{query01}" visible="true"/>

testQuery

Body ContentJSP
Description Creates test data that can be displayed by the table or chart components

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
onRowsfalseStringtrue Whitespace separated list of dimensions to show on rows. Possible values are: Measures, Region, Products, Advertising, Material
onColumnsfalseStringtrue Whitespace separated list of dimensions to show on columns. Possible values are: Measures, Region, Products, Advertising, Material

Example

<jp:testQuery id="query01" onColumns="Measures" onRows="Products Region">
  for some reason, the body must not be empty
</jp:testQuery>
    

xmlaQuery

Body ContentJSP
Description Creates a session attribute for an XMLA query. It will be used by components like table or navigator to display the result and navigate the cube. The attribute is always created, if the attribute already exists it will be replaced. So one has to take care that this tag creates the attribute only if it should, e.g. by using JSTL <c:if ... > tags or similar.

AttributeRequiredTypertexprDescription
idtrueStringtrue Name of the Session Attribute that is created by this tag
uritrueStringtrue The URI used to access the XMLA server
dataSourcefalseStringtrue DataSourceInfo specification like "Provider=MSOLAP;Data Source=local"
catalogtrueStringtrue Catalog spezification like "Foodmart 2000"
configfalseStringtrue Path to a config file that allows to integrat customer specific code

Example

<jp:xmlaQuery id="query01"
  uri="http://MYSERVER/XML4A/msxisapi.dll"
  catalog="Foodmart 2000">
select
  {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} on columns,
  {[Product].[All Products]} ON rows
from Sales
where ([Time].[1997])
</jp:xmlaQuery>