org.pentaho.platform.uifoundation.component
Class BaseUIComponent

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.PentahoBase
      extended by org.pentaho.platform.engine.services.PentahoMessenger
          extended by org.pentaho.platform.uifoundation.component.BaseUIComponent
All Implemented Interfaces:
Serializable, ILogger, IUIComponent
Direct Known Subclasses:
ActionComponent, HtmlComponent, XmlComponent

public abstract class BaseUIComponent
extends PentahoMessenger
implements IUIComponent

Author:
James Dixon TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
See Also:
Serialized Form

Field Summary
static boolean debug
           
 
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Constructor Summary
BaseUIComponent(IPentahoUrlFactory urlFactory, List messages, String sourcePath)
           
 
Method Summary
 void done()
           
abstract  String getContent(String mimeType)
           
abstract  org.apache.commons.logging.Log getLogger()
           
 Object getObjectParameter(String name, Object defaultValue)
           
 String getParameter(String name, String defaultValue)
           
 String[] getParameterAsArray(String name)
           
 HashMap getParameterProviders()
           
 String getXsl(String mimeType)
           
 HashMap getXslProperties()
           
 void handleRequest(OutputStream outputStream, IActionRequestHandler actionRequestHandler, String contentType, HashMap requestParameterProviders)
           
 void setParameterProvider(String name, IParameterProvider parameterProvider)
           
 void setParameterProviders(HashMap parameterProviders)
           
 void setRequestHandler(IActionRequestHandler actionRequestHandler)
           
 void setUrlFactory(IPentahoUrlFactory urlFactory)
           
 void setXsl(String mimeType, String xslName)
           
 void setXslProperty(String name, String value)
           
abstract  boolean validate()
           
 boolean validate(IPentahoSession session, IActionRequestHandler actionRequestHandler)
          Set the userSession member, generate a Log Id, set the requestHandler, and validate the component's configuration.
 
Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger
debug, debug, error, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
 
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, setLoggingLevel, setLogId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
See Also:
Constant Field Values
Constructor Detail

BaseUIComponent

public BaseUIComponent(IPentahoUrlFactory urlFactory,
                       List messages,
                       String sourcePath)
Method Detail

getLogger

public abstract org.apache.commons.logging.Log getLogger()
Specified by:
getLogger in class PentahoBase

handleRequest

public void handleRequest(OutputStream outputStream,
                          IActionRequestHandler actionRequestHandler,
                          String contentType,
                          HashMap requestParameterProviders)
                   throws IOException
Specified by:
handleRequest in interface IUIComponent
Throws:
IOException

setUrlFactory

public void setUrlFactory(IPentahoUrlFactory urlFactory)

setRequestHandler

public void setRequestHandler(IActionRequestHandler actionRequestHandler)

setParameterProvider

public void setParameterProvider(String name,
                                 IParameterProvider parameterProvider)

setParameterProviders

public void setParameterProviders(HashMap parameterProviders)

getParameterProviders

public HashMap getParameterProviders()

getParameter

public String getParameter(String name,
                           String defaultValue)

getObjectParameter

public Object getObjectParameter(String name,
                                 Object defaultValue)

getParameterAsArray

public String[] getParameterAsArray(String name)

setXsl

public void setXsl(String mimeType,
                   String xslName)

getXsl

public String getXsl(String mimeType)

validate

public abstract boolean validate()
Specified by:
validate in interface IUIComponent

validate

public boolean validate(IPentahoSession session,
                        IActionRequestHandler actionRequestHandler)
Set the userSession member, generate a Log Id, set the requestHandler, and validate the component's configuration. NOTE: this method has several side effects not related to validation. could probably use some refactoring

Specified by:
validate in interface IUIComponent
Parameters:
session -
actionRequestHandler -
Returns:
boolean true if component configuration is valid, else false

setXslProperty

public void setXslProperty(String name,
                           String value)

getXslProperties

public HashMap getXslProperties()

getContent

public abstract String getContent(String mimeType)

done

public void done()