KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > xmla > XMLA_DrillThrough


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.xmla;
14
15 /**
16  * @author stflourd
17  */

18
19 import com.tonbeller.jpivot.core.ExtensionSupport;
20 import com.tonbeller.jpivot.olap.model.Cell;
21 import com.tonbeller.jpivot.olap.navi.DrillThrough;
22 import com.tonbeller.wcf.table.TableModel;
23
24 public class XMLA_DrillThrough extends ExtensionSupport implements DrillThrough {
25
26   private boolean extendedContext = true;
27
28   /**
29    * Constructor sets ID
30    */

31   public XMLA_DrillThrough() {
32     super.setId(DrillThrough.ID);
33   }
34
35   /**
36    * drill through is possible if <code>member</code> is not calculated
37    */

38
39   public boolean canDrillThrough(Cell cell) {
40     //todo need to check if the cell is a calculated field before. If calculated then
41
// do't allow drillthrough
42
return true;
43   }
44
45   /**
46    * does a drill through, retrieves data that makes up the selected Cell
47    */

48   public TableModel drillThrough(Cell cell) {
49       XMLA_DrillThroughTableModel dtm = new XMLA_DrillThroughTableModel();
50       XMLA_Model xmodel = ((XMLA_Cell)cell).getModel();
51       dtm.setCellOrdinal(((XMLA_Cell) cell).getOrdinal());
52       dtm.setModel(xmodel);
53       return dtm;
54   }
55  
56   /**
57    * gets the mondrian connection
58    * @return
59    */

60
61   public boolean isExtendedContext() {
62     return extendedContext;
63   }
64
65   public void setExtendedContext(boolean extendedContext) {
66     this.extendedContext = extendedContext;
67   }
68
69 }
70
71
Popular Tags