From fa52e6de2b19521828c388db1480d6584d4f5fec Mon Sep 17 00:00:00 2001 From: lhg-interact <34886488+lhg-interact@users.noreply.github.com> Date: Wed, 27 Dec 2017 11:33:02 -0200 Subject: [PATCH 1/3] Fixed issue #212 --- .../analytics/ui/MemberSelectionHandler.java | 15 ++++++++++----- pivot4j-analytics/src/main/webapp/view.xhtml | 2 +- .../src/main/java/org/pivot4j/impl/Quax.java | 8 ++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java b/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java index 1afdee2c..b99e447a 100644 --- a/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java +++ b/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java @@ -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; @@ -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; @@ -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() { diff --git a/pivot4j-analytics/src/main/webapp/view.xhtml b/pivot4j-analytics/src/main/webapp/view.xhtml index 5b26eca9..96efd16b 100644 --- a/pivot4j-analytics/src/main/webapp/view.xhtml +++ b/pivot4j-analytics/src/main/webapp/view.xhtml @@ -354,7 +354,7 @@ action="#{memberSelectionHandler.show}" update=":hierarchy-form" oncomplete="PF('hierarchyConfig').show();" title="#{msg['button.hierarchyConfig.tooltip']}"> - + 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); } } @@ -557,8 +557,8 @@ public void regeneratePosTree(List 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()); From 449acee4b49faed04b88f7e48fe00719a17c783a Mon Sep 17 00:00:00 2001 From: lhg-interact <34886488+lhg-interact@users.noreply.github.com> Date: Wed, 27 Dec 2017 11:41:16 -0200 Subject: [PATCH 2/3] Fixed code indentation --- pivot4j-core/src/main/java/org/pivot4j/impl/Quax.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pivot4j-core/src/main/java/org/pivot4j/impl/Quax.java b/pivot4j-core/src/main/java/org/pivot4j/impl/Quax.java index cb8af07d..7792e933 100644 --- a/pivot4j-core/src/main/java/org/pivot4j/impl/Quax.java +++ b/pivot4j-core/src/main/java/org/pivot4j/impl/Quax.java @@ -497,8 +497,8 @@ public void setHierarchies(List hierarchies) { hierarchyMap.clear(); for (Hierarchy hierarchy : hierarchies) { - hiers.add(hierarchy.getUniqueName()); - hierarchyMap.put(hierarchy.getUniqueName(), hierarchy); + hiers.add(hierarchy.getUniqueName()); + hierarchyMap.put(hierarchy.getUniqueName(), hierarchy); } } @@ -557,8 +557,8 @@ public void regeneratePosTree(List sets, boolean hiersChanged) { for (Exp set : sets) { try { Hierarchy hierarchy = quaxUtil.hierForExp(set); - hiers.add(hierarchy.getUniqueName()); - hierarchyMap.put(hierarchy.getUniqueName(), hierarchy); + hiers.add(hierarchy.getUniqueName()); + hierarchyMap.put(hierarchy.getUniqueName(), hierarchy); } catch (UnknownExpressionException e) { throw new PivotException("Unknown expression : " + e.getExpression()); From 37553e4ff8dec5dad49b4aa4828b053fd6393716 Mon Sep 17 00:00:00 2001 From: lhg-interact <34886488+lhg-interact@users.noreply.github.com> Date: Wed, 27 Dec 2017 11:43:16 -0200 Subject: [PATCH 3/3] Fixed code indentation --- .../analytics/ui/MemberSelectionHandler.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java b/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java index b99e447a..ddd0a869 100644 --- a/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java +++ b/pivot4j-analytics/src/main/java/org/pivot4j/analytics/ui/MemberSelectionHandler.java @@ -418,14 +418,14 @@ public void moveDown() { public Hierarchy getHierarchy() { if (hierarchy == null && hierarchyName != null && model.isInitialized()) { - for (Hierarchy h : model.getCube().getHierarchies()) { - if (h.getUniqueName().equals(hierarchyName)) { - this.hierarchy = h; - } - } - } - - return hierarchy; + for (Hierarchy h : model.getCube().getHierarchies()) { + if (h.getUniqueName().equals(hierarchyName)) { + this.hierarchy = h; + } + } + } + + return hierarchy; } protected MemberSelection getSelection() {