Exemplo n.º 1
0
  @SuppressWarnings("rawtypes")
  protected static IRuntimeContext executeInternal(
      RepositoryFile file,
      IParameterProvider requestParams,
      HttpServletRequest httpServletRequest,
      IOutputHandler outputHandler,
      Map<String, IParameterProvider> parameterProviders,
      IPentahoSession userSession,
      boolean forcePrompt,
      List messages)
      throws Exception {
    String processId = XactionUtil.class.getName();
    String instanceId = httpServletRequest.getParameter("instance-id"); // $NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory(""); // $NON-NLS-1$
    ISolutionEngine solutionEngine = PentahoSystem.get(ISolutionEngine.class, userSession);
    ISystemSettings systemSettings = PentahoSystem.getSystemSettings();

    if (solutionEngine == null) {
      throw new ObjectFactoryException("No Solution Engine");
    }

    boolean instanceEnds =
        "true"
            .equalsIgnoreCase(
                requestParams.getStringParameter(
                    "instanceends", "true")); // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    String parameterXsl =
        systemSettings.getSystemSetting(
            "default-parameter-xsl", "DefaultParameterForm.xsl"); // $NON-NLS-1$ //$NON-NLS-2$

    solutionEngine.setLoggingLevel(2);
    solutionEngine.init(userSession);
    solutionEngine.setForcePrompt(forcePrompt);
    if (parameterXsl != null) {
      solutionEngine.setParameterXsl(parameterXsl);
    }
    return solutionEngine.execute(
        file.getPath(),
        processId,
        false,
        instanceEnds,
        instanceId,
        false,
        parameterProviders,
        outputHandler,
        null,
        urlFactory,
        messages);
  }
  @Override
  public Properties getProperties() throws IOException {
    Properties props = new Properties();
    List elements = settings.getSystemSettings("pentaho-system");
    if (elements == null) {
      return null;
    }
    elements = ((Element) elements.get(0)).content();
    addElementsToProperties(elements, props, "");

    return props;
  }