KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > test > olap > TestSqlAccess


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.test.olap;
14
15 import javax.sql.DataSource JavaDoc;
16
17 import com.tonbeller.jpivot.core.ExtensionSupport;
18 import com.tonbeller.jpivot.olap.model.Member;
19 import com.tonbeller.jpivot.olap.model.Property;
20 import com.tonbeller.jpivot.param.SqlAccess;
21 import com.tonbeller.wcf.param.SessionParam;
22
23 /**
24  * @author av
25  */

26 public class TestSqlAccess extends ExtensionSupport implements SqlAccess {
27
28   public DataSource JavaDoc getDataSource() {
29     return null;
30   }
31
32   public SessionParam createParameter(Member m, String JavaDoc paramName) {
33     SessionParam p = new SessionParam();
34     p.setDisplayName(m.getLevel().getLabel());
35     p.setDisplayValue(m.getLabel());
36     p.setMdxValue(m.getLabel());
37     p.setName(paramName);
38     p.setSqlValue(m.getLabel());
39     return p;
40   }
41
42   public SessionParam createParameter(Member m, String JavaDoc paramName, String JavaDoc propertyName) {
43     SessionParam p = new SessionParam();
44     p.setDisplayName(m.getLevel().getLabel());
45     p.setDisplayValue(m.getLabel());
46     p.setMdxValue(m.getLabel());
47     p.setName(paramName);
48     Property prop = m.getProperty(propertyName);
49     p.setSqlValue(prop.getValue());
50     return p;
51   }
52
53 }
54
Popular Tags