use of org.pentaho.platform.api.engine.IParameterProvider in project pentaho-platform by pentaho.
the class ActionSequenceParameterUiContentGenerator method getPathParameters.
@SuppressWarnings("unchecked")
public IParameterProvider getPathParameters() {
// $NON-NLS-1$
IParameterProvider pathParams = this.parameterProviders.get("path");
SimpleParameterSetter parameters = new SimpleParameterSetter();
Iterator pathParamIterator = pathParams.getParameterNames();
while (pathParamIterator.hasNext()) {
String param = (String) pathParamIterator.next();
parameters.setParameter(param, pathParams.getParameter(param));
}
this.pathParameters = parameters;
return parameters;
}
use of org.pentaho.platform.api.engine.IParameterProvider in project pdi-platform-plugin by pentaho.
the class ParameterContentGenerator method createContent.
@Override
public void createContent(OutputStream out) throws Exception {
IParameterProvider pathParams = parameterProviders.get(PATH);
IParameterProvider requestParams = parameterProviders.get(IParameterProvider.SCOPE_REQUEST);
RepositoryFile file = null;
if (pathParams != null) {
file = (RepositoryFile) pathParams.getParameter(FILE);
} else {
IUnifiedRepository repo = PentahoSystem.get(IUnifiedRepository.class, null);
String path = URLDecoder.decode(requestParams.getStringParameter(PATH, StringUtils.EMPTY), LocaleHelper.UTF_8);
file = repo.getFile(idTopath(path));
}
IPdiContentProvider provider = (IPdiContentProvider) PentahoSystem.get(IPluginManager.class).getBean(IPdiContentProvider.class.getSimpleName());
String[] userParams = provider.getUserParameters(file.getPath());
ParametersBean paramBean = new ParametersBean(userParams, requestParameterToStringMap(requestParams));
String response = paramBean.getParametersXmlString();
out.write(response.getBytes(LocaleHelper.getSystemEncoding()));
out.flush();
}
Aggregations