use of org.pentaho.platform.engine.core.solution.SimpleParameterProvider in project pentaho-platform by pentaho.
the class GeneratorStreamingOutput method createPathParamProvider.
protected IParameterProvider createPathParamProvider() throws IOException {
SimpleParameterProvider pathParams = null;
pathParams = new SimpleParameterProvider();
// $NON-NLS-1$
pathParams.setParameter("query", httpServletRequest.getQueryString());
List<String> mediaTypes = new ArrayList<String>(acceptableMediaTypes.size());
for (MediaType type : acceptableMediaTypes) {
mediaTypes.add(type.toString());
}
// $NON-NLS-1$
pathParams.setParameter("acceptableMediaTypes", mediaTypes);
if (mediaTypes.size() > 0) {
// $NON-NLS-1$
pathParams.setParameter("contentType", acceptableMediaTypes.get(0));
}
// $NON-NLS-1$
pathParams.setParameter("inputstream", httpServletRequest.getInputStream());
// $NON-NLS-1$
pathParams.setParameter("httpresponse", httpServletResponse);
// $NON-NLS-1$
pathParams.setParameter("httprequest", httpServletRequest);
// $NON-NLS-1$
pathParams.setParameter("remoteaddr", httpServletRequest.getRemoteAddr());
if (file != null) {
// $NON-NLS-1$
pathParams.setParameter("path", URLEncoder.encode(file.getPath(), "UTF-8"));
// $NON-NLS-1$
pathParams.setParameter("file", file);
}
if (command != null) {
// path beyond that which matched the GeneratorResource
// $NON-NLS-1$
pathParams.setParameter("cmd", command);
}
return pathParams;
}
use of org.pentaho.platform.engine.core.solution.SimpleParameterProvider in project pentaho-platform by pentaho.
the class ActionSequenceContentGenerator method getRequestParameters.
@SuppressWarnings("unchecked")
private IParameterProvider getRequestParameters() {
if (this.requestParameters != null) {
return this.requestParameters;
}
if (this.parameterProviders == null) {
return new SimpleParameterProvider();
}
// $NON-NLS-1$
IParameterProvider requestParams = this.parameterProviders.get("request");
SimpleParameterSetter parameters = new SimpleParameterSetter();
Iterator requestParamIterator = requestParams.getParameterNames();
while (requestParamIterator.hasNext()) {
String param = (String) requestParamIterator.next();
parameters.setParameter(param, requestParams.getParameter(param));
}
this.requestParameters = parameters;
return parameters;
}
Aggregations