KickJava   Java API By Example, From Geeks To Geeks.

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


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 import com.tonbeller.jpivot.core.ExtensionSupport;
16 import com.tonbeller.jpivot.olap.model.OlapException;
17 import com.tonbeller.jpivot.olap.navi.MdxQuery;
18 import com.tonbeller.wcf.format.FormatException;
19
20 /**
21  * set user defined MDX Query String
22  */

23 public class XMLA_MdxQuery extends ExtensionSupport implements MdxQuery {
24
25   public XMLA_MdxQuery() {
26     super.setId(MdxQuery.ID);
27   }
28
29   /**
30    * @see com.tonbeller.jpivot.olap.navi.MdxQuery#getMdxQuery()
31    */

32   public String JavaDoc getMdxQuery() {
33     XMLA_Model m = (XMLA_Model) getModel();
34     return m.getCurrentMdx();
35   }
36
37   /**
38    * @see com.tonbeller.jpivot.olap.navi.MdxQuery#setMdxQuery(String)
39    */

40   public void setMdxQuery(String JavaDoc mdxQuery) {
41     try {
42       XMLA_Model m = (XMLA_Model) getModel();
43       if (mdxQuery.equals(m.getCurrentMdx()))
44         return;
45       m.setUserMdx(mdxQuery);
46       m.fireModelChanged();
47     } catch (OlapException e) {
48       throw new FormatException(e.getMessage());
49     }
50   }
51
52  
53 } // End XMLA_MdxQuery
54
Popular Tags