Skip to content

Commit

Permalink
Fixed issue mysticfall#212
Browse files Browse the repository at this point in the history
  • Loading branch information
lhg-interact committed Dec 27, 2017
1 parent fc15e0e commit fa52e6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.Serializable;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
Expand All @@ -20,6 +21,7 @@
import org.olap4j.metadata.Hierarchy;
import org.olap4j.metadata.Member;
import org.olap4j.metadata.MetadataElement;
import org.olap4j.metadata.NamedList;
import org.pivot4j.PivotModel;
import org.pivot4j.analytics.component.tree.DefaultTreeNode;
import org.pivot4j.analytics.component.tree.NodeFilter;
Expand Down Expand Up @@ -416,11 +418,14 @@ public void moveDown() {

public Hierarchy getHierarchy() {
if (hierarchy == null && hierarchyName != null && model.isInitialized()) {
this.hierarchy = model.getCube().getHierarchies()
.get(hierarchyName);
}

return hierarchy;
for (Hierarchy h : model.getCube().getHierarchies()) {
if (h.getUniqueName().equals(hierarchyName)) {
this.hierarchy = h;
}
}
}

return hierarchy;
}

protected MemberSelection getSelection() {
Expand Down
2 changes: 1 addition & 1 deletion pivot4j-analytics/src/main/webapp/view.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
action="#{memberSelectionHandler.show}" update=":hierarchy-form"
oncomplete="PF('hierarchyConfig').show();"
title="#{msg['button.hierarchyConfig.tooltip']}">
<f:param name="hierarchy" value="#{node.name}" />
<f:param name="hierarchy" value="#{node.uniqueName}" />
</p:commandButton>
<!-- workaround for PrimeFaces issue #4748 -->
<p:draggable for="hierarchy-node"
Expand Down
8 changes: 4 additions & 4 deletions pivot4j-core/src/main/java/org/pivot4j/impl/Quax.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ public void setHierarchies(List<Hierarchy> hierarchies) {
hierarchyMap.clear();

for (Hierarchy hierarchy : hierarchies) {
hiers.add(hierarchy.getName());
hierarchyMap.put(hierarchy.getName(), hierarchy);
hiers.add(hierarchy.getUniqueName());
hierarchyMap.put(hierarchy.getUniqueName(), hierarchy);
}
}

Expand Down Expand Up @@ -557,8 +557,8 @@ public void regeneratePosTree(List<Exp> sets, boolean hiersChanged) {
for (Exp set : sets) {
try {
Hierarchy hierarchy = quaxUtil.hierForExp(set);
hiers.add(hierarchy.getName());
hierarchyMap.put(hierarchy.getName(), hierarchy);
hiers.add(hierarchy.getUniqueName());
hierarchyMap.put(hierarchy.getUniqueName(), hierarchy);
} catch (UnknownExpressionException e) {
throw new PivotException("Unknown expression : "
+ e.getExpression());
Expand Down

0 comments on commit fa52e6d

Please sign in to comment.