001: /*
002: * Copyright 2006 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
007: * BI Platform. The Initial Developer is Pentaho Corporation.
008: *
009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
011: * the license for the specific language governing your rights and limitations.
012: *
013: * @created Jun 17, 2005
014: * @author James Dixon
015: *
016: */
017:
018: package org.pentaho.core.solution;
019:
020: import java.util.Map;
021: import java.util.List;
022:
023: import org.pentaho.core.runtime.IRuntimeContext;
024: import org.pentaho.core.session.IPentahoSession;
025: import org.pentaho.core.ui.IPentahoUrlFactory;
026: import org.pentaho.util.logging.*;
027:
028: /**
029: * The Solution Engine handles loading and launching execution of solutions and
030: * action sequences. There is one solution engine per request, which can launch
031: * one or more action sequences.
032: */
033: public interface ISolutionEngine extends ILogger {
034:
035: public static final String RUNTIME_SOLUTION_NAME = "RuntimeSolution"; //$NON-NLS-1$
036:
037: /**
038: * Sets the source for input parameters.
039: *
040: * @param name
041: * name to give to this provider
042: * @param parameterProvider
043: * instance of a provider
044: * @see org.pentaho.core.solution.IParameterProvider
045: */
046: public void setParameterProvider(String name,
047: IParameterProvider parameterProvider);
048:
049: /**
050: * Executes the action sequence specified in the manner described in the
051: * parameters
052: *
053: * @param solutionName
054: * the name at the root level of the solution path
055: * @param actionPath
056: * the path relative to the solutionName that will lead to the
057: * requested action
058: * @param actionName
059: * name of the action sequence document
060: * @param processId
061: * id for the given action sequence document
062: * @param async
063: * synchronous(false) or asynchronous(true) execution (not
064: * currently used)
065: * @param instanceId
066: * id to be handed to the runtime repository
067: * @param persisted
068: * if true, store runtime data, otherwise do not
069: * @param parameterProviderMap
070: * group of ParameterProviders, sources for inout parameters
071: * @param outputHandler
072: * handler used to query for addition parameters
073: * @param listener
074: * object notified on completion of action sequences
075: * @param urlFactory
076: * factory for building urls
077: * @param messages
078: * list into which debug, info, warning, and errors messages will
079: * be added
080: * @return IRuntimeContext the RuntimeContext associated with this action
081: * sequence execution
082: *
083: * @see org.pentaho.core.runtime.IRuntimeContext
084: */
085: public IRuntimeContext execute(String solutionName,
086: String actionPath, String actionName, String processId,
087: boolean async, boolean instanceEnds, String instanceId,
088: boolean persisted, Map parameterProviderMap,
089: IOutputHandler outputHandler,
090: IActionCompleteListener listener,
091: IPentahoUrlFactory urlFactory, List messages);
092:
093: /**
094: * Executes the action sequence specified
095: * @param runtime The runtime context for the execution
096: * @param solutionName Name of the solution
097: * @param sequencePath path to the solution
098: * @param sequenceName name of the action sequence
099: * @param processId id for the given process, typically a GUID or unique id for this execution
100: * @param async true if the execution should be asynchronous.
101: * @param instanceEnds currently true indicating that the process ends with this execution
102: * @param parameterProviderMap Map of parameter providers to use for the execution
103: * @param outputHandler The output handler for dealing with user feedback
104: * @return The runtime context for the execution
105: * @see IRuntimeContext
106: * @see IParameterProvider
107: * @see IActionSequence
108: */
109: public IRuntimeContext execute(IRuntimeContext runtime,
110: String solutionName, String sequencePath,
111: String sequenceName, String processId, boolean async,
112: boolean instanceEnds, Map parameterProviderMap,
113: IOutputHandler outputHandler);
114:
115: /**
116: * Executes the in memory action sequence specified
117: * @param actionSequenceXML the in memory action sequence string
118: * @param sequenceName name of the action sequence
119: * @param processId id for the given process, typically a GUID or unique id for this execution
120: * @param async true if the execution should be asynchronous.
121: * @param instanceEnds currently true indicating that the process ends with this execution
122: * @param parameterProviderMap Map of parameter providers to use for the execution
123: * @param outputHandler The output handler for dealing with user feedback
124: * @return The runtime context for the execution
125: * @see IRuntimeContext
126: * @see IParameterProvider
127: * @see IActionSequence
128: */
129: public IRuntimeContext execute(String actionSequenceXML,
130: String sequenceName, String processId, boolean async,
131: boolean instanceEnds, String instanceId, boolean persisted,
132: Map parameterProviderMap, IOutputHandler outputHandler,
133: IActionCompleteListener pListener,
134: IPentahoUrlFactory urlFactory, List messages);
135:
136: /**
137: * Sets the action complete listener which will be called when the action is complete
138: * @param listener Listener to call back when execution is complete.
139: */
140: public void setlistener(IActionCompleteListener listener);
141:
142: /**
143: * Sets the session in the solution engine
144: * @param session The session for this execution
145: */
146: public void setSession(IPentahoSession session);
147:
148: /**
149: * @return the runtime context being used for this execution.
150: */
151: public IRuntimeContext getExecutionContext();
152:
153: /**
154: * @return Gets the current status from this execution
155: */
156: public int getStatus();
157:
158: /**
159: * Initialize the SolutionEngine. This method should be called immediately
160: * after object construction, and if solution engines are re-used among different
161: * IPentahoSessions to bind the solution engine to the session.
162: *
163: * @param session
164: * the session context for this SolutionEngine
165: */
166: public void init(IPentahoSession session);
167:
168: /**
169: * Sets if the promp page should be forced
170: * @param status
171: */
172: public void setForcePrompt(boolean forcePrompt);
173:
174: /**
175: * Sets the xsl file to be used to generate the parameter page for the
176: * current component. The parameter should be a full path from the solution
177: * root starting with a /, or it should be a path relative to the directory
178: * of the current action sequence.
179: *
180: * @param xsl
181: * The name of the XSL file
182: */
183: public void setParameterXsl(String xsl);
184:
185: }
|