Skip to content

Commit e201c97

Browse files
committed
Implement clearWarnings() as no-op (needed by apache-commons-dbcp); Make sure Level.getMembers() returns objects that implement Measure if applied to level in [Measures] dimension; Minor changes to web home page.
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@95 c6a108a4-781c-0410-a6c6-c2d559e19af0
1 parent babc6b2 commit e201c97

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
lines changed

doc/index.html

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
== This software is subject to the terms of the Common Public License
88
== Agreement, available at the following URL:
99
== http://www.opensource.org/licenses/cpl.html.
10-
== Copyright (C) 2006-2007 Julian Hyde and others.
10+
== Copyright (C) 2006-2008 Julian Hyde and others.
1111
== All Rights Reserved.
1212
== You must accept the terms of that agreement to use this software.
1313
-->
@@ -188,7 +188,8 @@ <h4>Resources</h4>
188188
<h4>Get involved!</h4>
189189
<p>Join the <a href="http://sourceforge.net/forum/forum.php?forum_id=577988">forum</a>, download the specification, and give us your feedback. If you are developing an OLAP server, component or
190190
application, let's work together to make your project olap4j-compliant.</p><br/>
191-
<p>Drivers for mondrian and XML/A are under development; we're looking for committers to work on these drivers and drivers for other servers.</p></td>
191+
<p>Drivers for mondrian and XML/A are under development; we're looking for committers to work on these drivers and drivers for other servers.</p>
192+
</td>
192193
<td rowspan="5" class="col_spacer" style="padding-bottom: 10px;"><img src="images/spacer.png" class="col_spacer"/></td>
193194
<td rowspan="4" valign="top" style="padding-bottom: 10px;"><div class="participation_bg"><h4 style="margin: 0px;">Participation</h4>
194195
olap4j is an open specification, being developed by a consortium of companies and open source projects, including:
@@ -214,7 +215,12 @@ <h5>Companies</h5>
214215
</table></td>
215216
</tr>
216217
<tr>
217-
<td colspan="2" class="copyright">&copy; 2007</td></td>
218+
<td colspan="2" class="copyright">&copy; 2007-2008</td>
219+
</tr>
220+
<tr>
221+
<td colspan="2" align="right">
222+
<a href="http://sourceforge.net/projects/olap4j"><img src="http://sourceforge.net/sflogo.php?group_id=168953&type=1" width="88" height="31" border="0" alt="SourceForge.net_Logo"></a>
223+
</td>
218224
</tr>
219225
</table>
220226
</td>

src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public SQLWarning getWarnings() throws SQLException {
342342
}
343343

344344
public void clearWarnings() throws SQLException {
345-
throw new UnsupportedOperationException();
345+
// this driver does not support warnings, so nothing to do
346346
}
347347

348348
public Statement createStatement(

src/org/olap4j/driver/xmla/XmlaOlap4jCube.java

+45
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class XmlaOlap4jCube implements Cube, Named
4646
new NamedListImpl<XmlaOlap4jNamedSet>();
4747
private final MetadataReader metadataReader;
4848

49+
/**
50+
* Creates an XmlaOlap4jCube.
51+
*
52+
* @param olap4jSchema Schema
53+
* @param name Name
54+
* @param description Description
55+
*/
4956
XmlaOlap4jCube(
5057
XmlaOlap4jSchema olap4jSchema,
5158
String name,
@@ -120,6 +127,27 @@ class XmlaOlap4jCube implements Cube, Named
120127
measure.getUniqueName(),
121128
new SoftReference<XmlaOlap4jMember>(measure));
122129
}
130+
if (!measures.isEmpty()) {
131+
final XmlaOlap4jHierarchy measuresHierarchy =
132+
measures.get(0).getHierarchy();
133+
for (XmlaOlap4jLevel level : measuresHierarchy.levels) {
134+
final List<Member> memberList = level.getMembers();
135+
final List<Measure> measureList =
136+
new ArrayList<Measure>(memberList.size());
137+
for (Member member : memberList) {
138+
final SoftReference<XmlaOlap4jMember> measureRef =
139+
((CachingMetadataReader) metadataReader).memberMap.get(
140+
member.getUniqueName());
141+
// gc not possible - we hold all members in 'measures' field.
142+
assert measureRef.get() != null;
143+
measureList.add((Measure) measureRef.get());
144+
}
145+
((CachingMetadataReader) metadataReader).levelMemberListMap.put(
146+
level,
147+
new SoftReference<List<XmlaOlap4jMember>>(
148+
Olap4jUtil.<XmlaOlap4jMember>cast(measureList)));
149+
}
150+
}
123151
// populate named sets
124152
olap4jConnection.populateList(
125153
namedSets, context,
@@ -177,6 +205,13 @@ public Member lookupMember(String... nameParts) throws OlapException {
177205
return lookupMember(segmentList);
178206
}
179207

208+
/**
209+
* Finds a member, given its fully qualfieid name.
210+
*
211+
* @param segmentList List of the segments of the name
212+
* @return Member, or null if not found
213+
* @throws OlapException on error
214+
*/
180215
private Member lookupMember(
181216
List<IdentifierNode.Segment> segmentList) throws OlapException
182217
{
@@ -230,6 +265,11 @@ private static abstract class DelegatingMetadataReader
230265
{
231266
private final MetadataReader metadataReader;
232267

268+
/**
269+
* Creates a DelegatingMetadataReader.
270+
*
271+
* @param metadataReader Underlying metadata reader
272+
*/
233273
DelegatingMetadataReader(MetadataReader metadataReader) {
234274
this.metadataReader = metadataReader;
235275
}
@@ -283,6 +323,11 @@ private static class CachingMetadataReader
283323
levelMemberListMap =
284324
new HashMap<XmlaOlap4jLevel, SoftReference<List<XmlaOlap4jMember>>>();
285325

326+
/**
327+
* Creates a CachingMetadataReader.
328+
*
329+
* @param metadataReader Underlying metadata reader
330+
*/
286331
CachingMetadataReader(MetadataReader metadataReader) {
287332
super(metadataReader);
288333
}

0 commit comments

Comments
 (0)