1 13 14 package com.tonbeller.jpivot.xmla; 15 16 import java.util.Iterator ; 17 import java.util.List ; 18 19 import org.apache.log4j.Logger; 20 21 import com.tonbeller.jpivot.olap.mdxparse.Exp; 22 import com.tonbeller.jpivot.olap.mdxparse.FunCall; 23 import com.tonbeller.jpivot.olap.model.Dimension; 24 import com.tonbeller.jpivot.olap.model.Hierarchy; 25 import com.tonbeller.jpivot.olap.model.Level; 26 import com.tonbeller.jpivot.olap.model.Member; 27 import com.tonbeller.jpivot.olap.model.OlapException; 28 import com.tonbeller.jpivot.olap.query.Quax; 29 import com.tonbeller.jpivot.olap.query.QuaxUti; 30 import com.tonbeller.jpivot.olap.query.SetExp; 31 import com.tonbeller.jpivot.olap.query.Quax.CannotHandleException; 32 33 36 public class XMLA_QuaxUti implements QuaxUti { 37 38 static Logger logger = Logger.getLogger(XMLA_QuaxUti.class); 39 40 46 public boolean isMemberInFunCall(Object oExp, Member m) throws Quax.CannotHandleException { 47 FunCall f = (FunCall) oExp; 48 XMLA_Member xm = (XMLA_Member) m; 49 try { 50 if (f.isCallTo("Children")) { 51 return isMemberInChildren(f, xm); 52 } else if (f.isCallTo("Descendants")) { 53 return isMemberInDescendants(f, xm); 54 } else if (f.isCallTo("Members")) { 55 return isMemberInLevel(f, xm); 56 } else if (f.isCallTo("Union")) { 57 return isMemberInUnion(f, xm); 58 } else if (f.isCallTo("{}")) { return isMemberInSet(f, xm); } 59 } catch (OlapException e) { 60 logger.error("?", e); 61 return false; 62 } 63 throw new Quax.CannotHandleException(f.getFunction()); 64 } 65 66 71 private boolean isMemberInChildren(FunCall f, XMLA_Member mSearch) { 72 if (mSearch.isCalculated()) 74 return false; 75 76 XMLA_Member parent = (XMLA_Member) f.getArgs()[0]; 77 if (checkParent(parent, mSearch)) 78 return true; 79 return false; 80 } 81 82 87 private boolean isMemberInDescendants(FunCall f, XMLA_Member mSearch) throws OlapException { 88 if (mSearch.isCalculated()) 90 return false; 91 92 XMLA_Member ancestor = (XMLA_Member) f.getArgs()[0]; 93 XMLA_Level level = (XMLA_Level) f.getArgs()[1]; 94 XMLA_Level mLevel = (XMLA_Level) mSearch.getLevel(); 95 if (!mLevel.equals(level)) 96 return false; 97 if (mSearch.equals(ancestor)) 98 return false; 99 100 int ancestorLevelNumber = ((XMLA_Level) ancestor.getLevel()).getDepth(); 101 XMLA_Member mm = mSearch; 102 while (ancestorLevelNumber < ((XMLA_Level) mm.getLevel()).getDepth()) { 103 mm = (XMLA_Member) mm.getParent(); 104 } 105 106 if (mm.equals(ancestor)) 107 return true; 108 else 109 return false; 110 111 } 112 113 118 private boolean isMemberInLevel(FunCall f, XMLA_Member mSearch) { 119 XMLA_Level level = (XMLA_Level) f.getArgs()[0]; 120 if (level.equals(mSearch.getLevel())) 121 return true; 122 return false; 123 } 124 125 130 private boolean isMemberInSet(FunCall f, XMLA_Member mSearch) { 131 for (int i = 0; i < f.getArgs().length; i++) { 133 XMLA_Member m = (XMLA_Member) f.getArgs()[i]; 134 if (m.equals(mSearch)) 135 return true; 136 } 137 return false; 138 } 139 140 145 private boolean isMemberInUnion(FunCall f, XMLA_Member mSearch) throws CannotHandleException { 146 for (int i = 0; i < 2; i++) { 148 FunCall fChild = (FunCall) f.getArgs()[i]; 149 if (isMemberInFunCall(fChild, mSearch)) 150 return true; 151 } 152 return false; 153 } 154 155 160 178 179 185 public boolean isChildOfMemberInFunCall(Object oFun, Member m) throws CannotHandleException { 186 if (((XMLA_Member) m).isCalculated()) 188 return false; 189 FunCall f = (FunCall) oFun; 190 try { 191 192 if (f.isCallTo("Children")) { 193 return (((XMLA_Member) f.getArgs()[0]).equals(m)); 194 } else if (f.isCallTo("Descendants")) { 195 XMLA_Member ancestor = (XMLA_Member) f.getArgs()[0]; 198 XMLA_Level lev = (XMLA_Level) f.getArgs()[1]; 199 XMLA_Level parentLevel = lev.getParentLevel(); 200 if (parentLevel != null && m.getLevel().equals(parentLevel)) { 201 XMLA_Member mm = (XMLA_Member) m; 202 int ancestorLevelNumber = ((XMLA_Level) ancestor.getLevel()).getDepth(); 203 while (ancestorLevelNumber < ((XMLA_Level) mm.getLevel()).getDepth()) { 204 mm = (XMLA_Member) mm.getParent(); 205 } 206 207 if (mm.equals(ancestor)) 208 return true; 209 else 210 return false; 211 } else 212 return false; 213 } else if (f.isCallTo("Members")) { 214 XMLA_Level lev = (XMLA_Level) f.getArgs()[0]; 215 XMLA_Level parentLevel = lev.getParentLevel(); 216 if (parentLevel != null && m.getLevel().equals(parentLevel)) 217 return true; 218 else 219 return false; 220 } else if (f.isCallTo("Union")) { 221 if (isChildOfMemberInFunCall(f.getArgs()[0], m)) 222 return true; 223 else 224 return isChildOfMemberInFunCall(f.getArgs()[1], m); 225 } else if (f.isCallTo("{}")) { 226 for (int i = 0; i < f.getArgs().length; i++) { 227 XMLA_Member mm = (XMLA_Member) f.getArgs()[i]; 228 XMLA_Member mmp = (XMLA_Member) mm.getParent(); 229 if (mmp != null && mmp.equals(m)) 230 return true; 231 } 232 return false; 233 } 234 } catch (OlapException e) { 235 logger.error("?", e); 237 return false; 238 } 239 throw new Quax.CannotHandleException(f.getFunction()); 240 } 241 242 248 249 public boolean isDescendantOfMemberInFunCall(Object oExp, Member member) 250 throws CannotHandleException { 251 XMLA_Member m = (XMLA_Member) member; 252 if (m.isCalculated()) 254 return false; 255 256 FunCall f = (FunCall) oExp; 257 if (f.isCallTo("Children")) { 258 XMLA_Member mExp = (XMLA_Member) f.getArgs()[0]; 261 return (m.equals(mExp) || XMLA_Util.isDescendant(m, mExp)); 262 } else if (f.isCallTo("Descendants")) { 263 XMLA_Member mExp = (XMLA_Member) f.getArgs()[0]; 266 return (m.equals(mExp) || XMLA_Util.isDescendant(m, mExp)); 267 } else if (f.isCallTo("Members")) { 268 XMLA_Level levExp = (XMLA_Level) f.getArgs()[0]; 269 return (levExp.getDepth() > ((XMLA_Level) m.getLevel()).getDepth()); 270 } else if (f.isCallTo("Union")) { 271 if (isDescendantOfMemberInFunCall(f.getArgs()[0], m)) 272 return true; 273 else 274 return isDescendantOfMemberInFunCall(f.getArgs()[1], m); 275 } else if (f.isCallTo("{}")) { 276 for (int i = 0; i < f.getArgs().length; i++) { 277 XMLA_Member mExp = (XMLA_Member) f.getArgs()[i]; 278 return (!m.equals(mExp) && XMLA_Util.isDescendant(m, mExp)); 279 } 280 return false; 281 } 282 throw new Quax.CannotHandleException(f.getFunction()); 283 } 284 285 291 static FunCall removeChildrenFromUnion(FunCall f, XMLA_Member monMember) { 292 293 FunCall f1 = (FunCall) f.getArgs()[0]; 294 FunCall f2 = (FunCall) f.getArgs()[1]; 295 if (f1.isCallTo("Children") && ((XMLA_Member) f1.getArgs()[0]).equals(monMember)) { return f2; } 296 if (f2.isCallTo("Children") && ((XMLA_Member) f1.getArgs()[0]).equals(monMember)) { return f1; } 297 FunCall f1New = f1; 298 if (f1.isCallTo("Union")) 299 f1New = removeChildrenFromUnion(f1, monMember); 300 FunCall f2New = f2; 301 if (f2.isCallTo("Union")) 302 f2New = removeChildrenFromUnion(f2, monMember); 303 304 if (f1 == f1New && f2 == f2New) 305 return f; 306 307 return new FunCall("Union", new Exp[] { f1New, f2New}); 308 } 309 310 314 public void addMemberUncles(List list, Member m, int[] maxLevel) { 315 XMLA_Member xm = (XMLA_Member) m; 316 317 int parentLevel = ((XMLA_Level) xm.getLevel()).getDepth() - 1; 318 if (parentLevel < maxLevel[0]) 319 return; 320 if (parentLevel > maxLevel[0]) { 321 maxLevel[0] = parentLevel; 322 list.clear(); 323 } 324 AddUncels: if (parentLevel > 0) { 325 XMLA_Member parent; 326 XMLA_Member grandPa; 327 try { 328 parent = (XMLA_Member) xm.getParent(); 329 grandPa = (XMLA_Member) parent.getParent(); 330 } catch (OlapException e) { 331 logger.error("?", e); 333 return; 334 } 335 336 for (Iterator iter = list.iterator(); iter.hasNext();) { 338 Exp exp = (Exp) iter.next(); 339 if (exp instanceof FunCall) { 340 FunCall f = (FunCall) exp; 341 if (f.isCallTo("Children") && ((XMLA_Member) f.getArgs()[0]).equals(grandPa)) { 342 break AddUncels; } 344 } 345 } 346 FunCall fUncles = new FunCall("Children", new Exp[] { grandPa}, FunCall.TypeProperty); 347 356 list.add(fUncles); 357 } } 359 360 364 public void addMemberSiblings(List list, Member m, int[] maxLevel) { 365 XMLA_Member xm = (XMLA_Member) m; 366 int level = ((XMLA_Level) xm.getLevel()).getDepth(); 367 if (level < maxLevel[0]) 368 return; 369 if (level > maxLevel[0]) { 370 maxLevel[0] = level; 371 list.clear(); 372 } 373 AddSiblings: if (level > 0) { 374 XMLA_Member parent; 375 try { 376 parent = (XMLA_Member) xm.getParent(); 377 } catch (OlapException e) { 378 logger.error("?", e); 380 return; 381 } 382 for (Iterator iter = list.iterator(); iter.hasNext();) { 384 Exp exp = (Exp) iter.next(); 385 if (exp instanceof FunCall) { 386 FunCall f = (FunCall) exp; 387 if (f.isCallTo("Children") && ((XMLA_Member) f.getArgs()[0]).equals(parent)) { 388 break AddSiblings; 389 } 390 } 391 } 392 FunCall fSiblings = new FunCall("Children", new Exp[] { parent}, FunCall.TypeProperty); 393 402 list.add(fSiblings); 403 } } 405 406 410 public void addMemberChildren(List list, Member m, int[] maxLevel) { 411 XMLA_Member xm = (XMLA_Member) m; 412 int childLevel = ((XMLA_Level) xm.getLevel()).getDepth() + 1; 413 if (childLevel < maxLevel[0]) 414 return; 415 if (childLevel > maxLevel[0]) { 416 maxLevel[0] = childLevel; 417 list.clear(); 418 } 419 AddChildren: if (childLevel > 0) { 420 for (Iterator iter = list.iterator(); iter.hasNext();) { 422 Exp exp = (Exp) iter.next(); 423 if (exp instanceof FunCall) { 424 FunCall f = (FunCall) exp; 425 if (f.isCallTo("Children") && ((XMLA_Member) f.getArgs()[0]).equals(xm)) { 426 break AddChildren; 427 } 428 } 429 } 430 FunCall fChildren = new FunCall("Children", new Exp[] { xm}, FunCall.TypeProperty); 431 440 list.add(fChildren); 441 } } 443 444 448 public void addMemberDescendants(List list, Member m, Level lev, int[] maxLevel) { 449 XMLA_Member xm = (XMLA_Member) m; 450 int parentLevel = ((XMLA_Level) xm.getLevel()).getDepth() - 1; 451 452 if (parentLevel < maxLevel[0]) 453 return; 454 if (parentLevel > maxLevel[0]) { 455 maxLevel[0] = parentLevel; 456 list.clear(); 457 } 458 AddDescendants: if (parentLevel > 0) { 459 for (Iterator iter = list.iterator(); iter.hasNext();) { 461 Exp exp = (Exp) iter.next(); 462 if (exp instanceof FunCall) { 463 FunCall f = (FunCall) exp; 464 if (f.isCallTo("Descendants") && ((XMLA_Member) f.getArgs()[0]).equals(m)) { 465 break AddDescendants; 466 } 467 } 468 } 469 FunCall fChildren = new FunCall("Descendants", new Exp[] { xm, (XMLA_Level) lev}, 470 FunCall.TypeFunction); 471 480 list.add(fChildren); 481 } } 483 484 488 public void addLevelMembers(List list, Level lev, int[] maxLevel) { 489 490 int level = ((XMLA_Level) lev).getDepth(); 491 if (level < maxLevel[0]) 492 return; 493 if (level > maxLevel[0]) { 494 maxLevel[0] = level; 495 list.clear(); 496 } 497 AddMembers: if (level > 0) { 498 for (Iterator iter = list.iterator(); iter.hasNext();) { 500 Exp exp = (Exp) iter.next(); 501 if (exp instanceof FunCall) { 502 FunCall f = (FunCall) exp; 503 if (f.isCallTo("Members")) { 504 break AddMembers; 505 } 506 } 507 } 508 FunCall fMembers = new FunCall("Members", new Exp[] { (XMLA_Level) lev}, FunCall.TypeProperty); 509 518 list.add(fMembers); 519 } } 521 522 527 public StringBuffer funString(Object oFun) { 528 FunCall f = (FunCall) oFun; 529 StringBuffer buf = new StringBuffer (); 530 if (f.isCallTo("Children")) { 531 XMLA_Member m = (XMLA_Member) f.getArgs()[0]; 532 buf.append(m.getUniqueName()); 533 buf.append(".children"); 534 } else if (f.isCallTo("Descendants")) { 535 XMLA_Member m = (XMLA_Member) f.getArgs()[0]; 536 XMLA_Level lev = (XMLA_Level) f.getArgs()[1]; 537 buf.append("Descendants("); 538 buf.append(m.getUniqueName()); 539 buf.append(","); 540 buf.append(lev.getUniqueName()); 541 buf.append(")"); 542 } else if (f.isCallTo("members")) { 543 XMLA_Level lev = (XMLA_Level) f.getArgs()[0]; 544 buf.append(lev.getUniqueName()); 545 buf.append(".Members"); 546 } else if (f.isCallTo("Union")) { 547 buf.append("Union("); 548 FunCall f1 = (FunCall) f.getArgs()[0]; 549 buf.append(funString(f1)); 550 buf.append(","); 551 FunCall f2 = (FunCall) f.getArgs()[1]; 552 buf.append(funString(f2)); 553 buf.append(")"); 554 } else if (f.isCallTo("{}")) { 555 buf.append("{"); 556 for (int i = 0; i < f.getArgs().length; i++) { 557 if (i > 0) 558 buf.append(","); 559 XMLA_Member m = (XMLA_Member) f.getArgs()[i]; 560 buf.append(m.getUniqueName()); 561 } 562 buf.append("}"); 563 } else if (f.isCallTo("TopCount") || f.isCallTo("BottomCount") || f.isCallTo("TopPercent") 564 || f.isCallTo("BottomPercent")) { 565 buf.append(f.getFunction()); 567 buf.append("("); 568 FunCall f1 = (FunCall) f.getArgs()[0]; 569 buf.append(funString(f1)); 570 buf.append(")"); 571 } 572 return buf; 573 } 574 575 580 public Hierarchy hierForExp(Object oExp) throws CannotHandleException { 581 if (oExp instanceof XMLA_Member) 582 return ((XMLA_Member) oExp).getHierarchy(); 583 else if (oExp instanceof SetExp) { 584 SetExp set = (SetExp) oExp; 586 return set.getHier(); 587 } 588 589 FunCall f = (FunCall) oExp; 591 if (f.isCallTo("Children")) { 592 XMLA_Member m = (XMLA_Member) f.getArgs()[0]; 593 return m.getHierarchy(); 594 } else if (f.isCallTo("Descendants")) { 595 XMLA_Member m = (XMLA_Member) f.getArgs()[0]; 596 return m.getHierarchy(); 597 } else if (f.isCallTo("Members")) { 598 XMLA_Level lev = (XMLA_Level) f.getArgs()[0]; 599 return lev.getHierarchy(); 600 } else if (f.isCallTo("Union")) { 601 return hierForExp(f.getArgs()[0]); 603 } else if (f.isCallTo("{}")) { 604 XMLA_Member m = (XMLA_Member) f.getArgs()[0]; 605 return m.getHierarchy(); 606 } else if (f.isCallTo("TopCount") || f.isCallTo("BottomCount") || f.isCallTo("TopPercent") 607 || f.isCallTo("BottomPercent") || f.isCallTo("Filter")) { 608 return hierForExp(f.getArgs()[0]); 610 } 611 throw new Quax.CannotHandleException(f.getFunction()); 612 } 613 614 619 public boolean isMember(Object oExp) { 620 return (oExp instanceof XMLA_Member); 621 } 622 623 626 public boolean isFunCall(Object oExp) { 627 return (oExp instanceof FunCall); 628 } 629 630 635 public boolean equalMember(Object oExp, Member member) { 636 return ((XMLA_Member) member).equals(oExp); 637 } 638 639 642 public Member getParentMember(Object oExp) { 643 try { 644 return ((XMLA_Member) oExp).getParent(); 645 } catch (OlapException e) { 646 logger.error("?", e); 648 return null; 649 } 650 } 651 652 656 public Object funCallChildren(Member member) { 657 return new FunCall("Children", new Exp[] { (XMLA_Member) member}, FunCall.TypeProperty); 658 } 659 660 664 public Hierarchy hierForMember(Member member) { 665 XMLA_Member xm = (XMLA_Member) member; 666 return xm.getHierarchy(); 667 } 668 669 673 public Dimension dimForMember(Member member) { 674 XMLA_Member xm = (XMLA_Member) member; 675 return xm.getHierarchy().getDimension(); 676 } 677 678 682 public String getMemberUniqueName(Object oExp) { 683 XMLA_Member m = (XMLA_Member) oExp; 684 return m.getUniqueName(); 685 } 686 687 691 public boolean isFunCallTo(Object oExp, String function) { 692 return ((FunCall) oExp).isCallTo(function); 693 } 694 695 699 public Object funCallArg(Object oExp, int index) { 700 return ((FunCall) oExp).getArgs()[index]; 701 } 702 703 707 public String funCallName(Object oFun) { 708 return ((FunCall) oFun).getFunction(); 709 } 710 711 715 public boolean checkParent(Member pMember, Object cMemObj) { 716 XMLA_Member pm = (XMLA_Member) pMember; 718 XMLA_Member cm = (XMLA_Member) cMemObj; 719 if (pm.isMicrosoft()) { 720 String pUName = cm.getParentUniqueName(); 721 return ((XMLA_Member) pMember).getUniqueName().equals(pUName); 722 } else { 723 try { 725 return (pm.equals(cm.getParent())); 726 } catch (OlapException e) { 727 return false; } 729 } 730 } 731 732 736 public boolean checkChild(Member cMember, Object pMemObj) { 737 return checkParent((XMLA_Member) pMemObj, cMember); 738 } 739 740 744 public boolean checkDescendantM(Member aMember, Member dMember) { 745 return XMLA_Util.isDescendant((XMLA_Member) aMember, (XMLA_Member) dMember); 746 } 747 748 752 public boolean checkDescendantO(Member aMember, Object oMember) { 753 return XMLA_Util.isDescendant((XMLA_Member) aMember, (XMLA_Member) oMember); 754 } 755 756 760 public Object objForMember(Member member) { 761 return member; 762 } 763 764 768 public Object objForDim(Dimension dim) { 769 return dim; } 771 772 776 public Member memberForObj(Object oExp) { 777 return (Member) oExp; 778 } 779 780 785 public String memberString(Member[] mPath) { 786 if (mPath == null || mPath.length == 0) 787 return ""; 788 StringBuffer sb = new StringBuffer (); 789 for (int i = 0; i < mPath.length; i++) { 790 if (i > 0) 791 sb.append(" "); 792 sb.append(((XMLA_Member) mPath[i]).getUniqueName()); 793 } 794 return sb.toString(); 795 } 796 797 798 804 public Object createMemberSet(List mList) { 805 if (mList.size() == 0) 806 return null; 807 else if (mList.size() == 1) 808 return (Exp) mList.get(0); 809 else { 810 Exp[] remExps = (Exp[]) mList.toArray(new Exp[0]); 811 return new FunCall("{}", remExps, FunCall.TypeBraces); 812 } 813 } 814 815 820 public boolean isFunCallNotTopLevel(Object oExp) throws CannotHandleException { 821 FunCall f = (FunCall) oExp; 822 if (f.isCallTo("Children")) { 823 return true; } else if (f.isCallTo("Descendants")) { 825 return true; } else if (f.isCallTo("Members")) { 827 XMLA_Level lev = (XMLA_Level) f.getArgs()[0]; 828 return (lev.getDepth() > 0); 829 } else if (f.isCallTo("Union")) { 830 if (isFunCallNotTopLevel(f.getArgs()[0])) 831 return true; 832 return isFunCallNotTopLevel(f.getArgs()[1]); 833 } else if (f.isCallTo("{}")) { 834 for (int i = 0; i < f.getArgs().length; i++) { 835 if (!isMemberOnToplevel(f.getArgs()[i])) 836 return true; 837 } 838 return false; 839 } 840 throw new Quax.CannotHandleException(f.getFunction()); 841 } 842 843 847 public boolean isMemberOnToplevel(Object oMem) { 848 XMLA_Member m = (XMLA_Member) oMem; 849 if (((XMLA_Level) m.getLevel()).getDepth() > 0) 850 return false; 851 else 852 return true; 853 } 854 855 859 public int levelDepthForMember(Object oExp) { 860 XMLA_Member m = (XMLA_Member) oExp; 861 XMLA_Level level = (XMLA_Level) m.getLevel(); 862 return level.getDepth(); 863 } 864 865 869 public Object topLevelMembers(Hierarchy hier, boolean expandAllMember) { 870 return XMLA_Util.topLevelMembers(hier, expandAllMember); 871 } 872 873 877 public int funCallArgCount(Object oFun) { 878 FunCall f = (FunCall) oFun; 879 return f.getArgs().length; 880 } 881 882 887 public Level LevelForObj(Object oLevel) { 888 return (Level) oLevel; 889 } 890 891 895 public Level getParentLevel(Level level) { 896 return ((XMLA_Level) level).getParentLevel(); 897 } 898 899 public mondrian.olap.Exp toExp(Object o) { 900 return (mondrian.olap.Exp) o; 901 } 902 903 907 public Object createFunCall(String function, Object [] args, int funType) { 908 Exp[] expArgs = new Exp[args.length]; 909 for (int i = 0; i < expArgs.length; i++) { 910 expArgs[i] = (Exp) args[i]; 911 } 912 int type; 913 switch (funType) { 914 case QuaxUti.FUNTYPE_BRACES: 915 type = FunCall.TypeBraces; 916 break; 917 case QuaxUti.FUNTYPE_PROPERTY: 918 type = FunCall.TypeProperty; 919 break; 920 case QuaxUti.FUNTYPE_TUPLE: 921 type = FunCall.TypeParentheses; 922 break; 923 case QuaxUti.FUNTYPE_INFIX: 924 type = FunCall.TypeInfix; 925 break; 926 default: 927 type = FunCall.TypeFunction; 928 } 929 return new FunCall(function, expArgs, type); 930 } 931 932 938 public boolean canHandle(Object oExp) { 939 940 if (oExp instanceof Member) 941 return true; 942 FunCall f = (FunCall) oExp; 943 if (f.isCallTo("children")) 944 return true; 945 if (f.isCallTo("descendants")) 946 return true; 947 if (f.isCallTo("members")) 948 return true; 949 if (f.isCallTo("{}")) 950 return true; 951 if (f.isCallTo("union")) { 952 for (int i = 0; i < f.getArgs().length; i++) { 953 if (!canHandle(f.getArgs()[i])) 954 return false; 955 } 956 return true; 957 } 958 959 return false; 960 } 961 962 963 967 public Object [] getChildren(Object oMember) { 968 XMLA_Member[] mChildren; 969 try { 970 mChildren = ((XMLA_Member) oMember).getChildren(); 971 } catch (OlapException e) { 972 logger.fatal("unexpected exception", e); 974 return null; 975 } 976 return mChildren; 977 } 978 979 982 public Object [] getLevelMembers(Level level) { 983 XMLA_Member[] members; 984 try { 985 members = ((XMLA_Level)level).getMembers(); 986 } catch (OlapException e) { 987 logger.fatal("unexpected failure level members", e); 988 return null; 989 } 990 return members; 991 } 992 993 } | Popular Tags |