Search in sources :

Example 1 with RunParagraphWithParametersRequest

use of org.apache.zeppelin.rest.message.RunParagraphWithParametersRequest in project zeppelin by apache.

the class NotebookRestApi method handleParagraphParams.

private void handleParagraphParams(String message, Note note, Paragraph paragraph) throws IOException {
    // handle params if presented
    if (!StringUtils.isEmpty(message)) {
        RunParagraphWithParametersRequest request = gson.fromJson(message, RunParagraphWithParametersRequest.class);
        Map<String, Object> paramsForUpdating = request.getParams();
        if (paramsForUpdating != null) {
            paragraph.settings.getParams().putAll(paramsForUpdating);
            AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal());
            note.persist(subject);
        }
    }
}
Also used : RunParagraphWithParametersRequest(org.apache.zeppelin.rest.message.RunParagraphWithParametersRequest) AuthenticationInfo(org.apache.zeppelin.user.AuthenticationInfo)

Aggregations

RunParagraphWithParametersRequest (org.apache.zeppelin.rest.message.RunParagraphWithParametersRequest)1 AuthenticationInfo (org.apache.zeppelin.user.AuthenticationInfo)1