mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
### What is this PR for?
Currently, zeppelin only support 3 kinds of dynamic form controls: TextBox, Select, CheckBox. All the things are in `Input.java`, this is hard to add new controls, this PR is for refactoring Input to make dynamic forms extensible. Main Changes:
* Make `Input` as the base class of dynamic forms also use it as the factory class
* All the concret dynamic forms extend `Input`
* Add method `toJson` and `fromJson` for `GUI` for `GUI`'s serialization/deserialization. I plan to do it for other classes as well, so that we can remove duplicated serde code and also make it easy to test serialization/deserialization
* Change `z.input` to `z.textbox` as I think z.input is a little misleading. But I still keep `z.input` and make `z.input` as deprecated.
* Ideally the new input forms' json should be the same as the old input form json. But there's one bug in the old input form, `type` is missing if the input forms are created in frontend for textbox and select. So I keep the old input forms for compatibility. I will load the old input forms json and convert it into new input forms, and after saving, `note.json` would have the new input forms json.
After this PR, user needs to do 3 things to add new ui controls
* Implement its UI control classes, (refer TextBox/CheckBox/Select), and specify it in `TypeAdapterFactory` of `Input` for serde.
* Add parsing logic in `Input.getInputForm` if you want to support this control in frontend.
* Add display logic in `paragraph-parameterizedQueryForm.html`
### What type of PR is it?
[ Improvement | Refactoring]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2395
### How should this be tested?
Test is added
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? Yes
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Jeff Zhang <zjffdu@apache.org>
Closes #2245 from zjffdu/ZEPPELIN-2395 and squashes the following commits:
16d42a8 [Jeff Zhang] ZEPPELIN-2395. Refactor Input.java to make dynamic forms extensible
234 lines
7 KiB
XML
234 lines
7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
~ Licensed to the Apache Software Foundation (ASF) under one or more
|
|
~ contributor license agreements. See the NOTICE file distributed with
|
|
~ this work for additional information regarding copyright ownership.
|
|
~ The ASF licenses this file to You under the Apache License, Version 2.0
|
|
~ (the "License"); you may not use this file except in compliance with
|
|
~ the License. You may obtain a copy of the License at
|
|
~
|
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
|
~
|
|
~ Unless required by applicable law or agreed to in writing, software
|
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
~ See the License for the specific language governing permissions and
|
|
~ limitations under the License.
|
|
-->
|
|
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<artifactId>zeppelin</artifactId>
|
|
<groupId>org.apache.zeppelin</groupId>
|
|
<version>0.8.0-SNAPSHOT</version>
|
|
<relativePath>..</relativePath>
|
|
</parent>
|
|
|
|
<groupId>org.apache.zeppelin</groupId>
|
|
<artifactId>zeppelin-interpreter</artifactId>
|
|
<packaging>jar</packaging>
|
|
<version>0.8.0-SNAPSHOT</version>
|
|
<name>Zeppelin: Interpreter</name>
|
|
<description>Zeppelin Interpreter</description>
|
|
|
|
<properties>
|
|
<!--library versions-->
|
|
<commons.pool2.version>2.3</commons.pool2.version>
|
|
<commons.exec.version>1.3</commons.exec.version>
|
|
<maven.plugin.api.version>3.0</maven.plugin.api.version>
|
|
<aether.version>1.12</aether.version>
|
|
<maven.aeither.provider.version>3.0.3</maven.aeither.provider.version>
|
|
<wagon.version>1.0</wagon.version>
|
|
<jline.version>2.12.1</jline.version>
|
|
|
|
<!--plugin versions-->
|
|
<plugin.shade.version>2.3</plugin.shade.version>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.thrift</groupId>
|
|
<artifactId>libthrift</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>com.google.code.gson</groupId>
|
|
<artifactId>gson</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.danilopianini</groupId>
|
|
<artifactId>gson-extras</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.commons</groupId>
|
|
<artifactId>commons-exec</artifactId>
|
|
<version>${commons.exec.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.commons</groupId>
|
|
<artifactId>commons-pool2</artifactId>
|
|
<version>${commons.pool2.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>commons-lang</groupId>
|
|
<artifactId>commons-lang</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-api</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-log4j12</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Aether :: maven dependency resolution -->
|
|
<dependency>
|
|
<groupId>org.apache.maven</groupId>
|
|
<artifactId>maven-plugin-api</artifactId>
|
|
<version>${maven.plugin.api.version}</version>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.codehaus.plexus</groupId>
|
|
<artifactId>plexus-utils</artifactId>
|
|
</exclusion>
|
|
<exclusion>
|
|
<groupId>org.sonatype.sisu</groupId>
|
|
<artifactId>sisu-inject-plexus</artifactId>
|
|
</exclusion>
|
|
<exclusion>
|
|
<groupId>org.apache.maven</groupId>
|
|
<artifactId>maven-model</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-api</artifactId>
|
|
<version>${aether.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-util</artifactId>
|
|
<version>${aether.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-impl</artifactId>
|
|
<version>${aether.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.maven</groupId>
|
|
<artifactId>maven-aether-provider</artifactId>
|
|
<version>${maven.aeither.provider.version}</version>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-api</artifactId>
|
|
</exclusion>
|
|
<exclusion>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-spi</artifactId>
|
|
</exclusion>
|
|
<exclusion>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-util</artifactId>
|
|
</exclusion>
|
|
<exclusion>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-impl</artifactId>
|
|
</exclusion>
|
|
<exclusion>
|
|
<groupId>org.codehaus.plexus</groupId>
|
|
<artifactId>plexus-utils</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-connector-file</artifactId>
|
|
<version>${aether.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.sonatype.aether</groupId>
|
|
<artifactId>aether-connector-wagon</artifactId>
|
|
<version>${aether.version}</version>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.apache.maven.wagon</groupId>
|
|
<artifactId>wagon-provider-api</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.maven.wagon</groupId>
|
|
<artifactId>wagon-provider-api</artifactId>
|
|
<version>${wagon.version}</version>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.codehaus.plexus</groupId>
|
|
<artifactId>plexus-utils</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.maven.wagon</groupId>
|
|
<artifactId>wagon-http-lightweight</artifactId>
|
|
<version>${wagon.version}</version>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.apache.maven.wagon</groupId>
|
|
<artifactId>wagon-http-shared</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.maven.wagon</groupId>
|
|
<artifactId>wagon-http</artifactId>
|
|
<version>${wagon.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>jline</groupId>
|
|
<artifactId>jline</artifactId>
|
|
<version>${jline.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>com.google.guava</groupId>
|
|
<artifactId>guava</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>junit</groupId>
|
|
<artifactId>junit</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.mockito</groupId>
|
|
<artifactId>mockito-all</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
</project>
|