#9 The top level is missing in the jpivot table

open-fixed
nobody
None
5
2009-05-27
2009-03-26
Min
No

The top level is missing in the jpivot table if the user is restricted to access All member by applying the mondrian security role like below:

<HierarchyGrant access="custom" topLevel="[Dim_Customer].[Sales Rep]" bottomLevel="[Dim_Customer].[Customer]" rollupPolicy="partial" hierarchy="Dim_Customer]">

See the patch attached for the fix.

Discussion

  • Min

    Min - 2009-03-26

    The top level is missing in the jpivot table

     
  • Min

    Min - 2009-05-27

    In case of the applied security, the level might be null, add the null check.

    Index: com/tonbeller/jpivot/mondrian/MondrianMember.java

    RCS file: /cvsroot/jpivot/jpivot/src/java/com/tonbeller/jpivot/mondrian/MondrianMember.java,v
    retrieving revision 1.4
    diff -r1.4 MondrianMember.java
    96a97,111
    > //bug fix #2576, get the root member
    > public mondrian.olap.Member getRootMember() {
    > SchemaReader scr = model.getSchemaReader();
    > mondrian.olap.Member m = monMember;
    > mondrian.olap.Member root=m;
    > while (true) {
    > m = scr.getMemberParent(m);
    > if (m == null){
    > return root;
    > }else{
    > root=m;
    > }
    > }
    > }
    >
    Index: com/tonbeller/jpivot/mondrian/MondrianModel.java
    ===================================================================
    RCS file: /cvsroot/jpivot/jpivot/src/java/com/tonbeller/jpivot/mondrian/MondrianModel.java,v
    retrieving revision 1.22
    diff -r1.22 MondrianModel.java
    677,680c677,687
    < MondrianMember member = new MondrianMember(monMember, level, this);
    < hMembers.put(uniqueName, member);
    < if (monMember.isMeasure())
    < aMeasures.add(member);
    ---
    > MondrianMember member = null;
    > //in case of the applied security, the level might be null
    > if(level==null){
    > hMembers.put(uniqueName, null);
    > }else{
    > member = new MondrianMember(monMember, level, this);
    > hMembers.put(uniqueName, member);
    > if (monMember.isMeasure()){
    > aMeasures.add(member);
    > }
    > }
    Index: com/tonbeller/jpivot/table/LevelAxisDecorator.java
    ===================================================================
    RCS file: /cvsroot/jpivot/jpivot/src/java/com/tonbeller/jpivot/table/LevelAxisDecorator.java,v
    retrieving revision 1.2
    diff -r1.2 LevelAxisDecorator.java
    92c92
    < if (members[i].isAll())
    ---
    > if (members[i].isAll()){
    93a94,100
    > }else if(members[i] instanceof com.tonbeller.jpivot.mondrian.MondrianMember){
    > //bug fix #2576, skip only if the root member is all
    > mondrian.olap.Member root=((com.tonbeller.jpivot.mondrian.MondrianMember) members[i]).getRootMember();
    > if(!root.isAll()){
    > skipAllMember[i]=false;
    > }
    > }

     
  • Min

    Min - 2009-05-27
    • status: open --> open-fixed
     

Log in to post a comment.