KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > mondrian > MondrianMdxQuery


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.mondrian;
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  * Created on 19.12.2002
22  *
23  * @author av
24  */

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

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

42   public void setMdxQuery(String JavaDoc mdxQuery) {
43     try {
44       MondrianModel m = (MondrianModel) getModel();
45       if (m.setUserMdx(mdxQuery))
46         m.fireModelChanged(); // only if changed
47
} catch (OlapException e) {
48       throw new FormatException(e.getMessage());
49     }
50   }
51
52 } // End MondrianMdxQuery
53
Popular Tags