<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6001.17052" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2>If the RolapResult object has stripped away the
RolapVirtualCubeMeasure objects, and what appear in the axes are the raw Measure
objects, then I guess that would be consistent with what you're seeing. There
may be a good reason for it - but I agree with you that it would seem better to
return the RolapVirtualCubeMeasure object, since it has more appropriate
metadata.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2>Mondrian's metamodel is very similar to ADO, so yes, you
can definitely get caption, level unique name, etc. for each position on an
axis. All of these properties can be gotten from the member in a fairly direct
way. (And in fact our XMLA handler does just that when answering an XMLA query
request.)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2>I don't know what JPivot calls to get the caption of a
member on an axis, but it's usually fairly straightforward. I would be surprised
if it doesn't just to member.getCaption(). And it's definitely something that
you could emulate in a test, so jpivot should give the right answer if and only
if the test gives the right answer.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2>Hope this answers your question - or at least gives you a
clue where to look next.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2>Julian</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=009132900-06022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org
[mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>Alan
Jackson<BR><B>Sent:</B> Tuesday, February 05, 2008 2:26 PM<BR><B>To:</B>
mondrian@pentaho.org<BR><B>Subject:</B> RE: [Mondrian] Calculation Captions in
Virtual Cubes<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV id=idOWAReplyText10281 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Thanks Julian</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>I totally agree that no code is too
simple to test.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>The advice you offer is something that
I'd tried first time round on this - unfortunately, from my understanding of
things, this does in fact return the caption for the Measure represented
by the position on the axis; not the RolapVirtualCubeMeasure at the position
on the axis - thus getting the caption for this does the right thing in terms
of getting the caption as specified in the schema XML through MemberBase
rather than through RolapVirtualCubeMeasure. This is because we actually get
hold of the physical member which isn't a
RolapVirtualCubeMeasure.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I'm coming at this with a background
using Microsoft technologies having previously been responsible for the OLAP
access in Crystal Reports (for my sins!) so have been used to dealing with
Axis Rowsets that return member Unique Names, Captions, Level Unique Names,
Level number and Display info for each member in the result. In order to
prove my change, what I guess I'm after is getting this same information
against Mondrian - is this possible? I presume it must be as I believe this is
what JPivot (our rendering control) gets the "wrong" caption without my
change, but gets the right one with it.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>Alan</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org on behalf
of Julian Hyde<BR><B>Sent:</B> Tue 05/02/2008 19:22<BR><B>To:</B> 'Mondrian
developer mailing list'<BR><B>Subject:</B> RE: [Mondrian] Calculation Captions
in Virtual Cubes<BR></FONT><BR></DIV>
<DIV dir=ltr>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2>Alan,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2>Sorry for the delay in replying. I am busy, as
ever.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2>Your proposed getCaption() method makes sense. It almost
seems to simple to test, but then again, no code is too simple to break, so
let's test it.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2>To test it, add a method to SchemaTest. The test will
probably need to create its own variant of the foodmart schema; follow
the example of a test in that class that tests a similar thing. Then execute a
query on that virtual cube that returns the measure on the columns axis,
navigate to the member using something like
result.getAxes().get(0).axis.getPositions().get(0).getMembers().get(0) and
call its getCaption method to make sure that the caption is as you
want.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2>Julian</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=093031519-05022008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org
[mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>Alan
Jackson<BR><B>Sent:</B> Monday, February 04, 2008 1:28 PM<BR><B>To:</B>
mondrian@pentaho.org<BR><B>Subject:</B> RE: [Mondrian] Calculation Captions
in Virtual Cubes<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>In the absence of any
responses to my request for help, I am still no further
forward.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>I have seen that the final has been
removed from MemberBase::getCaption by wgorman's check-in on 16
Nov.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I would still like to add the following
to RolapVirtualCubeMeasure.java but am void of any ideas on how I can really
test this in a unit test fashion.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><PRE>public String getCaption() {</PRE></DIV>
<DIV dir=ltr><PRE dir=ltr> return cubeMeasure.getCaption();</PRE></DIV><PRE dir=ltr>}</PRE>
<DIV dir=ltr><FONT face=Arial size=2>The reason I would like to do this is
that without passing this request on to the cubeMeasure, the default caption
is returned for the member - not the caption as specified in the original
cube's schema XML.</FONT></DIV>
<P><FONT face=Arial size=2></FONT> </P>
<P><FONT face=Arial size=2>Any thoughts on a means to test this would be
appreciated - or if someone wants to check it and submit it for me then I
would be grateful.</FONT></P>
<P><FONT face=Arial size=2>If I'm missing the point of this list then please
tell me to shut up!</FONT></P>
<P><FONT face=Arial size=2>Thanks</FONT></P>
<P><FONT face=Arial size=2>Alan</FONT></P>
<P> </P>
<DIV dir=ltr><BR></DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><FONT face=Tahoma size=2><B>From:</B>
mondrian-bounces@pentaho.org on behalf of Alan Jackson<BR><B>Sent:</B> Thu
31/01/2008 19:32<BR><B>To:</B> mondrian@pentaho.org<BR><B>Subject:</B>
[Mondrian] Calculation Captions in Virtual Cubes<BR></FONT><BR></DIV>
<DIV dir=ltr>
<DIV><FONT face=Arial color=#000000 size=2>Hi</FONT></DIV>
<DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The problem is where a calculation in a
cube has a caption define in the schema XML. When using this calculation in
a virtual cube, the specified caption is not returned but the default
caption is returned.</FONT></DIV>
<DIV><FONT face=Arial size=2>(see thread <FONT face=Arial color=#000000
size=2><A
href="https://mail.symmetrics.net/exchweb/bin/redir.asp?URL=http://forums.pentaho.org/showthread.php?t=53867"
target=_blank>http://forums.pentaho.org/showthread.php?t=53867</A>)</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've got a solution that works in our scenario,
but I'm struggling to create a unit test to highlight the problem - I want
to create unit tests so that I am able to submit the change back into the
community. The example tests I've seen all end up getting the measure
through the schema objects rather than getting the caption from the axis
result sets.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Are there any examples you guys can point me to
that get the captions back for the axes that I could use to validate this
fix?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The main contention in the fix would be the
removal of the "final" from MemberBase::getCaption so that it can be
overridden in RolapVirtualCubeMeasure - do you see this being a big
problem?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>TIA</FONT></DIV>
<DIV><FONT face=Arial
size=2>Alan</FONT></DIV></DIV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></BODY></HTML>