1 17 18 package org.pentaho.core.solution; 19 20 import org.pentaho.core.session.IPentahoSession; 21 22 public class HttpSessionParameterProvider extends SimpleParameterProvider { 23 24 private IPentahoSession session; 25 26 public HttpSessionParameterProvider(IPentahoSession session) { 27 this.session = session; 28 } 29 30 public Object getParameter(String name) { 31 if ("name".equals(name)) { return session.getName(); 33 } 34 return session.getAttribute(name); 35 } 36 37 public String getStringParameter(String name, String defaultValue) { 38 Object value = getParameter(name); 39 if (value != null) { 40 return value.toString(); 41 } 42 return defaultValue; 43 } 44 45 } 46 | Popular Tags |