diff --git a/README-CH.md b/README-CH.md
index ffd2eeb38..ee8b70d8f 100644
--- a/README-CH.md
+++ b/README-CH.md
@@ -7,22 +7,22 @@
## 简介
- Visualis是一个基于宜信的开源项目[Davinci](https://github.com/edp963/davinci)开发的数据可视化BI工具。现已被集成到数据应用开发门户[DataSphere Studio](https://github.com/WeBankFinTech/DataSphereStudio)中,此次发布的版本Visualis1.0.0版本支持Linkis1.1.1和DSS1.1.0版本。
+Visualis是一个基于宜信的开源项目[Davinci](https://github.com/edp963/davinci)开发的数据可视化BI工具。现已被集成到数据应用开发门户[DataSphere Studio](https://github.com/WeBankFinTech/DataSphereStudio)中。
- Visualis支持拖拽式报表定义、图表联动、钻取、全局筛选、多维分析、实时查询等数据开发探索的分析模式,并做了水印、数据质量校验等金融级增强。
+Visualis支持拖拽式报表定义、图表联动、钻取、全局筛选、多维分析、实时查询等数据开发探索的分析模式,并做了水印、数据质量校验等金融级增强。
## 功能特性
- 基于达芬奇项目, Visualis与DataSphere Studio 1.1.0集成,实现了以下特性:
+基于达芬奇项目, Visualis与DataSphere Studio结合,一同实现了以下特性:
* 图表水印
* 数据质量校验
* 图表展示优化
* 对接Linkis计算中间件
* Scriptis结果集一键可视化
* 外部应用参数支持
-* View/Widget/Dashboard/Display集成为DataSphere Studio的工作流节点
+* Dashboard/Display集成为DataSphere Studio的工作流节点
- Visualis同时支持以下Davinci v0.3版本的原生功能:
+Visualis同时支持以下Davinci的原生功能:
* **数据源**
* 支持JDBC数据源
* 支持CSV文件上传
@@ -50,13 +50,13 @@
* 支持仪表板授权分享
-## 与DataSphere Studio集成
+## 与DataSphere Studio继承
- Visualis与DataSphere Studio的数据开发、工作流调度和数据质量校验等模块无缝衔接,实现数据应用开发全流程的连贯顺滑用户体验。
+Visualis与DataSphere Studio的数据开发、工作流调度和数据质量校验等模块无缝衔接,实现数据应用开发全流程的连贯顺滑用户体验。
-更多使用说明可参考: [Visualis User Manul Doc](./visualis_docs/zh_CN/Visualis_user_manul_cn.md)
+更多信息请访问[DataSphere Studio documentations]().
-
+
@@ -66,34 +66,12 @@
## 文档
-## 安装部署文档
-[编译部署文档](visualis_docs/zh_CN/Visualis_deploy_doc_cn.md)
+[单独部署文档](visualis_docs/zh_CN/Visualis_deploy_doc_cn.md)
-[AppConn安装文档](visualis_docs/zh_CN/Visualis_appconn_install_cn.md)
-
-## 使用文档
-[用户使用文档](visualis_docs/zh_CN/Visualis_user_manul_cn.md)
+[快速对接DSS和Linkis](visualis_docs/zh_CN/Visualis_deploy_doc_cn.md)
[Visualis与Davinci的区别](visualis_docs/zh_CN/Visualis_Davinci_difference_cn.md)
-## 设计文档
-[Visualis设计文档](visualis_docs/zh_CN/Visualis_design_cn.md)
-
-[Display和DashBoard预览原理](visualis_docs/zh_CN/Visualis_display_dashboard_privew_cn.md)
-
-[Visualis接入DSS/Linkis注意点](visualis_docs/zh_CN/Visualis_dss_integration_cn.md)
-
-[集成LinkisDatasource](visualis_docs/zh_CN/Visualis_linkisdatasource_cn.md)
-
-[发送邮件实现原理](visualis_docs/zh_CN/Visualis_sendemail_cn.md)
-
-[绑定sql节点原理](visualis_docs/zh_CN/Visualis_sql_databind_cn.md)
-
-[虚拟视图设计文档](visualis_docs/zh_CN/Visualis_visual_doc_cn.md)
-
-## 升级文档
-[升级文档](visualis_docs/zh_CN/visualis_update_cn.md)
-
## 交流贡献

diff --git a/README.md b/README.md
index d2ab75f3c..2171159e7 100644
--- a/README.md
+++ b/README.md
@@ -7,21 +7,24 @@ English | [中文](README-CH.md)
## Introduction
- Visualis is an open source project based on Yixin [davinci](https://github.com/edp963/davinci) Developed data visualization Bi tool. It has been integrated into the data application development portal [datasphere studio](https://github.com/WeBankFinTech/DataSphereStudio) In this release, visualis1.0.0 supports linkis1.1.1 and dss1.1.0.
- Visualis provides data development/exploration functionalities including drag & drop style report definition, diagram correlation analysis, data drilling, global filtering, multi-dimensional analysis and real-time query, with the enhancement of report watermark and data quality management.
+Visualis is a BI tool for data visualization. It is developed based on the open source project [Davinci](https://github.com/edp963/davinci) contributed by CreditEase.
+
+Visualis has been integrated into the data application development portal [DataSphere Studio](https://github.com/WeBankFinTech/DataSphereStudio).
+
+Visualis provides data development/exploration functionalities including drag & drop style report definition, diagram correlation analysis, data drilling, global filtering, multi-dimensional analysis and real-time query, with the enhancement of report watermark and data quality management.
## Features
Based on Davinci project, Visualis achieves below features with DataSphere Studio:
-* Add chart mark
-* Data quality inspection
-* Optimize chart display
-* Linkis adaption for big-data queries
+* Report water mark.
+* Data quality inspection.
+* Report display optimization.
+* Linkis adaption for big-data queries.
* One-click visualization from Scriptis
-* External application parameters support
-* View/Widget/Dashboard/Display as an appjoint of DataSphere Studio workflow
+* External application parameters support.
+* Dashboard/Display as an appjoint of DataSphere Studio workflow
-Visualis also supports most of the original features of Davinci v0.3.
+Visualis also supports most of the original features of Davinci.
* Data Source Support
* Files in CSV format
* JDBC data source
@@ -42,7 +45,7 @@ Visualis also supports most of the original features of Davinci v0.3.
* Local advanced filter for visual components
* Paging mode and slider for huge volumes of data
* Integration Support
- * Download visual components in CSV format
+ * Upload visual components in CSV format
* Share visual components in a common/authorized way
* Share dashboard in a common/authorized way
@@ -50,44 +53,25 @@ Visualis also supports most of the original features of Davinci v0.3.
## DataSphere Studio Integration
Visualis seamlessly integrates with the data develoment, workflow scheduling and data quality management modules of DataSphere Studio, achieving a smooth and consistent user experience across the whole data application development lifecycle.
-For more details: [Visualis User Manul Doc](./visualis_docs/en_US/Visualis_user_manul_en.md)
+For more detail, please visit [DataSphere Studio documentations]().
-
+
+
+## Quick start
+Click to [Quick start]()
-## Architecture design
+## Architecture

-## Documentation
-
-## Install and deploy documentation
-[Compile and deploy documentation](visualis_docs/en_US/Visualis_deploy_doc_en.md)
-
-[AppConn Installation Documentation](visualis_docs/en_US/Visualis_appconn_install_en.md)
-
-## User manual
-[User documentation](visualis_docs/en_US/Visualis_user_manul_en.md)
-
-[Difference Between Visualis and Davinci](visualis_docs/en_US/Visualis_Davinci_difference_en.md)
-
-## Design documentation
-[Visualis Design Documentation](visualis_docs/en_US/Visualis_design_en.md)
-
-[Display and DashBoard preview principle](visualis_docs/en_US/Visualis_display_dashboard_privew_en.md)
-
-[Visualis access to DSS/Linkis attention points](visualis_docs/en_US/Visualis_dss_integration_en.md)
-
-[Integrate LinkisDatasource](visualis_docs/en_US/Visualis_linkisdatasource_en.md)
-
-[How to send emails](visualis_docs/en_US/Visualis_sendemail_en.md)
+## Documents
-[Principle of binding sql node](visualis_docs/en_US/Visualis_sql_databind_en.md)
+[Deploy documentation](visualis_docs/en_US/Visualis_deploy_doc_en.md)
-[Virtual View Design Documentation](visualis_docs/en_US/Visualis_visual_doc_en.md)
+[Quick integration with DSS and Linkis](visualis_docs/zh_CN/Visualis_dss_integration_cn.md)
-## Upgrade documentation
-[Upgrade Documentation](visualis_docs/en_US/visualis_update_en.md)
+[The differences between Visualis and Davinci](visualis_docs/zh_CN/Visualis_Davinci_difference_cn.md)
## Communication
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 6f2c8ed00..3a1e9ca11 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -3,10 +3,18 @@
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
+
+
+
+
+
+
+
+
visualis
com.webank.wedatasphere.dss
- 1.0.0
+ 0.5.0
visualis-assembly
diff --git a/assembly/src/main/assembly/assembly.xml b/assembly/src/main/assembly/assembly.xml
index 3bd980002..7ee2e869c 100644
--- a/assembly/src/main/assembly/assembly.xml
+++ b/assembly/src/main/assembly/assembly.xml
@@ -30,7 +30,7 @@
${project.parent.basedir}
- ${file.separator}
+ /
README*
@@ -43,7 +43,6 @@
*
- unix
.
@@ -62,7 +61,6 @@
upgrade.*
upgrade-*
- unix
@@ -82,12 +80,18 @@
text
-
-
- ${project.parent.basedir}/davinci-ui
-
- davinci-ui
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -100,4 +104,11 @@
false
+
+
diff --git a/assembly/src/main/assembly/distribution.xml b/assembly/src/main/assembly/distribution.xml
deleted file mode 100644
index 2c48f8356..000000000
--- a/assembly/src/main/assembly/distribution.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
- visualis-server
-
- zip
-
- false
- visualis-server
-
-
-
-
-
- lib
- true
- true
- false
- false
- true
-
- com.amazonaws:aws-java-sdk-autoscaling:jar
- com.amazonaws:aws-java-sdk-core:jar
- com.amazonaws:aws-java-sdk-ec2:jar
- com.amazonaws:aws-java-sdk-route53:jar
- com.amazonaws:aws-java-sdk-sts:jar
- com.amazonaws:jmespath-java:jar
- javax.ws.rs:jsr311-api:jar
- software.amazon.ion:ion-java:jar
-
-
-
-
-
-
- ${basedir}/src/main/resources
-
- *
-
- 0777
- conf
- unix
-
-
-
-
-
diff --git a/assembly/src/main/assembly/release.xml b/assembly/src/main/assembly/release.xml
index 03d69c191..aa60daeae 100644
--- a/assembly/src/main/assembly/release.xml
+++ b/assembly/src/main/assembly/release.xml
@@ -17,6 +17,12 @@
limitations under the License.
>>
-->
+
+
+
+
+
+
release-beta.4
@@ -85,4 +91,11 @@
false
+
+
diff --git a/bin/build.sh b/bin/build.sh
new file mode 100644
index 000000000..4ddf3a0cd
--- /dev/null
+++ b/bin/build.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+current_dir=`pwd`
+script_dir=$(cd `dirname $0`; pwd)
+echo $script_dir
+echo $current_dir
+cd $script_dir
+cd ..
+cd $current_dir
\ No newline at end of file
diff --git a/db/davinci.sql b/bin/davinci.sql
similarity index 82%
rename from db/davinci.sql
rename to bin/davinci.sql
index 17c818de9..99d8e8457 100644
--- a/db/davinci.sql
+++ b/bin/davinci.sql
@@ -1,7 +1,9 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
--- 调度任务
+-- ----------------------------
+-- Table structure for cron_job
+-- ----------------------------
DROP TABLE IF EXISTS `cron_job`;
CREATE TABLE `cron_job` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -20,9 +22,11 @@ CREATE TABLE `cron_job` (
`update_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `name_UNIQUE` (`name`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--- 仪表盘
+-- ----------------------------
+-- Table structure for dashboard
+-- ----------------------------
DROP TABLE IF EXISTS `dashboard`;
CREATE TABLE `dashboard`
(
@@ -30,7 +34,7 @@ CREATE TABLE `dashboard`
`name` varchar(255) NOT NULL,
`dashboard_portal_id` bigint(20) NOT NULL,
`type` smallint(1) NOT NULL,
- `index` int(4) NOT NULL, -- 1为文件0为DashBoard
+ `index` int(4) NOT NULL,
`parent_id` bigint(20) NOT NULL DEFAULT '0',
`config` text,
`full_parent_Id` varchar(100) DEFAULT NULL,
@@ -41,9 +45,12 @@ CREATE TABLE `dashboard`
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_dashboard_id` (`dashboard_portal_id`) USING BTREE,
KEY `idx_parent_id` (`parent_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- DashBoard顶部控件
+-- ----------------------------
+-- Table structure for dashboard_portal
+-- ----------------------------
DROP TABLE IF EXISTS `dashboard_portal`;
CREATE TABLE `dashboard_portal`
(
@@ -59,9 +66,12 @@ CREATE TABLE `dashboard_portal`
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_project_id` (`project_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- Display看板
+-- ----------------------------
+-- Table structure for display
+-- ----------------------------
DROP TABLE IF EXISTS `display`;
CREATE TABLE `display`
(
@@ -77,9 +87,12 @@ CREATE TABLE `display`
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_project_id` (`project_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- Display的画布组件
+-- ----------------------------
+-- Table structure for display_slide
+-- ----------------------------
DROP TABLE IF EXISTS `display_slide`;
CREATE TABLE `display_slide`
(
@@ -93,9 +106,12 @@ CREATE TABLE `display_slide`
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_display_id` (`display_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 下载记录
+-- ----------------------------
+-- Table structure for download_record
+-- ----------------------------
DROP TABLE IF EXISTS `download_record`;
CREATE TABLE `download_record`
(
@@ -108,9 +124,12 @@ CREATE TABLE `download_record`
`last_download_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_user` (`user_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- 点赞喜欢
+-- ----------------------------
+-- Table structure for favorite
+-- ----------------------------
DROP TABLE IF EXISTS `favorite`;
CREATE TABLE `favorite`
(
@@ -120,9 +139,12 @@ CREATE TABLE `favorite`
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `idx_user_project` (`user_id`, `project_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- dashboard里面wideget成员表
+-- ----------------------------
+-- Table structure for mem_dashboard_widget
+-- ----------------------------
DROP TABLE IF EXISTS `mem_dashboard_widget`;
CREATE TABLE `mem_dashboard_widget`
(
@@ -143,9 +165,12 @@ CREATE TABLE `mem_dashboard_widget`
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_protal_id` (`dashboard_id`) USING BTREE,
KEY `idx_widget_id` (`widget_Id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- Display的画布组件中成员表
+-- ----------------------------
+-- Table structure for mem_display_slide_widget
+-- ----------------------------
DROP TABLE IF EXISTS `mem_display_slide_widget`;
CREATE TABLE `mem_display_slide_widget`
(
@@ -164,9 +189,12 @@ CREATE TABLE `mem_display_slide_widget`
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_slide_id` (`display_slide_id`) USING BTREE,
KEY `idx_widget_id` (`widget_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 组织表
+-- ----------------------------
+-- Table structure for organization
+-- ----------------------------
DROP TABLE IF EXISTS `organization`;
CREATE TABLE `organization`
(
@@ -185,9 +213,12 @@ CREATE TABLE `organization`
`update_time` timestamp NULL DEFAULT NULL,
`update_by` bigint(20) DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 平台表
+-- ----------------------------
+-- Table structure for platform
+-- ----------------------------
DROP TABLE IF EXISTS `platform`;
CREATE TABLE `platform`
(
@@ -204,9 +235,12 @@ CREATE TABLE `platform`
`alternateField4` varchar(255) DEFAULT NULL,
`alternateField5` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 工程项目表
+-- ----------------------------
+-- Table structure for project
+-- ----------------------------
DROP TABLE IF EXISTS `project`;
CREATE TABLE `project`
(
@@ -225,9 +259,12 @@ CREATE TABLE `project`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 工程管理员表
+-- ----------------------------
+-- Table structure for rel_project_admin
+-- ----------------------------
DROP TABLE IF EXISTS `rel_project_admin`;
CREATE TABLE `rel_project_admin`
(
@@ -240,9 +277,12 @@ CREATE TABLE `rel_project_admin`
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `idx_project_user` (`project_id`, `user_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='project admin表';
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4 COMMENT ='project admin表';
--- dashboard角色表
+-- ----------------------------
+-- Table structure for rel_role_dashboard
+-- ----------------------------
DROP TABLE IF EXISTS `rel_role_dashboard`;
CREATE TABLE `rel_role_dashboard`
(
@@ -254,9 +294,12 @@ CREATE TABLE `rel_role_dashboard`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`role_id`, `dashboard_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- display角色表
+-- ----------------------------
+-- Table structure for rel_role_display
+-- ----------------------------
DROP TABLE IF EXISTS `rel_role_display`;
CREATE TABLE `rel_role_display`
(
@@ -268,9 +311,12 @@ CREATE TABLE `rel_role_display`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`role_id`, `display_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- dashprotal角色表
+-- ----------------------------
+-- Table structure for rel_role_portal
+-- ----------------------------
DROP TABLE IF EXISTS `rel_role_portal`;
CREATE TABLE `rel_role_portal`
(
@@ -282,9 +328,12 @@ CREATE TABLE `rel_role_portal`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`role_id`, `portal_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- 工程角色表
+-- ----------------------------
+-- Table structure for rel_role_project
+-- ----------------------------
DROP TABLE IF EXISTS `rel_role_project`;
CREATE TABLE `rel_role_project`
(
@@ -304,9 +353,12 @@ CREATE TABLE `rel_role_project`
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `idx_role_project` (`project_id`, `role_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- display slide画布角色表
+-- ----------------------------
+-- Table structure for rel_role_slide
+-- ----------------------------
DROP TABLE IF EXISTS `rel_role_slide`;
CREATE TABLE `rel_role_slide`
(
@@ -318,9 +370,12 @@ CREATE TABLE `rel_role_slide`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`role_id`, `slide_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- 用户角色表
+-- ----------------------------
+-- Table structure for rel_role_user
+-- ----------------------------
DROP TABLE IF EXISTS `rel_role_user`;
CREATE TABLE `rel_role_user`
(
@@ -333,9 +388,12 @@ CREATE TABLE `rel_role_user`
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `idx_role_user` (`user_id`, `role_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- 角色视图表
+-- ----------------------------
+-- Table structure for rel_role_view
+-- ----------------------------
DROP TABLE IF EXISTS `rel_role_view`;
CREATE TABLE `rel_role_view`
(
@@ -348,9 +406,12 @@ CREATE TABLE `rel_role_view`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`view_id`, `role_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 角色组织表
+-- ----------------------------
+-- Table structure for rel_user_organization
+-- ----------------------------
DROP TABLE IF EXISTS `rel_user_organization`;
CREATE TABLE `rel_user_organization`
(
@@ -360,9 +421,12 @@ CREATE TABLE `rel_user_organization`
`role` smallint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `idx_org_user` (`org_id`, `user_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 角色表
+-- ----------------------------
+-- Table structure for role
+-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role`
(
@@ -377,9 +441,12 @@ CREATE TABLE `role`
`avatar` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_orgid` (`org_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='权限表';
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4 COMMENT ='权限表';
--- 数据源表
+-- ----------------------------
+-- Table structure for source
+-- ----------------------------
DROP TABLE IF EXISTS `source`;
CREATE TABLE `source`
(
@@ -399,9 +466,12 @@ CREATE TABLE `source`
`index` int(5) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_project_id` (`project_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 点赞表
+-- ----------------------------
+-- Table structure for star
+-- ----------------------------
DROP TABLE IF EXISTS `star`;
CREATE TABLE `star`
(
@@ -416,7 +486,9 @@ CREATE TABLE `star`
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
--- 用户表
+-- ----------------------------
+-- Table structure for user
+-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`
(
@@ -435,9 +507,12 @@ CREATE TABLE `user`
`update_time` timestamp NOT NULL DEFAULT '1970-01-01 08:00:01',
`update_by` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- 视图view表
+-- ----------------------------
+-- Table structure for view
+-- ----------------------------
DROP TABLE IF EXISTS `view`;
CREATE TABLE `view`
(
@@ -460,16 +535,19 @@ CREATE TABLE `view`
`index` int(5) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_project_id` (`project_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
--- widget表
+-- ----------------------------
+-- Table structure for widget
+-- ----------------------------
DROP TABLE IF EXISTS `widget`;
CREATE TABLE `widget`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
- `view_id` bigint(20), -- 兼容SQL节点作为Source,需要支持null
+ `view_id` bigint(20) NOT NULL,
`project_id` bigint(20) NOT NULL,
`type` bigint(20) NOT NULL,
`publish` tinyint(1) NOT NULL,
@@ -485,9 +563,10 @@ CREATE TABLE `widget`
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_project_id` (`project_id`) USING BTREE,
KEY `idx_view_id` (`view_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8;
+
--- display画布上widget角色权限表
DROP TABLE IF EXISTS `rel_role_display_slide_widget`;
CREATE TABLE `rel_role_display_slide_widget`
(
@@ -499,9 +578,10 @@ CREATE TABLE `rel_role_display_slide_widget`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`role_id`, `mem_display_slide_widget_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
--- dashboard上widget角色权限表
DROP TABLE IF EXISTS `rel_role_dashboard_widget`;
CREATE TABLE `rel_role_dashboard_widget`
(
@@ -513,9 +593,9 @@ CREATE TABLE `rel_role_dashboard_widget`
`update_by` bigint(20) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`role_id`, `mem_dashboard_widget_id`) USING BTREE
-) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
--- 访问和操作记录统计表
DROP TABLE IF EXISTS `davinci_statistic_visitor_operation`;
CREATE TABLE `davinci_statistic_visitor_operation` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -539,7 +619,6 @@ CREATE TABLE `davinci_statistic_visitor_operation` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--- 客户端终端信息统计表
DROP TABLE IF EXISTS `davinci_statistic_terminal`;
CREATE TABLE `davinci_statistic_terminal` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -559,7 +638,7 @@ CREATE TABLE `davinci_statistic_terminal` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--- 停留时间统计表
+
DROP TABLE IF EXISTS `davinci_statistic_duration`;
CREATE TABLE `davinci_statistic_duration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -570,7 +649,6 @@ CREATE TABLE `davinci_statistic_duration` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--- 分享和下载记录表
DROP TABLE IF EXISTS `share_download_record`;
CREATE TABLE `share_download_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -583,12 +661,7 @@ CREATE TABLE `share_download_record` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--- alter table widget modify view_id bigint null;
SET FOREIGN_KEY_CHECKS = 1;
-DELETE FROM source;
-INSERT INTO `source` (
- id,name,description,config,type,project_id,create_by,create_time,update_by,update_time,parent_id,full_parent_id,is_folder,`index`)
-VALUES (
- 1,'hiveDataSource','','{"parameters":"","password":"","url":"test","username":"hiveDataSource-token"}','hive',-1,null,null,null,null,null,null,null,null);
+INSERT INTO `source` (id,name,description,config,type,project_id,create_by,create_time,update_by,update_time,parent_id,full_parent_id,is_folder,`index`) VALUES (1,'hiveDataSource','','{"parameters":"","password":"","url":"test","username":"hiveDataSource-token"}','hive',-1,null,null,null,null,null,null,null,null);
diff --git a/bin/initdb.bat b/bin/initdb.bat
new file mode 100644
index 000000000..725a8a368
--- /dev/null
+++ b/bin/initdb.bat
@@ -0,0 +1,22 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed 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.
+:: >>
+
+@echo off
+
+for %%x in ("%MYSQL_HOME%") do set MYSQL_HOME=%%~sx
+for %%x in ("%DAVINCI3_HOME%") do set DAVINCI3_HOME=%%~sx
+
+%MYSQL_HOME%\bin\mysql.exe -h localhost -uroot -proot davinci0.3 < %DAVINCI3_HOME%\bin\davinci.sql
\ No newline at end of file
diff --git a/bin/initdb.sh b/bin/initdb.sh
new file mode 100644
index 000000000..bbf1cb229
--- /dev/null
+++ b/bin/initdb.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+mysql -P 3306 -h localhost -u root -proot davinci0.3 < $DAVINCI3_HOME/bin/davinci.sql
diff --git a/bin/migration/README.md b/bin/migration/README.md
new file mode 100644
index 000000000..e7fd3060a
--- /dev/null
+++ b/bin/migration/README.md
@@ -0,0 +1,14 @@
+### 注意!
+
+1. **升级前请务必备份数据!!!, 升级前请务必备份数据!!!, 升级前请务必备份数据!!!**
+2. 本次升级只针对 davinci0.3 beta.4 升级至 beta.5, 其他版本请不要执行!
+3. 已安装 beta.5 及之后版本无须执行此脚本;
+4. 本次升级默认读取 config 下 application.yml 中配置的 davinci 数据源,也可通过参数指定,更多信息请执行 ‘upgrade -help’ 查看;
+5. 本次升级可能造成部分 View 中定义的`变量值`错误,请手动修改;
+6. 升级脚本为二进制文件,不同平台执行相应脚本即可,无须重复执行:
+
+ | 平台 | 对应脚本 |
+ | --- | --- |
+ |Windows | upgrade.exe |
+ |Mac OS | upgrade_darwin |
+ |Linux | upgrade_linux |
\ No newline at end of file
diff --git a/bin/migration/upgrade.exe b/bin/migration/upgrade.exe
new file mode 100644
index 000000000..498d9896e
Binary files /dev/null and b/bin/migration/upgrade.exe differ
diff --git a/bin/migration/upgrade_darwin b/bin/migration/upgrade_darwin
new file mode 100644
index 000000000..c512ed29c
Binary files /dev/null and b/bin/migration/upgrade_darwin differ
diff --git a/bin/migration/upgrade_linux b/bin/migration/upgrade_linux
new file mode 100644
index 000000000..907d23b48
Binary files /dev/null and b/bin/migration/upgrade_linux differ
diff --git a/bin/patch/001_beta5.sql b/bin/patch/001_beta5.sql
new file mode 100644
index 000000000..38901d6ae
--- /dev/null
+++ b/bin/patch/001_beta5.sql
@@ -0,0 +1,1191 @@
+set @data_base = 'davinci0.3';
+
+DROP TABLE IF EXISTS `platform`;
+CREATE TABLE `platform`
+(
+ `id` bigint(20) NOT NULL,
+ `name` varchar(255) NOT NULL,
+ `platform` varchar(255) NOT NULL,
+ `code` varchar(32) NOT NULL,
+ `checkCode` varchar(255) DEFAULT NULL,
+ `checkSystemToken` varchar(255) DEFAULT NULL,
+ `checkUrl` varchar(255) DEFAULT NULL,
+ `alternateField1` varchar(255) DEFAULT NULL,
+ `alternateField2` varchar(255) DEFAULT NULL,
+ `alternateField3` varchar(255) DEFAULT NULL,
+ `alternateField4` varchar(255) DEFAULT NULL,
+ `alternateField5` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+DROP TABLE IF EXISTS `download_record`;
+CREATE TABLE `download_record`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `user_id` bigint(20) NOT NULL,
+ `path` varchar(255) DEFAULT NULL,
+ `status` smallint(1) NOT NULL,
+ `create_time` datetime NOT NULL,
+ `last_download_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ KEY `idx_user` (`user_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_project_admin`;
+CREATE TABLE `rel_project_admin`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `project_id` bigint(20) NOT NULL,
+ `user_id` bigint(20) NOT NULL,
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `idx_project_user` (`project_id`, `user_id`) USING BTREE
+) ENGINE = InnoDB
+ AUTO_INCREMENT = 6
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_dashboard`;
+CREATE TABLE `rel_role_dashboard`
+(
+ `role_id` bigint(20) NOT NULL,
+ `dashboard_id` bigint(20) NOT NULL,
+ `visible` tinyint(1) NOT NULL DEFAULT '0',
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`role_id`, `dashboard_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_display`;
+CREATE TABLE `rel_role_display`
+(
+ `role_id` bigint(20) NOT NULL,
+ `display_id` bigint(20) NOT NULL,
+ `visible` tinyint(1) NOT NULL DEFAULT '0',
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`role_id`, `display_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_portal`;
+CREATE TABLE `rel_role_portal`
+(
+ `role_id` bigint(20) NOT NULL,
+ `portal_id` bigint(20) NOT NULL,
+ `visible` tinyint(1) NOT NULL DEFAULT '0',
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`role_id`, `portal_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_project`;
+CREATE TABLE `rel_role_project`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `project_id` bigint(20) NOT NULL,
+ `role_id` bigint(20) NOT NULL,
+ `source_permission` smallint(1) NOT NULL DEFAULT '1',
+ `view_permission` smallint(1) NOT NULL DEFAULT '1',
+ `widget_permission` smallint(1) NOT NULL DEFAULT '1',
+ `viz_permission` smallint(1) NOT NULL DEFAULT '1',
+ `schedule_permission` smallint(1) NOT NULL DEFAULT '1',
+ `share_permission` tinyint(1) NOT NULL DEFAULT '0',
+ `download_permission` tinyint(1) NOT NULL DEFAULT '0',
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `idx_role_project` (`project_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+ AUTO_INCREMENT = 40
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_slide`;
+CREATE TABLE `rel_role_slide`
+(
+ `role_id` bigint(20) NOT NULL,
+ `slide_id` bigint(20) NOT NULL,
+ `visible` tinyint(1) NOT NULL DEFAULT '0',
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`role_id`, `slide_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_user`;
+CREATE TABLE `rel_role_user`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `user_id` bigint(20) NOT NULL,
+ `role_id` bigint(20) NOT NULL,
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE KEY `idx_role_user` (`user_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+ AUTO_INCREMENT = 30
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_view`;
+CREATE TABLE `rel_role_view`
+(
+ `view_id` bigint(20) NOT NULL,
+ `role_id` bigint(20) NOT NULL,
+ `row_auth` text,
+ `column_auth` text,
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`view_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `role`;
+CREATE TABLE `role`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `org_id` bigint(20) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ `description` varchar(255) DEFAULT NULL,
+ `avatar` varchar(255) DEFAULT NULL,
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ KEY `idx_orgid` (`org_id`) USING BTREE
+) ENGINE = InnoDB
+ AUTO_INCREMENT = 24
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_display_slide_widget`;
+CREATE TABLE `rel_role_display_slide_widget`
+(
+ `role_id` bigint(20) NOT NULL,
+ `mem_display_slide_widget_id` bigint(20) NOT NULL,
+ `visible` tinyint(1) NOT NULL DEFAULT '0',
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`role_id`, `mem_display_slide_widget_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_dashboard_widget`;
+CREATE TABLE `rel_role_dashboard_widget`
+(
+ `role_id` bigint(20) NOT NULL,
+ `mem_dashboard_widget_id` bigint(20) NOT NULL,
+ `visible` tinyint(1) NOT NULL DEFAULT '0',
+ `create_by` bigint(20) DEFAULT NULL,
+ `create_time` datetime DEFAULT NULL,
+ `update_by` bigint(20) DEFAULT NULL,
+ `update_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`role_id`, `mem_dashboard_widget_id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+ALTER TABLE `organization`
+ ADD INDEX `idx_user_id` (`user_id`),
+ ADD INDEX `idx_allow_create_project` (`allow_create_project`),
+ ADD INDEX `idx_member_permisson` (`member_permission`);
+
+ALTER TABLE `project`
+ ADD INDEX `idx_org_id` (`org_id`),
+ ADD INDEX `idx_user_id` (`user_id`),
+ ADD INDEX `idx_visibility` (`visibility`);
+
+ALTER TABLE `rel_user_organization`
+ ADD INDEX `idx_role` (`role`);
+
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'cron_job'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `cron_job` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'cron_job'
+ AND column_name = 'parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `cron_job` ADD `parent_id` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'cron_job'
+ AND column_name = 'full_parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `cron_job` ADD `full_parent_id` varchar(100) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'cron_job'
+ AND column_name = 'is_folder') > 0,
+ "SELECT 1",
+ "ALTER TABLE `cron_job` ADD `is_folder` tinyint(1) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'cron_job'
+ AND column_name = 'index') > 0,
+ "SELECT 1",
+ "ALTER TABLE `cron_job` ADD `index` int(5) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard'
+ AND column_name = 'full_parent_Id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard` ADD `full_parent_Id` varchar(100) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard_portal'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard_portal` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard_portal'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard_portal` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard_portal'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard_portal` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'dashboard_portal'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `dashboard_portal` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display_slide'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display_slide` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display_slide'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display_slide` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display_slide'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display_slide` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'display_slide'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `display_slide` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_dashboard_widget'
+ AND column_name = 'config') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_dashboard_widget` ADD `config` text;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_dashboard_widget'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_dashboard_widget` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_dashboard_widget'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_dashboard_widget` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_dashboard_widget'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_dashboard_widget` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_dashboard_widget'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_dashboard_widget` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_display_slide_widget'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_display_slide_widget` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_display_slide_widget'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_display_slide_widget` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_display_slide_widget'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_display_slide_widget` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'mem_display_slide_widget'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `mem_display_slide_widget` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'project'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `project` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'project'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `project` ADD `create_time` datetime NULL DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'project'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `project` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'project'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `project` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `parent_id` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'full_parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `full_parent_id` varchar(255) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'is_folder') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `is_folder` tinyint(1) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'source'
+ AND column_name = 'index') > 0,
+ "SELECT 1",
+ "ALTER TABLE `source` ADD `index` int(5) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'variable') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `variable` text;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `parent_id` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'full_parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `full_parent_id` varchar(255) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'is_folder') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `is_folder` tinyint(1) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'view'
+ AND column_name = 'index') > 0,
+ "SELECT 1",
+ "ALTER TABLE `view` ADD `index` int(5) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'rel_user_organization'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `rel_user_organization` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'rel_user_organization'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `rel_user_organization` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'rel_user_organization'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `rel_user_organization` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'rel_user_organization'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `rel_user_organization` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'create_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `create_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'create_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `create_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'update_by') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `update_by` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'update_time') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `update_time` datetime DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `parent_id` bigint(20) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'full_parent_id') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `full_parent_id` varchar(255) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'is_folder') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `is_folder` varchar(255) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'widget'
+ AND column_name = 'index') > 0,
+ "SELECT 1",
+ "ALTER TABLE `widget` ADD `index` int(5) DEFAULT NULL;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+ (SELECT COUNT(*)
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE table_schema = @data_base
+ AND table_name = 'organization'
+ AND column_name = 'role_num') > 0,
+ "SELECT 1",
+ "ALTER TABLE `organization` CHANGE COLUMN `team_num` `role_num` int(20) NULL DEFAULT 0 AFTER `member_num`;"
+ ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+update organization
+set role_num = 0;
+
+update download_record
+set status = 4
+where last_download_time is not null
+ and status = 2;
diff --git a/bin/patch/002_beta7.sql b/bin/patch/002_beta7.sql
new file mode 100644
index 000000000..70d4864e5
--- /dev/null
+++ b/bin/patch/002_beta7.sql
@@ -0,0 +1,74 @@
+DROP TABLE IF EXISTS `davinci_statistic_visitor_operation`;
+CREATE TABLE `davinci_statistic_visitor_operation`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `user_id` bigint(20) DEFAULT NULL,
+ `email` varchar(255) DEFAULT NULL,
+ `action` varchar(255) DEFAULT NULL COMMENT 'login/visit/initial/sync/search/linkage/drill/download/print',
+ `org_id` bigint(20) DEFAULT NULL,
+ `project_id` bigint(20) DEFAULT NULL,
+ `project_name` varchar(255) DEFAULT NULL,
+ `viz_type` varchar(255) DEFAULT NULL COMMENT 'dashboard/display',
+ `viz_id` bigint(20) DEFAULT NULL,
+ `viz_name` varchar(255) DEFAULT NULL,
+ `sub_viz_id` bigint(20) DEFAULT NULL,
+ `sub_viz_name` varchar(255) DEFAULT NULL,
+ `widget_id` bigint(20) DEFAULT NULL,
+ `widget_name` varchar(255) DEFAULT NULL,
+ `variables` varchar(500) DEFAULT NULL,
+ `filters` varchar(500) DEFAULT NULL,
+ `groups` varchar(500) DEFAULT NULL,
+ `create_time` timestamp NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+DROP TABLE IF EXISTS `davinci_statistic_terminal`;
+CREATE TABLE `davinci_statistic_terminal`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `user_id` bigint(20) DEFAULT NULL,
+ `email` varchar(255) DEFAULT NULL,
+ `browser_name` varchar(255) DEFAULT NULL,
+ `browser_version` varchar(255) DEFAULT NULL,
+ `engine_name` varchar(255) DEFAULT NULL,
+ `engine_version` varchar(255) DEFAULT NULL,
+ `os_name` varchar(255) DEFAULT NULL,
+ `os_version` varchar(255) DEFAULT NULL,
+ `device_model` varchar(255) DEFAULT NULL,
+ `device_type` varchar(255) DEFAULT NULL,
+ `device_vendor` varchar(255) DEFAULT NULL,
+ `cpu_architecture` varchar(255) DEFAULT NULL,
+ `create_time` timestamp NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `davinci_statistic_duration`;
+CREATE TABLE `davinci_statistic_duration`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `user_id` bigint(20) DEFAULT NULL,
+ `email` varchar(255) DEFAULT NULL,
+ `start_time` timestamp NULL DEFAULT NULL,
+ `end_time` timestamp NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `share_download_record`;
+CREATE TABLE `share_download_record`
+(
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `uuid` varchar(50) DEFAULT NULL,
+ `name` varchar(255) NOT NULL,
+ `path` varchar(255) DEFAULT NULL,
+ `status` smallint(1) NOT NULL,
+ `create_time` datetime NOT NULL,
+ `last_download_time` datetime DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+ DEFAULT CHARSET = utf8mb4;
+
diff --git a/bin/phantomjs b/bin/phantomjs
deleted file mode 100644
index d72e801ce..000000000
Binary files a/bin/phantomjs and /dev/null differ
diff --git a/bin/run.bat b/bin/run.bat
new file mode 100644
index 000000000..c2988f5c7
--- /dev/null
+++ b/bin/run.bat
@@ -0,0 +1,32 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed 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.
+:: >>
+
+@echo off
+
+for %%x in ("%JAVA_HOME%") do set JAVA_HOME=%%~sx
+for %%x in ("%DAVINCI3_HOME%") do set DAVINCI3_HOME=%%~sx
+
+if "%1" == "start" (
+ echo start Davinci Server
+ start "Davinci Server" java -Dfile.encoding=UTF-8 -cp .;%JAVA_HOME%\lib\*;%DAVINCI3_HOME%\lib\*; edp.DavinciServerApplication --spring.config.additional-location=file:%DAVINCI3_HOME%\config\application.yml
+) else if "%1" == "stop" (
+ echo stop Davinci Server
+ taskkill /fi "WINDOWTITLE eq Davinci Server"
+) else (
+ echo please use "run.bat start" or "run.bat stop"
+)
+
+pause
\ No newline at end of file
diff --git a/bin/start-visualis-server.sh b/bin/start-visualis-server.sh
index a05483e70..b3fecd75c 100644
--- a/bin/start-visualis-server.sh
+++ b/bin/start-visualis-server.sh
@@ -34,7 +34,7 @@ export DWS_ENGINE_DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,a
export DWS_ENGINE_ANAGER_HEAP_SIZE="4G"
export DWS_ENGINE_ANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_ANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_ANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m $DWS_ENGINE_DEBUG"
-nohup java $DWS_ENGINE_ANAGER_JAVA_OPTS -cp $HOME/conf:$HOME/lib/*:$JAVA_HOME/lib/* org.apache.linkis.DataWorkCloudApplication 2>&1 > $DWS_ENGINE_ANAGER_LOG_PATH/linkis.out &
+nohup java $DWS_ENGINE_ANAGER_JAVA_OPTS -cp $HOME/conf:$HOME/lib/*:$JAVA_HOME/lib/* com.webank.wedatasphere.linkis.DataWorkCloudApplication 2>&1 > $DWS_ENGINE_ANAGER_LOG_PATH/linkis.out &
pid=$!
if [[ -z "${pid}" ]]; then
echo "visualis-server start failed!"
diff --git a/bin/start.bat b/bin/start.bat
new file mode 100644
index 000000000..5430e6a86
--- /dev/null
+++ b/bin/start.bat
@@ -0,0 +1,19 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed 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.
+:: >>
+
+@echo off
+call run.bat start
+exit
\ No newline at end of file
diff --git a/bin/stop.bat b/bin/stop.bat
new file mode 100644
index 000000000..7560aa234
--- /dev/null
+++ b/bin/stop.bat
@@ -0,0 +1,19 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed 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.
+:: >>
+
+@echo off
+call run.bat stop
+exit
\ No newline at end of file
diff --git a/conf/application.yml b/conf/application.yml
index dbeccfb9d..d4474fa1c 100644
--- a/conf/application.yml
+++ b/conf/application.yml
@@ -1,45 +1,44 @@
-# ##################################
-# 1. Visualis Service configuration
-# ##################################
server:
protocol: http
- address: 127.0.0.1 # server ip address
- port: 9008 # server port
- url: http://127.0.0.1:8088/dss/visualis # frontend index page full path
- access:
- address: 127.0.0.1 # frontend address
- port: 8088 # frontend port
-
-
-# ##################################
-# 2. eureka configuration
-# ##################################
+ address: 127.0.0.1 #server ip address
+ port: 9007 #该模块提供服务的端口(必须)
+ url: http://0.0.0.0:0000/dws/visualis #frontend index page full path
+ access:
+ address: 0.0.0.0 #frontend address
+ port: 0000 #frontend port
+
+#指定eureka Server的地址,用于注册(必须)
eureka:
client:
serviceUrl:
- defaultZone: http://127.0.0.1:20303/eureka/ # Configuration required
+ defaultZone: http://127.0.0.1:20303/eureka/
instance:
metadata-map:
test: wedatasphere
+#(必须)
management:
endpoints:
web:
exposure:
include: refresh,info
+logging:
+ config: classpath:log4j2.xml
+
+file:
+ userfiles-path: ${DAVINCI3_HOME}/userfiles
+ web_resources: ${DAVINCI3_HOME}/davinci-ui/
+ phantomJs-path: ${DAVINCI3_HOME}/bin/phantom.js
+ base-path: ${DAVINCI3_HOME}
-# ##################################
-# 3. Spring configuration
-# ##################################
spring:
- main:
- allow-bean-definition-overriding: true
application:
- name: visualis-dev
- datasource: # visualis需要和dss部署在同一个数据库
- url: jdbc:mysql://127.0.0.1:3306/dss?characterEncoding=UTF-8&allowMultiQueries=true # Configuration required
- username: hadoop
- password: hadoop
+ name: visualis #模块名,用于做高可用(必须)
+ ## davinci datasouce config
+ datasource:
+ url: jdbc:mysql://127.0.0.1:3306/xxx?characterEncoding=UTF-8 #application mysql database jdbc url
+ username: xxx #application mysql database username
+ password: xxx #application mysql database password
driver-class-name: com.mysql.jdbc.Driver
initial-size: 2
min-idle: 1
@@ -73,6 +72,7 @@ spring:
mvc:
static-path-pattern: /**
+
thymeleaf:
mode: HTML5
cache: true
@@ -106,25 +106,14 @@ spring:
smtp:
ssl:
enable: false
-logging:
- config: classpath:log4j2.xml
-
-# ##################################
-# 4. static resource configuration
-# ##################################
-file:
- userfiles-path: ${DAVINCI3_HOME}/userfiles
- web_resources: ${DAVINCI3_HOME}/davinci-ui/
- base-path: ${DAVINCI3_HOME}
-
-sql_template_delimiter: $
-custom-datasource-driver-path: ${DAVINCI3_HOME}/conf/datasource_driver.yml
+springfox:
+ documentation:
+ swagger:
+ v2:
+ path: /api-doc
-# ##################################
-# 5. SQL configuration
-# ##################################
pagehelper:
supportMethodsArguments: true
reasonable: true
@@ -145,14 +134,16 @@ mapper:
not-empty: false
mappers: edp.davinci.dao
+sql_template_delimiter: $
+
+custom-datasource-driver-path: ${DAVINCI3_HOME}/conf/datasource_driver.yml
+
+phantomjs_home: ${DAVINCI3_HOME}/bin/phantomjs
-# ##################################
-# 6. Screenshot drive
-# ##################################
email:
suffix: ""
screenshot:
- default_browser: PHANTOMJS
+ default_browser: PHANTOMJS # PHANTOMJS or CHROME
timeout_second: 1800
phantomjs_path: ${DAVINCI3_HOME}/bin/phantomjs
chromedriver_path: $your_chromedriver_path$
diff --git a/conf/linkis.properties b/conf/linkis.properties
index 019adc6a2..e4371a650 100644
--- a/conf/linkis.properties
+++ b/conf/linkis.properties
@@ -1,30 +1,24 @@
-# ##################################
-# 1. need configuration
-# 需要配置
-# ##################################
-wds.linkis.gateway.url=http://127.0.0.1:9001
-
-# 需配置和Linkis结果集路径保持一致
-wds.linkis.filesystem.root.path=file:///mnt/bdap/
-wds.linkis.filesystem.hdfs.root.path=hdfs:///tmp/linkis
-
-# ##################################
-# 2. can keep the default configuration
-# 可以保持默认配置
-# ##################################
-
-wds.dss.visualis.query.timeout=1200000
-
-wds.linkis.server.version=v1
-
+#是否启动测试默认
wds.linkis.test.mode=false
wds.linkis.test.user=test
+#Restful扫描的package
+wds.linkis.server.restful.scan.packages=com.webank.wedatasphere.linkis.entrance.restful,com.webank.wedatasphere.dss.visualis.restful
+wds.linkis.engine.application.name=sparkEngine
+wds.linkis.enginemanager.application.name=sparkEngineManager
+
+wds.linkis.query.application.name=cloud-publicservice
-wds.linkis.server.restful.scan.packages=com.webank.wedatasphere.dss.visualis.restful
+wds.linkis.console.config.application.name=cloud-publicservice
+wds.linkis.engine.creation.wait.time.max=20m
+wds.linkis.server.socket.mode=false
+
+wds.linkis.server.distinct.mode=true
+wds.linkis.entrance.config.logPath=file:///tmp/linkis/
wds.dss.visualis.project.name=default
-wds.dss.engine.allowed.creators=Visualis,nodeexecution,IDE
-wds.linkis.max.ask.executor.time=45m
-wds.linkis.server.component.exclude.classes=com.webank.wedatasphere.linkis.entrance.parser.SparkJobParser
-wds.dss.visualis.creator=Visualis
\ No newline at end of file
+wds.linkis.server.version=v1
+wds.linkis.resultSet.store.path=hdfs:///tmp/linkis
+wds.dss.visualis.gateway.ip=
+wds.dss.visualis.gateway.port=
+wds.dss.visualis.query.timeout=1200000
\ No newline at end of file
diff --git a/conf/log4j.properties b/conf/log4j.properties
new file mode 100644
index 000000000..0807e6087
--- /dev/null
+++ b/conf/log4j.properties
@@ -0,0 +1,37 @@
+#
+# Copyright 2019 WeBank
+#
+# Licensed 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.
+#
+#
+
+### set log levels ###
+
+log4j.rootCategory=INFO,console
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.Threshold=INFO
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+#log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n
+log4j.appender.console.layout.ConversionPattern= %d{ISO8601} %-5p (%t) %p %c{1} - %m%n
+
+
+log4j.appender.com.webank.bdp.ide.core=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.com.webank.bdp.ide.core.Threshold=INFO
+log4j.additivity.com.webank.bdp.ide.core=false
+log4j.appender.com.webank.bdp.ide.core.layout=org.apache.log4j.PatternLayout
+log4j.appender.com.webank.bdp.ide.core.Append=true
+log4j.appender.com.webank.bdp.ide.core.File=logs/linkis.log
+log4j.appender.com.webank.bdp.ide.core.layout.ConversionPattern= %d{ISO8601} %-5p (%t) [%F:%M(%L)] - %m%n
+
+log4j.logger.org.springframework=INFO
diff --git a/db/ddl.sql b/db/ddl.sql
deleted file mode 100644
index de4ad025f..000000000
--- a/db/ddl.sql
+++ /dev/null
@@ -1,51 +0,0 @@
-CREATE TABLE `visualis_config` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `key` varchar(255) DEFAULT NULL,
- `value` varchar(255) DEFAULT NULL,
- `scope` varchar(255) DEFAULT NULL,
- `username` varchar(255) DEFAULT NULL,
- `params` longtext,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-DROP TABLE IF EXISTS `visualis_project`;
-CREATE TABLE `visualis_project` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `name` varchar(200) COLLATE utf8_bin DEFAULT NULL,
- `description` text COLLATE utf8_bin,
- `pic` varchar(255) COLLATE utf8_bin DEFAULT NULL,
- `org_id` bigint(20) DEFAULT NULL COMMENT 'Organization ID',
- `user_id` bigint(20) DEFAULT NULL,
- `star_num` int(11) DEFAULT '0',
- `username` varchar(32) COLLATE utf8_bin DEFAULT NULL,
- `create_time` datetime DEFAULT NULL,
- `create_by` varchar(128) COLLATE utf8_bin DEFAULT NULL COMMENT '创建人',
- `update_time` datetime DEFAULT NULL,
- `update_by` varchar(128) COLLATE utf8_bin DEFAULT NULL COMMENT '修改人',
- `visibility` bit(1) DEFAULT NULL,
- `is_transfer` bit(1) DEFAULT NULL COMMENT 'Reserved word',
- `initial_org_id` bigint(20) DEFAULT NULL,
- `isArchive` bit(1) DEFAULT b'0' COMMENT 'If it is archived',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=313 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
-
--- visualis使用该表做权限管理
-DROP TABLE IF EXISTS `visualis_user`;
-CREATE TABLE `visualis_user` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `email` varchar(255) DEFAULT NULL,
- `username` varchar(255) NOT NULL,
- `password` varchar(255) DEFAULT NULL,
- `admin` tinyint(1) DEFAULT NULL COMMENT 'If it is an administrator',
- `active` tinyint(1) DEFAULT NULL COMMENT 'If it is active',
- `name` varchar(255) DEFAULT NULL COMMENT 'User name',
- `description` varchar(255) DEFAULT NULL,
- `department` varchar(255) DEFAULT NULL,
- `avatar` varchar(255) DEFAULT NULL COMMENT 'Path of the avator',
- `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `create_by` bigint(20) DEFAULT '0',
- `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `update_by` bigint(20) DEFAULT '0',
- `is_first_login` bit(1) DEFAULT NULL COMMENT 'If it is the first time to log in',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/docs/_docs/zh/1.1-deployment.md b/docs/_docs/zh/1.1-deployment.md
index 331f3f408..5461ffcd4 100644
--- a/docs/_docs/zh/1.1-deployment.md
+++ b/docs/_docs/zh/1.1-deployment.md
@@ -164,7 +164,7 @@ cache 这里用 redis 作为缓存服务,配置如下:
spring:
redis:
isEnable: false
- host: 127.0.0.1
+ host: 10.143.131.119
port: 6379
# cluster:
diff --git a/ext/pf.ttf b/ext/pf.ttf
deleted file mode 100644
index 96d0db72a..000000000
Binary files a/ext/pf.ttf and /dev/null differ
diff --git a/images/communication.png b/images/communication.png
index 55a0dde5d..12e86727d 100644
Binary files a/images/communication.png and b/images/communication.png differ
diff --git a/images/visualis_workflow.gif b/images/visualis_workflow.gif
deleted file mode 100644
index 96d268ede..000000000
Binary files a/images/visualis_workflow.gif and /dev/null differ
diff --git a/pom.xml b/pom.xml
index 955d9fffd..af6a3dd98 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,9 +3,17 @@
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">
4.0.0
+
+
+
+
+
+
+
+
visualis
com.webank.wedatasphere.dss
- 1.0.0
+ 0.5.0
pom
@@ -19,33 +27,14 @@
assembly
server
- visualis-appconn
${project.basedir}
UTF-8
UTF-8
- 2.11.8
1.8
UTF-8
- 2.12
- 2.15.2
- 1.8
- true
-
- 1.1.1
- 1.1.0
-
- 5.1.2
- 2.3.7.RELEASE
- 2.2.1.RELEASE
- 5.2.12.RELEASE
- 1.4.19
- 1.26
- 2.6.2
- 2.17.1
- 3.13
@@ -98,9 +87,7 @@
1024m
true
-
- ${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar${path.separator}${java.home}/../lib/tools.jar
-
+ ${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar${path.separator}${java.home}/../lib/tools.jar
-Xlint:all,-serial,-path
@@ -116,16 +103,6 @@
-
- org.projectlombok
- lombok
- 1.16.22
-
-
- org.projectlombok
- lombok-maven-plugin
- 1.16.8.0
-
diff --git a/server/README.md b/server/README.md
new file mode 100644
index 000000000..e69de29bb
diff --git a/server/pom.xml b/server/pom.xml
index 066c100e8..d5d70a2ea 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -1,141 +1,45 @@
+ 4.0.0
+
+ visualis-server
+ jar
+
+
+
+
+
+
+
visualis
com.webank.wedatasphere.dss
- 1.0.0
- ../pom.xml
+ 0.5.0
- 4.0.0
- visualis-server
- jar
+
+ UTF-8
+ UTF-8
+ 1.8
+ true
+ 6.4.2
+ 5.1.2
+ 2.0.3.RELEASE
+
-
- com.thoughtworks.xstream
- xstream
- ${xstream.core.version}
-
-
-
- org.apache.logging.log4j
- log4j-api
- ${log4j2.version}
-
-
- org.apache.logging.log4j
- log4j-core
- ${log4j2.version}
-
-
- org.apache.logging.log4j
- log4j-slf4j-impl
- ${log4j2.version}
-
-
-
- org.apache.logging.log4j
- log4j-1.2-api
- ${log4j2.version}
-
-
javax.validation
validation-api
2.0.1.Final
-
- com.webank.wedatasphere.dss
- spring-origin-sso-integration-plugin
- ${opensource.dss.version}
-
-
- spring-core
- org.springframework
-
-
-
-
-
- com.webank.wedatasphere.dss
- dss-project-plugin
- ${opensource.dss.version}
-
-
-
- org.apache.linkis
- linkis-module
- ${apache.linkis.version}
-
-
-
- org.apache.linkis
- linkis-common
- ${apache.linkis.version}
-
-
-
- org.apache.linkis
- linkis-computation-client
- ${apache.linkis.version}
-
-
-
- org.apache.linkis
- linkis-cs-client
- ${apache.linkis.version}
-
-
-
- org.apache.linkis
- linkis-storage
- ${apache.linkis.version}
-
-
-
- org.apache.linkis
- linkis-io_file-client
- ${apache.linkis.version}
-
-
-
- org.apache.linkis
- linkis-rpc
- ${apache.linkis.version}
-
-
- spring-aop
- org.springframework
-
-
- spring-cloud-commons
- org.springframework.cloud
-
-
-
-
-
- org.apache.linkis
- linkis-bml-client
- ${apache.linkis.version}
- provided
- true
-
-
- gson
- com.google.code.gson
-
-
-
-
- org.apache.linkis
- linkis-entrance
- ${apache.linkis.version}
+ com.webank.wedatasphere.linkis
+ linkis-ujes-spark-entracne
+ 0.9.1
javax.validation
@@ -155,29 +59,38 @@
-
- org.yaml
- snakeyaml
- ${snakeyaml.version}
+ spring-cloud-commons
+ org.springframework.cloud
+ 2.0.0.RELEASE
+
+
+ spring-cloud-starter-openfeign
+ org.springframework.cloud
+ 2.0.0.RELEASE
-
+ spring-cloud-starter-eureka
org.springframework.cloud
- spring-cloud-netflix-hystrix
- ${spring.cloud.version}
+ 1.4.4.RELEASE
org.springframework.cloud
- spring-cloud-starter-openfeign
- ${spring.cloud.version}
+ spring-cloud-netflix-core
+ 2.0.0.RELEASE
+
+
+
+ org.apache.logging.log4j
+ log4j-api
+ 2.10.0
org.springframework.cloud
- spring-cloud-starter-netflix-eureka-client
- ${spring.cloud.version}
+ spring-cloud-netflix-eureka-client
+ 2.0.0.RELEASE
@@ -194,22 +107,6 @@
org.apache.logging.log4j
log4j-to-slf4j
-
- spring-beans
- org.springframework
-
-
- spring-context
- org.springframework
-
-
- spring-boot-starter-logging
- org.springframework.boot
-
-
- spring-aop
- org.springframework
-
@@ -219,50 +116,28 @@
${spring.boot.version}
+
+
org.springframework.boot
spring-boot-starter-cache
${spring.boot.version}
-
org.springframework.boot
spring-boot-starter-thymeleaf
${spring.boot.version}
-
org.springframework.boot
spring-boot-starter-mail
${spring.boot.version}
-
- org.springframework.boot
- spring-boot-autoconfigure
- ${spring.boot.version}
-
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.boot
- spring-boot-starter-logging
-
-
- spring-aop
- org.springframework
-
-
- ${spring.boot.version}
-
-
com.github.ben-manes.caffeine
caffeine
- ${caffeine.version}
+ 2.6.2
@@ -275,25 +150,13 @@
org.springframework
spring-context-support
- ${spring.version}
-
-
-
- org.springframework
- spring-aop
- ${spring.version}
-
-
-
- org.springframework
- spring-web
- ${spring.version}
+ 5.0.8.RELEASE
org.quartz-scheduler
quartz
- 2.3.2
+ 2.3.0
com.zaxxer
@@ -305,7 +168,7 @@
org.mybatis.spring.boot
mybatis-spring-boot-starter
- 2.1.2
+ 1.3.2
@@ -314,41 +177,40 @@
2.9.9
+
+ org.yaml
+ snakeyaml
+ 1.19
+
+
com.fasterxml.jackson.core
jackson-databind
- 2.11.0
+ 2.9.6
com.google.guava
guava
- 28.2-jre
-
-
-
-
- org.scala-lang
- scala-library
- ${scala.version}
+ 19.0
- org.scala-lang
- scala-compiler
- ${scala.version}
-
-
-
- org.scala-lang
- scala-reflect
- ${scala.version}
+ io.springfox
+ springfox-swagger2
+ 2.6.1
+
+
+ guava
+ com.google.guava
+
+
- org.scala-lang
- scalap
- ${scala.version}
+ io.springfox
+ springfox-swagger-ui
+ 2.6.1
@@ -374,7 +236,6 @@
mysql-connector-java
5.1.44
-
com.alibaba
druid
@@ -404,10 +265,14 @@
+
+
+
+
com.alibaba
fastjson
- 1.2.83
+ 1.2.58
@@ -419,13 +284,13 @@
org.apache.poi
poi
- ${poi.version}
+ 3.9
org.apache.poi
poi-ooxml
- ${poi.version}
+ 3.9
@@ -591,18 +456,86 @@
commons-email
1.4
+
+
+ org.apache.hive
+ hive-jdbc
+ 1.2.1
+
+
+ jetty-all
+ org.eclipse.jetty.aggregate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
- 1.8
- 1.8
-
-
org.apache.maven.plugins
maven-dependency-plugin
@@ -634,7 +567,6 @@
net.alchim31.maven
scala-maven-plugin
- 3.2.2
scala-compile-first
@@ -659,6 +591,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/auth/ProjectAuth.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/auth/ProjectAuth.java
deleted file mode 100644
index 614429bb1..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/auth/ProjectAuth.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.auth;
-
-public interface ProjectAuth {
- boolean isPorjectOwner(Long projectId, Long userId);
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/auth/ProjectAuthImpl.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/auth/ProjectAuthImpl.java
deleted file mode 100644
index 7e92e3a39..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/auth/ProjectAuthImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.auth;
-
-import com.webank.wedatasphere.dss.visualis.configuration.CommonConfig;
-import edp.davinci.dao.ProjectMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class ProjectAuthImpl implements ProjectAuth {
-
- private static final Boolean CHECK_PROJECT_USER = (Boolean) CommonConfig.CHECK_PROJECT_USER().getValue();
-
- @Autowired
- private ProjectMapper projectMapper;
-
- @Override
- public boolean isPorjectOwner(Long projectId, Long userId) {
- if(CHECK_PROJECT_USER) {
- Integer projectUserId = projectMapper.getProjectUserId(projectId);
- if(null == projectUserId) {
- return false;
- }
- if(projectUserId.intValue() == userId.intValue()) {
- return true;
- } else {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/CommonContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/CommonContant.java
deleted file mode 100644
index 80ba9d162..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/CommonContant.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class CommonContant {
- public static String URL = "url";
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/DashboardContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/DashboardContant.java
deleted file mode 100644
index 8751bce75..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/DashboardContant.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class DashboardContant {
-
- public static String DASHBOARD_ID = "dashboardId";
-
- public static String DASHBOARD = "dashboard";
-
- public static String NAME = "name";
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/DisplayContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/DisplayContant.java
deleted file mode 100644
index 54d52416d..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/DisplayContant.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class DisplayContant {
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/ProjectContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/ProjectContant.java
deleted file mode 100644
index 14c5b0e58..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/ProjectContant.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class ProjectContant {
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/SourceContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/SourceContant.java
deleted file mode 100644
index c9c585831..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/SourceContant.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class SourceContant {
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/UserContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/UserContant.java
deleted file mode 100644
index 5acb97fe2..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/UserContant.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class UserContant {
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/ViewContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/ViewContant.java
deleted file mode 100644
index f615c0a4d..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/ViewContant.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class ViewContant {
-
- public static String VIEW_ID = "viewId";
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/WidgetContant.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/WidgetContant.java
deleted file mode 100644
index e6b97b628..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/content/WidgetContant.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.content;
-
-public class WidgetContant {
-
- public static String WIDGET_CONFIG_TEMPLATE = "{${context_info}\"data\":[],\"cols\":[],\"rows\":[]," +
- "\"metrics\":[],\"filters\":[],\"color\":{\"title\":\"颜色\",\"type\":\"category\"," +
- "\"value\":{\"all\":\"#509af2\"},\"items\":[]},\"chartStyles\":{\"pivot\":{\"fontFamily\":\"PingFang SC\"," +
- "\"fontSize\":\"12\",\"color\":\"#666\",\"lineStyle\":\"solid\",\"lineColor\":\"#D9D9D9\"," +
- "\"headerBackgroundColor\":\"#f7f7f7\"}},\"selectedChart\":1,\"pagination\":{\"pageNo\":0," +
- "\"pageSize\":0,\"withPaging\":false,\"totalCount\":0},\"renderType\":\"clear\",\"orders\":[]," +
- "\"mode\":\"pivot\",\"model\":${model_content},\"controls\":[],\"computed\":[],\"cache\":false,\"expired\":300,\"autoLoadData\":true}";
-
- public static String WIDGET_CHART_CONFIG_TEMPLE = "{${context_info}\"data\":[],\"pagination\":{\"pageNo\":0," +
- "\"pageSize\":0,\"totalCount\":0,\"withPaging\":false}," +
- "\"cols\":[],\"rows\":[],\"metrics\":[],\"secondaryMetrics\":[]," +
- "\"filters\":[],\"chartStyles\":{\"pivot\":{\"fontFamily\":\"PingFangSC\"," +
- "\"fontSize\":\"12\",\"color\":\"#666\",\"lineStyle\":\"solid\"," +
- "\"lineColor\":\"#D9D9D9\",\"headerBackgroundColor\":\"#f7f7f7\"}," +
- "\"table\":{\"fontFamily\":\"PingFangSC\",\"fontSize\":\"12\"," +
- "\"color\":\"#666\",\"lineStyle\":\"solid\",\"lineColor\":\"#D9D9D9\"," +
- "\"headerBackgroundColor\":\"#f7f7f7\",\"headerConfig\":[],\"columnsConfig\":[]," +
- "\"leftFixedColumns\":[],\"rightFixedColumns\":[],\"headerFixed\":true," +
- "\"autoMergeCell\":false,\"bordered\":true,\"size\":\"small\",\"withPaging\":true," +
- "\"pageSize\":\"5000\",\"withNoAggregators\":false}},\"selectedChart\":1," +
- "\"orders\":[],\"mode\":\"chart\",\"model\":${model_content},\"controls\":[],\"computed\":[]," +
- "\"cache\":false,\"expired\":300,\"autoLoadData\":true,\"query\":null}";
-
- public static String WIDGET_ID = "widgetId";
-
- public static String NAME = "name";
-
- public static String WIDGET = "widget";
-
- public static String WIDGETS = "widgets";
-
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/enums/ModuleEnum.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/enums/ModuleEnum.java
deleted file mode 100644
index 3f3a78db6..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/enums/ModuleEnum.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.enums;
-
-import java.util.Arrays;
-
-public enum ModuleEnum {
-
- DASHBOARD_PORTAL_IDS("dashboardPortalIds", "DASHBOARD ids"),
-
- DISPLAY_IDS("displayIds", "DISPLAY ids"),
-
- WIDGET_IDS("widgetIds", "WIDGET ids"),
-
- VIEW_IDS("viewIds", "VIEW ids");
-
- private String name;
- private String desc;
-
- ModuleEnum(String name, String desc) {
- this.name = name;
- this.desc = desc;
- }
-
- public static ModuleEnum getEnum(String name) {
- return Arrays.stream(ModuleEnum.values()).filter(e -> e.getName().equals(name)).findFirst().orElseThrow(NullPointerException::new);
- }
-
- public String getName() {
- return name;
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/exception/VGErrorException.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/exception/VGErrorException.java
index 3c748133c..c45f71303 100644
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/exception/VGErrorException.java
+++ b/server/src/main/java/com/webank/wedatasphere/dss/visualis/exception/VGErrorException.java
@@ -1,8 +1,27 @@
+/*
+ * Copyright 2019 WeBank
+ *
+ * Licensed 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.
+ *
+ */
package com.webank.wedatasphere.dss.visualis.exception;
-import org.apache.linkis.common.exception.ErrorException;
+import com.webank.wedatasphere.linkis.common.exception.ErrorException;
-public class VGErrorException extends ErrorException {
+/**
+ * Created by johnnwang on 2019/1/23.
+ */
+public class VGErrorException extends ErrorException {
public VGErrorException(int errCode, String desc) {
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/ModifyHttpRequestWrapper.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/ModifyHttpRequestWrapper.java
deleted file mode 100644
index 6198b4fc5..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/ModifyHttpRequestWrapper.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.integration;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import java.util.*;
-
-/**
- * 用来将DSS请求提供的cookie信息复制到visualis侧的cookie中
- */
-public class ModifyHttpRequestWrapper extends HttpServletRequestWrapper {
-
- Logger logger = LoggerFactory.getLogger(ModifyHttpRequestWrapper.class);
-
- private Map mapCookies;
-
- ModifyHttpRequestWrapper(HttpServletRequest request) {
- super(request);
- logger.info("Wrapper the request sent by DSS appconn.");
- this.mapCookies = new HashMap<>();
- }
-
- void putCookie(String name, String value) {
- logger.info("Wrapper the request sent by DSS appconn, And put cookie.");
- this.mapCookies.put(name, value);
- }
- public Cookie[] getCookies() {
- logger.info("Wrapper the request sent by DSS appconn, And get cookie.");
- HttpServletRequest request = (HttpServletRequest) getRequest();
- Cookie[] cookies = request.getCookies();
- if (mapCookies == null || mapCookies.isEmpty()) {
- return cookies;
- }
- if (cookies == null || cookies.length == 0) {
- List cookieList = new LinkedList<>();
- for (Map.Entry entry : mapCookies.entrySet()) {
- String key = entry.getKey();
- if (key != null && !"".equals(key)) {
- cookieList.add(new Cookie(key, entry.getValue()));
- }
- }
- if (cookieList.isEmpty()) {
- return cookies;
- }
- return cookieList.toArray(new Cookie[cookieList.size()]);
- } else {
- List cookieList = new ArrayList<>(Arrays.asList(cookies));
- for (Map.Entry entry : mapCookies.entrySet()) {
- String key = entry.getKey();
- if (key != null && !"".equals(key)) {
- for (int i = 0; i < cookieList.size(); i++) {
- if(cookieList.get(i).getName().equals(key)){
- cookieList.remove(i);
- }
- }
- cookieList.add(new Cookie(key, entry.getValue()));
- }
- }
- return cookieList.toArray(new Cookie[cookieList.size()]);
- }
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisProjectAuthInterceptor.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisProjectAuthInterceptor.java
deleted file mode 100644
index 3bdb5c823..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisProjectAuthInterceptor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.integration;
-
-import com.webank.wedatasphere.dss.standard.app.structure.project.plugin.filter.AbstractProjectAuthInterceptor;
-import com.webank.wedatasphere.dss.standard.app.structure.project.plugin.filter.ProjectRequestType;
-import org.springframework.stereotype.Component;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Component
-public class VisualisProjectAuthInterceptor extends AbstractProjectAuthInterceptor {
-
- @Override
- public boolean isProjectRequest(HttpServletRequest request) {
- return true;
- }
-
- @Override
- protected Object getForbiddenMsg(String s) {
- return s;
- }
-
- @Override
- public String getProjectId(HttpServletRequest httpServletRequest) {
- return null;
- }
-
- @Override
- public String getProjectName(HttpServletRequest httpServletRequest) {
- return null;
- }
-
- @Override
- public ProjectRequestType getProjectRequestType(HttpServletRequest httpServletRequest) {
- if("GET".equalsIgnoreCase(httpServletRequest.getMethod())){
- return ProjectRequestType.Access;
- } else if ("PUT".equalsIgnoreCase(httpServletRequest.getMethod())) {
- return ProjectRequestType.Edit;
- } else if ("DELETE".equalsIgnoreCase(httpServletRequest.getMethod())){
- return ProjectRequestType.Delete;
- } else {
- return ProjectRequestType.Execute;
- }
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisSSOFilterInitializer.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisSSOFilterInitializer.java
deleted file mode 100644
index f35ada2cc..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisSSOFilterInitializer.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.integration;
-
-import com.webank.wedatasphere.dss.standard.app.sso.origin.filter.spring.SpringOriginSSOPluginFilter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.WebApplicationInitializer;
-
-import javax.servlet.FilterRegistration;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-/**
- * 将DSS提供的SSO Filter加入Visualis的HTTP请求处理的链路中
- * */
-public class VisualisSSOFilterInitializer implements WebApplicationInitializer {
- Logger logger = LoggerFactory.getLogger(VisualisSSOFilterInitializer.class);
-
- @Override
- public void onStartup(ServletContext servletContext) throws ServletException {
- logger.info("Add DSS filter to the request processing of visualis.");
- FilterRegistration.Dynamic myFilter = servletContext.addFilter("dssSSOFilter", SpringOriginSSOPluginFilter.class);
- myFilter.addMappingForUrlPatterns(null, false, "/*");
- }
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisUserInterceptor.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisUserInterceptor.java
deleted file mode 100644
index 8638f98e8..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/integration/VisualisUserInterceptor.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.integration;
-
-import com.webank.wedatasphere.dss.standard.app.sso.builder.DssMsgBuilderOperation;
-import com.webank.wedatasphere.dss.standard.app.sso.plugin.filter.HttpRequestUserInterceptor;
-import org.springframework.stereotype.Component;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Map;
-
-/**
- * 用来操作HTTP session中的用户信息
- * */
-@Component
-public class VisualisUserInterceptor implements HttpRequestUserInterceptor {
-
- public void addUserToSession(String username, HttpServletRequest httpServletRequest) {
- httpServletRequest.setAttribute("dss-user", username);
- }
-
- public HttpServletRequest wrapRequest(DssMsgBuilderOperation.DSSMsg dssMsg, HttpServletRequest httpServletRequest) {
- ModifyHttpRequestWrapper requestWrapper = new ModifyHttpRequestWrapper(httpServletRequest);
- for (Map.Entry cookies : dssMsg.getCookies().entrySet()) {
- requestWrapper.putCookie(cookies.getKey(), cookies.getValue());
- }
- return requestWrapper;
- }
-
- @Override
- public boolean isUserExistInSession(HttpServletRequest httpServletRequest) {
- return httpServletRequest.getAttribute("dss-user") != null;
- }
-
- @Override
- public String getUser(HttpServletRequest httpServletRequest) {
- return (String) httpServletRequest.getAttribute("dss-user");
- }
-
-
- @Override
- public HttpServletRequest addUserToRequest(String user, HttpServletRequest httpServletRequest){
- return httpServletRequest;
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/DWCResultInfo.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/DWCResultInfo.java
index aa62841b7..b14844f66 100644
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/DWCResultInfo.java
+++ b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/DWCResultInfo.java
@@ -1,13 +1,32 @@
+/*
+ * Copyright 2019 WeBank
+ *
+ * Licensed 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.
+ *
+ */
package com.webank.wedatasphere.dss.visualis.model;
+/**
+ * Created by johnnwang on 2019/1/24.
+ */
public class DWCResultInfo {
- private String fileName;
+ private String fileName;
private String executionCode;
private String resultPath;
- private int resultNumber;
+ private int resultNumber;
private String runType;
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/EmailInfo.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/EmailInfo.java
index 14ac773fe..9f6990b64 100644
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/EmailInfo.java
+++ b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/EmailInfo.java
@@ -1,5 +1,22 @@
+/*
+ * Copyright 2019 WeBank
+ *
+ * Licensed 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.
+ *
+ */
package com.webank.wedatasphere.dss.visualis.model;
+
public class EmailInfo {
private String cc;
private String to;
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/HiveSource.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/HiveSource.java
index 7793fa248..d712d3e72 100644
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/HiveSource.java
+++ b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/HiveSource.java
@@ -1,10 +1,31 @@
+/*
+ * Copyright 2019 WeBank
+ *
+ * Licensed 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.
+ *
+ */
package com.webank.wedatasphere.dss.visualis.model;
+
import com.alibaba.fastjson.JSONObject;
import edp.davinci.model.Source;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
+/**
+ * created by cooperyang on 2019/1/24
+ * Description:
+ */
@Slf4j
@Data
public class HiveSource extends Source {
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/PaginateWithExecStatus.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/PaginateWithExecStatus.java
deleted file mode 100644
index 430767991..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/PaginateWithExecStatus.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model;
-
-import org.apache.linkis.scheduler.queue.SchedulerEventState;
-import edp.core.model.PaginateWithQueryColumns;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class PaginateWithExecStatus extends PaginateWithQueryColumns {
- private String execId = "";
- private String status = SchedulerEventState.Inited().toString();
- private float progress = -1;
-
- public String getExecId() {
- return execId;
- }
-
- public void setExecId(String execId) {
- this.execId = execId;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public float getProgress() {
- return progress;
- }
-
- public void setProgress(float progress) {
- this.progress = progress;
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/hivemodel/HiveDBModel.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/hivemodel/HiveDBModel.java
deleted file mode 100644
index 61b5c5936..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/hivemodel/HiveDBModel.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model.hivemodel;
-
-import java.util.List;
-
-public class HiveDBModel extends HiveModel {
- public static class HiveDB {
- private String dbName;
-
- public String getDbName() {
- return dbName;
- }
-
- public void setDbName(String dbName) {
- this.dbName = dbName;
- }
- }
-
- public static class Data {
- private List dbs;
-
- public List getDbs() {
- return dbs;
- }
-
- public void setDbs(List dbs) {
- this.dbs = dbs;
- }
- }
-
- private Data data;
-
-
- public Data getData() {
- return data;
- }
-
- public void setData(Data data) {
- this.data = data;
- }
-}
-
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/hivemodel/HiveModel.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/hivemodel/HiveModel.java
deleted file mode 100644
index 0f4250daf..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/hivemodel/HiveModel.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model.hivemodel;
-
-public abstract class HiveModel {
- private String method;
- private int status;
- private String message;
-
- public String getMethod() {
- return method;
- }
-
- public void setMethod(String method) {
- this.method = method;
- }
-
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-}
-
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/ExportedProject.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/ExportedProject.java
deleted file mode 100644
index f04c86abc..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/ExportedProject.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model.optmodel;
-
-import edp.davinci.model.*;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class ExportedProject {
- String name;
- List sources;
- List views;
- List widgets;
- List displays;
- List dashboardPortals;
-
-}
\ No newline at end of file
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/IdCatalog.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/IdCatalog.java
deleted file mode 100644
index dcef940b7..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/IdCatalog.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model.optmodel;
-
-import com.google.common.collect.Maps;
-
-import java.util.Map;
-
-public class IdCatalog {
- private Map source = Maps.newHashMap();
- private Map view = Maps.newHashMap();
- private Map widget = Maps.newHashMap();
- private Map display = Maps.newHashMap();
- private Map displaySlide = Maps.newHashMap();
- private Map memDisplaySlideWidget = Maps.newHashMap();
- private Map dashboardPortal = Maps.newHashMap();
- private Map dashboard = Maps.newHashMap();
- private Map memDashboardWidget = Maps.newHashMap();
-
- public Map getSource() {
- return source;
- }
-
- public void setSource(Map source) {
- this.source = source;
- }
-
- public Map getView() {
- return view;
- }
-
- public void setView(Map view) {
- this.view = view;
- }
-
- public Map getWidget() {
- return widget;
- }
-
- public void setWidget(Map widget) {
- this.widget = widget;
- }
-
- public Map getDisplay() {
- return display;
- }
-
- public void setDisplay(Map display) {
- this.display = display;
- }
-
- public Map getDisplaySlide() {
- return displaySlide;
- }
-
- public void setDisplaySlide(Map displaySlide) {
- this.displaySlide = displaySlide;
- }
-
- public Map getMemDisplaySlideWidget() {
- return memDisplaySlideWidget;
- }
-
- public void setMemDisplaySlideWidget(Map memDisplaySlideWidget) {
- this.memDisplaySlideWidget = memDisplaySlideWidget;
- }
-
- public Map getDashboardPortal() {
- return dashboardPortal;
- }
-
- public void setDashboardPortal(Map dashboardPortal) {
- this.dashboardPortal = dashboardPortal;
- }
-
- public Map getDashboard() {
- return dashboard;
- }
-
- public void setDashboard(Map dashboard) {
- this.dashboard = dashboard;
- }
-
- public Map getMemDashboardWidget() {
- return memDashboardWidget;
- }
-
- public void setMemDashboardWidget(Map memDashboardWidget) {
- this.memDashboardWidget = memDashboardWidget;
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDashboard.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDashboard.java
deleted file mode 100644
index 9d512c4b1..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDashboard.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model.optmodel;
-
-import edp.davinci.model.Dashboard;
-import edp.davinci.model.MemDashboardWidget;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class PlainDashboard {
- Dashboard dashboard;
- List memDashboardWidgets;
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDashboardPortal.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDashboardPortal.java
deleted file mode 100644
index 4e08139c0..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDashboardPortal.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model.optmodel;
-
-import edp.davinci.model.DashboardPortal;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class PlainDashboardPortal {
- DashboardPortal dashboardPortal;
- List dashboards;
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDisplay.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDisplay.java
deleted file mode 100644
index f62ae94ee..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/model/optmodel/PlainDisplay.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.model.optmodel;
-
-import edp.davinci.model.Display;
-import edp.davinci.model.DisplaySlide;
-import edp.davinci.model.MemDisplaySlideWidget;
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class PlainDisplay {
- Display display;
- DisplaySlide displaySlide;
- List memDisplaySlideWidgets;
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/generator/StatementGenerator.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/generator/StatementGenerator.java
deleted file mode 100644
index 091efde3a..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/generator/StatementGenerator.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.generator;
-
-import com.webank.wedatasphere.dss.visualis.query.model.VirtualView;
-import edp.davinci.dto.viewDto.DistinctParam;
-import edp.davinci.dto.viewDto.ViewExecuteParam;
-import edp.davinci.model.User;
-
-public interface StatementGenerator {
-
- String generate(VirtualView virtualView, ViewExecuteParam executeParam, User user);
-
- String generateDistinct(VirtualView virtualView, DistinctParam param, User user);
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/generator/VirtualSqlStatementGenerator.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/generator/VirtualSqlStatementGenerator.java
deleted file mode 100644
index 73f5e5e19..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/generator/VirtualSqlStatementGenerator.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.generator;
-
-import com.alibaba.druid.util.StringUtils;
-import com.alibaba.fastjson.JSON;
-import com.webank.wedatasphere.dss.visualis.query.model.VirtualView;
-import com.webank.wedatasphere.dss.visualis.query.utils.ChartUtils;
-import com.webank.wedatasphere.dss.visualis.utils.VisualisUtils;
-import edp.core.consts.Consts;
-import edp.core.utils.CollectionUtils;
-import edp.core.utils.SqlUtils;
-import edp.davinci.core.common.Constants;
-import edp.davinci.core.model.SqlEntity;
-import edp.davinci.core.model.SqlFilter;
-import edp.davinci.core.utils.SqlParseUtils;
-import edp.davinci.dao.SourceMapper;
-import edp.davinci.dto.viewDto.DistinctParam;
-import edp.davinci.dto.viewDto.ViewExecuteParam;
-import edp.davinci.model.Source;
-import edp.davinci.model.SqlVariable;
-import edp.davinci.model.User;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-import org.stringtemplate.v4.ST;
-import org.stringtemplate.v4.STGroup;
-import org.stringtemplate.v4.STGroupFile;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static edp.core.consts.Consts.MINUS;
-
-@Slf4j
-@Component
-public class VirtualSqlStatementGenerator implements StatementGenerator {
-
- @Autowired
- private SqlUtils sqlUtils;
-
- @Autowired
- private SqlParseUtils sqlParseUtils;
-
- @Autowired
- private SourceMapper sourceMapper;
-
- @Value("${sql_template_delimiter:$}")
- private String sqlTempDelimiter;
-
- @Override
- public String generate(VirtualView virtualView, ViewExecuteParam executeParam, User user) {
- ChartUtils.processViewExecuteParam(executeParam);
- List variables = virtualView.getVariables();
- //解析sql
- SqlEntity sqlEntity = sqlParseUtils.parseSql(virtualView.getSql(), variables, sqlTempDelimiter);
- //列权限(只记录被限制访问的字段)
- Set excludeColumns = new HashSet<>();
- String srcSql = sqlParseUtils.replaceParams(sqlEntity.getSql(), sqlEntity.getQuaryParams(), sqlEntity.getAuthParams(), sqlTempDelimiter, user);
-
- List executeSqlList = sqlParseUtils.getSqls(srcSql, false);
- List querySqlList = sqlParseUtils.getSqls(srcSql, true);
-
- if (!CollectionUtils.isEmpty(querySqlList)) {
-
- if (null != executeParam
- && null != executeParam.getCache()
- && executeParam.getCache()
- && executeParam.getExpired() > 0L) {
-
- StringBuilder slatBuilder = new StringBuilder();
- slatBuilder.append(executeParam.getPageNo());
- slatBuilder.append(MINUS);
- slatBuilder.append(executeParam.getLimit());
- slatBuilder.append(MINUS);
- slatBuilder.append(executeParam.getPageSize());
- excludeColumns.forEach(slatBuilder::append);
-
- }
-
- }
- buildQuerySql(querySqlList, executeParam);
- return String.join(Consts.SEMICOLON, querySqlList);
- }
-
- @Override
- public String generateDistinct(VirtualView virtualView, DistinctParam param, User user) {
- List variables = virtualView.getVariables();
- SqlEntity sqlEntity = sqlParseUtils.parseSql(virtualView.getSql(), variables, sqlTempDelimiter);
- String srcSql = sqlParseUtils.replaceParams(sqlEntity.getSql(), sqlEntity.getQuaryParams(), sqlEntity.getAuthParams(), sqlTempDelimiter, user);
-
- Source source = sourceMapper.getById(VisualisUtils.getHiveDataSourceId());
-
- SqlUtils sqlUtils = this.sqlUtils.init(source);
-
- List executeSqlList = sqlParseUtils.getSqls(srcSql, false);
- List querySqlList = sqlParseUtils.getSqls(srcSql, true);
- if (!CollectionUtils.isEmpty(querySqlList)) {
- String cacheKey = null;
- if (null != param) {
- STGroup stg = new STGroupFile(Constants.SQL_TEMPLATE);
- ST st = stg.getInstanceOf("queryDistinctSql");
- st.add("columns", param.getColumns());
- st.add("filters", convertFilters(param.getFilters(), source));
- st.add("sql", querySqlList.get(querySqlList.size() - 1));
- st.add("keywordPrefix", SqlUtils.getKeywordPrefix(source.getJdbcUrl(), source.getDbVersion()));
- st.add("keywordSuffix", SqlUtils.getKeywordSuffix(source.getJdbcUrl(), source.getDbVersion()));
-
- String sql = st.render();
- querySqlList.set(querySqlList.size() - 1, sql);
- }
- }
- return String.join(Consts.SEMICOLON, querySqlList);
- }
-
-
- public void buildQuerySql(List querySqlList, ViewExecuteParam executeParam) {
- Source source = sourceMapper.getById(VisualisUtils.getHiveDataSourceId());
- if (null != executeParam) {
- //构造参数, 原有的被传入的替换
- STGroup stg = new STGroupFile(Constants.SQL_TEMPLATE);
- ST st = stg.getInstanceOf("querySql");
- st.add("nativeQuery", executeParam.isNativeQuery());
- st.add("groups", executeParam.getGroups());
-
- if (executeParam.isNativeQuery()) {
- st.add("aggregators", executeParam.getAggregators());
- } else {
- st.add("aggregators", executeParam.getAggregators(source.getJdbcUrl(), source.getDbVersion()));
- }
- st.add("orders", executeParam.getOrders(source.getJdbcUrl(), source.getDbVersion()));
- st.add("filters", convertFilters(executeParam.getFilters(), source));
- st.add("keywordPrefix", sqlUtils.getKeywordPrefix(source.getJdbcUrl(), source.getDbVersion()));
- st.add("keywordSuffix", sqlUtils.getKeywordSuffix(source.getJdbcUrl(), source.getDbVersion()));
-
- for (int i = 0; i < querySqlList.size(); i++) {
- st.add("sql", querySqlList.get(i));
- querySqlList.set(i, st.render());
- }
-
- }
- }
-
- public List convertFilters(List filterStrs, Source source) {
- List whereClauses = new ArrayList<>();
- List filters = new ArrayList<>();
- try {
- if (null == filterStrs || filterStrs.isEmpty()) {
- return null;
- }
-
- for (String str : filterStrs) {
- SqlFilter obj = JSON.parseObject(str, SqlFilter.class);
- if (!StringUtils.isEmpty(obj.getName())) {
- obj.setName(ViewExecuteParam.getField(obj.getName(), source.getJdbcUrl(), source.getDbVersion()));
- }
- filters.add(obj);
- }
- filters.forEach(filter -> whereClauses.add(SqlFilter.dealFilter(filter)));
-
- }catch (Exception e){
- log.error("convertFilters error . filterStrs = {}, source = {}, filters = {} , whereClauses = {} ",
- filterStrs, source, filters, whereClauses);
- throw e;
- }
- return whereClauses;
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/ContextSourceInitializer.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/ContextSourceInitializer.java
deleted file mode 100644
index 461660033..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/ContextSourceInitializer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.initializer;
-
-import com.webank.wedatasphere.dss.visualis.query.model.VirtualView;
-import com.webank.wedatasphere.dss.visualis.query.utils.QueryUtils;
-import org.apache.linkis.common.exception.ErrorException;
-import org.apache.linkis.cs.common.exception.CSErrorException;
-import edp.davinci.model.User;
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ContextSourceInitializer implements SourceInitializer{
-
- private static final Logger logger = LoggerFactory.getLogger(ContextSourceInitializer.class);
-
- @Override
- public SourceInitJob init(VirtualView virtualView, User user) throws ErrorException {
- SourceInitJob sourceInitJob = null;
- try {
- QueryUtils.refreshFromContext(virtualView);
- } catch (CSErrorException e) {
- logger.error("Failed to refresh metadata:", e);
- }
-
- String tableName = virtualView.getSource().getDataSourceContent().get("tableName");
- String dbName = virtualView.getSource().getDataSourceContent().get("dbName");
- String fullName = StringUtils.isBlank(dbName) ? tableName : dbName + "." + tableName;
- String selectFrom = "select * from " + fullName;
- virtualView.setSql(selectFrom);
- return sourceInitJob;
- }
-
- @Override
- public String getType() {
- return "context";
- }
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/ResultSetSourceInitializer.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/ResultSetSourceInitializer.java
deleted file mode 100644
index c2977cc62..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/ResultSetSourceInitializer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.initializer;
-
-import com.webank.wedatasphere.dss.visualis.query.model.VirtualView;
-import com.webank.wedatasphere.dss.visualis.query.utils.QueryUtils;
-import com.webank.wedatasphere.dss.visualis.res.ResultHelper;
-import com.webank.wedatasphere.dss.visualis.ujes.UJESJob;
-import edp.davinci.model.User;
-import org.springframework.stereotype.Component;
-
-
-@Component
-public class ResultSetSourceInitializer implements SourceInitializer{
-
- @Override
- public SourceInitJob init(VirtualView virtualView, User user) {
- String resultLocation = ResultHelper.getSchemaPath(virtualView.getSource().getDataSourceContent().get("resultLocation"));
- String tempViewName = "tmp_res_" + (virtualView.getName().hashCode() & Integer.MAX_VALUE);
- String selectFrom = "select * from " + tempViewName;
- virtualView.setSql(selectFrom);
- return new SourceInitJob(QueryUtils.getCreateTempViewScala(tempViewName, resultLocation), UJESJob.SCALA_TYPE());
- }
-
- @Override
- public String getType() {
- return "resultset";
- }
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/SourceInitJob.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/SourceInitJob.java
deleted file mode 100644
index 19e887833..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/SourceInitJob.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.initializer;
-
-import lombok.Data;
-
-@Data
-public class SourceInitJob {
-
- String scriptContent;
- String scriptType;
-
- public SourceInitJob(String scriptContent, String scriptType) {
- this.scriptContent = scriptContent;
- this.scriptType = scriptType;
- }
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/SourceInitializer.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/SourceInitializer.java
deleted file mode 100644
index a245c7c4c..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/SourceInitializer.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.initializer;
-
-import com.webank.wedatasphere.dss.visualis.query.model.VirtualView;
-import org.apache.linkis.common.exception.ErrorException;
-import edp.davinci.model.User;
-
-public interface SourceInitializer {
-
- SourceInitJob init(VirtualView virtualView, User user) throws ErrorException;
- String getType();
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/UrlSourceInitializer.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/UrlSourceInitializer.java
deleted file mode 100644
index 26c77c596..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/initializer/UrlSourceInitializer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.initializer;
-
-import com.webank.wedatasphere.dss.visualis.query.model.VirtualView;
-import com.webank.wedatasphere.dss.visualis.query.utils.QueryUtils;
-import com.webank.wedatasphere.dss.visualis.ujes.UJESJob;
-import edp.davinci.model.User;
-import org.apache.commons.lang.StringUtils;
-import org.apache.http.client.CookieStore;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.util.EntityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import java.io.IOException;
-
-@Component
-public class UrlSourceInitializer implements SourceInitializer {
-
- private static final Logger logger = LoggerFactory.getLogger(UrlSourceInitializer.class);
-
- @Override
- public SourceInitJob init(VirtualView virtualView, User user) {
- SourceInitJob sourceInitJob = null;
- CookieStore cookieStore = new BasicCookieStore();
- CloseableHttpClient httpClient = HttpClientBuilder.create().setDefaultCookieStore(cookieStore).build();
- HttpGet httpGet = new HttpGet(virtualView.getSource().getDataSourceContent().get("url"));
- String dolphinResult = "";
- try{
- CloseableHttpResponse response = httpClient.execute(httpGet);
- dolphinResult = EntityUtils.toString(response.getEntity(), "UTF-8");
- }catch(IOException e){
- logger.error("failed to download url data source, reason:" , e);
- }
- if(StringUtils.isNotBlank(dolphinResult)){
- String tempViewName = "tmp_url_" + virtualView.getName();
- sourceInitJob = new SourceInitJob(QueryUtils.getCreateTempViewScala(tempViewName, dolphinResult), UJESJob.SCALA_TYPE());
- String selectFrom = "select * from " + tempViewName;
- virtualView.setSql(selectFrom);
- }
- return sourceInitJob;
- }
-
- @Override
- public String getType() {
- return "url";
- }
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/model/VirtualSource.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/model/VirtualSource.java
deleted file mode 100644
index 4bddd054b..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/model/VirtualSource.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.model;
-
-import edp.davinci.model.Source;
-import lombok.Data;
-
-import java.util.Map;
-
-@Data
-public class VirtualSource extends Source {
-
- String engineType;
- String dataSourceType;
- Map dataSourceContent;
- String creator;
-
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/model/VirtualView.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/model/VirtualView.java
deleted file mode 100644
index 56e842243..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/model/VirtualView.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.model;
-
-import edp.davinci.model.View;
-import lombok.Data;
-
-import java.util.Map;
-
-@Data
-public class VirtualView extends View {
- VirtualSource source;
- Map params;
-}
diff --git a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/service/VirtualViewQueryService.java b/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/service/VirtualViewQueryService.java
deleted file mode 100644
index 52130ff15..000000000
--- a/server/src/main/java/com/webank/wedatasphere/dss/visualis/query/service/VirtualViewQueryService.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.webank.wedatasphere.dss.visualis.query.service;
-
-import edp.core.model.Paginate;
-import edp.davinci.dto.viewDto.DistinctParam;
-import edp.davinci.dto.viewDto.ViewExecuteParam;
-import edp.davinci.model.User;
-
-import java.util.List;
-import java.util.Map;
-
-public interface VirtualViewQueryService {
-
- Paginate