Search in sources :

Example 1 with WizardExecutionController

use of org.knime.core.node.workflow.WizardExecutionController in project knime-core by knime.

the class WizardPageManager method createCurrentWizardPage.

/**
 * Creates a wizard page for the current subnode in wizard execution
 * @return a {@link JSONWebNodePage} object which can be used for serialization
 * @throws IOException if the layout of the wizard page can not be generated
 */
public JSONWebNodePage createCurrentWizardPage() throws IOException {
    WizardExecutionController wec = getWizardExecutionController();
    WizardPageContent page = wec.getCurrentWizardPage();
    return createWizardPageInternal(page);
}
Also used : WizardExecutionController(org.knime.core.node.workflow.WizardExecutionController) WizardPageContent(org.knime.core.node.workflow.WebResourceController.WizardPageContent)

Example 2 with WizardExecutionController

use of org.knime.core.node.workflow.WizardExecutionController in project knime-core by knime.

the class WizardPageManager method applyViewValuesToCurrentPage.

/**
 * Applies a given map of view values to the current subnode in wizard execution.
 *
 * @param valueMap a map with {@link NodeIDSuffix} string as key and parsed view value as value
 * @return A JSON-serialized string containing the validation result, null if validation succeeded.
 * @throws IOException on JSON serialization errors
 */
public String applyViewValuesToCurrentPage(final Map<String, String> valueMap) throws IOException {
    try (WorkflowLock lock = getWorkflowManager().lock()) {
        Map<String, String> viewContentMap = validateValueMap(valueMap);
        Map<String, ValidationError> validationResults = null;
        if (!valueMap.isEmpty()) {
            WizardExecutionController wec = getWizardExecutionController();
            validationResults = wec.loadValuesIntoCurrentPage(viewContentMap);
        }
        return serializeValidationResult(validationResults);
    }
}
Also used : WorkflowLock(org.knime.core.node.workflow.WorkflowLock) WizardExecutionController(org.knime.core.node.workflow.WizardExecutionController) ValidationError(org.knime.core.node.web.ValidationError)

Aggregations

WizardExecutionController (org.knime.core.node.workflow.WizardExecutionController)2 ValidationError (org.knime.core.node.web.ValidationError)1 WizardPageContent (org.knime.core.node.workflow.WebResourceController.WizardPageContent)1 WorkflowLock (org.knime.core.node.workflow.WorkflowLock)1