From 461d19d8f0f9d732244906e2eb479a785a54bb0e Mon Sep 17 00:00:00 2001 From: sinllychen Date: Thu, 19 Oct 2017 09:57:11 +0800 Subject: [PATCH] =?UTF-8?q?1.Release=20new=20features:=20ETL=E3=80=81Progr?= =?UTF-8?q?amable=20Script=E3=80=81Data=20Visualization=E3=80=81Run=20Hist?= =?UTF-8?q?ory=20Viewer=E3=80=81Administrator=20Search.=202.Adjust=20some?= =?UTF-8?q?=20code=20file=20format.=203.Imporve=20comments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mysql/bdajob.sql | 38 - mysql/main.sql | 26 +- mysql/oozieaction.sql | 56 - mysql/ooziejob.sql | 43 - mysql/readme.md | 2 - mysql/{ => studio}/account.sql | 4 +- mysql/studio/bdajob.sql | 39 + mysql/{ => studio}/category.sql | 12 +- mysql/{ => studio}/dataset.sql | 4 +- mysql/{ => studio}/jobcron.sql | 4 +- mysql/studio/moduleversion.sql | 30 + mysql/studio/oozieaction.sql | 85 + mysql/studio/ooziejob.sql | 42 + mysql/{ => studio}/program.sql | 27 +- mysql/{ => studio}/supernode.sql | 4 +- mysql/test/titanic_train.sql | 930 + pom.xml | 15 + .../studio/client/OozieConnectionFactory.java | 22 +- .../client/controller/DBController.java | 51 +- .../client/controller/DiagramController.java | 25 +- .../client/controller/LoginController.java | 288 +- .../client/controller/MonitorController.java | 616 +- .../eml/studio/client/event/CloneEvent.java | 41 +- .../client/event/HasConnectionEvent.java | 6 +- .../eml/studio/client/event/LoginEvent.java | 52 +- .../eml/studio/client/event/LogoutEvent.java | 34 +- .../studio/client/event/ToAccountEvent.java | 41 +- .../studio/client/event/ToMonitorEvent.java | 41 +- .../studio/client/event/ToRegisterEvent.java | 42 +- .../studio/client/graph/DiagramBuilder.java | 619 +- .../client/graph/OozieGraphBuilder.java | 248 +- .../studio/client/i18n/AccountUIMessages.java | 48 +- .../studio/client/i18n/AdminUIMessages.java | 108 +- .../eml/studio/client/i18n/Globalization.java | 62 +- .../studio/client/i18n/HeaderUIMessages.java | 28 +- .../eml/studio/client/i18n/LogUIMessages.java | 44 +- .../client/i18n/RegisterUIMessages.java | 41 +- .../client/i18n/ResetpwdUIMessages.java | 30 +- .../studio/client/i18n/StudioUIMessages.java | 204 +- .../eml/studio/client/mvp/AppController.java | 271 +- .../client/mvp/presenter/AccountLoader.java | 919 +- .../mvp/presenter/AccountPresenter.java | 621 +- .../client/mvp/presenter/AdminPresenter.java | 821 +- .../client/mvp/presenter/BdaJobMonitor.java | 371 +- .../client/mvp/presenter/CategoryLoader.java | 1251 +- .../client/mvp/presenter/DatasetLoader.java | 782 +- .../client/mvp/presenter/HeaderLoader.java | 296 +- .../mvp/presenter/MonitorPresenter.java | 369 +- .../client/mvp/presenter/Presenter.java | 2 +- .../client/mvp/presenter/ProgramLoader.java | 577 +- .../mvp/presenter/RegisterPresenter.java | 325 +- .../mvp/presenter/ResetpwdPresenter.java | 221 +- .../studio/client/mvp/view/AccountView.java | 455 +- .../studio/client/mvp/view/AccountView.ui.xml | 5 - .../eml/studio/client/mvp/view/AdminView.java | 785 +- .../studio/client/mvp/view/AdminView.ui.xml | 58 +- .../eml/studio/client/mvp/view/Generator.java | 54 +- .../studio/client/mvp/view/HeaderView.java | 227 +- .../studio/client/mvp/view/MonitorView.java | 528 +- .../studio/client/mvp/view/RegisterView.java | 259 +- .../studio/client/mvp/view/ResetpwdView.java | 5 + .../studio/client/resources/Resources.java | 14 +- .../eml/studio/client/rpc/AccountService.java | 137 +- .../client/rpc/AccountServiceAsync.java | 2 + .../studio/client/rpc/CategoryService.java | 78 +- .../client/rpc/CategoryServiceAsync.java | 6 +- .../eml/studio/client/rpc/ChartService.java | 39 + .../studio/client/rpc/ChartServiceAsync.java | 20 + .../client/rpc/DataAnalysisService.java | 59 + .../client/rpc/DataAnalysisServiceAsync.java | 24 + .../eml/studio/client/rpc/DatasetService.java | 234 +- .../client/rpc/DatasetServiceAsync.java | 55 +- .../eml/studio/client/rpc/ETLService.java | 69 + .../studio/client/rpc/ETLServiceAsync.java | 26 + .../eml/studio/client/rpc/JobService.java | 264 +- .../studio/client/rpc/JobServiceAsync.java | 63 +- .../eml/studio/client/rpc/MailService.java | 23 + .../studio/client/rpc/MailServiceAsync.java | 2 + .../eml/studio/client/rpc/ProgramService.java | 129 +- .../client/rpc/ProgramServiceAsync.java | 4 +- .../studio/client/ui/binding/TextBinder.java | 4 +- .../ui/binding/TextBinderGenerator.java | 362 +- .../studio/client/ui/charts/DrawBarChart.java | 67 + .../connection/CommonConnectionFactory.java | 17 +- .../client/ui/connection/Connection.java | 2 +- .../client/ui/menu/DatasetDeleteMenu.java | 62 +- .../client/ui/menu/DatasetDeprecateMenu.java | 58 +- .../client/ui/menu/DatasetDownloadMenu.java | 88 +- .../client/ui/menu/DatasetEditMenu.java | 28 +- .../client/ui/menu/DatasetUpdateMenu.java | 28 +- .../client/ui/menu/HasRightMouseUpMenu.java | 2 +- .../client/ui/menu/JobAddExampleMenu.java | 50 +- .../studio/client/ui/menu/JobDeleteMenu.java | 56 +- .../client/ui/menu/MenuItemCommand.java | 8 +- .../client/ui/menu/ProgramDeleteMenu.java | 62 +- .../client/ui/menu/ProgramDeprecateMenu.java | 60 +- .../client/ui/menu/ProgramDownloadMenu.java | 60 +- .../client/ui/menu/ProgramEditMenu.java | 28 +- .../client/ui/menu/ProgramUpdateMenu.java | 24 +- .../studio/client/ui/panel/AlertPanel.java | 80 +- .../eml/studio/client/ui/panel/BasePanel.java | 225 +- .../client/ui/panel/BasePopupPanel.java | 62 +- .../studio/client/ui/panel/CateAddPanel.java | 138 +- .../studio/client/ui/panel/CategoryPanel.java | 7 + .../client/ui/panel/DataTypeSelectPanel.java | 177 + .../client/ui/panel/DataVisualPopPanel.java | 570 + .../studio/client/ui/panel/DeletePanel.java | 74 +- .../studio/client/ui/panel/ETLPopPanel.java | 344 + .../client/ui/panel/EditDatasetPanel.java | 48 +- .../client/ui/panel/EditProgramPanel.java | 66 +- .../studio/client/ui/panel/Grid/ETLGrid.java | 34 + .../client/ui/panel/Grid/HiveETLGrid.java | 30 + .../ui/panel/Grid/MonitorJobDescGrid.java | 2 - .../client/ui/panel/Grid/SearchGrid.java | 240 +- .../client/ui/panel/Grid/SqlETLGrid.java | 72 + .../client/ui/panel/HistoryPopupPanel.java | 598 + .../client/ui/panel/JobDescPopupPanel.java | 190 +- .../studio/client/ui/panel/LoginPanel.java | 242 +- .../client/ui/panel/ParameterPopupPanel.java | 70 +- .../client/ui/panel/PreviewPopupPanel.java | 8 +- .../studio/client/ui/panel/RegisterPanel.java | 188 +- .../studio/client/ui/panel/ResetpwdPanel.java | 170 +- .../client/ui/panel/SaveDatasetPanel.java | 97 +- .../eml/studio/client/ui/panel/StdPanel.java | 80 +- .../client/ui/panel/UpdateDatasetPanel.java | 254 +- .../client/ui/panel/UpdateProgramPanel.java | 260 +- .../client/ui/panel/UploadDatasetPanel.java | 49 +- .../client/ui/panel/UploadProgramPanel.java | 192 +- .../ui/panel/Uploader/FileUploader.java | 260 +- .../ui/panel/Uploader/UpdateFileModule.java | 92 +- .../ui/panel/Uploader/UploadFileModule.java | 82 +- .../ui/panel/component/DescCmdPanel.java | 445 +- .../ui/panel/component/DescListBox.java | 60 +- .../client/ui/panel/component/DescWidget.java | 4 +- .../ui/panel/component/DescribeGrid.java | 456 +- .../ui/property/DatasetPropertyTable.java | 64 +- .../ui/property/ProgramPropertyTable.java | 54 +- .../studio/client/ui/property/Property.java | 92 +- .../client/ui/property/PropertyTable.java | 54 +- .../eml/studio/client/ui/tree/BaseTree.java | 34 +- .../client/ui/tree/CopyOfModuleTree.java | 142 +- .../client/ui/tree/DatasetCateTreeLoader.java | 74 +- .../client/ui/tree/DatasetCategoryTree.java | 10 +- .../studio/client/ui/tree/DatasetLeaf.java | 14 +- .../client/ui/tree/DatasetModuleTree.java | 258 +- .../studio/client/ui/tree/DatasetTree.java | 10 +- .../client/ui/tree/DatasetTreeLoader.java | 171 +- .../eml/studio/client/ui/tree/JobLeaf.java | 54 +- .../eml/studio/client/ui/tree/JobTree.java | 206 +- .../java/eml/studio/client/ui/tree/Leaf.java | 124 +- .../client/ui/tree/ProgramCateTreeLoader.java | 76 +- .../client/ui/tree/ProgramCategoryTree.java | 10 +- .../studio/client/ui/tree/ProgramLeaf.java | 22 +- .../client/ui/tree/ProgramModuleTree.java | 259 +- .../studio/client/ui/tree/ProgramTree.java | 26 +- .../client/ui/tree/ProgramTreeLoader.java | 179 +- .../eml/studio/client/ui/tree/SearchTree.java | 84 +- .../client/ui/tree/TreeImageResources.java | 24 +- .../studio/client/ui/widget/BaseWidget.java | 187 +- .../ui/widget/BaseWidgetMenuItemFactory.java | 240 +- .../ui/widget/DisclosureStackPanel.java | 26 +- .../widget/command/CommandParseException.java | 6 +- .../ui/widget/command/CommandParser.java | 25 +- .../client/ui/widget/command/Commander.java | 2 +- .../ui/widget/command/FileDescription.java | 90 +- .../client/ui/widget/command/FileHolder.java | 2 +- .../client/ui/widget/command/Parameter.java | 136 +- .../ui/widget/command/ScriptCommand.java | 81 + .../widget/command/ScriptFileDescription.java | 68 + .../ui/widget/command/ScriptHolder.java | 98 +- .../client/ui/widget/command/ValueCheck.java | 7 - .../ui/widget/dataset/DatasetWidget.java | 240 +- .../ui/widget/panel/CommonParameterPanel.java | 236 +- .../ui/widget/panel/FileConfigPanel.java | 42 + .../panel/InSqlScriptFileConfigTable.java | 40 + .../panel/OutSqlScriptFileConfigTable.java | 38 + .../ui/widget/panel/ParameterPanel.java | 92 +- .../ui/widget/panel/ScriptParameterPanel.java | 100 + .../panel/SqlScriptFileConfigTable.java | 135 + .../widget/panel/SqlScriptParameterPanel.java | 80 + .../client/ui/widget/panel/UpdateEvent.java | 68 +- .../client/ui/widget/panel/UpdateHandler.java | 2 +- .../widget/program/CommonProgramWidget.java | 102 +- .../ui/widget/program/ETLProgramConf.java | 87 + .../ui/widget/program/ETLProgramWidget.java | 50 + .../client/ui/widget/program/ProgramConf.java | 64 +- .../ui/widget/program/ProgramWidget.java | 510 +- .../ui/widget/program/ScriptProgramConf.java | 95 + .../widget/program/ScriptProgramWidget.java | 153 + .../ui/widget/program/SqlProgramWidget.java | 105 + .../widget/program/SqlScriptProgramConf.java | 118 + .../shape/BaseShapeMenuItemFactory.java | 72 + .../ui/widget/shape/ConnectionUtils.java | 632 +- .../client/ui/widget/shape/InNodeShape.java | 103 +- .../client/ui/widget/shape/MouseShape.java | 62 +- .../client/ui/widget/shape/NodeShape.java | 453 +- .../client/ui/widget/shape/OutNodeShape.java | 156 +- .../studio/client/ui/widget/shape/Point.java | 293 +- .../client/ui/widget/shape/Rectangle.java | 214 +- .../client/ui/widget/shape/Segment.java | 115 +- .../studio/client/ui/widget/shape/Shape.java | 82 +- .../ui/widget/shape/SqlInNodeShape.java | 37 + .../client/ui/widget/shape/SqlNodeShape.java | 14 + .../ui/widget/shape/SqlOutNodeShape.java | 36 + .../eml/studio/client/util/Constants.java | 24 +- .../eml/studio/client/util/Pagination.java | 196 + .../eml/studio/client/util/TimeUtils.java | 86 +- .../java/eml/studio/client/util/UUID.java | 66 +- .../java/eml/studio/client/util/Util.java | 124 +- .../studio/server/anotation/TableField.java | 2 +- .../eml/studio/server/constant/Constants.java | 108 +- .../java/eml/studio/server/db/BaseDao.java | 299 +- .../eml/studio/server/db/ETLDBService.java | 13 + .../java/eml/studio/server/db/HiveETL.java | 80 + .../java/eml/studio/server/db/SecureDao.java | 6 +- .../java/eml/studio/server/db/SqlETL.java | 125 + .../server/file/FileDownloadServlet.java | 30 +- .../studio/server/file/FileUploadServlet.java | 186 +- .../server/graph/OozieGraphXMLParser.java | 4 +- .../server/oozie/instance/OozieInstance.java | 39 +- .../server/oozie/workflow/ActionNodeDef.java | 6 +- .../server/oozie/workflow/ControlNodeDef.java | 7 +- .../server/oozie/workflow/EndNodeDef.java | 24 +- .../server/oozie/workflow/ForkNodeDef.java | 24 +- .../server/oozie/workflow/JoinNodeDef.java | 20 +- .../studio/server/oozie/workflow/NodeDef.java | 6 +- .../oozie/workflow/ShellActionNodeDef.java | 4 +- .../server/oozie/workflow/StartNodeDef.java | 20 +- .../server/oozie/workflow/WFBuilder.java | 80 +- .../studio/server/oozie/workflow/WFGraph.java | 47 +- .../studio/server/rpc/AccountServiceImpl.java | 880 +- .../server/rpc/CategoryServiceImpl.java | 362 +- .../studio/server/rpc/ChartServiceImpl.java | 318 + .../server/rpc/DataAnalysisServiceImpl.java | 304 + .../studio/server/rpc/DatasetServiceImpl.java | 876 +- .../eml/studio/server/rpc/ETLServiceImpl.java | 41 + .../eml/studio/server/rpc/JobServiceImpl.java | 459 +- .../studio/server/rpc/MailServiceImpl.java | 12 +- .../studio/server/rpc/ProgramServiceImpl.java | 684 +- .../server/statics/ThreadDataParser.java | 62 + .../studio/server/statics/ThreadUtils.java | 13 + .../eml/studio/server/util/DataParser.java | 159 + .../util/DistributedRunShellGenerator.java | 79 +- .../server/util/GenerateSequenceUtil.java | 84 +- .../java/eml/studio/server/util/HDFSIO.java | 663 +- .../java/eml/studio/server/util/JavaMail.java | 71 +- .../eml/studio/server/util/LinkUtils.java | 86 +- .../eml/studio/server/util/ModuleBuilder.java | 66 +- .../eml/studio/server/util/OozieUtil.java | 511 +- .../util/ProgramAbleRunShellGenerator.java | 75 + .../studio/server/util/RunShellGenerator.java | 108 +- .../eml/studio/server/util/TimeUtils.java | 116 +- .../java/eml/studio/server/util/XMLUtil.java | 276 +- .../util/typeparser/DefaultTypeParsers.java | 382 +- .../studio/server/util/typeparser/Main.java | 25 - .../util/typeparser/StringToTypeParser.java | 288 +- .../typeparser/StringToTypeParserBuilder.java | 50 +- .../server/util/typeparser/TypeParser.java | 4 +- .../studio/shared/graph/OozieDatasetNode.java | 68 +- .../eml/studio/shared/graph/OozieEdge.java | 11 +- .../eml/studio/shared/graph/OozieGraph.java | 12 +- .../eml/studio/shared/graph/OozieNode.java | 88 +- .../studio/shared/graph/OozieProgramNode.java | 41 +- .../java/eml/studio/shared/model/Account.java | 276 +- .../java/eml/studio/shared/model/BdaJob.java | 6 + .../eml/studio/shared/model/Category.java | 166 +- .../java/eml/studio/shared/model/Dataset.java | 99 +- .../java/eml/studio/shared/model/Module.java | 192 +- .../studio/shared/model/ModuleVersion.java | 32 +- .../java/eml/studio/shared/model/Program.java | 202 +- .../eml/studio/shared/oozie/OozieAction.java | 434 +- .../eml/studio/shared/oozie/OozieJob.java | 419 +- .../java/eml/studio/shared/script/Script.java | 70 +- .../eml/studio/shared/util/DataFeature.java | 94 + .../eml/studio/shared/util/DataTools.java | 54 + .../eml/studio/shared/util/DatasetType.java | 41 + .../eml/studio/shared/util/ProgramUtil.java | 94 +- .../client/i18n/AdminUIMessages.properties | 8 +- .../client/i18n/AdminUIMessages_cn.properties | 8 +- .../client/i18n/AdminUIMessages_en.properties | 8 +- .../client/i18n/StudioUIMessages.properties | 16 +- .../i18n/StudioUIMessages_cn.properties | 7 + .../i18n/StudioUIMessages_en.properties | 16 +- src/main/webapp/Dataflow_generator.css | 125 +- src/main/webapp/Dataflow_generator_mdj.css | 335 +- src/main/webapp/EMLStudio.html | 4 + src/main/webapp/WEB-INF/web.xml | 260 +- src/main/webapp/img/history-delete.png | Bin 0 -> 572 bytes src/main/webapp/img/history-view.png | Bin 0 -> 11157 bytes src/main/webapp/plugins/echarts/.DS_Store | Bin 0 -> 6148 bytes src/main/webapp/plugins/echarts/chart/bar.js | 1 + .../webapp/plugins/echarts/chart/chord.js | 1 + .../plugins/echarts/chart/eventRiver.js | 1 + .../webapp/plugins/echarts/chart/force.js | 1 + .../webapp/plugins/echarts/chart/funnel.js | 1 + .../webapp/plugins/echarts/chart/gauge.js | 1 + src/main/webapp/plugins/echarts/chart/k.js | 1 + src/main/webapp/plugins/echarts/chart/line.js | 1 + src/main/webapp/plugins/echarts/chart/map.js | 12 + src/main/webapp/plugins/echarts/chart/pie.js | 1 + .../webapp/plugins/echarts/chart/radar.js | 1 + .../webapp/plugins/echarts/chart/scatter.js | 1 + src/main/webapp/plugins/echarts/chart/tree.js | 1 + .../webapp/plugins/echarts/chart/treemap.js | 1 + src/main/webapp/plugins/echarts/chart/venn.js | 1 + .../webapp/plugins/echarts/chart/wordCloud.js | 2 + .../webapp/plugins/echarts/echarts-all.js | 35 + src/main/webapp/plugins/echarts/echarts.js | 15 + .../webapp/plugins/echarts/echarts_big.js | 23136 ++++++++++++++++ src/main/webapp/plugins/echarts/esl.js | 1780 ++ src/main/webapp/plugins/echarts/wordCloud.js | 2 + src/main/webapp/plugins/jquery-2.1.4.js | 9210 ++++++ 312 files changed, 59476 insertions(+), 15765 deletions(-) delete mode 100644 mysql/bdajob.sql delete mode 100644 mysql/oozieaction.sql delete mode 100644 mysql/ooziejob.sql delete mode 100644 mysql/readme.md rename mysql/{ => studio}/account.sql (98%) create mode 100644 mysql/studio/bdajob.sql rename mysql/{ => studio}/category.sql (89%) rename mysql/{ => studio}/dataset.sql (94%) rename mysql/{ => studio}/jobcron.sql (91%) create mode 100644 mysql/studio/moduleversion.sql create mode 100644 mysql/studio/oozieaction.sql create mode 100644 mysql/studio/ooziejob.sql rename mysql/{ => studio}/program.sql (52%) rename mysql/{ => studio}/supernode.sql (92%) create mode 100644 mysql/test/titanic_train.sql create mode 100644 src/main/java/eml/studio/client/rpc/ChartService.java create mode 100644 src/main/java/eml/studio/client/rpc/ChartServiceAsync.java create mode 100644 src/main/java/eml/studio/client/rpc/DataAnalysisService.java create mode 100644 src/main/java/eml/studio/client/rpc/DataAnalysisServiceAsync.java create mode 100644 src/main/java/eml/studio/client/rpc/ETLService.java create mode 100644 src/main/java/eml/studio/client/rpc/ETLServiceAsync.java create mode 100644 src/main/java/eml/studio/client/ui/charts/DrawBarChart.java create mode 100644 src/main/java/eml/studio/client/ui/panel/DataTypeSelectPanel.java create mode 100644 src/main/java/eml/studio/client/ui/panel/DataVisualPopPanel.java create mode 100644 src/main/java/eml/studio/client/ui/panel/ETLPopPanel.java create mode 100644 src/main/java/eml/studio/client/ui/panel/Grid/ETLGrid.java create mode 100644 src/main/java/eml/studio/client/ui/panel/Grid/HiveETLGrid.java create mode 100644 src/main/java/eml/studio/client/ui/panel/Grid/SqlETLGrid.java create mode 100644 src/main/java/eml/studio/client/ui/panel/HistoryPopupPanel.java create mode 100644 src/main/java/eml/studio/client/ui/widget/command/ScriptCommand.java create mode 100644 src/main/java/eml/studio/client/ui/widget/command/ScriptFileDescription.java create mode 100644 src/main/java/eml/studio/client/ui/widget/panel/FileConfigPanel.java create mode 100644 src/main/java/eml/studio/client/ui/widget/panel/InSqlScriptFileConfigTable.java create mode 100644 src/main/java/eml/studio/client/ui/widget/panel/OutSqlScriptFileConfigTable.java create mode 100644 src/main/java/eml/studio/client/ui/widget/panel/ScriptParameterPanel.java create mode 100644 src/main/java/eml/studio/client/ui/widget/panel/SqlScriptFileConfigTable.java create mode 100644 src/main/java/eml/studio/client/ui/widget/panel/SqlScriptParameterPanel.java create mode 100644 src/main/java/eml/studio/client/ui/widget/program/ETLProgramConf.java create mode 100644 src/main/java/eml/studio/client/ui/widget/program/ETLProgramWidget.java create mode 100644 src/main/java/eml/studio/client/ui/widget/program/ScriptProgramConf.java create mode 100644 src/main/java/eml/studio/client/ui/widget/program/ScriptProgramWidget.java create mode 100644 src/main/java/eml/studio/client/ui/widget/program/SqlProgramWidget.java create mode 100644 src/main/java/eml/studio/client/ui/widget/program/SqlScriptProgramConf.java create mode 100644 src/main/java/eml/studio/client/ui/widget/shape/BaseShapeMenuItemFactory.java create mode 100644 src/main/java/eml/studio/client/ui/widget/shape/SqlInNodeShape.java create mode 100644 src/main/java/eml/studio/client/ui/widget/shape/SqlNodeShape.java create mode 100644 src/main/java/eml/studio/client/ui/widget/shape/SqlOutNodeShape.java create mode 100644 src/main/java/eml/studio/client/util/Pagination.java create mode 100644 src/main/java/eml/studio/server/db/ETLDBService.java create mode 100644 src/main/java/eml/studio/server/db/HiveETL.java create mode 100644 src/main/java/eml/studio/server/db/SqlETL.java create mode 100644 src/main/java/eml/studio/server/rpc/ChartServiceImpl.java create mode 100644 src/main/java/eml/studio/server/rpc/DataAnalysisServiceImpl.java create mode 100644 src/main/java/eml/studio/server/rpc/ETLServiceImpl.java create mode 100644 src/main/java/eml/studio/server/statics/ThreadDataParser.java create mode 100644 src/main/java/eml/studio/server/statics/ThreadUtils.java create mode 100644 src/main/java/eml/studio/server/util/DataParser.java create mode 100644 src/main/java/eml/studio/server/util/ProgramAbleRunShellGenerator.java delete mode 100644 src/main/java/eml/studio/server/util/typeparser/Main.java create mode 100644 src/main/java/eml/studio/shared/util/DataFeature.java create mode 100644 src/main/java/eml/studio/shared/util/DataTools.java create mode 100644 src/main/java/eml/studio/shared/util/DatasetType.java create mode 100644 src/main/webapp/img/history-delete.png create mode 100644 src/main/webapp/img/history-view.png create mode 100644 src/main/webapp/plugins/echarts/.DS_Store create mode 100644 src/main/webapp/plugins/echarts/chart/bar.js create mode 100644 src/main/webapp/plugins/echarts/chart/chord.js create mode 100644 src/main/webapp/plugins/echarts/chart/eventRiver.js create mode 100644 src/main/webapp/plugins/echarts/chart/force.js create mode 100644 src/main/webapp/plugins/echarts/chart/funnel.js create mode 100644 src/main/webapp/plugins/echarts/chart/gauge.js create mode 100644 src/main/webapp/plugins/echarts/chart/k.js create mode 100644 src/main/webapp/plugins/echarts/chart/line.js create mode 100644 src/main/webapp/plugins/echarts/chart/map.js create mode 100644 src/main/webapp/plugins/echarts/chart/pie.js create mode 100644 src/main/webapp/plugins/echarts/chart/radar.js create mode 100644 src/main/webapp/plugins/echarts/chart/scatter.js create mode 100644 src/main/webapp/plugins/echarts/chart/tree.js create mode 100644 src/main/webapp/plugins/echarts/chart/treemap.js create mode 100644 src/main/webapp/plugins/echarts/chart/venn.js create mode 100644 src/main/webapp/plugins/echarts/chart/wordCloud.js create mode 100644 src/main/webapp/plugins/echarts/echarts-all.js create mode 100644 src/main/webapp/plugins/echarts/echarts.js create mode 100644 src/main/webapp/plugins/echarts/echarts_big.js create mode 100644 src/main/webapp/plugins/echarts/esl.js create mode 100644 src/main/webapp/plugins/echarts/wordCloud.js create mode 100644 src/main/webapp/plugins/jquery-2.1.4.js diff --git a/mysql/bdajob.sql b/mysql/bdajob.sql deleted file mode 100644 index 7924dcf..0000000 --- a/mysql/bdajob.sql +++ /dev/null @@ -1,38 +0,0 @@ -/* -Navicat MySQL Data Transfer - -Source Server : 10.20.13.7 -Source Server Version : 50717 -Source Host : 10.20.13.7:3306 -Source Database : studio - -Target Server Type : MYSQL -Target Server Version : 50717 -File Encoding : 65001 - -Date: 2017-05-01 22:45:04 -*/ - -SET FOREIGN_KEY_CHECKS=0; - --- ---------------------------- --- Table structure for bdajob --- ---------------------------- -DROP TABLE IF EXISTS `bdajob`; -CREATE TABLE `bdajob` ( - `job_id` varchar(255) CHARACTER SET utf8 NOT NULL, - `job_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `graphxml` text CHARACTER SET utf8, - `account` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `description` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `last_submit_time` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - `endtime` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - `is_example` tinyint(5) DEFAULT '0', - `oozie_job` varchar(255) DEFAULT NULL, - PRIMARY KEY (`job_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- ---------------------------- --- Records of bdajob --- ---------------------------- -INSERT INTO `bdajob` VALUES ('05010808093800000-bda', 'Examples of distributed abalone age prediction', '\n\n DataSet-15bc2ba1b9b-fe1c\n Dataset\n 454\n 74\n /EML/Data/Dataset\n\n\n RMSE-15bc2b909a8-346a\n RMSE\n latest\n 352\n 495\n ${appPath}/RMSE-15bc2b909a8-346a/\n spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt ${appPath}/GBRT_Predict-15bc2b9c369-f641/5BE7BEAE-135C-4F48-90C9-21EC291AEF89/5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n true\n false\n\n\n File_split-15bc2b97594-306b\n File_split\n latest\n 420\n 219\n ${appPath}/File_split-15bc2b97594-306b/\n 00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7\n AD415C51-4BAF-443C-868E-F0B59C744F1B\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC --ratio 0.8 --output_pt1 ${appPath}/File_split-15bc2b97594-306b/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7 --output_pt2 ${appPath}/File_split-15bc2b97594-306b/AD415C51-4BAF-443C-868E-F0B59C744F1B/AD415C51-4BAF-443C-868E-F0B59C744F1B\n true\n false\n\n\n GBRT_Train-15bc2b99d06-b3a7\n GBRT_Train\n latest\n 355\n 355\n ${appPath}/GBRT_Train-15bc2b99d06-b3a7/\n F0665C46-A1FC-4C9F-BA6D-8C97D571A372\n 11:Variance\n 13:10\n 15:32\n 17:10000\n 19:15\n 21:1e-6\n 23:10\n 25:0.02\n spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt ${appPath}/File_split-15bc2b9d556-f370/13C2F84E-6FBA-46FC-BE81-CD047C15B138/13C2F84E-6FBA-46FC-BE81-CD047C15B138 --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --cp_pt /EML/tmp --impurity \'Variance\' --max_depth 10 --max_bins 32 --bin_samples 10000 --min_node_size 15 --min_info_gain 1e-6 --num_round 10 --learn_rate 0.02\n true\n false\n\n\n GBRT_Predict-15bc2b9c369-f641\n GBRT_Predict\n latest\n 347\n 434\n ${appPath}/GBRT_Predict-15bc2b9c369-f641/\n 5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt ${appPath}/File_split-15bc2b9d556-f370/4537F376-6E1E-4CC5-B8C6-8F8680683767/4537F376-6E1E-4CC5-B8C6-8F8680683767 --predict_pt ${appPath}/GBRT_Predict-15bc2b9c369-f641/5BE7BEAE-135C-4F48-90C9-21EC291AEF89/5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n true\n false\n\n\n GBRT_Predict-15bc2b9b546-d790\n GBRT_Predict\n latest\n 531\n 435\n ${appPath}/GBRT_Predict-15bc2b9b546-d790/\n 9129BB64-6AB1-46F6-8E24-6F8A4A481998\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt ${appPath}/File_split-15bc2b97594-306b/AD415C51-4BAF-443C-868E-F0B59C744F1B/AD415C51-4BAF-443C-868E-F0B59C744F1B --predict_pt ${appPath}/GBRT_Predict-15bc2b9b546-d790/9129BB64-6AB1-46F6-8E24-6F8A4A481998/9129BB64-6AB1-46F6-8E24-6F8A4A481998\n true\n false\n\n\n File_split-15bc2b9d556-f370\n File_split\n latest\n 401\n 286\n ${appPath}/File_split-15bc2b9d556-f370/\n 13C2F84E-6FBA-46FC-BE81-CD047C15B138\n 4537F376-6E1E-4CC5-B8C6-8F8680683767\n 7:0.6\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/File_split-15bc2b97594-306b/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7 --ratio 0.6 --output_pt1 ${appPath}/File_split-15bc2b9d556-f370/13C2F84E-6FBA-46FC-BE81-CD047C15B138/13C2F84E-6FBA-46FC-BE81-CD047C15B138 --output_pt2 ${appPath}/File_split-15bc2b9d556-f370/4537F376-6E1E-4CC5-B8C6-8F8680683767/4537F376-6E1E-4CC5-B8C6-8F8680683767\n true\n false\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180\n LibSVM2LabeledPoint\n latest\n 390\n 156\n ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/\n 9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC\n 9:true\n spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt /EML/Data/Dataset/Dataset --output_pt ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC --is_class true\n true\n false\n\n\n DataSet-15bc2ba1b9b-fe1c:0\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n File_split-15bc2b97594-306b:0\n\n\n File_split-15bc2b97594-306b:0\n File_split-15bc2b9d556-f370:0\n\n\n File_split-15bc2b9d556-f370:0\n GBRT_Train-15bc2b99d06-b3a7:0\n\n\n File_split-15bc2b97594-306b:1\n GBRT_Predict-15bc2b9b546-d790:1\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9b546-d790:0\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9c369-f641:0\n\n\n File_split-15bc2b9d556-f370:1\n GBRT_Predict-15bc2b9c369-f641:1\n\n\n GBRT_Predict-15bc2b9c369-f641:0\n RMSE-15bc2b909a8-346a:0\n\n', 'bdaict@hotmail.com', 'Use the GDBT regression model to predict abalone age', '2017-05-01 08:08:10', null, '1', '0000001-170501074411311-oozie-root-W'); diff --git a/mysql/main.sql b/mysql/main.sql index f1d9577..bf22a17 100644 --- a/mysql/main.sql +++ b/mysql/main.sql @@ -9,16 +9,24 @@ create database studio CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; grant all privileges on studio.* to 'root'@'localhost' identified by '111111'; grant all privileges on studio.* to 'root'@'%' identified by '111111'; +drop database if exists test; +create database test CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; +grant all privileges on test.* to 'root'@'localhost' identified by '111111'; +grant all privileges on test.* to 'root'@'%' identified by '111111'; + flush privileges; use studio; +source /root/mysql/studio/account.sql; +source /root/mysql/studio/bdajob.sql; +source /root/mysql/studio/dataset.sql; +source /root/mysql/studio/jobcron.sql; +source /root/mysql/studio/oozieaction.sql; +source /root/mysql/studio/ooziejob.sql; +source /root/mysql/studio/program.sql; +source /root/mysql/studio/supernode.sql; +source /root/mysql/studio/category.sql; +source /root/mysql/studio/moduleversion.sql; -source /root/mysql/account.sql; -source /root/mysql/bdajob.sql; -source /root/mysql/dataset.sql; -source /root/mysql/jobcron.sql; -source /root/mysql/oozieaction.sql; -source /root/mysql/ooziejob.sql; -source /root/mysql/program.sql; -source /root/mysql/supernode.sql; -source /root/mysql/category.sql; \ No newline at end of file +use test; +source /root/mysql/test/titanic_train.sql; \ No newline at end of file diff --git a/mysql/oozieaction.sql b/mysql/oozieaction.sql deleted file mode 100644 index 189aa78..0000000 --- a/mysql/oozieaction.sql +++ /dev/null @@ -1,56 +0,0 @@ -/* -Navicat MySQL Data Transfer - -Source Server : 10.20.13.7 -Source Server Version : 50717 -Source Host : 10.20.13.7:3306 -Source Database : studio - -Target Server Type : MYSQL -Target Server Version : 50717 -File Encoding : 65001 - -Date: 2017-05-01 22:47:01 -*/ - -SET FOREIGN_KEY_CHECKS=0; - --- ---------------------------- --- Table structure for oozieaction --- ---------------------------- -DROP TABLE IF EXISTS `oozieaction`; -CREATE TABLE `oozieaction` ( - `jobid` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `cred` varchar(255) DEFAULT NULL, - `type` varchar(255) DEFAULT NULL, - `status` varchar(255) DEFAULT NULL, - `retries` int(11) DEFAULT '0', - `userretrycount` int(11) DEFAULT '0', - `userretrymax` int(11) DEFAULT '0', - `userretryinterval` int(11) DEFAULT '0', - `starttime` varchar(255) DEFAULT NULL, - `endtime` varchar(255) DEFAULT NULL, - `transition` varchar(255) DEFAULT NULL, - `stats` varchar(255) DEFAULT NULL, - `externalchildids` varchar(255) DEFAULT NULL, - `externalid` varchar(255) DEFAULT NULL, - `externalstatus` varchar(255) DEFAULT NULL, - `trackeruri` varchar(255) DEFAULT NULL, - `consoleurl` varchar(255) DEFAULT NULL, - `errorcode` varchar(255) DEFAULT NULL, - `errormessage` varchar(255) DEFAULT NULL, - `apppath` varchar(255) DEFAULT NULL, - `ooziejobid` varchar(255) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of oozieaction --- ---------------------------- -INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'RMSE-15bc2b909a8-346a', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:11:26', '2017-05-01 08:12:04', 'end', null, null, 'job_1493624196048_0009', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0009/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); -INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'File_split-15bc2b97594-306b', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:08:48', '2017-05-01 08:09:24', 'File_split-15bc2b9d556-f370', null, null, 'job_1493624196048_0004', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0004/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); -INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'GBRT_Train-15bc2b99d06-b3a7', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:10:00', '2017-05-01 08:10:45', 'fork-E3EC0509-121A-4290-8851-DC01695DFBE2', null, null, 'job_1493624196048_0006', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0006/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); -INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'GBRT_Predict-15bc2b9c369-f641', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:10:46', '2017-05-01 08:11:26', 'join-E3EC0509-121A-4290-8851-DC01695DFBE2', null, null, 'job_1493624196048_0008', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0008/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); -INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'GBRT_Predict-15bc2b9b546-d790', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:10:45', '2017-05-01 08:11:20', 'join-E3EC0509-121A-4290-8851-DC01695DFBE2', null, null, 'job_1493624196048_0007', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0007/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); -INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'File_split-15bc2b9d556-f370', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:09:24', '2017-05-01 08:10:00', 'GBRT_Train-15bc2b99d06-b3a7', null, null, 'job_1493624196048_0005', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0005/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); -INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'LibSVM2LabeledPoint-15bc2b9f8ca-3180', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:08:11', '2017-05-01 08:08:48', 'File_split-15bc2b97594-306b', null, null, 'job_1493624196048_0003', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0003/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); diff --git a/mysql/ooziejob.sql b/mysql/ooziejob.sql deleted file mode 100644 index bc12e5b..0000000 --- a/mysql/ooziejob.sql +++ /dev/null @@ -1,43 +0,0 @@ -/* -Navicat MySQL Data Transfer - -Source Server : 10.20.13.7 -Source Server Version : 50717 -Source Host : 10.20.13.7:3306 -Source Database : studio - -Target Server Type : MYSQL -Target Server Version : 50717 -File Encoding : 65001 - -Date: 2017-05-01 22:47:11 -*/ - -SET FOREIGN_KEY_CHECKS=0; - --- ---------------------------- --- Table structure for ooziejob --- ---------------------------- -DROP TABLE IF EXISTS `ooziejob`; -CREATE TABLE `ooziejob` ( - `id` varchar(255) CHARACTER SET utf8 NOT NULL, - `name` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `path` varchar(255) DEFAULT NULL, - `graphxml` text CHARACTER SET utf8, - `status` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `account` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `description` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `createtime` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - `endtime` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - `isexample` tinyint(5) DEFAULT '0', - `jobid` varchar(255) DEFAULT NULL, - `sequence` int(255) DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- ---------------------------- --- Records of ooziejob --- ---------------------------- -INSERT INTO `ooziejob` VALUES ('0000001-170501061427028-oozie-root-W', 'Examples of distributed abalone age prediction', '/EML/oozie/APP-PATH-976b2ab3-477d-4ccc-abf7-c261c79c4038', '\n\n DataSet-15bc2ba1b9b-fe1c\n Dataset\n 454\n 74\n /EML/Data/Dataset\n\n\n RMSE-15bc2b909a8-346a\n RMSE\n latest\n 352\n 495\n ${appPath}/RMSE-15bc2b909a8-346a/\n spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt ${appPath}/GBRT_Predict-15bc2b9c369-f641/85736071-AA38-428E-895B-9588FCFEE4F3/85736071-AA38-428E-895B-9588FCFEE4F3\n true\n false\n\n\n File_split-15bc2b97594-306b\n File_split\n latest\n 420\n 219\n ${appPath}/File_split-15bc2b97594-306b/\n A77D035C-7BC1-4123-9D86-CC4503A5F0BC\n F3A8EE14-FA47-4304-A953-BEAD9590D03D\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/1437C267-4EDC-4A35-86F9-86C5F8C10FBE/1437C267-4EDC-4A35-86F9-86C5F8C10FBE --ratio 0.8 --output_pt1 ${appPath}/File_split-15bc2b97594-306b/A77D035C-7BC1-4123-9D86-CC4503A5F0BC/A77D035C-7BC1-4123-9D86-CC4503A5F0BC --output_pt2 ${appPath}/File_split-15bc2b97594-306b/F3A8EE14-FA47-4304-A953-BEAD9590D03D/F3A8EE14-FA47-4304-A953-BEAD9590D03D\n true\n false\n\n\n GBRT_Train-15bc2b99d06-b3a7\n GBRT_Train\n latest\n 355\n 355\n ${appPath}/GBRT_Train-15bc2b99d06-b3a7/\n E51642F5-093B-4436-9BCC-55F0807ED856\n 11:Variance\n 13:10\n 15:32\n 17:10000\n 19:15\n 21:1e-6\n 23:10\n 25:0.02\n spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt ${appPath}/File_split-15bc2b9d556-f370/48DB3996-1379-4A16-BFE2-64E99608D967/48DB3996-1379-4A16-BFE2-64E99608D967 --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/E51642F5-093B-4436-9BCC-55F0807ED856/E51642F5-093B-4436-9BCC-55F0807ED856 --cp_pt /EML/tmp --impurity \'Variance\' --max_depth 10 --max_bins 32 --bin_samples 10000 --min_node_size 15 --min_info_gain 1e-6 --num_round 10 --learn_rate 0.02\n true\n false\n\n\n GBRT_Predict-15bc2b9b546-d790\n GBRT_Predict\n latest\n 531\n 435\n ${appPath}/GBRT_Predict-15bc2b9b546-d790/\n 9471B2AA-7D10-469F-826B-344EA10C1571\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/E51642F5-093B-4436-9BCC-55F0807ED856/E51642F5-093B-4436-9BCC-55F0807ED856 --test_pt ${appPath}/File_split-15bc2b97594-306b/F3A8EE14-FA47-4304-A953-BEAD9590D03D/F3A8EE14-FA47-4304-A953-BEAD9590D03D --predict_pt ${appPath}/GBRT_Predict-15bc2b9b546-d790/9471B2AA-7D10-469F-826B-344EA10C1571/9471B2AA-7D10-469F-826B-344EA10C1571\n true\n false\n\n\n GBRT_Predict-15bc2b9c369-f641\n GBRT_Predict\n latest\n 347\n 434\n ${appPath}/GBRT_Predict-15bc2b9c369-f641/\n 85736071-AA38-428E-895B-9588FCFEE4F3\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/E51642F5-093B-4436-9BCC-55F0807ED856/E51642F5-093B-4436-9BCC-55F0807ED856 --test_pt ${appPath}/File_split-15bc2b9d556-f370/2F9EB230-6F5F-4C27-9ADC-05EFC782D7E2/2F9EB230-6F5F-4C27-9ADC-05EFC782D7E2 --predict_pt ${appPath}/GBRT_Predict-15bc2b9c369-f641/85736071-AA38-428E-895B-9588FCFEE4F3/85736071-AA38-428E-895B-9588FCFEE4F3\n true\n false\n\n\n File_split-15bc2b9d556-f370\n File_split\n latest\n 401\n 286\n ${appPath}/File_split-15bc2b9d556-f370/\n 48DB3996-1379-4A16-BFE2-64E99608D967\n 2F9EB230-6F5F-4C27-9ADC-05EFC782D7E2\n 7:0.6\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/File_split-15bc2b97594-306b/A77D035C-7BC1-4123-9D86-CC4503A5F0BC/A77D035C-7BC1-4123-9D86-CC4503A5F0BC --ratio 0.6 --output_pt1 ${appPath}/File_split-15bc2b9d556-f370/48DB3996-1379-4A16-BFE2-64E99608D967/48DB3996-1379-4A16-BFE2-64E99608D967 --output_pt2 ${appPath}/File_split-15bc2b9d556-f370/2F9EB230-6F5F-4C27-9ADC-05EFC782D7E2/2F9EB230-6F5F-4C27-9ADC-05EFC782D7E2\n true\n false\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180\n LibSVM2LabeledPoint\n latest\n 390\n 156\n ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/\n 1437C267-4EDC-4A35-86F9-86C5F8C10FBE\n 9:true\n spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt /EML/Data/Dataset/Dataset --output_pt ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/1437C267-4EDC-4A35-86F9-86C5F8C10FBE/1437C267-4EDC-4A35-86F9-86C5F8C10FBE --is_class true\n true\n false\n\n\n DataSet-15bc2ba1b9b-fe1c:0\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n File_split-15bc2b97594-306b:0\n\n\n File_split-15bc2b97594-306b:0\n File_split-15bc2b9d556-f370:0\n\n\n File_split-15bc2b9d556-f370:0\n GBRT_Train-15bc2b99d06-b3a7:0\n\n\n File_split-15bc2b97594-306b:1\n GBRT_Predict-15bc2b9b546-d790:1\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9b546-d790:0\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9c369-f641:0\n\n\n File_split-15bc2b9d556-f370:1\n GBRT_Predict-15bc2b9c369-f641:1\n\n\n GBRT_Predict-15bc2b9c369-f641:0\n RMSE-15bc2b909a8-346a:0\n\n', 'KILLED', 'bdaict@hotmail.com', 'Use the GDBT regression model to predict abalone age', '2017-05-01 06:34:39', '2017-05-01 06:35:10', '0', '05010634371350000-bda', '0'); -INSERT INTO `ooziejob` VALUES ('0000001-170501074411311-oozie-root-W', 'Examples of distributed abalone age prediction', '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '\n\n DataSet-15bc2ba1b9b-fe1c\n Dataset\n 454\n 74\n /EML/Data/Dataset\n\n\n RMSE-15bc2b909a8-346a\n RMSE\n latest\n 352\n 495\n ${appPath}/RMSE-15bc2b909a8-346a/\n spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt ${appPath}/GBRT_Predict-15bc2b9c369-f641/5BE7BEAE-135C-4F48-90C9-21EC291AEF89/5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n true\n false\n\n\n File_split-15bc2b97594-306b\n File_split\n latest\n 420\n 219\n ${appPath}/File_split-15bc2b97594-306b/\n 00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7\n AD415C51-4BAF-443C-868E-F0B59C744F1B\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC --ratio 0.8 --output_pt1 ${appPath}/File_split-15bc2b97594-306b/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7 --output_pt2 ${appPath}/File_split-15bc2b97594-306b/AD415C51-4BAF-443C-868E-F0B59C744F1B/AD415C51-4BAF-443C-868E-F0B59C744F1B\n true\n false\n\n\n GBRT_Train-15bc2b99d06-b3a7\n GBRT_Train\n latest\n 355\n 355\n ${appPath}/GBRT_Train-15bc2b99d06-b3a7/\n F0665C46-A1FC-4C9F-BA6D-8C97D571A372\n 11:Variance\n 13:10\n 15:32\n 17:10000\n 19:15\n 21:1e-6\n 23:10\n 25:0.02\n spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt ${appPath}/File_split-15bc2b9d556-f370/13C2F84E-6FBA-46FC-BE81-CD047C15B138/13C2F84E-6FBA-46FC-BE81-CD047C15B138 --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --cp_pt /EML/tmp --impurity \'Variance\' --max_depth 10 --max_bins 32 --bin_samples 10000 --min_node_size 15 --min_info_gain 1e-6 --num_round 10 --learn_rate 0.02\n true\n false\n\n\n GBRT_Predict-15bc2b9c369-f641\n GBRT_Predict\n latest\n 347\n 434\n ${appPath}/GBRT_Predict-15bc2b9c369-f641/\n 5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt ${appPath}/File_split-15bc2b9d556-f370/4537F376-6E1E-4CC5-B8C6-8F8680683767/4537F376-6E1E-4CC5-B8C6-8F8680683767 --predict_pt ${appPath}/GBRT_Predict-15bc2b9c369-f641/5BE7BEAE-135C-4F48-90C9-21EC291AEF89/5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n true\n false\n\n\n GBRT_Predict-15bc2b9b546-d790\n GBRT_Predict\n latest\n 531\n 435\n ${appPath}/GBRT_Predict-15bc2b9b546-d790/\n 9129BB64-6AB1-46F6-8E24-6F8A4A481998\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt ${appPath}/File_split-15bc2b97594-306b/AD415C51-4BAF-443C-868E-F0B59C744F1B/AD415C51-4BAF-443C-868E-F0B59C744F1B --predict_pt ${appPath}/GBRT_Predict-15bc2b9b546-d790/9129BB64-6AB1-46F6-8E24-6F8A4A481998/9129BB64-6AB1-46F6-8E24-6F8A4A481998\n true\n false\n\n\n File_split-15bc2b9d556-f370\n File_split\n latest\n 401\n 286\n ${appPath}/File_split-15bc2b9d556-f370/\n 13C2F84E-6FBA-46FC-BE81-CD047C15B138\n 4537F376-6E1E-4CC5-B8C6-8F8680683767\n 7:0.6\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/File_split-15bc2b97594-306b/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7 --ratio 0.6 --output_pt1 ${appPath}/File_split-15bc2b9d556-f370/13C2F84E-6FBA-46FC-BE81-CD047C15B138/13C2F84E-6FBA-46FC-BE81-CD047C15B138 --output_pt2 ${appPath}/File_split-15bc2b9d556-f370/4537F376-6E1E-4CC5-B8C6-8F8680683767/4537F376-6E1E-4CC5-B8C6-8F8680683767\n true\n false\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180\n LibSVM2LabeledPoint\n latest\n 390\n 156\n ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/\n 9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC\n 9:true\n spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt /EML/Data/Dataset/Dataset --output_pt ${appPath}/LibSVM2LabeledPoint-15bc2b9f8ca-3180/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC --is_class true\n true\n false\n\n\n DataSet-15bc2ba1b9b-fe1c:0\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n File_split-15bc2b97594-306b:0\n\n\n File_split-15bc2b97594-306b:0\n File_split-15bc2b9d556-f370:0\n\n\n File_split-15bc2b9d556-f370:0\n GBRT_Train-15bc2b99d06-b3a7:0\n\n\n File_split-15bc2b97594-306b:1\n GBRT_Predict-15bc2b9b546-d790:1\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9b546-d790:0\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9c369-f641:0\n\n\n File_split-15bc2b9d556-f370:1\n GBRT_Predict-15bc2b9c369-f641:1\n\n\n GBRT_Predict-15bc2b9c369-f641:0\n RMSE-15bc2b909a8-346a:0\n\n', 'SUCCEEDED', 'bdaict@hotmail.com', 'Use the GDBT regression model to predict abalone age', '2017-05-01 08:08:11', '2017-05-01 08:12:04', '0', '05010808093800000-bda', '0'); -INSERT INTO `ooziejob` VALUES ('0000013-170429041822084-oozie-root-W', 'Examples of distributed abalone age prediction', '/EML/oozie/APP-PATH-0effc235-ce90-4170-ad28-d2972abe8247', '\n\n DataSet-15bb8d8cf3d-f1cb\n 9706F0E5-967E-4787-901D-6773D282CCAD\n 415\n 99\n /EML/Data/9706F0E5-967E-4787-901D-6773D282CCAD\n\n\n LibSVM2LabeledPoint-15bb8d909fc-de54\n 24D79829-7745-4AF0-B03A-F1BD62585A29\n latest\n 346\n 170\n ${appPath}/LibSVM2LabeledPoint-15bb8d909fc-de54/\n C7F5C710-C4C3-47EC-AD44-515F810251BC\n 9:true\n spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt /EML/Data/9706F0E5-967E-4787-901D-6773D282CCAD/9706F0E5-967E-4787-901D-6773D282CCAD --output_pt ${appPath}/LibSVM2LabeledPoint-15bb8d909fc-de54/C7F5C710-C4C3-47EC-AD44-515F810251BC/C7F5C710-C4C3-47EC-AD44-515F810251BC --is_class true\n true\n false\n\n\n GBRT_Predict-15bb8daa191-c48f\n 5E8BC98D-F076-4F97-8CD7-4CF50EF882F4\n latest\n 472\n 439\n ${appPath}/GBRT_Predict-15bb8daa191-c48f/\n FF0AABF9-2E6F-4D52-82FB-3477D98E1FB3\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bb8daa434-95a8/29D53154-F326-4C13-BB15-47C7C5A8C41C/29D53154-F326-4C13-BB15-47C7C5A8C41C --test_pt ${appPath}/File_split-15bb8dab9d5-d657/F2130951-E732-4B36-A9B6-6F1E0AE75D9D/F2130951-E732-4B36-A9B6-6F1E0AE75D9D --predict_pt ${appPath}/GBRT_Predict-15bb8daa191-c48f/FF0AABF9-2E6F-4D52-82FB-3477D98E1FB3/FF0AABF9-2E6F-4D52-82FB-3477D98E1FB3\n true\n false\n\n\n GBRT_Train-15bb8daa434-95a8\n 9AD8CDC5-F12D-444C-8FEB-97875201985C\n latest\n 334\n 368\n ${appPath}/GBRT_Train-15bb8daa434-95a8/\n 29D53154-F326-4C13-BB15-47C7C5A8C41C\n 11:Variance\n 13:10\n 15:32\n 17:10000\n 19:15\n 21:1e-6\n 23:10\n 25:0.02\n spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt ${appPath}/File_split-15bb8dac9f0-74bc/8EA71CD7-B0B2-4B2C-A878-4761FF5EEFBF/8EA71CD7-B0B2-4B2C-A878-4761FF5EEFBF --model_pt ${appPath}/GBRT_Train-15bb8daa434-95a8/29D53154-F326-4C13-BB15-47C7C5A8C41C/29D53154-F326-4C13-BB15-47C7C5A8C41C --cp_pt /EML/tmp --impurity \'Variance\' --max_depth 10 --max_bins 32 --bin_samples 10000 --min_node_size 15 --min_info_gain 1e-6 --num_round 10 --learn_rate 0.02\n true\n false\n\n\n File_split-15bb8dab9d5-d657\n 0BC9148A-8D22-4744-82EF-BFBB8A716843\n latest\n 378\n 231\n ${appPath}/File_split-15bb8dab9d5-d657/\n 6FAB1E8D-7600-49CF-8F27-FDD55495FE51\n F2130951-E732-4B36-A9B6-6F1E0AE75D9D\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/LibSVM2LabeledPoint-15bb8d909fc-de54/C7F5C710-C4C3-47EC-AD44-515F810251BC/C7F5C710-C4C3-47EC-AD44-515F810251BC --ratio 0.8 --output_pt1 ${appPath}/File_split-15bb8dab9d5-d657/6FAB1E8D-7600-49CF-8F27-FDD55495FE51/6FAB1E8D-7600-49CF-8F27-FDD55495FE51 --output_pt2 ${appPath}/File_split-15bb8dab9d5-d657/F2130951-E732-4B36-A9B6-6F1E0AE75D9D/F2130951-E732-4B36-A9B6-6F1E0AE75D9D\n true\n false\n\n\n File_split-15bb8dac9f0-74bc\n 0BC9148A-8D22-4744-82EF-BFBB8A716843\n latest\n 355\n 301\n ${appPath}/File_split-15bb8dac9f0-74bc/\n 8EA71CD7-B0B2-4B2C-A878-4761FF5EEFBF\n 073037AF-3DE7-4A0B-A7E0-098635B7315D\n 7:0.6\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/File_split-15bb8dab9d5-d657/6FAB1E8D-7600-49CF-8F27-FDD55495FE51/6FAB1E8D-7600-49CF-8F27-FDD55495FE51 --ratio 0.6 --output_pt1 ${appPath}/File_split-15bb8dac9f0-74bc/8EA71CD7-B0B2-4B2C-A878-4761FF5EEFBF/8EA71CD7-B0B2-4B2C-A878-4761FF5EEFBF --output_pt2 ${appPath}/File_split-15bb8dac9f0-74bc/073037AF-3DE7-4A0B-A7E0-098635B7315D/073037AF-3DE7-4A0B-A7E0-098635B7315D\n true\n false\n\n\n GBRT_Predict-15bb8dc122b-eecb\n 5E8BC98D-F076-4F97-8CD7-4CF50EF882F4\n latest\n 315\n 438\n ${appPath}/GBRT_Predict-15bb8dc122b-eecb/\n 0698729F-E6CF-4F89-823D-59826EA9C824\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt ${appPath}/GBRT_Train-15bb8daa434-95a8/29D53154-F326-4C13-BB15-47C7C5A8C41C/29D53154-F326-4C13-BB15-47C7C5A8C41C --test_pt ${appPath}/File_split-15bb8dac9f0-74bc/073037AF-3DE7-4A0B-A7E0-098635B7315D/073037AF-3DE7-4A0B-A7E0-098635B7315D --predict_pt ${appPath}/GBRT_Predict-15bb8dc122b-eecb/0698729F-E6CF-4F89-823D-59826EA9C824/0698729F-E6CF-4F89-823D-59826EA9C824\n true\n false\n\n\n RMSE-15bb8dc44f2-cc75\n DF4B8A29-D55C-4CE0-9156-1F4A1B364E55\n latest\n 319\n 510\n ${appPath}/RMSE-15bb8dc44f2-cc75/\n spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt ${appPath}/GBRT_Predict-15bb8dc122b-eecb/0698729F-E6CF-4F89-823D-59826EA9C824/0698729F-E6CF-4F89-823D-59826EA9C824\n true\n false\n\n\n DataSet-15bb8d8cf3d-f1cb:0\n LibSVM2LabeledPoint-15bb8d909fc-de54:0\n\n\n LibSVM2LabeledPoint-15bb8d909fc-de54:0\n File_split-15bb8dab9d5-d657:0\n\n\n File_split-15bb8dab9d5-d657:0\n File_split-15bb8dac9f0-74bc:0\n\n\n File_split-15bb8dac9f0-74bc:0\n GBRT_Train-15bb8daa434-95a8:0\n\n\n File_split-15bb8dab9d5-d657:1\n GBRT_Predict-15bb8daa191-c48f:1\n\n\n GBRT_Train-15bb8daa434-95a8:0\n GBRT_Predict-15bb8daa191-c48f:0\n\n\n GBRT_Train-15bb8daa434-95a8:0\n GBRT_Predict-15bb8dc122b-eecb:0\n\n\n File_split-15bb8dac9f0-74bc:1\n GBRT_Predict-15bb8dc122b-eecb:1\n\n\n GBRT_Predict-15bb8dc122b-eecb:0\n RMSE-15bb8dc44f2-cc75:0\n\n', 'SUCCEEDED', 'bdaict@hotmail.com', 'Use the GDBT regression model to predict abalone age', '2017-04-29 08:48:56', '2017-04-29 08:52:43', '0', '04290848557360011-bda', '0'); diff --git a/mysql/readme.md b/mysql/readme.md deleted file mode 100644 index 05b69ef..0000000 --- a/mysql/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -#Easy Machine Learning Database Initialization -Run the main.sql to initialize the EasyML database if you build your own hadoop cluster and database for EasyML project. \ No newline at end of file diff --git a/mysql/account.sql b/mysql/studio/account.sql similarity index 98% rename from mysql/account.sql rename to mysql/studio/account.sql index cdda823..f2a51cc 100644 --- a/mysql/account.sql +++ b/mysql/studio/account.sql @@ -1,7 +1,7 @@ /* Navicat MySQL Data Transfer -Source Server : 10.20.13.7 +Source Server : BDA(烟å°) Source Server Version : 50717 Source Host : 10.20.13.7:3306 Source Database : studio @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50717 File Encoding : 65001 -Date: 2017-05-01 22:44:47 +Date: 2017-10-18 16:18:47 */ SET FOREIGN_KEY_CHECKS=0; diff --git a/mysql/studio/bdajob.sql b/mysql/studio/bdajob.sql new file mode 100644 index 0000000..ba17a31 --- /dev/null +++ b/mysql/studio/bdajob.sql @@ -0,0 +1,39 @@ +/* +Navicat MySQL Data Transfer + +Source Server : BDA(烟å°) +Source Server Version : 50717 +Source Host : 10.20.13.7:3306 +Source Database : studio + +Target Server Type : MYSQL +Target Server Version : 50717 +File Encoding : 65001 + +Date: 2017-10-18 16:27:38 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for bdajob +-- ---------------------------- +DROP TABLE IF EXISTS `bdajob`; +CREATE TABLE `bdajob` ( + `job_id` varchar(255) CHARACTER SET utf8 NOT NULL, + `job_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `graphxml` text CHARACTER SET utf8, + `account` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `description` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `last_submit_time` varchar(30) CHARACTER SET utf8 DEFAULT NULL, + `endtime` varchar(30) CHARACTER SET utf8 DEFAULT NULL, + `is_example` tinyint(5) DEFAULT '0', + `oozie_job` varchar(255) DEFAULT NULL, + PRIMARY KEY (`job_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- ---------------------------- +-- Records of bdajob +-- ---------------------------- +INSERT INTO `bdajob` VALUES ('05010808093800000-bda', 'Examples of distributed abalone age prediction', '\n\n DataSet-15bc2ba1b9b-fe1c\n Dataset\n 454\n 74\n /EML/Data/Dataset\n\n\n RMSE-15bc2b909a8-346a\n RMSE\n 0000001-170501074411311-oozie-root-W\n 352\n 495\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/RMSE-15bc2b909a8-346a/\n spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Predict-15bc2b9c369-f641/5BE7BEAE-135C-4F48-90C9-21EC291AEF89/5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n true\n false\n\n\n GBRT_Train-15bc2b99d06-b3a7\n GBRT_Train\n 0000001-170501074411311-oozie-root-W\n 355\n 355\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Train-15bc2b99d06-b3a7/\n F0665C46-A1FC-4C9F-BA6D-8C97D571A372\n 11:Variance\n 13:10\n 15:32\n 17:10000\n 19:15\n 21:1e-6\n 23:10\n 25:0.02\n spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b9d556-f370/13C2F84E-6FBA-46FC-BE81-CD047C15B138/13C2F84E-6FBA-46FC-BE81-CD047C15B138 --model_pt \'\' --cp_pt /EML/tmp --impurity \'Variance\' --max_depth 10 --max_bins 32 --bin_samples 10000 --min_node_size 15 --min_info_gain 1e-6 --num_round 10 --learn_rate 0.02\n true\n false\n\n\n File_split-15bc2b97594-306b\n File_split\n 0000001-170501074411311-oozie-root-W\n 420\n 219\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b97594-306b/\n 00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7\n AD415C51-4BAF-443C-868E-F0B59C744F1B\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/LibSVM2LabeledPoint-15bc2b9f8ca-3180/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC --ratio 0.8 --output_pt1 \'\' --output_pt2 \'\'\n true\n false\n\n\n GBRT_Predict-15bc2b9b546-d790\n GBRT_Predict\n 0000001-170501074411311-oozie-root-W\n 531\n 435\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Predict-15bc2b9b546-d790/\n 9129BB64-6AB1-46F6-8E24-6F8A4A481998\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b97594-306b/AD415C51-4BAF-443C-868E-F0B59C744F1B/AD415C51-4BAF-443C-868E-F0B59C744F1B --predict_pt \'\'\n true\n false\n\n\n File_split-15bc2b9d556-f370\n File_split\n 0000001-170501074411311-oozie-root-W\n 401\n 286\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b9d556-f370/\n 13C2F84E-6FBA-46FC-BE81-CD047C15B138\n 4537F376-6E1E-4CC5-B8C6-8F8680683767\n 7:0.6\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b97594-306b/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7 --ratio 0.6 --output_pt1 \'\' --output_pt2 \'\'\n true\n false\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180\n LibSVM2LabeledPoint\n 0000001-170501074411311-oozie-root-W\n 390\n 156\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/LibSVM2LabeledPoint-15bc2b9f8ca-3180/\n 9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC\n 9:true\n spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt /EML/Data/Dataset/Dataset --output_pt \'\' --is_class true\n true\n false\n\n\n GBRT_Predict-15bc2b9c369-f641\n GBRT_Predict\n 0000001-170501074411311-oozie-root-W\n 347\n 434\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Predict-15bc2b9c369-f641/\n 5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b9d556-f370/4537F376-6E1E-4CC5-B8C6-8F8680683767/4537F376-6E1E-4CC5-B8C6-8F8680683767 --predict_pt \'\'\n true\n false\n\n\n DataSet-15bc2ba1b9b-fe1c:0\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n File_split-15bc2b97594-306b:0\n\n\n File_split-15bc2b97594-306b:0\n File_split-15bc2b9d556-f370:0\n\n\n File_split-15bc2b9d556-f370:0\n GBRT_Train-15bc2b99d06-b3a7:0\n\n\n File_split-15bc2b97594-306b:1\n GBRT_Predict-15bc2b9b546-d790:1\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9b546-d790:0\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9c369-f641:0\n\n\n File_split-15bc2b9d556-f370:1\n GBRT_Predict-15bc2b9c369-f641:1\n\n\n GBRT_Predict-15bc2b9c369-f641:0\n RMSE-15bc2b909a8-346a:0\n\n', 'bdaict@hotmail.com', 'Use the GDBT regression model to predict abalone age', '2017-10-13 09:28:46', null, '1', '0000018-171011074245692-oozie-root-W'); +INSERT INTO `bdajob` VALUES ('1018155522800001-bda', 'Titanic Demo For Kaggle', '\n\n spark_sql-15f0453e7a9-3edd\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 381\n 249\n ${appPath}/spark_sql-15f0453e7a9-3edd/\n 4450E78E-CC61-4BB6-9B55-1D44B09E4F71\n Train\n after_name_sex\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e7a9-3edd.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f01b9-3047/90BAE136-31D1-462F-9A31-2A847579E760/90BAE136-31D1-462F-9A31-2A847579E760;\' --output_kv \'after_name_sex:${appPath}/spark_sql-15f0453e7a9-3edd/4450E78E-CC61-4BB6-9B55-1D44B09E4F71/4450E78E-CC61-4BB6-9B55-1D44B09E4F71;\'\n true\n false\n\n\n spark_sql-15f0453e516-77ee\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 773\n 255\n ${appPath}/spark_sql-15f0453e516-77ee/\n BC22DDD6-9970-4980-90FC-5607A7B4B39C\n Train\n parch\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e516-77ee.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808;\' --output_kv \'parch:${appPath}/spark_sql-15f0453e516-77ee/BC22DDD6-9970-4980-90FC-5607A7B4B39C/BC22DDD6-9970-4980-90FC-5607A7B4B39C;\'\n true\n false\n\n\n spark_sql-15f0453e651-c3cf\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 248\n 250\n ${appPath}/spark_sql-15f0453e651-c3cf/\n E4262E65-FC25-4C95-8EA0-6B66A8C64432\n Train\n fare\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e651-c3cf.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f0928-982b/08473566-A5C1-4A35-8ADB-0BE227F66B67/08473566-A5C1-4A35-8ADB-0BE227F66B67;\' --output_kv \'fare:${appPath}/spark_sql-15f0453e651-c3cf/E4262E65-FC25-4C95-8EA0-6B66A8C64432/E4262E65-FC25-4C95-8EA0-6B66A8C64432;\'\n true\n false\n\n\n spark_sql-15f0453e351-2e41\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 109\n 248\n ${appPath}/spark_sql-15f0453e351-2e41/\n 6939CE20-29D4-42E6-8347-35B6B712CDC0\n Train\n survive\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e351-2e41.script\' --input_kv \'Train:${appPath}/SqlETL-15f044e2e71-241f/BED112EC-CA3D-45C4-86D2-29C7612803B9/BED112EC-CA3D-45C4-86D2-29C7612803B9;\' --output_kv \'survive:${appPath}/spark_sql-15f0453e351-2e41/6939CE20-29D4-42E6-8347-35B6B712CDC0/6939CE20-29D4-42E6-8347-35B6B712CDC0;\'\n true\n false\n\n\n SqlETL-15f044f01b9-3047\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 379\n 165\n ${appPath}/SqlETL-15f044f01b9-3047/\n 90BAE136-31D1-462F-9A31-2A847579E760\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Pclass,Sex\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044f01b9-3047/90BAE136-31D1-462F-9A31-2A847579E760/90BAE136-31D1-462F-9A31-2A847579E760 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Pclass,Sex\' --format \'json\'\n true\n false\n\n\n SqlETL-15f044f0928-982b\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 245\n 167\n ${appPath}/SqlETL-15f044f0928-982b/\n 08473566-A5C1-4A35-8ADB-0BE227F66B67\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Fare\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044f0928-982b/08473566-A5C1-4A35-8ADB-0BE227F66B67/08473566-A5C1-4A35-8ADB-0BE227F66B67 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Fare\' --format \'json\'\n true\n false\n\n\n FormatTransform-15f04568619-76fd\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 90\n 329\n ${appPath}/FormatTransform-15f04568619-76fd/\n 1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e351-2e41/6939CE20-29D4-42E6-8347-35B6B712CDC0/6939CE20-29D4-42E6-8347-35B6B712CDC0 --output_pt ${appPath}/FormatTransform-15f04568619-76fd/1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5/1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5\n true\n false\n\n\n FormatTransform-15f048a7fda-5e75\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 646\n 329\n ${appPath}/FormatTransform-15f048a7fda-5e75/\n 20A97032-74CB-4B77-B4DA-E640B74B9825\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e9ff-9470/63D39534-0137-4672-9259-A7EAF6074385/63D39534-0137-4672-9259-A7EAF6074385 --output_pt ${appPath}/FormatTransform-15f048a7fda-5e75/20A97032-74CB-4B77-B4DA-E640B74B9825/20A97032-74CB-4B77-B4DA-E640B74B9825\n true\n false\n\n\n FormatTransform-15f048aa48a-86f7\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 792\n 328\n ${appPath}/FormatTransform-15f048aa48a-86f7/\n 3D90A0F7-6FB1-4616-85BE-6029B5D87D5B\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e516-77ee/BC22DDD6-9970-4980-90FC-5607A7B4B39C/BC22DDD6-9970-4980-90FC-5607A7B4B39C --output_pt ${appPath}/FormatTransform-15f048aa48a-86f7/3D90A0F7-6FB1-4616-85BE-6029B5D87D5B/3D90A0F7-6FB1-4616-85BE-6029B5D87D5B\n true\n false\n\n\n SqlETL-15f044f2851-46cc\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 638\n 162\n ${appPath}/SqlETL-15f044f2851-46cc/\n 7448154C-CBD9-4C2B-8EA7-FF31ED956808\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Age,SibSp,Parch\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Age,SibSp,Parch\' --format \'json\'\n true\n false\n\n\n spark_sql-15f0453e8f9-43fc\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 505\n 252\n ${appPath}/spark_sql-15f0453e8f9-43fc/\n BA8A93FB-9EAA-4525-947A-2920F509B1F2\n Train\n age\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e8f9-43fc.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808;\' --output_kv \'age:${appPath}/spark_sql-15f0453e8f9-43fc/BA8A93FB-9EAA-4525-947A-2920F509B1F2/BA8A93FB-9EAA-4525-947A-2920F509B1F2;\'\n true\n false\n\n\n FormatTransform-15f048a11cb-4e6c\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 370\n 329\n ${appPath}/FormatTransform-15f048a11cb-4e6c/\n C0B15993-17BC-4DAC-80B2-2877F7494DCC\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e7a9-3edd/4450E78E-CC61-4BB6-9B55-1D44B09E4F71/4450E78E-CC61-4BB6-9B55-1D44B09E4F71 --output_pt ${appPath}/FormatTransform-15f048a11cb-4e6c/C0B15993-17BC-4DAC-80B2-2877F7494DCC/C0B15993-17BC-4DAC-80B2-2877F7494DCC\n true\n false\n\n\n FormatTransform-15f0456b9e0-ca2d\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 229\n 329\n ${appPath}/FormatTransform-15f0456b9e0-ca2d/\n 9E3B8169-401A-4EA6-8542-F1A08B682779\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e651-c3cf/E4262E65-FC25-4C95-8EA0-6B66A8C64432/E4262E65-FC25-4C95-8EA0-6B66A8C64432 --output_pt ${appPath}/FormatTransform-15f0456b9e0-ca2d/9E3B8169-401A-4EA6-8542-F1A08B682779/9E3B8169-401A-4EA6-8542-F1A08B682779\n true\n false\n\n\n Shell-15f048b174a-2a34\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 106\n 399\n ${appPath}/Shell-15f048b174a-2a34/\n F8B9C1F4-B9DF-44D4-8E41-4D7EE58B419C\n 1\n 1\n \n sh Shell-15f048b174a-2a34.script 1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5 F8B9C1F4-B9DF-44D4-8E41-4D7EE58B419C\n false\n true\n\n\n File_split-15f049392b3-6fa7\n File_split\n latest\n 392\n 694\n ${appPath}/File_split-15f049392b3-6fa7/\n BADAC0A9-B811-4884-B187-464D99F2647F\n A727BDA2-7F19-4B28-B28E-30B0E876378E\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/JsonToLabelPoint-15f04935c77-65fa/11B339B8-806E-411F-AAD8-9B544F214018/11B339B8-806E-411F-AAD8-9B544F214018 --ratio 0.8 --output_pt1 ${appPath}/File_split-15f049392b3-6fa7/BADAC0A9-B811-4884-B187-464D99F2647F/BADAC0A9-B811-4884-B187-464D99F2647F --output_pt2 ${appPath}/File_split-15f049392b3-6fa7/A727BDA2-7F19-4B28-B28E-30B0E876378E/A727BDA2-7F19-4B28-B28E-30B0E876378E\n true\n false\n\n\n Shell-15f048b15dc-f65e\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 803\n 399\n ${appPath}/Shell-15f048b15dc-f65e/\n 4E6540FF-2CC5-44B0-9CC5-DD4C52DB5FFF\n 1\n 1\n \n sh Shell-15f048b15dc-f65e.script 3D90A0F7-6FB1-4616-85BE-6029B5D87D5B 4E6540FF-2CC5-44B0-9CC5-DD4C52DB5FFF\n false\n true\n\n\n Shell-15f048b1892-ba2b\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 245\n 399\n ${appPath}/Shell-15f048b1892-ba2b/\n A10014BF-79AE-4DE3-85C1-7FF62B51C257\n 1\n 1\n \n sh Shell-15f048b1892-ba2b.script 9E3B8169-401A-4EA6-8542-F1A08B682779 A10014BF-79AE-4DE3-85C1-7FF62B51C257\n false\n true\n\n\n FormatTransform-15f049308ab-1111\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 379\n 556\n ${appPath}/FormatTransform-15f049308ab-1111/\n 72772B3A-F0B1-4C99-BFB9-5BF269B23E52\n 5:csv\n 7:json\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'csv\' --output_format \'json\' --input_pt ${appPath}/Shell-15f04925385-3907/F3C164CD-07A1-462D-A7C7-B2D5CD62C155/F3C164CD-07A1-462D-A7C7-B2D5CD62C155 --output_pt ${appPath}/FormatTransform-15f049308ab-1111/72772B3A-F0B1-4C99-BFB9-5BF269B23E52/72772B3A-F0B1-4C99-BFB9-5BF269B23E52\n true\n false\n\n\n Shell-15f04925385-3907\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 390\n 491\n ${appPath}/Shell-15f04925385-3907/\n F3C164CD-07A1-462D-A7C7-B2D5CD62C155\n 6\n 1\n \n sh Shell-15f04925385-3907.script F8B9C1F4-B9DF-44D4-8E41-4D7EE58B419C A10014BF-79AE-4DE3-85C1-7FF62B51C257 5894334B-E814-40A8-9B20-C0B28BC4522D DA3D71A0-3B03-49F6-BC8A-C27D404ED032 13D1F867-D15C-47FC-9F48-3AC4A29887F0 4E6540FF-2CC5-44B0-9CC5-DD4C52DB5FFF F3C164CD-07A1-462D-A7C7-B2D5CD62C155\n false\n true\n\n\n spark_sql-15f0453e9ff-9470\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 634\n 251\n ${appPath}/spark_sql-15f0453e9ff-9470/\n 63D39534-0137-4672-9259-A7EAF6074385\n Train\n siblings\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e9ff-9470.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808;\' --output_kv \'siblings:${appPath}/spark_sql-15f0453e9ff-9470/63D39534-0137-4672-9259-A7EAF6074385/63D39534-0137-4672-9259-A7EAF6074385;\'\n true\n false\n\n\n BinaryClassification_Evaluate-15f04940fe6-f45a\n 1035AB95-287F-4EE3-BA47-D41DB456F0B8\n latest\n 395\n 938\n ${appPath}/BinaryClassification_Evaluate-15f04940fe6-f45a/\n spark-submit --class bda.spark.runnable.evaluate.BinaryClassificationRunner spark.jar --predict_pt ${appPath}/LogisticRegression_Predict-15f0493e084-482f/05003BA7-F72D-451A-B6D9-73714FF97888/05003BA7-F72D-451A-B6D9-73714FF97888\n true\n false\n\n\n SqlETL-15f044e2e71-241f\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 111\n 167\n ${appPath}/SqlETL-15f044e2e71-241f/\n BED112EC-CA3D-45C4-86D2-29C7612803B9\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Survived\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044e2e71-241f/BED112EC-CA3D-45C4-86D2-29C7612803B9/BED112EC-CA3D-45C4-86D2-29C7612803B9 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Survived\' --format \'json\'\n true\n false\n\n\n LogisticRegression_Predict-15f0493e084-482f\n LogisticRegression_Predict\n latest\n 403\n 862\n ${appPath}/LogisticRegression_Predict-15f0493e084-482f/\n 05003BA7-F72D-451A-B6D9-73714FF97888\n spark-submit --class bda.spark.runnable.logisticRegression.Predict spark.jar --model_pt ${appPath}/LogisticRegression_Train-15f0493ba7a-b9e2/56A5912F-5783-47DB-92EE-8A78F2AFD515/56A5912F-5783-47DB-92EE-8A78F2AFD515 --test_pt ${appPath}/File_split-15f049392b3-6fa7/A727BDA2-7F19-4B28-B28E-30B0E876378E/A727BDA2-7F19-4B28-B28E-30B0E876378E --predict_pt ${appPath}/LogisticRegression_Predict-15f0493e084-482f/05003BA7-F72D-451A-B6D9-73714FF97888/05003BA7-F72D-451A-B6D9-73714FF97888\n true\n false\n\n\n Shell-15f048b17ea-9823\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 658\n 399\n ${appPath}/Shell-15f048b17ea-9823/\n 13D1F867-D15C-47FC-9F48-3AC4A29887F0\n 1\n 1\n \n sh Shell-15f048b17ea-9823.script 20A97032-74CB-4B77-B4DA-E640B74B9825 13D1F867-D15C-47FC-9F48-3AC4A29887F0\n false\n true\n\n\n FormatTransform-15f048a590b-1bfd\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 507\n 330\n ${appPath}/FormatTransform-15f048a590b-1bfd/\n D0A14D51-D580-46E5-A9B8-30C0D23F7C65\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e8f9-43fc/BA8A93FB-9EAA-4525-947A-2920F509B1F2/BA8A93FB-9EAA-4525-947A-2920F509B1F2 --output_pt ${appPath}/FormatTransform-15f048a590b-1bfd/D0A14D51-D580-46E5-A9B8-30C0D23F7C65/D0A14D51-D580-46E5-A9B8-30C0D23F7C65\n true\n false\n\n\n Shell-15f048b143e-f0fc\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 384\n 400\n ${appPath}/Shell-15f048b143e-f0fc/\n 5894334B-E814-40A8-9B20-C0B28BC4522D\n 1\n 1\n \n sh Shell-15f048b143e-f0fc.script C0B15993-17BC-4DAC-80B2-2877F7494DCC 5894334B-E814-40A8-9B20-C0B28BC4522D\n false\n true\n\n\n JsonToLabelPoint-15f04935c77-65fa\n C7A9256B-0DEE-4481-9F43-20EFE0DAB4FB\n latest\n 379\n 618\n ${appPath}/JsonToLabelPoint-15f04935c77-65fa/\n 11B339B8-806E-411F-AAD8-9B544F214018\n 9:survived\n 11:true\n spark-submit --class \"bda.spark.labelpoint.JsonToLabelPoint\" --conf \"spark.cores.max=10\" bda-spark.jar --output_pt ${appPath}/JsonToLabelPoint-15f04935c77-65fa/11B339B8-806E-411F-AAD8-9B544F214018/11B339B8-806E-411F-AAD8-9B544F214018 --label_col \'survived\' --is_class \'true\' --input_pt ${appPath}/FormatTransform-15f049308ab-1111/72772B3A-F0B1-4C99-BFB9-5BF269B23E52/72772B3A-F0B1-4C99-BFB9-5BF269B23E52\n true\n false\n\n\n LogisticRegression_Train-15f0493ba7a-b9e2\n LogisticRegression_Train\n latest\n 299\n 783\n ${appPath}/LogisticRegression_Train-15f0493ba7a-b9e2/\n 56A5912F-5783-47DB-92EE-8A78F2AFD515\n 11:false\n 13:20\n 15:0.01\n 17:0.1\n spark-submit --class bda.spark.runnable.logisticRegression.Train spark.jar --train_pt ${appPath}/File_split-15f049392b3-6fa7/BADAC0A9-B811-4884-B187-464D99F2647F/BADAC0A9-B811-4884-B187-464D99F2647F --validate_pt ${appPath}/File_split-15f049392b3-6fa7/A727BDA2-7F19-4B28-B28E-30B0E876378E/A727BDA2-7F19-4B28-B28E-30B0E876378E --model_pt ${appPath}/LogisticRegression_Train-15f0493ba7a-b9e2/56A5912F-5783-47DB-92EE-8A78F2AFD515/56A5912F-5783-47DB-92EE-8A78F2AFD515 --graphx false --max_iter 20 --reg 0.01 --learn_rate 0.1\n true\n false\n\n\n Shell-15f048b169f-1419\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 521\n 399\n ${appPath}/Shell-15f048b169f-1419/\n DA3D71A0-3B03-49F6-BC8A-C27D404ED032\n 1\n 1\n \n sh Shell-15f048b169f-1419.script D0A14D51-D580-46E5-A9B8-30C0D23F7C65 DA3D71A0-3B03-49F6-BC8A-C27D404ED032\n false\n true\n\n\n SqlETL-15f044e2e71-241f:0\n spark_sql-15f0453e351-2e41:0\n\n\n SqlETL-15f044f0928-982b:0\n spark_sql-15f0453e651-c3cf:0\n\n\n SqlETL-15f044f01b9-3047:0\n spark_sql-15f0453e7a9-3edd:0\n\n\n SqlETL-15f044f2851-46cc:0\n spark_sql-15f0453e8f9-43fc:0\n\n\n SqlETL-15f044f2851-46cc:0\n spark_sql-15f0453e9ff-9470:0\n\n\n SqlETL-15f044f2851-46cc:0\n spark_sql-15f0453e516-77ee:0\n\n\n spark_sql-15f0453e351-2e41:0\n FormatTransform-15f04568619-76fd:0\n\n\n spark_sql-15f0453e651-c3cf:0\n FormatTransform-15f0456b9e0-ca2d:0\n\n\n spark_sql-15f0453e7a9-3edd:0\n FormatTransform-15f048a11cb-4e6c:0\n\n\n spark_sql-15f0453e8f9-43fc:0\n FormatTransform-15f048a590b-1bfd:0\n\n\n spark_sql-15f0453e9ff-9470:0\n FormatTransform-15f048a7fda-5e75:0\n\n\n spark_sql-15f0453e516-77ee:0\n FormatTransform-15f048aa48a-86f7:0\n\n\n FormatTransform-15f04568619-76fd:0\n Shell-15f048b174a-2a34:0\n\n\n FormatTransform-15f0456b9e0-ca2d:0\n Shell-15f048b1892-ba2b:0\n\n\n FormatTransform-15f048a11cb-4e6c:0\n Shell-15f048b143e-f0fc:0\n\n\n FormatTransform-15f048a590b-1bfd:0\n Shell-15f048b169f-1419:0\n\n\n FormatTransform-15f048a7fda-5e75:0\n Shell-15f048b17ea-9823:0\n\n\n FormatTransform-15f048aa48a-86f7:0\n Shell-15f048b15dc-f65e:0\n\n\n Shell-15f048b174a-2a34:0\n Shell-15f04925385-3907:0\n\n\n Shell-15f048b1892-ba2b:0\n Shell-15f04925385-3907:1\n\n\n Shell-15f048b143e-f0fc:0\n Shell-15f04925385-3907:2\n\n\n Shell-15f048b169f-1419:0\n Shell-15f04925385-3907:3\n\n\n Shell-15f048b17ea-9823:0\n Shell-15f04925385-3907:4\n\n\n Shell-15f048b15dc-f65e:0\n Shell-15f04925385-3907:5\n\n\n Shell-15f04925385-3907:0\n FormatTransform-15f049308ab-1111:0\n\n\n FormatTransform-15f049308ab-1111:0\n JsonToLabelPoint-15f04935c77-65fa:0\n\n\n JsonToLabelPoint-15f04935c77-65fa:0\n File_split-15f049392b3-6fa7:0\n\n\n File_split-15f049392b3-6fa7:0\n LogisticRegression_Train-15f0493ba7a-b9e2:0\n\n\n File_split-15f049392b3-6fa7:1\n LogisticRegression_Train-15f0493ba7a-b9e2:1\n\n\n LogisticRegression_Train-15f0493ba7a-b9e2:0\n LogisticRegression_Predict-15f0493e084-482f:0\n\n\n File_split-15f049392b3-6fa7:1\n LogisticRegression_Predict-15f0493e084-482f:1\n\n\n LogisticRegression_Predict-15f0493e084-482f:0\n BinaryClassification_Evaluate-15f04940fe6-f45a:0\n\n', 'bdaict@hotmail.com', 'Use distributed logistic regression model to predict survival on the Titanic. The data in the demo come from kaggle. The use of etlã€spark sqlã€programable script component can be seen in the demo .', '2017-10-18 15:55:39', null, '1', '0000020-171011074245692-oozie-root-W'); diff --git a/mysql/category.sql b/mysql/studio/category.sql similarity index 89% rename from mysql/category.sql rename to mysql/studio/category.sql index dc7299a..29135ac 100644 --- a/mysql/category.sql +++ b/mysql/studio/category.sql @@ -1,16 +1,16 @@ /* Navicat MySQL Data Transfer -Source Server : BDA -Source Server Version : 50173 -Source Host : bda04:3306 -Source Database : studio4 +Source Server : BDA(烟å°) +Source Server Version : 50717 +Source Host : 10.20.13.7:3306 +Source Database : studio Target Server Type : MYSQL -Target Server Version : 50173 +Target Server Version : 50717 File Encoding : 65001 -Date: 2017-06-26 20:59:51 +Date: 2017-10-18 16:27:48 */ SET FOREIGN_KEY_CHECKS=0; diff --git a/mysql/dataset.sql b/mysql/studio/dataset.sql similarity index 94% rename from mysql/dataset.sql rename to mysql/studio/dataset.sql index 0fd3b3f..1d2c7ff 100644 --- a/mysql/dataset.sql +++ b/mysql/studio/dataset.sql @@ -1,7 +1,7 @@ /* Navicat MySQL Data Transfer -Source Server : 10.20.13.7 +Source Server : BDA(烟å°) Source Server Version : 50717 Source Host : 10.20.13.7:3306 Source Database : studio @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50717 File Encoding : 65001 -Date: 2017-05-01 22:45:20 +Date: 2017-10-18 16:27:57 */ SET FOREIGN_KEY_CHECKS=0; diff --git a/mysql/jobcron.sql b/mysql/studio/jobcron.sql similarity index 91% rename from mysql/jobcron.sql rename to mysql/studio/jobcron.sql index 5b92d63..22f56d6 100644 --- a/mysql/jobcron.sql +++ b/mysql/studio/jobcron.sql @@ -1,7 +1,7 @@ /* Navicat MySQL Data Transfer -Source Server : 10.20.13.7 +Source Server : BDA(烟å°) Source Server Version : 50717 Source Host : 10.20.13.7:3306 Source Database : studio @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50717 File Encoding : 65001 -Date: 2017-05-01 22:45:31 +Date: 2017-10-18 16:28:07 */ SET FOREIGN_KEY_CHECKS=0; diff --git a/mysql/studio/moduleversion.sql b/mysql/studio/moduleversion.sql new file mode 100644 index 0000000..b1ce10f --- /dev/null +++ b/mysql/studio/moduleversion.sql @@ -0,0 +1,30 @@ +/* +Navicat MySQL Data Transfer + +Source Server : BDA(烟å°) +Source Server Version : 50717 +Source Host : 10.20.13.7:3306 +Source Database : studio + +Target Server Type : MYSQL +Target Server Version : 50717 +File Encoding : 65001 + +Date: 2017-10-18 16:28:16 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for moduleversion +-- ---------------------------- +DROP TABLE IF EXISTS `moduleversion`; +CREATE TABLE `moduleversion` ( + `oldversionid` varchar(100) CHARACTER SET utf8 NOT NULL, + `newversionid` varchar(100) CHARACTER SET utf8 DEFAULT NULL, + PRIMARY KEY (`oldversionid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- ---------------------------- +-- Records of moduleversion +-- ---------------------------- diff --git a/mysql/studio/oozieaction.sql b/mysql/studio/oozieaction.sql new file mode 100644 index 0000000..4482926 --- /dev/null +++ b/mysql/studio/oozieaction.sql @@ -0,0 +1,85 @@ +/* +Navicat MySQL Data Transfer + +Source Server : BDA(烟å°) +Source Server Version : 50717 +Source Host : 10.20.13.7:3306 +Source Database : studio + +Target Server Type : MYSQL +Target Server Version : 50717 +File Encoding : 65001 + +Date: 2017-10-18 16:28:25 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for oozieaction +-- ---------------------------- +DROP TABLE IF EXISTS `oozieaction`; +CREATE TABLE `oozieaction` ( + `jobid` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `cred` varchar(255) DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `retries` int(11) DEFAULT '0', + `userretrycount` int(11) DEFAULT '0', + `userretrymax` int(11) DEFAULT '0', + `userretryinterval` int(11) DEFAULT '0', + `starttime` varchar(255) DEFAULT NULL, + `endtime` varchar(255) DEFAULT NULL, + `transition` varchar(255) DEFAULT NULL, + `stats` varchar(255) DEFAULT NULL, + `externalchildids` varchar(255) DEFAULT NULL, + `externalid` varchar(255) DEFAULT NULL, + `externalstatus` varchar(255) DEFAULT NULL, + `trackeruri` varchar(255) DEFAULT NULL, + `consoleurl` varchar(255) DEFAULT NULL, + `errorcode` varchar(255) DEFAULT NULL, + `errormessage` varchar(1000) DEFAULT NULL, + `apppath` varchar(255) DEFAULT NULL, + `ooziejobid` varchar(255) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of oozieaction +-- ---------------------------- +INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'RMSE-15bc2b909a8-346a', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:11:26', '2017-05-01 08:12:04', 'end', null, null, 'job_1493624196048_0009', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0009/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'File_split-15bc2b97594-306b', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:08:48', '2017-05-01 08:09:24', 'File_split-15bc2b9d556-f370', null, null, 'job_1493624196048_0004', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0004/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'GBRT_Train-15bc2b99d06-b3a7', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:10:00', '2017-05-01 08:10:45', 'fork-E3EC0509-121A-4290-8851-DC01695DFBE2', null, null, 'job_1493624196048_0006', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0006/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'GBRT_Predict-15bc2b9c369-f641', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:10:46', '2017-05-01 08:11:26', 'join-E3EC0509-121A-4290-8851-DC01695DFBE2', null, null, 'job_1493624196048_0008', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0008/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'GBRT_Predict-15bc2b9b546-d790', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:10:45', '2017-05-01 08:11:20', 'join-E3EC0509-121A-4290-8851-DC01695DFBE2', null, null, 'job_1493624196048_0007', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0007/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'File_split-15bc2b9d556-f370', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:09:24', '2017-05-01 08:10:00', 'GBRT_Train-15bc2b99d06-b3a7', null, null, 'job_1493624196048_0005', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0005/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('05010808093800000-bda', 'LibSVM2LabeledPoint-15bc2b9f8ca-3180', null, 'shell', 'OK', '0', '0', '0', '0', '2017-05-01 08:08:11', '2017-05-01 08:08:48', 'File_split-15bc2b97594-306b', null, null, 'job_1493624196048_0003', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1493624196048_0003/', null, null, '/EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45', '0000001-170501074411311-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'spark_sql-15f0453e7a9-3edd', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:59:15', '2017-10-18 16:02:10', 'join-6EB4DCC3-E348-4E31-A438-016593FF0AB0', null, null, 'job_1507772893546_0063', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0063/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'FormatTransform-15f048a11cb-4e6c', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:02:11', '2017-10-18 16:03:33', 'join-46C4B6D8-60D9-4164-9BF6-53DA5C6A6F31', null, null, 'job_1507772893546_0067', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0067/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'Shell-15f048b143e-f0fc', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:04:15', '2017-10-18 16:05:02', 'join-CD3A9B45-A263-4CB3-9F5E-E0BE077948B2', null, null, 'job_1507772893546_0072', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0072/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'Shell-15f04925385-3907', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:05:31', '2017-10-18 16:06:08', 'FormatTransform-15f049308ab-1111', null, null, 'job_1507772893546_0076', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0076/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'FormatTransform-15f049308ab-1111', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:06:08', '2017-10-18 16:06:45', 'JsonToLabelPoint-15f04935c77-65fa', null, null, 'job_1507772893546_0077', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0077/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'JsonToLabelPoint-15f04935c77-65fa', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:06:45', '2017-10-18 16:07:23', 'File_split-15f049392b3-6fa7', null, null, 'job_1507772893546_0078', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0078/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'File_split-15f049392b3-6fa7', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:07:23', '2017-10-18 16:08:00', 'LogisticRegression_Train-15f0493ba7a-b9e2', null, null, 'job_1507772893546_0079', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0079/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'LogisticRegression_Train-15f0493ba7a-b9e2', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:08:00', '2017-10-18 16:08:39', 'LogisticRegression_Predict-15f0493e084-482f', null, null, 'job_1507772893546_0080', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0080/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'LogisticRegression_Predict-15f0493e084-482f', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:08:39', '2017-10-18 16:09:15', 'BinaryClassification_Evaluate-15f04940fe6-f45a', null, null, 'job_1507772893546_0081', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0081/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'BinaryClassification_Evaluate-15f04940fe6-f45a', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:09:15', '2017-10-18 16:09:54', 'end', null, null, 'job_1507772893546_0082', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0082/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'spark_sql-15f0453e516-77ee', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:59:15', '2017-10-18 16:01:11', 'join-6EB4DCC3-E348-4E31-A438-016593FF0AB0', null, null, 'job_1507772893546_0061', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0061/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'FormatTransform-15f048aa48a-86f7', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:02:12', '2017-10-18 16:04:14', 'join-46C4B6D8-60D9-4164-9BF6-53DA5C6A6F31', null, null, 'job_1507772893546_0069', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0069/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'Shell-15f048b15dc-f65e', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:04:14', '2017-10-18 16:04:39', 'join-CD3A9B45-A263-4CB3-9F5E-E0BE077948B2', null, null, 'job_1507772893546_0071', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0071/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'spark_sql-15f0453e651-c3cf', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:59:13', '2017-10-18 16:00:10', 'join-6EB4DCC3-E348-4E31-A438-016593FF0AB0', null, null, 'job_1507772893546_0058', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0058/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'FormatTransform-15f0456b9e0-ca2d', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:02:12', '2017-10-18 16:04:11', 'join-46C4B6D8-60D9-4164-9BF6-53DA5C6A6F31', null, null, 'job_1507772893546_0068', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0068/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'Shell-15f048b1892-ba2b', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:04:14', '2017-10-18 16:04:37', 'join-CD3A9B45-A263-4CB3-9F5E-E0BE077948B2', null, null, 'job_1507772893546_0070', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0070/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'spark_sql-15f0453e351-2e41', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:59:14', '2017-10-18 16:01:09', 'join-6EB4DCC3-E348-4E31-A438-016593FF0AB0', null, null, 'job_1507772893546_0060', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0060/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'FormatTransform-15f04568619-76fd', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:02:10', '2017-10-18 16:02:51', 'join-46C4B6D8-60D9-4164-9BF6-53DA5C6A6F31', null, null, 'job_1507772893546_0065', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0065/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'Shell-15f048b174a-2a34', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:04:15', '2017-10-18 16:05:05', 'join-CD3A9B45-A263-4CB3-9F5E-E0BE077948B2', null, null, 'job_1507772893546_0073', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0073/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'SqlETL-15f044f01b9-3047', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:57:49', '2017-10-18 15:59:13', 'join-59A135DF-2278-437B-9D41-6CF80EF3801F', null, null, 'job_1507772893546_0057', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0057/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'SqlETL-15f044f0928-982b', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:57:48', '2017-10-18 15:58:28', 'join-59A135DF-2278-437B-9D41-6CF80EF3801F', null, null, 'job_1507772893546_0055', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0055/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'FormatTransform-15f048a7fda-5e75', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:02:10', '2017-10-18 16:02:49', 'join-46C4B6D8-60D9-4164-9BF6-53DA5C6A6F31', null, null, 'job_1507772893546_0064', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0064/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'Shell-15f048b17ea-9823', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:04:16', '2017-10-18 16:05:28', 'join-CD3A9B45-A263-4CB3-9F5E-E0BE077948B2', null, null, 'job_1507772893546_0074', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0074/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'SqlETL-15f044f2851-46cc', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:57:47', '2017-10-18 15:58:28', 'join-59A135DF-2278-437B-9D41-6CF80EF3801F', null, null, 'job_1507772893546_0054', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0054/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'spark_sql-15f0453e8f9-43fc', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:59:15', '2017-10-18 16:02:09', 'join-6EB4DCC3-E348-4E31-A438-016593FF0AB0', null, null, 'job_1507772893546_0062', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0062/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'FormatTransform-15f048a590b-1bfd', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:02:11', '2017-10-18 16:03:30', 'join-46C4B6D8-60D9-4164-9BF6-53DA5C6A6F31', null, null, 'job_1507772893546_0066', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0066/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'Shell-15f048b169f-1419', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 16:04:16', '2017-10-18 16:05:31', 'join-CD3A9B45-A263-4CB3-9F5E-E0BE077948B2', null, null, 'job_1507772893546_0075', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0075/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'spark_sql-15f0453e9ff-9470', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:59:14', '2017-10-18 16:00:12', 'join-6EB4DCC3-E348-4E31-A438-016593FF0AB0', null, null, 'job_1507772893546_0059', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0059/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); +INSERT INTO `oozieaction` VALUES ('1018155522800001-bda', 'SqlETL-15f044e2e71-241f', null, 'shell', 'OK', '0', '0', '0', '0', '2017-10-18 15:57:48', '2017-10-18 15:59:12', 'join-59A135DF-2278-437B-9D41-6CF80EF3801F', null, null, 'job_1507772893546_0056', 'SUCCEEDED', 'hadoop-master:8032', 'http://hadoop-master:8088/proxy/application_1507772893546_0056/', null, null, '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '0000020-171011074245692-oozie-root-W'); diff --git a/mysql/studio/ooziejob.sql b/mysql/studio/ooziejob.sql new file mode 100644 index 0000000..fbfada4 --- /dev/null +++ b/mysql/studio/ooziejob.sql @@ -0,0 +1,42 @@ +/* +Navicat MySQL Data Transfer + +Source Server : BDA(烟å°) +Source Server Version : 50717 +Source Host : 10.20.13.7:3306 +Source Database : studio + +Target Server Type : MYSQL +Target Server Version : 50717 +File Encoding : 65001 + +Date: 2017-10-18 16:28:36 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for ooziejob +-- ---------------------------- +DROP TABLE IF EXISTS `ooziejob`; +CREATE TABLE `ooziejob` ( + `id` varchar(255) CHARACTER SET utf8 NOT NULL, + `name` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `path` varchar(255) DEFAULT NULL, + `graphxml` text CHARACTER SET utf8, + `status` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `account` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `description` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `createtime` varchar(30) CHARACTER SET utf8 DEFAULT NULL, + `endtime` varchar(30) CHARACTER SET utf8 DEFAULT NULL, + `isexample` tinyint(5) DEFAULT '0', + `jobid` varchar(255) DEFAULT NULL, + `sequence` int(255) DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- ---------------------------- +-- Records of ooziejob +-- ---------------------------- +INSERT INTO `ooziejob` VALUES ('0000018-171011074245692-oozie-root-W', 'Examples of distributed abalone age prediction', '/EML/oozie/APP-PATH-d65566bb-f011-4c6f-9220-2c86ef58a6df', '\n\n DataSet-15bc2ba1b9b-fe1c\n Dataset\n 454\n 74\n /EML/Data/Dataset\n\n\n RMSE-15bc2b909a8-346a\n RMSE\n 0000001-170501074411311-oozie-root-W\n 352\n 495\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/RMSE-15bc2b909a8-346a/\n spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Predict-15bc2b9c369-f641/5BE7BEAE-135C-4F48-90C9-21EC291AEF89/5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n true\n false\n\n\n GBRT_Train-15bc2b99d06-b3a7\n GBRT_Train\n 0000001-170501074411311-oozie-root-W\n 355\n 355\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Train-15bc2b99d06-b3a7/\n F0665C46-A1FC-4C9F-BA6D-8C97D571A372\n 11:Variance\n 13:10\n 15:32\n 17:10000\n 19:15\n 21:1e-6\n 23:10\n 25:0.02\n spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b9d556-f370/13C2F84E-6FBA-46FC-BE81-CD047C15B138/13C2F84E-6FBA-46FC-BE81-CD047C15B138 --model_pt \'\' --cp_pt /EML/tmp --impurity \'Variance\' --max_depth 10 --max_bins 32 --bin_samples 10000 --min_node_size 15 --min_info_gain 1e-6 --num_round 10 --learn_rate 0.02\n true\n false\n\n\n File_split-15bc2b97594-306b\n File_split\n 0000001-170501074411311-oozie-root-W\n 420\n 219\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b97594-306b/\n 00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7\n AD415C51-4BAF-443C-868E-F0B59C744F1B\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/LibSVM2LabeledPoint-15bc2b9f8ca-3180/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC/9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC --ratio 0.8 --output_pt1 \'\' --output_pt2 \'\'\n true\n false\n\n\n GBRT_Predict-15bc2b9b546-d790\n GBRT_Predict\n 0000001-170501074411311-oozie-root-W\n 531\n 435\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Predict-15bc2b9b546-d790/\n 9129BB64-6AB1-46F6-8E24-6F8A4A481998\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b97594-306b/AD415C51-4BAF-443C-868E-F0B59C744F1B/AD415C51-4BAF-443C-868E-F0B59C744F1B --predict_pt \'\'\n true\n false\n\n\n File_split-15bc2b9d556-f370\n File_split\n 0000001-170501074411311-oozie-root-W\n 401\n 286\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b9d556-f370/\n 13C2F84E-6FBA-46FC-BE81-CD047C15B138\n 4537F376-6E1E-4CC5-B8C6-8F8680683767\n 7:0.6\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b97594-306b/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7/00008E8E-6BBC-45A6-A7F4-A6C499E2A3A7 --ratio 0.6 --output_pt1 \'\' --output_pt2 \'\'\n true\n false\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180\n LibSVM2LabeledPoint\n 0000001-170501074411311-oozie-root-W\n 390\n 156\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/LibSVM2LabeledPoint-15bc2b9f8ca-3180/\n 9EF6C361-1D0B-42D6-B0AA-C0CECA9586DC\n 9:true\n spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt /EML/Data/Dataset/Dataset --output_pt \'\' --is_class true\n true\n false\n\n\n GBRT_Predict-15bc2b9c369-f641\n GBRT_Predict\n 0000001-170501074411311-oozie-root-W\n 347\n 434\n /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Predict-15bc2b9c369-f641/\n 5BE7BEAE-135C-4F48-90C9-21EC291AEF89\n spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/GBRT_Train-15bc2b99d06-b3a7/F0665C46-A1FC-4C9F-BA6D-8C97D571A372/F0665C46-A1FC-4C9F-BA6D-8C97D571A372 --test_pt /EML/oozie/APP-PATH-bd13e472-381b-4fd1-9e29-42a36dc11a45/File_split-15bc2b9d556-f370/4537F376-6E1E-4CC5-B8C6-8F8680683767/4537F376-6E1E-4CC5-B8C6-8F8680683767 --predict_pt \'\'\n true\n false\n\n\n DataSet-15bc2ba1b9b-fe1c:0\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n\n\n LibSVM2LabeledPoint-15bc2b9f8ca-3180:0\n File_split-15bc2b97594-306b:0\n\n\n File_split-15bc2b97594-306b:0\n File_split-15bc2b9d556-f370:0\n\n\n File_split-15bc2b9d556-f370:0\n GBRT_Train-15bc2b99d06-b3a7:0\n\n\n File_split-15bc2b97594-306b:1\n GBRT_Predict-15bc2b9b546-d790:1\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9b546-d790:0\n\n\n GBRT_Train-15bc2b99d06-b3a7:0\n GBRT_Predict-15bc2b9c369-f641:0\n\n\n File_split-15bc2b9d556-f370:1\n GBRT_Predict-15bc2b9c369-f641:1\n\n\n GBRT_Predict-15bc2b9c369-f641:0\n RMSE-15bc2b909a8-346a:0\n\n', 'SUCCEEDED', 'bdaict@hotmail.com', 'Use the GDBT regression model to predict abalone age', '2017-10-13 09:30:36', '2017-10-13 09:30:36', '0', '05010808093800000-bda', '0'); +INSERT INTO `ooziejob` VALUES ('0000020-171011074245692-oozie-root-W', 'Titanic Demo For Kaggle', '/EML/oozie/APP-PATH-4d79309d-8163-47c6-9429-5b8e58193e53', '\n\n spark_sql-15f0453e7a9-3edd\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 381\n 249\n ${appPath}/spark_sql-15f0453e7a9-3edd/\n 4450E78E-CC61-4BB6-9B55-1D44B09E4F71\n Train\n after_name_sex\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e7a9-3edd.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f01b9-3047/90BAE136-31D1-462F-9A31-2A847579E760/90BAE136-31D1-462F-9A31-2A847579E760;\' --output_kv \'after_name_sex:${appPath}/spark_sql-15f0453e7a9-3edd/4450E78E-CC61-4BB6-9B55-1D44B09E4F71/4450E78E-CC61-4BB6-9B55-1D44B09E4F71;\'\n true\n false\n\n\n spark_sql-15f0453e516-77ee\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 773\n 255\n ${appPath}/spark_sql-15f0453e516-77ee/\n BC22DDD6-9970-4980-90FC-5607A7B4B39C\n Train\n parch\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e516-77ee.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808;\' --output_kv \'parch:${appPath}/spark_sql-15f0453e516-77ee/BC22DDD6-9970-4980-90FC-5607A7B4B39C/BC22DDD6-9970-4980-90FC-5607A7B4B39C;\'\n true\n false\n\n\n spark_sql-15f0453e651-c3cf\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 248\n 250\n ${appPath}/spark_sql-15f0453e651-c3cf/\n E4262E65-FC25-4C95-8EA0-6B66A8C64432\n Train\n fare\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e651-c3cf.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f0928-982b/08473566-A5C1-4A35-8ADB-0BE227F66B67/08473566-A5C1-4A35-8ADB-0BE227F66B67;\' --output_kv \'fare:${appPath}/spark_sql-15f0453e651-c3cf/E4262E65-FC25-4C95-8EA0-6B66A8C64432/E4262E65-FC25-4C95-8EA0-6B66A8C64432;\'\n true\n false\n\n\n spark_sql-15f0453e351-2e41\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 109\n 248\n ${appPath}/spark_sql-15f0453e351-2e41/\n 6939CE20-29D4-42E6-8347-35B6B712CDC0\n Train\n survive\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e351-2e41.script\' --input_kv \'Train:${appPath}/SqlETL-15f044e2e71-241f/BED112EC-CA3D-45C4-86D2-29C7612803B9/BED112EC-CA3D-45C4-86D2-29C7612803B9;\' --output_kv \'survive:${appPath}/spark_sql-15f0453e351-2e41/6939CE20-29D4-42E6-8347-35B6B712CDC0/6939CE20-29D4-42E6-8347-35B6B712CDC0;\'\n true\n false\n\n\n SqlETL-15f044f01b9-3047\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 379\n 165\n ${appPath}/SqlETL-15f044f01b9-3047/\n 90BAE136-31D1-462F-9A31-2A847579E760\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Pclass,Sex\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044f01b9-3047/90BAE136-31D1-462F-9A31-2A847579E760/90BAE136-31D1-462F-9A31-2A847579E760 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Pclass,Sex\' --format \'json\'\n true\n false\n\n\n SqlETL-15f044f0928-982b\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 245\n 167\n ${appPath}/SqlETL-15f044f0928-982b/\n 08473566-A5C1-4A35-8ADB-0BE227F66B67\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Fare\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044f0928-982b/08473566-A5C1-4A35-8ADB-0BE227F66B67/08473566-A5C1-4A35-8ADB-0BE227F66B67 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Fare\' --format \'json\'\n true\n false\n\n\n FormatTransform-15f04568619-76fd\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 90\n 329\n ${appPath}/FormatTransform-15f04568619-76fd/\n 1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e351-2e41/6939CE20-29D4-42E6-8347-35B6B712CDC0/6939CE20-29D4-42E6-8347-35B6B712CDC0 --output_pt ${appPath}/FormatTransform-15f04568619-76fd/1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5/1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5\n true\n false\n\n\n FormatTransform-15f048a7fda-5e75\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 646\n 329\n ${appPath}/FormatTransform-15f048a7fda-5e75/\n 20A97032-74CB-4B77-B4DA-E640B74B9825\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e9ff-9470/63D39534-0137-4672-9259-A7EAF6074385/63D39534-0137-4672-9259-A7EAF6074385 --output_pt ${appPath}/FormatTransform-15f048a7fda-5e75/20A97032-74CB-4B77-B4DA-E640B74B9825/20A97032-74CB-4B77-B4DA-E640B74B9825\n true\n false\n\n\n FormatTransform-15f048aa48a-86f7\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 792\n 328\n ${appPath}/FormatTransform-15f048aa48a-86f7/\n 3D90A0F7-6FB1-4616-85BE-6029B5D87D5B\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e516-77ee/BC22DDD6-9970-4980-90FC-5607A7B4B39C/BC22DDD6-9970-4980-90FC-5607A7B4B39C --output_pt ${appPath}/FormatTransform-15f048aa48a-86f7/3D90A0F7-6FB1-4616-85BE-6029B5D87D5B/3D90A0F7-6FB1-4616-85BE-6029B5D87D5B\n true\n false\n\n\n SqlETL-15f044f2851-46cc\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 638\n 162\n ${appPath}/SqlETL-15f044f2851-46cc/\n 7448154C-CBD9-4C2B-8EA7-FF31ED956808\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Age,SibSp,Parch\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Age,SibSp,Parch\' --format \'json\'\n true\n false\n\n\n spark_sql-15f0453e8f9-43fc\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 505\n 252\n ${appPath}/spark_sql-15f0453e8f9-43fc/\n BA8A93FB-9EAA-4525-947A-2920F509B1F2\n Train\n age\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e8f9-43fc.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808;\' --output_kv \'age:${appPath}/spark_sql-15f0453e8f9-43fc/BA8A93FB-9EAA-4525-947A-2920F509B1F2/BA8A93FB-9EAA-4525-947A-2920F509B1F2;\'\n true\n false\n\n\n FormatTransform-15f048a11cb-4e6c\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 370\n 329\n ${appPath}/FormatTransform-15f048a11cb-4e6c/\n C0B15993-17BC-4DAC-80B2-2877F7494DCC\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e7a9-3edd/4450E78E-CC61-4BB6-9B55-1D44B09E4F71/4450E78E-CC61-4BB6-9B55-1D44B09E4F71 --output_pt ${appPath}/FormatTransform-15f048a11cb-4e6c/C0B15993-17BC-4DAC-80B2-2877F7494DCC/C0B15993-17BC-4DAC-80B2-2877F7494DCC\n true\n false\n\n\n FormatTransform-15f0456b9e0-ca2d\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 229\n 329\n ${appPath}/FormatTransform-15f0456b9e0-ca2d/\n 9E3B8169-401A-4EA6-8542-F1A08B682779\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e651-c3cf/E4262E65-FC25-4C95-8EA0-6B66A8C64432/E4262E65-FC25-4C95-8EA0-6B66A8C64432 --output_pt ${appPath}/FormatTransform-15f0456b9e0-ca2d/9E3B8169-401A-4EA6-8542-F1A08B682779/9E3B8169-401A-4EA6-8542-F1A08B682779\n true\n false\n\n\n Shell-15f048b174a-2a34\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 106\n 399\n ${appPath}/Shell-15f048b174a-2a34/\n F8B9C1F4-B9DF-44D4-8E41-4D7EE58B419C\n 1\n 1\n \n sh Shell-15f048b174a-2a34.script 1C3CD804-1ECC-4280-9EEB-F3DAB77E4EC5 F8B9C1F4-B9DF-44D4-8E41-4D7EE58B419C\n false\n true\n\n\n File_split-15f049392b3-6fa7\n File_split\n latest\n 392\n 694\n ${appPath}/File_split-15f049392b3-6fa7/\n BADAC0A9-B811-4884-B187-464D99F2647F\n A727BDA2-7F19-4B28-B28E-30B0E876378E\n 7:0.8\n spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt ${appPath}/JsonToLabelPoint-15f04935c77-65fa/11B339B8-806E-411F-AAD8-9B544F214018/11B339B8-806E-411F-AAD8-9B544F214018 --ratio 0.8 --output_pt1 ${appPath}/File_split-15f049392b3-6fa7/BADAC0A9-B811-4884-B187-464D99F2647F/BADAC0A9-B811-4884-B187-464D99F2647F --output_pt2 ${appPath}/File_split-15f049392b3-6fa7/A727BDA2-7F19-4B28-B28E-30B0E876378E/A727BDA2-7F19-4B28-B28E-30B0E876378E\n true\n false\n\n\n Shell-15f048b15dc-f65e\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 803\n 399\n ${appPath}/Shell-15f048b15dc-f65e/\n 4E6540FF-2CC5-44B0-9CC5-DD4C52DB5FFF\n 1\n 1\n \n sh Shell-15f048b15dc-f65e.script 3D90A0F7-6FB1-4616-85BE-6029B5D87D5B 4E6540FF-2CC5-44B0-9CC5-DD4C52DB5FFF\n false\n true\n\n\n Shell-15f048b1892-ba2b\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 245\n 399\n ${appPath}/Shell-15f048b1892-ba2b/\n A10014BF-79AE-4DE3-85C1-7FF62B51C257\n 1\n 1\n \n sh Shell-15f048b1892-ba2b.script 9E3B8169-401A-4EA6-8542-F1A08B682779 A10014BF-79AE-4DE3-85C1-7FF62B51C257\n false\n true\n\n\n FormatTransform-15f049308ab-1111\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 379\n 556\n ${appPath}/FormatTransform-15f049308ab-1111/\n 72772B3A-F0B1-4C99-BFB9-5BF269B23E52\n 5:csv\n 7:json\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'csv\' --output_format \'json\' --input_pt ${appPath}/Shell-15f04925385-3907/F3C164CD-07A1-462D-A7C7-B2D5CD62C155/F3C164CD-07A1-462D-A7C7-B2D5CD62C155 --output_pt ${appPath}/FormatTransform-15f049308ab-1111/72772B3A-F0B1-4C99-BFB9-5BF269B23E52/72772B3A-F0B1-4C99-BFB9-5BF269B23E52\n true\n false\n\n\n Shell-15f04925385-3907\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 390\n 491\n ${appPath}/Shell-15f04925385-3907/\n F3C164CD-07A1-462D-A7C7-B2D5CD62C155\n 6\n 1\n \n sh Shell-15f04925385-3907.script F8B9C1F4-B9DF-44D4-8E41-4D7EE58B419C A10014BF-79AE-4DE3-85C1-7FF62B51C257 5894334B-E814-40A8-9B20-C0B28BC4522D DA3D71A0-3B03-49F6-BC8A-C27D404ED032 13D1F867-D15C-47FC-9F48-3AC4A29887F0 4E6540FF-2CC5-44B0-9CC5-DD4C52DB5FFF F3C164CD-07A1-462D-A7C7-B2D5CD62C155\n false\n true\n\n\n spark_sql-15f0453e9ff-9470\n 0C228899-0267-4FFE-93E3-BDFB8FF7F83E\n latest\n 634\n 251\n ${appPath}/spark_sql-15f0453e9ff-9470/\n 63D39534-0137-4672-9259-A7EAF6074385\n Train\n siblings\n 1\n 1\n \n spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp \'${appPath}/spark_sql-15f0453e9ff-9470.script\' --input_kv \'Train:${appPath}/SqlETL-15f044f2851-46cc/7448154C-CBD9-4C2B-8EA7-FF31ED956808/7448154C-CBD9-4C2B-8EA7-FF31ED956808;\' --output_kv \'siblings:${appPath}/spark_sql-15f0453e9ff-9470/63D39534-0137-4672-9259-A7EAF6074385/63D39534-0137-4672-9259-A7EAF6074385;\'\n true\n false\n\n\n BinaryClassification_Evaluate-15f04940fe6-f45a\n 1035AB95-287F-4EE3-BA47-D41DB456F0B8\n latest\n 395\n 938\n ${appPath}/BinaryClassification_Evaluate-15f04940fe6-f45a/\n spark-submit --class bda.spark.runnable.evaluate.BinaryClassificationRunner spark.jar --predict_pt ${appPath}/LogisticRegression_Predict-15f0493e084-482f/05003BA7-F72D-451A-B6D9-73714FF97888/05003BA7-F72D-451A-B6D9-73714FF97888\n true\n false\n\n\n SqlETL-15f044e2e71-241f\n 75D61276-32E7-418D-A776-F051385FD106\n latest\n 111\n 167\n ${appPath}/SqlETL-15f044e2e71-241f/\n BED112EC-CA3D-45C4-86D2-29C7612803B9\n 9:jdbc:mysql://mysql:3306/test\n 13:root\n 15:111111\n 17:titanic_train\n 19:Survived\n 21:json\n spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url \'jdbc:mysql://mysql:3306/test\' --output_pt ${appPath}/SqlETL-15f044e2e71-241f/BED112EC-CA3D-45C4-86D2-29C7612803B9/BED112EC-CA3D-45C4-86D2-29C7612803B9 --user \'root\' --passwd \'111111\' --table \'titanic_train\' --columns \'Survived\' --format \'json\'\n true\n false\n\n\n LogisticRegression_Predict-15f0493e084-482f\n LogisticRegression_Predict\n latest\n 403\n 862\n ${appPath}/LogisticRegression_Predict-15f0493e084-482f/\n 05003BA7-F72D-451A-B6D9-73714FF97888\n spark-submit --class bda.spark.runnable.logisticRegression.Predict spark.jar --model_pt ${appPath}/LogisticRegression_Train-15f0493ba7a-b9e2/56A5912F-5783-47DB-92EE-8A78F2AFD515/56A5912F-5783-47DB-92EE-8A78F2AFD515 --test_pt ${appPath}/File_split-15f049392b3-6fa7/A727BDA2-7F19-4B28-B28E-30B0E876378E/A727BDA2-7F19-4B28-B28E-30B0E876378E --predict_pt ${appPath}/LogisticRegression_Predict-15f0493e084-482f/05003BA7-F72D-451A-B6D9-73714FF97888/05003BA7-F72D-451A-B6D9-73714FF97888\n true\n false\n\n\n Shell-15f048b17ea-9823\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 658\n 399\n ${appPath}/Shell-15f048b17ea-9823/\n 13D1F867-D15C-47FC-9F48-3AC4A29887F0\n 1\n 1\n \n sh Shell-15f048b17ea-9823.script 20A97032-74CB-4B77-B4DA-E640B74B9825 13D1F867-D15C-47FC-9F48-3AC4A29887F0\n false\n true\n\n\n FormatTransform-15f048a590b-1bfd\n E8BB2E5C-D834-4749-B7F2-FCB72C85C27E\n latest\n 507\n 330\n ${appPath}/FormatTransform-15f048a590b-1bfd/\n D0A14D51-D580-46E5-A9B8-30C0D23F7C65\n 5:json\n 7:csv\n spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format \'json\' --output_format \'csv\' --input_pt ${appPath}/spark_sql-15f0453e8f9-43fc/BA8A93FB-9EAA-4525-947A-2920F509B1F2/BA8A93FB-9EAA-4525-947A-2920F509B1F2 --output_pt ${appPath}/FormatTransform-15f048a590b-1bfd/D0A14D51-D580-46E5-A9B8-30C0D23F7C65/D0A14D51-D580-46E5-A9B8-30C0D23F7C65\n true\n false\n\n\n Shell-15f048b143e-f0fc\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 384\n 400\n ${appPath}/Shell-15f048b143e-f0fc/\n 5894334B-E814-40A8-9B20-C0B28BC4522D\n 1\n 1\n \n sh Shell-15f048b143e-f0fc.script C0B15993-17BC-4DAC-80B2-2877F7494DCC 5894334B-E814-40A8-9B20-C0B28BC4522D\n false\n true\n\n\n JsonToLabelPoint-15f04935c77-65fa\n C7A9256B-0DEE-4481-9F43-20EFE0DAB4FB\n latest\n 379\n 618\n ${appPath}/JsonToLabelPoint-15f04935c77-65fa/\n 11B339B8-806E-411F-AAD8-9B544F214018\n 9:survived\n 11:true\n spark-submit --class \"bda.spark.labelpoint.JsonToLabelPoint\" --conf \"spark.cores.max=10\" bda-spark.jar --output_pt ${appPath}/JsonToLabelPoint-15f04935c77-65fa/11B339B8-806E-411F-AAD8-9B544F214018/11B339B8-806E-411F-AAD8-9B544F214018 --label_col \'survived\' --is_class \'true\' --input_pt ${appPath}/FormatTransform-15f049308ab-1111/72772B3A-F0B1-4C99-BFB9-5BF269B23E52/72772B3A-F0B1-4C99-BFB9-5BF269B23E52\n true\n false\n\n\n LogisticRegression_Train-15f0493ba7a-b9e2\n LogisticRegression_Train\n latest\n 299\n 783\n ${appPath}/LogisticRegression_Train-15f0493ba7a-b9e2/\n 56A5912F-5783-47DB-92EE-8A78F2AFD515\n 11:false\n 13:20\n 15:0.01\n 17:0.1\n spark-submit --class bda.spark.runnable.logisticRegression.Train spark.jar --train_pt ${appPath}/File_split-15f049392b3-6fa7/BADAC0A9-B811-4884-B187-464D99F2647F/BADAC0A9-B811-4884-B187-464D99F2647F --validate_pt ${appPath}/File_split-15f049392b3-6fa7/A727BDA2-7F19-4B28-B28E-30B0E876378E/A727BDA2-7F19-4B28-B28E-30B0E876378E --model_pt ${appPath}/LogisticRegression_Train-15f0493ba7a-b9e2/56A5912F-5783-47DB-92EE-8A78F2AFD515/56A5912F-5783-47DB-92EE-8A78F2AFD515 --graphx false --max_iter 20 --reg 0.01 --learn_rate 0.1\n true\n false\n\n\n Shell-15f048b169f-1419\n 292CB212-FBF8-4A7C-9DDE-B36D2345F522\n latest\n 521\n 399\n ${appPath}/Shell-15f048b169f-1419/\n DA3D71A0-3B03-49F6-BC8A-C27D404ED032\n 1\n 1\n \n sh Shell-15f048b169f-1419.script D0A14D51-D580-46E5-A9B8-30C0D23F7C65 DA3D71A0-3B03-49F6-BC8A-C27D404ED032\n false\n true\n\n\n SqlETL-15f044e2e71-241f:0\n spark_sql-15f0453e351-2e41:0\n\n\n SqlETL-15f044f0928-982b:0\n spark_sql-15f0453e651-c3cf:0\n\n\n SqlETL-15f044f01b9-3047:0\n spark_sql-15f0453e7a9-3edd:0\n\n\n SqlETL-15f044f2851-46cc:0\n spark_sql-15f0453e8f9-43fc:0\n\n\n SqlETL-15f044f2851-46cc:0\n spark_sql-15f0453e9ff-9470:0\n\n\n SqlETL-15f044f2851-46cc:0\n spark_sql-15f0453e516-77ee:0\n\n\n spark_sql-15f0453e351-2e41:0\n FormatTransform-15f04568619-76fd:0\n\n\n spark_sql-15f0453e651-c3cf:0\n FormatTransform-15f0456b9e0-ca2d:0\n\n\n spark_sql-15f0453e7a9-3edd:0\n FormatTransform-15f048a11cb-4e6c:0\n\n\n spark_sql-15f0453e8f9-43fc:0\n FormatTransform-15f048a590b-1bfd:0\n\n\n spark_sql-15f0453e9ff-9470:0\n FormatTransform-15f048a7fda-5e75:0\n\n\n spark_sql-15f0453e516-77ee:0\n FormatTransform-15f048aa48a-86f7:0\n\n\n FormatTransform-15f04568619-76fd:0\n Shell-15f048b174a-2a34:0\n\n\n FormatTransform-15f0456b9e0-ca2d:0\n Shell-15f048b1892-ba2b:0\n\n\n FormatTransform-15f048a11cb-4e6c:0\n Shell-15f048b143e-f0fc:0\n\n\n FormatTransform-15f048a590b-1bfd:0\n Shell-15f048b169f-1419:0\n\n\n FormatTransform-15f048a7fda-5e75:0\n Shell-15f048b17ea-9823:0\n\n\n FormatTransform-15f048aa48a-86f7:0\n Shell-15f048b15dc-f65e:0\n\n\n Shell-15f048b174a-2a34:0\n Shell-15f04925385-3907:0\n\n\n Shell-15f048b1892-ba2b:0\n Shell-15f04925385-3907:1\n\n\n Shell-15f048b143e-f0fc:0\n Shell-15f04925385-3907:2\n\n\n Shell-15f048b169f-1419:0\n Shell-15f04925385-3907:3\n\n\n Shell-15f048b17ea-9823:0\n Shell-15f04925385-3907:4\n\n\n Shell-15f048b15dc-f65e:0\n Shell-15f04925385-3907:5\n\n\n Shell-15f04925385-3907:0\n FormatTransform-15f049308ab-1111:0\n\n\n FormatTransform-15f049308ab-1111:0\n JsonToLabelPoint-15f04935c77-65fa:0\n\n\n JsonToLabelPoint-15f04935c77-65fa:0\n File_split-15f049392b3-6fa7:0\n\n\n File_split-15f049392b3-6fa7:0\n LogisticRegression_Train-15f0493ba7a-b9e2:0\n\n\n File_split-15f049392b3-6fa7:1\n LogisticRegression_Train-15f0493ba7a-b9e2:1\n\n\n LogisticRegression_Train-15f0493ba7a-b9e2:0\n LogisticRegression_Predict-15f0493e084-482f:0\n\n\n File_split-15f049392b3-6fa7:1\n LogisticRegression_Predict-15f0493e084-482f:1\n\n\n LogisticRegression_Predict-15f0493e084-482f:0\n BinaryClassification_Evaluate-15f04940fe6-f45a:0\n\n', 'SUCCEEDED', 'bdaict@hotmail.com', 'Use distributed logistic regression model to predict survival on the Titanic. The data in the demo come from kaggle. The use of etlã€spark sqlã€programable script component can be seen in the demo .', '2017-10-18 15:57:47', '2017-10-18 16:09:54', '0', '1018155522800001-bda', '0'); diff --git a/mysql/program.sql b/mysql/studio/program.sql similarity index 52% rename from mysql/program.sql rename to mysql/studio/program.sql index 7ab139a..f3d0348 100644 --- a/mysql/program.sql +++ b/mysql/studio/program.sql @@ -1,7 +1,7 @@ /* Navicat MySQL Data Transfer -Source Server : 10.20.13.7 +Source Server : BDA(烟å°) Source Server Version : 50717 Source Host : 10.20.13.7:3306 Source Database : studio @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50717 File Encoding : 65001 -Date: 2017-05-01 22:47:21 +Date: 2017-10-18 16:28:47 */ SET FOREIGN_KEY_CHECKS=0; @@ -34,17 +34,24 @@ CREATE TABLE `program` ( `commandline` varchar(5000) DEFAULT NULL, `describXML` varchar(5000) DEFAULT NULL, `scriptversion` varchar(30) DEFAULT NULL, - `programable` tinyint(1) DEFAULT '0' COMMENT '是å¦为å¯编程算å­Â', + `programable` tinyint(1) DEFAULT '0' COMMENT '是å¦为å¯编程ç®â€â€ÃƒÂ¥Ã‚­ÂÂ', + `sourcelink` varchar(500) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of program -- ---------------------------- -INSERT INTO `program` VALUES ('File_split', 'File_split', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/File_split', '0', 'distributed', '0', '', '0.1', '2017-04-28 17:08:20', 'spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt {in:Data:\"Input_file\"} --ratio [\"Cut_ratio\":Double:default,0.5] --output_pt1 {out:Data,HFile:\"Output_file_1(ratio)\"} --output_pt2 {out:Data,HFile:\"Output_fie(1-ratio)\"} ', null, '2', '0'); -INSERT INTO `program` VALUES ('GBRT_Predict', 'GBRT_Predict', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/GBRT_Predict', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:25:55', 'spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt {in:ObjectFile:\"Model_file\"} --test_pt {in:LabeledPoint:\"test_file\"} --predict_pt {out:TextFile:\"Predict_file\"} ', null, '2', '0'); -INSERT INTO `program` VALUES ('GBRT_Train', 'GBRT_Train', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/GBRT_Train', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:27:42', 'spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt {in:LabeledPoint:\"Train_file\"} --model_pt {out:ObjectFile,HFile:\"Model_file\"} --cp_pt /EML/tmp --impurity [\"impurity\":String:default,\"Variance\"] --max_depth [\"Max_depth\":Int:default,10] --max_bins [\"Max_bins\":Int:default,32] --bin_samples [\"Bin_sample\":Int:default,10000] --min_node_size [\"Min_node_size\":Int:default,15] --min_info_gain [\"Min_info_gain\":Double:default,1e-6] --num_round [\"Round\":Int:default,10] --learn_rate [\"Learning_rate\":Double:default,0.02] ', null, '2', '0'); -INSERT INTO `program` VALUES ('LibSVM2LabeledPoint', 'LibSVM2LabeledPoint', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/LibSVM2LabeledPoint', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:28:19', 'spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt {in:LibSVM:\"LibSVM_data_file\"} --output_pt {out:LabeledPoint,HFile:\"LabeledPoint_data_file\"} --is_class [\"Is_classfication\":Boolean:default,true] ', null, '2', '0'); -INSERT INTO `program` VALUES ('LogisticRegression_Predict', 'LogisticRegression_Predict', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/LogisticRegression_Predict', '0', 'distributed', '0', '', '0.1', '2017-04-28 17:10:45', 'spark-submit --class bda.spark.runnable.logisticRegression.Predict spark.jar --model_pt {in:LogisticRegressionModel:\"model\"} --test_pt {in:LabeledPoint:\"test_file\"} --predict_pt {out:Prediction,HFile:\"predict_file\"} ', null, '2', '0'); -INSERT INTO `program` VALUES ('LogisticRegression_Train', 'LogisticRegression_Train', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/LogisticRegression_Train', '0', 'distributed', '0', '', '0.1', '2017-04-28 17:15:13', 'spark-submit --class bda.spark.runnable.logisticRegression.Train spark.jar --train_pt {in:LabeledPoint:\"Train_file\"} --validate_pt {in:LabeledPoint:\"validate_file\"} --model_pt {out:LogisticRegressionModel,HFile:\"Model\"} --graphx [\"If_GraphX\":Boolean:default,false] --max_iter [\"max_iter\":Int:default,20] --reg [\"reg\":Double:default,0.01] --learn_rate [\"learn_rate\":Double:default,0.1] ', null, '2', '0'); -INSERT INTO `program` VALUES ('RMSE', 'RMSE', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/RMSE', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:28:55', 'spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt {in:Prediction:\"predict_file\"} ', null, '2', '0'); +INSERT INTO `program` VALUES ('0C228899-0267-4FFE-93E3-BDFB8FF7F83E', 'spark_sql', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/spark_sql', '0', 'distributed', '0', '', '1.1', '2017-03-31 10:57:00 AM', 'spark-submit --class bda.spark.runnable.preprocess.DataTransformRunner spark.jar --script_fp [\"script path\":string:default,\" \"] --input_kv [\"input table_name,file_path pair\":string:default,\" \"] --output_kv [\"output table_name,file_path pair\":string:default,\" \"] ', null, '2', '1', null); +INSERT INTO `program` VALUES ('1035AB95-287F-4EE3-BA47-D41DB456F0B8', 'BinaryClassification_Evaluate', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'peng_come_on@126.com', '/EML/Modules/BinaryClassification_Evaluate', '0', 'spark', '1', 'Spark版本的BinaryClassification Evaluation。', '0.4', '2016-01-25 04:48:39 PM', 'spark-submit --class bda.spark.runnable.evaluate.BinaryClassificationRunner spark.jar --predict_pt {in:Prediction:\"预测结果文件\"}', '\n BinaryClassification_Evaluate\n 结果评价>分布å¼\n Spark\n 是\n 0.4\n 2016-01-25 04:48:39 PM\n peng_come_on@126.com\n Spark版本的BinaryClassification Evaluation。\n spark-submit --class bda.spark.runnable.evaluate.BinaryClassificationRunner spark.jar --predict_pt {in:Prediction:预测结果文件}\n', '2', '0', null); +INSERT INTO `program` VALUES ('292CB212-FBF8-4A7C-9DDE-B36D2345F522', 'Shell', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'fortianyou@qq.com', '/EML/Modules/Shell', '0', 'standalone', '0', '', '0.4', '2016-11-29 03:15:45 PM', 'sh', null, '2', '1', null); +INSERT INTO `program` VALUES ('75D61276-32E7-418D-A776-F051385FD106', 'SqlETL', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/SqlETL', '0', 'etl', '0', '', '1.1', '2017-08-09 02:11:46 PM', 'spark-submit --executor-memory \'5G\' --class \'sparksql.reader.DatabaseReader\' --conf \'spark.cores.max=10\' reader.jar --url [\"SqlURL\":String:default,\"jdbc:mysql://mysql:3306/test\"] --output_pt {out:Custom:\"output\"} --user [\"user\":String:default,\"root\"] --passwd [\"passwd\":String:default,\"111111\"] --table [\"table\":String:default,\"\"] --columns [\"columns\":String:default,\"\"] --format [\"format\":String:default,\"csv\"] ', null, '2', '0', ''); +INSERT INTO `program` VALUES ('C7A9256B-0DEE-4481-9F43-20EFE0DAB4FB', 'JsonToLabelPoint', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/JsonToLabelPoint', '0', 'distributed', '0', 'JsonToLabelPoint', '0.2', '2017-08-09 02:12:59 PM', 'spark-submit --class \"bda.spark.labelpoint.JsonToLabelPoint\" --conf \"spark.cores.max=10\" bda-spark.jar --output_pt {out:Custom:\"output\"} --label_col [\"label_col\":String:default,\"label\"] --is_class [\"is_class\":String:default,\"true\"] --input_pt {in:Custom:\"input\"} ', null, '2', '0', ''); +INSERT INTO `program` VALUES ('E8BB2E5C-D834-4749-B7F2-FCB72C85C27E', 'FormatTransform', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/FormatTransform', '0', 'distributed', '0', 'tranform a csv,tsv, parquet, json file into any of them.', '0.1', '2017-08-09 02:12:42 PM', 'spark-submit --class sparksql.reader.FormatTransform spark-sql.jar --input_format [\"(输入格å¼)\":String:default,\"csv\"] --output_format [\"(输出格å¼)\":String:default,\"json\"] --input_pt {in:(Custom):\"(输出文件)\"} --output_pt {out:(Custom):\"(输出文件)\"} ', null, '2', '0', ''); +INSERT INTO `program` VALUES ('File_split', 'File_split', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/File_split', '0', 'distributed', '0', '', '0.1', '2017-04-28 17:08:20', 'spark-submit --class bda.spark.runnable.preprocess.FileSplitRunner spark.jar --input_pt {in:Data:\"Input_file\"} --ratio [\"Cut_ratio\":Double:default,0.5] --output_pt1 {out:Data,HFile:\"Output_file_1(ratio)\"} --output_pt2 {out:Data,HFile:\"Output_fie(1-ratio)\"} ', null, '2', '0', null); +INSERT INTO `program` VALUES ('GBRT_Predict', 'GBRT_Predict', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/GBRT_Predict', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:25:55', 'spark-submit --class bda.spark.runnable.tree.gbrt.Predict spark.jar --model_pt {in:ObjectFile:\"Model_file\"} --test_pt {in:LabeledPoint:\"test_file\"} --predict_pt {out:TextFile:\"Predict_file\"} ', null, '2', '0', null); +INSERT INTO `program` VALUES ('GBRT_Train', 'GBRT_Train', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/GBRT_Train', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:27:42', 'spark-submit --class bda.spark.runnable.tree.gbrt.Train spark.jar --train_pt {in:LabeledPoint:\"Train_file\"} --model_pt {out:ObjectFile,HFile:\"Model_file\"} --cp_pt /EML/tmp --impurity [\"impurity\":String:default,\"Variance\"] --max_depth [\"Max_depth\":Int:default,10] --max_bins [\"Max_bins\":Int:default,32] --bin_samples [\"Bin_sample\":Int:default,10000] --min_node_size [\"Min_node_size\":Int:default,15] --min_info_gain [\"Min_info_gain\":Double:default,1e-6] --num_round [\"Round\":Int:default,10] --learn_rate [\"Learning_rate\":Double:default,0.02] ', null, '2', '0', null); +INSERT INTO `program` VALUES ('LibSVM2LabeledPoint', 'LibSVM2LabeledPoint', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/LibSVM2LabeledPoint', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:28:19', 'spark-submit --class bda.spark.runnable.formatTransform.LibSVM2LabeledPoint spark.jar --input_pt {in:LibSVM:\"LibSVM_data_file\"} --output_pt {out:LabeledPoint,HFile:\"LabeledPoint_data_file\"} --is_class [\"Is_classfication\":Boolean:default,true] ', null, '2', '0', null); +INSERT INTO `program` VALUES ('LogisticRegression_Predict', 'LogisticRegression_Predict', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/LogisticRegression_Predict', '0', 'distributed', '0', '', '0.1', '2017-04-28 17:10:45', 'spark-submit --class bda.spark.runnable.logisticRegression.Predict spark.jar --model_pt {in:LogisticRegressionModel:\"model\"} --test_pt {in:LabeledPoint:\"test_file\"} --predict_pt {out:Prediction,HFile:\"predict_file\"} ', null, '2', '0', null); +INSERT INTO `program` VALUES ('LogisticRegression_Train', 'LogisticRegression_Train', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/LogisticRegression_Train', '0', 'distributed', '0', '', '0.1', '2017-04-28 17:15:13', 'spark-submit --class bda.spark.runnable.logisticRegression.Train spark.jar --train_pt {in:LabeledPoint:\"Train_file\"} --validate_pt {in:LabeledPoint:\"validate_file\"} --model_pt {out:LogisticRegressionModel,HFile:\"Model\"} --graphx [\"If_GraphX\":Boolean:default,false] --max_iter [\"max_iter\":Int:default,20] --reg [\"reg\":Double:default,0.01] --learn_rate [\"learn_rate\":Double:default,0.1] ', null, '2', '0', null); +INSERT INTO `program` VALUES ('RMSE', 'RMSE', '0A0F402F-670F-4696-9D9C-42F0E0D665A0', 'bdaict@hotmail.com', '/EML/Modules/RMSE', '0', 'distributed', '0', '', '0.1', '2017-04-29 16:28:55', 'spark-submit --class bda.spark.runnable.evaluate.RMSERunner spark.jar --predict_pt {in:Prediction:\"predict_file\"} ', null, '2', '0', null); diff --git a/mysql/supernode.sql b/mysql/studio/supernode.sql similarity index 92% rename from mysql/supernode.sql rename to mysql/studio/supernode.sql index b50ca24..7d28cd1 100644 --- a/mysql/supernode.sql +++ b/mysql/studio/supernode.sql @@ -1,7 +1,7 @@ /* Navicat MySQL Data Transfer -Source Server : 10.20.13.7 +Source Server : BDA(烟å°) Source Server Version : 50717 Source Host : 10.20.13.7:3306 Source Database : studio @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50717 File Encoding : 65001 -Date: 2017-05-01 22:47:44 +Date: 2017-10-18 16:28:57 */ SET FOREIGN_KEY_CHECKS=0; diff --git a/mysql/test/titanic_train.sql b/mysql/test/titanic_train.sql new file mode 100644 index 0000000..501d520 --- /dev/null +++ b/mysql/test/titanic_train.sql @@ -0,0 +1,930 @@ +/* +Navicat MySQL Data Transfer + +Source Server : test +Source Server Version : 50719 +Source Host : 10.60.0.55:3306 +Source Database : test + +Target Server Type : MYSQL +Target Server Version : 50719 +File Encoding : 65001 + +Date: 2017-10-09 16:05:03 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for titanic_train +-- ---------------------------- +DROP TABLE IF EXISTS `titanic_train`; +CREATE TABLE `titanic_train` ( + `PassengerId` int(11) DEFAULT NULL, + `Survived` int(11) DEFAULT NULL, + `Pclass` int(11) DEFAULT NULL, + `Name` text, + `Sex` text, + `Age` double DEFAULT NULL, + `SibSp` int(11) DEFAULT NULL, + `Parch` int(11) DEFAULT NULL, + `Ticket` text, + `Fare` double DEFAULT NULL, + `Cabin` text, + `Embarked` text +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- ---------------------------- +-- Records of titanic_train +-- ---------------------------- +INSERT INTO `titanic_train` VALUES ('1', '0', '3', 'Braund, Mr. Owen Harris', 'male', '22', '1', '0', 'A/5 21171', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('2', '1', '1', 'Cumings, Mrs. John Bradley (Florence Briggs Thayer)', 'female', '38', '1', '0', 'PC 17599', '71.2833', 'C85', 'C'); +INSERT INTO `titanic_train` VALUES ('3', '1', '3', 'Heikkinen, Miss. Laina', 'female', '26', '0', '0', 'STON/O2. 3101282', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('4', '1', '1', 'Futrelle, Mrs. Jacques Heath (Lily May Peel)', 'female', '35', '1', '0', '113803', '53.1', 'C123', 'S'); +INSERT INTO `titanic_train` VALUES ('5', '0', '3', 'Allen, Mr. William Henry', 'male', '35', '0', '0', '373450', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('6', '0', '3', 'Moran, Mr. James', 'male', null, '0', '0', '330877', '8.4583', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('7', '0', '1', 'McCarthy, Mr. Timothy J', 'male', '54', '0', '0', '17463', '51.8625', 'E46', 'S'); +INSERT INTO `titanic_train` VALUES ('8', '0', '3', 'Palsson, Master. Gosta Leonard', 'male', '2', '3', '1', '349909', '21.075', '', 'S'); +INSERT INTO `titanic_train` VALUES ('9', '1', '3', 'Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)', 'female', '27', '0', '2', '347742', '11.1333', '', 'S'); +INSERT INTO `titanic_train` VALUES ('10', '1', '2', 'Nasser, Mrs. Nicholas (Adele Achem)', 'female', '14', '1', '0', '237736', '30.0708', '', 'C'); +INSERT INTO `titanic_train` VALUES ('11', '1', '3', 'Sandstrom, Miss. Marguerite Rut', 'female', '4', '1', '1', 'PP 9549', '16.7', 'G6', 'S'); +INSERT INTO `titanic_train` VALUES ('12', '1', '1', 'Bonnell, Miss. Elizabeth', 'female', '58', '0', '0', '113783', '26.55', 'C103', 'S'); +INSERT INTO `titanic_train` VALUES ('13', '0', '3', 'Saundercock, Mr. William Henry', 'male', '20', '0', '0', 'A/5. 2151', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('14', '0', '3', 'Andersson, Mr. Anders Johan', 'male', '39', '1', '5', '347082', '31.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('15', '0', '3', 'Vestrom, Miss. Hulda Amanda Adolfina', 'female', '14', '0', '0', '350406', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('16', '1', '2', 'Hewlett, Mrs. (Mary D Kingcome) ', 'female', '55', '0', '0', '248706', '16', '', 'S'); +INSERT INTO `titanic_train` VALUES ('17', '0', '3', 'Rice, Master. Eugene', 'male', '2', '4', '1', '382652', '29.125', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('18', '1', '2', 'Williams, Mr. Charles Eugene', 'male', null, '0', '0', '244373', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('19', '0', '3', 'Vander Planke, Mrs. Julius (Emelia Maria Vandemoortele)', 'female', '31', '1', '0', '345763', '18', '', 'S'); +INSERT INTO `titanic_train` VALUES ('20', '1', '3', 'Masselmani, Mrs. Fatima', 'female', null, '0', '0', '2649', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('21', '0', '2', 'Fynney, Mr. Joseph J', 'male', '35', '0', '0', '239865', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('22', '1', '2', 'Beesley, Mr. Lawrence', 'male', '34', '0', '0', '248698', '13', 'D56', 'S'); +INSERT INTO `titanic_train` VALUES ('23', '1', '3', 'McGowan, Miss. Anna \"Annie\"', 'female', '15', '0', '0', '330923', '8.0292', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('24', '1', '1', 'Sloper, Mr. William Thompson', 'male', '28', '0', '0', '113788', '35.5', 'A6', 'S'); +INSERT INTO `titanic_train` VALUES ('25', '0', '3', 'Palsson, Miss. Torborg Danira', 'female', '8', '3', '1', '349909', '21.075', '', 'S'); +INSERT INTO `titanic_train` VALUES ('26', '1', '3', 'Asplund, Mrs. Carl Oscar (Selma Augusta Emilia Johansson)', 'female', '38', '1', '5', '347077', '31.3875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('27', '0', '3', 'Emir, Mr. Farred Chehab', 'male', null, '0', '0', '2631', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('28', '0', '1', 'Fortune, Mr. Charles Alexander', 'male', '19', '3', '2', '19950', '263', 'C23 C25 C27', 'S'); +INSERT INTO `titanic_train` VALUES ('29', '1', '3', 'O\'Dwyer, Miss. Ellen \"Nellie\"', 'female', null, '0', '0', '330959', '7.8792', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('30', '0', '3', 'Todoroff, Mr. Lalio', 'male', null, '0', '0', '349216', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('31', '0', '1', 'Uruchurtu, Don. Manuel E', 'male', '40', '0', '0', 'PC 17601', '27.7208', '', 'C'); +INSERT INTO `titanic_train` VALUES ('32', '1', '1', 'Spencer, Mrs. William Augustus (Marie Eugenie)', 'female', null, '1', '0', 'PC 17569', '146.5208', 'B78', 'C'); +INSERT INTO `titanic_train` VALUES ('33', '1', '3', 'Glynn, Miss. Mary Agatha', 'female', null, '0', '0', '335677', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('34', '0', '2', 'Wheadon, Mr. Edward H', 'male', '66', '0', '0', 'C.A. 24579', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('35', '0', '1', 'Meyer, Mr. Edgar Joseph', 'male', '28', '1', '0', 'PC 17604', '82.1708', '', 'C'); +INSERT INTO `titanic_train` VALUES ('36', '0', '1', 'Holverson, Mr. Alexander Oskar', 'male', '42', '1', '0', '113789', '52', '', 'S'); +INSERT INTO `titanic_train` VALUES ('37', '1', '3', 'Mamee, Mr. Hanna', 'male', null, '0', '0', '2677', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('38', '0', '3', 'Cann, Mr. Ernest Charles', 'male', '21', '0', '0', 'A./5. 2152', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('39', '0', '3', 'Vander Planke, Miss. Augusta Maria', 'female', '18', '2', '0', '345764', '18', '', 'S'); +INSERT INTO `titanic_train` VALUES ('40', '1', '3', 'Nicola-Yarred, Miss. Jamila', 'female', '14', '1', '0', '2651', '11.2417', '', 'C'); +INSERT INTO `titanic_train` VALUES ('41', '0', '3', 'Ahlin, Mrs. Johan (Johanna Persdotter Larsson)', 'female', '40', '1', '0', '7546', '9.475', '', 'S'); +INSERT INTO `titanic_train` VALUES ('42', '0', '2', 'Turpin, Mrs. William John Robert (Dorothy Ann Wonnacott)', 'female', '27', '1', '0', '11668', '21', '', 'S'); +INSERT INTO `titanic_train` VALUES ('43', '0', '3', 'Kraeff, Mr. Theodor', 'male', null, '0', '0', '349253', '7.8958', '', 'C'); +INSERT INTO `titanic_train` VALUES ('44', '1', '2', 'Laroche, Miss. Simonne Marie Anne Andree', 'female', '3', '1', '2', 'SC/Paris 2123', '41.5792', '', 'C'); +INSERT INTO `titanic_train` VALUES ('45', '1', '3', 'Devaney, Miss. Margaret Delia', 'female', '19', '0', '0', '330958', '7.8792', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('46', '0', '3', 'Rogers, Mr. William John', 'male', null, '0', '0', 'S.C./A.4. 23567', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('47', '0', '3', 'Lennon, Mr. Denis', 'male', null, '1', '0', '370371', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('48', '1', '3', 'O\'Driscoll, Miss. Bridget', 'female', null, '0', '0', '14311', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('49', '0', '3', 'Samaan, Mr. Youssef', 'male', null, '2', '0', '2662', '21.6792', '', 'C'); +INSERT INTO `titanic_train` VALUES ('50', '0', '3', 'Arnold-Franchi, Mrs. Josef (Josefine Franchi)', 'female', '18', '1', '0', '349237', '17.8', '', 'S'); +INSERT INTO `titanic_train` VALUES ('51', '0', '3', 'Panula, Master. Juha Niilo', 'male', '7', '4', '1', '3101295', '39.6875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('52', '0', '3', 'Nosworthy, Mr. Richard Cater', 'male', '21', '0', '0', 'A/4. 39886', '7.8', '', 'S'); +INSERT INTO `titanic_train` VALUES ('53', '1', '1', 'Harper, Mrs. Henry Sleeper (Myna Haxtun)', 'female', '49', '1', '0', 'PC 17572', '76.7292', 'D33', 'C'); +INSERT INTO `titanic_train` VALUES ('54', '1', '2', 'Faunthorpe, Mrs. Lizzie (Elizabeth Anne Wilkinson)', 'female', '29', '1', '0', '2926', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('55', '0', '1', 'Ostby, Mr. Engelhart Cornelius', 'male', '65', '0', '1', '113509', '61.9792', 'B30', 'C'); +INSERT INTO `titanic_train` VALUES ('56', '1', '1', 'Woolner, Mr. Hugh', 'male', null, '0', '0', '19947', '35.5', 'C52', 'S'); +INSERT INTO `titanic_train` VALUES ('57', '1', '2', 'Rugg, Miss. Emily', 'female', '21', '0', '0', 'C.A. 31026', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('58', '0', '3', 'Novel, Mr. Mansouer', 'male', '28.5', '0', '0', '2697', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('59', '1', '2', 'West, Miss. Constance Mirium', 'female', '5', '1', '2', 'C.A. 34651', '27.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('60', '0', '3', 'Goodwin, Master. William Frederick', 'male', '11', '5', '2', 'CA 2144', '46.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('61', '0', '3', 'Sirayanian, Mr. Orsen', 'male', '22', '0', '0', '2669', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('62', '1', '1', 'Icard, Miss. Amelie', 'female', '38', '0', '0', '113572', '80', 'B28', ''); +INSERT INTO `titanic_train` VALUES ('63', '0', '1', 'Harris, Mr. Henry Birkhardt', 'male', '45', '1', '0', '36973', '83.475', 'C83', 'S'); +INSERT INTO `titanic_train` VALUES ('64', '0', '3', 'Skoog, Master. Harald', 'male', '4', '3', '2', '347088', '27.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('65', '0', '1', 'Stewart, Mr. Albert A', 'male', null, '0', '0', 'PC 17605', '27.7208', '', 'C'); +INSERT INTO `titanic_train` VALUES ('66', '1', '3', 'Moubarek, Master. Gerios', 'male', null, '1', '1', '2661', '15.2458', '', 'C'); +INSERT INTO `titanic_train` VALUES ('67', '1', '2', 'Nye, Mrs. (Elizabeth Ramell)', 'female', '29', '0', '0', 'C.A. 29395', '10.5', 'F33', 'S'); +INSERT INTO `titanic_train` VALUES ('68', '0', '3', 'Crease, Mr. Ernest James', 'male', '19', '0', '0', 'S.P. 3464', '8.1583', '', 'S'); +INSERT INTO `titanic_train` VALUES ('69', '1', '3', 'Andersson, Miss. Erna Alexandra', 'female', '17', '4', '2', '3101281', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('70', '0', '3', 'Kink, Mr. Vincenz', 'male', '26', '2', '0', '315151', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('71', '0', '2', 'Jenkin, Mr. Stephen Curnow', 'male', '32', '0', '0', 'C.A. 33111', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('72', '0', '3', 'Goodwin, Miss. Lillian Amy', 'female', '16', '5', '2', 'CA 2144', '46.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('73', '0', '2', 'Hood, Mr. Ambrose Jr', 'male', '21', '0', '0', 'S.O.C. 14879', '73.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('74', '0', '3', 'Chronopoulos, Mr. Apostolos', 'male', '26', '1', '0', '2680', '14.4542', '', 'C'); +INSERT INTO `titanic_train` VALUES ('75', '1', '3', 'Bing, Mr. Lee', 'male', '32', '0', '0', '1601', '56.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('76', '0', '3', 'Moen, Mr. Sigurd Hansen', 'male', '25', '0', '0', '348123', '7.65', 'F G73', 'S'); +INSERT INTO `titanic_train` VALUES ('77', '0', '3', 'Staneff, Mr. Ivan', 'male', null, '0', '0', '349208', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('78', '0', '3', 'Moutal, Mr. Rahamin Haim', 'male', null, '0', '0', '374746', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('79', '1', '2', 'Caldwell, Master. Alden Gates', 'male', '0.83', '0', '2', '248738', '29', '', 'S'); +INSERT INTO `titanic_train` VALUES ('80', '1', '3', 'Dowdell, Miss. Elizabeth', 'female', '30', '0', '0', '364516', '12.475', '', 'S'); +INSERT INTO `titanic_train` VALUES ('81', '0', '3', 'Waelens, Mr. Achille', 'male', '22', '0', '0', '345767', '9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('82', '1', '3', 'Sheerlinck, Mr. Jan Baptist', 'male', '29', '0', '0', '345779', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('83', '1', '3', 'McDermott, Miss. Brigdet Delia', 'female', null, '0', '0', '330932', '7.7875', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('84', '0', '1', 'Carrau, Mr. Francisco M', 'male', '28', '0', '0', '113059', '47.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('85', '1', '2', 'Ilett, Miss. Bertha', 'female', '17', '0', '0', 'SO/C 14885', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('86', '1', '3', 'Backstrom, Mrs. Karl Alfred (Maria Mathilda Gustafsson)', 'female', '33', '3', '0', '3101278', '15.85', '', 'S'); +INSERT INTO `titanic_train` VALUES ('87', '0', '3', 'Ford, Mr. William Neal', 'male', '16', '1', '3', 'W./C. 6608', '34.375', '', 'S'); +INSERT INTO `titanic_train` VALUES ('88', '0', '3', 'Slocovski, Mr. Selman Francis', 'male', null, '0', '0', 'SOTON/OQ 392086', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('89', '1', '1', 'Fortune, Miss. Mabel Helen', 'female', '23', '3', '2', '19950', '263', 'C23 C25 C27', 'S'); +INSERT INTO `titanic_train` VALUES ('90', '0', '3', 'Celotti, Mr. Francesco', 'male', '24', '0', '0', '343275', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('91', '0', '3', 'Christmann, Mr. Emil', 'male', '29', '0', '0', '343276', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('92', '0', '3', 'Andreasson, Mr. Paul Edvin', 'male', '20', '0', '0', '347466', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('93', '0', '1', 'Chaffee, Mr. Herbert Fuller', 'male', '46', '1', '0', 'W.E.P. 5734', '61.175', 'E31', 'S'); +INSERT INTO `titanic_train` VALUES ('94', '0', '3', 'Dean, Mr. Bertram Frank', 'male', '26', '1', '2', 'C.A. 2315', '20.575', '', 'S'); +INSERT INTO `titanic_train` VALUES ('95', '0', '3', 'Coxon, Mr. Daniel', 'male', '59', '0', '0', '364500', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('96', '0', '3', 'Shorney, Mr. Charles Joseph', 'male', null, '0', '0', '374910', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('97', '0', '1', 'Goldschmidt, Mr. George B', 'male', '71', '0', '0', 'PC 17754', '34.6542', 'A5', 'C'); +INSERT INTO `titanic_train` VALUES ('98', '1', '1', 'Greenfield, Mr. William Bertram', 'male', '23', '0', '1', 'PC 17759', '63.3583', 'D10 D12', 'C'); +INSERT INTO `titanic_train` VALUES ('99', '1', '2', 'Doling, Mrs. John T (Ada Julia Bone)', 'female', '34', '0', '1', '231919', '23', '', 'S'); +INSERT INTO `titanic_train` VALUES ('100', '0', '2', 'Kantor, Mr. Sinai', 'male', '34', '1', '0', '244367', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('101', '0', '3', 'Petranec, Miss. Matilda', 'female', '28', '0', '0', '349245', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('102', '0', '3', 'Petroff, Mr. Pastcho (\"Pentcho\")', 'male', null, '0', '0', '349215', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('103', '0', '1', 'White, Mr. Richard Frasar', 'male', '21', '0', '1', '35281', '77.2875', 'D26', 'S'); +INSERT INTO `titanic_train` VALUES ('104', '0', '3', 'Johansson, Mr. Gustaf Joel', 'male', '33', '0', '0', '7540', '8.6542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('105', '0', '3', 'Gustafsson, Mr. Anders Vilhelm', 'male', '37', '2', '0', '3101276', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('106', '0', '3', 'Mionoff, Mr. Stoytcho', 'male', '28', '0', '0', '349207', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('107', '1', '3', 'Salkjelsvik, Miss. Anna Kristine', 'female', '21', '0', '0', '343120', '7.65', '', 'S'); +INSERT INTO `titanic_train` VALUES ('108', '1', '3', 'Moss, Mr. Albert Johan', 'male', null, '0', '0', '312991', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('109', '0', '3', 'Rekic, Mr. Tido', 'male', '38', '0', '0', '349249', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('110', '1', '3', 'Moran, Miss. Bertha', 'female', null, '1', '0', '371110', '24.15', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('111', '0', '1', 'Porter, Mr. Walter Chamberlain', 'male', '47', '0', '0', '110465', '52', 'C110', 'S'); +INSERT INTO `titanic_train` VALUES ('112', '0', '3', 'Zabour, Miss. Hileni', 'female', '14.5', '1', '0', '2665', '14.4542', '', 'C'); +INSERT INTO `titanic_train` VALUES ('113', '0', '3', 'Barton, Mr. David John', 'male', '22', '0', '0', '324669', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('114', '0', '3', 'Jussila, Miss. Katriina', 'female', '20', '1', '0', '4136', '9.825', '', 'S'); +INSERT INTO `titanic_train` VALUES ('115', '0', '3', 'Attalah, Miss. Malake', 'female', '17', '0', '0', '2627', '14.4583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('116', '0', '3', 'Pekoniemi, Mr. Edvard', 'male', '21', '0', '0', 'STON/O 2. 3101294', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('117', '0', '3', 'Connors, Mr. Patrick', 'male', '70.5', '0', '0', '370369', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('118', '0', '2', 'Turpin, Mr. William John Robert', 'male', '29', '1', '0', '11668', '21', '', 'S'); +INSERT INTO `titanic_train` VALUES ('119', '0', '1', 'Baxter, Mr. Quigg Edmond', 'male', '24', '0', '1', 'PC 17558', '247.5208', 'B58 B60', 'C'); +INSERT INTO `titanic_train` VALUES ('120', '0', '3', 'Andersson, Miss. Ellis Anna Maria', 'female', '2', '4', '2', '347082', '31.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('121', '0', '2', 'Hickman, Mr. Stanley George', 'male', '21', '2', '0', 'S.O.C. 14879', '73.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('122', '0', '3', 'Moore, Mr. Leonard Charles', 'male', null, '0', '0', 'A4. 54510', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('123', '0', '2', 'Nasser, Mr. Nicholas', 'male', '32.5', '1', '0', '237736', '30.0708', '', 'C'); +INSERT INTO `titanic_train` VALUES ('124', '1', '2', 'Webber, Miss. Susan', 'female', '32.5', '0', '0', '27267', '13', 'E101', 'S'); +INSERT INTO `titanic_train` VALUES ('125', '0', '1', 'White, Mr. Percival Wayland', 'male', '54', '0', '1', '35281', '77.2875', 'D26', 'S'); +INSERT INTO `titanic_train` VALUES ('126', '1', '3', 'Nicola-Yarred, Master. Elias', 'male', '12', '1', '0', '2651', '11.2417', '', 'C'); +INSERT INTO `titanic_train` VALUES ('127', '0', '3', 'McMahon, Mr. Martin', 'male', null, '0', '0', '370372', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('128', '1', '3', 'Madsen, Mr. Fridtjof Arne', 'male', '24', '0', '0', 'C 17369', '7.1417', '', 'S'); +INSERT INTO `titanic_train` VALUES ('129', '1', '3', 'Peter, Miss. Anna', 'female', null, '1', '1', '2668', '22.3583', 'F E69', 'C'); +INSERT INTO `titanic_train` VALUES ('130', '0', '3', 'Ekstrom, Mr. Johan', 'male', '45', '0', '0', '347061', '6.975', '', 'S'); +INSERT INTO `titanic_train` VALUES ('131', '0', '3', 'Drazenoic, Mr. Jozef', 'male', '33', '0', '0', '349241', '7.8958', '', 'C'); +INSERT INTO `titanic_train` VALUES ('132', '0', '3', 'Coelho, Mr. Domingos Fernandeo', 'male', '20', '0', '0', 'SOTON/O.Q. 3101307', '7.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('133', '0', '3', 'Robins, Mrs. Alexander A (Grace Charity Laury)', 'female', '47', '1', '0', 'A/5. 3337', '14.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('134', '1', '2', 'Weisz, Mrs. Leopold (Mathilde Francoise Pede)', 'female', '29', '1', '0', '228414', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('135', '0', '2', 'Sobey, Mr. Samuel James Hayden', 'male', '25', '0', '0', 'C.A. 29178', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('136', '0', '2', 'Richard, Mr. Emile', 'male', '23', '0', '0', 'SC/PARIS 2133', '15.0458', '', 'C'); +INSERT INTO `titanic_train` VALUES ('137', '1', '1', 'Newsom, Miss. Helen Monypeny', 'female', '19', '0', '2', '11752', '26.2833', 'D47', 'S'); +INSERT INTO `titanic_train` VALUES ('138', '0', '1', 'Futrelle, Mr. Jacques Heath', 'male', '37', '1', '0', '113803', '53.1', 'C123', 'S'); +INSERT INTO `titanic_train` VALUES ('139', '0', '3', 'Osen, Mr. Olaf Elon', 'male', '16', '0', '0', '7534', '9.2167', '', 'S'); +INSERT INTO `titanic_train` VALUES ('140', '0', '1', 'Giglio, Mr. Victor', 'male', '24', '0', '0', 'PC 17593', '79.2', 'B86', 'C'); +INSERT INTO `titanic_train` VALUES ('141', '0', '3', 'Boulos, Mrs. Joseph (Sultana)', 'female', null, '0', '2', '2678', '15.2458', '', 'C'); +INSERT INTO `titanic_train` VALUES ('142', '1', '3', 'Nysten, Miss. Anna Sofia', 'female', '22', '0', '0', '347081', '7.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('143', '1', '3', 'Hakkarainen, Mrs. Pekka Pietari (Elin Matilda Dolck)', 'female', '24', '1', '0', 'STON/O2. 3101279', '15.85', '', 'S'); +INSERT INTO `titanic_train` VALUES ('144', '0', '3', 'Burke, Mr. Jeremiah', 'male', '19', '0', '0', '365222', '6.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('145', '0', '2', 'Andrew, Mr. Edgardo Samuel', 'male', '18', '0', '0', '231945', '11.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('146', '0', '2', 'Nicholls, Mr. Joseph Charles', 'male', '19', '1', '1', 'C.A. 33112', '36.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('147', '1', '3', 'Andersson, Mr. August Edvard (\"Wennerstrom\")', 'male', '27', '0', '0', '350043', '7.7958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('148', '0', '3', 'Ford, Miss. Robina Maggie \"Ruby\"', 'female', '9', '2', '2', 'W./C. 6608', '34.375', '', 'S'); +INSERT INTO `titanic_train` VALUES ('149', '0', '2', 'Navratil, Mr. Michel (\"Louis M Hoffman\")', 'male', '36.5', '0', '2', '230080', '26', 'F2', 'S'); +INSERT INTO `titanic_train` VALUES ('150', '0', '2', 'Byles, Rev. Thomas Roussel Davids', 'male', '42', '0', '0', '244310', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('151', '0', '2', 'Bateman, Rev. Robert James', 'male', '51', '0', '0', 'S.O.P. 1166', '12.525', '', 'S'); +INSERT INTO `titanic_train` VALUES ('152', '1', '1', 'Pears, Mrs. Thomas (Edith Wearne)', 'female', '22', '1', '0', '113776', '66.6', 'C2', 'S'); +INSERT INTO `titanic_train` VALUES ('153', '0', '3', 'Meo, Mr. Alfonzo', 'male', '55.5', '0', '0', 'A.5. 11206', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('154', '0', '3', 'van Billiard, Mr. Austin Blyler', 'male', '40.5', '0', '2', 'A/5. 851', '14.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('155', '0', '3', 'Olsen, Mr. Ole Martin', 'male', null, '0', '0', 'Fa 265302', '7.3125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('156', '0', '1', 'Williams, Mr. Charles Duane', 'male', '51', '0', '1', 'PC 17597', '61.3792', '', 'C'); +INSERT INTO `titanic_train` VALUES ('157', '1', '3', 'Gilnagh, Miss. Katherine \"Katie\"', 'female', '16', '0', '0', '35851', '7.7333', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('158', '0', '3', 'Corn, Mr. Harry', 'male', '30', '0', '0', 'SOTON/OQ 392090', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('159', '0', '3', 'Smiljanic, Mr. Mile', 'male', null, '0', '0', '315037', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('160', '0', '3', 'Sage, Master. Thomas Henry', 'male', null, '8', '2', 'CA. 2343', '69.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('161', '0', '3', 'Cribb, Mr. John Hatfield', 'male', '44', '0', '1', '371362', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('162', '1', '2', 'Watt, Mrs. James (Elizabeth \"Bessie\" Inglis Milne)', 'female', '40', '0', '0', 'C.A. 33595', '15.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('163', '0', '3', 'Bengtsson, Mr. John Viktor', 'male', '26', '0', '0', '347068', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('164', '0', '3', 'Calic, Mr. Jovo', 'male', '17', '0', '0', '315093', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('165', '0', '3', 'Panula, Master. Eino Viljami', 'male', '1', '4', '1', '3101295', '39.6875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('166', '1', '3', 'Goldsmith, Master. Frank John William \"Frankie\"', 'male', '9', '0', '2', '363291', '20.525', '', 'S'); +INSERT INTO `titanic_train` VALUES ('167', '1', '1', 'Chibnall, Mrs. (Edith Martha Bowerman)', 'female', null, '0', '1', '113505', '55', 'E33', 'S'); +INSERT INTO `titanic_train` VALUES ('168', '0', '3', 'Skoog, Mrs. William (Anna Bernhardina Karlsson)', 'female', '45', '1', '4', '347088', '27.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('169', '0', '1', 'Baumann, Mr. John D', 'male', null, '0', '0', 'PC 17318', '25.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('170', '0', '3', 'Ling, Mr. Lee', 'male', '28', '0', '0', '1601', '56.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('171', '0', '1', 'Van der hoef, Mr. Wyckoff', 'male', '61', '0', '0', '111240', '33.5', 'B19', 'S'); +INSERT INTO `titanic_train` VALUES ('172', '0', '3', 'Rice, Master. Arthur', 'male', '4', '4', '1', '382652', '29.125', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('173', '1', '3', 'Johnson, Miss. Eleanor Ileen', 'female', '1', '1', '1', '347742', '11.1333', '', 'S'); +INSERT INTO `titanic_train` VALUES ('174', '0', '3', 'Sivola, Mr. Antti Wilhelm', 'male', '21', '0', '0', 'STON/O 2. 3101280', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('175', '0', '1', 'Smith, Mr. James Clinch', 'male', '56', '0', '0', '17764', '30.6958', 'A7', 'C'); +INSERT INTO `titanic_train` VALUES ('176', '0', '3', 'Klasen, Mr. Klas Albin', 'male', '18', '1', '1', '350404', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('177', '0', '3', 'Lefebre, Master. Henry Forbes', 'male', null, '3', '1', '4133', '25.4667', '', 'S'); +INSERT INTO `titanic_train` VALUES ('178', '0', '1', 'Isham, Miss. Ann Elizabeth', 'female', '50', '0', '0', 'PC 17595', '28.7125', 'C49', 'C'); +INSERT INTO `titanic_train` VALUES ('179', '0', '2', 'Hale, Mr. Reginald', 'male', '30', '0', '0', '250653', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('180', '0', '3', 'Leonard, Mr. Lionel', 'male', '36', '0', '0', 'LINE', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('181', '0', '3', 'Sage, Miss. Constance Gladys', 'female', null, '8', '2', 'CA. 2343', '69.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('182', '0', '2', 'Pernot, Mr. Rene', 'male', null, '0', '0', 'SC/PARIS 2131', '15.05', '', 'C'); +INSERT INTO `titanic_train` VALUES ('183', '0', '3', 'Asplund, Master. Clarence Gustaf Hugo', 'male', '9', '4', '2', '347077', '31.3875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('184', '1', '2', 'Becker, Master. Richard F', 'male', '1', '2', '1', '230136', '39', 'F4', 'S'); +INSERT INTO `titanic_train` VALUES ('185', '1', '3', 'Kink-Heilmann, Miss. Luise Gretchen', 'female', '4', '0', '2', '315153', '22.025', '', 'S'); +INSERT INTO `titanic_train` VALUES ('186', '0', '1', 'Rood, Mr. Hugh Roscoe', 'male', null, '0', '0', '113767', '50', 'A32', 'S'); +INSERT INTO `titanic_train` VALUES ('187', '1', '3', 'O\'Brien, Mrs. Thomas (Johanna \"Hannah\" Godfrey)', 'female', null, '1', '0', '370365', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('188', '1', '1', 'Romaine, Mr. Charles Hallace (\"Mr C Rolmane\")', 'male', '45', '0', '0', '111428', '26.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('189', '0', '3', 'Bourke, Mr. John', 'male', '40', '1', '1', '364849', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('190', '0', '3', 'Turcin, Mr. Stjepan', 'male', '36', '0', '0', '349247', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('191', '1', '2', 'Pinsky, Mrs. (Rosa)', 'female', '32', '0', '0', '234604', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('192', '0', '2', 'Carbines, Mr. William', 'male', '19', '0', '0', '28424', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('193', '1', '3', 'Andersen-Jensen, Miss. Carla Christine Nielsine', 'female', '19', '1', '0', '350046', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('194', '1', '2', 'Navratil, Master. Michel M', 'male', '3', '1', '1', '230080', '26', 'F2', 'S'); +INSERT INTO `titanic_train` VALUES ('195', '1', '1', 'Brown, Mrs. James Joseph (Margaret Tobin)', 'female', '44', '0', '0', 'PC 17610', '27.7208', 'B4', 'C'); +INSERT INTO `titanic_train` VALUES ('196', '1', '1', 'Lurette, Miss. Elise', 'female', '58', '0', '0', 'PC 17569', '146.5208', 'B80', 'C'); +INSERT INTO `titanic_train` VALUES ('197', '0', '3', 'Mernagh, Mr. Robert', 'male', null, '0', '0', '368703', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('198', '0', '3', 'Olsen, Mr. Karl Siegwart Andreas', 'male', '42', '0', '1', '4579', '8.4042', '', 'S'); +INSERT INTO `titanic_train` VALUES ('199', '1', '3', 'Madigan, Miss. Margaret \"Maggie\"', 'female', null, '0', '0', '370370', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('200', '0', '2', 'Yrois, Miss. Henriette (\"Mrs Harbeck\")', 'female', '24', '0', '0', '248747', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('201', '0', '3', 'Vande Walle, Mr. Nestor Cyriel', 'male', '28', '0', '0', '345770', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('202', '0', '3', 'Sage, Mr. Frederick', 'male', null, '8', '2', 'CA. 2343', '69.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('203', '0', '3', 'Johanson, Mr. Jakob Alfred', 'male', '34', '0', '0', '3101264', '6.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('204', '0', '3', 'Youseff, Mr. Gerious', 'male', '45.5', '0', '0', '2628', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('205', '1', '3', 'Cohen, Mr. Gurshon \"Gus\"', 'male', '18', '0', '0', 'A/5 3540', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('206', '0', '3', 'Strom, Miss. Telma Matilda', 'female', '2', '0', '1', '347054', '10.4625', 'G6', 'S'); +INSERT INTO `titanic_train` VALUES ('445', '1', '3', 'Johannesen-Bratthammer, Mr. Bernt', 'male', null, '0', '0', '65306', '8.1125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('207', '0', '3', 'Backstrom, Mr. Karl Alfred', 'male', '32', '1', '0', '3101278', '15.85', '', 'S'); +INSERT INTO `titanic_train` VALUES ('208', '1', '3', 'Albimona, Mr. Nassef Cassem', 'male', '26', '0', '0', '2699', '18.7875', '', 'C'); +INSERT INTO `titanic_train` VALUES ('446', '1', '1', 'Dodge, Master. Washington', 'male', '4', '0', '2', '33638', '81.8583', 'A34', 'S'); +INSERT INTO `titanic_train` VALUES ('209', '1', '3', 'Carr, Miss. Helen \"Ellen\"', 'female', '16', '0', '0', '367231', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('447', '1', '2', 'Mellinger, Miss. Madeleine Violet', 'female', '13', '0', '1', '250644', '19.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('210', '1', '1', 'Blank, Mr. Henry', 'male', '40', '0', '0', '112277', '31', 'A31', 'C'); +INSERT INTO `titanic_train` VALUES ('448', '1', '1', 'Seward, Mr. Frederic Kimber', 'male', '34', '0', '0', '113794', '26.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('211', '0', '3', 'Ali, Mr. Ahmed', 'male', '24', '0', '0', 'SOTON/O.Q. 3101311', '7.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('449', '1', '3', 'Baclini, Miss. Marie Catherine', 'female', '5', '2', '1', '2666', '19.2583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('212', '1', '2', 'Cameron, Miss. Clear Annie', 'female', '35', '0', '0', 'F.C.C. 13528', '21', '', 'S'); +INSERT INTO `titanic_train` VALUES ('450', '1', '1', 'Peuchen, Major. Arthur Godfrey', 'male', '52', '0', '0', '113786', '30.5', 'C104', 'S'); +INSERT INTO `titanic_train` VALUES ('213', '0', '3', 'Perkin, Mr. John Henry', 'male', '22', '0', '0', 'A/5 21174', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('451', '0', '2', 'West, Mr. Edwy Arthur', 'male', '36', '1', '2', 'C.A. 34651', '27.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('214', '0', '2', 'Givard, Mr. Hans Kristensen', 'male', '30', '0', '0', '250646', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('452', '0', '3', 'Hagland, Mr. Ingvald Olai Olsen', 'male', null, '1', '0', '65303', '19.9667', '', 'S'); +INSERT INTO `titanic_train` VALUES ('215', '0', '3', 'Kiernan, Mr. Philip', 'male', null, '1', '0', '367229', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('453', '0', '1', 'Foreman, Mr. Benjamin Laventall', 'male', '30', '0', '0', '113051', '27.75', 'C111', 'C'); +INSERT INTO `titanic_train` VALUES ('216', '1', '1', 'Newell, Miss. Madeleine', 'female', '31', '1', '0', '35273', '113.275', 'D36', 'C'); +INSERT INTO `titanic_train` VALUES ('454', '1', '1', 'Goldenberg, Mr. Samuel L', 'male', '49', '1', '0', '17453', '89.1042', 'C92', 'C'); +INSERT INTO `titanic_train` VALUES ('217', '1', '3', 'Honkanen, Miss. Eliina', 'female', '27', '0', '0', 'STON/O2. 3101283', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('455', '0', '3', 'Peduzzi, Mr. Joseph', 'male', null, '0', '0', 'A/5 2817', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('218', '0', '2', 'Jacobsohn, Mr. Sidney Samuel', 'male', '42', '1', '0', '243847', '27', '', 'S'); +INSERT INTO `titanic_train` VALUES ('456', '1', '3', 'Jalsevac, Mr. Ivan', 'male', '29', '0', '0', '349240', '7.8958', '', 'C'); +INSERT INTO `titanic_train` VALUES ('219', '1', '1', 'Bazzani, Miss. Albina', 'female', '32', '0', '0', '11813', '76.2917', 'D15', 'C'); +INSERT INTO `titanic_train` VALUES ('220', '0', '2', 'Harris, Mr. Walter', 'male', '30', '0', '0', 'W/C 14208', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('221', '1', '3', 'Sunderland, Mr. Victor Francis', 'male', '16', '0', '0', 'SOTON/OQ 392089', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('222', '0', '2', 'Bracken, Mr. James H', 'male', '27', '0', '0', '220367', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('457', '0', '1', 'Millet, Mr. Francis Davis', 'male', '65', '0', '0', '13509', '26.55', 'E38', 'S'); +INSERT INTO `titanic_train` VALUES ('223', '0', '3', 'Green, Mr. George Henry', 'male', '51', '0', '0', '21440', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('458', '1', '1', 'Kenyon, Mrs. Frederick R (Marion)', 'female', null, '1', '0', '17464', '51.8625', 'D21', 'S'); +INSERT INTO `titanic_train` VALUES ('224', '0', '3', 'Nenkoff, Mr. Christo', 'male', null, '0', '0', '349234', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('459', '1', '2', 'Toomey, Miss. Ellen', 'female', '50', '0', '0', 'F.C.C. 13531', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('225', '1', '1', 'Hoyt, Mr. Frederick Maxfield', 'male', '38', '1', '0', '19943', '90', 'C93', 'S'); +INSERT INTO `titanic_train` VALUES ('460', '0', '3', 'O\'Connor, Mr. Maurice', 'male', null, '0', '0', '371060', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('226', '0', '3', 'Berglund, Mr. Karl Ivar Sven', 'male', '22', '0', '0', 'PP 4348', '9.35', '', 'S'); +INSERT INTO `titanic_train` VALUES ('461', '1', '1', 'Anderson, Mr. Harry', 'male', '48', '0', '0', '19952', '26.55', 'E12', 'S'); +INSERT INTO `titanic_train` VALUES ('227', '1', '2', 'Mellors, Mr. William John', 'male', '19', '0', '0', 'SW/PP 751', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('462', '0', '3', 'Morley, Mr. William', 'male', '34', '0', '0', '364506', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('228', '0', '3', 'Lovell, Mr. John Hall (\"Henry\")', 'male', '20.5', '0', '0', 'A/5 21173', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('463', '0', '1', 'Gee, Mr. Arthur H', 'male', '47', '0', '0', '111320', '38.5', 'E63', 'S'); +INSERT INTO `titanic_train` VALUES ('229', '0', '2', 'Fahlstrom, Mr. Arne Jonas', 'male', '18', '0', '0', '236171', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('464', '0', '2', 'Milling, Mr. Jacob Christian', 'male', '48', '0', '0', '234360', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('230', '0', '3', 'Lefebre, Miss. Mathilde', 'female', null, '3', '1', '4133', '25.4667', '', 'S'); +INSERT INTO `titanic_train` VALUES ('465', '0', '3', 'Maisner, Mr. Simon', 'male', null, '0', '0', 'A/S 2816', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('231', '1', '1', 'Harris, Mrs. Henry Birkhardt (Irene Wallach)', 'female', '35', '1', '0', '36973', '83.475', 'C83', 'S'); +INSERT INTO `titanic_train` VALUES ('466', '0', '3', 'Goncalves, Mr. Manuel Estanslas', 'male', '38', '0', '0', 'SOTON/O.Q. 3101306', '7.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('232', '0', '3', 'Larsson, Mr. Bengt Edvin', 'male', '29', '0', '0', '347067', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('467', '0', '2', 'Campbell, Mr. William', 'male', null, '0', '0', '239853', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('233', '0', '2', 'Sjostedt, Mr. Ernst Adolf', 'male', '59', '0', '0', '237442', '13.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('468', '0', '1', 'Smart, Mr. John Montgomery', 'male', '56', '0', '0', '113792', '26.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('234', '1', '3', 'Asplund, Miss. Lillian Gertrud', 'female', '5', '4', '2', '347077', '31.3875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('469', '0', '3', 'Scanlan, Mr. James', 'male', null, '0', '0', '36209', '7.725', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('235', '0', '2', 'Leyson, Mr. Robert William Norman', 'male', '24', '0', '0', 'C.A. 29566', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('470', '1', '3', 'Baclini, Miss. Helene Barbara', 'female', '0.75', '2', '1', '2666', '19.2583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('236', '0', '3', 'Harknett, Miss. Alice Phoebe', 'female', null, '0', '0', 'W./C. 6609', '7.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('471', '0', '3', 'Keefe, Mr. Arthur', 'male', null, '0', '0', '323592', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('237', '0', '2', 'Hold, Mr. Stephen', 'male', '44', '1', '0', '26707', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('472', '0', '3', 'Cacic, Mr. Luka', 'male', '38', '0', '0', '315089', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('238', '1', '2', 'Collyer, Miss. Marjorie \"Lottie\"', 'female', '8', '0', '2', 'C.A. 31921', '26.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('473', '1', '2', 'West, Mrs. Edwy Arthur (Ada Mary Worth)', 'female', '33', '1', '2', 'C.A. 34651', '27.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('239', '0', '2', 'Pengelly, Mr. Frederick William', 'male', '19', '0', '0', '28665', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('474', '1', '2', 'Jerwan, Mrs. Amin S (Marie Marthe Thuillard)', 'female', '23', '0', '0', 'SC/AH Basle 541', '13.7917', 'D', 'C'); +INSERT INTO `titanic_train` VALUES ('240', '0', '2', 'Hunt, Mr. George Henry', 'male', '33', '0', '0', 'SCO/W 1585', '12.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('475', '0', '3', 'Strandberg, Miss. Ida Sofia', 'female', '22', '0', '0', '7553', '9.8375', '', 'S'); +INSERT INTO `titanic_train` VALUES ('241', '0', '3', 'Zabour, Miss. Thamine', 'female', null, '1', '0', '2665', '14.4542', '', 'C'); +INSERT INTO `titanic_train` VALUES ('476', '0', '1', 'Clifford, Mr. George Quincy', 'male', null, '0', '0', '110465', '52', 'A14', 'S'); +INSERT INTO `titanic_train` VALUES ('242', '1', '3', 'Murphy, Miss. Katherine \"Kate\"', 'female', null, '1', '0', '367230', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('477', '0', '2', 'Renouf, Mr. Peter Henry', 'male', '34', '1', '0', '31027', '21', '', 'S'); +INSERT INTO `titanic_train` VALUES ('243', '0', '2', 'Coleridge, Mr. Reginald Charles', 'male', '29', '0', '0', 'W./C. 14263', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('478', '0', '3', 'Braund, Mr. Lewis Richard', 'male', '29', '1', '0', '3460', '7.0458', '', 'S'); +INSERT INTO `titanic_train` VALUES ('244', '0', '3', 'Maenpaa, Mr. Matti Alexanteri', 'male', '22', '0', '0', 'STON/O 2. 3101275', '7.125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('479', '0', '3', 'Karlsson, Mr. Nils August', 'male', '22', '0', '0', '350060', '7.5208', '', 'S'); +INSERT INTO `titanic_train` VALUES ('245', '0', '3', 'Attalah, Mr. Sleiman', 'male', '30', '0', '0', '2694', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('480', '1', '3', 'Hirvonen, Miss. Hildur E', 'female', '2', '0', '1', '3101298', '12.2875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('246', '0', '1', 'Minahan, Dr. William Edward', 'male', '44', '2', '0', '19928', '90', 'C78', 'Q'); +INSERT INTO `titanic_train` VALUES ('481', '0', '3', 'Goodwin, Master. Harold Victor', 'male', '9', '5', '2', 'CA 2144', '46.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('247', '0', '3', 'Lindahl, Miss. Agda Thorilda Viktoria', 'female', '25', '0', '0', '347071', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('482', '0', '2', 'Frost, Mr. Anthony Wood \"Archie\"', 'male', null, '0', '0', '239854', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('248', '1', '2', 'Hamalainen, Mrs. William (Anna)', 'female', '24', '0', '2', '250649', '14.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('483', '0', '3', 'Rouse, Mr. Richard Henry', 'male', '50', '0', '0', 'A/5 3594', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('249', '1', '1', 'Beckwith, Mr. Richard Leonard', 'male', '37', '1', '1', '11751', '52.5542', 'D35', 'S'); +INSERT INTO `titanic_train` VALUES ('484', '1', '3', 'Turkula, Mrs. (Hedwig)', 'female', '63', '0', '0', '4134', '9.5875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('250', '0', '2', 'Carter, Rev. Ernest Courtenay', 'male', '54', '1', '0', '244252', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('485', '1', '1', 'Bishop, Mr. Dickinson H', 'male', '25', '1', '0', '11967', '91.0792', 'B49', 'C'); +INSERT INTO `titanic_train` VALUES ('251', '0', '3', 'Reed, Mr. James George', 'male', null, '0', '0', '362316', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('486', '0', '3', 'Lefebre, Miss. Jeannie', 'female', null, '3', '1', '4133', '25.4667', '', 'S'); +INSERT INTO `titanic_train` VALUES ('252', '0', '3', 'Strom, Mrs. Wilhelm (Elna Matilda Persson)', 'female', '29', '1', '1', '347054', '10.4625', 'G6', 'S'); +INSERT INTO `titanic_train` VALUES ('487', '1', '1', 'Hoyt, Mrs. Frederick Maxfield (Jane Anne Forby)', 'female', '35', '1', '0', '19943', '90', 'C93', 'S'); +INSERT INTO `titanic_train` VALUES ('253', '0', '1', 'Stead, Mr. William Thomas', 'male', '62', '0', '0', '113514', '26.55', 'C87', 'S'); +INSERT INTO `titanic_train` VALUES ('488', '0', '1', 'Kent, Mr. Edward Austin', 'male', '58', '0', '0', '11771', '29.7', 'B37', 'C'); +INSERT INTO `titanic_train` VALUES ('254', '0', '3', 'Lobb, Mr. William Arthur', 'male', '30', '1', '0', 'A/5. 3336', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('489', '0', '3', 'Somerton, Mr. Francis William', 'male', '30', '0', '0', 'A.5. 18509', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('255', '0', '3', 'Rosblom, Mrs. Viktor (Helena Wilhelmina)', 'female', '41', '0', '2', '370129', '20.2125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('490', '1', '3', 'Coutts, Master. Eden Leslie \"Neville\"', 'male', '9', '1', '1', 'C.A. 37671', '15.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('256', '1', '3', 'Touma, Mrs. Darwis (Hanne Youssef Razi)', 'female', '29', '0', '2', '2650', '15.2458', '', 'C'); +INSERT INTO `titanic_train` VALUES ('491', '0', '3', 'Hagland, Mr. Konrad Mathias Reiersen', 'male', null, '1', '0', '65304', '19.9667', '', 'S'); +INSERT INTO `titanic_train` VALUES ('257', '1', '1', 'Thorne, Mrs. Gertrude Maybelle', 'female', null, '0', '0', 'PC 17585', '79.2', '', 'C'); +INSERT INTO `titanic_train` VALUES ('492', '0', '3', 'Windelov, Mr. Einar', 'male', '21', '0', '0', 'SOTON/OQ 3101317', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('258', '1', '1', 'Cherry, Miss. Gladys', 'female', '30', '0', '0', '110152', '86.5', 'B77', 'S'); +INSERT INTO `titanic_train` VALUES ('493', '0', '1', 'Molson, Mr. Harry Markland', 'male', '55', '0', '0', '113787', '30.5', 'C30', 'S'); +INSERT INTO `titanic_train` VALUES ('259', '1', '1', 'Ward, Miss. Anna', 'female', '35', '0', '0', 'PC 17755', '512.3292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('494', '0', '1', 'Artagaveytia, Mr. Ramon', 'male', '71', '0', '0', 'PC 17609', '49.5042', '', 'C'); +INSERT INTO `titanic_train` VALUES ('260', '1', '2', 'Parrish, Mrs. (Lutie Davis)', 'female', '50', '0', '1', '230433', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('495', '0', '3', 'Stanley, Mr. Edward Roland', 'male', '21', '0', '0', 'A/4 45380', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('261', '0', '3', 'Smith, Mr. Thomas', 'male', null, '0', '0', '384461', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('496', '0', '3', 'Yousseff, Mr. Gerious', 'male', null, '0', '0', '2627', '14.4583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('262', '1', '3', 'Asplund, Master. Edvin Rojj Felix', 'male', '3', '4', '2', '347077', '31.3875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('497', '1', '1', 'Eustis, Miss. Elizabeth Mussey', 'female', '54', '1', '0', '36947', '78.2667', 'D20', 'C'); +INSERT INTO `titanic_train` VALUES ('263', '0', '1', 'Taussig, Mr. Emil', 'male', '52', '1', '1', '110413', '79.65', 'E67', 'S'); +INSERT INTO `titanic_train` VALUES ('498', '0', '3', 'Shellard, Mr. Frederick William', 'male', null, '0', '0', 'C.A. 6212', '15.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('264', '0', '1', 'Harrison, Mr. William', 'male', '40', '0', '0', '112059', '0', 'B94', 'S'); +INSERT INTO `titanic_train` VALUES ('499', '0', '1', 'Allison, Mrs. Hudson J C (Bessie Waldo Daniels)', 'female', '25', '1', '2', '113781', '151.55', 'C22 C26', 'S'); +INSERT INTO `titanic_train` VALUES ('265', '0', '3', 'Henry, Miss. Delia', 'female', null, '0', '0', '382649', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('500', '0', '3', 'Svensson, Mr. Olof', 'male', '24', '0', '0', '350035', '7.7958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('266', '0', '2', 'Reeves, Mr. David', 'male', '36', '0', '0', 'C.A. 17248', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('501', '0', '3', 'Calic, Mr. Petar', 'male', '17', '0', '0', '315086', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('267', '0', '3', 'Panula, Mr. Ernesti Arvid', 'male', '16', '4', '1', '3101295', '39.6875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('502', '0', '3', 'Canavan, Miss. Mary', 'female', '21', '0', '0', '364846', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('268', '1', '3', 'Persson, Mr. Ernst Ulrik', 'male', '25', '1', '0', '347083', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('503', '0', '3', 'O\'Sullivan, Miss. Bridget Mary', 'female', null, '0', '0', '330909', '7.6292', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('269', '1', '1', 'Graham, Mrs. William Thompson (Edith Junkins)', 'female', '58', '0', '1', 'PC 17582', '153.4625', 'C125', 'S'); +INSERT INTO `titanic_train` VALUES ('504', '0', '3', 'Laitinen, Miss. Kristina Sofia', 'female', '37', '0', '0', '4135', '9.5875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('270', '1', '1', 'Bissette, Miss. Amelia', 'female', '35', '0', '0', 'PC 17760', '135.6333', 'C99', 'S'); +INSERT INTO `titanic_train` VALUES ('505', '1', '1', 'Maioni, Miss. Roberta', 'female', '16', '0', '0', '110152', '86.5', 'B79', 'S'); +INSERT INTO `titanic_train` VALUES ('271', '0', '1', 'Cairns, Mr. Alexander', 'male', null, '0', '0', '113798', '31', '', 'S'); +INSERT INTO `titanic_train` VALUES ('506', '0', '1', 'Penasco y Castellana, Mr. Victor de Satode', 'male', '18', '1', '0', 'PC 17758', '108.9', 'C65', 'C'); +INSERT INTO `titanic_train` VALUES ('272', '1', '3', 'Tornquist, Mr. William Henry', 'male', '25', '0', '0', 'LINE', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('507', '1', '2', 'Quick, Mrs. Frederick Charles (Jane Richards)', 'female', '33', '0', '2', '26360', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('273', '1', '2', 'Mellinger, Mrs. (Elizabeth Anne Maidment)', 'female', '41', '0', '1', '250644', '19.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('508', '1', '1', 'Bradley, Mr. George (\"George Arthur Brayton\")', 'male', null, '0', '0', '111427', '26.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('274', '0', '1', 'Natsch, Mr. Charles H', 'male', '37', '0', '1', 'PC 17596', '29.7', 'C118', 'C'); +INSERT INTO `titanic_train` VALUES ('509', '0', '3', 'Olsen, Mr. Henry Margido', 'male', '28', '0', '0', 'C 4001', '22.525', '', 'S'); +INSERT INTO `titanic_train` VALUES ('275', '1', '3', 'Healy, Miss. Hanora \"Nora\"', 'female', null, '0', '0', '370375', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('510', '1', '3', 'Lang, Mr. Fang', 'male', '26', '0', '0', '1601', '56.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('276', '1', '1', 'Andrews, Miss. Kornelia Theodosia', 'female', '63', '1', '0', '13502', '77.9583', 'D7', 'S'); +INSERT INTO `titanic_train` VALUES ('511', '1', '3', 'Daly, Mr. Eugene Patrick', 'male', '29', '0', '0', '382651', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('277', '0', '3', 'Lindblom, Miss. Augusta Charlotta', 'female', '45', '0', '0', '347073', '7.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('512', '0', '3', 'Webber, Mr. James', 'male', null, '0', '0', 'SOTON/OQ 3101316', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('278', '0', '2', 'Parkes, Mr. Francis \"Frank\"', 'male', null, '0', '0', '239853', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('513', '1', '1', 'McGough, Mr. James Robert', 'male', '36', '0', '0', 'PC 17473', '26.2875', 'E25', 'S'); +INSERT INTO `titanic_train` VALUES ('279', '0', '3', 'Rice, Master. Eric', 'male', '7', '4', '1', '382652', '29.125', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('514', '1', '1', 'Rothschild, Mrs. Martin (Elizabeth L. Barrett)', 'female', '54', '1', '0', 'PC 17603', '59.4', '', 'C'); +INSERT INTO `titanic_train` VALUES ('280', '1', '3', 'Abbott, Mrs. Stanton (Rosa Hunt)', 'female', '35', '1', '1', 'C.A. 2673', '20.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('515', '0', '3', 'Coleff, Mr. Satio', 'male', '24', '0', '0', '349209', '7.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('281', '0', '3', 'Duane, Mr. Frank', 'male', '65', '0', '0', '336439', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('516', '0', '1', 'Walker, Mr. William Anderson', 'male', '47', '0', '0', '36967', '34.0208', 'D46', 'S'); +INSERT INTO `titanic_train` VALUES ('282', '0', '3', 'Olsson, Mr. Nils Johan Goransson', 'male', '28', '0', '0', '347464', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('517', '1', '2', 'Lemore, Mrs. (Amelia Milley)', 'female', '34', '0', '0', 'C.A. 34260', '10.5', 'F33', 'S'); +INSERT INTO `titanic_train` VALUES ('283', '0', '3', 'de Pelsmaeker, Mr. Alfons', 'male', '16', '0', '0', '345778', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('518', '0', '3', 'Ryan, Mr. Patrick', 'male', null, '0', '0', '371110', '24.15', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('284', '1', '3', 'Dorking, Mr. Edward Arthur', 'male', '19', '0', '0', 'A/5. 10482', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('519', '1', '2', 'Angle, Mrs. William A (Florence \"Mary\" Agnes Hughes)', 'female', '36', '1', '0', '226875', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('285', '0', '1', 'Smith, Mr. Richard William', 'male', null, '0', '0', '113056', '26', 'A19', 'S'); +INSERT INTO `titanic_train` VALUES ('520', '0', '3', 'Pavlovic, Mr. Stefo', 'male', '32', '0', '0', '349242', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('286', '0', '3', 'Stankovic, Mr. Ivan', 'male', '33', '0', '0', '349239', '8.6625', '', 'C'); +INSERT INTO `titanic_train` VALUES ('521', '1', '1', 'Perreault, Miss. Anne', 'female', '30', '0', '0', '12749', '93.5', 'B73', 'S'); +INSERT INTO `titanic_train` VALUES ('287', '1', '3', 'de Mulder, Mr. Theodore', 'male', '30', '0', '0', '345774', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('522', '0', '3', 'Vovk, Mr. Janko', 'male', '22', '0', '0', '349252', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('288', '0', '3', 'Naidenoff, Mr. Penko', 'male', '22', '0', '0', '349206', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('523', '0', '3', 'Lahoud, Mr. Sarkis', 'male', null, '0', '0', '2624', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('289', '1', '2', 'Hosono, Mr. Masabumi', 'male', '42', '0', '0', '237798', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('524', '1', '1', 'Hippach, Mrs. Louis Albert (Ida Sophia Fischer)', 'female', '44', '0', '1', '111361', '57.9792', 'B18', 'C'); +INSERT INTO `titanic_train` VALUES ('290', '1', '3', 'Connolly, Miss. Kate', 'female', '22', '0', '0', '370373', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('525', '0', '3', 'Kassem, Mr. Fared', 'male', null, '0', '0', '2700', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('291', '1', '1', 'Barber, Miss. Ellen \"Nellie\"', 'female', '26', '0', '0', '19877', '78.85', '', 'S'); +INSERT INTO `titanic_train` VALUES ('526', '0', '3', 'Farrell, Mr. James', 'male', '40.5', '0', '0', '367232', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('292', '1', '1', 'Bishop, Mrs. Dickinson H (Helen Walton)', 'female', '19', '1', '0', '11967', '91.0792', 'B49', 'C'); +INSERT INTO `titanic_train` VALUES ('527', '1', '2', 'Ridsdale, Miss. Lucy', 'female', '50', '0', '0', 'W./C. 14258', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('293', '0', '2', 'Levy, Mr. Rene Jacques', 'male', '36', '0', '0', 'SC/Paris 2163', '12.875', 'D', 'C'); +INSERT INTO `titanic_train` VALUES ('528', '0', '1', 'Farthing, Mr. John', 'male', null, '0', '0', 'PC 17483', '221.7792', 'C95', 'S'); +INSERT INTO `titanic_train` VALUES ('294', '0', '3', 'Haas, Miss. Aloisia', 'female', '24', '0', '0', '349236', '8.85', '', 'S'); +INSERT INTO `titanic_train` VALUES ('529', '0', '3', 'Salonen, Mr. Johan Werner', 'male', '39', '0', '0', '3101296', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('295', '0', '3', 'Mineff, Mr. Ivan', 'male', '24', '0', '0', '349233', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('530', '0', '2', 'Hocking, Mr. Richard George', 'male', '23', '2', '1', '29104', '11.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('296', '0', '1', 'Lewy, Mr. Ervin G', 'male', null, '0', '0', 'PC 17612', '27.7208', '', 'C'); +INSERT INTO `titanic_train` VALUES ('531', '1', '2', 'Quick, Miss. Phyllis May', 'female', '2', '1', '1', '26360', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('297', '0', '3', 'Hanna, Mr. Mansour', 'male', '23.5', '0', '0', '2693', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('532', '0', '3', 'Toufik, Mr. Nakli', 'male', null, '0', '0', '2641', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('298', '0', '1', 'Allison, Miss. Helen Loraine', 'female', '2', '1', '2', '113781', '151.55', 'C22 C26', 'S'); +INSERT INTO `titanic_train` VALUES ('533', '0', '3', 'Elias, Mr. Joseph Jr', 'male', '17', '1', '1', '2690', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('299', '1', '1', 'Saalfeld, Mr. Adolphe', 'male', null, '0', '0', '19988', '30.5', 'C106', 'S'); +INSERT INTO `titanic_train` VALUES ('534', '1', '3', 'Peter, Mrs. Catherine (Catherine Rizk)', 'female', null, '0', '2', '2668', '22.3583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('300', '1', '1', 'Baxter, Mrs. James (Helene DeLaudeniere Chaput)', 'female', '50', '0', '1', 'PC 17558', '247.5208', 'B58 B60', 'C'); +INSERT INTO `titanic_train` VALUES ('535', '0', '3', 'Cacic, Miss. Marija', 'female', '30', '0', '0', '315084', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('301', '1', '3', 'Kelly, Miss. Anna Katherine \"Annie Kate\"', 'female', null, '0', '0', '9234', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('536', '1', '2', 'Hart, Miss. Eva Miriam', 'female', '7', '0', '2', 'F.C.C. 13529', '26.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('302', '1', '3', 'McCoy, Mr. Bernard', 'male', null, '2', '0', '367226', '23.25', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('537', '0', '1', 'Butt, Major. Archibald Willingham', 'male', '45', '0', '0', '113050', '26.55', 'B38', 'S'); +INSERT INTO `titanic_train` VALUES ('303', '0', '3', 'Johnson, Mr. William Cahoone Jr', 'male', '19', '0', '0', 'LINE', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('538', '1', '1', 'LeRoy, Miss. Bertha', 'female', '30', '0', '0', 'PC 17761', '106.425', '', 'C'); +INSERT INTO `titanic_train` VALUES ('304', '1', '2', 'Keane, Miss. Nora A', 'female', null, '0', '0', '226593', '12.35', 'E101', 'Q'); +INSERT INTO `titanic_train` VALUES ('539', '0', '3', 'Risien, Mr. Samuel Beard', 'male', null, '0', '0', '364498', '14.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('305', '0', '3', 'Williams, Mr. Howard Hugh \"Harry\"', 'male', null, '0', '0', 'A/5 2466', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('540', '1', '1', 'Frolicher, Miss. Hedwig Margaritha', 'female', '22', '0', '2', '13568', '49.5', 'B39', 'C'); +INSERT INTO `titanic_train` VALUES ('306', '1', '1', 'Allison, Master. Hudson Trevor', 'male', '0.92', '1', '2', '113781', '151.55', 'C22 C26', 'S'); +INSERT INTO `titanic_train` VALUES ('541', '1', '1', 'Crosby, Miss. Harriet R', 'female', '36', '0', '2', 'WE/P 5735', '71', 'B22', 'S'); +INSERT INTO `titanic_train` VALUES ('307', '1', '1', 'Fleming, Miss. Margaret', 'female', null, '0', '0', '17421', '110.8833', '', 'C'); +INSERT INTO `titanic_train` VALUES ('542', '0', '3', 'Andersson, Miss. Ingeborg Constanzia', 'female', '9', '4', '2', '347082', '31.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('308', '1', '1', 'Penasco y Castellana, Mrs. Victor de Satode (Maria Josefa Perez de Soto y Vallejo)', 'female', '17', '1', '0', 'PC 17758', '108.9', 'C65', 'C'); +INSERT INTO `titanic_train` VALUES ('543', '0', '3', 'Andersson, Miss. Sigrid Elisabeth', 'female', '11', '4', '2', '347082', '31.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('309', '0', '2', 'Abelson, Mr. Samuel', 'male', '30', '1', '0', 'P/PP 3381', '24', '', 'C'); +INSERT INTO `titanic_train` VALUES ('544', '1', '2', 'Beane, Mr. Edward', 'male', '32', '1', '0', '2908', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('310', '1', '1', 'Francatelli, Miss. Laura Mabel', 'female', '30', '0', '0', 'PC 17485', '56.9292', 'E36', 'C'); +INSERT INTO `titanic_train` VALUES ('545', '0', '1', 'Douglas, Mr. Walter Donald', 'male', '50', '1', '0', 'PC 17761', '106.425', 'C86', 'C'); +INSERT INTO `titanic_train` VALUES ('311', '1', '1', 'Hays, Miss. Margaret Bechstein', 'female', '24', '0', '0', '11767', '83.1583', 'C54', 'C'); +INSERT INTO `titanic_train` VALUES ('546', '0', '1', 'Nicholson, Mr. Arthur Ernest', 'male', '64', '0', '0', '693', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('312', '1', '1', 'Ryerson, Miss. Emily Borie', 'female', '18', '2', '2', 'PC 17608', '262.375', 'B57 B59 B63 B66', 'C'); +INSERT INTO `titanic_train` VALUES ('547', '1', '2', 'Beane, Mrs. Edward (Ethel Clarke)', 'female', '19', '1', '0', '2908', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('313', '0', '2', 'Lahtinen, Mrs. William (Anna Sylfven)', 'female', '26', '1', '1', '250651', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('548', '1', '2', 'Padro y Manent, Mr. Julian', 'male', null, '0', '0', 'SC/PARIS 2146', '13.8625', '', 'C'); +INSERT INTO `titanic_train` VALUES ('314', '0', '3', 'Hendekovic, Mr. Ignjac', 'male', '28', '0', '0', '349243', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('549', '0', '3', 'Goldsmith, Mr. Frank John', 'male', '33', '1', '1', '363291', '20.525', '', 'S'); +INSERT INTO `titanic_train` VALUES ('315', '0', '2', 'Hart, Mr. Benjamin', 'male', '43', '1', '1', 'F.C.C. 13529', '26.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('550', '1', '2', 'Davies, Master. John Morgan Jr', 'male', '8', '1', '1', 'C.A. 33112', '36.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('316', '1', '3', 'Nilsson, Miss. Helmina Josefina', 'female', '26', '0', '0', '347470', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('551', '1', '1', 'Thayer, Mr. John Borland Jr', 'male', '17', '0', '2', '17421', '110.8833', 'C70', 'C'); +INSERT INTO `titanic_train` VALUES ('317', '1', '2', 'Kantor, Mrs. Sinai (Miriam Sternin)', 'female', '24', '1', '0', '244367', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('552', '0', '2', 'Sharp, Mr. Percival James R', 'male', '27', '0', '0', '244358', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('318', '0', '2', 'Moraweck, Dr. Ernest', 'male', '54', '0', '0', '29011', '14', '', 'S'); +INSERT INTO `titanic_train` VALUES ('553', '0', '3', 'O\'Brien, Mr. Timothy', 'male', null, '0', '0', '330979', '7.8292', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('319', '1', '1', 'Wick, Miss. Mary Natalie', 'female', '31', '0', '2', '36928', '164.8667', 'C7', 'S'); +INSERT INTO `titanic_train` VALUES ('554', '1', '3', 'Leeni, Mr. Fahim (\"Philip Zenni\")', 'male', '22', '0', '0', '2620', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('320', '1', '1', 'Spedden, Mrs. Frederic Oakley (Margaretta Corning Stone)', 'female', '40', '1', '1', '16966', '134.5', 'E34', 'C'); +INSERT INTO `titanic_train` VALUES ('555', '1', '3', 'Ohman, Miss. Velin', 'female', '22', '0', '0', '347085', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('321', '0', '3', 'Dennis, Mr. Samuel', 'male', '22', '0', '0', 'A/5 21172', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('556', '0', '1', 'Wright, Mr. George', 'male', '62', '0', '0', '113807', '26.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('322', '0', '3', 'Danoff, Mr. Yoto', 'male', '27', '0', '0', '349219', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('557', '1', '1', 'Duff Gordon, Lady. (Lucille Christiana Sutherland) (\"Mrs Morgan\")', 'female', '48', '1', '0', '11755', '39.6', 'A16', 'C'); +INSERT INTO `titanic_train` VALUES ('323', '1', '2', 'Slayter, Miss. Hilda Mary', 'female', '30', '0', '0', '234818', '12.35', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('558', '0', '1', 'Robbins, Mr. Victor', 'male', null, '0', '0', 'PC 17757', '227.525', '', 'C'); +INSERT INTO `titanic_train` VALUES ('324', '1', '2', 'Caldwell, Mrs. Albert Francis (Sylvia Mae Harbaugh)', 'female', '22', '1', '1', '248738', '29', '', 'S'); +INSERT INTO `titanic_train` VALUES ('559', '1', '1', 'Taussig, Mrs. Emil (Tillie Mandelbaum)', 'female', '39', '1', '1', '110413', '79.65', 'E67', 'S'); +INSERT INTO `titanic_train` VALUES ('325', '0', '3', 'Sage, Mr. George John Jr', 'male', null, '8', '2', 'CA. 2343', '69.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('560', '1', '3', 'de Messemaeker, Mrs. Guillaume Joseph (Emma)', 'female', '36', '1', '0', '345572', '17.4', '', 'S'); +INSERT INTO `titanic_train` VALUES ('326', '1', '1', 'Young, Miss. Marie Grice', 'female', '36', '0', '0', 'PC 17760', '135.6333', 'C32', 'C'); +INSERT INTO `titanic_train` VALUES ('561', '0', '3', 'Morrow, Mr. Thomas Rowan', 'male', null, '0', '0', '372622', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('327', '0', '3', 'Nysveen, Mr. Johan Hansen', 'male', '61', '0', '0', '345364', '6.2375', '', 'S'); +INSERT INTO `titanic_train` VALUES ('562', '0', '3', 'Sivic, Mr. Husein', 'male', '40', '0', '0', '349251', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('328', '1', '2', 'Ball, Mrs. (Ada E Hall)', 'female', '36', '0', '0', '28551', '13', 'D', 'S'); +INSERT INTO `titanic_train` VALUES ('563', '0', '2', 'Norman, Mr. Robert Douglas', 'male', '28', '0', '0', '218629', '13.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('329', '1', '3', 'Goldsmith, Mrs. Frank John (Emily Alice Brown)', 'female', '31', '1', '1', '363291', '20.525', '', 'S'); +INSERT INTO `titanic_train` VALUES ('564', '0', '3', 'Simmons, Mr. John', 'male', null, '0', '0', 'SOTON/OQ 392082', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('330', '1', '1', 'Hippach, Miss. Jean Gertrude', 'female', '16', '0', '1', '111361', '57.9792', 'B18', 'C'); +INSERT INTO `titanic_train` VALUES ('565', '0', '3', 'Meanwell, Miss. (Marion Ogden)', 'female', null, '0', '0', 'SOTON/O.Q. 392087', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('331', '1', '3', 'McCoy, Miss. Agnes', 'female', null, '2', '0', '367226', '23.25', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('566', '0', '3', 'Davies, Mr. Alfred J', 'male', '24', '2', '0', 'A/4 48871', '24.15', '', 'S'); +INSERT INTO `titanic_train` VALUES ('332', '0', '1', 'Partner, Mr. Austen', 'male', '45.5', '0', '0', '113043', '28.5', 'C124', 'S'); +INSERT INTO `titanic_train` VALUES ('567', '0', '3', 'Stoytcheff, Mr. Ilia', 'male', '19', '0', '0', '349205', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('333', '0', '1', 'Graham, Mr. George Edward', 'male', '38', '0', '1', 'PC 17582', '153.4625', 'C91', 'S'); +INSERT INTO `titanic_train` VALUES ('568', '0', '3', 'Palsson, Mrs. Nils (Alma Cornelia Berglund)', 'female', '29', '0', '4', '349909', '21.075', '', 'S'); +INSERT INTO `titanic_train` VALUES ('334', '0', '3', 'Vander Planke, Mr. Leo Edmondus', 'male', '16', '2', '0', '345764', '18', '', 'S'); +INSERT INTO `titanic_train` VALUES ('569', '0', '3', 'Doharr, Mr. Tannous', 'male', null, '0', '0', '2686', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('335', '1', '1', 'Frauenthal, Mrs. Henry William (Clara Heinsheimer)', 'female', null, '1', '0', 'PC 17611', '133.65', '', 'S'); +INSERT INTO `titanic_train` VALUES ('570', '1', '3', 'Jonsson, Mr. Carl', 'male', '32', '0', '0', '350417', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('336', '0', '3', 'Denkoff, Mr. Mitto', 'male', null, '0', '0', '349225', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('571', '1', '2', 'Harris, Mr. George', 'male', '62', '0', '0', 'S.W./PP 752', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('337', '0', '1', 'Pears, Mr. Thomas Clinton', 'male', '29', '1', '0', '113776', '66.6', 'C2', 'S'); +INSERT INTO `titanic_train` VALUES ('572', '1', '1', 'Appleton, Mrs. Edward Dale (Charlotte Lamson)', 'female', '53', '2', '0', '11769', '51.4792', 'C101', 'S'); +INSERT INTO `titanic_train` VALUES ('338', '1', '1', 'Burns, Miss. Elizabeth Margaret', 'female', '41', '0', '0', '16966', '134.5', 'E40', 'C'); +INSERT INTO `titanic_train` VALUES ('573', '1', '1', 'Flynn, Mr. John Irwin (\"Irving\")', 'male', '36', '0', '0', 'PC 17474', '26.3875', 'E25', 'S'); +INSERT INTO `titanic_train` VALUES ('339', '1', '3', 'Dahl, Mr. Karl Edwart', 'male', '45', '0', '0', '7598', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('574', '1', '3', 'Kelly, Miss. Mary', 'female', null, '0', '0', '14312', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('340', '0', '1', 'Blackwell, Mr. Stephen Weart', 'male', '45', '0', '0', '113784', '35.5', 'T', 'S'); +INSERT INTO `titanic_train` VALUES ('575', '0', '3', 'Rush, Mr. Alfred George John', 'male', '16', '0', '0', 'A/4. 20589', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('341', '1', '2', 'Navratil, Master. Edmond Roger', 'male', '2', '1', '1', '230080', '26', 'F2', 'S'); +INSERT INTO `titanic_train` VALUES ('576', '0', '3', 'Patchett, Mr. George', 'male', '19', '0', '0', '358585', '14.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('342', '1', '1', 'Fortune, Miss. Alice Elizabeth', 'female', '24', '3', '2', '19950', '263', 'C23 C25 C27', 'S'); +INSERT INTO `titanic_train` VALUES ('577', '1', '2', 'Garside, Miss. Ethel', 'female', '34', '0', '0', '243880', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('343', '0', '2', 'Collander, Mr. Erik Gustaf', 'male', '28', '0', '0', '248740', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('578', '1', '1', 'Silvey, Mrs. William Baird (Alice Munger)', 'female', '39', '1', '0', '13507', '55.9', 'E44', 'S'); +INSERT INTO `titanic_train` VALUES ('344', '0', '2', 'Sedgwick, Mr. Charles Frederick Waddington', 'male', '25', '0', '0', '244361', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('579', '0', '3', 'Caram, Mrs. Joseph (Maria Elias)', 'female', null, '1', '0', '2689', '14.4583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('345', '0', '2', 'Fox, Mr. Stanley Hubert', 'male', '36', '0', '0', '229236', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('580', '1', '3', 'Jussila, Mr. Eiriik', 'male', '32', '0', '0', 'STON/O 2. 3101286', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('346', '1', '2', 'Brown, Miss. Amelia \"Mildred\"', 'female', '24', '0', '0', '248733', '13', 'F33', 'S'); +INSERT INTO `titanic_train` VALUES ('581', '1', '2', 'Christy, Miss. Julie Rachel', 'female', '25', '1', '1', '237789', '30', '', 'S'); +INSERT INTO `titanic_train` VALUES ('347', '1', '2', 'Smith, Miss. Marion Elsie', 'female', '40', '0', '0', '31418', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('582', '1', '1', 'Thayer, Mrs. John Borland (Marian Longstreth Morris)', 'female', '39', '1', '1', '17421', '110.8833', 'C68', 'C'); +INSERT INTO `titanic_train` VALUES ('348', '1', '3', 'Davison, Mrs. Thomas Henry (Mary E Finck)', 'female', null, '1', '0', '386525', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('583', '0', '2', 'Downton, Mr. William James', 'male', '54', '0', '0', '28403', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('349', '1', '3', 'Coutts, Master. William Loch \"William\"', 'male', '3', '1', '1', 'C.A. 37671', '15.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('584', '0', '1', 'Ross, Mr. John Hugo', 'male', '36', '0', '0', '13049', '40.125', 'A10', 'C'); +INSERT INTO `titanic_train` VALUES ('350', '0', '3', 'Dimic, Mr. Jovan', 'male', '42', '0', '0', '315088', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('585', '0', '3', 'Paulner, Mr. Uscher', 'male', null, '0', '0', '3411', '8.7125', '', 'C'); +INSERT INTO `titanic_train` VALUES ('351', '0', '3', 'Odahl, Mr. Nils Martin', 'male', '23', '0', '0', '7267', '9.225', '', 'S'); +INSERT INTO `titanic_train` VALUES ('586', '1', '1', 'Taussig, Miss. Ruth', 'female', '18', '0', '2', '110413', '79.65', 'E68', 'S'); +INSERT INTO `titanic_train` VALUES ('352', '0', '1', 'Williams-Lambert, Mr. Fletcher Fellows', 'male', null, '0', '0', '113510', '35', 'C128', 'S'); +INSERT INTO `titanic_train` VALUES ('587', '0', '2', 'Jarvis, Mr. John Denzil', 'male', '47', '0', '0', '237565', '15', '', 'S'); +INSERT INTO `titanic_train` VALUES ('353', '0', '3', 'Elias, Mr. Tannous', 'male', '15', '1', '1', '2695', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('588', '1', '1', 'Frolicher-Stehli, Mr. Maxmillian', 'male', '60', '1', '1', '13567', '79.2', 'B41', 'C'); +INSERT INTO `titanic_train` VALUES ('354', '0', '3', 'Arnold-Franchi, Mr. Josef', 'male', '25', '1', '0', '349237', '17.8', '', 'S'); +INSERT INTO `titanic_train` VALUES ('589', '0', '3', 'Gilinski, Mr. Eliezer', 'male', '22', '0', '0', '14973', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('355', '0', '3', 'Yousif, Mr. Wazli', 'male', null, '0', '0', '2647', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('590', '0', '3', 'Murdlin, Mr. Joseph', 'male', null, '0', '0', 'A./5. 3235', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('356', '0', '3', 'Vanden Steen, Mr. Leo Peter', 'male', '28', '0', '0', '345783', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('591', '0', '3', 'Rintamaki, Mr. Matti', 'male', '35', '0', '0', 'STON/O 2. 3101273', '7.125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('357', '1', '1', 'Bowerman, Miss. Elsie Edith', 'female', '22', '0', '1', '113505', '55', 'E33', 'S'); +INSERT INTO `titanic_train` VALUES ('592', '1', '1', 'Stephenson, Mrs. Walter Bertram (Martha Eustis)', 'female', '52', '1', '0', '36947', '78.2667', 'D20', 'C'); +INSERT INTO `titanic_train` VALUES ('358', '0', '2', 'Funk, Miss. Annie Clemmer', 'female', '38', '0', '0', '237671', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('359', '1', '3', 'McGovern, Miss. Mary', 'female', null, '0', '0', '330931', '7.8792', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('593', '0', '3', 'Elsbury, Mr. William James', 'male', '47', '0', '0', 'A/5 3902', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('360', '1', '3', 'Mockler, Miss. Helen Mary \"Ellie\"', 'female', null, '0', '0', '330980', '7.8792', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('594', '0', '3', 'Bourke, Miss. Mary', 'female', null, '0', '2', '364848', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('361', '0', '3', 'Skoog, Mr. Wilhelm', 'male', '40', '1', '4', '347088', '27.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('595', '0', '2', 'Chapman, Mr. John Henry', 'male', '37', '1', '0', 'SC/AH 29037', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('362', '0', '2', 'del Carlo, Mr. Sebastiano', 'male', '29', '1', '0', 'SC/PARIS 2167', '27.7208', '', 'C'); +INSERT INTO `titanic_train` VALUES ('596', '0', '3', 'Van Impe, Mr. Jean Baptiste', 'male', '36', '1', '1', '345773', '24.15', '', 'S'); +INSERT INTO `titanic_train` VALUES ('363', '0', '3', 'Barbara, Mrs. (Catherine David)', 'female', '45', '0', '1', '2691', '14.4542', '', 'C'); +INSERT INTO `titanic_train` VALUES ('597', '1', '2', 'Leitch, Miss. Jessie Wills', 'female', null, '0', '0', '248727', '33', '', 'S'); +INSERT INTO `titanic_train` VALUES ('364', '0', '3', 'Asim, Mr. Adola', 'male', '35', '0', '0', 'SOTON/O.Q. 3101310', '7.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('598', '0', '3', 'Johnson, Mr. Alfred', 'male', '49', '0', '0', 'LINE', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('365', '0', '3', 'O\'Brien, Mr. Thomas', 'male', null, '1', '0', '370365', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('599', '0', '3', 'Boulos, Mr. Hanna', 'male', null, '0', '0', '2664', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('366', '0', '3', 'Adahl, Mr. Mauritz Nils Martin', 'male', '30', '0', '0', 'C 7076', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('600', '1', '1', 'Duff Gordon, Sir. Cosmo Edmund (\"Mr Morgan\")', 'male', '49', '1', '0', 'PC 17485', '56.9292', 'A20', 'C'); +INSERT INTO `titanic_train` VALUES ('367', '1', '1', 'Warren, Mrs. Frank Manley (Anna Sophia Atkinson)', 'female', '60', '1', '0', '110813', '75.25', 'D37', 'C'); +INSERT INTO `titanic_train` VALUES ('601', '1', '2', 'Jacobsohn, Mrs. Sidney Samuel (Amy Frances Christy)', 'female', '24', '2', '1', '243847', '27', '', 'S'); +INSERT INTO `titanic_train` VALUES ('368', '1', '3', 'Moussa, Mrs. (Mantoura Boulos)', 'female', null, '0', '0', '2626', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('602', '0', '3', 'Slabenoff, Mr. Petco', 'male', null, '0', '0', '349214', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('369', '1', '3', 'Jermyn, Miss. Annie', 'female', null, '0', '0', '14313', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('603', '0', '1', 'Harrington, Mr. Charles H', 'male', null, '0', '0', '113796', '42.4', '', 'S'); +INSERT INTO `titanic_train` VALUES ('370', '1', '1', 'Aubart, Mme. Leontine Pauline', 'female', '24', '0', '0', 'PC 17477', '69.3', 'B35', 'C'); +INSERT INTO `titanic_train` VALUES ('604', '0', '3', 'Torber, Mr. Ernst William', 'male', '44', '0', '0', '364511', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('371', '1', '1', 'Harder, Mr. George Achilles', 'male', '25', '1', '0', '11765', '55.4417', 'E50', 'C'); +INSERT INTO `titanic_train` VALUES ('605', '1', '1', 'Homer, Mr. Harry (\"Mr E Haven\")', 'male', '35', '0', '0', '111426', '26.55', '', 'C'); +INSERT INTO `titanic_train` VALUES ('606', '0', '3', 'Lindell, Mr. Edvard Bengtsson', 'male', '36', '1', '0', '349910', '15.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('372', '0', '3', 'Wiklund, Mr. Jakob Alfred', 'male', '18', '1', '0', '3101267', '6.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('607', '0', '3', 'Karaic, Mr. Milan', 'male', '30', '0', '0', '349246', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('373', '0', '3', 'Beavan, Mr. William Thomas', 'male', '19', '0', '0', '323951', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('608', '1', '1', 'Daniel, Mr. Robert Williams', 'male', '27', '0', '0', '113804', '30.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('374', '0', '1', 'Ringhini, Mr. Sante', 'male', '22', '0', '0', 'PC 17760', '135.6333', '', 'C'); +INSERT INTO `titanic_train` VALUES ('609', '1', '2', 'Laroche, Mrs. Joseph (Juliette Marie Louise Lafargue)', 'female', '22', '1', '2', 'SC/Paris 2123', '41.5792', '', 'C'); +INSERT INTO `titanic_train` VALUES ('375', '0', '3', 'Palsson, Miss. Stina Viola', 'female', '3', '3', '1', '349909', '21.075', '', 'S'); +INSERT INTO `titanic_train` VALUES ('610', '1', '1', 'Shutes, Miss. Elizabeth W', 'female', '40', '0', '0', 'PC 17582', '153.4625', 'C125', 'S'); +INSERT INTO `titanic_train` VALUES ('611', '0', '3', 'Andersson, Mrs. Anders Johan (Alfrida Konstantia Brogren)', 'female', '39', '1', '5', '347082', '31.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('376', '1', '1', 'Meyer, Mrs. Edgar Joseph (Leila Saks)', 'female', null, '1', '0', 'PC 17604', '82.1708', '', 'C'); +INSERT INTO `titanic_train` VALUES ('612', '0', '3', 'Jardin, Mr. Jose Neto', 'male', null, '0', '0', 'SOTON/O.Q. 3101305', '7.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('377', '1', '3', 'Landergren, Miss. Aurora Adelia', 'female', '22', '0', '0', 'C 7077', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('613', '1', '3', 'Murphy, Miss. Margaret Jane', 'female', null, '1', '0', '367230', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('378', '0', '1', 'Widener, Mr. Harry Elkins', 'male', '27', '0', '2', '113503', '211.5', 'C82', 'C'); +INSERT INTO `titanic_train` VALUES ('614', '0', '3', 'Horgan, Mr. John', 'male', null, '0', '0', '370377', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('379', '0', '3', 'Betros, Mr. Tannous', 'male', '20', '0', '0', '2648', '4.0125', '', 'C'); +INSERT INTO `titanic_train` VALUES ('615', '0', '3', 'Brocklebank, Mr. William Alfred', 'male', '35', '0', '0', '364512', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('380', '0', '3', 'Gustafsson, Mr. Karl Gideon', 'male', '19', '0', '0', '347069', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('616', '1', '2', 'Herman, Miss. Alice', 'female', '24', '1', '2', '220845', '65', '', 'S'); +INSERT INTO `titanic_train` VALUES ('381', '1', '1', 'Bidois, Miss. Rosalie', 'female', '42', '0', '0', 'PC 17757', '227.525', '', 'C'); +INSERT INTO `titanic_train` VALUES ('617', '0', '3', 'Danbom, Mr. Ernst Gilbert', 'male', '34', '1', '1', '347080', '14.4', '', 'S'); +INSERT INTO `titanic_train` VALUES ('382', '1', '3', 'Nakid, Miss. Maria (\"Mary\")', 'female', '1', '0', '2', '2653', '15.7417', '', 'C'); +INSERT INTO `titanic_train` VALUES ('618', '0', '3', 'Lobb, Mrs. William Arthur (Cordelia K Stanlick)', 'female', '26', '1', '0', 'A/5. 3336', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('383', '0', '3', 'Tikkanen, Mr. Juho', 'male', '32', '0', '0', 'STON/O 2. 3101293', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('619', '1', '2', 'Becker, Miss. Marion Louise', 'female', '4', '2', '1', '230136', '39', 'F4', 'S'); +INSERT INTO `titanic_train` VALUES ('384', '1', '1', 'Holverson, Mrs. Alexander Oskar (Mary Aline Towner)', 'female', '35', '1', '0', '113789', '52', '', 'S'); +INSERT INTO `titanic_train` VALUES ('620', '0', '2', 'Gavey, Mr. Lawrence', 'male', '26', '0', '0', '31028', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('385', '0', '3', 'Plotcharsky, Mr. Vasil', 'male', null, '0', '0', '349227', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('621', '0', '3', 'Yasbeck, Mr. Antoni', 'male', '27', '1', '0', '2659', '14.4542', '', 'C'); +INSERT INTO `titanic_train` VALUES ('386', '0', '2', 'Davies, Mr. Charles Henry', 'male', '18', '0', '0', 'S.O.C. 14879', '73.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('622', '1', '1', 'Kimball, Mr. Edwin Nelson Jr', 'male', '42', '1', '0', '11753', '52.5542', 'D19', 'S'); +INSERT INTO `titanic_train` VALUES ('387', '0', '3', 'Goodwin, Master. Sidney Leonard', 'male', '1', '5', '2', 'CA 2144', '46.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('623', '1', '3', 'Nakid, Mr. Sahid', 'male', '20', '1', '1', '2653', '15.7417', '', 'C'); +INSERT INTO `titanic_train` VALUES ('388', '1', '2', 'Buss, Miss. Kate', 'female', '36', '0', '0', '27849', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('624', '0', '3', 'Hansen, Mr. Henry Damsgaard', 'male', '21', '0', '0', '350029', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('389', '0', '3', 'Sadlier, Mr. Matthew', 'male', null, '0', '0', '367655', '7.7292', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('625', '0', '3', 'Bowen, Mr. David John \"Dai\"', 'male', '21', '0', '0', '54636', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('390', '1', '2', 'Lehmann, Miss. Bertha', 'female', '17', '0', '0', 'SC 1748', '12', '', 'C'); +INSERT INTO `titanic_train` VALUES ('626', '0', '1', 'Sutton, Mr. Frederick', 'male', '61', '0', '0', '36963', '32.3208', 'D50', 'S'); +INSERT INTO `titanic_train` VALUES ('391', '1', '1', 'Carter, Mr. William Ernest', 'male', '36', '1', '2', '113760', '120', 'B96 B98', 'S'); +INSERT INTO `titanic_train` VALUES ('627', '0', '2', 'Kirkland, Rev. Charles Leonard', 'male', '57', '0', '0', '219533', '12.35', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('392', '1', '3', 'Jansson, Mr. Carl Olof', 'male', '21', '0', '0', '350034', '7.7958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('628', '1', '1', 'Longley, Miss. Gretchen Fiske', 'female', '21', '0', '0', '13502', '77.9583', 'D9', 'S'); +INSERT INTO `titanic_train` VALUES ('393', '0', '3', 'Gustafsson, Mr. Johan Birger', 'male', '28', '2', '0', '3101277', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('629', '0', '3', 'Bostandyeff, Mr. Guentcho', 'male', '26', '0', '0', '349224', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('394', '1', '1', 'Newell, Miss. Marjorie', 'female', '23', '1', '0', '35273', '113.275', 'D36', 'C'); +INSERT INTO `titanic_train` VALUES ('630', '0', '3', 'O\'Connell, Mr. Patrick D', 'male', null, '0', '0', '334912', '7.7333', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('395', '1', '3', 'Sandstrom, Mrs. Hjalmar (Agnes Charlotta Bengtsson)', 'female', '24', '0', '2', 'PP 9549', '16.7', 'G6', 'S'); +INSERT INTO `titanic_train` VALUES ('631', '1', '1', 'Barkworth, Mr. Algernon Henry Wilson', 'male', '80', '0', '0', '27042', '30', 'A23', 'S'); +INSERT INTO `titanic_train` VALUES ('396', '0', '3', 'Johansson, Mr. Erik', 'male', '22', '0', '0', '350052', '7.7958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('632', '0', '3', 'Lundahl, Mr. Johan Svensson', 'male', '51', '0', '0', '347743', '7.0542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('397', '0', '3', 'Olsson, Miss. Elina', 'female', '31', '0', '0', '350407', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('633', '1', '1', 'Stahelin-Maeglin, Dr. Max', 'male', '32', '0', '0', '13214', '30.5', 'B50', 'C'); +INSERT INTO `titanic_train` VALUES ('398', '0', '2', 'McKane, Mr. Peter David', 'male', '46', '0', '0', '28403', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('634', '0', '1', 'Parr, Mr. William Henry Marsh', 'male', null, '0', '0', '112052', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('399', '0', '2', 'Pain, Dr. Alfred', 'male', '23', '0', '0', '244278', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('635', '0', '3', 'Skoog, Miss. Mabel', 'female', '9', '3', '2', '347088', '27.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('400', '1', '2', 'Trout, Mrs. William H (Jessie L)', 'female', '28', '0', '0', '240929', '12.65', '', 'S'); +INSERT INTO `titanic_train` VALUES ('636', '1', '2', 'Davis, Miss. Mary', 'female', '28', '0', '0', '237668', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('401', '1', '3', 'Niskanen, Mr. Juha', 'male', '39', '0', '0', 'STON/O 2. 3101289', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('637', '0', '3', 'Leinonen, Mr. Antti Gustaf', 'male', '32', '0', '0', 'STON/O 2. 3101292', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('402', '0', '3', 'Adams, Mr. John', 'male', '26', '0', '0', '341826', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('638', '0', '2', 'Collyer, Mr. Harvey', 'male', '31', '1', '1', 'C.A. 31921', '26.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('403', '0', '3', 'Jussila, Miss. Mari Aina', 'female', '21', '1', '0', '4137', '9.825', '', 'S'); +INSERT INTO `titanic_train` VALUES ('639', '0', '3', 'Panula, Mrs. Juha (Maria Emilia Ojala)', 'female', '41', '0', '5', '3101295', '39.6875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('404', '0', '3', 'Hakkarainen, Mr. Pekka Pietari', 'male', '28', '1', '0', 'STON/O2. 3101279', '15.85', '', 'S'); +INSERT INTO `titanic_train` VALUES ('640', '0', '3', 'Thorneycroft, Mr. Percival', 'male', null, '1', '0', '376564', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('405', '0', '3', 'Oreskovic, Miss. Marija', 'female', '20', '0', '0', '315096', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('641', '0', '3', 'Jensen, Mr. Hans Peder', 'male', '20', '0', '0', '350050', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('406', '0', '2', 'Gale, Mr. Shadrach', 'male', '34', '1', '0', '28664', '21', '', 'S'); +INSERT INTO `titanic_train` VALUES ('642', '1', '1', 'Sagesser, Mlle. Emma', 'female', '24', '0', '0', 'PC 17477', '69.3', 'B35', 'C'); +INSERT INTO `titanic_train` VALUES ('407', '0', '3', 'Widegren, Mr. Carl/Charles Peter', 'male', '51', '0', '0', '347064', '7.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('643', '0', '3', 'Skoog, Miss. Margit Elizabeth', 'female', '2', '3', '2', '347088', '27.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('408', '1', '2', 'Richards, Master. William Rowe', 'male', '3', '1', '1', '29106', '18.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('644', '1', '3', 'Foo, Mr. Choong', 'male', null, '0', '0', '1601', '56.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('409', '0', '3', 'Birkeland, Mr. Hans Martin Monsen', 'male', '21', '0', '0', '312992', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('645', '1', '3', 'Baclini, Miss. Eugenie', 'female', '0.75', '2', '1', '2666', '19.2583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('410', '0', '3', 'Lefebre, Miss. Ida', 'female', null, '3', '1', '4133', '25.4667', '', 'S'); +INSERT INTO `titanic_train` VALUES ('646', '1', '1', 'Harper, Mr. Henry Sleeper', 'male', '48', '1', '0', 'PC 17572', '76.7292', 'D33', 'C'); +INSERT INTO `titanic_train` VALUES ('411', '0', '3', 'Sdycoff, Mr. Todor', 'male', null, '0', '0', '349222', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('647', '0', '3', 'Cor, Mr. Liudevit', 'male', '19', '0', '0', '349231', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('412', '0', '3', 'Hart, Mr. Henry', 'male', null, '0', '0', '394140', '6.8583', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('648', '1', '1', 'Simonius-Blumer, Col. Oberst Alfons', 'male', '56', '0', '0', '13213', '35.5', 'A26', 'C'); +INSERT INTO `titanic_train` VALUES ('413', '1', '1', 'Minahan, Miss. Daisy E', 'female', '33', '1', '0', '19928', '90', 'C78', 'Q'); +INSERT INTO `titanic_train` VALUES ('649', '0', '3', 'Willey, Mr. Edward', 'male', null, '0', '0', 'S.O./P.P. 751', '7.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('414', '0', '2', 'Cunningham, Mr. Alfred Fleming', 'male', null, '0', '0', '239853', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('650', '1', '3', 'Stanley, Miss. Amy Zillah Elsie', 'female', '23', '0', '0', 'CA. 2314', '7.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('415', '1', '3', 'Sundman, Mr. Johan Julian', 'male', '44', '0', '0', 'STON/O 2. 3101269', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('651', '0', '3', 'Mitkoff, Mr. Mito', 'male', null, '0', '0', '349221', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('416', '0', '3', 'Meek, Mrs. Thomas (Annie Louise Rowley)', 'female', null, '0', '0', '343095', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('652', '1', '2', 'Doling, Miss. Elsie', 'female', '18', '0', '1', '231919', '23', '', 'S'); +INSERT INTO `titanic_train` VALUES ('417', '1', '2', 'Drew, Mrs. James Vivian (Lulu Thorne Christian)', 'female', '34', '1', '1', '28220', '32.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('653', '0', '3', 'Kalvik, Mr. Johannes Halvorsen', 'male', '21', '0', '0', '8475', '8.4333', '', 'S'); +INSERT INTO `titanic_train` VALUES ('418', '1', '2', 'Silven, Miss. Lyyli Karoliina', 'female', '18', '0', '2', '250652', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('654', '1', '3', 'O\'Leary, Miss. Hanora \"Norah\"', 'female', null, '0', '0', '330919', '7.8292', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('419', '0', '2', 'Matthews, Mr. William John', 'male', '30', '0', '0', '28228', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('655', '0', '3', 'Hegarty, Miss. Hanora \"Nora\"', 'female', '18', '0', '0', '365226', '6.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('420', '0', '3', 'Van Impe, Miss. Catharina', 'female', '10', '0', '2', '345773', '24.15', '', 'S'); +INSERT INTO `titanic_train` VALUES ('656', '0', '2', 'Hickman, Mr. Leonard Mark', 'male', '24', '2', '0', 'S.O.C. 14879', '73.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('421', '0', '3', 'Gheorgheff, Mr. Stanio', 'male', null, '0', '0', '349254', '7.8958', '', 'C'); +INSERT INTO `titanic_train` VALUES ('657', '0', '3', 'Radeff, Mr. Alexander', 'male', null, '0', '0', '349223', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('422', '0', '3', 'Charters, Mr. David', 'male', '21', '0', '0', 'A/5. 13032', '7.7333', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('658', '0', '3', 'Bourke, Mrs. John (Catherine)', 'female', '32', '1', '1', '364849', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('423', '0', '3', 'Zimmerman, Mr. Leo', 'male', '29', '0', '0', '315082', '7.875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('659', '0', '2', 'Eitemiller, Mr. George Floyd', 'male', '23', '0', '0', '29751', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('424', '0', '3', 'Danbom, Mrs. Ernst Gilbert (Anna Sigrid Maria Brogren)', 'female', '28', '1', '1', '347080', '14.4', '', 'S'); +INSERT INTO `titanic_train` VALUES ('660', '0', '1', 'Newell, Mr. Arthur Webster', 'male', '58', '0', '2', '35273', '113.275', 'D48', 'C'); +INSERT INTO `titanic_train` VALUES ('425', '0', '3', 'Rosblom, Mr. Viktor Richard', 'male', '18', '1', '1', '370129', '20.2125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('661', '1', '1', 'Frauenthal, Dr. Henry William', 'male', '50', '2', '0', 'PC 17611', '133.65', '', 'S'); +INSERT INTO `titanic_train` VALUES ('426', '0', '3', 'Wiseman, Mr. Phillippe', 'male', null, '0', '0', 'A/4. 34244', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('662', '0', '3', 'Badt, Mr. Mohamed', 'male', '40', '0', '0', '2623', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('427', '1', '2', 'Clarke, Mrs. Charles V (Ada Maria Winfield)', 'female', '28', '1', '0', '2003', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('663', '0', '1', 'Colley, Mr. Edward Pomeroy', 'male', '47', '0', '0', '5727', '25.5875', 'E58', 'S'); +INSERT INTO `titanic_train` VALUES ('428', '1', '2', 'Phillips, Miss. Kate Florence (\"Mrs Kate Louise Phillips Marshall\")', 'female', '19', '0', '0', '250655', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('664', '0', '3', 'Coleff, Mr. Peju', 'male', '36', '0', '0', '349210', '7.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('429', '0', '3', 'Flynn, Mr. James', 'male', null, '0', '0', '364851', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('665', '1', '3', 'Lindqvist, Mr. Eino William', 'male', '20', '1', '0', 'STON/O 2. 3101285', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('430', '1', '3', 'Pickard, Mr. Berk (Berk Trembisky)', 'male', '32', '0', '0', 'SOTON/O.Q. 392078', '8.05', 'E10', 'S'); +INSERT INTO `titanic_train` VALUES ('666', '0', '2', 'Hickman, Mr. Lewis', 'male', '32', '2', '0', 'S.O.C. 14879', '73.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('431', '1', '1', 'Bjornstrom-Steffansson, Mr. Mauritz Hakan', 'male', '28', '0', '0', '110564', '26.55', 'C52', 'S'); +INSERT INTO `titanic_train` VALUES ('667', '0', '2', 'Butler, Mr. Reginald Fenton', 'male', '25', '0', '0', '234686', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('432', '1', '3', 'Thorneycroft, Mrs. Percival (Florence Kate White)', 'female', null, '1', '0', '376564', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('668', '0', '3', 'Rommetvedt, Mr. Knud Paust', 'male', null, '0', '0', '312993', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('433', '1', '2', 'Louch, Mrs. Charles Alexander (Alice Adelaide Slow)', 'female', '42', '1', '0', 'SC/AH 3085', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('669', '0', '3', 'Cook, Mr. Jacob', 'male', '43', '0', '0', 'A/5 3536', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('434', '0', '3', 'Kallio, Mr. Nikolai Erland', 'male', '17', '0', '0', 'STON/O 2. 3101274', '7.125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('670', '1', '1', 'Taylor, Mrs. Elmer Zebley (Juliet Cummins Wright)', 'female', null, '1', '0', '19996', '52', 'C126', 'S'); +INSERT INTO `titanic_train` VALUES ('435', '0', '1', 'Silvey, Mr. William Baird', 'male', '50', '1', '0', '13507', '55.9', 'E44', 'S'); +INSERT INTO `titanic_train` VALUES ('671', '1', '2', 'Brown, Mrs. Thomas William Solomon (Elizabeth Catherine Ford)', 'female', '40', '1', '1', '29750', '39', '', 'S'); +INSERT INTO `titanic_train` VALUES ('436', '1', '1', 'Carter, Miss. Lucile Polk', 'female', '14', '1', '2', '113760', '120', 'B96 B98', 'S'); +INSERT INTO `titanic_train` VALUES ('672', '0', '1', 'Davidson, Mr. Thornton', 'male', '31', '1', '0', 'F.C. 12750', '52', 'B71', 'S'); +INSERT INTO `titanic_train` VALUES ('437', '0', '3', 'Ford, Miss. Doolina Margaret \"Daisy\"', 'female', '21', '2', '2', 'W./C. 6608', '34.375', '', 'S'); +INSERT INTO `titanic_train` VALUES ('673', '0', '2', 'Mitchell, Mr. Henry Michael', 'male', '70', '0', '0', 'C.A. 24580', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('438', '1', '2', 'Richards, Mrs. Sidney (Emily Hocking)', 'female', '24', '2', '3', '29106', '18.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('674', '1', '2', 'Wilhelms, Mr. Charles', 'male', '31', '0', '0', '244270', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('439', '0', '1', 'Fortune, Mr. Mark', 'male', '64', '1', '4', '19950', '263', 'C23 C25 C27', 'S'); +INSERT INTO `titanic_train` VALUES ('675', '0', '2', 'Watson, Mr. Ennis Hastings', 'male', null, '0', '0', '239856', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('440', '0', '2', 'Kvillner, Mr. Johan Henrik Johannesson', 'male', '31', '0', '0', 'C.A. 18723', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('676', '0', '3', 'Edvardsson, Mr. Gustaf Hjalmar', 'male', '18', '0', '0', '349912', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('441', '1', '2', 'Hart, Mrs. Benjamin (Esther Ada Bloomfield)', 'female', '45', '1', '1', 'F.C.C. 13529', '26.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('677', '0', '3', 'Sawyer, Mr. Frederick Charles', 'male', '24.5', '0', '0', '342826', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('442', '0', '3', 'Hampe, Mr. Leon', 'male', '20', '0', '0', '345769', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('678', '1', '3', 'Turja, Miss. Anna Sofia', 'female', '18', '0', '0', '4138', '9.8417', '', 'S'); +INSERT INTO `titanic_train` VALUES ('443', '0', '3', 'Petterson, Mr. Johan Emil', 'male', '25', '1', '0', '347076', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('679', '0', '3', 'Goodwin, Mrs. Frederick (Augusta Tyler)', 'female', '43', '1', '6', 'CA 2144', '46.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('444', '1', '2', 'Reynaldo, Ms. Encarnacion', 'female', '28', '0', '0', '230434', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('680', '1', '1', 'Cardeza, Mr. Thomas Drake Martinez', 'male', '36', '0', '1', 'PC 17755', '512.3292', 'B51 B53 B55', 'C'); +INSERT INTO `titanic_train` VALUES ('681', '0', '3', 'Peters, Miss. Katie', 'female', null, '0', '0', '330935', '8.1375', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('682', '1', '1', 'Hassab, Mr. Hammad', 'male', '27', '0', '0', 'PC 17572', '76.7292', 'D49', 'C'); +INSERT INTO `titanic_train` VALUES ('683', '0', '3', 'Olsvigen, Mr. Thor Anderson', 'male', '20', '0', '0', '6563', '9.225', '', 'S'); +INSERT INTO `titanic_train` VALUES ('684', '0', '3', 'Goodwin, Mr. Charles Edward', 'male', '14', '5', '2', 'CA 2144', '46.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('685', '0', '2', 'Brown, Mr. Thomas William Solomon', 'male', '60', '1', '1', '29750', '39', '', 'S'); +INSERT INTO `titanic_train` VALUES ('686', '0', '2', 'Laroche, Mr. Joseph Philippe Lemercier', 'male', '25', '1', '2', 'SC/Paris 2123', '41.5792', '', 'C'); +INSERT INTO `titanic_train` VALUES ('687', '0', '3', 'Panula, Mr. Jaako Arnold', 'male', '14', '4', '1', '3101295', '39.6875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('688', '0', '3', 'Dakic, Mr. Branko', 'male', '19', '0', '0', '349228', '10.1708', '', 'S'); +INSERT INTO `titanic_train` VALUES ('689', '0', '3', 'Fischer, Mr. Eberhard Thelander', 'male', '18', '0', '0', '350036', '7.7958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('690', '1', '1', 'Madill, Miss. Georgette Alexandra', 'female', '15', '0', '1', '24160', '211.3375', 'B5', 'S'); +INSERT INTO `titanic_train` VALUES ('691', '1', '1', 'Dick, Mr. Albert Adrian', 'male', '31', '1', '0', '17474', '57', 'B20', 'S'); +INSERT INTO `titanic_train` VALUES ('692', '1', '3', 'Karun, Miss. Manca', 'female', '4', '0', '1', '349256', '13.4167', '', 'C'); +INSERT INTO `titanic_train` VALUES ('693', '1', '3', 'Lam, Mr. Ali', 'male', null, '0', '0', '1601', '56.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('694', '0', '3', 'Saad, Mr. Khalil', 'male', '25', '0', '0', '2672', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('695', '0', '1', 'Weir, Col. John', 'male', '60', '0', '0', '113800', '26.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('696', '0', '2', 'Chapman, Mr. Charles Henry', 'male', '52', '0', '0', '248731', '13.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('697', '0', '3', 'Kelly, Mr. James', 'male', '44', '0', '0', '363592', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('698', '1', '3', 'Mullens, Miss. Katherine \"Katie\"', 'female', null, '0', '0', '35852', '7.7333', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('699', '0', '1', 'Thayer, Mr. John Borland', 'male', '49', '1', '1', '17421', '110.8833', 'C68', 'C'); +INSERT INTO `titanic_train` VALUES ('700', '0', '3', 'Humblen, Mr. Adolf Mathias Nicolai Olsen', 'male', '42', '0', '0', '348121', '7.65', 'F G63', 'S'); +INSERT INTO `titanic_train` VALUES ('701', '1', '1', 'Astor, Mrs. John Jacob (Madeleine Talmadge Force)', 'female', '18', '1', '0', 'PC 17757', '227.525', 'C62 C64', 'C'); +INSERT INTO `titanic_train` VALUES ('702', '1', '1', 'Silverthorne, Mr. Spencer Victor', 'male', '35', '0', '0', 'PC 17475', '26.2875', 'E24', 'S'); +INSERT INTO `titanic_train` VALUES ('703', '0', '3', 'Barbara, Miss. Saiide', 'female', '18', '0', '1', '2691', '14.4542', '', 'C'); +INSERT INTO `titanic_train` VALUES ('704', '0', '3', 'Gallagher, Mr. Martin', 'male', '25', '0', '0', '36864', '7.7417', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('705', '0', '3', 'Hansen, Mr. Henrik Juul', 'male', '26', '1', '0', '350025', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('706', '0', '2', 'Morley, Mr. Henry Samuel (\"Mr Henry Marshall\")', 'male', '39', '0', '0', '250655', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('707', '1', '2', 'Kelly, Mrs. Florence \"Fannie\"', 'female', '45', '0', '0', '223596', '13.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('708', '1', '1', 'Calderhead, Mr. Edward Pennington', 'male', '42', '0', '0', 'PC 17476', '26.2875', 'E24', 'S'); +INSERT INTO `titanic_train` VALUES ('709', '1', '1', 'Cleaver, Miss. Alice', 'female', '22', '0', '0', '113781', '151.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('710', '1', '3', 'Moubarek, Master. Halim Gonios (\"William George\")', 'male', null, '1', '1', '2661', '15.2458', '', 'C'); +INSERT INTO `titanic_train` VALUES ('711', '1', '1', 'Mayne, Mlle. Berthe Antonine (\"Mrs de Villiers\")', 'female', '24', '0', '0', 'PC 17482', '49.5042', 'C90', 'C'); +INSERT INTO `titanic_train` VALUES ('712', '0', '1', 'Klaber, Mr. Herman', 'male', null, '0', '0', '113028', '26.55', 'C124', 'S'); +INSERT INTO `titanic_train` VALUES ('713', '1', '1', 'Taylor, Mr. Elmer Zebley', 'male', '48', '1', '0', '19996', '52', 'C126', 'S'); +INSERT INTO `titanic_train` VALUES ('714', '0', '3', 'Larsson, Mr. August Viktor', 'male', '29', '0', '0', '7545', '9.4833', '', 'S'); +INSERT INTO `titanic_train` VALUES ('715', '0', '2', 'Greenberg, Mr. Samuel', 'male', '52', '0', '0', '250647', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('716', '0', '3', 'Soholt, Mr. Peter Andreas Lauritz Andersen', 'male', '19', '0', '0', '348124', '7.65', 'F G73', 'S'); +INSERT INTO `titanic_train` VALUES ('717', '1', '1', 'Endres, Miss. Caroline Louise', 'female', '38', '0', '0', 'PC 17757', '227.525', 'C45', 'C'); +INSERT INTO `titanic_train` VALUES ('718', '1', '2', 'Troutt, Miss. Edwina Celia \"Winnie\"', 'female', '27', '0', '0', '34218', '10.5', 'E101', 'S'); +INSERT INTO `titanic_train` VALUES ('719', '0', '3', 'McEvoy, Mr. Michael', 'male', null, '0', '0', '36568', '15.5', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('720', '0', '3', 'Johnson, Mr. Malkolm Joackim', 'male', '33', '0', '0', '347062', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('721', '1', '2', 'Harper, Miss. Annie Jessie \"Nina\"', 'female', '6', '0', '1', '248727', '33', '', 'S'); +INSERT INTO `titanic_train` VALUES ('722', '0', '3', 'Jensen, Mr. Svend Lauritz', 'male', '17', '1', '0', '350048', '7.0542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('723', '0', '2', 'Gillespie, Mr. William Henry', 'male', '34', '0', '0', '12233', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('724', '0', '2', 'Hodges, Mr. Henry Price', 'male', '50', '0', '0', '250643', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('725', '1', '1', 'Chambers, Mr. Norman Campbell', 'male', '27', '1', '0', '113806', '53.1', 'E8', 'S'); +INSERT INTO `titanic_train` VALUES ('726', '0', '3', 'Oreskovic, Mr. Luka', 'male', '20', '0', '0', '315094', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('727', '1', '2', 'Renouf, Mrs. Peter Henry (Lillian Jefferys)', 'female', '30', '3', '0', '31027', '21', '', 'S'); +INSERT INTO `titanic_train` VALUES ('728', '1', '3', 'Mannion, Miss. Margareth', 'female', null, '0', '0', '36866', '7.7375', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('729', '0', '2', 'Bryhl, Mr. Kurt Arnold Gottfrid', 'male', '25', '1', '0', '236853', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('730', '0', '3', 'Ilmakangas, Miss. Pieta Sofia', 'female', '25', '1', '0', 'STON/O2. 3101271', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('731', '1', '1', 'Allen, Miss. Elisabeth Walton', 'female', '29', '0', '0', '24160', '211.3375', 'B5', 'S'); +INSERT INTO `titanic_train` VALUES ('732', '0', '3', 'Hassan, Mr. Houssein G N', 'male', '11', '0', '0', '2699', '18.7875', '', 'C'); +INSERT INTO `titanic_train` VALUES ('733', '0', '2', 'Knight, Mr. Robert J', 'male', null, '0', '0', '239855', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('734', '0', '2', 'Berriman, Mr. William John', 'male', '23', '0', '0', '28425', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('735', '0', '2', 'Troupiansky, Mr. Moses Aaron', 'male', '23', '0', '0', '233639', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('736', '0', '3', 'Williams, Mr. Leslie', 'male', '28.5', '0', '0', '54636', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('737', '0', '3', 'Ford, Mrs. Edward (Margaret Ann Watson)', 'female', '48', '1', '3', 'W./C. 6608', '34.375', '', 'S'); +INSERT INTO `titanic_train` VALUES ('738', '1', '1', 'Lesurer, Mr. Gustave J', 'male', '35', '0', '0', 'PC 17755', '512.3292', 'B101', 'C'); +INSERT INTO `titanic_train` VALUES ('739', '0', '3', 'Ivanoff, Mr. Kanio', 'male', null, '0', '0', '349201', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('740', '0', '3', 'Nankoff, Mr. Minko', 'male', null, '0', '0', '349218', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('741', '1', '1', 'Hawksford, Mr. Walter James', 'male', null, '0', '0', '16988', '30', 'D45', 'S'); +INSERT INTO `titanic_train` VALUES ('742', '0', '1', 'Cavendish, Mr. Tyrell William', 'male', '36', '1', '0', '19877', '78.85', 'C46', 'S'); +INSERT INTO `titanic_train` VALUES ('743', '1', '1', 'Ryerson, Miss. Susan Parker \"Suzette\"', 'female', '21', '2', '2', 'PC 17608', '262.375', 'B57 B59 B63 B66', 'C'); +INSERT INTO `titanic_train` VALUES ('744', '0', '3', 'McNamee, Mr. Neal', 'male', '24', '1', '0', '376566', '16.1', '', 'S'); +INSERT INTO `titanic_train` VALUES ('745', '1', '3', 'Stranden, Mr. Juho', 'male', '31', '0', '0', 'STON/O 2. 3101288', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('746', '0', '1', 'Crosby, Capt. Edward Gifford', 'male', '70', '1', '1', 'WE/P 5735', '71', 'B22', 'S'); +INSERT INTO `titanic_train` VALUES ('747', '0', '3', 'Abbott, Mr. Rossmore Edward', 'male', '16', '1', '1', 'C.A. 2673', '20.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('748', '1', '2', 'Sinkkonen, Miss. Anna', 'female', '30', '0', '0', '250648', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('749', '0', '1', 'Marvin, Mr. Daniel Warner', 'male', '19', '1', '0', '113773', '53.1', 'D30', 'S'); +INSERT INTO `titanic_train` VALUES ('750', '0', '3', 'Connaghton, Mr. Michael', 'male', '31', '0', '0', '335097', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('751', '1', '2', 'Wells, Miss. Joan', 'female', '4', '1', '1', '29103', '23', '', 'S'); +INSERT INTO `titanic_train` VALUES ('752', '1', '3', 'Moor, Master. Meier', 'male', '6', '0', '1', '392096', '12.475', 'E121', 'S'); +INSERT INTO `titanic_train` VALUES ('753', '0', '3', 'Vande Velde, Mr. Johannes Joseph', 'male', '33', '0', '0', '345780', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('754', '0', '3', 'Jonkoff, Mr. Lalio', 'male', '23', '0', '0', '349204', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('755', '1', '2', 'Herman, Mrs. Samuel (Jane Laver)', 'female', '48', '1', '2', '220845', '65', '', 'S'); +INSERT INTO `titanic_train` VALUES ('756', '1', '2', 'Hamalainen, Master. Viljo', 'male', '0.67', '1', '1', '250649', '14.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('757', '0', '3', 'Carlsson, Mr. August Sigfrid', 'male', '28', '0', '0', '350042', '7.7958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('758', '0', '2', 'Bailey, Mr. Percy Andrew', 'male', '18', '0', '0', '29108', '11.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('759', '0', '3', 'Theobald, Mr. Thomas Leonard', 'male', '34', '0', '0', '363294', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('760', '1', '1', 'Rothes, the Countess. of (Lucy Noel Martha Dyer-Edwards)', 'female', '33', '0', '0', '110152', '86.5', 'B77', 'S'); +INSERT INTO `titanic_train` VALUES ('761', '0', '3', 'Garfirth, Mr. John', 'male', null, '0', '0', '358585', '14.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('762', '0', '3', 'Nirva, Mr. Iisakki Antino Aijo', 'male', '41', '0', '0', 'SOTON/O2 3101272', '7.125', '', 'S'); +INSERT INTO `titanic_train` VALUES ('763', '1', '3', 'Barah, Mr. Hanna Assi', 'male', '20', '0', '0', '2663', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('764', '1', '1', 'Carter, Mrs. William Ernest (Lucile Polk)', 'female', '36', '1', '2', '113760', '120', 'B96 B98', 'S'); +INSERT INTO `titanic_train` VALUES ('765', '0', '3', 'Eklund, Mr. Hans Linus', 'male', '16', '0', '0', '347074', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('766', '1', '1', 'Hogeboom, Mrs. John C (Anna Andrews)', 'female', '51', '1', '0', '13502', '77.9583', 'D11', 'S'); +INSERT INTO `titanic_train` VALUES ('767', '0', '1', 'Brewe, Dr. Arthur Jackson', 'male', null, '0', '0', '112379', '39.6', '', 'C'); +INSERT INTO `titanic_train` VALUES ('768', '0', '3', 'Mangan, Miss. Mary', 'female', '30.5', '0', '0', '364850', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('769', '0', '3', 'Moran, Mr. Daniel J', 'male', null, '1', '0', '371110', '24.15', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('770', '0', '3', 'Gronnestad, Mr. Daniel Danielsen', 'male', '32', '0', '0', '8471', '8.3625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('771', '0', '3', 'Lievens, Mr. Rene Aime', 'male', '24', '0', '0', '345781', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('772', '0', '3', 'Jensen, Mr. Niels Peder', 'male', '48', '0', '0', '350047', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('773', '0', '2', 'Mack, Mrs. (Mary)', 'female', '57', '0', '0', 'S.O./P.P. 3', '10.5', 'E77', 'S'); +INSERT INTO `titanic_train` VALUES ('774', '0', '3', 'Elias, Mr. Dibo', 'male', null, '0', '0', '2674', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('775', '1', '2', 'Hocking, Mrs. Elizabeth (Eliza Needs)', 'female', '54', '1', '3', '29105', '23', '', 'S'); +INSERT INTO `titanic_train` VALUES ('776', '0', '3', 'Myhrman, Mr. Pehr Fabian Oliver Malkolm', 'male', '18', '0', '0', '347078', '7.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('777', '0', '3', 'Tobin, Mr. Roger', 'male', null, '0', '0', '383121', '7.75', 'F38', 'Q'); +INSERT INTO `titanic_train` VALUES ('778', '1', '3', 'Emanuel, Miss. Virginia Ethel', 'female', '5', '0', '0', '364516', '12.475', '', 'S'); +INSERT INTO `titanic_train` VALUES ('779', '0', '3', 'Kilgannon, Mr. Thomas J', 'male', null, '0', '0', '36865', '7.7375', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('780', '1', '1', 'Robert, Mrs. Edward Scott (Elisabeth Walton McMillan)', 'female', '43', '0', '1', '24160', '211.3375', 'B3', 'S'); +INSERT INTO `titanic_train` VALUES ('781', '1', '3', 'Ayoub, Miss. Banoura', 'female', '13', '0', '0', '2687', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('782', '1', '1', 'Dick, Mrs. Albert Adrian (Vera Gillespie)', 'female', '17', '1', '0', '17474', '57', 'B20', 'S'); +INSERT INTO `titanic_train` VALUES ('783', '0', '1', 'Long, Mr. Milton Clyde', 'male', '29', '0', '0', '113501', '30', 'D6', 'S'); +INSERT INTO `titanic_train` VALUES ('784', '0', '3', 'Johnston, Mr. Andrew G', 'male', null, '1', '2', 'W./C. 6607', '23.45', '', 'S'); +INSERT INTO `titanic_train` VALUES ('785', '0', '3', 'Ali, Mr. William', 'male', '25', '0', '0', 'SOTON/O.Q. 3101312', '7.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('786', '0', '3', 'Harmer, Mr. Abraham (David Lishin)', 'male', '25', '0', '0', '374887', '7.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('787', '1', '3', 'Sjoblom, Miss. Anna Sofia', 'female', '18', '0', '0', '3101265', '7.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('788', '0', '3', 'Rice, Master. George Hugh', 'male', '8', '4', '1', '382652', '29.125', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('789', '1', '3', 'Dean, Master. Bertram Vere', 'male', '1', '1', '2', 'C.A. 2315', '20.575', '', 'S'); +INSERT INTO `titanic_train` VALUES ('790', '0', '1', 'Guggenheim, Mr. Benjamin', 'male', '46', '0', '0', 'PC 17593', '79.2', 'B82 B84', 'C'); +INSERT INTO `titanic_train` VALUES ('791', '0', '3', 'Keane, Mr. Andrew \"Andy\"', 'male', null, '0', '0', '12460', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('792', '0', '2', 'Gaskell, Mr. Alfred', 'male', '16', '0', '0', '239865', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('793', '0', '3', 'Sage, Miss. Stella Anna', 'female', null, '8', '2', 'CA. 2343', '69.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('794', '0', '1', 'Hoyt, Mr. William Fisher', 'male', null, '0', '0', 'PC 17600', '30.6958', '', 'C'); +INSERT INTO `titanic_train` VALUES ('795', '0', '3', 'Dantcheff, Mr. Ristiu', 'male', '25', '0', '0', '349203', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('796', '0', '2', 'Otter, Mr. Richard', 'male', '39', '0', '0', '28213', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('797', '1', '1', 'Leader, Dr. Alice (Farnham)', 'female', '49', '0', '0', '17465', '25.9292', 'D17', 'S'); +INSERT INTO `titanic_train` VALUES ('798', '1', '3', 'Osman, Mrs. Mara', 'female', '31', '0', '0', '349244', '8.6833', '', 'S'); +INSERT INTO `titanic_train` VALUES ('799', '0', '3', 'Ibrahim Shawah, Mr. Yousseff', 'male', '30', '0', '0', '2685', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('800', '0', '3', 'Van Impe, Mrs. Jean Baptiste (Rosalie Paula Govaert)', 'female', '30', '1', '1', '345773', '24.15', '', 'S'); +INSERT INTO `titanic_train` VALUES ('801', '0', '2', 'Ponesell, Mr. Martin', 'male', '34', '0', '0', '250647', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('802', '1', '2', 'Collyer, Mrs. Harvey (Charlotte Annie Tate)', 'female', '31', '1', '1', 'C.A. 31921', '26.25', '', 'S'); +INSERT INTO `titanic_train` VALUES ('803', '1', '1', 'Carter, Master. William Thornton II', 'male', '11', '1', '2', '113760', '120', 'B96 B98', 'S'); +INSERT INTO `titanic_train` VALUES ('804', '1', '3', 'Thomas, Master. Assad Alexander', 'male', '0.42', '0', '1', '2625', '8.5167', '', 'C'); +INSERT INTO `titanic_train` VALUES ('805', '1', '3', 'Hedman, Mr. Oskar Arvid', 'male', '27', '0', '0', '347089', '6.975', '', 'S'); +INSERT INTO `titanic_train` VALUES ('806', '0', '3', 'Johansson, Mr. Karl Johan', 'male', '31', '0', '0', '347063', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('807', '0', '1', 'Andrews, Mr. Thomas Jr', 'male', '39', '0', '0', '112050', '0', 'A36', 'S'); +INSERT INTO `titanic_train` VALUES ('808', '0', '3', 'Pettersson, Miss. Ellen Natalia', 'female', '18', '0', '0', '347087', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('809', '0', '2', 'Meyer, Mr. August', 'male', '39', '0', '0', '248723', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('810', '1', '1', 'Chambers, Mrs. Norman Campbell (Bertha Griggs)', 'female', '33', '1', '0', '113806', '53.1', 'E8', 'S'); +INSERT INTO `titanic_train` VALUES ('811', '0', '3', 'Alexander, Mr. William', 'male', '26', '0', '0', '3474', '7.8875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('812', '0', '3', 'Lester, Mr. James', 'male', '39', '0', '0', 'A/4 48871', '24.15', '', 'S'); +INSERT INTO `titanic_train` VALUES ('813', '0', '2', 'Slemen, Mr. Richard James', 'male', '35', '0', '0', '28206', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('814', '0', '3', 'Andersson, Miss. Ebba Iris Alfrida', 'female', '6', '4', '2', '347082', '31.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('815', '0', '3', 'Tomlin, Mr. Ernest Portage', 'male', '30.5', '0', '0', '364499', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('816', '0', '1', 'Fry, Mr. Richard', 'male', null, '0', '0', '112058', '0', 'B102', 'S'); +INSERT INTO `titanic_train` VALUES ('817', '0', '3', 'Heininen, Miss. Wendla Maria', 'female', '23', '0', '0', 'STON/O2. 3101290', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('818', '0', '2', 'Mallet, Mr. Albert', 'male', '31', '1', '1', 'S.C./PARIS 2079', '37.0042', '', 'C'); +INSERT INTO `titanic_train` VALUES ('819', '0', '3', 'Holm, Mr. John Fredrik Alexander', 'male', '43', '0', '0', 'C 7075', '6.45', '', 'S'); +INSERT INTO `titanic_train` VALUES ('820', '0', '3', 'Skoog, Master. Karl Thorsten', 'male', '10', '3', '2', '347088', '27.9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('821', '1', '1', 'Hays, Mrs. Charles Melville (Clara Jennings Gregg)', 'female', '52', '1', '1', '12749', '93.5', 'B69', 'S'); +INSERT INTO `titanic_train` VALUES ('822', '1', '3', 'Lulic, Mr. Nikola', 'male', '27', '0', '0', '315098', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('823', '0', '1', 'Reuchlin, Jonkheer. John George', 'male', '38', '0', '0', '19972', '0', '', 'S'); +INSERT INTO `titanic_train` VALUES ('824', '1', '3', 'Moor, Mrs. (Beila)', 'female', '27', '0', '1', '392096', '12.475', 'E121', 'S'); +INSERT INTO `titanic_train` VALUES ('825', '0', '3', 'Panula, Master. Urho Abraham', 'male', '2', '4', '1', '3101295', '39.6875', '', 'S'); +INSERT INTO `titanic_train` VALUES ('826', '0', '3', 'Flynn, Mr. John', 'male', null, '0', '0', '368323', '6.95', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('827', '0', '3', 'Lam, Mr. Len', 'male', null, '0', '0', '1601', '56.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('828', '1', '2', 'Mallet, Master. Andre', 'male', '1', '0', '2', 'S.C./PARIS 2079', '37.0042', '', 'C'); +INSERT INTO `titanic_train` VALUES ('829', '1', '3', 'McCormack, Mr. Thomas Joseph', 'male', null, '0', '0', '367228', '7.75', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('830', '1', '1', 'Stone, Mrs. George Nelson (Martha Evelyn)', 'female', '62', '0', '0', '113572', '80', 'B28', ''); +INSERT INTO `titanic_train` VALUES ('831', '1', '3', 'Yasbeck, Mrs. Antoni (Selini Alexander)', 'female', '15', '1', '0', '2659', '14.4542', '', 'C'); +INSERT INTO `titanic_train` VALUES ('832', '1', '2', 'Richards, Master. George Sibley', 'male', '0.83', '1', '1', '29106', '18.75', '', 'S'); +INSERT INTO `titanic_train` VALUES ('833', '0', '3', 'Saad, Mr. Amin', 'male', null, '0', '0', '2671', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('834', '0', '3', 'Augustsson, Mr. Albert', 'male', '23', '0', '0', '347468', '7.8542', '', 'S'); +INSERT INTO `titanic_train` VALUES ('835', '0', '3', 'Allum, Mr. Owen George', 'male', '18', '0', '0', '2223', '8.3', '', 'S'); +INSERT INTO `titanic_train` VALUES ('836', '1', '1', 'Compton, Miss. Sara Rebecca', 'female', '39', '1', '1', 'PC 17756', '83.1583', 'E49', 'C'); +INSERT INTO `titanic_train` VALUES ('837', '0', '3', 'Pasic, Mr. Jakob', 'male', '21', '0', '0', '315097', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('838', '0', '3', 'Sirota, Mr. Maurice', 'male', null, '0', '0', '392092', '8.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('839', '1', '3', 'Chip, Mr. Chang', 'male', '32', '0', '0', '1601', '56.4958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('840', '1', '1', 'Marechal, Mr. Pierre', 'male', null, '0', '0', '11774', '29.7', 'C47', 'C'); +INSERT INTO `titanic_train` VALUES ('841', '0', '3', 'Alhomaki, Mr. Ilmari Rudolf', 'male', '20', '0', '0', 'SOTON/O2 3101287', '7.925', '', 'S'); +INSERT INTO `titanic_train` VALUES ('842', '0', '2', 'Mudd, Mr. Thomas Charles', 'male', '16', '0', '0', 'S.O./P.P. 3', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('843', '1', '1', 'Serepeca, Miss. Augusta', 'female', '30', '0', '0', '113798', '31', '', 'C'); +INSERT INTO `titanic_train` VALUES ('844', '0', '3', 'Lemberopolous, Mr. Peter L', 'male', '34.5', '0', '0', '2683', '6.4375', '', 'C'); +INSERT INTO `titanic_train` VALUES ('845', '0', '3', 'Culumovic, Mr. Jeso', 'male', '17', '0', '0', '315090', '8.6625', '', 'S'); +INSERT INTO `titanic_train` VALUES ('846', '0', '3', 'Abbing, Mr. Anthony', 'male', '42', '0', '0', 'C.A. 5547', '7.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('847', '0', '3', 'Sage, Mr. Douglas Bullen', 'male', null, '8', '2', 'CA. 2343', '69.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('848', '0', '3', 'Markoff, Mr. Marin', 'male', '35', '0', '0', '349213', '7.8958', '', 'C'); +INSERT INTO `titanic_train` VALUES ('849', '0', '2', 'Harper, Rev. John', 'male', '28', '0', '1', '248727', '33', '', 'S'); +INSERT INTO `titanic_train` VALUES ('850', '1', '1', 'Goldenberg, Mrs. Samuel L (Edwiga Grabowska)', 'female', null, '1', '0', '17453', '89.1042', 'C92', 'C'); +INSERT INTO `titanic_train` VALUES ('851', '0', '3', 'Andersson, Master. Sigvard Harald Elias', 'male', '4', '4', '2', '347082', '31.275', '', 'S'); +INSERT INTO `titanic_train` VALUES ('852', '0', '3', 'Svensson, Mr. Johan', 'male', '74', '0', '0', '347060', '7.775', '', 'S'); +INSERT INTO `titanic_train` VALUES ('853', '0', '3', 'Boulos, Miss. Nourelain', 'female', '9', '1', '1', '2678', '15.2458', '', 'C'); +INSERT INTO `titanic_train` VALUES ('854', '1', '1', 'Lines, Miss. Mary Conover', 'female', '16', '0', '1', 'PC 17592', '39.4', 'D28', 'S'); +INSERT INTO `titanic_train` VALUES ('855', '0', '2', 'Carter, Mrs. Ernest Courtenay (Lilian Hughes)', 'female', '44', '1', '0', '244252', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('856', '1', '3', 'Aks, Mrs. Sam (Leah Rosen)', 'female', '18', '0', '1', '392091', '9.35', '', 'S'); +INSERT INTO `titanic_train` VALUES ('857', '1', '1', 'Wick, Mrs. George Dennick (Mary Hitchcock)', 'female', '45', '1', '1', '36928', '164.8667', '', 'S'); +INSERT INTO `titanic_train` VALUES ('858', '1', '1', 'Daly, Mr. Peter Denis ', 'male', '51', '0', '0', '113055', '26.55', 'E17', 'S'); +INSERT INTO `titanic_train` VALUES ('859', '1', '3', 'Baclini, Mrs. Solomon (Latifa Qurban)', 'female', '24', '0', '3', '2666', '19.2583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('860', '0', '3', 'Razi, Mr. Raihed', 'male', null, '0', '0', '2629', '7.2292', '', 'C'); +INSERT INTO `titanic_train` VALUES ('861', '0', '3', 'Hansen, Mr. Claus Peter', 'male', '41', '2', '0', '350026', '14.1083', '', 'S'); +INSERT INTO `titanic_train` VALUES ('862', '0', '2', 'Giles, Mr. Frederick Edward', 'male', '21', '1', '0', '28134', '11.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('863', '1', '1', 'Swift, Mrs. Frederick Joel (Margaret Welles Barron)', 'female', '48', '0', '0', '17466', '25.9292', 'D17', 'S'); +INSERT INTO `titanic_train` VALUES ('864', '0', '3', 'Sage, Miss. Dorothy Edith \"Dolly\"', 'female', null, '8', '2', 'CA. 2343', '69.55', '', 'S'); +INSERT INTO `titanic_train` VALUES ('865', '0', '2', 'Gill, Mr. John William', 'male', '24', '0', '0', '233866', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('866', '1', '2', 'Bystrom, Mrs. (Karolina)', 'female', '42', '0', '0', '236852', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('867', '1', '2', 'Duran y More, Miss. Asuncion', 'female', '27', '1', '0', 'SC/PARIS 2149', '13.8583', '', 'C'); +INSERT INTO `titanic_train` VALUES ('868', '0', '1', 'Roebling, Mr. Washington Augustus II', 'male', '31', '0', '0', 'PC 17590', '50.4958', 'A24', 'S'); +INSERT INTO `titanic_train` VALUES ('869', '0', '3', 'van Melkebeke, Mr. Philemon', 'male', null, '0', '0', '345777', '9.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('870', '1', '3', 'Johnson, Master. Harold Theodor', 'male', '4', '1', '1', '347742', '11.1333', '', 'S'); +INSERT INTO `titanic_train` VALUES ('871', '0', '3', 'Balkic, Mr. Cerin', 'male', '26', '0', '0', '349248', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('872', '1', '1', 'Beckwith, Mrs. Richard Leonard (Sallie Monypeny)', 'female', '47', '1', '1', '11751', '52.5542', 'D35', 'S'); +INSERT INTO `titanic_train` VALUES ('873', '0', '1', 'Carlsson, Mr. Frans Olof', 'male', '33', '0', '0', '695', '5', 'B51 B53 B55', 'S'); +INSERT INTO `titanic_train` VALUES ('874', '0', '3', 'Vander Cruyssen, Mr. Victor', 'male', '47', '0', '0', '345765', '9', '', 'S'); +INSERT INTO `titanic_train` VALUES ('875', '1', '2', 'Abelson, Mrs. Samuel (Hannah Wizosky)', 'female', '28', '1', '0', 'P/PP 3381', '24', '', 'C'); +INSERT INTO `titanic_train` VALUES ('876', '1', '3', 'Najib, Miss. Adele Kiamie \"Jane\"', 'female', '15', '0', '0', '2667', '7.225', '', 'C'); +INSERT INTO `titanic_train` VALUES ('877', '0', '3', 'Gustafsson, Mr. Alfred Ossian', 'male', '20', '0', '0', '7534', '9.8458', '', 'S'); +INSERT INTO `titanic_train` VALUES ('878', '0', '3', 'Petroff, Mr. Nedelio', 'male', '19', '0', '0', '349212', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('879', '0', '3', 'Laleff, Mr. Kristo', 'male', null, '0', '0', '349217', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('880', '1', '1', 'Potter, Mrs. Thomas Jr (Lily Alexenia Wilson)', 'female', '56', '0', '1', '11767', '83.1583', 'C50', 'C'); +INSERT INTO `titanic_train` VALUES ('881', '1', '2', 'Shelley, Mrs. William (Imanita Parrish Hall)', 'female', '25', '0', '1', '230433', '26', '', 'S'); +INSERT INTO `titanic_train` VALUES ('882', '0', '3', 'Markun, Mr. Johann', 'male', '33', '0', '0', '349257', '7.8958', '', 'S'); +INSERT INTO `titanic_train` VALUES ('883', '0', '3', 'Dahlberg, Miss. Gerda Ulrika', 'female', '22', '0', '0', '7552', '10.5167', '', 'S'); +INSERT INTO `titanic_train` VALUES ('884', '0', '2', 'Banfield, Mr. Frederick James', 'male', '28', '0', '0', 'C.A./SOTON 34068', '10.5', '', 'S'); +INSERT INTO `titanic_train` VALUES ('885', '0', '3', 'Sutehall, Mr. Henry Jr', 'male', '25', '0', '0', 'SOTON/OQ 392076', '7.05', '', 'S'); +INSERT INTO `titanic_train` VALUES ('886', '0', '3', 'Rice, Mrs. William (Margaret Norton)', 'female', '39', '0', '5', '382652', '29.125', '', 'Q'); +INSERT INTO `titanic_train` VALUES ('887', '0', '2', 'Montvila, Rev. Juozas', 'male', '27', '0', '0', '211536', '13', '', 'S'); +INSERT INTO `titanic_train` VALUES ('888', '1', '1', 'Graham, Miss. Margaret Edith', 'female', '19', '0', '0', '112053', '30', 'B42', 'S'); +INSERT INTO `titanic_train` VALUES ('889', '0', '3', 'Johnston, Miss. Catherine Helen \"Carrie\"', 'female', null, '1', '2', 'W./C. 6607', '23.45', '', 'S'); +INSERT INTO `titanic_train` VALUES ('890', '1', '1', 'Behr, Mr. Karl Howell', 'male', '26', '0', '0', '111369', '30', 'C148', 'C'); +INSERT INTO `titanic_train` VALUES ('891', '0', '3', 'Dooley, Mr. Patrick', 'male', '32', '0', '0', '370376', '7.75', '', 'Q'); diff --git a/pom.xml b/pom.xml index bbd0ad5..9dfadac 100644 --- a/pom.xml +++ b/pom.xml @@ -115,6 +115,21 @@ ant 1.7.1 + + com.github.abel533 + ECharts + 2.2.7 + + + com.alibaba + fastjson + 1.2.31 + + + com.google.code.gson + gson + 2.5 + dom4j dom4j diff --git a/src/main/java/eml/studio/client/OozieConnectionFactory.java b/src/main/java/eml/studio/client/OozieConnectionFactory.java index d6adf14..aecb895 100644 --- a/src/main/java/eml/studio/client/OozieConnectionFactory.java +++ b/src/main/java/eml/studio/client/OozieConnectionFactory.java @@ -20,19 +20,19 @@ public class OozieConnectionFactory extends AbstractConnectionFactory { public static AbstractConnectionFactory singleton = new OozieConnectionFactory(); private OozieConnectionFactory() {} - - /** - * Build diagram widget shape connection - * - * @param controller diagram controller - * @param start start shape point - * @param end end shape point - * @return connection between start and end shape - */ + + /** + * Build diagram widget shape connection + * + * @param controller diagram controller + * @param start start shape point + * @param end end shape point + * @return connection between start and end shape + */ @Override public Connection buildConnection(DiagramController controller, - Shape start, - Shape end) { + Shape start, + Shape end) { if (((NodeShape) start).getWidget() == ((NodeShape) end).getWidget()) return null; return new Connection(controller, start, end); diff --git a/src/main/java/eml/studio/client/controller/DBController.java b/src/main/java/eml/studio/client/controller/DBController.java index 4154593..cb6732f 100644 --- a/src/main/java/eml/studio/client/controller/DBController.java +++ b/src/main/java/eml/studio/client/controller/DBController.java @@ -19,6 +19,8 @@ import eml.studio.client.ui.binding.DatasetBinder; import eml.studio.client.ui.panel.component.DescribeGrid; import eml.studio.client.ui.binding.ProgramBinder; +import eml.studio.client.ui.panel.DataTypeSelectPanel; +import eml.studio.client.ui.panel.DataVisualPopPanel; import eml.studio.client.ui.panel.EditDatasetPanel; import eml.studio.client.ui.panel.EditProgramPanel; import eml.studio.client.ui.panel.PreviewPopupPanel; @@ -36,6 +38,7 @@ import eml.studio.client.util.Constants; import eml.studio.shared.model.Dataset; import eml.studio.shared.model.Program; +import eml.studio.shared.util.DatasetType; import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; @@ -53,7 +56,7 @@ public class DBController { public static ProgramServiceAsync programSrv = GWT.create(ProgramService.class); public static DatasetServiceAsync datasetSrv = GWT.create(DatasetService.class); public static CategoryServiceAsync categorySrv = GWT.create(CategoryService.class); - + public static ProgramBinder programBinder = GWT.create(ProgramBinder.class); public static DatasetBinder datasetBinder = GWT.create(DatasetBinder.class); private static Logger logger = Logger.getLogger(DBController.class.getName()); @@ -69,7 +72,7 @@ public class DBController { * @throws CommandParseException */ public boolean submitUploadProgram2DB(final Presenter presenter, final UploadFileModule fileUploader, - Program program, final DescribeGrid grid) + Program program, final DescribeGrid grid) throws CommandParseException { String name = grid.getText("Name"); if (name == null || "".equals(name)) { @@ -551,4 +554,48 @@ public void onSuccess(Dataset result) { previewPopup.setSourceUrl( path ); previewPopup.center(); } + + /** + * Data Visualization + * + * @param path file path + * @param fileId fileId + */ + public static void showDataVisualPopup(final String path,String fileId){ + //Data module visualization + if(path.contains("null")) + { + Window.alert("The results have not been produced yet!"); + return; + } + + datasetSrv.loadFile(path, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert("Loading data failedï¼"); + logger.info(caught.getMessage()); + } + @Override + public void onSuccess(Dataset result) { + if (result == null) + return; + if(result.getContenttype() == null) + { + Window.alert("Data type is not defined ,please select the data type firstï¼"); + DataTypeSelectPanel dataSelectPanel = new DataTypeSelectPanel(path,result); + dataSelectPanel.getDescLabel().setText("Data Type Selection - " + result.getName()); + dataSelectPanel.center(); + } + else if(result.getContenttype().equals(DatasetType.GENERAL.getDesc())) + Window.alert("Visualization only support jsonã€tsvã€csv data typeï¼"); + else + { + DataVisualPopPanel chartPopPanel = new DataVisualPopPanel(path ,result); + chartPopPanel.getDescLabel().setText("Data Visualization - " + result.getName()); + chartPopPanel.center(); + } + } + }); + } } diff --git a/src/main/java/eml/studio/client/controller/DiagramController.java b/src/main/java/eml/studio/client/controller/DiagramController.java index 04027fa..cfe54a0 100644 --- a/src/main/java/eml/studio/client/controller/DiagramController.java +++ b/src/main/java/eml/studio/client/controller/DiagramController.java @@ -295,7 +295,7 @@ public DiagramController(int canvasWidth, int canvasHeight, int frameWidth, scrollPanel.setHeight(frameHeight + "px"); } - + /** * Initialize the widget panel according to the canvas. * @@ -382,11 +382,11 @@ public void deleteWidget(){ this.clearSelectedWidgets(); } - /** - * Initialize panel event handler. - * - * @param panel - */ + /** + * Initialize panel event handler. + * + * @param panel + */ protected void initEventHandler(Panel panel) { panel.addDomHandler(new MouseMoveHandler() { @@ -451,7 +451,7 @@ protected void onKeyUp(KeyUpEvent event){ deleteWidget(); } } - + /** * Trigger action when mouse move event fired * @@ -533,9 +533,10 @@ public void onMouseDown(MouseDownEvent event) { NodeShape shape = (NodeShape) getShapeUnderMouse(); if (shape instanceof OutNodeShape) { OutNodeShape outShape = (OutNodeShape)shape; - String fileId = outShape.getFileId(); - String path = outShape.getAbsolutePath(); - DBController.showPreviewPopup(path,fileId); + int x = outShape.getOffsetLeft() + 2*outShape.getRadius(); + int y = outShape.getOffsetTop() + 2*outShape.getRadius(); + outShape.getContextMenu().setPopupPosition(x,y); + outShape.getContextMenu().show(); } if(isvacancy){ event.stopPropagation(); @@ -1111,7 +1112,7 @@ public int getCanvasHeight() { public AbsolutePanel getView() { return widgetPanel; } - + public Map getWidgets() { return widgets; } @@ -1119,7 +1120,7 @@ public Map getWidgets() { public void setWidgets(Map widgets) { this.widgets = widgets; } - + public SVGPanel getSvgPanel() { return svgPanel; } diff --git a/src/main/java/eml/studio/client/controller/LoginController.java b/src/main/java/eml/studio/client/controller/LoginController.java index 9200bd9..3630678 100644 --- a/src/main/java/eml/studio/client/controller/LoginController.java +++ b/src/main/java/eml/studio/client/controller/LoginController.java @@ -30,150 +30,150 @@ */ public class LoginController { - private static Logger logger = Logger.getLogger(LoginController.class.getName()); - protected AccountServiceAsync accountSrv = GWT.create(AccountService.class); - protected MailServiceAsync mailSrv = GWT.create(MailService.class); - protected AlertPanel alertPanel = new AlertPanel(); - - private HandlerManager eventBus; - private String token; - - public LoginController(HandlerManager eventBus) { - this.eventBus = eventBus; - this.token = null; - alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - AppController.redirect("index.html"); - } - - }); - - alertPanel.getClose().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - AppController.redirect("index.html"); - } - - }); - } - - public void logout() { - accountSrv.logout(new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - Window.Location.reload(); - } - - @Override - public void onSuccess(Void result) { - AppController.redirect("index.html?url=" + AppController.getUrl()); - } - - }); - - } - - public void dologin() { - accountSrv.isLogin(new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - logger.warning(caught.getMessage()); - String urlString = AppController.getUrl(); - AppController.redirect("index.html?url=" + urlString); + private static Logger logger = Logger.getLogger(LoginController.class.getName()); + protected AccountServiceAsync accountSrv = GWT.create(AccountService.class); + protected MailServiceAsync mailSrv = GWT.create(MailService.class); + protected AlertPanel alertPanel = new AlertPanel(); + + private HandlerManager eventBus; + private String token; + + public LoginController(HandlerManager eventBus) { + this.eventBus = eventBus; + this.token = null; + alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + AppController.redirect("index.html"); + } + + }); + + alertPanel.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + AppController.redirect("index.html"); + } + + }); + } + + public void logout() { + accountSrv.logout(new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.Location.reload(); + } + + @Override + public void onSuccess(Void result) { + AppController.redirect("index.html?url=" + AppController.getUrl()); + } + + }); + + } + + public void dologin() { + accountSrv.isLogin(new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + logger.warning(caught.getMessage()); + String urlString = AppController.getUrl(); + AppController.redirect("index.html?url=" + urlString); + } + + @Override + public void onSuccess(Account result) { + if (result != null) { + if(result.getEmail().equals("admin") && !token.equals("account")){ + AppController.username = result.getUsername(); + AppController.email = result.getEmail(); + AppController.power = result.getPower(); + eventBus.fireEvent(new LoginEvent("admin")); + }else{ + AppController.username = result.getUsername(); + AppController.email = result.getEmail(); + AppController.power = result.getPower(); + eventBus.fireEvent(new LoginEvent(token)); + } + } else { + String urlString = AppController.getUrl(); + AppController.redirect("index.html?url=" + urlString); + } + } + + }); + } + + public void go(String token) { + this.token = token; + if(token.startsWith("verifyr")){ + mailSrv.VerifyLink(token, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning(caught.getMessage()); + AppController.redirect("index.html?url=" + AppController.getUrl()); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + String arr[] = result.split(" "); + if(arr[0].equals("success")){ + AppController.username = result.split(" ")[1]; + AppController.email = result.split(" ")[2]; + AppController.verifylink = result.split(" ")[5]; + eventBus.fireEvent(new LoginEvent("register")); + }else{ + alertPanel.setContent("Link failed"); + RootLayoutPanel.get().clear(); + alertPanel.show(); + logger.info(result); + } + } + }); + }else if(token.startsWith("verifym")){ + mailSrv.VerifyLink(token, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning(caught.getMessage()); + AppController.redirect("index.html?url=" + AppController.getUrl()); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + String arr[] = result.split(" "); + if(arr[0].equals("success")){ + AppController.username = arr[1]; + AppController.email = arr[2]; + AppController.verifylink = arr[5]; + eventBus.fireEvent(new LoginEvent("resetpwd")); + }else{ + alertPanel.setContent("Link failed"); + RootLayoutPanel.get().clear(); + alertPanel.show(); + logger.info(result); + } + } + + }); + }else if(token.startsWith("register") || token.startsWith("resetpwd")){ + AppController.redirect("index.html?url=" + AppController.getUrl()); + }else { + dologin(); } - - @Override - public void onSuccess(Account result) { - if (result != null) { - if(result.getEmail().equals("admin") && !token.equals("account")){ - AppController.username = result.getUsername(); - AppController.email = result.getEmail(); - AppController.power = result.getPower(); - eventBus.fireEvent(new LoginEvent("admin")); - }else{ - AppController.username = result.getUsername(); - AppController.email = result.getEmail(); - AppController.power = result.getPower(); - eventBus.fireEvent(new LoginEvent(token)); - } - } else { - String urlString = AppController.getUrl(); - AppController.redirect("index.html?url=" + urlString); - } - } - - }); - } - - public void go(String token) { - this.token = token; - if(token.startsWith("verifyr")){ - mailSrv.VerifyLink(token, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - logger.warning(caught.getMessage()); - AppController.redirect("index.html?url=" + AppController.getUrl()); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - String arr[] = result.split(" "); - if(arr[0].equals("success")){ - AppController.username = result.split(" ")[1]; - AppController.email = result.split(" ")[2]; - AppController.verifylink = result.split(" ")[5]; - eventBus.fireEvent(new LoginEvent("register")); - }else{ - alertPanel.setContent("Link failed"); - RootLayoutPanel.get().clear(); - alertPanel.show(); - logger.info(result); - } - } - }); - }else if(token.startsWith("verifym")){ - mailSrv.VerifyLink(token, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - logger.warning(caught.getMessage()); - AppController.redirect("index.html?url=" + AppController.getUrl()); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - String arr[] = result.split(" "); - if(arr[0].equals("success")){ - AppController.username = arr[1]; - AppController.email = arr[2]; - AppController.verifylink = arr[5]; - eventBus.fireEvent(new LoginEvent("resetpwd")); - }else{ - alertPanel.setContent("Link failed"); - RootLayoutPanel.get().clear(); - alertPanel.show(); - logger.info(result); - } - } - - }); - }else if(token.startsWith("register") || token.startsWith("resetpwd")){ - AppController.redirect("index.html?url=" + AppController.getUrl()); - }else { - dologin(); - } - } + } } diff --git a/src/main/java/eml/studio/client/controller/MonitorController.java b/src/main/java/eml/studio/client/controller/MonitorController.java index f23926b..38bd3e7 100644 --- a/src/main/java/eml/studio/client/controller/MonitorController.java +++ b/src/main/java/eml/studio/client/controller/MonitorController.java @@ -28,313 +28,323 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.event.dom.client.MouseUpEvent; -import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; /** * Monitor controller is used to control operating logic in web app */ public class MonitorController extends DiagramController { - private static Logger logger = - Logger.getLogger(MonitorController.class.getName()); - - private static JobServiceAsync jobSrv = GWT.create(JobService.class); - - public MonitorController(int canvasWidth, int canvasHeight) { - super(canvasWidth, canvasHeight); - } - - /** - * Synchronize current oozie job with server - * @param curOozJobId target job id - */ - public void updateWgtCurOozJobId(String curOozJobId){ - for( Map.Entry entry: widgets.entrySet()){ - BaseWidget bw = entry.getValue(); - if( bw instanceof DatasetWidget) continue; - ProgramWidget proWgt = (ProgramWidget)bw; - if( ProgramWidget.Model.LATEST_OOZIE_JOBID.equals( - proWgt.getModel().getCurOozJobId() )){ - proWgt.getModel().setCurOozJobId( curOozJobId); - } - } - } - - /** - * Change the program node need to be executed status to new - * @param actionNames acitons need to be executed - */ - public void reflushWidgetStatus(List actionNames){ - for( String widgetId : actionNames){ - if( widgets.containsKey( widgetId )){ - ProgramWidget pw = (ProgramWidget) widgets.get(widgetId); - //give pw a NEW_STATUS OozieAction - pw.flushOozieAction(); - pw.clearMenu(); - - pw.addMenuItem( BaseWidgetMenuItemFactory.createDeleteItem(pw)); - } - } - } - - /** - * Lock widgets' parameter panels - * @param actionNames target action widgets need to be locked - */ - public void lockWidgetParameterPanel(List actionNames){ - for( String widgetId : actionNames){ - if( widgets.containsKey( widgetId )){ - ProgramWidget pw = (ProgramWidget) widgets.get(widgetId); - pw.getParameterPanel().lock(); - } - } - } - - /** - * Unlock widgets' parameter panels - * @param actionNames target action widgets need to be unlocked - */ - public void unlockWidgetParameterPanel(List actionNames){ - for( String widgetId : actionNames){ - if( widgets.containsKey( widgetId )){ - ProgramWidget pw = (ProgramWidget) widgets.get(widgetId); - pw.getParameterPanel().unlock(); - } - } - } - - /** - * Update widgets' actions status - * @param actions actions need to be update - */ - public void updateWidgetStatus(List actions) { - logger.info( "Actions number: " + actions.size() ); - for (OozieAction newAction : actions ) { - String widgetId = newAction.getName(); - if (widgets.containsKey(widgetId)) { - ProgramWidget widget = (ProgramWidget) widgets.get(widgetId); - String wdgOozJob = widget.getModel().getCurOozJobId() ; - if( !wdgOozJob.equals( newAction.getJobId() ) ){ - logger.info( widget.getId() + ":"+ wdgOozJob + " NOT EQUALs " + newAction.getJobId() ); - continue; - } - - if( newAction != null ){ - logger.info( widget.getId() + ":"+ wdgOozJob + " EQUALs " + newAction.getJobId() ); - logger.info( newAction.getStatus() ); - if ( ProgramUtil.isOkState( newAction )) { - if(ProgramUtil.isOkState( widget.getAction() ) ) continue; - widget.setStyleName("actionOK"); - widget.setAction(newAction); - widget.addMenuItem(BaseWidgetMenuItemFactory - .createStdoutItem(widget)); - widget.addMenuItem(BaseWidgetMenuItemFactory - .createStderrItem(widget)); - } else if (ProgramUtil.isErrorState(newAction)) { - if(ProgramUtil.isErrorState( widget.getAction() ) ) continue; - widget.setAction(newAction); - widget.setStyleName("actionERROR"); - //add menu item - widget.addMenuItem(BaseWidgetMenuItemFactory - .createStdoutItem(widget)); - widget.addMenuItem(BaseWidgetMenuItemFactory - .createStderrItem(widget)); - } else if( !ProgramUtil.isNewState(newAction)){ - widget.setAction(newAction); - widget.setStyleName("actionRunning"); - } - } - } - } - } - - /** - * resume oozie job - * - * @param JobId target job id - */ - public void resumeJob(String JobId) { - //JobMasterAsyc.resumeJob(JobId, new AsyncCallback() { - jobSrv.resumeJob(JobId, new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - logger.warning("job resume failed!"); - } - - @Override - public void onSuccess(Void result) { - logger.warning("resume succeeded!"); - } - }); - } - - /** - * suspend oozie job - * - * @param JobId target job id - */ - public void suspendJob(String JobId) { - //JobMasterAsyc.suspendJob(JobId, new AsyncCallback() { - jobSrv.suspendJob(JobId, new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - logger.warning("job suspend failed!"); - } - - @Override - public void onSuccess(Void result) { - logger.warning("Suspend succeeded!"); - } - }); - } - - /** kill a oozie job */ - public void killJob(String JobId) { - jobSrv.killJob(JobId, new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - logger.warning("job kill failed!"); - } - - @Override - public void onSuccess(Void result) { - logger.info("Kill succeeded!"); - } - }); - } - - /** start a oozie job */ - public void startJob(String JobId) { - - jobSrv.startJob(JobId, new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - logger.warning("job start failed!"); - } - - @Override - public void onSuccess(Void result) { - logger.info("start succeeded!"); - } - }); - } - - /** ReRun oozie job */ - public void rerunJob(final String JobId) { - - jobSrv.reRun(JobId, new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - logger.warning("job rerun failed!"); - } - - @Override - public void onSuccess(Void result) { - logger.info("Rerun succeeded!"); - // updateJob(JobId); - } - }); - } - - - /** Get the stdout of a program widget */ - public void getStdOut(String jobId, final String actionId) { - - jobSrv.getStdOut(jobId, actionId, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - logger.warning("Get StdOutErr Failed!"); - } - - @Override - public void onSuccess(String result) { - String title = "Standard output - " + actionId.split("@")[1]; - showMsg(result, title); - } - }); - } - /** Get the stderr of a program widget */ - public void getStdErr(String jobId, final String actionId) { - jobSrv.getStdErr(jobId, actionId, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - logger.warning("Get StdOutErr Failed!"); - } - - @Override - public void onSuccess(String result) { - String title = "Standard error - " + actionId.split("@")[1]; - showMsg(result, title); - } - }); - } - - private void showMsg(String msg, String title) { - new StdPanel(msg, title); - } - - @Override -public void onMouseUp(MouseUpEvent event) { - super.onMouseUp(event); - if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) { - NodeShape shape = (NodeShape) getShapeUnderMouse(); - if (shape instanceof OutNodeShape) { - OutNodeShape outShape = (OutNodeShape)shape; - String fileId = outShape.getFileId(); - String path = outShape.getAbsolutePath(); - Window.alert(path + ":" + fileId); - DBController.showPreviewPopup(path,fileId); - } - } - } - - - /** - * Validate the parameters in the program widgets - */ - public void parameterValidate() throws ValueInvalidException { - - for (Map.Entry entry : widgets.entrySet()) { - if (entry.getValue() instanceof ProgramWidget) { - ParameterPanel panel = ((ProgramWidget) entry.getValue()) - .getParameterPanel(); - if (panel != null) { - panel.validate(); - } - } - } - } - - - /** - * Create an XML that describes the Dataflow diagram and save it - */ - public OozieGraph generateGraphXML() { - OozieGraphBuilder graphBuilder = new OozieGraphBuilder(this); - return graphBuilder.asGraph(); - } - - - /** Place a widget to paint panel - * - *@param w widget need to be add - *@param left distance to the left boundary - *@param top distance to the top boundary - */ - @Override - public void addWidget(final BaseWidget w, int left, int top) { - super.addWidget(w, left, top); - w.clearMenu(); - w.addMenuItem(BaseWidgetMenuItemFactory.createDeleteItem(w)); - if(w instanceof ProgramWidget){ - if(((ProgramWidget) w).getProgram().isETL()) - w.addMenuItem(BaseWidgetMenuItemFactory.createPremeterItem(w)); - } - - } - - - + private static Logger logger = + Logger.getLogger(MonitorController.class.getName()); + + private static JobServiceAsync jobSrv = GWT.create(JobService.class); + + public MonitorController(int canvasWidth, int canvasHeight) { + super(canvasWidth, canvasHeight); + } + + /** + * Synchronize current oozie job with server + * @param curOozJobId target job id + */ + public void updateWgtCurOozJobId(String curOozJobId){ + for( Map.Entry entry: widgets.entrySet()){ + BaseWidget bw = entry.getValue(); + if( bw instanceof DatasetWidget) continue; + ProgramWidget proWgt = (ProgramWidget)bw; + if( ProgramWidget.Model.LATEST_OOZIE_JOBID.equals( + proWgt.getModel().getCurOozJobId() )){ + proWgt.getModel().setCurOozJobId( curOozJobId); + } + } + } + + /** + * Change the program node need to be executed status to new + * @param actionNames acitons need to be executed + */ + public void reflushWidgetStatus(List actionNames){ + for( String widgetId : actionNames){ + if( widgets.containsKey( widgetId )){ + ProgramWidget pw = (ProgramWidget) widgets.get(widgetId); + //give pw a NEW_STATUS OozieAction + pw.flushOozieAction(); + pw.clearMenu(); + + pw.addMenuItem( BaseWidgetMenuItemFactory.createDeleteItem(pw)); + } + } + } + + /** + * Lock widgets' parameter panels + * @param actionNames target action widgets need to be locked + */ + public void lockWidgetParameterPanel(List actionNames){ + for( String widgetId : actionNames){ + if( widgets.containsKey( widgetId )){ + ProgramWidget pw = (ProgramWidget) widgets.get(widgetId); + pw.getParameterPanel().lock(); + } + } + } + + /** + * Unlock widgets' parameter panels + * @param actionNames target action widgets need to be unlocked + */ + public void unlockWidgetParameterPanel(List actionNames){ + for( String widgetId : actionNames){ + if( widgets.containsKey( widgetId )){ + ProgramWidget pw = (ProgramWidget) widgets.get(widgetId); + pw.getParameterPanel().unlock(); + } + } + } + + /** + * Update widget status + * + * @param actions oozie action list + */ + public void updateWidgetStatus(List actions) { + logger.info( "Actions number: " + actions.size() ); + for (OozieAction newAction : actions ) { + String widgetId = newAction.getName(); + logger.info( "Action name: " + widgetId ); + if(setWidgetStatus(widgetId,widgets,newAction)) continue; + } + } + + /** + * set widget status + */ + public Boolean setWidgetStatus(String widgetId, Map widgets,OozieAction newAction){ + if (widgets.containsKey(widgetId)) { + ProgramWidget widget = (ProgramWidget) widgets.get(widgetId); + String wdgOozJob = widget.getModel().getCurOozJobId() ; + + + if( !wdgOozJob.equals( newAction.getJobId() ) ){ + logger.info( widget.getId() + ":"+ wdgOozJob + " NOT EQUALs " + newAction.getJobId() ); + return true; + } + + if( newAction != null ){ + logger.info( widget.getId() + ":"+ wdgOozJob + " EQUALs " + newAction.getJobId() ); + logger.info( newAction.getStatus() ); + if ( ProgramUtil.isOkState( newAction )) { + if(ProgramUtil.isOkState( widget.getAction() ) ) return true; + widget.setStyleName("actionOK"); + widget.setAction(newAction); + widget.addMenuItem(BaseWidgetMenuItemFactory + .createStdoutItem(widget)); + widget.addMenuItem(BaseWidgetMenuItemFactory + .createStderrItem(widget)); + } else if (ProgramUtil.isErrorState(newAction)) { + if(ProgramUtil.isErrorState( widget.getAction() ) ) return true; + widget.setAction(newAction); + widget.setStyleName("actionERROR"); + //add menu item + widget.addMenuItem(BaseWidgetMenuItemFactory + .createStdoutItem(widget)); + widget.addMenuItem(BaseWidgetMenuItemFactory + .createStderrItem(widget)); + } else if( !ProgramUtil.isNewState(newAction)){ + widget.setAction(newAction); + widget.setStyleName("actionRunning"); + } + } + } + return false; + } + + /** + * resume oozie job + * + * @param JobId target job id + */ + public void resumeJob(String JobId) { + //JobMasterAsyc.resumeJob(JobId, new AsyncCallback() { + jobSrv.resumeJob(JobId, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning("job resume failed!"); + } + + @Override + public void onSuccess(Void result) { + logger.warning("resume succeeded!"); + } + }); + } + + /** + * suspend oozie job + * + * @param JobId target job id + */ + public void suspendJob(String JobId) { + jobSrv.suspendJob(JobId, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning("job suspend failed!"); + } + + @Override + public void onSuccess(Void result) { + logger.warning("Suspend succeeded!"); + } + }); + } + + /** kill a oozie job */ + public void killJob(String JobId) { + jobSrv.killJob(JobId, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning("job kill failed!"); + } + + @Override + public void onSuccess(Void result) { + logger.info("Kill succeeded!"); + } + }); + } + + /** start a oozie job */ + public void startJob(String JobId) { + + jobSrv.startJob(JobId, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning("job start failed!"); + } + + @Override + public void onSuccess(Void result) { + logger.info("start succeeded!"); + } + }); + } + + /** ReRun oozie job */ + public void rerunJob(final String JobId) { + + jobSrv.reRun(JobId, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning("job rerun failed!"); + } + + @Override + public void onSuccess(Void result) { + logger.info("Rerun succeeded!"); + // updateJob(JobId); + } + }); + } + + + /** Get the stdout of a program widget */ + public void getStdOut(String jobId, final String actionId) { + + jobSrv.getStdOut(jobId, actionId, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + logger.warning("Get StdOutErr Failed!"); + } + + @Override + public void onSuccess(String result) { + String title = "Standard output - " + actionId.split("@")[1]; + showMsg(result, title); + } + }); + } + /** Get the stderr of a program widget */ + public void getStdErr(String jobId, final String actionId) { + jobSrv.getStdErr(jobId, actionId, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + logger.warning("Get StdOutErr Failed!"); + } + + @Override + public void onSuccess(String result) { + String title = "Standard error - " + actionId.split("@")[1]; + showMsg(result, title); + } + }); + } + + private void showMsg(String msg, String title) { + new StdPanel(msg, title); + } + + @Override + public void onMouseUp(MouseUpEvent event) { + super.onMouseUp(event); + if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) { + NodeShape shape = (NodeShape) getShapeUnderMouse(); + if (shape instanceof OutNodeShape) { + OutNodeShape outShape = (OutNodeShape)shape; + int x = outShape.getOffsetLeft() + 2*outShape.getRadius(); + int y = outShape.getOffsetTop() + 2*outShape.getRadius(); + outShape.getContextMenu().setPopupPosition(x,y); + outShape.getContextMenu().show(); + } + } + } + + + /** + * Validate the parameters in the program widgets + */ + public void parameterValidate() throws ValueInvalidException { + + for (Map.Entry entry : widgets.entrySet()) { + if (entry.getValue() instanceof ProgramWidget) { + ParameterPanel panel = ((ProgramWidget) entry.getValue()) + .getParameterPanel(); + if (panel != null) { + panel.validate(); + } + } + } + } + + + /** + * Create an XML that describes the Dataflow diagram and save it + */ + public OozieGraph generateGraphXML() { + OozieGraphBuilder graphBuilder = new OozieGraphBuilder(this); + return graphBuilder.asGraph(); + } + + + /** Place a widget to paint panel + * + *@param w widget need to be add + *@param left distance to the left boundary + *@param top distance to the top boundary + */ + @Override + public void addWidget(final BaseWidget w, int left, int top) { + super.addWidget(w, left, top); + w.clearMenu(); + w.addMenuItem(BaseWidgetMenuItemFactory.createDeleteItem(w)); + if(w instanceof ProgramWidget){ + if(((ProgramWidget) w).getProgram().isETL()) + w.addMenuItem(BaseWidgetMenuItemFactory.createPremeterItem(w)); + } + + } + + + } diff --git a/src/main/java/eml/studio/client/event/CloneEvent.java b/src/main/java/eml/studio/client/event/CloneEvent.java index b5eaf24..3d94621 100644 --- a/src/main/java/eml/studio/client/event/CloneEvent.java +++ b/src/main/java/eml/studio/client/event/CloneEvent.java @@ -11,32 +11,31 @@ /** * The event that will be triggered when clone */ -public class CloneEvent extends - GwtEvent { - public final static Type TYPE = new Type(); +public class CloneEvent extends GwtEvent { + public final static Type TYPE = new Type(); - private String message; + private String message; - public CloneEvent(String msg) { - message = msg; - } + public CloneEvent(String msg) { + message = msg; + } - public interface CloneEventHandler extends EventHandler { - void onCloneEvent(CloneEvent event); - } + public interface CloneEventHandler extends EventHandler { + void onCloneEvent(CloneEvent event); + } - @Override - public Type getAssociatedType() { - return TYPE; - } + @Override + public Type getAssociatedType() { + return TYPE; + } - @Override - protected void dispatch(CloneEventHandler handler) { - handler.onCloneEvent(this); - } + @Override + protected void dispatch(CloneEventHandler handler) { + handler.onCloneEvent(this); + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } } diff --git a/src/main/java/eml/studio/client/event/HasConnectionEvent.java b/src/main/java/eml/studio/client/event/HasConnectionEvent.java index 24a8fbc..6de52f9 100644 --- a/src/main/java/eml/studio/client/event/HasConnectionEvent.java +++ b/src/main/java/eml/studio/client/event/HasConnectionEvent.java @@ -8,9 +8,9 @@ import eml.studio.client.ui.connection.Connection; public interface HasConnectionEvent { - void onConnectionCancel(); + void onConnectionCancel(); - void onConnectionStart(); + void onConnectionStart(); - void onConnectionEnd(Connection conn); + void onConnectionEnd(Connection conn); } diff --git a/src/main/java/eml/studio/client/event/LoginEvent.java b/src/main/java/eml/studio/client/event/LoginEvent.java index 3fdbe90..e6360d9 100644 --- a/src/main/java/eml/studio/client/event/LoginEvent.java +++ b/src/main/java/eml/studio/client/event/LoginEvent.java @@ -12,31 +12,31 @@ * The event that will be triggered when login */ public class LoginEvent extends GwtEvent{ - - public interface LoginEventHandler extends EventHandler{ - void onLoginEvent(LoginEvent event); - } - - public final static Type TYPE = new Type(); - - private String message; - - public LoginEvent(String msg){ - this.message = msg; - } - - @Override - public Type getAssociatedType() { - return TYPE; - } - - @Override - protected void dispatch(LoginEventHandler handler) { - handler.onLoginEvent(this); - } - - public String getMessage(){ - return message; - } + + public interface LoginEventHandler extends EventHandler{ + void onLoginEvent(LoginEvent event); + } + + public final static Type TYPE = new Type(); + + private String message; + + public LoginEvent(String msg){ + this.message = msg; + } + + @Override + public Type getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(LoginEventHandler handler) { + handler.onLoginEvent(this); + } + + public String getMessage(){ + return message; + } } diff --git a/src/main/java/eml/studio/client/event/LogoutEvent.java b/src/main/java/eml/studio/client/event/LogoutEvent.java index eeaf85b..3e3e148 100644 --- a/src/main/java/eml/studio/client/event/LogoutEvent.java +++ b/src/main/java/eml/studio/client/event/LogoutEvent.java @@ -12,22 +12,22 @@ * The event that will be triggered when logout */ public class LogoutEvent extends GwtEvent{ - - public interface LogoutEventHandler extends EventHandler{ - void onLogoutEvent(LogoutEvent event); - } - - public final static Type TYPE = new Type(); - - @Override - public Type getAssociatedType() { - return TYPE; - } - - @Override - protected void dispatch(LogoutEventHandler handler) { - handler.onLogoutEvent(this); - } - + + public interface LogoutEventHandler extends EventHandler{ + void onLogoutEvent(LogoutEvent event); + } + + public final static Type TYPE = new Type(); + + @Override + public Type getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(LogoutEventHandler handler) { + handler.onLogoutEvent(this); + } + } diff --git a/src/main/java/eml/studio/client/event/ToAccountEvent.java b/src/main/java/eml/studio/client/event/ToAccountEvent.java index 78aaabb..a37d602 100644 --- a/src/main/java/eml/studio/client/event/ToAccountEvent.java +++ b/src/main/java/eml/studio/client/event/ToAccountEvent.java @@ -11,32 +11,31 @@ /** * The event that will be triggered when navigating to account page */ -public class ToAccountEvent extends - GwtEvent { - public final static Type TYPE = new Type(); +public class ToAccountEvent extends GwtEvent { + public final static Type TYPE = new Type(); - private String message; + private String message; - public ToAccountEvent(String msg) { - message = msg; - } + public ToAccountEvent(String msg) { + message = msg; + } - public interface ToAccountEventHandler extends EventHandler { - void onToAccountEvent(ToAccountEvent event); - } + public interface ToAccountEventHandler extends EventHandler { + void onToAccountEvent(ToAccountEvent event); + } - @Override - public Type getAssociatedType() { - return TYPE; - } + @Override + public Type getAssociatedType() { + return TYPE; + } - @Override - protected void dispatch(ToAccountEventHandler handler) { - handler.onToAccountEvent(this); - } + @Override + protected void dispatch(ToAccountEventHandler handler) { + handler.onToAccountEvent(this); + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } } diff --git a/src/main/java/eml/studio/client/event/ToMonitorEvent.java b/src/main/java/eml/studio/client/event/ToMonitorEvent.java index 1d9e433..6873478 100644 --- a/src/main/java/eml/studio/client/event/ToMonitorEvent.java +++ b/src/main/java/eml/studio/client/event/ToMonitorEvent.java @@ -11,32 +11,31 @@ /** * The event that will be triggered when navigating to monitor page */ -public class ToMonitorEvent extends - GwtEvent { - public final static Type TYPE = new Type(); +public class ToMonitorEvent extends GwtEvent { + public final static Type TYPE = new Type(); - private String message; + private String message; - public ToMonitorEvent(String msg) { - message = msg; - } + public ToMonitorEvent(String msg) { + message = msg; + } - public interface ToMonitorEventHandler extends EventHandler { - void onToMonitorEvent(ToMonitorEvent event); - } + public interface ToMonitorEventHandler extends EventHandler { + void onToMonitorEvent(ToMonitorEvent event); + } - @Override - public Type getAssociatedType() { - return TYPE; - } + @Override + public Type getAssociatedType() { + return TYPE; + } - @Override - protected void dispatch(ToMonitorEventHandler handler) { - handler.onToMonitorEvent(this); - } + @Override + protected void dispatch(ToMonitorEventHandler handler) { + handler.onToMonitorEvent(this); + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } } diff --git a/src/main/java/eml/studio/client/event/ToRegisterEvent.java b/src/main/java/eml/studio/client/event/ToRegisterEvent.java index 0adffd6..747f9e5 100644 --- a/src/main/java/eml/studio/client/event/ToRegisterEvent.java +++ b/src/main/java/eml/studio/client/event/ToRegisterEvent.java @@ -10,35 +10,33 @@ /** * The event that will be triggered when navigating to register page - * @author Roger * */ -public class ToRegisterEvent extends - GwtEvent { - public final static Type TYPE = new Type(); +public class ToRegisterEvent extends GwtEvent { + public final static Type TYPE = new Type(); - private String message; + private String message; - public ToRegisterEvent(String msg) { - message = msg; - } + public ToRegisterEvent(String msg) { + message = msg; + } - public interface ToRegisterEventHandler extends EventHandler { - void onToRegisterEvent(ToRegisterEvent event); - } + public interface ToRegisterEventHandler extends EventHandler { + void onToRegisterEvent(ToRegisterEvent event); + } - @Override - public Type getAssociatedType() { - return TYPE; - } + @Override + public Type getAssociatedType() { + return TYPE; + } - @Override - protected void dispatch(ToRegisterEventHandler handler) { - handler.onToRegisterEvent(this); - } + @Override + protected void dispatch(ToRegisterEventHandler handler) { + handler.onToRegisterEvent(this); + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } } diff --git a/src/main/java/eml/studio/client/graph/DiagramBuilder.java b/src/main/java/eml/studio/client/graph/DiagramBuilder.java index acd2dc4..049e597 100644 --- a/src/main/java/eml/studio/client/graph/DiagramBuilder.java +++ b/src/main/java/eml/studio/client/graph/DiagramBuilder.java @@ -20,6 +20,8 @@ import eml.studio.client.ui.widget.panel.ParameterPanel; import eml.studio.client.ui.widget.program.CommonProgramWidget; import eml.studio.client.ui.widget.program.ProgramWidget; +import eml.studio.client.ui.widget.program.ScriptProgramWidget; +import eml.studio.client.ui.widget.program.SqlProgramWidget; import eml.studio.client.util.UUID; import eml.studio.shared.graph.OozieDatasetNode; import eml.studio.shared.graph.OozieEdge; @@ -41,283 +43,346 @@ */ public class DiagramBuilder { - private Logger logger = Logger.getLogger( DiagramBuilder.class.getName() ); - - protected static ProgramServiceAsync programSrv = - GWT.create(ProgramService.class); - - protected static DatasetServiceAsync datasetSrv = - GWT.create(DatasetService.class); - private boolean isloading = false; - private MonitorPresenter presenter = null; - private MonitorController controller = null; - private MonitorPresenter.View view = null; - public DiagramBuilder(MonitorPresenter presenter){ - this.presenter = presenter; - this.view = presenter.getView(); - this.controller = this.presenter.getView().getController(); - - } - - public void bind(){ - presenter.getView().getProgramTree().addSelectionHandler(new SelectionHandler() { - - @Override - public void onSelection(SelectionEvent event) { - - TreeItem item = event.getSelectedItem(); - if (item instanceof ProgramLeaf) { - Program program = ((ProgramLeaf) item).getModule(); - String uid = program.getName().replaceAll("[\\s,?]+", "") + - "-" + UUID.randomID(); - - ProgramWidget pw = null; - if( !program.getProgramable() ){ - pw = new CommonProgramWidget(program, uid); - } - //give pw a NEW_STATUS OozieAction - pw.flushOozieAction(); - pw.genParamPanel(true); - - placeProgramWidget(pw); - } - } - }); - - presenter.getView().getDatasetTree().addSelectionHandler(new SelectionHandler() { - - @Override - public void onSelection(SelectionEvent event) { - TreeItem item = event.getSelectedItem(); - if (item instanceof DatasetLeaf) { - Dataset dataset = ((DatasetLeaf) item).getModule(); - String uid = dataset.getName().replaceAll("[\\s,?]+", "") + - "-" + UUID.randomID(); - final DatasetWidget dw = new DatasetWidget(dataset, uid); - placeDatasetWidget(dw); - } - } - }); - - presenter.getView().getResultTree().addSelectionHandler(new SelectionHandler() { - - @Override - public void onSelection(SelectionEvent event) { - - TreeItem item = event.getSelectedItem(); - if (item instanceof ProgramLeaf) { - Program program = ((ProgramLeaf) item).getModule(); - String uid = program.getName().replaceAll("[\\s,?]+", "") + - "-" + UUID.randomID(); - - ProgramWidget pw = null; - if( !program.getProgramable() ){ - pw = new CommonProgramWidget(program, uid); - } - - //give pw a NEW_STATUS OozieAction - pw.flushOozieAction(); - pw.genParamPanel(true); - - placeProgramWidget(pw); - } - - if (item instanceof DatasetLeaf) { - Dataset dataset = ((DatasetLeaf) item).getModule(); - String uid = dataset.getName().replaceAll("[\\s,?]+", "") + - "-" + UUID.randomID(); - final DatasetWidget dw = new DatasetWidget(dataset, uid); - placeDatasetWidget(dw); - } - } - }); - } - - - /** place a dataset widget to paint panel */ - private void placeDatasetWidget(DatasetWidget w) { - view.getNowDiagramColler().addWidget(w); - view.setPropTable(w.getPropertyTable()); - } - - /** place a program widget to paint panel */ - public void placeProgramWidget(ProgramWidget w) { - view.getProgramTree().setPopupWidget(w); - if(w instanceof CommonProgramWidget){ - if (((CommonProgramWidget) w).getProgramConf().getParameterCount() > 0) { - ParameterPanel panel = w.getParameterPanel(); - view.getParamPopup().setParameterPanel(panel); - view.getParamPopup().center(); - } - } - - view.setPropTable(w.getPropertyTable()); - view.getNowDiagramColler().addWidget(w); - } - - /** - * Redraw Data flow chart and draft - */ - public void rebuildDAG(final OozieGraph graph, final boolean editable) { - // If you are performing a DAG redraw task, do not repeat it - if (isloading) - return; - - //Before you start building the map, - //the submit button is locked so that it can not be submitted - //Until you confirm that the current task has been completed, or begin a new task - //And then use unlockSubmit to unlock - presenter.lockSubmit(); - isloading = true; - controller.clear(); - - // the expected widget number after loading the DAG - final int target_widget_size = controller.getWidgetNum() + - graph.getNodeNum(); - // draw dataset nodes - for (OozieDatasetNode node : graph.getDatasetNodes()) - setupDatasetWidget(node,controller); - - // draw program nodes - for (OozieProgramNode node : graph.getProgramNodes()){ - logger.info("(BEGIN) setup widget " + node.getId() ); - setupProgramWidget(node, editable,controller); - logger.info("(END) setup widget " + node.getId() ); - } - // draw edges - Timer timer = new Timer() { - - @Override - public void run() { - if (controller.getWidgetNum() >= target_widget_size) { - for (OozieEdge e : graph.getEdges()) - setupEdge(e); - - this.cancel(); - isloading = false; - - if( !editable ) - presenter.afterDAGBuild(); - else{ - presenter.unlockSubmit(); - } - } - } - }; - - timer.scheduleRepeating(2); - } - - - /** - * load a program widget according to a node from graph-describe.xml - */ - private void setupProgramWidget(final OozieProgramNode node, - final boolean editable, final DiagramController dcontroller) { - programSrv.load(node.getModuleId(), new AsyncCallback() { - - @Override - public void onFailure(Throwable e) { - Window.alert(e.getMessage()); - } - - @Override - public void onSuccess(Program program) { - // create widget according to moduleId - - ProgramWidget widget = null; - - logger.info("(TRY)Create widget: " + node.getId()); - - widget = createCommonWidget(program, node, editable); - logger.info("(SUCCEED)Create widget: " + node.getId()); - - - if( !editable ){ - if( ProgramWidget.Model.LATEST_OOZIE_JOBID.equals( node.getOozJobId() )){ - // set latest oozie job id - widget.getModel().setCurOozJobId( - presenter.getCurrentJob().getCurOozJobId() ); - }else{ - widget.getModel().setCurOozJobId( node.getOozJobId() ); - } - logger.info( widget.getModel().getCurOozJobId() ); - }else{ - widget.getModel().setCurOozJobId( ProgramWidget.Model.LATEST_OOZIE_JOBID); - } - - // set the input/output files - logger.info("initialize output files"); - int i = 0; - for (String file : node.getFiles()) { - widget.getOutNodeShapes().get(i++).setFileId(file); - } - - dcontroller.addWidget(widget, node.getX(), node.getY()); - } - }); - } - - /** - * Create CommonWidget via program and oozie program node - * @param program - * @param node - * @param editable - * @return CommonProgramWidget - */ - private CommonProgramWidget createCommonWidget(Program program, OozieProgramNode node, boolean editable){ - - CommonProgramWidget widget = new CommonProgramWidget(program, node.getId()); - // set the parameters of program - for (String kv: node.getParams()) { - int split_idx = kv.indexOf(":"); - int param_id = Integer.parseInt(kv.substring(0, split_idx)); - String value = kv.substring(split_idx + 1); - // logger.info( "parameter: (" + param_id + ", " + value +")"); - widget.getProgramConf().setParameter(param_id, value); - } - widget.genParamPanel(editable); - logger.info("create CommonProgramWidget: " + widget.getId()); - return widget; - } - - - /** load a dataset widget according to a node from graph-describe.xml */ - private void setupDatasetWidget(final OozieDatasetNode node,final DiagramController dcontroller) { - datasetSrv.load(node.getModuleId(), new AsyncCallback() { - - @Override - public void onFailure(Throwable e) { - Window.alert(e.getMessage()); - } - - @Override - public void onSuccess(Dataset dataset) { - logger.info("setup dataset:" + dataset.getName()); - // create widget according to moduleId - DatasetWidget widget = new DatasetWidget(dataset, node.getId()); - widget.getOutNodeShapes().get(0).setFileId(node.getFile()); - dcontroller.addWidget(widget, node.getX(), node.getY()); - logger.info("setup dataset success"); - } - }); - } - - /** - * Draw an edge based on xml description - */ - private void setupEdge(final OozieEdge e) { - String[] arr = e.getSrc().split(":"); - String src_id = arr[0]; - int src_port = Integer.parseInt(arr[1]); - - String[] items = e.getDst().split(":"); - String dst_id = items[0]; - int dst_port = Integer.parseInt(items[1]); - logger.info("src=" + src_id + ":" + src_port + - ", dst=" + dst_id + ":" + dst_port); - controller.addConnection(src_id, src_port, dst_id, dst_port); - } + private Logger logger = Logger.getLogger( DiagramBuilder.class.getName() ); + + protected static ProgramServiceAsync programSrv = + GWT.create(ProgramService.class); + + protected static DatasetServiceAsync datasetSrv = + GWT.create(DatasetService.class); + private boolean isloading = false; + private MonitorPresenter presenter = null; + private MonitorController controller = null; + private MonitorPresenter.View view = null; + public DiagramBuilder(MonitorPresenter presenter){ + this.presenter = presenter; + this.view = presenter.getView(); + this.controller = this.presenter.getView().getController(); + + } + + public void bind(){ + presenter.getView().getProgramTree().addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + + TreeItem item = event.getSelectedItem(); + if (item instanceof ProgramLeaf) { + Program program = ((ProgramLeaf) item).getModule(); + String uid = program.getName().replaceAll("[\\s,?]+", "") + + "-" + UUID.randomID(); + + ProgramWidget pw = null; + if( !program.getProgramable() ){ + pw = new CommonProgramWidget(program, uid); + }else if( !program.isDistributed() ) + pw = new ScriptProgramWidget(program,uid); + else + pw = new SqlProgramWidget(program,uid); + //give pw a NEW_STATUS OozieAction + pw.flushOozieAction(); + pw.genParamPanel(true); + + placeProgramWidget(pw); + } + } + }); + + presenter.getView().getDatasetTree().addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + TreeItem item = event.getSelectedItem(); + if (item instanceof DatasetLeaf) { + Dataset dataset = ((DatasetLeaf) item).getModule(); + String uid = dataset.getName().replaceAll("[\\s,?]+", "") + + "-" + UUID.randomID(); + final DatasetWidget dw = new DatasetWidget(dataset, uid); + placeDatasetWidget(dw); + } + } + }); + + presenter.getView().getResultTree().addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + + TreeItem item = event.getSelectedItem(); + if (item instanceof ProgramLeaf) { + Program program = ((ProgramLeaf) item).getModule(); + String uid = program.getName().replaceAll("[\\s,?]+", "") + + "-" + UUID.randomID(); + + ProgramWidget pw = null; + if( !program.getProgramable() ){ + pw = new CommonProgramWidget(program, uid); + }else if( !program.isDistributed() ) + pw = new ScriptProgramWidget(program,uid); + else + pw = new SqlProgramWidget(program,uid); + + //give pw a NEW_STATUS OozieAction + pw.flushOozieAction(); + pw.genParamPanel(true); + + placeProgramWidget(pw); + } + + if (item instanceof DatasetLeaf) { + Dataset dataset = ((DatasetLeaf) item).getModule(); + String uid = dataset.getName().replaceAll("[\\s,?]+", "") + + "-" + UUID.randomID(); + final DatasetWidget dw = new DatasetWidget(dataset, uid); + placeDatasetWidget(dw); + } + } + }); + } + + + /** place a dataset widget to paint panel */ + private void placeDatasetWidget(DatasetWidget w) { + view.getNowDiagramColler().addWidget(w); + view.setPropTable(w.getPropertyTable()); + } + + /** place a program widget to paint panel */ + public void placeProgramWidget(ProgramWidget w) { + view.getProgramTree().setPopupWidget(w); + if(w instanceof CommonProgramWidget){ + if (((CommonProgramWidget) w).getProgramConf().getParameterCount() > 0) { + ParameterPanel panel = w.getParameterPanel(); + view.getParamPopup().setParameterPanel(panel); + view.getParamPopup().center(); + } + } + + view.setPropTable(w.getPropertyTable()); + view.getNowDiagramColler().addWidget(w); + } + + /** + * Redraw Data flow chart and draft + */ + public void rebuildDAG(final OozieGraph graph, final boolean editable) { + // If you are performing a DAG redraw task, do not repeat it + if (isloading) + return; + + //Before you start building the map, + //the submit button is locked so that it can not be submitted + //Until you confirm that the current task has been completed, or begin a new task + //And then use unlockSubmit to unlock + presenter.lockSubmit(); + isloading = true; + controller.clear(); + + // the expected widget number after loading the DAG + final int target_widget_size = controller.getWidgetNum() + + graph.getNodeNum(); + // draw dataset nodes + for (OozieDatasetNode node : graph.getDatasetNodes()) + setupDatasetWidget(node,controller); + + // draw program nodes + for (OozieProgramNode node : graph.getProgramNodes()){ + logger.info("(BEGIN) setup widget " + node.getId() ); + setupProgramWidget(node, editable,controller); + logger.info("(END) setup widget " + node.getId() ); + } + // draw edges + Timer timer = new Timer() { + + @Override + public void run() { + if (controller.getWidgetNum() >= target_widget_size) { + for (OozieEdge e : graph.getEdges()) + setupEdge(e); + + this.cancel(); + isloading = false; + + if( !editable ) + presenter.afterDAGBuild(); + else{ + presenter.unlockSubmit(); + } + } + } + }; + + timer.scheduleRepeating(2); + } + + + /** + * load a program widget according to a node from graph-describe.xml + */ + private void setupProgramWidget(final OozieProgramNode node, + final boolean editable, final DiagramController dcontroller) { + programSrv.load(node.getModuleId(), new AsyncCallback() { + + @Override + public void onFailure(Throwable e) { + Window.alert(e.getMessage()); + } + + @Override + public void onSuccess(Program program) { + // create widget according to moduleId + + ProgramWidget widget = null; + + logger.info("(TRY)Create widget: " + node.getId()); + + if( program.getProgramable() ){ + if(! program.isDistributed() ) + widget = createScriptWidget(program, node, editable); + else{ + widget = createSqlScriptWidget(program,node, editable); + } + } + else widget = createCommonWidget(program, node, editable); + logger.info("(SUCCEED)Create widget: " + node.getId()); + + if( !editable ){ + if( ProgramWidget.Model.LATEST_OOZIE_JOBID.equals( node.getOozJobId() )){ + // set latest oozie job id + widget.getModel().setCurOozJobId( + presenter.getCurrentJob().getCurOozJobId() ); + }else{ + widget.getModel().setCurOozJobId( node.getOozJobId() ); + } + logger.info( widget.getModel().getCurOozJobId() ); + }else{ + widget.getModel().setCurOozJobId( ProgramWidget.Model.LATEST_OOZIE_JOBID); + } + + // set the input/output files + logger.info("initialize output files"); + int i = 0; + for (String file : node.getFiles()) { + widget.getOutNodeShapes().get(i++).setFileId(file); + } + + dcontroller.addWidget(widget, node.getX(), node.getY()); + } + }); + } + + /** + * Create SQL script widget via program and oozie program node + * @param program + * @param node + * @param editable + * @return + */ + private SqlProgramWidget createSqlScriptWidget(Program program, OozieProgramNode node, boolean editable){ + + SqlProgramWidget widget = new SqlProgramWidget(program, node.getId() ); + + if( node.getScript() != null ){ + + widget.getProgramConf().setScriptContent( node.getScript() ); + } + + widget.genParamPanel(editable); + + logger.info( "append input file to widget"); + for( int i = 0; i < node.getInputFileCount(); ++ i ){ + widget.addInput( node.getInputAliases().get(i)); + } + logger.info( "append output file to widget"); + for( int i = 0; i < node.getOutputFileCount(); ++ i ){ + widget.addOutput( node.getOutputAliases().get(i)); + } + logger.info("active the widget"); + widget.active(); + return widget; + } + + /** + * Create script widget via program and oozie program node + * @param program + * @param node + * @param editable + * @return + */ + private ScriptProgramWidget createScriptWidget(Program program, OozieProgramNode node, boolean editable){ + ScriptProgramWidget widget = new ScriptProgramWidget(program, node.getId() ); + + if( node.getScript() != null ){ + logger.info("initialize script"); + widget.active(node.getInputFileCount(), node.getOutputFileCount()); + widget.getProgramConf().setScriptContent( node.getScript() ); + } + widget.genParamPanel(editable); + return widget; + } + + + /** + * Create CommonWidget via program and oozie program node + * @param program + * @param node + * @param editable + * @return CommonProgramWidget + */ + private CommonProgramWidget createCommonWidget(Program program, OozieProgramNode node, boolean editable){ + + CommonProgramWidget widget = new CommonProgramWidget(program, node.getId()); + // set the parameters of program + for (String kv: node.getParams()) { + int split_idx = kv.indexOf(":"); + int param_id = Integer.parseInt(kv.substring(0, split_idx)); + String value = kv.substring(split_idx + 1); + // logger.info( "parameter: (" + param_id + ", " + value +")"); + widget.getProgramConf().setParameter(param_id, value); + } + widget.genParamPanel(editable); + logger.info("create CommonProgramWidget: " + widget.getId()); + return widget; + } + + + /** load a dataset widget according to a node from graph-describe.xml */ + private void setupDatasetWidget(final OozieDatasetNode node,final DiagramController dcontroller) { + datasetSrv.load(node.getModuleId(), new AsyncCallback() { + + @Override + public void onFailure(Throwable e) { + Window.alert(e.getMessage()); + } + + @Override + public void onSuccess(Dataset dataset) { + logger.info("setup dataset:" + dataset.getName()); + // create widget according to moduleId + DatasetWidget widget = new DatasetWidget(dataset, node.getId()); + widget.getOutNodeShapes().get(0).setFileId(node.getFile()); + dcontroller.addWidget(widget, node.getX(), node.getY()); + logger.info("setup dataset success"); + } + }); + } + + /** + * Draw an edge based on xml description + */ + private void setupEdge(final OozieEdge e) { + String[] arr = e.getSrc().split(":"); + String src_id = arr[0]; + int src_port = Integer.parseInt(arr[1]); + + String[] items = e.getDst().split(":"); + String dst_id = items[0]; + int dst_port = Integer.parseInt(items[1]); + logger.info("src=" + src_id + ":" + src_port + + ", dst=" + dst_id + ":" + dst_port); + controller.addConnection(src_id, src_port, dst_id, dst_port); + } } diff --git a/src/main/java/eml/studio/client/graph/OozieGraphBuilder.java b/src/main/java/eml/studio/client/graph/OozieGraphBuilder.java index a0139da..aed4012 100644 --- a/src/main/java/eml/studio/client/graph/OozieGraphBuilder.java +++ b/src/main/java/eml/studio/client/graph/OozieGraphBuilder.java @@ -17,10 +17,14 @@ import eml.studio.client.controller.MonitorController; import eml.studio.client.ui.connection.Connection; import eml.studio.client.ui.widget.BaseWidget; +import eml.studio.client.ui.widget.command.FileDescription; import eml.studio.client.ui.widget.command.Parameter; +import eml.studio.client.ui.widget.command.ScriptFileDescription; import eml.studio.client.ui.widget.dataset.DatasetWidget; import eml.studio.client.ui.widget.program.CommonProgramWidget; import eml.studio.client.ui.widget.program.ProgramWidget; +import eml.studio.client.ui.widget.program.ScriptProgramWidget; +import eml.studio.client.ui.widget.program.SqlProgramWidget; import eml.studio.client.ui.widget.shape.InNodeShape; import eml.studio.client.ui.widget.shape.NodeShape; import eml.studio.client.ui.widget.shape.OutNodeShape; @@ -29,6 +33,7 @@ import eml.studio.shared.graph.OozieEdge; import eml.studio.shared.graph.OozieGraph; import eml.studio.shared.graph.OozieProgramNode; +import eml.studio.shared.script.Script; import eml.studio.shared.util.ProgramUtil; /** @@ -38,50 +43,54 @@ public class OozieGraphBuilder { private Logger logger = Logger.getLogger(OozieGraphBuilder.class.getName()); private OozieGraph graph = new OozieGraph(); - /** - * Add widget to oozie graph - * @param widget - * @param x X-axis coordinates - * @param y Y-axis coordinates - */ - + /** + * Add widget to oozie graph + * @param widget + * @param x X-axis coordinates + * @param y Y-axis coordinates + */ public void addWidget(BaseWidget widget, int x, int y) { - - + + if (widget instanceof DatasetWidget) { DatasetWidget dwidget = (DatasetWidget) widget; OozieDatasetNode node = new OozieDatasetNode(); this.graph.addDatasetNode( node ); node.init(widget.getId(), dwidget.getDataset().getId(), dwidget.getDataset().getPath(), x, y); - + return; } - + ProgramWidget progWidget = (ProgramWidget) widget; OozieProgramNode node = new OozieProgramNode(); node.init(widget.getId(),progWidget.getProgram().getId(), progWidget.getWorkPath(), x, y, - progWidget.getModel().getCurOozJobId(), widget - .getInNodeShapes().size(), - widget.getOutNodeShapes().size(), - ProgramUtil.isDistributed(progWidget.getProgram().getType()) || - ProgramUtil.isETL(progWidget.getProgram().getType())); + progWidget.getModel().getCurOozJobId(), widget + .getInNodeShapes().size(), + widget.getOutNodeShapes().size(), + ProgramUtil.isDistributed(progWidget.getProgram().getType()) || + ProgramUtil.isETL(progWidget.getProgram().getType())); this.graph.addProgramNode(node); - if (widget instanceof CommonProgramWidget) { + if (widget instanceof ScriptProgramWidget) { + wrapScriptNode(node, (ScriptProgramWidget) widget); + } else if (widget instanceof CommonProgramWidget) { CommonProgramWidget comWidget = (CommonProgramWidget) widget; wrapComNode(node, comWidget); + } else if (widget instanceof SqlProgramWidget) { + SqlProgramWidget sqlWidget = (SqlProgramWidget) widget; + wrapSqlNode(node, sqlWidget); } String cmdLine = progWidget.getProgramConf().getCommandLine(); node.setCmdLine(cmdLine); } - /** - * Wrap common program widget - * @param node - * @param comWidget - */ + /** + * Wrap common program widget + * @param node + * @param comWidget + */ private void wrapComNode(OozieProgramNode node, CommonProgramWidget comWidget){ List params = new LinkedList(); List files = new LinkedList(); @@ -91,57 +100,109 @@ private void wrapComNode(OozieProgramNode node, CommonProgramWidget comWidget){ .getParameters()) params.add(param.getIndex() + ":" + param.getParamValue()); node.initAsCommonNode(files, params); - + + } + + /** + * Wrap script program widget + * @param node + * @param scriptWidget + */ + private void wrapScriptNode(OozieProgramNode node, ScriptProgramWidget scriptWidget){ + + List files = new LinkedList(); + for (NodeShape shape : scriptWidget.getOutNodeShapes()) + files.add(((OutNodeShape) shape).getFileId()); + + node.initAsScriptNode(files, + scriptWidget.getProgramConf() + .getScriptContent()); + } + + /** + * Wrap sql script program widget + * @param node + * @param sqlWidget + */ + private void wrapSqlNode(OozieProgramNode node, SqlProgramWidget sqlWidget){ + List input_aliases = new LinkedList(); + List output_aliases = new LinkedList(); + List dy_input_aliases = new LinkedList(); + List dy_output_aliases = new LinkedList(); + List params = new LinkedList(); + List files = new LinkedList(); + List dy_files = new LinkedList(); + for (NodeShape shape : sqlWidget.getOutNodeShapes()) + files.add(((OutNodeShape) shape).getFileId()); + for (Parameter param : sqlWidget.getProgramConf() + .getParameters()) + params.add(param.getIndex() + ":" + param.getParamValue()); + for (FileDescription fd : sqlWidget.getProgramConf() + .getInFileDescriptions()) { + ScriptFileDescription sfd = (ScriptFileDescription) fd; + input_aliases.add(sfd.getOtherName()); + } + + for (FileDescription fd : sqlWidget.getProgramConf() + .getOutFileDescriptions()) { + ScriptFileDescription sfd = (ScriptFileDescription) fd; + output_aliases.add(sfd.getOtherName()); + } + + node.initAsSqlNode(files, dy_files, params, input_aliases, + output_aliases, dy_input_aliases, dy_output_aliases, + sqlWidget.getProgramConf().getScriptContent()); + } - /** - * Add edge to oozie graph - * @param conn - */ + /** + * Add edge to oozie graph + * @param conn + */ public void addEdge(Connection conn) { NodeShape start = (NodeShape) conn.getStartShape(); NodeShape end = (NodeShape) conn.getEndShape(); OozieEdge edge = new OozieEdge(); edge.init(start.getWidget().getId() + ":" + start.getPortId(), end.getWidget().getId() + ":" - + end.getPortId()); + + end.getPortId()); this.graph.addEdge(edge); } public OozieGraph asGraph(){ return graph; } - + public OozieGraphBuilder(MonitorController controller){ buildInitialization(controller); loadWidgets(controller); } - + /** * Generate the random file name of the intermediate file - * determine the active node + * determine the active node * @param controller */ private void buildInitialization(MonitorController controller){ Map widgets = controller.getWidgets(); logger.info("(Oozie Graph build Initialization ): Setting Widgets"); - Set activeNodes = new HashSet(); - - //Get the nodes that need to be re-executed - //(including non-successful nodes and their descendants) - for( Map.Entry entry: widgets.entrySet()) - { - BaseWidget wgt = entry.getValue(); - if( !( wgt instanceof ProgramWidget ) ) continue; - ProgramWidget pw = (ProgramWidget)wgt; - if( !ProgramUtil.isSuccess( pw.getAction() )) - { - activeNodes.add(pw.getId()); - pw.getModel().setInActionList(true); - getActiveNode(pw,activeNodes); - } - } - + Set activeNodes = new HashSet(); + + //Get the nodes that need to be re-executed + //(including non-successful nodes and their descendants) + for( Map.Entry entry: widgets.entrySet()) + { + BaseWidget wgt = entry.getValue(); + if( !( wgt instanceof ProgramWidget ) ) continue; + ProgramWidget pw = (ProgramWidget)wgt; + if( !ProgramUtil.isSuccess( pw.getAction() )) + { + activeNodes.add(pw.getId()); + pw.getModel().setInActionList(true); + getActiveNode(pw,activeNodes); + } + } + for( Map.Entry entry: widgets.entrySet()){ BaseWidget wgt = entry.getValue(); if( !( wgt instanceof ProgramWidget ) ) continue; @@ -151,10 +212,35 @@ private void buildInitialization(MonitorController controller){ pw.getModel().setInActionList(false); continue; } - + pw.getModel().setCurOozJobId( ProgramWidget.Model.LATEST_OOZIE_JOBID ); - pw.randFileName(); + pw.randFileName(); + + //If is programable node , the generated script file should be saved to HDFS and added to ProgramConf + if( pw.getProgram().getProgramable() ){ + String scriptPath = "${appPath}/" + pw.getId() + ".script"; + String scriptName = pw.getId() + ".script"; + + Script script = new Script(); + script.setPath( scriptPath ); + script.setInputCount( pw.getInNodeShapes().size() ); + script.setOutputCount( pw.getOutNodeShapes().size() ); + + if( pw instanceof ScriptProgramWidget ){ + ScriptProgramWidget sw = (ScriptProgramWidget)pw; + sw.getProgramConf().setScriptPath(scriptPath, scriptName); + script.setValue( sw.getProgramConf().getScriptContent() ); + script.setStartShellPath("${appPath}/" + pw.getId() + ".startup"); + }else if( pw instanceof SqlProgramWidget){ + SqlProgramWidget ssw = (SqlProgramWidget)pw; + ssw.getProgramConf().setScriptPath(scriptPath, scriptName); + script.setValue( ssw.getProgramConf().getScriptContent()); + + script.setStartShellPath(null); + } + graph.addScript( script ); + } } logger.info("Active node size = "+activeNodes.size()); for(String nodeId : activeNodes) @@ -162,45 +248,43 @@ private void buildInitialization(MonitorController controller){ logger.info("Active node :"+nodeId); graph.addActiveNode(nodeId); } - + logger.info("(Oozie Graph build Initialization ): Setting edges"); Set connDrawSet = controller.getConnDrawSet(); - //Set the file entry address for each component dependent - for (Connection conn : connDrawSet) { - - NodeShape start_shape = (NodeShape)conn.getStartShape(); - - //Get the shape of the line - OutNodeShape src_shape = (OutNodeShape) conn.getStartShape(); - NodeShape dst_shape = (NodeShape) conn.getEndShape(); - ProgramWidget dst_wgt = (ProgramWidget) dst_shape.getWidget(); - dst_wgt.getProgramConf().setInputFilePath( dst_shape.getPortId(), - src_shape.getWorkflowPath() + "/" + src_shape.getFileId(), src_shape.getFileId()); - } + //Set the file entry address for each component dependent + for (Connection conn : connDrawSet) { + + //Get the shape of the line + OutNodeShape src_shape = (OutNodeShape) conn.getStartShape(); + NodeShape dst_shape = (NodeShape) conn.getEndShape(); + ProgramWidget dst_wgt = (ProgramWidget) dst_shape.getWidget(); + dst_wgt.getProgramConf().setInputFilePath( dst_shape.getPortId(), + src_shape.getWorkflowPath() + "/" + src_shape.getFileId(), src_shape.getFileId()); + } } - /** - * Load all widgets form controller - * @param controller - */ + /** + * Load all widgets form controller + * @param controller + */ private void loadWidgets(MonitorController controller){ Map widgets = controller.getWidgets(); - for (Map.Entry entry : widgets.entrySet()) { - BaseWidget widget = entry.getValue(); - Integer x = widget.getController().getWidgetPanel().getWidgetLeft(widget); - Integer y = widget.getController().getWidgetPanel().getWidgetTop(widget); - int tx = Util.parseStrToInt(String.valueOf(x)); - int ty = Util.parseStrToInt(String.valueOf(y)); - - this.addWidget(widget, tx, ty); - } - - Set connDrawSet = controller.getConnDrawSet(); - for (Connection conn : connDrawSet) { - this.addEdge(conn); - } + for (Map.Entry entry : widgets.entrySet()) { + BaseWidget widget = entry.getValue(); + Integer x = widget.getController().getWidgetPanel().getWidgetLeft(widget); + Integer y = widget.getController().getWidgetPanel().getWidgetTop(widget); + int tx = Util.parseStrToInt(String.valueOf(x)); + int ty = Util.parseStrToInt(String.valueOf(y)); + + this.addWidget(widget, tx, ty); + } + + Set connDrawSet = controller.getConnDrawSet(); + for (Connection conn : connDrawSet) { + this.addEdge(conn); + } } - + /** * Get active node from DAG to execute * diff --git a/src/main/java/eml/studio/client/i18n/AccountUIMessages.java b/src/main/java/eml/studio/client/i18n/AccountUIMessages.java index 1a36e65..04f3fa9 100644 --- a/src/main/java/eml/studio/client/i18n/AccountUIMessages.java +++ b/src/main/java/eml/studio/client/i18n/AccountUIMessages.java @@ -9,28 +9,28 @@ public interface AccountUIMessages extends Messages{ - //modify account information - String information(); - String account(); - String username(); - String company(); - String position(); - String oldpwd(); - String newpwd(); - String verpwd(); - String infoSuccess(); - String infoExist(); - String infoFail(); - String usrEmpty(); - String cmpEmpty(); - String pstEmpty(); - //modify account password - String pwdSuccess(); - String pwdFail(); - String pwdWrong(); - String pwdEmpty(); - String pwdLength(); - String pwdMatch1(); - String pwdMatch2(); - String confirm(); + //modify account information + String information(); + String account(); + String username(); + String company(); + String position(); + String oldpwd(); + String newpwd(); + String verpwd(); + String infoSuccess(); + String infoExist(); + String infoFail(); + String usrEmpty(); + String cmpEmpty(); + String pstEmpty(); + //modify account password + String pwdSuccess(); + String pwdFail(); + String pwdWrong(); + String pwdEmpty(); + String pwdLength(); + String pwdMatch1(); + String pwdMatch2(); + String confirm(); } diff --git a/src/main/java/eml/studio/client/i18n/AdminUIMessages.java b/src/main/java/eml/studio/client/i18n/AdminUIMessages.java index 3f5f7d8..5ce700d 100644 --- a/src/main/java/eml/studio/client/i18n/AdminUIMessages.java +++ b/src/main/java/eml/studio/client/i18n/AdminUIMessages.java @@ -9,55 +9,61 @@ public interface AdminUIMessages extends Messages{ - String chooseCate(); - String addCate(); - String cateName(); - String catePath(); - String confirm(); - String cancel(); - String alert1(); - String alert2(); - String alert3(); - String alert4(); - String alert5(); - String alert6(); - String alert7(); - String delete1(); - String delete2(); - String delete3(); - String delete4(); - - //program management - String deleteProg(); - String progDelete1(); - String progDelete2(); - String progSuccess(); - - //dataset management - String deleteData(); - String dataDelete1(); - String dataDelete2(); - String dataSuccess(); - - //user management - String power1(); - String power2(); - String power3(); - String powerSuccess(); - String userDelete1(); - String userDelete2(); - String userSuccess(); - String editPower(); - String deleteUser(); - - //category management - String dataAdd(); - String progAdd(); - String deleteCate(); - - //page - String firstPage(); - String lastPage(); - String prevPage(); - String nextPage(); + String chooseCate(); + String addCate(); + String cateName(); + String catePath(); + String confirm(); + String cancel(); + String alert1(); + String alert2(); + String alert3(); + String alert4(); + String alert5(); + String alert6(); + String alert7(); + String delete1(); + String delete2(); + String delete3(); + String delete4(); + String change(); + + //program management + String deleteProg(); + String progDelete1(); + String progDelete2(); + String progSuccess(); + + //dataset management + String deleteData(); + String dataDelete1(); + String dataDelete2(); + String dataSuccess(); + + //user management + String power1(); + String power2(); + String power3(); + String powerSuccess(); + String userDelete1(); + String userDelete2(); + String userSuccess(); + String editPower(); + String deleteUser(); + + //category management + String dataAdd(); + String progAdd(); + String deleteCate(); + + //search + String searchNoInput(); + String searchNoResult(); + String searchCateError(); + + //page + String firstPage(); + String lastPage(); + String prevPage(); + String nextPage(); } diff --git a/src/main/java/eml/studio/client/i18n/Globalization.java b/src/main/java/eml/studio/client/i18n/Globalization.java index a7c2639..b8417a4 100644 --- a/src/main/java/eml/studio/client/i18n/Globalization.java +++ b/src/main/java/eml/studio/client/i18n/Globalization.java @@ -9,35 +9,35 @@ public class Globalization { - public static String getI18NString(String cateName){ - - if( cateName.equals("预处ç†") ){ - return Constants.studioUIMsg.preprocess(); - }else if(cateName.equals("å•æœº") ){ - return Constants.studioUIMsg.standalone(); - }else if(cateName.equals("分布å¼") ){ - return Constants.studioUIMsg.distributed(); - }else if(cateName.equals("结果评价") ){ - return Constants.studioUIMsg.evaluation(); - }else if(cateName.equals("æ ¼å¼è½¬æ¢") ){ - return Constants.studioUIMsg.transformation(); - }else if(cateName.equals("机器学习算法") ){ - return Constants.studioUIMsg.machineLearning(); - }else if(cateName.equals("深度学习") ){ - return Constants.studioUIMsg.deepLearning(); - }else if(cateName.equals("文本分æž") ){ - return Constants.studioUIMsg.textAnalysis(); - }else if(cateName.equals("推è算法") ){ - return Constants.studioUIMsg.recommendation(); - }else if(cateName.equals("图分æž") ){ - return Constants.studioUIMsg.graphAnalysis(); - }else if(cateName.equals("分类回归") ){ - return Constants.studioUIMsg.classification(); - }else if(cateName.equals("èšç±»ç®—法") ){ - return Constants.studioUIMsg.clusterAnalysis(); - }else if(cateName.equals("结构化分æž") ){ - return Constants.studioUIMsg.structuralAnalysis(); - } - return cateName; - } + public static String getI18NString(String cateName){ + + if( cateName.equals("预处ç†") ){ + return Constants.studioUIMsg.preprocess(); + }else if(cateName.equals("å•æœº") ){ + return Constants.studioUIMsg.standalone(); + }else if(cateName.equals("分布å¼") ){ + return Constants.studioUIMsg.distributed(); + }else if(cateName.equals("结果评价") ){ + return Constants.studioUIMsg.evaluation(); + }else if(cateName.equals("æ ¼å¼è½¬æ¢") ){ + return Constants.studioUIMsg.transformation(); + }else if(cateName.equals("机器学习算法") ){ + return Constants.studioUIMsg.machineLearning(); + }else if(cateName.equals("深度学习") ){ + return Constants.studioUIMsg.deepLearning(); + }else if(cateName.equals("文本分æž") ){ + return Constants.studioUIMsg.textAnalysis(); + }else if(cateName.equals("推è算法") ){ + return Constants.studioUIMsg.recommendation(); + }else if(cateName.equals("图分æž") ){ + return Constants.studioUIMsg.graphAnalysis(); + }else if(cateName.equals("分类回归") ){ + return Constants.studioUIMsg.classification(); + }else if(cateName.equals("èšç±»ç®—法") ){ + return Constants.studioUIMsg.clusterAnalysis(); + }else if(cateName.equals("结构化分æž") ){ + return Constants.studioUIMsg.structuralAnalysis(); + } + return cateName; + } } diff --git a/src/main/java/eml/studio/client/i18n/HeaderUIMessages.java b/src/main/java/eml/studio/client/i18n/HeaderUIMessages.java index e62efff..6b72108 100644 --- a/src/main/java/eml/studio/client/i18n/HeaderUIMessages.java +++ b/src/main/java/eml/studio/client/i18n/HeaderUIMessages.java @@ -9,18 +9,18 @@ public interface HeaderUIMessages extends Messages{ - String createJob(); - String uploadData(); - String uploadProgram(); - String progManagement(); - String dataManagement(); - String userManagement(); - String cateManagement(); - String notebook(); - - String workStage(); - String manager(); - - String login(); - String logout(); + String createJob(); + String uploadData(); + String uploadProgram(); + String progManagement(); + String dataManagement(); + String userManagement(); + String cateManagement(); + String notebook(); + + String workStage(); + String manager(); + + String login(); + String logout(); } diff --git a/src/main/java/eml/studio/client/i18n/LogUIMessages.java b/src/main/java/eml/studio/client/i18n/LogUIMessages.java index 330a6f2..59dce39 100644 --- a/src/main/java/eml/studio/client/i18n/LogUIMessages.java +++ b/src/main/java/eml/studio/client/i18n/LogUIMessages.java @@ -9,26 +9,26 @@ public interface LogUIMessages extends Messages{ - String login(); - String logout(); - String register(); - String remember(); - String forget(); - - String guest(); - String email(); - String password(); - - String loginErrorMsg(); - String loginWrongMsg(); - - String resetEmail(); - String resetSend(); - String resetCancel(); - - String registerEmail(); - String registerVerify(); - String registerConfirm(); - String registerCancel(); - + String login(); + String logout(); + String register(); + String remember(); + String forget(); + + String guest(); + String email(); + String password(); + + String loginErrorMsg(); + String loginWrongMsg(); + + String resetEmail(); + String resetSend(); + String resetCancel(); + + String registerEmail(); + String registerVerify(); + String registerConfirm(); + String registerCancel(); + } diff --git a/src/main/java/eml/studio/client/i18n/RegisterUIMessages.java b/src/main/java/eml/studio/client/i18n/RegisterUIMessages.java index 7648e9c..09f2036 100644 --- a/src/main/java/eml/studio/client/i18n/RegisterUIMessages.java +++ b/src/main/java/eml/studio/client/i18n/RegisterUIMessages.java @@ -9,27 +9,26 @@ public interface RegisterUIMessages extends Messages { + String register(); + String registerUsr(); + String registerPwd(); + String registerVer(); + String registerCmp(); + String registerPst(); - String register(); - String registerUsr(); - String registerPwd(); - String registerVer(); - String registerCmp(); - String registerPst(); - - String emailFormatErrorMsg(); - String emailHasRegisteredMsg(); - String verifyEmailErrMsg(); - String verifyEmailSuccessMsg(); - String registerSuccessMsg(); - String usernameExistMsg(); - String usernameEmptyMsg(); - String companyEmptyMsg(); - String positionEmptyMsg(); - String passwordEmptyMsg(); - String passwordLengthMsg(); - String passwordMismatchMsg(); - String otherErrMsg(); + String emailFormatErrorMsg(); + String emailHasRegisteredMsg(); + String verifyEmailErrMsg(); + String verifyEmailSuccessMsg(); + String registerSuccessMsg(); + String usernameExistMsg(); + String usernameEmptyMsg(); + String companyEmptyMsg(); + String positionEmptyMsg(); + String passwordEmptyMsg(); + String passwordLengthMsg(); + String passwordMismatchMsg(); + String otherErrMsg(); - String confirm(); + String confirm(); } diff --git a/src/main/java/eml/studio/client/i18n/ResetpwdUIMessages.java b/src/main/java/eml/studio/client/i18n/ResetpwdUIMessages.java index 9ada5fb..fc47133 100644 --- a/src/main/java/eml/studio/client/i18n/ResetpwdUIMessages.java +++ b/src/main/java/eml/studio/client/i18n/ResetpwdUIMessages.java @@ -9,20 +9,20 @@ public interface ResetpwdUIMessages extends Messages { - String resetpwd(); - String resetPwd(); - String resetVer(); - - String emailFormatErrorMsg(); - String emailHasnotRegisterMsg(); - String sendEmailErrMsg(); - String sendEmailSuccessMsg(); - String emailNotExistMsg(); - String passwordResetSuccessMsg(); - String passwordEmptyMsg(); - String passwordLengthMsg(); - String passwordMismatchMsg(); - String otherErrMsg(); + String resetpwd(); + String resetPwd(); + String resetVer(); - String confirm(); + String emailFormatErrorMsg(); + String emailHasnotRegisterMsg(); + String sendEmailErrMsg(); + String sendEmailSuccessMsg(); + String emailNotExistMsg(); + String passwordResetSuccessMsg(); + String passwordEmptyMsg(); + String passwordLengthMsg(); + String passwordMismatchMsg(); + String otherErrMsg(); + + String confirm(); } diff --git a/src/main/java/eml/studio/client/i18n/StudioUIMessages.java b/src/main/java/eml/studio/client/i18n/StudioUIMessages.java index 4212c2a..9805920 100644 --- a/src/main/java/eml/studio/client/i18n/StudioUIMessages.java +++ b/src/main/java/eml/studio/client/i18n/StudioUIMessages.java @@ -8,108 +8,116 @@ import com.google.gwt.i18n.client.Messages; public interface StudioUIMessages extends Messages { - String yes(); - String no(); - String submit(); - String clear(); - String clone(); - String refresh(); - String confirm(); - String cancel(); - String stop(); - String createJob(); + + String yes(); + String no(); + String submit(); + String clear(); + String clone(); + String refresh(); + String runHistory(); + String confirm(); + String cancel(); + String stop(); + String createJob(); - String program(); - String data(); - String job(); - + String program(); + String data(); + String job(); - String systemProgram(); - String systemData(); - String preprocess(); - String standalone(); - String distributed(); - String evaluation(); - String transformation(); - String machineLearning(); - String deepLearning(); - String textAnalysis(); - String recommendation(); - String graphAnalysis(); - String classification(); - String clusterAnalysis(); - String structuralAnalysis(); - String sharedData(); - String sharedProgram(); - String myProgram(); - String myData(); - String chooseCategory(); - String examples(); - String myJobs(); - String otherJobs(); - String finished(); - String running(); - + String systemProgram(); + String systemData(); + String preprocess(); + String standalone(); + String distributed(); + String evaluation(); + String transformation(); + String machineLearning(); + String deepLearning(); + String textAnalysis(); + String recommendation(); + String graphAnalysis(); + String classification(); + String clusterAnalysis(); + String structuralAnalysis(); + String sharedData(); + String sharedProgram(); + String myProgram(); + String myData(); + String chooseCategory(); - String jobPanelTitle(); - String jobName(); - String jobOwner(); - String jobId(); - String jobStatus(); - String startTime(); - String endTime(); - String useTime(); - String jobDescription(); - String cronSetting(); - + String examples(); + String myJobs(); + String otherJobs(); + String finished(); + String running(); + String historyView(); + String historyDelete(); + String historySearch(); + String historyBatchDel(); + String historySelectAll(); + String historyDelHint(); - String modulePanelTitle(); - String moduleName(); - String moduleDesription(); - String moduleDeterminacy(); - String moduleVersion(); - String moduleCreateTime(); - String moduleOwner(); - String moduleDeprecated(); - String parameter(); - String type(); - String value(); - String moduleCategory(); - String moduleType(); - String programable(); - String moduleCMDFormat(); - - String dataName(); - String dataCategory(); - String dataType(); - String dataStorage(); - String dataDescription(); - String dataVersion(); - String dataCreateTime(); - String dataOwner(); - String dataDeprecated(); - - String commandLine(); - String defaultValue(); - String add(); - String remove(); - String generate(); - String description(); - - //operations on control panel - String cut(); - String copy(); - String paste(); - String supernode(); - String input(); - String output(); - String back(); - - String minute(); - String hour(); - String day(); - String month(); - String week(); + + String jobPanelTitle(); + String jobName(); + String jobOwner(); + String jobId(); + String jobStatus(); + String startTime(); + String endTime(); + String useTime(); + String jobDescription(); + String cronSetting(); + + + String modulePanelTitle(); + String moduleName(); + String moduleDesription(); + String moduleDeterminacy(); + String moduleVersion(); + String moduleCreateTime(); + String moduleOwner(); + String moduleDeprecated(); + String parameter(); + String type(); + String value(); + String moduleCategory(); + String moduleType(); + String programable(); + String moduleCMDFormat(); + + String dataName(); + String dataCategory(); + String dataType(); + String dataStorage(); + String dataDescription(); + String dataVersion(); + String dataCreateTime(); + String dataOwner(); + String dataDeprecated(); + + String commandLine(); + String defaultValue(); + String add(); + String remove(); + String generate(); + String description(); + + //operations on control panel + String cut(); + String copy(); + String paste(); + String supernode(); + String input(); + String output(); + String back(); + + String minute(); + String hour(); + String day(); + String month(); + String week(); } diff --git a/src/main/java/eml/studio/client/mvp/AppController.java b/src/main/java/eml/studio/client/mvp/AppController.java index 52b5862..1753455 100644 --- a/src/main/java/eml/studio/client/mvp/AppController.java +++ b/src/main/java/eml/studio/client/mvp/AppController.java @@ -35,133 +35,150 @@ * This Controller is used to control webpage's operations */ public class AppController implements ValueChangeHandler { - private static Logger logger = Logger.getLogger(AppController.class.getName()); - - public static String email = null; - public static String username = null; - public static String verifylink = null; - public static String power = null; - private LoginController loginController; - private HandlerManager eventBus; - private HasWidgets container; - - public AppController(HandlerManager eventBus, LoginController loginController) { - this.eventBus = eventBus; - this.loginController = loginController; - bind(); - } - - /** - * Event binding - */ - private void bind() { - //Browser browser page token history (token is url # token) - History.addValueChangeHandler(this); - - eventBus.addHandler(ToMonitorEvent.TYPE, - new ToMonitorEvent.ToMonitorEventHandler() { - - @Override - public void onToMonitorEvent(ToMonitorEvent event) { - String msg = event.getMessage(); - if (msg != null && !"".equals(msg)) - History.newItem("monitor=" + msg); - else - History.newItem("monitor"); - } - }); - - eventBus.addHandler(LogoutEvent.TYPE, - new LogoutEvent.LogoutEventHandler() { - - @Override - public void onLogoutEvent(LogoutEvent event) { - loginController.logout(); - } - - }); - - eventBus.addHandler(LoginEvent.TYPE, - new LoginEvent.LoginEventHandler() { - - @Override - public void onLoginEvent(LoginEvent event) { - handleToken(event.getMessage()); - } - }); - } - - public void go(final HasWidgets container) { - logger.info("app view going..."); - this.container = container; - - if ("".equals(History.getToken())) { - History.newItem("monitor"); - } else { - History.fireCurrentHistoryState(); - } - } - - @Override - public void onValueChange(ValueChangeEvent event) { - final String token = event.getValue(); - logger.info("value change:" + token); - - loginController.go(token); - } - - /** token is the url postfix after bdastudio, like designer or desigeer=jobid */ - private void handleToken(String token) { - if (token != null) { - Presenter presenter = null; - - if (token.startsWith("monitor")) { - String jobid = null; - if (token.startsWith("monitor=")) { - logger.info("token = " + token); - jobid = token.replaceFirst("monitor=", ""); - logger.info("jobid = " + jobid); - } - presenter = new MonitorPresenter(eventBus, new MonitorView(), jobid); - }else if (token.startsWith("account")){ - presenter = new AccountPresenter(eventBus, new AccountView()); - } else if (token.startsWith("register")){ - presenter = new RegisterPresenter(eventBus, new RegisterView()); - } else if (token.startsWith("resetpwd")){ - presenter = new ResetpwdPresenter(eventBus, new ResetpwdView()); - } else if (token.startsWith("admin")){ - presenter = new AdminPresenter(eventBus, new AdminView()); - } - - if (presenter != null) { - presenter.go(container); - } - } - } - - /** - * Redirect to url - * @param url target url - */ - public static void redirect(String url) { - String href = Window.Location.getHref(); - logger.info("[href]" + href); - int splitIdx = href.lastIndexOf('/'); - String base_url = href.substring(0, splitIdx); - logger.info("[base_url]" + base_url); - Window.Location.replace(base_url + "/" + url); - } - - /** - * Get now Url - * @return url string - */ - public static native String getUrl()/*-{ + private static Logger logger = Logger.getLogger(AppController.class.getName()); + + public static String email = null; + public static String username = null; + public static String verifylink = null; + public static String power = null; + private LoginController loginController; + private HandlerManager eventBus; + private HasWidgets container; + + public AppController(HandlerManager eventBus, LoginController loginController) { + this.eventBus = eventBus; + this.loginController = loginController; + bind(); + } + + /** + * Event binding + */ + private void bind() { + //Browser browser page token history (token is url # token) + History.addValueChangeHandler(this); + + eventBus.addHandler(ToMonitorEvent.TYPE, + new ToMonitorEvent.ToMonitorEventHandler() { + + @Override + public void onToMonitorEvent(ToMonitorEvent event) { + String msg = event.getMessage(); + if (msg != null && !"".equals(msg)) + History.newItem("monitor=" + msg); + else + History.newItem("monitor"); + } + }); + + eventBus.addHandler(LogoutEvent.TYPE, + new LogoutEvent.LogoutEventHandler() { + + @Override + public void onLogoutEvent(LogoutEvent event) { + loginController.logout(); + } + + }); + + eventBus.addHandler(LoginEvent.TYPE, + new LoginEvent.LoginEventHandler() { + + @Override + public void onLoginEvent(LoginEvent event) { + handleToken(event.getMessage()); + } + }); + } + + public void go(final HasWidgets container) { + logger.info("app view going..."); + this.container = container; + + if ("".equals(History.getToken())) { + History.newItem("monitor"); + } else { + History.fireCurrentHistoryState(); + } + } + + @Override + public void onValueChange(ValueChangeEvent event) { + final String token = event.getValue(); + logger.info("value change:" + token); + + loginController.go(token); + } + + /** token is the url postfix after bdastudio, like designer or desigeer=jobid */ + private void handleToken(String token) { + if (token != null) { + Presenter presenter = null; + + if (token.startsWith("monitor")) { + if(token.contains("&instance=")) + { + String jobId = null; + String oozieJobId = null; + if(token.startsWith("monitor=")) + { + logger.info("token = " + token); + String[] ids = token.replaceFirst("monitor=", "").split("&instance="); + jobId = ids[0]; + oozieJobId = ids[1]; + logger.info("jobId = "+jobId+"; oozieJobId = "+oozieJobId); + } + presenter = new MonitorPresenter(eventBus,new MonitorView(),jobId,oozieJobId); + } + else + { + String jobid = null; + if (token.startsWith("monitor=")) { + logger.info("token = " + token); + jobid = token.replaceFirst("monitor=", ""); + logger.info("jobid = " + jobid); + } + presenter = new MonitorPresenter(eventBus, new MonitorView(), jobid); + } + }else if (token.startsWith("account")){ + presenter = new AccountPresenter(eventBus, new AccountView()); + } else if (token.startsWith("register")){ + presenter = new RegisterPresenter(eventBus, new RegisterView()); + } else if (token.startsWith("resetpwd")){ + presenter = new ResetpwdPresenter(eventBus, new ResetpwdView()); + } else if (token.startsWith("admin")){ + presenter = new AdminPresenter(eventBus, new AdminView()); + } + + if (presenter != null) { + presenter.go(container); + } + } + } + + /** + * Redirect to url + * @param url target url + */ + public static void redirect(String url) { + String href = Window.Location.getHref(); + logger.info("[href]" + href); + int splitIdx = href.lastIndexOf('/'); + String base_url = href.substring(0, splitIdx); + logger.info("[base_url]" + base_url); + Window.Location.replace(base_url + "/" + url); + } + + /** + * Get now Url + * @return url string + */ + public static native String getUrl()/*-{ return $wnd.location; }-*/; - public static int random(int min, int max){ - Random random = new Random(); - int s = random.nextInt(max)%(max-min+1) + min; - return s; - } + public static int random(int min, int max){ + Random random = new Random(); + int s = random.nextInt(max)%(max-min+1) + min; + return s; + } } diff --git a/src/main/java/eml/studio/client/mvp/presenter/AccountLoader.java b/src/main/java/eml/studio/client/mvp/presenter/AccountLoader.java index f579202..6aa8578 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/AccountLoader.java +++ b/src/main/java/eml/studio/client/mvp/presenter/AccountLoader.java @@ -13,376 +13,639 @@ import eml.studio.client.ui.panel.AlertPanel; import eml.studio.client.ui.panel.DeletePanel; import eml.studio.client.util.Constants; +import eml.studio.client.util.Pagination; import eml.studio.shared.model.Account; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.i18n.client.DateTimeFormat; +import com.google.gwt.user.client.Cookies; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.CheckBox; +import com.google.gwt.user.client.ui.Grid; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Label; /** - * Loaded user management page data - * + * User management in backstage manegement */ public class AccountLoader { - private final AdminView adminView; - protected AccountServiceAsync accountService = GWT.create(AccountService.class); - protected AlertPanel alertPanel = new AlertPanel(); - protected DeletePanel deletePanel = new DeletePanel(); - final DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); - int currentPage = 1; - int lastPage; - int headStart; - int tailStart; - int resultSize; - int resultStart; - int everyPageSize; - final Label first = new Label( Constants.adminUIMsg.firstPage() ); - final Label prev = new Label( Constants.adminUIMsg.prevPage() ); - final Label next = new Label( Constants.adminUIMsg.nextPage() ); - final Label last = new Label( Constants.adminUIMsg.lastPage() ); - Account account; - - public AccountLoader(AdminView adminView, int currentPage, int lastPage, int resultSize, Account account) { - this.adminView = adminView; - this.currentPage = currentPage; - this.lastPage = lastPage; - this.resultSize = resultSize; - this.account = account; - } - - /** - * Init data - */ - public void init() { - //Prompt box and close button - alertPanel.getClose().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.fireCurrentHistoryState(); - } - - }); + private final AdminView adminView; + private AccountServiceAsync accountService = GWT.create(AccountService.class); + private DeletePanel deletePanel = new DeletePanel(); + private AlertPanel alertPanel = new AlertPanel(); + private AlertPanel searchAlert = new AlertPanel(); + private final DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); + private int currentPage = 1; + private int pageSize; + private int lastPage; + private int resultSize; + private int resultStart; + private int everyPageSize; + private Grid page = new Grid(); //Pagination control area + private Pagination pagination; + private Account searchAccount; + private String searchEmail; + private String searchName; + private String searchCompany; + private String searchPosition; + private int searchPower; - //Prompt box and confirmation button - alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + //true: search result; false: all result; use to distinguish the paging control response from data load function: load or reload + private boolean searchFlag = false; - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.fireCurrentHistoryState(); - } - - }); - - //Calculate the number of records per page - resultStart = (currentPage-1)*13; - if(currentPage == lastPage){ - everyPageSize = resultSize - resultStart; - }else{ - everyPageSize = 13; + public AccountLoader(AdminView adminView) { + this.adminView = adminView; + bind(); } - //Reset the table row number and set the header - adminView.getUserGrid().resize(everyPageSize+1, 7); - adminView.getUserGrid().setText(0, 0, "Email"); - adminView.getUserGrid().setText(0, 1, "Username"); - adminView.getUserGrid().setText(0, 2, "Company"); - adminView.getUserGrid().setText(0, 3, "Position"); - adminView.getUserGrid().setText(0, 4, "Join Date"); - adminView.getUserGrid().setText(0, 5, "Power"); - adminView.getUserGrid().setText(0, 6, "Operation"); - - //Get the user information and fill in the form - accountService.findValid(account, resultStart, everyPageSize, new AsyncCallback>(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - alertPanel.setContent(caught.getMessage()); - alertPanel.show(); - } + public void go(){ + init(); + } + + /** + * Event bind + */ + private void bind(){ + + alertPanel.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.fireCurrentHistoryState(); + } + + }); - @Override - public void onSuccess(List result) { - // TODO Auto-generated method stub - for(int i=0;i() { - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - alertPanel.setContent(caught.getMessage()); - alertPanel.show(); - } + if(searchCompany != ""){ + searchAccount.setCompany(searchCompany); + }else{ + searchAccount.setCompany(null); + } + if(searchPosition != ""){ + searchAccount.setPosition(searchPosition); + }else{ + searchAccount.setPosition(null); + } + searchAccount.setPower(Integer.toString(searchPower)); - @Override - public void onSuccess(Account result) { - // TODO Auto-generated method stub - if (result != null) { - alertPanel.setContent( Constants.adminUIMsg.powerSuccess() ); - alertPanel.show(); - } - } + //If all the input is empty, prompt user enter input information. If is not , then begin searching + if(searchEmail == "" && searchName == "" && searchCompany == "" && searchPosition == "" && searchPower == 0){ + searchAlert.setContent( Constants.adminUIMsg.searchNoInput() ); + searchAlert.show(); + }else{ + searchResult(); + } + } + + }); + + page.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + int index = page.getCellForEvent(event).getCellIndex(); + String crtPageText = page.getText(0, index); + currentPage = pagination.getCurrentPage(currentPage, crtPageText, lastPage); + pagination.reload(currentPage); + if(searchFlag){ //Show search results + reload(); + }else //Show all results + load(); + } - }); - } - - }); + }); + } + + /** + * Initialization + */ + private void init(){ + clearInput(); + adminView.getUserPage().clear(); + page.addStyleName("admin-page"); + adminView.getUserPage().add(page); + currentPage = 1; + + Account currentAccount = new Account(); + currentAccount.setEmail(Cookies.getCookie("bdaemail")); + accountService.getSize(currentAccount, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); + } + + @Override + public void onSuccess(Integer result) { + // TODO Auto-generated method stub + //Caculate page-related information, initialize and load paging controls + resultSize = result; + pageSize = (int)Math.ceil((double)result/13); + lastPage = pageSize; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + //Load user data + load(); + } + }); + } + + /** + * Load data into the page + */ + private void load() { + resultStart = (currentPage-1)*13; + if(currentPage == lastPage){ + everyPageSize = resultSize - resultStart; + }else{ + everyPageSize = 13; + } + + adminView.getUserGrid().resize(everyPageSize+1, 7); + adminView.getUserGrid().setText(0, 0, "Email"); + adminView.getUserGrid().setText(0, 1, "Username"); + adminView.getUserGrid().setText(0, 2, "Company"); + adminView.getUserGrid().setText(0, 3, "Position"); + adminView.getUserGrid().setText(0, 4, "Join Date"); + adminView.getUserGrid().setText(0, 5, "Power"); + adminView.getUserGrid().setText(0, 6, "Operation"); + + Account currentAccount = new Account(); + currentAccount.setEmail(Cookies.getCookie("bdaemail")); + accountService.findValid(currentAccount, resultStart, everyPageSize, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + for(int i=0;i() { - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - deletePanel.hide(); - alertPanel.setContent(caught.getMessage()); - alertPanel.show(); + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + String newPower = ""; + if(cb1.getValue()){ + newPower = newPower + "1"; + }else{ + newPower = newPower + "0"; + } + if(cb2.getValue()){ + newPower = newPower + "1"; + }else{ + newPower = newPower + "0"; + } + if(cb3.getValue()){ + newPower = newPower + "1"; + }else{ + newPower = newPower + "0"; } + Account account = new Account(); + account.setEmail(userEmail); + account.setPower(newPower); + accountService.updatePower(account, new AsyncCallback() { - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if (result.equals("success")) { - deletePanel.hide(); - alertPanel.setContent( Constants.adminUIMsg.userSuccess() ); + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + alertPanel.setContent(caught.getMessage()); alertPanel.show(); - } else { + } + + @Override + public void onSuccess(Account result) { + // TODO Auto-generated method stub + if (result != null) { + alertPanel.setContent( Constants.adminUIMsg.powerSuccess() ); + alertPanel.show(); + } + } + + }); + } + + }); + } + + }); + Label deleteUser = new Label(); + deleteUser.setTitle( Constants.adminUIMsg.deleteUser() ); + deleteUser.addStyleName("admin-user-delete"); + deleteUser.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + deletePanel.setContent( Constants.adminUIMsg.userDelete1() + userEmail + Constants.adminUIMsg.userDelete2() ); + deletePanel.show(); + deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + Account account = new Account(); + account.setEmail(userEmail); + accountService.deleteAccount(account, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub deletePanel.hide(); - alertPanel.setContent(result); + alertPanel.setContent(caught.getMessage()); alertPanel.show(); } - } - }); - } - }); - } + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if (result.equals("success")) { + deletePanel.hide(); + alertPanel.setContent( Constants.adminUIMsg.userSuccess() ); + alertPanel.show(); + } else { + deletePanel.hide(); + alertPanel.setContent(result); + alertPanel.show(); + } + } + }); + } - }); - HorizontalPanel operate = new HorizontalPanel(); - operate.addStyleName("admin-user"); - operate.add(editUser); - operate.add(deleteUser); - if(!userEmail.equals(AppController.email)){ - adminView.getUserGrid().setWidget(i + 1, 6, operate); + }); + } + + }); + HorizontalPanel operate = new HorizontalPanel(); + operate.addStyleName("admin-user"); + operate.add(editUser); + operate.add(deleteUser); + if(!userEmail.equals(AppController.email)){ + adminView.getUserGrid().setWidget(i + 1, 6, operate); + } } } - } - }); - } - - /** - * Load the paging for the first time - * - * @param pageSize - */ - public void pageLoader(int pageSize){ - if(pageSize>20){ - headStart = 1; - tailStart = lastPage - 9; - adminView.getUserPage().resize(1, 25); - adminView.getUserPage().setWidget(0, 0, first); - adminView.getUserPage().setWidget(0, 1, prev); - for(int count=2;count<12;count++){ - adminView.getUserPage().setWidget(0, count, new Label(headStart+"")); - headStart++; - } - adminView.getUserPage().setText(0, 12, "..."); - for(int count=13;count<23;count++){ - adminView.getUserPage().setWidget(0, count, new Label(tailStart+"")); - tailStart++; - } - adminView.getUserPage().setWidget(0, 23, next); - adminView.getUserPage().setWidget(0, 24, last); - }else{ - adminView.getUserPage().resize(1, pageSize+4); - adminView.getUserPage().setWidget(0, 0, first); - adminView.getUserPage().setWidget(0, 1, prev); - for(int count=2;count 20){ - if(currentPage == 1 || currentPage == lastPage){ - headStart = 1; - tailStart = lastPage - 9; - }else{ - if(currentPage > 9 && (currentPage+9)>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); } - } - if(tailStart == 0){ - adminView.getUserPage().clear(); - adminView.getUserPage().resize(1, 25); - adminView.getUserPage().setWidget(0, 0, first); - adminView.getUserPage().setWidget(0, 1, prev); - adminView.getUserPage().setText(0, 2, "..."); - for(int count=3;count<22;count++){ - adminView.getUserPage().setWidget(0, count, new Label(headStart+"")); - headStart++; + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result.size() == 0){ + searchAlert.setContent( Constants.adminUIMsg.searchNoResult() ); + searchAlert.show(); + }else{ + resultSize = result.size(); + pageSize = (int)Math.ceil((double)result.size()/13); + lastPage = pageSize; + currentPage = 1; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + reload(); + } } - adminView.getUserPage().setText(0, 22, "..."); - adminView.getUserPage().setWidget(0, 23, next); - adminView.getUserPage().setWidget(0, 24, last); - int stylePage = (currentPage - Integer.parseInt(adminView.getUserPage().getText(0, 3)))+3; - adminView.getUserPage().getWidget(0, stylePage).removeStyleName("gwt-Label"); - adminView.getUserPage().getWidget(0, stylePage).addStyleName("admin-page-selected"); + + }); + } + + /** + * Reload search result + */ + private void reload(){ + resultStart = (currentPage-1)*13; + if(currentPage == lastPage){ + everyPageSize = resultSize - resultStart; }else{ - adminView.getUserPage().clear(); - adminView.getUserPage().resize(1, 25); - adminView.getUserPage().setWidget(0, 0, first); - adminView.getUserPage().setWidget(0, 1, prev); - for(int count=2;count<12;count++){ - adminView.getUserPage().setWidget(0, count, new Label(headStart+"")); - headStart++; - } - adminView.getUserPage().setText(0, 12, "..."); - for(int count=13;count<23;count++){ - adminView.getUserPage().setWidget(0, count, new Label(tailStart+"")); - tailStart++; - } - adminView.getUserPage().setWidget(0, 23, next); - adminView.getUserPage().setWidget(0, 24, last); - if(currentPage>=Integer.parseInt(adminView.getUserPage().getText(0, 2))&¤tPage<=Integer.parseInt(adminView.getUserPage().getText(0, 11))){ - adminView.getUserPage().getWidget(0, currentPage+1).removeStyleName("gwt-Label"); - adminView.getUserPage().getWidget(0, currentPage+1).addStyleName("admin-page-selected"); - }else if(currentPage>=Integer.parseInt(adminView.getUserPage().getText(0, 13))&¤tPage<=Integer.parseInt(adminView.getUserPage().getText(0, 22))){ - int stylePage = (currentPage - Integer.parseInt(adminView.getUserPage().getText(0, 13)))+13; - adminView.getUserPage().getWidget(0, stylePage).removeStyleName("gwt-Label"); - adminView.getUserPage().getWidget(0, stylePage).addStyleName("admin-page-selected"); - } + everyPageSize = 13; } - }else{ - if(currentPage > 0 && currentPage < (pageSize + 1)){ - adminView.getUserPage().clear(); - adminView.getUserPage().resize(1, pageSize+4); - adminView.getUserPage().setWidget(0, 0, first); - adminView.getUserPage().setWidget(0, 1, prev); - for(int count=2;count>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); } - adminView.getUserPage().setWidget(0, pageSize+2, next); - adminView.getUserPage().setWidget(0, pageSize+3, last); - adminView.getUserPage().getWidget(0, currentPage+1).removeStyleName("gwt-Label"); - adminView.getUserPage().getWidget(0, currentPage+1).addStyleName("admin-page-selected"); - } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + for(int i=0;i() { + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(Account result) { + // TODO Auto-generated method stub + if (result != null) { + alertPanel.setContent( Constants.adminUIMsg.powerSuccess() ); + alertPanel.show(); + } + } + + }); + } + + }); + } + + }); + Label deleteUser = new Label(); + deleteUser.setTitle( Constants.adminUIMsg.deleteUser() ); + deleteUser.addStyleName("admin-user-delete"); + deleteUser.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + deletePanel.setContent( Constants.adminUIMsg.userDelete1() + userEmail + Constants.adminUIMsg.userDelete2() ); + deletePanel.show(); + deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + Account account = new Account(); + account.setEmail(userEmail); + accountService.deleteAccount(account, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if (result.equals("success")) { + deletePanel.hide(); + alertPanel.setContent( Constants.adminUIMsg.userSuccess() ); + alertPanel.show(); + } else { + deletePanel.hide(); + alertPanel.setContent(result); + alertPanel.show(); + } + } + }); + } + + }); + } + + }); + HorizontalPanel operate = new HorizontalPanel(); + operate.addStyleName("admin-user"); + operate.add(editUser); + operate.add(deleteUser); + if(!userEmail.equals(AppController.email)){ + adminView.getUserGrid().setWidget(i + 1, 6, operate); + } + } + } + }); + } + + /** + * Clear input area + */ + private void clearInput(){ + adminView.getUserEmail().setValue(null); + adminView.getUserName().setValue(null); + adminView.getUserCmp().setValue(null); + adminView.getUserPst().setValue(null); + adminView.getUserPower().setItemSelected(0, true); + } + + public boolean isSearchFlag() { + return searchFlag; + } + + public void setSearchFlag(boolean searchFlag) { + this.searchFlag = searchFlag; } - } } diff --git a/src/main/java/eml/studio/client/mvp/presenter/AccountPresenter.java b/src/main/java/eml/studio/client/mvp/presenter/AccountPresenter.java index 7e51529..d957893 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/AccountPresenter.java +++ b/src/main/java/eml/studio/client/mvp/presenter/AccountPresenter.java @@ -23,326 +23,325 @@ /** * Modified persional info logical presenter - * */ public class AccountPresenter implements Presenter { - protected AccountServiceAsync accountService = GWT.create(AccountService.class); - protected AlertPanel alertPanel = new AlertPanel(); - private final HandlerManager eventBus; - private final AccountView accountView; - - /** - * User information is initialized - */ - public void init(){ - if(AppController.power.startsWith("0")){ //æƒé™0开头 用户没有åŽå°ç®¡ç†æƒé™ å³ä¸Šè§’[åŽå°ç®¡ç†]按钮éšè—且ä¸å¯ç‚¹å‡» - accountView.getAdminAnchor().setVisible(false); - accountView.getAdminAnchor().setEnabled(false); - } - accountView.setAccount(AppController.username, AppController.email); - Account account = new Account(); - account.setUsername(AppController.username); - account.setEmail(AppController.email); - accountService.getAccountInfo(account, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - accountView.getVererrorLabel().setText(caught.getMessage()); + protected AccountServiceAsync accountService = GWT.create(AccountService.class); + protected AlertPanel alertPanel = new AlertPanel(); + private final HandlerManager eventBus; + private final AccountView accountView; + + /** + * User information is initialized + */ + public void init(){ + if(AppController.power.startsWith("0")){ //Authority code starts with 0, general user have no authority to visit background management. + accountView.getAdminAnchor().setVisible(false); + accountView.getAdminAnchor().setEnabled(false); } + accountView.setAccount(AppController.username, AppController.email); + Account account = new Account(); + account.setUsername(AppController.username); + account.setEmail(AppController.email); + accountService.getAccountInfo(account, new AsyncCallback(){ - @Override - public void onSuccess(Account result) { - // TODO Auto-generated method stub - accountView.getUsrBox().setValue(result.getUsername()); - accountView.getCmpBox().setValue(result.getCompany()); - accountView.getPstBox().setValue(result.getPosition()); - } - - }); - } - - /** - * Event binding - */ - public void bind() { - //Prompt box close button - alertPanel.getClose().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.fireCurrentHistoryState(); - } - - }); + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + accountView.getVererrorLabel().setText(caught.getMessage()); + } - //Prompt box confirmation button - alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + @Override + public void onSuccess(Account result) { + // TODO Auto-generated method stub + accountView.getUsrBox().setValue(result.getUsername()); + accountView.getCmpBox().setValue(result.getCompany()); + accountView.getPstBox().setValue(result.getPosition()); + } - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.fireCurrentHistoryState(); - } - - }); + }); + } - //Backstage management - accountView.getAdminAnchor().addClickHandler(new ClickHandler(){ + /** + * Event binding + */ + public void bind() { + //Prompt box close button + alertPanel.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.fireCurrentHistoryState(); + } - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.newItem("admin"); - } - - }); + }); - //Work stage - accountView.getWorkStage().addClickHandler(new ClickHandler(){ + //Prompt box confirmation button + alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.newItem("monitor"); - } - - }); - - //The user exits - accountView.getLogout().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - eventBus.fireEvent(new LogoutEvent()); - } - - }); - - //Personal Information Page Navigation Click Response - Information Edit - accountView.getNavInfo().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - accountView.getNavInfo().addStyleName("account-nav-selected"); - accountView.getNavPwd().removeStyleName("account-nav-selected"); - accountView.getInfoPanel().setVisible(true); - accountView.getPwdPanel().setVisible(false); - } - - }); - - //Personal information page navigation click response - password modification - accountView.getNavPwd().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - accountView.getNavInfo().removeStyleName("account-nav-selected"); - accountView.getNavPwd().addStyleName("account-nav-selected"); - accountView.getInfoPanel().setVisible(false); - accountView.getPwdPanel().setVisible(true); - } - - }); - - //Personal Information Page Navigation Click Response - Information Modify OK - accountView.getInfoConfirmBtn().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - Account account = info_validate(); - if(account != null){ - accountService.modifyInfo(account, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - accountView.getPsterrorLabel().setText(caught.getMessage()); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result.startsWith("success")){ - AppController.username = result.split(" ")[1]; - alertPanel.setContent( Constants.accountUIMsg.infoSuccess() ); - alertPanel.show(); - }else if(result.equals("username existed")){ - accountView.getUsrerrorLabel().setText( Constants.accountUIMsg.infoExist() ); - }else - accountView.getPsterrorLabel().setText( Constants.accountUIMsg.infoFail() ); - } - - }); + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.fireCurrentHistoryState(); } - } - - }); - - //Personal Information Page Navigation Click Response - Password Change OK - accountView.getPwdConfirmBtn().addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - - String account = pwd_validate(); - if (account != null) { - accountService.modifyPassword(account, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - accountView.getVererrorLabel().setText(caught.getMessage()); - } - - @Override - public void onSuccess(String result) { - if (result != null) { - String arr[] = result.split(" "); - if (arr[0].equals("[success]")) { - AppController.email = arr[1]; - AppController.username = arr[2]; - alertPanel.setContent( Constants.accountUIMsg.pwdSuccess() ); - alertPanel.show(); - } else if (result.equals("wrong old password")) { - accountView.getOlderrorLabel().setText( Constants.accountUIMsg.pwdWrong() ); - accountView.getOlderrorLabel().setVisible(true); - accountView.getNewerrorLabel().setVisible(false); - accountView.getVererrorLabel().setVisible(false); - } else if (result.equals("new password failed")) { - accountView.getVererrorLabel().setText( Constants.accountUIMsg.pwdFail() ); - accountView.getOlderrorLabel().setVisible(false); - accountView.getNewerrorLabel().setVisible(false); - accountView.getVererrorLabel().setVisible(true); - } else { - accountView.getVererrorLabel().setText(result); - accountView.getOlderrorLabel().setVisible(false); - accountView.getNewerrorLabel().setVisible(false); - accountView.getVererrorLabel().setVisible(true); - } - } - } - - }); - } - } - }); - } - - /** - * Verification of information - * @return Account account information - */ - public Account info_validate() { - if (accountView.getUsrBox().getValue().length() <= 0) { - accountView.getUsrerrorLabel().setText( Constants.accountUIMsg.usrEmpty() ); - accountView.getUsrerrorLabel().setVisible(true); - accountView.getCmperrorLabel().setVisible(false); - accountView.getPsterrorLabel().setVisible(false); - accountView.getInfoConfirmBtn().setEnabled(true); - return null; - } else - accountView.getUsrerrorLabel().setText(""); - - if (accountView.getCmpBox().getValue().length() <= 0) { - accountView.getCmperrorLabel().setText( Constants.accountUIMsg.cmpEmpty() ); - accountView.getUsrerrorLabel().setVisible(false); - accountView.getCmperrorLabel().setVisible(true); - accountView.getPsterrorLabel().setVisible(false); - accountView.getInfoConfirmBtn().setEnabled(true); - return null; - } else - accountView.getCmperrorLabel().setText(""); - - if (accountView.getPstBox().getValue().length() <= 0) { - accountView.getPsterrorLabel().setText( Constants.accountUIMsg.pstEmpty() ); - accountView.getUsrerrorLabel().setVisible(false); - accountView.getCmperrorLabel().setVisible(false); - accountView.getPsterrorLabel().setVisible(true); - accountView.getInfoConfirmBtn().setEnabled(true); - return null; - } else - accountView.getPsterrorLabel().setText(""); - - Account account = new Account(); - account.setEmail(accountView.getEmail()); - account.setUsername(accountView.getUsrBox().getValue()); - account.setCompany(accountView.getCmpBox().getValue()); - account.setPosition(accountView.getPstBox().getValue()); - - return account; - } - - /** - * Password verification - * @return String Mail and old and new passwords - */ - public String pwd_validate() { - if (accountView.getOldPwd().getValue().length() <= 0) { - accountView.getOlderrorLabel().setText( Constants.accountUIMsg.pwdEmpty() ); - accountView.getOlderrorLabel().setVisible(true); - accountView.getNewerrorLabel().setVisible(false); - accountView.getVererrorLabel().setVisible(false); - accountView.getPwdConfirmBtn().setEnabled(true); - return null; - } else - accountView.getOlderrorLabel().setText(""); - - if (accountView.getNewPwd().getValue().length() <= 0) { - accountView.getNewerrorLabel().setText( Constants.accountUIMsg.pwdEmpty() ); - accountView.getOlderrorLabel().setVisible(false); - accountView.getNewerrorLabel().setVisible(true); - accountView.getVererrorLabel().setVisible(false); - accountView.getPwdConfirmBtn().setEnabled(true); - return null; - }else if(accountView.getNewPwd().getValue().length()>20){ - accountView.getNewerrorLabel().setText( Constants.accountUIMsg.pwdLength() ); - accountView.getNewerrorLabel().setVisible(true); - accountView.getOlderrorLabel().setVisible(false); - accountView.getVererrorLabel().setVisible(false); - accountView.getPwdConfirmBtn().setEnabled(true); - return null; - } else - accountView.getNewerrorLabel().setText(""); - - if (accountView.getOldPwd().getValue().equals(accountView.getNewPwd().getValue())) { - accountView.getNewerrorLabel().setText( Constants.accountUIMsg.pwdMatch1() ); - accountView.getOlderrorLabel().setVisible(false); - accountView.getNewerrorLabel().setVisible(true); - accountView.getVererrorLabel().setVisible(false); - accountView.getPwdConfirmBtn().setEnabled(true); - return null; - } else - accountView.getNewerrorLabel().setText(""); - - if (!accountView.getNewPwd().getValue().equals(accountView.getVerPwd().getValue())) { - accountView.getVererrorLabel().setText( Constants.accountUIMsg.pwdMatch2() ); - accountView.getOlderrorLabel().setVisible(false); - accountView.getNewerrorLabel().setVisible(false); - accountView.getVererrorLabel().setVisible(true); - accountView.getPwdConfirmBtn().setEnabled(true); - return null; - } else - accountView.getVererrorLabel().setText(""); - - String result = accountView.getEmail() + " " + accountView.getOldPwd().getValue() - + " " + accountView.getNewPwd().getValue(); - - return result; - } - - public AccountPresenter(HandlerManager eventBus, AccountView accountView) { - this.eventBus = eventBus; - this.accountView = accountView; - } - - @Override - public void go(HasWidgets container) { - bind(); - container.clear(); - container.add(accountView.asWidget()); - init(); - } + + }); + + //Backstage management + accountView.getAdminAnchor().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.newItem("admin"); + } + + }); + + //Work stage + accountView.getWorkStage().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.newItem("monitor"); + } + + }); + + //The user exits + accountView.getLogout().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + eventBus.fireEvent(new LogoutEvent()); + } + + }); + + //Personal Information Page Navigation Click Response - Information Edit + accountView.getNavInfo().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + accountView.getNavInfo().addStyleName("account-nav-selected"); + accountView.getNavPwd().removeStyleName("account-nav-selected"); + accountView.getInfoPanel().setVisible(true); + accountView.getPwdPanel().setVisible(false); + } + + }); + + //Personal information page navigation click response - password modification + accountView.getNavPwd().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + accountView.getNavInfo().removeStyleName("account-nav-selected"); + accountView.getNavPwd().addStyleName("account-nav-selected"); + accountView.getInfoPanel().setVisible(false); + accountView.getPwdPanel().setVisible(true); + } + + }); + + //Personal Information Page Navigation Click Response - Information Modify OK + accountView.getInfoConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + Account account = info_validate(); + if(account != null){ + accountService.modifyInfo(account, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + accountView.getPsterrorLabel().setText(caught.getMessage()); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result.startsWith("success")){ + AppController.username = result.split(" ")[1]; + alertPanel.setContent( Constants.accountUIMsg.infoSuccess() ); + alertPanel.show(); + }else if(result.equals("username existed")){ + accountView.getUsrerrorLabel().setText( Constants.accountUIMsg.infoExist() ); + }else + accountView.getPsterrorLabel().setText( Constants.accountUIMsg.infoFail() ); + } + + }); + } + } + + }); + + //Personal Information Page Navigation Click Response - Password Change OK + accountView.getPwdConfirmBtn().addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + + String account = pwd_validate(); + if (account != null) { + accountService.modifyPassword(account, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + accountView.getVererrorLabel().setText(caught.getMessage()); + } + + @Override + public void onSuccess(String result) { + if (result != null) { + String arr[] = result.split(" "); + if (arr[0].equals("[success]")) { + AppController.email = arr[1]; + AppController.username = arr[2]; + alertPanel.setContent( Constants.accountUIMsg.pwdSuccess() ); + alertPanel.show(); + } else if (result.equals("wrong old password")) { + accountView.getOlderrorLabel().setText( Constants.accountUIMsg.pwdWrong() ); + accountView.getOlderrorLabel().setVisible(true); + accountView.getNewerrorLabel().setVisible(false); + accountView.getVererrorLabel().setVisible(false); + } else if (result.equals("new password failed")) { + accountView.getVererrorLabel().setText( Constants.accountUIMsg.pwdFail() ); + accountView.getOlderrorLabel().setVisible(false); + accountView.getNewerrorLabel().setVisible(false); + accountView.getVererrorLabel().setVisible(true); + } else { + accountView.getVererrorLabel().setText(result); + accountView.getOlderrorLabel().setVisible(false); + accountView.getNewerrorLabel().setVisible(false); + accountView.getVererrorLabel().setVisible(true); + } + } + } + + }); + } + } + }); + } + + /** + * Verification of information + * @return Account account information + */ + public Account info_validate() { + if (accountView.getUsrBox().getValue().length() <= 0) { + accountView.getUsrerrorLabel().setText( Constants.accountUIMsg.usrEmpty() ); + accountView.getUsrerrorLabel().setVisible(true); + accountView.getCmperrorLabel().setVisible(false); + accountView.getPsterrorLabel().setVisible(false); + accountView.getInfoConfirmBtn().setEnabled(true); + return null; + } else + accountView.getUsrerrorLabel().setText(""); + + if (accountView.getCmpBox().getValue().length() <= 0) { + accountView.getCmperrorLabel().setText( Constants.accountUIMsg.cmpEmpty() ); + accountView.getUsrerrorLabel().setVisible(false); + accountView.getCmperrorLabel().setVisible(true); + accountView.getPsterrorLabel().setVisible(false); + accountView.getInfoConfirmBtn().setEnabled(true); + return null; + } else + accountView.getCmperrorLabel().setText(""); + + if (accountView.getPstBox().getValue().length() <= 0) { + accountView.getPsterrorLabel().setText( Constants.accountUIMsg.pstEmpty() ); + accountView.getUsrerrorLabel().setVisible(false); + accountView.getCmperrorLabel().setVisible(false); + accountView.getPsterrorLabel().setVisible(true); + accountView.getInfoConfirmBtn().setEnabled(true); + return null; + } else + accountView.getPsterrorLabel().setText(""); + + Account account = new Account(); + account.setEmail(accountView.getEmail()); + account.setUsername(accountView.getUsrBox().getValue()); + account.setCompany(accountView.getCmpBox().getValue()); + account.setPosition(accountView.getPstBox().getValue()); + + return account; + } + + /** + * Password verification + * @return String Mail and old and new passwords + */ + public String pwd_validate() { + if (accountView.getOldPwd().getValue().length() <= 0) { + accountView.getOlderrorLabel().setText( Constants.accountUIMsg.pwdEmpty() ); + accountView.getOlderrorLabel().setVisible(true); + accountView.getNewerrorLabel().setVisible(false); + accountView.getVererrorLabel().setVisible(false); + accountView.getPwdConfirmBtn().setEnabled(true); + return null; + } else + accountView.getOlderrorLabel().setText(""); + + if (accountView.getNewPwd().getValue().length() <= 0) { + accountView.getNewerrorLabel().setText( Constants.accountUIMsg.pwdEmpty() ); + accountView.getOlderrorLabel().setVisible(false); + accountView.getNewerrorLabel().setVisible(true); + accountView.getVererrorLabel().setVisible(false); + accountView.getPwdConfirmBtn().setEnabled(true); + return null; + }else if(accountView.getNewPwd().getValue().length()>20){ + accountView.getNewerrorLabel().setText( Constants.accountUIMsg.pwdLength() ); + accountView.getNewerrorLabel().setVisible(true); + accountView.getOlderrorLabel().setVisible(false); + accountView.getVererrorLabel().setVisible(false); + accountView.getPwdConfirmBtn().setEnabled(true); + return null; + } else + accountView.getNewerrorLabel().setText(""); + + if (accountView.getOldPwd().getValue().equals(accountView.getNewPwd().getValue())) { + accountView.getNewerrorLabel().setText( Constants.accountUIMsg.pwdMatch1() ); + accountView.getOlderrorLabel().setVisible(false); + accountView.getNewerrorLabel().setVisible(true); + accountView.getVererrorLabel().setVisible(false); + accountView.getPwdConfirmBtn().setEnabled(true); + return null; + } else + accountView.getNewerrorLabel().setText(""); + + if (!accountView.getNewPwd().getValue().equals(accountView.getVerPwd().getValue())) { + accountView.getVererrorLabel().setText( Constants.accountUIMsg.pwdMatch2() ); + accountView.getOlderrorLabel().setVisible(false); + accountView.getNewerrorLabel().setVisible(false); + accountView.getVererrorLabel().setVisible(true); + accountView.getPwdConfirmBtn().setEnabled(true); + return null; + } else + accountView.getVererrorLabel().setText(""); + + String result = accountView.getEmail() + " " + accountView.getOldPwd().getValue() + + " " + accountView.getNewPwd().getValue(); + + return result; + } + + public AccountPresenter(HandlerManager eventBus, AccountView accountView) { + this.eventBus = eventBus; + this.accountView = accountView; + } + + @Override + public void go(HasWidgets container) { + bind(); + container.clear(); + container.add(accountView.asWidget()); + init(); + } } diff --git a/src/main/java/eml/studio/client/mvp/presenter/AdminPresenter.java b/src/main/java/eml/studio/client/mvp/presenter/AdminPresenter.java index b36977a..86c3f14 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/AdminPresenter.java +++ b/src/main/java/eml/studio/client/mvp/presenter/AdminPresenter.java @@ -8,728 +8,169 @@ import eml.studio.client.event.LogoutEvent; import eml.studio.client.mvp.AppController; import eml.studio.client.mvp.view.AdminView; -import eml.studio.client.rpc.AccountService; -import eml.studio.client.rpc.AccountServiceAsync; -import eml.studio.client.rpc.CategoryService; -import eml.studio.client.rpc.CategoryServiceAsync; -import eml.studio.client.rpc.DatasetService; -import eml.studio.client.rpc.DatasetServiceAsync; -import eml.studio.client.rpc.ProgramService; -import eml.studio.client.rpc.ProgramServiceAsync; -import eml.studio.client.ui.panel.AlertPanel; -import eml.studio.client.ui.panel.CateAddPanel; -import eml.studio.client.ui.panel.CategoryPanel; -import eml.studio.client.util.Constants; -import eml.studio.client.util.TimeUtils; -import eml.studio.client.util.UUID; -import eml.studio.shared.model.Account; -import eml.studio.shared.model.Category; -import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.logical.shared.SelectionEvent; -import com.google.gwt.event.logical.shared.SelectionHandler; import com.google.gwt.event.shared.HandlerManager; -import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.History; -import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.HasWidgets; -import com.google.gwt.user.client.ui.Tree; -import com.google.gwt.user.client.ui.TreeItem; /** - * Backstage management - * + * Background management presenter */ public class AdminPresenter implements Presenter { - protected ProgramServiceAsync programService = GWT.create(ProgramService.class); - protected DatasetServiceAsync datasetService = GWT.create(DatasetService.class); - protected AccountServiceAsync accountService = GWT.create(AccountService.class); - protected CategoryServiceAsync categoryService = GWT.create(CategoryService.class); - protected CategoryPanel dataCatePanel = new CategoryPanel("data"); - protected CategoryPanel progCatePanel = new CategoryPanel("prog"); - protected CateAddPanel dataAddPanel = new CateAddPanel(); - protected CateAddPanel progAddPanel = new CateAddPanel(); - protected AlertPanel addAlert = new AlertPanel(); - final DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); - int progCurrentPage = 1; - int dataCurrentPage = 1; - int userCurrentPage = 1; - int cateCurrentPage = 1; - ProgramLoader programLoader; - DatasetLoader datasetLoader; - AccountLoader accountLoader; - CategoryLoader categoryLoader; - - private final HandlerManager eventBus; - private final AdminView adminView; - - public AdminPresenter(HandlerManager eventBus, AdminView adminView) { - this.eventBus = eventBus; - this.adminView = adminView; - } - - /** - * Init data - */ - public void init(){ - adminView.setAccount(AppController.username, AppController.email); - - if(AppController.email.equals("admin")){ - adminView.getWorkStage().getElement().getStyle().setDisplay(Display.NONE); - adminView.getWorkStage().getElement().removeAttribute("href"); + private ProgramLoader programLoader; + private DatasetLoader datasetLoader; + private AccountLoader accountLoader; + private CategoryLoader categoryLoader; + + private final HandlerManager eventBus; + private final AdminView adminView; + + public AdminPresenter(HandlerManager eventBus, AdminView adminView) { + this.eventBus = eventBus; + this.adminView = adminView; + bind(); } - - program(); - dataset(); - account(); - category(); - } - - /** - * Event binding - */ - public void bind() { - dataCatePanel.setTitle( Constants.adminUIMsg.chooseCate() ); - progCatePanel.setTitle( Constants.adminUIMsg.chooseCate() ); - progAddPanel.setTitle( Constants.adminUIMsg.addCate() ); - dataAddPanel.setTitle( Constants.adminUIMsg.addCate() ); - - //Program management - adminView.getUserProg().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - adminView.getProgGrid().setVisible(true); - adminView.getDataGrid().setVisible(false); - adminView.getUserGrid().setVisible(false); - adminView.getCatePanel().setVisible(false); - adminView.getProgPage().setVisible(true); - adminView.getDataPage().setVisible(false); - adminView.getUserPage().setVisible(false); - adminView.getCatePage().setVisible(false); - adminView.getUserProg().addStyleName("current"); - adminView.getUserData().removeStyleName("current"); - adminView.getUserList().removeStyleName("current"); - adminView.getCategory().removeStyleName("current"); - } - - }); - - //Data management - adminView.getUserData().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - adminView.getProgGrid().setVisible(false); - adminView.getDataGrid().setVisible(true); - adminView.getUserGrid().setVisible(false); - adminView.getCatePanel().setVisible(false); - adminView.getProgPage().setVisible(false); - adminView.getDataPage().setVisible(true); - adminView.getUserPage().setVisible(false); - adminView.getCatePage().setVisible(false); - adminView.getUserProg().removeStyleName("current"); - adminView.getUserData().addStyleName("current"); - adminView.getUserList().removeStyleName("current"); - adminView.getCategory().removeStyleName("current"); - } - - }); - - //User Management - adminView.getUserList().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - adminView.getProgGrid().setVisible(false); - adminView.getDataGrid().setVisible(false); - adminView.getUserGrid().setVisible(true); - adminView.getCatePanel().setVisible(false); - adminView.getProgPage().setVisible(false); - adminView.getDataPage().setVisible(false); - adminView.getUserPage().setVisible(true); - adminView.getCatePage().setVisible(false); - adminView.getUserProg().removeStyleName("current"); - adminView.getUserData().removeStyleName("current"); - adminView.getUserList().addStyleName("current"); - adminView.getCategory().removeStyleName("current"); - } - - }); - - //Catagory management - adminView.getCategory().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - adminView.getProgGrid().setVisible(false); - adminView.getDataGrid().setVisible(false); - adminView.getUserGrid().setVisible(false); - adminView.getCatePanel().setVisible(true); - adminView.getProgPage().setVisible(false); - adminView.getDataPage().setVisible(false); - adminView.getUserPage().setVisible(false); - adminView.getCatePage().setVisible(true); - adminView.getUserProg().removeStyleName("current"); - adminView.getUserData().removeStyleName("current"); - adminView.getUserList().removeStyleName("current"); - adminView.getCategory().addStyleName("current"); - } - - }); - - //work stage - adminView.getWorkStage().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.newItem("monitor"); - } - - }); - - //Personal information - adminView.getUserAnchor().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - if(!AppController.email.equals("admin")){ - History.newItem("account"); - } - } - - }); - - adminView.getLogout().addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - eventBus.fireEvent(new LogoutEvent()); - } - - }); - - //Add directory - program - adminView.getProgAdd().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - progAddPanel.show(); - } - }); - - //Add directory - data - adminView.getDataAdd().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - dataAddPanel.show(); - } - }); - - addAlert.getClose().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - progAddPanel.hide(); - dataAddPanel.hide(); - History.fireCurrentHistoryState(); - } - - }); - - addAlert.getConfirmBtn().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - progAddPanel.hide(); - dataAddPanel.hide(); - History.fireCurrentHistoryState(); - } - - }); - - progAddPanel.getFatherBox().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - progCatePanel.show(); - - Tree tree = progCatePanel.getCategoryTree(); - tree.addSelectionHandler(new SelectionHandler(){ - @Override - public void onSelection(SelectionEvent event) { - // TODO Auto-generated method stub - Boolean state = event.getSelectedItem().getState(); - if(!state){ - progCatePanel.hide(); - String cate_str = event.getSelectedItem().getText(); - if(cate_str.equals("共享程åº") || cate_str.toLowerCase().equals("shared program") - || cate_str.startsWith("我的程åº") || cate_str.toLowerCase().startsWith("my program") - || cate_str.equals("系统程åº") || cate_str.toLowerCase().equals("system program") ){ - progAddPanel.getFatherBox().setValue(cate_str); - }else{ - String sysPath = progCatePanel.getSysTreeCateMap().get(event.getSelectedItem()); - String shrPath = progCatePanel.getShrTreeCateMap().get(event.getSelectedItem()); - String myPath = progCatePanel.getMyTreeCateMap().get(event.getSelectedItem()); - if(sysPath != null){ - progAddPanel.getFatherBox().setValue(sysPath); - }else if(shrPath != null){ - progAddPanel.getFatherBox().setValue(shrPath); - }else if(myPath != null){ - progAddPanel.getFatherBox().setValue(myPath); - }else - progAddPanel.getFatherBox().setValue(null); - } - } - } - }); - } - - }); - - dataAddPanel.getFatherBox().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - dataCatePanel.show(); - - Tree tree = dataCatePanel.getCategoryTree(); - tree.addSelectionHandler(new SelectionHandler(){ - @Override - public void onSelection(SelectionEvent event) { - // TODO Auto-generated method stub - Boolean state = event.getSelectedItem().getState(); - if(!state){ - dataCatePanel.hide(); - String cate_str = event.getSelectedItem().getText(); - if(cate_str.equals("共享数æ®") || cate_str.toLowerCase().equals("shared data") - || cate_str.startsWith("我的数æ®") || cate_str.toLowerCase().startsWith("my data") - || cate_str.equals("系统数æ®") || cate_str.toLowerCase().equals("system data") ){ - dataAddPanel.getFatherBox().setValue(cate_str); - }else{ - String sysPath = dataCatePanel.getSysTreeCateMap().get(event.getSelectedItem()); - String shrPath = dataCatePanel.getShrTreeCateMap().get(event.getSelectedItem()); - String myPath = dataCatePanel.getMyTreeCateMap().get(event.getSelectedItem()); - if(sysPath != null){ - dataAddPanel.getFatherBox().setValue(sysPath); - }else if(shrPath != null){ - dataAddPanel.getFatherBox().setValue(shrPath); - }else if(myPath != null){ - dataAddPanel.getFatherBox().setValue(myPath); - }else - dataAddPanel.getFatherBox().setValue(null); - } - } - } - }); - } - - }); - - progAddPanel.getCancelBtn().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - addAlert.hide(); - dataCatePanel.hide(); - progCatePanel.hide(); - dataAddPanel.hide(); - progAddPanel.hide(); - progAddPanel.getNameBox().setValue(""); - progAddPanel.getFatherBox().setValue(""); - } - - }); - progAddPanel.getClose().addClickHandler(new ClickHandler(){ + @Override + public void go(HasWidgets container) { + container.clear(); + container.add(adminView.asWidget()); + init(); + } - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - addAlert.hide(); - dataCatePanel.hide(); - progCatePanel.hide(); - dataAddPanel.hide(); - progAddPanel.hide(); - progAddPanel.getNameBox().setValue(""); - progAddPanel.getFatherBox().setValue(""); - } + //Initialization + private void init(){ + adminView.setAccount(AppController.username, AppController.email); - }); - - dataAddPanel.getCancelBtn().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - addAlert.hide(); - dataCatePanel.hide(); - progCatePanel.hide(); - progAddPanel.hide(); - dataAddPanel.hide(); - dataAddPanel.getNameBox().setValue(""); - dataAddPanel.getFatherBox().setValue(""); + //Admin user have no workbench visit + if(AppController.email.equals("admin")){ + adminView.getWorkStage().getElement().getStyle().setDisplay(Display.NONE); + adminView.getWorkStage().getElement().removeAttribute("href"); } - - }); - - dataAddPanel.getClose().addClickHandler(new ClickHandler(){ - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - addAlert.hide(); - dataCatePanel.hide(); - progCatePanel.hide(); - progAddPanel.hide(); - dataAddPanel.hide(); - dataAddPanel.getNameBox().setValue(""); - dataAddPanel.getFatherBox().setValue(""); - } - - }); - - progAddPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + programLoader = new ProgramLoader(adminView); + datasetLoader = new DatasetLoader(adminView); + accountLoader = new AccountLoader(adminView); + categoryLoader = new CategoryLoader(adminView); + programLoader.go(); + } - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - String name = progAddPanel.getNameBox().getValue(); - String fathPath = progAddPanel.getFatherBox().getValue(); - - String path = fathPath + ">" + name; - if(name == "null" || "".equals(name)){ - progAddPanel.getNameErrorLabel().setText( Constants.adminUIMsg.alert1() ); - progAddPanel.getNameErrorLabel().setVisible(true); - progAddPanel.getFathErrorLabel().setVisible(false); - }else if(fathPath == "null" || "".equals(fathPath)){ - progAddPanel.getFathErrorLabel().setText( Constants.adminUIMsg.alert2() ); - progAddPanel.getNameErrorLabel().setVisible(false); - progAddPanel.getFathErrorLabel().setVisible(true); - }else{ - Category category = new Category(); - final String id = UUID.randomUUID(); - category.setId(id); - category.setName(name); - category.setType("prog"); - category.setPath(path); - category.setHaschild(false); - category.setCreatetime(TimeUtils.timeNow()); - categoryService.insertCategory(category, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - addAlert.setContent(caught.getMessage()); - addAlert.show(); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result.equals("success")){ - addAlert.setContent( Constants.adminUIMsg.alert3() ); - addAlert.show(); - }else if(result.startsWith("该目录")){ - addAlert.setContent(result); - addAlert.show(); - }else if(result.endsWith("insert failed")){ - addAlert.setContent( Constants.adminUIMsg.alert4() ); - addAlert.show(); - }else{ - addAlert.setContent( Constants.adminUIMsg.alert5() ); - addAlert.show(); - } - } - }); + private void bind() { + //Programs + adminView.getUserProg().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + adminView.getProgContent().setVisible(true); + adminView.getDataContent().setVisible(false); + adminView.getUserContent().setVisible(false); + adminView.getCateContent().setVisible(false); + adminView.getUserProg().addStyleName("current"); + adminView.getUserData().removeStyleName("current"); + adminView.getUserList().removeStyleName("current"); + adminView.getCategory().removeStyleName("current"); + programLoader.setSearchFlag(false); + programLoader.go(); } - } - - }); - - dataAddPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - String name = dataAddPanel.getNameBox().getValue(); - String fathPath = dataAddPanel.getFatherBox().getValue(); - - String path = fathPath + ">" + name; - if(name == "null" || "".equals(name)){ - dataAddPanel.getNameErrorLabel().setText( Constants.adminUIMsg.alert1() ); - dataAddPanel.getNameErrorLabel().setVisible(true); - dataAddPanel.getFathErrorLabel().setVisible(false); - }else if(fathPath == "null" || "".equals(fathPath)){ - dataAddPanel.getFathErrorLabel().setText( Constants.adminUIMsg.alert2() ); - dataAddPanel.getNameErrorLabel().setVisible(false); - dataAddPanel.getFathErrorLabel().setVisible(true); - }else{ - Category category = new Category(); - final String id = UUID.randomUUID(); - category.setId(id); - category.setName(name); - category.setType("data"); - category.setPath(path); - category.setHaschild(false); - category.setCreatetime(TimeUtils.timeNow()); - categoryService.insertCategory(category, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - addAlert.setContent(caught.getMessage()); - addAlert.show(); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result.equals("success")){ - addAlert.setContent( Constants.adminUIMsg.alert3() ); - addAlert.show(); - }else if(result.startsWith("该目录")){ - addAlert.setContent(result); - addAlert.show(); - }else if(result.endsWith("insert failed")){ - addAlert.setContent( Constants.adminUIMsg.alert4() ); - addAlert.show(); - }else{ - addAlert.setContent( Constants.adminUIMsg.alert5() ); - addAlert.show(); - } - } - }); + }); + + //Datasets + adminView.getUserData().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + adminView.getProgContent().setVisible(false); + adminView.getDataContent().setVisible(true); + adminView.getUserContent().setVisible(false); + adminView.getCateContent().setVisible(false); + adminView.getUserProg().removeStyleName("current"); + adminView.getUserData().addStyleName("current"); + adminView.getUserList().removeStyleName("current"); + adminView.getCategory().removeStyleName("current"); + datasetLoader.setSearchFlag(false); + datasetLoader.go(); } - } - - }); - } - - /** - * Load program - */ - public void program(){ - programService.getSize(new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - caught.getMessage(); - } - @Override - public void onSuccess(Integer result) { - // TODO Auto-generated method stub - - //Calculate page numbers, load paging and data - final int resultSize = result; - final int pageSize = (int)Math.ceil((double)result/13); - final int lastPage = pageSize; - programLoader = new ProgramLoader(adminView, progCurrentPage, lastPage, resultSize); - programLoader.pageLoader(pageSize); - programLoader.init(); - - //Page click response, reload page and data/ - adminView.getProgPage().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - int index = adminView.getProgPage().getCellForEvent(event).getCellIndex(); - String pageText = adminView.getProgPage().getText(0, index); - progCurrentPage = countPage(progCurrentPage, pageText, lastPage); - programLoader = new ProgramLoader(adminView, progCurrentPage, lastPage, resultSize); - programLoader.pageReloader(pageSize); - programLoader.init(); - } - - }); - } - }); - } - - /** - * Load dataset - */ - public void dataset(){ - datasetService.getSize(new AsyncCallback(){ + }); + + //Users + adminView.getUserList().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + adminView.getProgContent().setVisible(false); + adminView.getDataContent().setVisible(false); + adminView.getUserContent().setVisible(true); + adminView.getCateContent().setVisible(false); + adminView.getUserProg().removeStyleName("current"); + adminView.getUserData().removeStyleName("current"); + adminView.getUserList().addStyleName("current"); + adminView.getCategory().removeStyleName("current"); + accountLoader.setSearchFlag(false); + accountLoader.go(); + } - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - caught.getMessage(); - } + }); + + //Categories + adminView.getCategory().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + adminView.getProgContent().setVisible(false); + adminView.getDataContent().setVisible(false); + adminView.getUserContent().setVisible(false); + adminView.getCateContent().setVisible(true); + adminView.getUserProg().removeStyleName("current"); + adminView.getUserData().removeStyleName("current"); + adminView.getUserList().removeStyleName("current"); + adminView.getCategory().addStyleName("current"); + categoryLoader.setSearchFlag(false); + categoryLoader.go(); + } - @Override - public void onSuccess(Integer result) { - // TODO Auto-generated method stub - - //Calculate page numbers, load paging and data - final int resultSize = result; - final int pageSize = (int)Math.ceil((double)result/13); - final int lastPage = pageSize; - datasetLoader = new DatasetLoader(adminView, dataCurrentPage, lastPage, resultSize); - datasetLoader.pageLoader(pageSize); - datasetLoader.init(); - - //Page click response, reload page and data/ - adminView.getDataPage().addClickHandler(new ClickHandler(){ + }); - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - int index = adminView.getDataPage().getCellForEvent(event).getCellIndex(); - String pageText = adminView.getDataPage().getText(0, index); - dataCurrentPage = countPage(dataCurrentPage, pageText, lastPage); - datasetLoader = new DatasetLoader(adminView, dataCurrentPage, lastPage, resultSize); - datasetLoader.pageReloader(pageSize); - datasetLoader.init(); - } - - }); - } - }); - } + //WorkStage + adminView.getWorkStage().addClickHandler(new ClickHandler(){ - /** - * Load account - */ - public void account(){ - final Account account = new Account(); - account.setEmail(AppController.email); - accountService.getSize(account, new AsyncCallback(){ + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.newItem("monitor"); + } - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - caught.getMessage(); - } + }); - @Override - public void onSuccess(Integer result) { - // TODO Auto-generated method stub - - //Calculate page numbers, load paging and data - final int resultSize = result; - final int pageSize = (int)Math.ceil((double)result/13); - final int lastPage = pageSize; - accountLoader = new AccountLoader(adminView, userCurrentPage, lastPage, resultSize,account); - accountLoader.pageLoader(pageSize); - accountLoader.init(); - - //Page click response, reload page and data - adminView.getUserPage().addClickHandler(new ClickHandler(){ + //Account Information + adminView.getUserAnchor().addClickHandler(new ClickHandler(){ - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - int index = adminView.getUserPage().getCellForEvent(event).getCellIndex(); - String pageText = adminView.getUserPage().getText(0, index); - userCurrentPage = countPage(userCurrentPage, pageText, lastPage); - accountLoader = new AccountLoader(adminView, userCurrentPage, lastPage, resultSize,account); - accountLoader.pageReloader(pageSize); - accountLoader.init(); + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + if(!AppController.email.equals("admin")){ + History.newItem("account"); } - - }); - } - }); - } - - /** - * Load category - */ - public void category(){ - categoryService.getSize(new AsyncCallback(){ + } - @Override - public void onFailure(Throwable caught) { - caught.getMessage(); - } + }); - @Override - public void onSuccess(Integer result) { - //Calculate page numbers, load paging and data - final int resultSize = result; - final int pageSize = (int)Math.ceil((double)result/13); - final int lastPage = pageSize; - categoryLoader = new CategoryLoader(adminView, cateCurrentPage, lastPage, resultSize); - categoryLoader.pageLoader(pageSize); - categoryLoader.init(); - - //Page click response, reload page and data/ - adminView.getCatePage().addClickHandler(new ClickHandler(){ + //Logout + adminView.getLogout().addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - int index = adminView.getCatePage().getCellForEvent(event).getCellIndex(); - String pageText = adminView.getCatePage().getText(0, index); - cateCurrentPage = countPage(cateCurrentPage, pageText, lastPage); - categoryLoader = new CategoryLoader(adminView, cateCurrentPage, lastPage, resultSize); - categoryLoader.pageReloader(pageSize); - categoryLoader.init(); - } - - }); - } - - }); - } - - /** - * Calculate the current page number - * @param current Current page number - * @param pagetext Clickpage number - * @param lastpage Last page number - * @return current New current page number - */ - private static int countPage(int current, String pagetext, int lastpage){ - if(pagetext.equals( Constants.adminUIMsg.firstPage() )){ - current = 1; - }else if(pagetext.equals( Constants.adminUIMsg.prevPage() )){ - if(current > 1){ - current = current - 1; - }else{ - current = 1; + @Override + public void onClick(ClickEvent event) { + eventBus.fireEvent(new LogoutEvent()); } - }else if(pagetext.equals( Constants.adminUIMsg.nextPage() )){ - if(current < lastpage){ - current = current + 1; - }else{ - current = lastpage; - } - }else if(pagetext.equals( Constants.adminUIMsg.lastPage() )){ - current = lastpage; - }else{ - current = Integer.parseInt(pagetext); - } - return current; - } - - @Override - public void go(HasWidgets container) { - bind(); - container.clear(); - container.add(adminView.asWidget()); - init(); - } + }); + + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/mvp/presenter/BdaJobMonitor.java b/src/main/java/eml/studio/client/mvp/presenter/BdaJobMonitor.java index f3c5a5a..485d734 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/BdaJobMonitor.java +++ b/src/main/java/eml/studio/client/mvp/presenter/BdaJobMonitor.java @@ -5,6 +5,7 @@ */ package eml.studio.client.mvp.presenter; +import java.util.List; import java.util.logging.Logger; import eml.studio.client.controller.MonitorController; @@ -12,6 +13,7 @@ import eml.studio.client.rpc.JobServiceAsync; import eml.studio.client.util.TimeUtils; import eml.studio.shared.model.BdaJob; +import eml.studio.shared.oozie.OozieAction; import eml.studio.shared.oozie.OozieJob; import com.google.gwt.core.client.GWT; @@ -22,154 +24,223 @@ * Monitor class of EML job */ public class BdaJobMonitor { - protected static JobServiceAsync jobSrv = GWT.create(JobService.class); - - private static Logger logger = Logger.getLogger(BdaJobMonitor.class.getName()); - - private MonitorPresenter presenter = null; - private MonitorController controller = null; - - private int refressRate = 10000; - - /** - * This timer is used to update job status in refress rate - */ - private class UpdateJobTimer extends Timer { - private boolean canceled = true; - - @Override - public void run() { - logger.info("Timer was started..."); - updateCurrentJob(); - } - - @Override - public void scheduleRepeating(int periodMillis) { - super.scheduleRepeating(periodMillis); - canceled = false; - } - - @Override - public void cancel() { - if (!canceled) - super.cancel(); - canceled = true; - } - } - - private UpdateJobTimer updateJobTimer = new UpdateJobTimer(); - - - public BdaJobMonitor(MonitorPresenter presenter) { - this.presenter = presenter; - controller = presenter.getView().getController(); - } - - /** - * After submit bdajob, do monitor task - * @param bdaJob - */ - public void afterSubmit(BdaJob bdaJob){ - updateJobTimer.scheduleRepeating(refressRate); - (presenter).updateJobIFView(); - (controller).updateWgtCurOozJobId( bdaJob.getCurOozJobId() ); - updateCurrentJob(); - } - - /** - * According to the synchronization of the current oozJob - * update task view information - * @param oozJob - */ - private void updateView(OozieJob oozJob){ - final MonitorPresenter presenter = this.presenter; - - presenter.getView().getJobDescGrid().setJobStatus(oozJob.getStatus()); - String createdTime = TimeUtils.format(oozJob.getCreatedTime()); - presenter.getView().getJobDescGrid().setStartTime(createdTime); - String endTime = TimeUtils.format(oozJob.getEndTime()); - presenter.getView().getJobDescGrid().setEndTime( endTime ); - - String exeTime = TimeUtils.timeDiff( oozJob.getCreatedTime(), - oozJob.getEndTime() ); - if (exeTime == null) { - presenter.getView().getJobDescGrid().setUseTime(""); - } else { - presenter.getView().getJobDescGrid().setUseTime(exeTime); - } - } - - /** - * Update current Job - */ - public void updateCurrentJob() { - final MonitorPresenter presenter = this.presenter; - jobSrv.synCurOozJob( presenter.getCurrentJob().getJobId(), new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - logger.warning("job status getJob failed!"); - } - - @Override - public void onSuccess(OozieJob result) { - if( result.getActions() != null ){ - logger.info("Executed Actions Number: " + result.getActions().size()); - //Dynamically update oozJob related action - controller.updateWidgetStatus(result.getActions()); - }else{ - updateJobTimer.cancel(); - presenter.unlockSubmit(); - logger.info("Executed Actions is null"); - return; - } - //Update the task view - updateView(result); - //Update the current oozie Job - presenter.getCurrentJob().setCurOozJob( result ); - if (presenter.getCurrentJob().getCurOozJob().getEndTime() != null) { - updateJobTimer.cancel(); - presenter.unlockSubmit(); - logger.info("Timer was canceled"); - } - } - }); - - } - - /** - * Init current job - */ - public void initCurrentJob() { - final MonitorPresenter presenter = this.presenter; - jobSrv.getBdaJob( presenter.getCurrentJob().getJobId(), new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - logger.warning("job status getJob failed!"); - } - - @Override - public void onSuccess(BdaJob result) { - logger.info("init current job status"); - presenter.setCurrentJob(result); - //First loaded, update all programWidget - controller.updateWidgetStatus(result.getActions()); - //Set the view information - updateView(result.getCurOozJob()); - //If there is no end time, the scheduled update is initiated - if (presenter.getCurrentJob().getCurOozJob().getEndTime() == null) { - updateJobTimer.scheduleRepeating(refressRate); - }else{ - presenter.unlockSubmit(); - } - } - }); - - } - - public void afterDAGBuild() { - presenter.updateJobIFView(); - initCurrentJob(); - } + protected static JobServiceAsync jobSrv = GWT.create(JobService.class); + + private static Logger logger = Logger.getLogger(BdaJobMonitor.class.getName()); + + private MonitorPresenter presenter = null; + private MonitorController controller = null; + + private int refressRate = 10000; + + /** + * This timer is used to update job status in refress rate + */ + private class UpdateJobTimer extends Timer { + private boolean canceled = true; + + @Override + public void run() { + logger.info("Timer was started..."); + updateCurrentJob(); + } + + @Override + public void scheduleRepeating(int periodMillis) { + super.scheduleRepeating(periodMillis); + canceled = false; + } + + @Override + public void cancel() { + if (!canceled) + super.cancel(); + canceled = true; + } + } + + private UpdateJobTimer updateJobTimer = new UpdateJobTimer(); + + + public BdaJobMonitor(MonitorPresenter presenter) { + this.presenter = presenter; + controller = presenter.getView().getController(); + } + + /** + * After submit bdajob, do monitor task + * @param bdaJob + */ + public void afterSubmit(BdaJob bdaJob){ + updateJobTimer.scheduleRepeating(refressRate); + (presenter).updateJobIFView(); + (controller).updateWgtCurOozJobId( bdaJob.getCurOozJobId() ); + updateCurrentJob(); + } + + /** + * According to the synchronization of the current oozJob + * update task view information + * @param oozJob + */ + private void updateView(OozieJob oozJob){ + final MonitorPresenter presenter = this.presenter; + + presenter.getView().getJobDescGrid().setJobStatus(oozJob.getStatus()); + String createdTime = TimeUtils.format(oozJob.getCreatedTime()); + presenter.getView().getJobDescGrid().setStartTime(createdTime); + String endTime = TimeUtils.format(oozJob.getEndTime()); + presenter.getView().getJobDescGrid().setEndTime( endTime ); + + String exeTime = TimeUtils.timeDiff( oozJob.getCreatedTime(), + oozJob.getEndTime() ); + if (exeTime == null) { + presenter.getView().getJobDescGrid().setUseTime(""); + } else { + presenter.getView().getJobDescGrid().setUseTime(exeTime); + } + } + + /** + * Update current Job + */ + public void updateCurrentJob() { + final MonitorPresenter presenter = this.presenter; + if(presenter.isInstanceFlag()) //OozieJob instance + { + jobSrv.synCurOozJobByOozId( presenter.getCurrentOozieJob().getId(), new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + logger.warning("job status getJob failed!"); + } + + @Override + public void onSuccess(OozieJob result) { + if( result.getActions() != null ){ + logger.info("Executed Actions Number: " + result.getActions().size()); + //Update oozie job related action dynamically + controller.updateWidgetStatus(result.getActions()); + }else{ + updateJobTimer.cancel(); + presenter.unlockSubmit(); + logger.info("Executed Actions is null"); + return; + } + //Update job view + updateView(result); + //Update the current oozie job + presenter.setCurrentOozieJob(result); + presenter.getCurrentJob().setCurOozJob( result ); + if (presenter.getCurrentOozieJob().getEndTime() != null) { + updateJobTimer.cancel(); + presenter.unlockSubmit(); + logger.info("Timer was canceled"); + } + } + }); + }else{ + jobSrv.synCurOozJob( presenter.getCurrentJob().getJobId(), new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + logger.warning("job status getJob failed!"); + } + + @Override + public void onSuccess(OozieJob result) { + if( result.getActions() != null ){ + logger.info("Executed Actions Number: " + result.getActions().size()); + //Dynamically update oozJob related action + controller.updateWidgetStatus(result.getActions()); + }else{ + updateJobTimer.cancel(); + presenter.unlockSubmit(); + logger.info("Executed Actions is null"); + return; + } + //Update the job view + updateView(result); + //Update the current oozie Job + presenter.getCurrentJob().setCurOozJob( result ); + if (presenter.getCurrentJob().getCurOozJob().getEndTime() != null) { + updateJobTimer.cancel(); + presenter.unlockSubmit(); + logger.info("Timer was canceled"); + } + } + }); + } + + } + + /** + * Init current job + */ + public void initCurrentJob() { + final MonitorPresenter presenter = this.presenter; + if(presenter.isInstanceFlag()) + { + //Get non latest submit action + final List curActions = presenter.getNonLatestAction(presenter.getCurrentOozieJob().getGraph()); + jobSrv.getSynOozieJob( presenter.getCurrentOozieJob().getId(), new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + logger.warning("job status getJob failed!"); + } + + @Override + public void onSuccess(OozieJob result) { + logger.info("init current oozie job status"); + presenter.setCurrentOozieJob(result); + //Current view action include other job finished instance action and submit action + curActions.addAll(result.getActions()); + result.setActions(curActions); + controller.updateWidgetStatus(result.getActions()); + //Update the job view + updateView(result); + //If the current oozie job has not finished, then start timer to update the status + if (presenter.getCurrentOozieJob().getEndTime() == null) { + updateJobTimer.scheduleRepeating(refressRate); + }else{ + presenter.unlockSubmit(); + } + } + }); + }else{ + jobSrv.getBdaJob( presenter.getCurrentJob().getJobId(), new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + logger.warning("job status getJob failed!"); + } + + @Override + public void onSuccess(BdaJob result) { + logger.info("init current job status"); + presenter.setCurrentJob(result); + //First loaded, update all programWidget + controller.updateWidgetStatus(result.getActions()); + //Set the view information + updateView(result.getCurOozJob()); + //If there is no end time, the scheduled update is initiated + if (presenter.getCurrentJob().getCurOozJob().getEndTime() == null) { + updateJobTimer.scheduleRepeating(refressRate); + }else{ + presenter.unlockSubmit(); + } + } + }); + } + + } + + public void afterDAGBuild() { + if(presenter.isInstanceFlag()) + presenter.updateOozieJobIFView(); + else + presenter.updateJobIFView(); + initCurrentJob(); + } } diff --git a/src/main/java/eml/studio/client/mvp/presenter/CategoryLoader.java b/src/main/java/eml/studio/client/mvp/presenter/CategoryLoader.java index 617a665..d45622a 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/CategoryLoader.java +++ b/src/main/java/eml/studio/client/mvp/presenter/CategoryLoader.java @@ -6,6 +6,7 @@ package eml.studio.client.mvp.presenter; import java.util.List; + import eml.studio.client.mvp.view.AdminView; import eml.studio.client.rpc.CategoryService; import eml.studio.client.rpc.CategoryServiceAsync; @@ -14,346 +15,992 @@ import eml.studio.client.rpc.ProgramService; import eml.studio.client.rpc.ProgramServiceAsync; import eml.studio.client.ui.panel.AlertPanel; +import eml.studio.client.ui.panel.CateAddPanel; +import eml.studio.client.ui.panel.CategoryPanel; import eml.studio.client.ui.panel.DeletePanel; import eml.studio.client.util.Constants; +import eml.studio.client.util.Pagination; +import eml.studio.client.util.TimeUtils; +import eml.studio.client.util.UUID; import eml.studio.shared.model.Category; + import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Grid; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Label; - +import com.google.gwt.user.client.ui.Tree; +import com.google.gwt.user.client.ui.TreeItem; /** * Load Directory management page data - * */ public class CategoryLoader { - private final AdminView adminView; - protected CategoryServiceAsync categoryService = GWT.create(CategoryService.class); - protected ProgramServiceAsync programService = GWT.create(ProgramService.class); - protected DatasetServiceAsync datasetService = GWT.create(DatasetService.class); - protected DeletePanel deletePanel = new DeletePanel(); - protected AlertPanel deleteAlert = new AlertPanel(); - int currentPage = 1; - int lastPage; - int headStart; - int tailStart; - int resultSize; - int resultStart; - int everyPageSize; - final Label first = new Label( Constants.adminUIMsg.firstPage() ); - final Label prev = new Label( Constants.adminUIMsg.prevPage() ); - final Label next = new Label( Constants.adminUIMsg.nextPage() ); - final Label last = new Label( Constants.adminUIMsg.lastPage() ); - - public CategoryLoader(AdminView adminView, int currentPage, int lastPage, int resultSize) { - this.adminView = adminView; - this.currentPage = currentPage; - this.lastPage = lastPage; - this.resultSize = resultSize; - } - - /** - * Load data - */ - public void init() { - deleteAlert.getClose().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.fireCurrentHistoryState(); - } - - }); - - deleteAlert.getConfirmBtn().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - History.fireCurrentHistoryState(); - } - - }); - - //Calculate the number of records per page - resultStart = (currentPage-1)*13; - if(currentPage == lastPage){ - everyPageSize = resultSize - resultStart; - }else{ - everyPageSize = 13; + private final AdminView adminView; + private CategoryServiceAsync categoryService = GWT.create(CategoryService.class); + private ProgramServiceAsync programService = GWT.create(ProgramService.class); + private DatasetServiceAsync datasetService = GWT.create(DatasetService.class); + private CateAddPanel progAddPanel = new CateAddPanel(); + private CategoryPanel progCatePanel = new CategoryPanel("prog"); + private CateAddPanel dataAddPanel = new CateAddPanel(); + private CategoryPanel dataCatePanel = new CategoryPanel("data"); + private DeletePanel deletePanel = new DeletePanel(); + private AlertPanel addAlert = new AlertPanel(); + private AlertPanel deleteAlert = new AlertPanel(); + private AlertPanel searchAlert = new AlertPanel(); + private int currentPage = 1; + private int pageSize; + private int lastPage; + private int resultSize; + private int resultStart; + private int everyPageSize; + private Grid page = new Grid(); + private Pagination pagination; + private Category searchCategory; + private String searchName; + private String searchPath; + private boolean searchFlag = false; + + + public CategoryLoader(AdminView adminView) { + this.adminView = adminView; + bind(); } - //Set the header - adminView.getCateGrid().resize(everyPageSize+1, 4); - adminView.getCateGrid().setText(0, 0, "Name"); - adminView.getCateGrid().setText(0, 1, "Path"); - adminView.getCateGrid().setText(0, 2, "Create Time"); - adminView.getCateGrid().setText(0, 3, "Operation"); - - //Get category info - categoryService.getCategory(resultStart, everyPageSize, new AsyncCallback>(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - deleteAlert.setContent(caught.getMessage()); - deleteAlert.show(); - } + public void go(){ + init(); + } + + /** + * Event bind + */ + private void bind(){ + + addAlert.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + progAddPanel.hide(); + dataAddPanel.hide(); + History.fireCurrentHistoryState(); + } + + }); + + addAlert.getConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + progAddPanel.hide(); + dataAddPanel.hide(); + History.fireCurrentHistoryState(); + } + + }); + + deleteAlert.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.fireCurrentHistoryState(); + } + + }); + + deleteAlert.getConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + History.fireCurrentHistoryState(); + } + + }); + + adminView.getProgAdd().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + progAddPanel.show(); + } + }); - @Override - public void onSuccess(List result) { - // TODO Auto-generated method stub - for(int i=0;i(){ + @Override + public void onSelection(SelectionEvent event) { + // TODO Auto-generated method stub + Boolean state = event.getSelectedItem().getState(); + if(!state){ + progCatePanel.hide(); + String cate_str = event.getSelectedItem().getText(); + if(cate_str.equals("共享程åº") || cate_str.toLowerCase().equals("shared program") + || cate_str.startsWith("我的程åº") || cate_str.toLowerCase().startsWith("my program") + || cate_str.equals("系统程åº") || cate_str.toLowerCase().equals("system program") ){ + progAddPanel.getFatherBox().setValue(cate_str); + }else{ + String sysPath = progCatePanel.getSysTreeCateMap().get(event.getSelectedItem()); + String shrPath = progCatePanel.getShrTreeCateMap().get(event.getSelectedItem()); + String myPath = progCatePanel.getMyTreeCateMap().get(event.getSelectedItem()); + if(sysPath != null){ + progAddPanel.getFatherBox().setValue(sysPath); + }else if(shrPath != null){ + progAddPanel.getFatherBox().setValue(shrPath); + }else if(myPath != null){ + progAddPanel.getFatherBox().setValue(myPath); + }else + progAddPanel.getFatherBox().setValue(null); + } + } + } + }); + } + + }); + + progAddPanel.getCancelBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + addAlert.hide(); + dataCatePanel.hide(); + progCatePanel.hide(); + dataAddPanel.hide(); + progAddPanel.hide(); + progAddPanel.getNameBox().setValue(""); + progAddPanel.getFatherBox().setValue(""); + } + + }); + + progAddPanel.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + addAlert.hide(); + dataCatePanel.hide(); + progCatePanel.hide(); + dataAddPanel.hide(); + progAddPanel.hide(); + progAddPanel.getNameBox().setValue(""); + progAddPanel.getFatherBox().setValue(""); + } + + }); + + progAddPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + String name = progAddPanel.getNameBox().getValue(); + String fathPath = progAddPanel.getFatherBox().getValue(); + + String path = fathPath + ">" + name; + if(name == "null" || "".equals(name)){ + progAddPanel.getNameErrorLabel().setText( Constants.adminUIMsg.alert1() ); + progAddPanel.getNameErrorLabel().setVisible(true); + progAddPanel.getFathErrorLabel().setVisible(false); + }else if(fathPath == "null" || "".equals(fathPath)){ + progAddPanel.getFathErrorLabel().setText( Constants.adminUIMsg.alert2() ); + progAddPanel.getNameErrorLabel().setVisible(false); + progAddPanel.getFathErrorLabel().setVisible(true); }else{ - adminView.getCateGrid().setText(i + 1, 1, result.get(i).getPath()); + Category category = new Category(); + final String id = UUID.randomUUID(); + category.setId(id); + category.setName(name); + category.setType("prog"); + category.setPath(path); + category.setHaschild(false); + category.setCreatetime(TimeUtils.timeNow()); + categoryService.insertCategory(category, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + addAlert.setContent(caught.getMessage()); + addAlert.show(); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result.equals("success")){ + addAlert.setContent( Constants.adminUIMsg.alert3() ); + addAlert.show(); + }else if(result.startsWith("该目录")){ + addAlert.setContent(result); + addAlert.show(); + }else if(result.endsWith("insert failed")){ + addAlert.setContent( Constants.adminUIMsg.alert4() ); + addAlert.show(); + }else{ + addAlert.setContent( Constants.adminUIMsg.alert5() ); + addAlert.show(); + } + } + }); } - adminView.getCateGrid().setText(i + 1, 2, result.get(i).getCreatetime()); - final String cateName = result.get(i).getName(); - final String cateType = result.get(i).getType(); - final String catePath = result.get(i).getPath(); - final String fathId = result.get(i).getFatherid(); - Label deleteCate = new Label(); - deleteCate.setTitle( Constants.adminUIMsg.deleteCate() ); - deleteCate.addStyleName("admin-user-delete"); - deleteCate.addClickHandler(new ClickHandler() { + } + + }); + dataAddPanel.getFatherBox().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + dataCatePanel.show(); + + Tree tree = dataCatePanel.getCategoryTree(); + tree.addSelectionHandler(new SelectionHandler(){ @Override - public void onClick(ClickEvent event) { + public void onSelection(SelectionEvent event) { // TODO Auto-generated method stub - deletePanel.setContent( Constants.adminUIMsg.delete1() + cateName + Constants.adminUIMsg.delete2() ); - deletePanel.show(); - deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + Boolean state = event.getSelectedItem().getState(); + if(!state){ + dataCatePanel.hide(); + String cate_str = event.getSelectedItem().getText(); + if(cate_str.equals("共享数æ®") || cate_str.toLowerCase().equals("shared data") + || cate_str.startsWith("我的数æ®") || cate_str.toLowerCase().startsWith("my data") + || cate_str.equals("系统数æ®") || cate_str.toLowerCase().equals("system data") ){ + dataAddPanel.getFatherBox().setValue(cate_str); + }else{ + String sysPath = dataCatePanel.getSysTreeCateMap().get(event.getSelectedItem()); + String shrPath = dataCatePanel.getShrTreeCateMap().get(event.getSelectedItem()); + String myPath = dataCatePanel.getMyTreeCateMap().get(event.getSelectedItem()); + if(sysPath != null){ + dataAddPanel.getFatherBox().setValue(sysPath); + }else if(shrPath != null){ + dataAddPanel.getFatherBox().setValue(shrPath); + }else if(myPath != null){ + dataAddPanel.getFatherBox().setValue(myPath); + }else + dataAddPanel.getFatherBox().setValue(null); + } + } + } + }); + } - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - Category category = new Category(); - category.setType(cateType); - categoryService.getCategory(category, "and path = '"+catePath+"' or path like '"+catePath+"%'", new AsyncCallback>(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - deletePanel.hide(); - deleteAlert.setContent(caught.getMessage()); - deleteAlert.show(); - } - - @Override - public void onSuccess(List result) { - // TODO Auto-generated method stub - if(result != null){ - for(Category category : result){ - Category delete = new Category(); - delete.setId(category.getId()); - final String cateType = category.getType(); - final String oldCate = category.getId(); - categoryService.deleteCategory(delete, new AsyncCallback(){ - - @Override - public void onFailure( - Throwable caught) { - // TODO Auto-generated method stub - deletePanel.hide(); - deleteAlert.setContent(caught.getMessage()); - deleteAlert.show(); - } - - @Override - public void onSuccess(Category result) { - // TODO Auto-generated method stub - if(result == null){ - if(cateType.equals("data")){ - datasetService.editCategory(oldCate, fathId, new AsyncCallback(){ - - @Override - public void onFailure( - Throwable caught) { - // TODO Auto-generated method stub - caught.getMessage(); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result == "success"){ - deletePanel.hide(); - deleteAlert.setContent( Constants.adminUIMsg.delete3() ); - deleteAlert.show(); - }else{ - deletePanel.hide(); - deleteAlert.setContent(result); - deleteAlert.show(); + }); + + dataAddPanel.getCancelBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + addAlert.hide(); + dataCatePanel.hide(); + progCatePanel.hide(); + progAddPanel.hide(); + dataAddPanel.hide(); + dataAddPanel.getNameBox().setValue(""); + dataAddPanel.getFatherBox().setValue(""); + } + + }); + + dataAddPanel.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + addAlert.hide(); + dataCatePanel.hide(); + progCatePanel.hide(); + progAddPanel.hide(); + dataAddPanel.hide(); + dataAddPanel.getNameBox().setValue(""); + dataAddPanel.getFatherBox().setValue(""); + } + + }); + + dataAddPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + String name = dataAddPanel.getNameBox().getValue(); + String fathPath = dataAddPanel.getFatherBox().getValue(); + + String path = fathPath + ">" + name; + if(name == "null" || "".equals(name)){ + dataAddPanel.getNameErrorLabel().setText( Constants.adminUIMsg.alert1() ); + dataAddPanel.getNameErrorLabel().setVisible(true); + dataAddPanel.getFathErrorLabel().setVisible(false); + }else if(fathPath == "null" || "".equals(fathPath)){ + dataAddPanel.getFathErrorLabel().setText( Constants.adminUIMsg.alert2() ); + dataAddPanel.getNameErrorLabel().setVisible(false); + dataAddPanel.getFathErrorLabel().setVisible(true); + }else{ + Category category = new Category(); + final String id = UUID.randomUUID(); + category.setId(id); + category.setName(name); + category.setType("data"); + category.setPath(path); + category.setHaschild(false); + category.setCreatetime(TimeUtils.timeNow()); + categoryService.insertCategory(category, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + addAlert.setContent(caught.getMessage()); + addAlert.show(); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result.equals("success")){ + addAlert.setContent( Constants.adminUIMsg.alert3() ); + addAlert.show(); + }else if(result.startsWith("该目录")){ + addAlert.setContent(result); + addAlert.show(); + }else if(result.endsWith("insert failed")){ + addAlert.setContent( Constants.adminUIMsg.alert4() ); + addAlert.show(); + }else{ + addAlert.setContent( Constants.adminUIMsg.alert5() ); + addAlert.show(); + } + } + }); + } + } + + }); + + adminView.getCateSearch().addDomHandler(new KeyUpHandler() { + @Override + public void onKeyUp(KeyUpEvent event) { + if(event.getNativeKeyCode()== 13){ + adminView.getCateSearchBtn().click(); + } + } + }, KeyUpEvent.getType()); + + adminView.getCateSearchBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + //Clear last search account object information before a new search + searchCategory = new Category(); + searchFlag = true; + + //Get search information and save to searchAccount object + searchName = adminView.getCateName().getValue(); + searchPath = adminView.getCatePath().getValue(); + + if(searchName != ""){ + searchCategory.setName(searchName); + }else{ + searchCategory.setName(null); + } + if(searchPath != ""){ + searchCategory.setPath(searchPath); + }else{ + searchCategory.setPath(null); + } + + //If all the input is empty, prompt user enter input information. If is not , then begin searching + if(searchName == "" && searchPath == ""){ + searchAlert.setContent( Constants.adminUIMsg.searchNoInput() ); + searchAlert.show(); + }else{ + searchResult(); + } + } + + }); + + + page.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + int index = page.getCellForEvent(event).getCellIndex(); + String crtPageText = page.getText(0, index); + currentPage = pagination.getCurrentPage(currentPage, crtPageText, lastPage); + pagination.reload(currentPage); + if(searchFlag){ //Show search results + reload(); + }else //Show all results + load(); + } + + }); + } + + /** + * Initialization + */ + private void init(){ + progCatePanel.getChange().setVisible(false); + progAddPanel.setTitle( Constants.adminUIMsg.addCate() ); + progCatePanel.setTitle( Constants.adminUIMsg.chooseCate() ); + dataCatePanel.getChange().setVisible(false); + dataAddPanel.setTitle( Constants.adminUIMsg.addCate() ); + dataCatePanel.setTitle( Constants.adminUIMsg.chooseCate() ); + currentPage = 1; + + clearInput(); + adminView.getCatePage().clear(); + page.addStyleName("admin-page"); + adminView.getCatePage().add(page); + + categoryService.getSize(new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); + } + + @Override + public void onSuccess(Integer result) { + // TODO Auto-generated method stub + //Caculate page-related information, initialize and load paging controls + resultSize = result; + pageSize = (int)Math.ceil((double)result/13); + lastPage = pageSize; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + //Load user data + load(); + } + + }); + } + + /** + * Load data into the page + */ + private void load() { + resultStart = (currentPage-1)*13; + if(currentPage == lastPage){ + everyPageSize = resultSize - resultStart; + }else{ + everyPageSize = 13; + } + + adminView.getCateGrid().resize(everyPageSize+1, 4); + adminView.getCateGrid().setText(0, 0, "Name"); + adminView.getCateGrid().setText(0, 1, "Path"); + adminView.getCateGrid().setText(0, 2, "Create Time"); + adminView.getCateGrid().setText(0, 3, "Operation"); + + categoryService.getCategory(resultStart, everyPageSize, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deleteAlert.setContent(caught.getMessage()); + deleteAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + for(int i=0;i>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + deleteAlert.setContent(caught.getMessage()); + deleteAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result != null){ + for(Category category : result){ + Category delete = new Category(); + delete.setId(category.getId()); + final String cateType = category.getType(); + final String oldCate = category.getId(); + categoryService.deleteCategory(delete, new AsyncCallback(){ + + @Override + public void onFailure( + Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + deleteAlert.setContent(caught.getMessage()); + deleteAlert.show(); + } + + @Override + public void onSuccess(Category result) { + // TODO Auto-generated method stub + if(result == null){ + if(cateType.equals("data")){ + datasetService.editCategory(oldCate, fathId, new AsyncCallback(){ + + @Override + public void onFailure( + Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); } - } - - }); - }else{ - programService.editCategory(oldCate, fathId, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - caught.getMessage(); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result == "success"){ - deletePanel.hide(); - deleteAlert.setContent( Constants.adminUIMsg.delete3() ); - deleteAlert.show(); - }else{ - deletePanel.hide(); - deleteAlert.setContent(result); - deleteAlert.show(); + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result == "success"){ + deletePanel.hide(); + deleteAlert.setContent( Constants.adminUIMsg.delete3() ); + deleteAlert.show(); + }else{ + deletePanel.hide(); + deleteAlert.setContent(result); + deleteAlert.show(); + } + } + + }); + }else{ + programService.editCategory(oldCate, fathId, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); } - } - - }); + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result == "success"){ + deletePanel.hide(); + deleteAlert.setContent( Constants.adminUIMsg.delete3() ); + deleteAlert.show(); + }else{ + deletePanel.hide(); + deleteAlert.setContent(result); + deleteAlert.show(); + } + } + + }); + } } } - } - }); + }); + } + }else{ + deletePanel.hide(); + deleteAlert.setContent( Constants.adminUIMsg.delete4() ); + deleteAlert.show(); } - }else{ - deletePanel.hide(); - deleteAlert.setContent( Constants.adminUIMsg.delete4() ); - deleteAlert.show(); } - } - - }); + + }); + } + }); + } + }); + HorizontalPanel operate = new HorizontalPanel(); + operate.addStyleName("admin-user"); + operate.add(deleteCate); + adminView.getCateGrid().setWidget(i + 1, 3, operate); + } + } + }); + } + + /** + * Load search result and reset paging control + */ + private void searchResult(){ + adminView.getCatePage().clear(); //Clear paging area and reload + adminView.getCatePage().add(page); + categoryService.search(searchCategory, 0, 0, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result.size() == 0){ + String newPath = changeCategory(searchCategory.getPath()); + if(newPath != null){ + searchCategory.setPath(newPath); + categoryService.search(searchCategory, 0, 0, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result.size() == 0){ + searchAlert.setContent( Constants.adminUIMsg.searchNoResult() ); + searchAlert.show(); + }else{ + resultSize = result.size(); + pageSize = (int)Math.ceil((double)result.size()/13); + lastPage = pageSize; + currentPage = 1; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + reload(); + } + } + }); + }else{ + searchAlert.setContent( Constants.adminUIMsg.searchNoResult() ); + searchAlert.show(); } - }); - HorizontalPanel operate = new HorizontalPanel(); - operate.addStyleName("admin-user"); - operate.add(deleteCate); - adminView.getCateGrid().setWidget(i + 1, 3, operate); + }else{ + resultSize = result.size(); + pageSize = (int)Math.ceil((double)result.size()/13); + lastPage = pageSize; + currentPage = 1; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + reload(); + } } - } - }); - } - - /** - * Frist load page loader - * - * @param pageSize - */ - public void pageLoader(int pageSize){ - if(pageSize>20){ - headStart = 1; - tailStart = lastPage - 9; - adminView.getCatePage().resize(1, 25); - adminView.getCatePage().setWidget(0, 0, first); - adminView.getCatePage().setWidget(0, 1, prev); - for(int count=2;count<12;count++){ - adminView.getCatePage().setWidget(0, count, new Label(headStart+"")); - headStart++; - } - adminView.getCatePage().setText(0, 12, "..."); - for(int count=13;count<23;count++){ - adminView.getCatePage().setWidget(0, count, new Label(tailStart+"")); - tailStart++; - } - adminView.getCatePage().setWidget(0, 23, next); - adminView.getCatePage().setWidget(0, 24, last); - }else{ - adminView.getCatePage().resize(1, pageSize+4); - adminView.getCatePage().setWidget(0, 0, first); - adminView.getCatePage().setWidget(0, 1, prev); - for(int count=2;count 20){ - if(currentPage == 1 || currentPage == lastPage){ - headStart = 1; - tailStart = lastPage - 9; + + /** + * Reload search result to the page + */ + private void reload(){ + resultStart = (currentPage-1)*13; + if(currentPage == lastPage){ + everyPageSize = resultSize - resultStart; }else{ - if(currentPage > 9 && (currentPage+9)>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deleteAlert.setContent(caught.getMessage()); + deleteAlert.show(); } - adminView.getCatePage().setWidget(0, 23, next); - adminView.getCatePage().setWidget(0, 24, last); - if(currentPage>=Integer.parseInt(adminView.getCatePage().getText(0, 2))&¤tPage<=Integer.parseInt(adminView.getCatePage().getText(0, 11))){ - adminView.getCatePage().getWidget(0, currentPage+1).removeStyleName("gwt-Label"); - adminView.getCatePage().getWidget(0, currentPage+1).addStyleName("admin-page-selected"); - }else if(currentPage>=Integer.parseInt(adminView.getCatePage().getText(0, 13))&¤tPage<=Integer.parseInt(adminView.getCatePage().getText(0, 22))){ - int stylePage = (currentPage - Integer.parseInt(adminView.getCatePage().getText(0, 13)))+13; - adminView.getCatePage().getWidget(0, stylePage).removeStyleName("gwt-Label"); - adminView.getCatePage().getWidget(0, stylePage).addStyleName("admin-page-selected"); + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + for(int i=0;i>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + deleteAlert.setContent(caught.getMessage()); + deleteAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result != null){ + for(Category category : result){ + Category delete = new Category(); + delete.setId(category.getId()); + final String cateType = category.getType(); + final String oldCate = category.getId(); + categoryService.deleteCategory(delete, new AsyncCallback(){ + + @Override + public void onFailure( + Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + deleteAlert.setContent(caught.getMessage()); + deleteAlert.show(); + } + + @Override + public void onSuccess(Category result) { + // TODO Auto-generated method stub + if(result == null){ + if(cateType.equals("data")){ + datasetService.editCategory(oldCate, fathId, new AsyncCallback(){ + + @Override + public void onFailure( + Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result == "success"){ + deletePanel.hide(); + deleteAlert.setContent( Constants.adminUIMsg.delete3() ); + deleteAlert.show(); + }else{ + deletePanel.hide(); + deleteAlert.setContent(result); + deleteAlert.show(); + } + } + + }); + }else{ + programService.editCategory(oldCate, fathId, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result == "success"){ + deletePanel.hide(); + deleteAlert.setContent( Constants.adminUIMsg.delete3() ); + deleteAlert.show(); + }else{ + deletePanel.hide(); + deleteAlert.setContent(result); + deleteAlert.show(); + } + } + + }); + } + } + } + }); + } + }else{ + deletePanel.hide(); + deleteAlert.setContent( Constants.adminUIMsg.delete4() ); + deleteAlert.show(); + } + } + + }); + } + }); + } + }); + HorizontalPanel operate = new HorizontalPanel(); + operate.addStyleName("admin-user"); + operate.add(deleteCate); + adminView.getCateGrid().setWidget(i + 1, 3, operate); + } } - } - }else{ - if(currentPage > 0 && currentPage < (pageSize + 1)){ - adminView.getCatePage().clear(); - adminView.getCatePage().resize(1, pageSize+4); - adminView.getCatePage().setWidget(0, 0, first); - adminView.getCatePage().setWidget(0, 1, prev); - for(int count=2;count"); + String tmp = arr[0]; + if(tmp.equals("我的程åº")){ + newPath = "My Program"; + for(int i=1;i>(){ + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result.size() == 0){ + Category tc = new Category(); + tc.setPath(changeCategory(searchPath)); + categoryService.getCategory(tc, "", new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); + } + + @Override + public void onSuccess(List result) { + if(result.size() == 0){ + searchAlert.setContent( Constants.adminUIMsg.searchCateError() ); + searchAlert.show(); + }else{ + searchDataset.setCategory( result.get(0).getId() ); + searchResult(); + } + } + }); + }else{ + searchDataset.setCategory( result.get(0).getId() ); + searchResult(); + } + } + }); + } + } + } + + }); + + page.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + int index = page.getCellForEvent(event).getCellIndex(); + String crtPageText = page.getText(0, index); + currentPage = pagination.getCurrentPage(currentPage, crtPageText, lastPage); + pagination.reload(currentPage); + if(searchFlag){ + reload(); + }else + load(); + } + + }); + } + + /** + * Initialization + */ + private void init(){ + clearInput(); + adminView.getDataPage().clear(); + page.addStyleName("admin-page"); + adminView.getDataPage().add(page); + currentPage = 1; + + datasetService.getSize(new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); + } + + @Override + public void onSuccess(Integer result) { + // TODO Auto-generated method stub + resultSize = result; + pageSize = (int)Math.ceil((double)result/13); + lastPage = pageSize; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); - }); - - resultStart = (currentPage-1)*13; - if(currentPage == lastPage){ - everyPageSize = resultSize - resultStart; - }else{ - everyPageSize = 13; + load(); + } + }); } - - //Reset the table row number and set the header - adminView.getDataGrid().resize(everyPageSize+1, 7); - adminView.getDataGrid().setText(0, 0, "Name"); - adminView.getDataGrid().setText(0, 1, "Category"); - adminView.getDataGrid().setText(0, 2, "Description"); - adminView.getDataGrid().setText(0, 3, "Version"); - adminView.getDataGrid().setText(0, 4, "CreateDate"); - adminView.getDataGrid().setText(0, 5, "Owner"); - adminView.getDataGrid().setText(0, 6, "Operation"); - - //Get the data into the form - datasetService.loadPart(resultStart, everyPageSize, new AsyncCallback>(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - alertPanel.setContent(caught.getMessage()); - alertPanel.show(); + + /** + * Loading data to the page + */ + private void load() { + resultStart = (currentPage-1)*13; + if(currentPage == lastPage){ + everyPageSize = resultSize - resultStart; + }else{ + everyPageSize = 13; } - @Override - public void onSuccess(List result) { - // TODO Auto-generated method stub - for(int i=0;i(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - adminView.getDataGrid().setText(a+1, 1, categoryId); - } - + adminView.getDataGrid().resize(everyPageSize+1, 7); + adminView.getDataGrid().setText(0, 0, "Name"); + adminView.getDataGrid().setText(0, 1, "Category"); + adminView.getDataGrid().setText(0, 2, "Description"); + adminView.getDataGrid().setText(0, 3, "Version"); + adminView.getDataGrid().setText(0, 4, "CreateDate"); + adminView.getDataGrid().setText(0, 5, "Owner"); + adminView.getDataGrid().setText(0, 6, "Operation"); + + datasetService.loadPart(resultStart, everyPageSize, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + for(int i=0;i(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + adminView.getDataGrid().setText(a+1, 1, categoryId); + } + + @Override + public void onSuccess(Category result) { + // TODO Auto-generated method stub + if(result != null){ + adminView.getDataGrid().setText(a+1, 1, result.getPath()); + }else + adminView.getDataGrid().setText(a+1, 1, "————"); + } + + }); + } + if(result.get(i).getDescription().length() > 50){ + adminView.getDataGrid().setText(i+1, 2, result.get(i).getDescription().substring(0, 49)+"..."); + }else{ + adminView.getDataGrid().setText(i+1, 2, result.get(i).getDescription()); + } + adminView.getDataGrid().setText(i+1, 3, result.get(i).getVersion()); + adminView.getDataGrid().setText(i+1, 4, result.get(i).getCreatedate()); + adminView.getDataGrid().setText(i+1, 5, result.get(i).getOwner()); + + final String dataId = result.get(i).getId(); + final String dataName = result.get(i).getName(); + Label deleteData = new Label(); + deleteData.setTitle( Constants.adminUIMsg.deleteData() ); + deleteData.addStyleName("admin-user-delete"); + deleteData.addClickHandler(new ClickHandler() { + @Override - public void onSuccess(Category result) { + public void onClick(ClickEvent event) { // TODO Auto-generated method stub - if(result != null){ - adminView.getDataGrid().setText(a+1, 1, result.getPath()); - }else - adminView.getDataGrid().setText(a+1, 1, "————"); + deletePanel.setContent( Constants.adminUIMsg.dataDelete1() + dataName + Constants.adminUIMsg.dataDelete2() ); + deletePanel.show(); + deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + Dataset dataset = new Dataset(); + dataset.setId(dataId); + datasetService.delete(dataId, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(Void result) { + // TODO Auto-generated method stub + deletePanel.hide(); + alertPanel.setContent( Constants.adminUIMsg.dataSuccess() ); + alertPanel.show(); + } + + }); + } + + }); } - + }); + HorizontalPanel operate = new HorizontalPanel(); + operate.addStyleName("admin-user"); + operate.add(deleteData); + adminView.getDataGrid().setWidget(i + 1, 6, operate); } - if(result.get(i).getDescription().length() > 50){ - adminView.getDataGrid().setText(i+1, 2, result.get(i).getDescription().substring(0, 49)+"..."); + } + }); + } + + /** + * Load search result and reset paging control + */ + private void searchResult(){ + adminView.getDataPage().clear(); + adminView.getDataPage().add(page); + datasetService.search(searchDataset, searchStart, searchEnd, 0, 0, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result.size() == 0){ + searchAlert.setContent( Constants.adminUIMsg.searchNoResult()); + searchAlert.show(); }else{ - adminView.getDataGrid().setText(i+1, 2, result.get(i).getDescription()); + resultSize = result.size(); + pageSize = (int)Math.ceil((double)result.size()/13); + lastPage = pageSize; + currentPage = 1; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + reload(); } - adminView.getDataGrid().setText(i+1, 3, result.get(i).getVersion()); - adminView.getDataGrid().setText(i+1, 4, result.get(i).getCreatedate()); - adminView.getDataGrid().setText(i+1, 5, result.get(i).getOwner()); - - final String dataId = result.get(i).getId(); - final String dataName = result.get(i).getName(); - Label deleteData = new Label(); - deleteData.setTitle( Constants.adminUIMsg.deleteData() ); - deleteData.addStyleName("admin-user-delete"); - deleteData.addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - deletePanel.setContent( Constants.adminUIMsg.dataDelete1() + dataName + Constants.adminUIMsg.dataDelete2() ); - deletePanel.show(); - deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + } + + }); + } + + /** + * Reload search result to the page + */ + private void reload(){ + resultStart = (currentPage-1)*13; + if(currentPage == lastPage){ //Every page show 13 records, if the last page has less than 13 records, it show real records + everyPageSize = resultSize - resultStart; + }else{ + everyPageSize = 13; + } + + adminView.getDataGrid().resize(everyPageSize+1, 7); + adminView.getDataGrid().setText(0, 0, "Name"); + adminView.getDataGrid().setText(0, 1, "Category"); + adminView.getDataGrid().setText(0, 2, "Description"); + adminView.getDataGrid().setText(0, 3, "Version"); + adminView.getDataGrid().setText(0, 4, "CreateDate"); + adminView.getDataGrid().setText(0, 5, "Owner"); + adminView.getDataGrid().setText(0, 6, "Operation"); + + datasetService.search(searchDataset,searchStart,searchEnd,resultStart, everyPageSize, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + for(int i=0;i(){ @Override - public void onClick(ClickEvent event) { + public void onFailure(Throwable caught) { // TODO Auto-generated method stub - Dataset dataset = new Dataset(); - dataset.setId(dataId); - datasetService.delete(dataId, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - deletePanel.hide(); - alertPanel.setContent(caught.getMessage()); - alertPanel.show(); - } - - @Override - public void onSuccess(Void result) { - // TODO Auto-generated method stub - deletePanel.hide(); - alertPanel.setContent( Constants.adminUIMsg.dataSuccess() ); - alertPanel.show(); - } - - }); + adminView.getDataGrid().setText(a+1, 1, categoryId); + } + + @Override + public void onSuccess(Category result) { + // TODO Auto-generated method stub + if(result != null){ + adminView.getDataGrid().setText(a+1, 1, result.getPath()); + }else + adminView.getDataGrid().setText(a+1, 1, "————"); } }); } + if(result.get(i).getDescription().length() > 50){ + adminView.getDataGrid().setText(i+1, 2, result.get(i).getDescription().substring(0, 49)+"..."); + }else{ + adminView.getDataGrid().setText(i+1, 2, result.get(i).getDescription()); + } + adminView.getDataGrid().setText(i+1, 3, result.get(i).getVersion()); + adminView.getDataGrid().setText(i+1, 4, result.get(i).getCreatedate()); + adminView.getDataGrid().setText(i+1, 5, result.get(i).getOwner()); + + final String dataId = result.get(i).getId(); + final String dataName = result.get(i).getName(); + Label deleteData = new Label(); + deleteData.setTitle( Constants.adminUIMsg.deleteData() ); + deleteData.addStyleName("admin-user-delete"); + deleteData.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + deletePanel.setContent( Constants.adminUIMsg.dataDelete1() + dataName + Constants.adminUIMsg.dataDelete2() ); + deletePanel.show(); + deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + Dataset dataset = new Dataset(); + dataset.setId(dataId); + datasetService.delete(dataId, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(Void result) { + // TODO Auto-generated method stub + deletePanel.hide(); + alertPanel.setContent( Constants.adminUIMsg.dataSuccess() ); + alertPanel.show(); + } + + }); + } + + }); + } - }); - HorizontalPanel operate = new HorizontalPanel(); - operate.addStyleName("admin-user"); - operate.add(deleteData); - adminView.getDataGrid().setWidget(i + 1, 6, operate); + }); + HorizontalPanel operate = new HorizontalPanel(); + operate.addStyleName("admin-user"); + operate.add(deleteData); + adminView.getDataGrid().setWidget(i + 1, 6, operate); + } } - } - }); - } - - /** - * Load page loader - * - * @param pageSize - */ - public void pageLoader(int pageSize){ - if(pageSize>20){ - headStart = 1; - tailStart = lastPage - 9; - adminView.getDataPage().resize(1, 25); - adminView.getDataPage().setWidget(0, 0, first); - adminView.getDataPage().setWidget(0, 1, prev); - for(int count=2;count<12;count++){ - adminView.getDataPage().setWidget(0, count, new Label(headStart+"")); - headStart++; - } - adminView.getDataPage().setText(0, 12, "..."); - for(int count=13;count<23;count++){ - adminView.getDataPage().setWidget(0, count, new Label(tailStart+"")); - tailStart++; - } - adminView.getDataPage().setWidget(0, 23, next); - adminView.getDataPage().setWidget(0, 24, last); - }else{ - adminView.getDataPage().resize(1, pageSize+4); - adminView.getDataPage().setWidget(0, 0, first); - adminView.getDataPage().setWidget(0, 1, prev); - for(int count=2;count 20){ - if(currentPage == 1 || currentPage == lastPage){ - headStart = 1; - tailStart = lastPage - 9; - }else{ - if(currentPage > 9 && (currentPage+9)"); + String tmp = arr[0]; + String newPath = null; + if(tmp.equals("我的数æ®")){ + newPath = "My Data"; + for(int i=1;i=Integer.parseInt(adminView.getDataPage().getText(0, 2))&¤tPage<=Integer.parseInt(adminView.getDataPage().getText(0, 11))){ - adminView.getDataPage().getWidget(0, currentPage+1).removeStyleName("gwt-Label"); - adminView.getDataPage().getWidget(0, currentPage+1).addStyleName("admin-page-selected"); - }else if(currentPage>=Integer.parseInt(adminView.getDataPage().getText(0, 13))&¤tPage<=Integer.parseInt(adminView.getDataPage().getText(0, 22))){ - int stylePage = (currentPage - Integer.parseInt(adminView.getDataPage().getText(0, 13)))+13; - adminView.getDataPage().getWidget(0, stylePage).removeStyleName("gwt-Label"); - adminView.getDataPage().getWidget(0, stylePage).addStyleName("admin-page-selected"); + }else if(tmp.toLowerCase().equals("system data")){ + newPath = "系统数æ®"; + for(int i=1;i 0 && currentPage < (pageSize + 1)){ - adminView.getDataPage().resize(1, pageSize+4); - adminView.getDataPage().setWidget(0, 0, first); - adminView.getDataPage().setWidget(0, 1, prev); - for(int count=2;count event) { // new a job view.getNewJobPopup().getSubmitBtn() - .addClickHandler(new ClickHandler() { + .addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - if (view.getNewJobPopup().getJobName().equals("")) { - view.getNewJobPopup().setErrorMsg("Task name can not be empty"); - } else { - view.getJobDescGrid().setJobName( - view.getNewJobPopup().getJobName()); - view.getJobDescGrid().setDescription( - view.getNewJobPopup().getJobDesc()); - view.getNewJobPopup().hide(); - try { - submit(); - } catch (ValueInvalidException e) { - Window.alert(e.getMessage()); - e.printStackTrace(); - } - } + @Override + public void onClick(ClickEvent event) { + if (view.getNewJobPopup().getJobName().equals("")) { + view.getNewJobPopup().setErrorMsg("Task name can not be empty"); + } else { + view.getJobDescGrid().setJobName( + view.getNewJobPopup().getJobName()); + view.getJobDescGrid().setDescription( + view.getNewJobPopup().getJobDesc()); + view.getNewJobPopup().hide(); + try { + submit(); + } catch (ValueInvalidException e) { + Window.alert(e.getMessage()); + e.printStackTrace(); } + } + } - }); + }); view.getParamPopup().addSubmitHandler(new ClickHandler() { @@ -232,6 +271,21 @@ public void onClick(ClickEvent event) { pw.getPropertyTable().addParameterPanel(paramPopup.getPanel()); } }); + + getView().getHistoryButton().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + if(currentJob.getJobId()!=null) + { + getView().getHistoryPopup(currentJob.getJobId(),currentJob.getIsExample(),eventBus).center(); + } + else + Window.alert("There is no job instance in the workspace, you can not view the historyï¼"); + } + + }); } @@ -239,29 +293,29 @@ public void afterDAGBuild() { this.bdaJobMonitor.afterDAGBuild(); } - /** - * Lock submit button - */ + /** + * Lock submit button + */ public void lockSubmit() { this.getView().getSubmitButton().setEnabled(false); this.getView().getController().lockDrawConnection(); } - /** - * Unlock submit button - */ + /** + * Unlock submit button + */ public void unlockSubmit() { this.getView().getSubmitButton().setEnabled(true); this.getView().getController().unlockDrawConnection(); } - /** - * Submit a job to Server - * @throws ValueInvalidException - */ + /** + * Submit a job to Server + * @throws ValueInvalidException + */ private void submit() throws ValueInvalidException { // The workflow must be generated before graphDescribe - // because the middle is generated during this process + // because the middle is generated during this process // The uuid of the file is generated before the graphDescribe will be generated without the middle file name. MonitorController controller = view.getController(); @@ -280,40 +334,46 @@ private void submit() throws ValueInvalidException { bdaJobId = currentJob.getJobId(); } - lockSubmit(); - view.getController().lockWidgetParameterPanel(graph.getActiveList()); + if(graph.getActiveList().size()>0) + { - jobSrv.submit(view.getJobDescGrid().getJobName(), bdaJobId, graph, - account, jobDesc, new AsyncCallback() { + lockSubmit(); + view.getController().lockWidgetParameterPanel(graph.getActiveList()); - @Override - public void onFailure(Throwable caught) { - Window.alert("submit failed!"); + jobSrv.submit(view.getJobDescGrid().getJobName(), bdaJobId, graph, + account, jobDesc, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert("submit failed!"); + unlockSubmit(); + view.getController().unlockWidgetParameterPanel( + graph.getActiveList()); + } + + @Override + public void onSuccess(BdaJob result) { + if (result == null) { + Window.alert("submit failed"); unlockSubmit(); view.getController().unlockWidgetParameterPanel( graph.getActiveList()); } + currentJob = result; + view.getController().reflushWidgetStatus( + graph.getActiveList()); + bdaJobMonitor.afterSubmit(result); + } - @Override - public void onSuccess(BdaJob result) { - if (result == null) { - Window.alert("submit failed"); - unlockSubmit(); - view.getController().unlockWidgetParameterPanel( - graph.getActiveList()); - } - currentJob = result; - view.getController().reflushWidgetStatus( - graph.getActiveList()); - bdaJobMonitor.afterSubmit(result); - } - - }); + }); + }else{ + Window.alert("The job is finished, there is no action to execute!"); + } } - /** - * Clone current job to a new job - */ + /** + * Clone current job to a new job + */ private void cloneCurJob() { String cloneJobId = currentJob.getJobId(); @@ -342,9 +402,9 @@ public void onSuccess(BdaJob result) { } } - /** - * Clear current Job - */ + /** + * Clear current Job + */ public void clearCurrentJob() { BdaJob cloneJob = new BdaJob(); OozieJob oozJob = new OozieJob(); @@ -353,31 +413,64 @@ public void clearCurrentJob() { currentJob = cloneJob; } - /** - * Init job - */ + /** + * Init job + */ private void loadInitJob() { - final String jobid = currentJob.getJobId(); - if (jobid != null && !jobid.equals("undefined")) { - jobSrv.getJob(jobid, new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - logger.warning(caught.getMessage()); - } + String jobid = currentJob.getJobId(); + if(instanceFlag) + { + final String curOozieJobId = currentOozieJob.getId(); + if (curOozieJobId != null && !curOozieJobId.equals("undefined")) { + jobSrv.getOozieJob(curOozieJobId, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning(caught.getMessage()); + } - @Override - public void onSuccess(BdaJob result) { - currentJob = result; - diagramBuilder.rebuildDAG(result.getOozieGraph(), false); - } - }); + @Override + public void onSuccess(OozieJob result) { + currentOozieJob = result; + currentJob.setCurOozJob(currentOozieJob); + diagramBuilder.rebuildDAG(result.getGraph(), false); + } + }); + } + if (jobid != null && !jobid.equals("undefined")) { + jobSrv.getJob(jobid, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning(caught.getMessage()); + } + + @Override + public void onSuccess(BdaJob result) { + currentJob = result; + } + }); + } + }else{ + if (jobid != null && !jobid.equals("undefined")) { + jobSrv.getJob(jobid, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + logger.warning(caught.getMessage()); + } + + @Override + public void onSuccess(BdaJob result) { + currentJob = result; + diagramBuilder.rebuildDAG(result.getOozieGraph(), false); + } + }); + } } } - /** - * Update Job info View - */ + /** + * Update Job info View + */ public void updateJobIFView() { if (currentJob == null) return; @@ -390,9 +483,9 @@ public void updateJobIFView() { getView().getJobDescGrid().setJobStatus( currentJob.getCurOozJob().getStatus()); getView().getJobDescGrid() - .setStartTime( - TimeUtils.format(currentJob.getCurOozJob() - .getCreatedTime())); + .setStartTime( + TimeUtils.format(currentJob.getCurOozJob() + .getCreatedTime())); getView().getJobDescGrid().setEndTime( TimeUtils.format(currentJob.getCurOozJob().getEndTime())); getView().getJobDescGrid().setDescription( @@ -407,6 +500,77 @@ public void updateJobIFView() { } } + + /** + * If is oozie job instance, the view should be updated to oozie job + */ + public void updateOozieJobIFView() { + + if (currentJob == null) + return; + getView().getJobDescGrid().setEmailAccount(currentJob.getAccount()); + getView().getJobDescGrid().setBdaJobID(currentJob.getJobId()); + + if (currentOozieJob != null) { + getView().getJobDescGrid().setJobName( + currentOozieJob.getAppName()); + getView().getJobDescGrid().setJobStatus( + currentOozieJob.getStatus()); + getView().getJobDescGrid() + .setStartTime( + TimeUtils.format(currentOozieJob + .getCreatedTime())); + getView().getJobDescGrid().setEndTime( + TimeUtils.format(currentOozieJob.getEndTime())); + getView().getJobDescGrid().setDescription( + currentOozieJob.getDescription()); + String exeTime = TimeUtils.timeDiff(currentOozieJob + .getCreatedTime(), currentOozieJob.getEndTime()); + if (exeTime == null) { + getView().getJobDescGrid().setUseTime(""); + } else { + getView().getJobDescGrid().setUseTime(exeTime); + } + } + } + + /** + * Get oozie actions which are not belong to current graph(When the workflow is submitted, the finished action can not be written to the workflow) + * + * @param graph + * @return + */ + public List getNonLatestAction(OozieGraph graph) + { + final List nonLatestActions = new ArrayList(); + List pNodes = graph.getProgramNodes(); + for(OozieProgramNode pNode : pNodes) + { + String actionName = pNode.getId(); + String oozieJobId = pNode.getOozJobId(); + if(oozieJobId.toLowerCase().contains("latest")) + continue; + else + { + jobSrv.getOozieAction(oozieJobId, actionName, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning(caught.getMessage()); + } + + @Override + public void onSuccess(OozieAction result) { + // TODO Auto-generated method stub + nonLatestActions.add(result); + } + + }); + } + } + return nonLatestActions; + } public View getView() { return view; @@ -427,34 +591,40 @@ public BdaJob getCurrentJob() { public void setCurrentJob(BdaJob currentJob) { this.currentJob = currentJob; } + + public OozieJob getCurrentOozieJob() { + return currentOozieJob; + } + + public void setCurrentOozieJob(OozieJob currentOozieJob) { + this.currentOozieJob = currentOozieJob; + } + + public boolean isInstanceFlag() { + return instanceFlag; + } + + public void setInstanceFlag(boolean instanceFlag) { + this.instanceFlag = instanceFlag; + } /** * View interface */ public interface View { - /** - * Clear button of the paint - */ + Button getClearButton(); - /** - * Job submit button - */ Button getSubmitButton(); + Button getRefreshButton(); Button getCloneButton(); Button getStopButton(); - Button getSuspendButton(); - - Button getResumeButton(); - HeaderView getHeaderView(); - // EditDatasetPanel getEditDataPanel(); - TabPanel getTabPanel(); ProgramTree getProgramTree(); @@ -476,9 +646,16 @@ public interface View { MonitorController getController(); Widget asWidget(); + DiagramController getNowDiagramColler(); + void setPropTable(PropertyTable propertyTable); + void clearPropTable(); + + Button getHistoryButton(); + + HistoryPopupPanel getHistoryPopup(String jobId,boolean isExample, HandlerManager eventBus); } } diff --git a/src/main/java/eml/studio/client/mvp/presenter/Presenter.java b/src/main/java/eml/studio/client/mvp/presenter/Presenter.java index 5ad8a47..dac7e61 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/Presenter.java +++ b/src/main/java/eml/studio/client/mvp/presenter/Presenter.java @@ -11,5 +11,5 @@ * Presenter interface */ public interface Presenter { - void go(final HasWidgets container); + void go(final HasWidgets container); } diff --git a/src/main/java/eml/studio/client/mvp/presenter/ProgramLoader.java b/src/main/java/eml/studio/client/mvp/presenter/ProgramLoader.java index a1ab34b..e8b6219 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/ProgramLoader.java +++ b/src/main/java/eml/studio/client/mvp/presenter/ProgramLoader.java @@ -1,8 +1,3 @@ -/** - * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. - * Licensed under the terms of the Apache 2.0 license. - * Please see LICENSE file in the project root for terms - */ package eml.studio.client.mvp.presenter; import java.util.List; @@ -14,52 +9,66 @@ import eml.studio.client.ui.panel.AlertPanel; import eml.studio.client.ui.panel.DeletePanel; import eml.studio.client.util.Constants; +import eml.studio.client.util.Pagination; import eml.studio.shared.model.Category; import eml.studio.shared.model.Program; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Grid; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Label; /** - * Load the program manages the page data + * åŽå°ç®¡ç†-程åºç®¡ç† 内容加载 * + * @author madongjing */ public class ProgramLoader { + private final AdminView adminView; - protected ProgramServiceAsync programService = GWT.create(ProgramService.class); - protected CategoryServiceAsync cateogryService = GWT.create(CategoryService.class); - protected AlertPanel alertPanel = new AlertPanel(); - protected DeletePanel deletePanel = new DeletePanel(); - final DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); - int currentPage = 1; - int lastPage; - int headStart; - int tailStart; - int resultSize; - int resultStart; - int everyPageSize; - final Label first = new Label( Constants.adminUIMsg.firstPage() ); - final Label prev = new Label( Constants.adminUIMsg.prevPage() ); - final Label next = new Label( Constants.adminUIMsg.nextPage() ); - final Label last = new Label( Constants.adminUIMsg.lastPage() ); - - public ProgramLoader(AdminView adminView, int currentPage, int lastPage, int resultSize) { + private ProgramServiceAsync programService = GWT.create(ProgramService.class); + private CategoryServiceAsync categoryService = GWT.create(CategoryService.class); + private DeletePanel deletePanel = new DeletePanel(); //é¢æ¿ï¼šç¡®è®¤æ˜¯å¦åˆ é™¤ç›®å½• + private AlertPanel alertPanel = new AlertPanel(); //æ示框:æ“作æˆåŠŸor失败 + private AlertPanel searchAlert = new AlertPanel(); //æ示框:æœç´¢ç»“æžœæ示 + private final DateTimeFormat formatter = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); + private int currentPage = 1; //以下为页ç ç›¸å…³ä¿¡æ¯ + private int pageSize; + private int lastPage; + private int resultSize; + private int resultStart; + private int everyPageSize; + private Grid page = new Grid(); //分页控件放置区域 + private Pagination pagination; //分页控件 + private Program searchProgram; //以下为ä¿å­˜æœç´¢è¾“å…¥çš„ä¿¡æ¯ + private String searchName; + private String searchPath; + private String searchStart = null; + private String searchEnd = null; + private String searchOwner; + private boolean searchFlag = false; //true表示æœç´¢ç»“æžœ false表示所有结果 用æ¥åŒºåˆ†åˆ†é¡µæŽ§ä»¶è¦å“应哪一个数æ®åŠ è½½å‡½æ•°load()&reload() + + + public ProgramLoader(AdminView adminView) { this.adminView = adminView; - this.currentPage = currentPage; - this.lastPage = lastPage; - this.resultSize = resultSize; + bind(); + } + + public void go(){ + init(); } /** - * Init - */ - public void init() { - //close button + * 事件绑定 + */ + public void bind(){ + //æ示框-关闭 alertPanel.getClose().addClickHandler(new ClickHandler(){ @Override @@ -67,10 +76,10 @@ public void onClick(ClickEvent event) { // TODO Auto-generated method stub History.fireCurrentHistoryState(); } - + }); - - //confirm button + + //æ示框-确认 alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ @Override @@ -78,18 +87,199 @@ public void onClick(ClickEvent event) { // TODO Auto-generated method stub History.fireCurrentHistoryState(); } - + }); + +// //æœç´¢æ示框-关闭 +// searchAlert.getClose().addClickHandler(new ClickHandler(){ +// +// @Override +// public void onClick(ClickEvent event) { +// // TODO Auto-generated method stub +// //刷新当å‰é¡µ +// } +// +// }); +// +// //æœç´¢æ示框-确认 +// searchAlert.getConfirmBtn().addClickHandler(new ClickHandler(){ +// +// @Override +// public void onClick(ClickEvent event) { +// // TODO Auto-generated method stub +// //刷新当å‰é¡µ +// } +// +// }); + + //æœç´¢å›žè½¦é”®å“应 + adminView.getProgSearch().addDomHandler(new KeyUpHandler() { + @Override + public void onKeyUp(KeyUpEvent event) { + if(event.getNativeKeyCode()== 13){ + adminView.getProgSearchBtn().click(); + } + } + }, KeyUpEvent.getType()); + + //æœç´¢æŒ‰é’®å“应 + adminView.getProgSearchBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + //æœç´¢å‰å…ˆæ¸…ç†ä¸Šæ¬¡æœç´¢ä¿å­˜çš„searchProgramå¯¹è±¡ä¿¡æ¯ + searchProgram = new Program(); + searchFlag = true; + + //获å–此次æœç´¢è¾“å…¥çš„ä¿¡æ¯ ä¿å­˜åˆ°searchProgram对象中 + searchName = adminView.getProgName().getValue(); + searchOwner = adminView.getProgOwner().getValue(); + searchPath = adminView.getProgCate().getValue(); + + if(searchName != ""){ + searchProgram.setName(searchName); + }else{ + searchProgram.setName(null); + } + if(searchOwner != ""){ + searchProgram.setOwner(searchOwner); + }else{ + searchProgram.setOwner(null); + } + + if( adminView.getProgStartDate().getValue() != null ){ + searchStart = formatter.format( adminView.getProgStartDate().getValue() ); + }else{ + searchStart = null; + } + if( adminView.getProgEndDate().getValue() != null ){ + searchEnd = formatter.format( adminView.getProgEndDate().getValue() ); + }else{ + searchEnd = null; + } + + //若所有输入框å‡ä¸ºç©º 则æ示需è¦è¾“å…¥ è‹¥éžå‡ç©ºåˆ™è¿›è¡Œæœç´¢ + if(searchName == "" && searchPath == "" && searchOwner == "" && searchStart == null && searchEnd == null){ + searchAlert.setContent( Constants.adminUIMsg.searchNoInput() ); + searchAlert.show(); + }else{ + //è‹¥searchPath为空 则直接æœç´¢ éžç©ºåˆ™éœ€è¦åœ¨æœç´¢æ— ç»“果时转æ¢ä¸€ä¸‹category pathå†æœç´¢ + if(searchPath == ""){ + searchResult(); + }else{ + Category category = new Category(); + category.setPath(searchPath); + categoryService.getCategory(category, "", new AsyncCallback>(){ + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + //查询category path是å¦å­˜åœ¨ ä¸å­˜åœ¨æ—¶éœ€è¦è½¬æ¢åŽå†æŸ¥è¯¢ä¸€ä¸‹ï¼ˆå› category根目录在数æ®åº“中是中英文混åˆä¿å­˜çš„) + if(result.size() == 0){ + Category tc = new Category(); + tc.setPath(changeCategory(searchPath)); + categoryService.getCategory(tc, "", new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); + } + + @Override + public void onSuccess(List result) { + if(result.size() == 0){ //转æ¢åŽå†æŸ¥è¯¢ä¾ç„¶ä¸å­˜åœ¨ 则æ示目录出错 + searchAlert.setContent( Constants.adminUIMsg.searchCateError() ); + searchAlert.show(); + }else{ //转æ¢åŽå†æŸ¥è¯¢å­˜åœ¨ 则获å–category id 并æœç´¢ + searchProgram.setCategory( result.get(0).getId() ); + searchResult(); + } + } + }); + }else{ //查询category path是å¦å­˜åœ¨ 存在则获å–category id 并æœç´¢ + searchProgram.setCategory( result.get(0).getId() ); + searchResult(); + } + } + }); + } + } + } - //Calculate the number of records per page + }); + + //页ç ç‚¹å‡»å“应 + page.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + int index = page.getCellForEvent(event).getCellIndex(); + String crtPageText = page.getText(0, index); + currentPage = pagination.getCurrentPage(currentPage, crtPageText, lastPage); + pagination.reload(currentPage); + if(searchFlag){ //searchFlag=true å³æ˜¾ç¤ºæœç´¢ç»“æžœ 调用reload() + reload(); + }else //searchFlag=false å³æ˜¾ç¤ºæ‰€æœ‰ç»“æžœ 调用load() + load(); + } + + }); + } + + /** + * 程åºç®¡ç†é¡µåˆå§‹åŒ– æ•°æ®åˆåŠ è½½ + */ + private void init(){ + clearInput(); //清除输入框内容 + adminView.getProgPage().clear(); //清除分页区域内容 é‡æ–°åŠ è½½åˆ†é¡µæŽ§ä»¶ + page.addStyleName("admin-page"); + adminView.getProgPage().add(page); + currentPage = 1; + + programService.getSize(new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + caught.getMessage(); + } + + @Override + public void onSuccess(Integer result) { + // TODO Auto-generated method stub + //计算页ç ç›¸å…³ä¿¡æ¯ åˆå§‹åŒ–并加载分页控件 + resultSize = result; + pageSize = (int)Math.ceil((double)result/13); + lastPage = pageSize; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + //åŠ è½½ç”¨æˆ·æ•°æ® + load(); + } + }); + } + + /** + * åŠ è½½æ•°æ® å¡«å…¥é¡µé¢ + */ + private void load() { resultStart = (currentPage-1)*13; - if(currentPage == lastPage){ + if(currentPage == lastPage){ //满页æ¯é¡µæ˜¾ç¤º13æ¡è®°å½• 尾页ä¸è¶³13æ¡æ—¶è®¡ç®—一下实际æ¡æ•° everyPageSize = resultSize - resultStart; }else{ everyPageSize = 13; } - //Reset the table row number to set the header adminView.getProgGrid().resize(everyPageSize+1, 6); adminView.getProgGrid().setText(0, 0, "Name"); adminView.getProgGrid().setText(0, 1, "Category"); @@ -98,7 +288,6 @@ public void onClick(ClickEvent event) { adminView.getProgGrid().setText(0, 4, "Owner"); adminView.getProgGrid().setText(0, 5, "Operation"); - //Get the user information to fill in the form programService.loadPart(resultStart, everyPageSize, new AsyncCallback>(){ @Override @@ -122,7 +311,7 @@ public void onSuccess(List result) { || ("系统程åº").equals(categoryId) || ("system program").equals(categoryId.toLowerCase()) ){ adminView.getProgGrid().setText(a+1, 1, categoryId); }else{ - cateogryService.getCategory(categoryId, new AsyncCallback(){ + categoryService.getCategory(categoryId, new AsyncCallback(){ @Override public void onFailure(Throwable caught) { @@ -200,117 +389,223 @@ public void onSuccess(Void result) { } }); } - + /** - * Load page loader - * - * @param pageSize - */ - public void pageLoader(int pageSize){ - if(pageSize>20){ - headStart = 1; - tailStart = lastPage - 9; - adminView.getProgPage().resize(1, 25); - adminView.getProgPage().setWidget(0, 0, first); - adminView.getProgPage().setWidget(0, 1, prev); - for(int count=2;count<12;count++){ - adminView.getProgPage().setWidget(0, count, new Label(headStart+"")); - headStart++; + * æœç´¢ é‡ç½®åˆ†é¡µæŽ§ä»¶ 加载æœç´¢ç»“æžœ + */ + private void searchResult(){ + adminView.getProgPage().clear(); //清除分页区域内容 é‡æ–°åŠ è½½åˆ†é¡µæŽ§ + adminView.getProgPage().add(page); + programService.search(searchProgram, searchStart, searchEnd, 0, 0, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + searchAlert.setContent(caught.getMessage()); + searchAlert.show(); } - adminView.getProgPage().setText(0, 12, "..."); - for(int count=13;count<23;count++){ - adminView.getProgPage().setWidget(0, count, new Label(tailStart+"")); - tailStart++; + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result.size() == 0){ + searchAlert.setContent( Constants.adminUIMsg.searchNoResult() ); + searchAlert.show(); + }else{ + resultSize = result.size(); //计算页ç ç›¸å…³ä¿¡æ¯ é‡æ–°è®¾ç½®åˆ†é¡µæŽ§ä»¶ é‡æ–°åŠ è½½ + pageSize = (int)Math.ceil((double)result.size()/13); + lastPage = pageSize; + currentPage = 1; + pagination = new Pagination(page, pageSize, Pagination.PageType.LARGE); + pagination.load(); + reload(); //加载æœç´¢ç»“æžœ + } } - adminView.getProgPage().setWidget(0, 23, next); - adminView.getProgPage().setWidget(0, 24, last); + + }); + } + + /** + * 加载æœç´¢ç»“æžœ å¡«å…¥é¡µé¢ + */ + private void reload(){ + resultStart = (currentPage-1)*13; + if(currentPage == lastPage){ //满页æ¯é¡µæ˜¾ç¤º13æ¡è®°å½• 尾页ä¸è¶³13æ¡æ—¶è®¡ç®—一下实际æ¡æ•° + everyPageSize = resultSize - resultStart; }else{ - adminView.getProgPage().resize(1, pageSize+4); - adminView.getProgPage().setWidget(0, 0, first); - adminView.getProgPage().setWidget(0, 1, prev); - for(int count=2;count 20){ - if(currentPage == 1 || currentPage == lastPage){ - headStart = 1; - tailStart = lastPage - 9; - }else{ - if(currentPage > 9 && (currentPage+9)>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); } - if(tailStart == 0){ - adminView.getProgPage().clear(); - adminView.getProgPage().resize(1, 25); - adminView.getProgPage().setWidget(0, 0, first); - adminView.getProgPage().setWidget(0, 1, prev); - adminView.getProgPage().setText(0, 2, "..."); - for(int count=3;count<22;count++){ - adminView.getProgPage().setWidget(0, count, new Label(headStart+"")); - headStart++; - } - adminView.getProgPage().setText(0, 22, "..."); - adminView.getProgPage().setWidget(0, 23, next); - adminView.getProgPage().setWidget(0, 24, last); - int stylePage = (currentPage - Integer.parseInt(adminView.getProgPage().getText(0, 3)))+3; - adminView.getProgPage().getWidget(0, stylePage).removeStyleName("gwt-Label"); - adminView.getProgPage().getWidget(0, stylePage).addStyleName("admin-page-selected"); - }else{ - adminView.getProgPage().clear(); - adminView.getProgPage().resize(1, 25); - adminView.getProgPage().setWidget(0, 0, first); - adminView.getProgPage().setWidget(0, 1, prev); - for(int count=2;count<12;count++){ - adminView.getProgPage().setWidget(0, count, new Label(headStart+"")); - headStart++; - } - adminView.getProgPage().setText(0, 12, "..."); - for(int count=13;count<23;count++){ - adminView.getProgPage().setWidget(0, count, new Label(tailStart+"")); - tailStart++; - } - adminView.getProgPage().setWidget(0, 23, next); - adminView.getProgPage().setWidget(0, 24, last); - if(currentPage>=Integer.parseInt(adminView.getProgPage().getText(0, 2))&¤tPage<=Integer.parseInt(adminView.getProgPage().getText(0, 11))){ - adminView.getProgPage().getWidget(0, currentPage+1).removeStyleName("gwt-Label"); - adminView.getProgPage().getWidget(0, currentPage+1).addStyleName("admin-page-selected"); - }else if(currentPage>=Integer.parseInt(adminView.getProgPage().getText(0, 13))&¤tPage<=Integer.parseInt(adminView.getProgPage().getText(0, 22))){ - int stylePage = (currentPage - Integer.parseInt(adminView.getProgPage().getText(0, 13)))+13; - adminView.getProgPage().getWidget(0, stylePage).removeStyleName("gwt-Label"); - adminView.getProgPage().getWidget(0, stylePage).addStyleName("admin-page-selected"); + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + for(int i=0;i(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + adminView.getProgGrid().setText(a+1, 1, categoryId); + } + + @Override + public void onSuccess(Category result) { + // TODO Auto-generated method stub + if(result != null){ + adminView.getProgGrid().setText(a+1, 1, result.getPath()); + }else + adminView.getProgGrid().setText(a+1, 1, "————"); + } + + }); + } + if(result.get(i).getDescription().length() > 50){ + adminView.getProgGrid().setText(i+1, 2, result.get(i).getDescription().substring(0, 49)+"..."); + }else{ + adminView.getProgGrid().setText(i+1, 2, result.get(i).getDescription()); + } + adminView.getProgGrid().setText(i+1, 3, result.get(i).getCreatedate()); + adminView.getProgGrid().setText(i+1, 4, result.get(i).getOwner()); + final String progId = result.get(i).getId(); + final String progName = result.get(i).getName(); + Label deleteProg = new Label(); + deleteProg.setTitle( Constants.adminUIMsg.deleteProg() ); + deleteProg.addStyleName("admin-user-delete"); + deleteProg.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + deletePanel.setContent( Constants.adminUIMsg.progDelete1() + progName + Constants.adminUIMsg.progDelete2() ); + deletePanel.show(); + deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + Program program = new Program(); + program.setId(progId); + programService.delete(progId, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + deletePanel.hide(); + alertPanel.setContent(caught.getMessage()); + alertPanel.show(); + } + + @Override + public void onSuccess(Void result) { + // TODO Auto-generated method stub + deletePanel.hide(); + alertPanel.setContent( Constants.adminUIMsg.progSuccess() ); + alertPanel.show(); + } + + }); + } + + }); + } + + }); + HorizontalPanel operate = new HorizontalPanel(); + operate.addStyleName("admin-user"); + operate.add(deleteProg); + adminView.getProgGrid().setWidget(i + 1, 5, operate); } } - }else{ - if(currentPage > 0 && currentPage < (pageSize + 1)){ - adminView.getProgPage().resize(1, pageSize+4); - adminView.getProgPage().setWidget(0, 0, first); - adminView.getProgPage().setWidget(0, 1, prev); - for(int count=2;count"); + String tmp = arr[0]; + String newPath = null; + if(tmp.equals("我的程åº")){ + newPath = "My Program"; + for(int i=1;i(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - registerView.getPsterrorLabel().setText(caught.getMessage()); - } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result != null){ - String arr[] = result.split(" "); - if(arr[0].equals("[success]")){ - alertPanel.setContent(Constants.registerUIMsg.registerSuccessMsg()); - alertPanel.show(); - }else if(result.equals("username error")){ - registerView.getUsrerrorLabel().setText(Constants.registerUIMsg.usernameExistMsg()); - }else - registerView.getPsterrorLabel().setText(result); - } - } - - }); - } - } - }); - } - - /** - * Registration information verification - * @return Account - */ - public Account validate() { - if (registerView.getUsernameBox().getValue().length() <= 0) { - registerView.getUsrerrorLabel().setText(Constants.registerUIMsg.usernameEmptyMsg()); - registerView.getUsrerrorLabel().setVisible(true); - registerView.getPwderrorLabel().setVisible(false); - registerView.getVererrorLabel().setVisible(false); - registerView.getCmperrorLabel().setVisible(false); - registerView.getPsterrorLabel().setVisible(false); - registerView.getConfirmBtn().setEnabled(true); - return null; - } else - registerView.getUsrerrorLabel().setText(""); - - if (registerView.getPasswordBox().getValue().length() <= 0) { - registerView.getPwderrorLabel().setText(Constants.registerUIMsg.passwordEmptyMsg()); - registerView.getPwderrorLabel().setVisible(true); - registerView.getUsrerrorLabel().setVisible(false); - registerView.getVererrorLabel().setVisible(false); - registerView.getCmperrorLabel().setVisible(false); - registerView.getPsterrorLabel().setVisible(false); - registerView.getConfirmBtn().setEnabled(true); - return null; - }else if(registerView.getPasswordBox().getValue().length()>20){ - registerView.getPwderrorLabel().setText(Constants.registerUIMsg.passwordLengthMsg()); - registerView.getPwderrorLabel().setVisible(true); - registerView.getUsrerrorLabel().setVisible(false); - registerView.getVererrorLabel().setVisible(false); - registerView.getCmperrorLabel().setVisible(false); - registerView.getPsterrorLabel().setVisible(false); - registerView.getConfirmBtn().setEnabled(true); - return null; - } else - registerView.getPwderrorLabel().setText(""); - - if (!registerView.getPasswordBox().getValue().equals(registerView.getVerpwdBox().getValue())) { - registerView.getVererrorLabel().setText(Constants.registerUIMsg.passwordMismatchMsg()); - registerView.getVererrorLabel().setVisible(true); - registerView.getUsrerrorLabel().setVisible(false); - registerView.getPwderrorLabel().setVisible(false); - registerView.getCmperrorLabel().setVisible(false); - registerView.getPsterrorLabel().setVisible(false); - registerView.getConfirmBtn().setEnabled(true); - return null; - } else - registerView.getVererrorLabel().setText(""); - - if (registerView.getCompanyBox().getValue().length() <= 0) { - registerView.getCmperrorLabel().setText(Constants.registerUIMsg.companyEmptyMsg()); - registerView.getCmperrorLabel().setVisible(true); - registerView.getUsrerrorLabel().setVisible(false); - registerView.getPwderrorLabel().setVisible(false); - registerView.getVererrorLabel().setVisible(false); - registerView.getPsterrorLabel().setVisible(false); - registerView.getConfirmBtn().setEnabled(true); - return null; - } else - registerView.getCmperrorLabel().setText(""); - - if (registerView.getPositionBox().getValue().length() <= 0) { - registerView.getPsterrorLabel().setText(Constants.registerUIMsg.positionEmptyMsg()); - registerView.getPsterrorLabel().setVisible(true); - registerView.getUsrerrorLabel().setVisible(false); - registerView.getPwderrorLabel().setVisible(false); - registerView.getVererrorLabel().setVisible(false); - registerView.getCmperrorLabel().setVisible(false); - registerView.getConfirmBtn().setEnabled(true); - return null; - } else - registerView.getPsterrorLabel().setText(""); - - Account account = new Account(); - account.setEmail(registerView.getEmail()); - account.setUsername(registerView.getUsernameBox().getValue()); - account.setPassword(registerView.getPasswordBox().getValue()); - account.setCompany(registerView.getCompanyBox().getValue()); - account.setPosition(registerView.getPositionBox().getValue()); - account.setVerifylink(AppController.verifylink); - account.setPower("011"); - - return account; - } - - public RegisterPresenter(HandlerManager eventBus, RegisterView registerView) { - this.eventBus = eventBus; - this.registerView = registerView; - } - - @Override - public void go(HasWidgets container) { - bind(); - container.clear(); - container.add(registerView.asWidget()); - } + protected AccountServiceAsync accountService = GWT.create(AccountService.class); + protected AlertPanel alertPanel = new AlertPanel(); + private final HandlerManager eventBus; + private final RegisterView registerView; + + /** + * Event binding + */ + public void bind() { + alertPanel.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + AppController.redirect("index.html"); + } + + }); + + alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + AppController.redirect("index.html"); + } + + }); + + //Registration information, confirmation button + registerView.getConfirmBtn().addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + + Account account = validate(); + if (account != null) { + accountService.register(account, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + registerView.getPsterrorLabel().setText(caught.getMessage()); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result != null){ + String arr[] = result.split(" "); + if(arr[0].equals("[success]")){ + alertPanel.setContent(Constants.registerUIMsg.registerSuccessMsg()); + alertPanel.show(); + }else if(result.equals("username error")){ + registerView.getUsrerrorLabel().setText(Constants.registerUIMsg.usernameExistMsg()); + }else + registerView.getPsterrorLabel().setText(result); + } + } + + }); + } + } + }); + } + + /** + * Registration information verification + * @return Account + */ + public Account validate() { + if (registerView.getUsernameBox().getValue().length() <= 0) { + registerView.getUsrerrorLabel().setText(Constants.registerUIMsg.usernameEmptyMsg()); + registerView.getUsrerrorLabel().setVisible(true); + registerView.getPwderrorLabel().setVisible(false); + registerView.getVererrorLabel().setVisible(false); + registerView.getCmperrorLabel().setVisible(false); + registerView.getPsterrorLabel().setVisible(false); + registerView.getConfirmBtn().setEnabled(true); + return null; + } else + registerView.getUsrerrorLabel().setText(""); + + if (registerView.getPasswordBox().getValue().length() <= 0) { + registerView.getPwderrorLabel().setText(Constants.registerUIMsg.passwordEmptyMsg()); + registerView.getPwderrorLabel().setVisible(true); + registerView.getUsrerrorLabel().setVisible(false); + registerView.getVererrorLabel().setVisible(false); + registerView.getCmperrorLabel().setVisible(false); + registerView.getPsterrorLabel().setVisible(false); + registerView.getConfirmBtn().setEnabled(true); + return null; + }else if(registerView.getPasswordBox().getValue().length()>20){ + registerView.getPwderrorLabel().setText(Constants.registerUIMsg.passwordLengthMsg()); + registerView.getPwderrorLabel().setVisible(true); + registerView.getUsrerrorLabel().setVisible(false); + registerView.getVererrorLabel().setVisible(false); + registerView.getCmperrorLabel().setVisible(false); + registerView.getPsterrorLabel().setVisible(false); + registerView.getConfirmBtn().setEnabled(true); + return null; + } else + registerView.getPwderrorLabel().setText(""); + + if (!registerView.getPasswordBox().getValue().equals(registerView.getVerpwdBox().getValue())) { + registerView.getVererrorLabel().setText(Constants.registerUIMsg.passwordMismatchMsg()); + registerView.getVererrorLabel().setVisible(true); + registerView.getUsrerrorLabel().setVisible(false); + registerView.getPwderrorLabel().setVisible(false); + registerView.getCmperrorLabel().setVisible(false); + registerView.getPsterrorLabel().setVisible(false); + registerView.getConfirmBtn().setEnabled(true); + return null; + } else + registerView.getVererrorLabel().setText(""); + + if (registerView.getCompanyBox().getValue().length() <= 0) { + registerView.getCmperrorLabel().setText(Constants.registerUIMsg.companyEmptyMsg()); + registerView.getCmperrorLabel().setVisible(true); + registerView.getUsrerrorLabel().setVisible(false); + registerView.getPwderrorLabel().setVisible(false); + registerView.getVererrorLabel().setVisible(false); + registerView.getPsterrorLabel().setVisible(false); + registerView.getConfirmBtn().setEnabled(true); + return null; + } else + registerView.getCmperrorLabel().setText(""); + + if (registerView.getPositionBox().getValue().length() <= 0) { + registerView.getPsterrorLabel().setText(Constants.registerUIMsg.positionEmptyMsg()); + registerView.getPsterrorLabel().setVisible(true); + registerView.getUsrerrorLabel().setVisible(false); + registerView.getPwderrorLabel().setVisible(false); + registerView.getVererrorLabel().setVisible(false); + registerView.getCmperrorLabel().setVisible(false); + registerView.getConfirmBtn().setEnabled(true); + return null; + } else + registerView.getPsterrorLabel().setText(""); + + Account account = new Account(); + account.setEmail(registerView.getEmail()); + account.setUsername(registerView.getUsernameBox().getValue()); + account.setPassword(registerView.getPasswordBox().getValue()); + account.setCompany(registerView.getCompanyBox().getValue()); + account.setPosition(registerView.getPositionBox().getValue()); + account.setVerifylink(AppController.verifylink); + account.setPower("011"); + + return account; + } + + public RegisterPresenter(HandlerManager eventBus, RegisterView registerView) { + this.eventBus = eventBus; + this.registerView = registerView; + } + + @Override + public void go(HasWidgets container) { + bind(); + container.clear(); + container.add(registerView.asWidget()); + } } diff --git a/src/main/java/eml/studio/client/mvp/presenter/ResetpwdPresenter.java b/src/main/java/eml/studio/client/mvp/presenter/ResetpwdPresenter.java index 954e0fa..5eca437 100644 --- a/src/main/java/eml/studio/client/mvp/presenter/ResetpwdPresenter.java +++ b/src/main/java/eml/studio/client/mvp/presenter/ResetpwdPresenter.java @@ -21,118 +21,117 @@ /** * Reset Password(forget password) - * */ public class ResetpwdPresenter implements Presenter { - protected AccountServiceAsync accountService = GWT.create(AccountService.class); - protected AlertPanel alertPanel = new AlertPanel(); - private final HandlerManager eventBus; - private final ResetpwdView resetpwdView; - - - /** - * Event binding - */ - public void bind() { - alertPanel.getClose().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - AppController.redirect("index.html"); - } - - }); - - alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - AppController.redirect("index.html"); - } - - }); - - resetpwdView.getConfirmBtn().addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - - Account account = validate(); - if (account != null) { - accountService.resetPassword(account, new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - resetpwdView.getVererrorLabel().setText(caught.getMessage()); - } - - @Override - public void onSuccess(Account result) { - // TODO Auto-generated method stub - if(result != null){ - AppController.username = result.getUsername(); - AppController.email = result.getEmail(); - alertPanel.setContent(Constants.resetpwdUIMsg.passwordResetSuccessMsg()); - alertPanel.show(); - }else - resetpwdView.getVererrorLabel().setText(Constants.resetpwdUIMsg.otherErrMsg()); - } - - }); - } - } - }); - } - - /** - * Password verification - * @return Account - */ - public Account validate() { - if (resetpwdView.getPasswordBox().getValue().length() <= 0) { - resetpwdView.getPwderrorLabel().setText(Constants.resetpwdUIMsg.passwordEmptyMsg()); - resetpwdView.getPwderrorLabel().setVisible(true); - resetpwdView.getVererrorLabel().setVisible(false); - resetpwdView.getConfirmBtn().setEnabled(true); - return null; - }else if(resetpwdView.getPasswordBox().getValue().length()>20){ - resetpwdView.getPwderrorLabel().setText(Constants.resetpwdUIMsg.passwordLengthMsg()); - resetpwdView.getPwderrorLabel().setVisible(true); - resetpwdView.getVererrorLabel().setVisible(false); - resetpwdView.getConfirmBtn().setEnabled(true); - return null; - } else - resetpwdView.getPwderrorLabel().setText(""); - - if (!resetpwdView.getPasswordBox().getValue().equals(resetpwdView.getVerpwdBox().getValue())) { - resetpwdView.getVererrorLabel().setText(Constants.resetpwdUIMsg.passwordMismatchMsg()); - resetpwdView.getVererrorLabel().setVisible(true); - resetpwdView.getPwderrorLabel().setVisible(false); - resetpwdView.getConfirmBtn().setEnabled(true); - return null; - } else - resetpwdView.getVererrorLabel().setText(""); - - Account account = new Account(); - account.setEmail(resetpwdView.getEmail()); - account.setPassword(resetpwdView.getPasswordBox().getValue()); - account.setVerifylink(AppController.verifylink); - - return account; - } - - public ResetpwdPresenter(HandlerManager eventBus, ResetpwdView resetpwdView) { - this.eventBus = eventBus; - this.resetpwdView = resetpwdView; - } - - @Override - public void go(HasWidgets container) { - bind(); - container.clear(); - container.add(resetpwdView.asWidget()); - } + protected AccountServiceAsync accountService = GWT.create(AccountService.class); + protected AlertPanel alertPanel = new AlertPanel(); + private final HandlerManager eventBus; + private final ResetpwdView resetpwdView; + + + /** + * Event binding + */ + public void bind() { + alertPanel.getClose().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + AppController.redirect("index.html"); + } + + }); + + alertPanel.getConfirmBtn().addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + AppController.redirect("index.html"); + } + + }); + + resetpwdView.getConfirmBtn().addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + + Account account = validate(); + if (account != null) { + accountService.resetPassword(account, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + resetpwdView.getVererrorLabel().setText(caught.getMessage()); + } + + @Override + public void onSuccess(Account result) { + // TODO Auto-generated method stub + if(result != null){ + AppController.username = result.getUsername(); + AppController.email = result.getEmail(); + alertPanel.setContent(Constants.resetpwdUIMsg.passwordResetSuccessMsg()); + alertPanel.show(); + }else + resetpwdView.getVererrorLabel().setText(Constants.resetpwdUIMsg.otherErrMsg()); + } + + }); + } + } + }); + } + + /** + * Password verification + * @return Account + */ + public Account validate() { + if (resetpwdView.getPasswordBox().getValue().length() <= 0) { + resetpwdView.getPwderrorLabel().setText(Constants.resetpwdUIMsg.passwordEmptyMsg()); + resetpwdView.getPwderrorLabel().setVisible(true); + resetpwdView.getVererrorLabel().setVisible(false); + resetpwdView.getConfirmBtn().setEnabled(true); + return null; + }else if(resetpwdView.getPasswordBox().getValue().length()>20){ + resetpwdView.getPwderrorLabel().setText(Constants.resetpwdUIMsg.passwordLengthMsg()); + resetpwdView.getPwderrorLabel().setVisible(true); + resetpwdView.getVererrorLabel().setVisible(false); + resetpwdView.getConfirmBtn().setEnabled(true); + return null; + } else + resetpwdView.getPwderrorLabel().setText(""); + + if (!resetpwdView.getPasswordBox().getValue().equals(resetpwdView.getVerpwdBox().getValue())) { + resetpwdView.getVererrorLabel().setText(Constants.resetpwdUIMsg.passwordMismatchMsg()); + resetpwdView.getVererrorLabel().setVisible(true); + resetpwdView.getPwderrorLabel().setVisible(false); + resetpwdView.getConfirmBtn().setEnabled(true); + return null; + } else + resetpwdView.getVererrorLabel().setText(""); + + Account account = new Account(); + account.setEmail(resetpwdView.getEmail()); + account.setPassword(resetpwdView.getPasswordBox().getValue()); + account.setVerifylink(AppController.verifylink); + + return account; + } + + public ResetpwdPresenter(HandlerManager eventBus, ResetpwdView resetpwdView) { + this.eventBus = eventBus; + this.resetpwdView = resetpwdView; + } + + @Override + public void go(HasWidgets container) { + bind(); + container.clear(); + container.add(resetpwdView.asWidget()); + } } diff --git a/src/main/java/eml/studio/client/mvp/view/AccountView.java b/src/main/java/eml/studio/client/mvp/view/AccountView.java index 7e24652..d515b96 100644 --- a/src/main/java/eml/studio/client/mvp/view/AccountView.java +++ b/src/main/java/eml/studio/client/mvp/view/AccountView.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.mvp.view; import eml.studio.client.mvp.AppController; @@ -15,235 +20,233 @@ import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; - /** * Personal information page layout - * */ public class AccountView extends Composite { - interface AccountViewUiBinder extends UiBinder { - } - - private static AccountViewUiBinder ourUiBinder = GWT.create(AccountViewUiBinder.class); - - @UiField - Anchor workStage; - - @UiField - Anchor adminAnchor; - - @UiField - Anchor userAnchor; - - @UiField - Anchor logout; - - @UiField - Anchor navInf; - - @UiField - Anchor navPwd; - - @UiField - Label usernameLabel; - - @UiField - Label companyLabel; - - @UiField - Label positionLabel; - - @UiField - TextBox usrBox; - - @UiField - TextBox cmpBox; - - @UiField - TextBox pstBox; - - @UiField - Label usrerrorLabel; - - @UiField - Label cmperrorLabel; - - @UiField - Label psterrorLabel; - - @UiField - Button infoConfirmBtn; - - @UiField - VerticalPanel infoPanel; - - @UiField - Label oldpwdLabel; - - @UiField - Label newpwdLabel; - - @UiField - Label verpwdLabel; - - @UiField - PasswordTextBox oldPwd; - - @UiField - PasswordTextBox newPwd; - - @UiField - PasswordTextBox verPwd; - - @UiField - Label olderrorLabel; - - @UiField - Label newerrorLabel; - - @UiField - Label vererrorLabel; - - @UiField - Button pwdConfirmBtn; - - @UiField - VerticalPanel pwdPanel; - - @UiField - HTMLPanel container; - - public AccountView() { - initWidget(ourUiBinder.createAndBindUi(this)); - - workStage.setText( Constants.headerUIMsg.workStage() ); - adminAnchor.setText( Constants.headerUIMsg.manager() ); - logout.setText( Constants.headerUIMsg.logout() ); - navInf.setText( Constants.accountUIMsg.information() ); - navPwd.setText( Constants.accountUIMsg.account() ); - usernameLabel.setText( Constants.accountUIMsg.username() ); - companyLabel.setText( Constants.accountUIMsg.company() ); - positionLabel.setText( Constants.accountUIMsg.position() ); - oldpwdLabel.setText( Constants.accountUIMsg.oldpwd() ); - newpwdLabel.setText( Constants.accountUIMsg.newpwd() ); - verpwdLabel.setText( Constants.accountUIMsg.verpwd() ); - - navInf.addStyleName("account-nav-selected"); - infoConfirmBtn.removeStyleName("gwt-Button"); - infoConfirmBtn.setText( Constants.accountUIMsg.confirm() ); - infoConfirmBtn.getElement().getStyle().setMarginTop(70, Unit.PX); - infoConfirmBtn.getElement().getStyle().setMarginLeft(100, Unit.PX); - pwdConfirmBtn.removeStyleName("gwt-Button"); - pwdConfirmBtn.setText( Constants.accountUIMsg.confirm() ); - pwdConfirmBtn.getElement().getStyle().setMarginTop(70, Unit.PX); - pwdConfirmBtn.getElement().getStyle().setMarginLeft(100, Unit.PX); - - infoPanel.setVisible(true); - pwdPanel.setVisible(false); - } - - public void setAccount(String usernameAccount, String emailAccount){ - if( usernameAccount == "" || usernameAccount == null){ - userAnchor.setText(emailAccount); - }else{ - userAnchor.setText(usernameAccount); - } - } - - public Anchor getAdminAnchor(){ - return adminAnchor; - } - - public Anchor getWorkStage(){ - return workStage; - } - - public Anchor getUserAnchor(){ - return userAnchor; - } - - public Anchor getLogout() { - return logout; - } - - public Anchor getNavInfo(){ - return navInf; - } - - public Anchor getNavPwd(){ - return navPwd; - } - - public TextBox getUsrBox(){ - return usrBox; - } - - public Label getUsrerrorLabel(){ - return usrerrorLabel; - } - - public TextBox getCmpBox(){ - return cmpBox; - } - - public Label getCmperrorLabel(){ - return cmperrorLabel; - } - - public TextBox getPstBox(){ - return pstBox; - } - - public Label getPsterrorLabel(){ - return psterrorLabel; - } - - public Button getInfoConfirmBtn() { - return infoConfirmBtn; - } - - public VerticalPanel getInfoPanel(){ - return infoPanel; - } - - public PasswordTextBox getOldPwd(){ - return oldPwd; - } - - public Label getOlderrorLabel(){ - return olderrorLabel; - } - - public PasswordTextBox getNewPwd(){ - return newPwd; - } - - public Label getNewerrorLabel(){ - return newerrorLabel; - } - - public PasswordTextBox getVerPwd(){ - return verPwd; - } - - public Label getVererrorLabel(){ - return vererrorLabel; - } - - public Button getPwdConfirmBtn(){ - return pwdConfirmBtn; - } - - public VerticalPanel getPwdPanel(){ - return pwdPanel; - } - - public String getUsername(){ - return AppController.username; - } - - public String getEmail(){ - return AppController.email; - } + interface AccountViewUiBinder extends UiBinder { + } + + private static AccountViewUiBinder ourUiBinder = GWT.create(AccountViewUiBinder.class); + + @UiField + Anchor workStage; + + @UiField + Anchor adminAnchor; + + @UiField + Anchor userAnchor; + + @UiField + Anchor logout; + + @UiField + Anchor navInf; + + @UiField + Anchor navPwd; + + @UiField + Label usernameLabel; + + @UiField + Label companyLabel; + + @UiField + Label positionLabel; + + @UiField + TextBox usrBox; + + @UiField + TextBox cmpBox; + + @UiField + TextBox pstBox; + + @UiField + Label usrerrorLabel; + + @UiField + Label cmperrorLabel; + + @UiField + Label psterrorLabel; + + @UiField + Button infoConfirmBtn; + + @UiField + VerticalPanel infoPanel; + + @UiField + Label oldpwdLabel; + + @UiField + Label newpwdLabel; + + @UiField + Label verpwdLabel; + + @UiField + PasswordTextBox oldPwd; + + @UiField + PasswordTextBox newPwd; + + @UiField + PasswordTextBox verPwd; + + @UiField + Label olderrorLabel; + + @UiField + Label newerrorLabel; + + @UiField + Label vererrorLabel; + + @UiField + Button pwdConfirmBtn; + + @UiField + VerticalPanel pwdPanel; + + @UiField + HTMLPanel container; + + public AccountView() { + initWidget(ourUiBinder.createAndBindUi(this)); + + workStage.setText( Constants.headerUIMsg.workStage() ); + adminAnchor.setText( Constants.headerUIMsg.manager() ); + logout.setText( Constants.headerUIMsg.logout() ); + navInf.setText( Constants.accountUIMsg.information() ); + navPwd.setText( Constants.accountUIMsg.account() ); + usernameLabel.setText( Constants.accountUIMsg.username() ); + companyLabel.setText( Constants.accountUIMsg.company() ); + positionLabel.setText( Constants.accountUIMsg.position() ); + oldpwdLabel.setText( Constants.accountUIMsg.oldpwd() ); + newpwdLabel.setText( Constants.accountUIMsg.newpwd() ); + verpwdLabel.setText( Constants.accountUIMsg.verpwd() ); + + navInf.addStyleName("account-nav-selected"); + infoConfirmBtn.removeStyleName("gwt-Button"); + infoConfirmBtn.setText( Constants.accountUIMsg.confirm() ); + infoConfirmBtn.getElement().getStyle().setMarginTop(70, Unit.PX); + infoConfirmBtn.getElement().getStyle().setMarginLeft(100, Unit.PX); + pwdConfirmBtn.removeStyleName("gwt-Button"); + pwdConfirmBtn.setText( Constants.accountUIMsg.confirm() ); + pwdConfirmBtn.getElement().getStyle().setMarginTop(70, Unit.PX); + pwdConfirmBtn.getElement().getStyle().setMarginLeft(100, Unit.PX); + + infoPanel.setVisible(true); + pwdPanel.setVisible(false); + } + + public void setAccount(String usernameAccount, String emailAccount){ + if( usernameAccount == "" || usernameAccount == null){ + userAnchor.setText(emailAccount); + }else{ + userAnchor.setText(usernameAccount); + } + } + + public Anchor getAdminAnchor(){ + return adminAnchor; + } + + public Anchor getWorkStage(){ + return workStage; + } + + public Anchor getUserAnchor(){ + return userAnchor; + } + + public Anchor getLogout() { + return logout; + } + + public Anchor getNavInfo(){ + return navInf; + } + + public Anchor getNavPwd(){ + return navPwd; + } + + public TextBox getUsrBox(){ + return usrBox; + } + + public Label getUsrerrorLabel(){ + return usrerrorLabel; + } + + public TextBox getCmpBox(){ + return cmpBox; + } + + public Label getCmperrorLabel(){ + return cmperrorLabel; + } + + public TextBox getPstBox(){ + return pstBox; + } + + public Label getPsterrorLabel(){ + return psterrorLabel; + } + + public Button getInfoConfirmBtn() { + return infoConfirmBtn; + } + + public VerticalPanel getInfoPanel(){ + return infoPanel; + } + + public PasswordTextBox getOldPwd(){ + return oldPwd; + } + + public Label getOlderrorLabel(){ + return olderrorLabel; + } + + public PasswordTextBox getNewPwd(){ + return newPwd; + } + + public Label getNewerrorLabel(){ + return newerrorLabel; + } + + public PasswordTextBox getVerPwd(){ + return verPwd; + } + + public Label getVererrorLabel(){ + return vererrorLabel; + } + + public Button getPwdConfirmBtn(){ + return pwdConfirmBtn; + } + + public VerticalPanel getPwdPanel(){ + return pwdPanel; + } + + public String getUsername(){ + return AppController.username; + } + + public String getEmail(){ + return AppController.email; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/mvp/view/AccountView.ui.xml b/src/main/java/eml/studio/client/mvp/view/AccountView.ui.xml index 9e4fed1..2c76f79 100644 --- a/src/main/java/eml/studio/client/mvp/view/AccountView.ui.xml +++ b/src/main/java/eml/studio/client/mvp/view/AccountView.ui.xml @@ -80,11 +80,6 @@ ä¿å­˜ - -
- - - - - - -
    -
  • æ•°æ®
  • -
  • 程åº
  • -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + -
-
- - - - -
+ +
\ No newline at end of file diff --git a/src/main/java/eml/studio/client/mvp/view/Generator.java b/src/main/java/eml/studio/client/mvp/view/Generator.java index 4bba5db..a06e87d 100644 --- a/src/main/java/eml/studio/client/mvp/view/Generator.java +++ b/src/main/java/eml/studio/client/mvp/view/Generator.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.mvp.view; import eml.studio.client.controller.DiagramController; @@ -12,39 +17,38 @@ * Generator is the base class for all custom pages * In the onModuleLoad custom page, * contains some of the basic functions of the page - * TODO: 把éžUI相关的代ç ç§»åˆ°present里去 */ public abstract class Generator { - protected Panel propPanel = new AbsolutePanel(); + protected Panel propPanel = new AbsolutePanel(); + + /** Menu panel show in the head */ + protected HTMLPanel headerHtmlPanel = null; - /** Menu panel show in the head */ - protected HTMLPanel headerHtmlPanel = null; + private DiagramController controller; - private DiagramController controller; + public DiagramController getController() { + return controller; + } - public DiagramController getController() { - return controller; - } + public void setController(DiagramController controller) { + this.controller = controller; + } - public void setController(DiagramController controller) { - this.controller = controller; - } + public abstract Widget createMainLayout(); - public abstract Widget createMainLayout(); + /** + * Tet the program attributes information panel + * + * @param pt The attribute table corresponding to the algorithm module + */ + public void setPropTable(PropertyTable pt) { + propPanel.clear(); + propPanel.add(pt); + } - /** - * Tet the program attributes information panel - * - * @param pt The attribute table corresponding to the algorithm module - */ - public void setPropTable(PropertyTable pt) { - propPanel.clear(); - propPanel.add(pt); - } - - public void clearPropTable(){ - propPanel.clear(); - } + public void clearPropTable(){ + propPanel.clear(); + } } diff --git a/src/main/java/eml/studio/client/mvp/view/HeaderView.java b/src/main/java/eml/studio/client/mvp/view/HeaderView.java index ac0b39e..9e214a1 100644 --- a/src/main/java/eml/studio/client/mvp/view/HeaderView.java +++ b/src/main/java/eml/studio/client/mvp/view/HeaderView.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.mvp.view; import eml.studio.client.util.Constants; @@ -15,115 +20,115 @@ */ public class HeaderView extends Composite { - interface HeaderViewUiBinder extends UiBinder { - } - - private static HeaderViewUiBinder ourUiBinder = GWT.create(HeaderViewUiBinder.class); - - @UiField - Anchor userAnchor; - - @UiField - Anchor logout; - - @UiField - Anchor newJobAnchor; - - @UiField - Anchor dataAnchor; - - @UiField - Anchor progAnchor; - - @UiField - Anchor userProg; - - @UiField - Anchor userData; - - @UiField - Anchor userList; - - @UiField - Anchor notebook; - - @UiField - HTMLPanel navMenu; - - @UiField - Anchor adminAnchor; - - @UiField - Anchor workStage; - - public HeaderView() { - initWidget(ourUiBinder.createAndBindUi(this)); - init(); - } - - public void init(){ - newJobAnchor.setText( Constants.headerUIMsg.createJob() ); - dataAnchor.setText( Constants.headerUIMsg.uploadData() ); - progAnchor.setText( Constants.headerUIMsg.uploadProgram() ); - userData.setText( Constants.headerUIMsg.dataManagement() ); - userProg.setText( Constants.headerUIMsg.progManagement()); - userList.setText(Constants.headerUIMsg.userManagement()); - notebook.setText( Constants.headerUIMsg.notebook()); - - workStage.setText(Constants.headerUIMsg.workStage()); - adminAnchor.setText( Constants.headerUIMsg.manager()); - logout.setText( Constants.headerUIMsg.logout()); - } - - public void setAccount(String usernameAccount, String emailAccount){ - if( usernameAccount == "" || usernameAccount == null){ - userAnchor.setText(emailAccount); - }else{ - userAnchor.setText(usernameAccount); - } - } - - public Anchor getLogout() { - return logout; - } - - public Anchor getNewJobAnchor() { - return newJobAnchor; - } - - public Anchor getProgAnchor() { - return progAnchor; - } - - public Anchor getDataAnchor() { - return dataAnchor; - } - - public Anchor getUserAnchor(){ - return userAnchor; - } - - public Anchor getUserProg(){ - return userProg; - } - - public Anchor getUserData(){ - return userData; - } - - public Anchor getUserList(){ - return userList; - } - - public HTMLPanel getNavMenu(){ - return navMenu; - } - - public Anchor getAdminAnchor(){ - return adminAnchor; - } - - public Anchor getWorkStage(){ - return workStage; - } + interface HeaderViewUiBinder extends UiBinder { + } + + private static HeaderViewUiBinder ourUiBinder = GWT.create(HeaderViewUiBinder.class); + + @UiField + Anchor userAnchor; + + @UiField + Anchor logout; + + @UiField + Anchor newJobAnchor; + + @UiField + Anchor dataAnchor; + + @UiField + Anchor progAnchor; + + @UiField + Anchor userProg; + + @UiField + Anchor userData; + + @UiField + Anchor userList; + + @UiField + Anchor notebook; + + @UiField + HTMLPanel navMenu; + + @UiField + Anchor adminAnchor; + + @UiField + Anchor workStage; + + public HeaderView() { + initWidget(ourUiBinder.createAndBindUi(this)); + init(); + } + + public void init(){ + newJobAnchor.setText( Constants.headerUIMsg.createJob() ); + dataAnchor.setText( Constants.headerUIMsg.uploadData() ); + progAnchor.setText( Constants.headerUIMsg.uploadProgram() ); + userData.setText( Constants.headerUIMsg.dataManagement() ); + userProg.setText( Constants.headerUIMsg.progManagement()); + userList.setText(Constants.headerUIMsg.userManagement()); + notebook.setText( Constants.headerUIMsg.notebook()); + + workStage.setText(Constants.headerUIMsg.workStage()); + adminAnchor.setText( Constants.headerUIMsg.manager()); + logout.setText( Constants.headerUIMsg.logout()); + } + + public void setAccount(String usernameAccount, String emailAccount){ + if( usernameAccount == "" || usernameAccount == null){ + userAnchor.setText(emailAccount); + }else{ + userAnchor.setText(usernameAccount); + } + } + + public Anchor getLogout() { + return logout; + } + + public Anchor getNewJobAnchor() { + return newJobAnchor; + } + + public Anchor getProgAnchor() { + return progAnchor; + } + + public Anchor getDataAnchor() { + return dataAnchor; + } + + public Anchor getUserAnchor(){ + return userAnchor; + } + + public Anchor getUserProg(){ + return userProg; + } + + public Anchor getUserData(){ + return userData; + } + + public Anchor getUserList(){ + return userList; + } + + public HTMLPanel getNavMenu(){ + return navMenu; + } + + public Anchor getAdminAnchor(){ + return adminAnchor; + } + + public Anchor getWorkStage(){ + return workStage; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/mvp/view/MonitorView.java b/src/main/java/eml/studio/client/mvp/view/MonitorView.java index c49e415..e9e535a 100644 --- a/src/main/java/eml/studio/client/mvp/view/MonitorView.java +++ b/src/main/java/eml/studio/client/mvp/view/MonitorView.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.mvp.view; import eml.studio.client.OozieConnectionFactory; @@ -8,12 +13,15 @@ import eml.studio.client.mvp.presenter.MonitorPresenter; import eml.studio.client.ui.tree.*; import eml.studio.client.util.Constants; +import eml.studio.client.ui.panel.HistoryPopupPanel; import eml.studio.client.ui.panel.JobDescPopupPanel; import eml.studio.client.ui.panel.ParameterPopupPanel; import eml.studio.client.ui.panel.Grid.MonitorJobDescGrid; import eml.studio.client.ui.widget.DisclosureStackPanel; import eml.studio.client.ui.widget.program.ProgramWidget; + import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.layout.client.Layout.Alignment; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.DisclosurePanel; @@ -31,263 +39,267 @@ import com.google.gwt.user.client.ui.Widget; public class MonitorView extends Generator implements MonitorPresenter.View { - private Button refreshBtn = new Button(Constants.studioUIMsg.refresh()); - private Button cloneBtn = new Button(Constants.studioUIMsg.clone()); - private Button stopBtn = new Button(Constants.studioUIMsg.stop()); - private Button suspendBtn = new Button("Suspend"); - private Button resumeBtn = new Button("Restart"); - private Button submitBtn = new Button(Constants.studioUIMsg.submit()); - private Button clearBtn = new Button(Constants.studioUIMsg.clear()); - - private HeaderView headerView = new HeaderView(); - - private TabPanel tabPanel = new TabPanel(); - private ProgramTree programTree; - private DatasetTree datasetTree; - private JobTree jobTree; - private SearchTree resultTree; - private MonitorJobDescGrid jobDescGrid; - private SearchGrid searchGrid; - private JobDescPopupPanel newJob = new JobDescPopupPanel(Constants.studioUIMsg.createJob()); - protected ParameterPopupPanel paramPopup = new ParameterPopupPanel(); - private Widget mainLayout; - private DiagramController nowDiagramColler ; - - LayoutPanel layoutPanel = new LayoutPanel(); - HorizontalPanel btnPanel2 = new HorizontalPanel(); - - public MonitorView() { - mainLayout = this.createMainLayout(); - } - - public void initTabPanel() { - tabPanel.clear(); - tabPanel.setWidth("100%"); - tabPanel.setTitle("myDisclosurePanel-headerView"); - tabPanel.add(programTree, Constants.studioUIMsg.program(), true); - tabPanel.add(datasetTree, Constants.studioUIMsg.data(), true); - tabPanel.add( jobTree, Constants.studioUIMsg.job(), true ); - tabPanel.selectTab(0); - } - - @Override - public Widget createMainLayout() { - SplitLayoutPanel splitLayout = new SplitLayoutPanel(); - - - StackLayoutPanel stack = new StackLayoutPanel(Unit.EM); - stack.setStyleName("sp"); - ScrollPanel leftcrp = new ScrollPanel(); - leftcrp.setSize("100%", "100%"); - VerticalPanel vPanel = new VerticalPanel(); - vPanel.setWidth("100%"); - - programTree = ProgramTreeLoader.load(AppController.email); - datasetTree = DatasetTreeLoader.load(AppController.email); - jobTree = JobTreeLoader.load(AppController.email); - resultTree = new SearchTree(); - initTabPanel(); - DisclosurePanel distackleft = new DisclosureStackPanel("Search") - .asWidget(); - searchGrid = new SearchGrid(programTree,datasetTree,jobTree,resultTree); - distackleft.setContent(searchGrid); - SimplePanel tabSimPanel = new SimplePanel(); - tabSimPanel.add(tabPanel); - - vPanel.add(tabSimPanel); - vPanel.add(distackleft); - leftcrp.add(vPanel); - stack.add(leftcrp, "", 0); - - StackLayoutPanel stackright = new StackLayoutPanel(Unit.EM); - stackright.setStyleName("sp"); - DisclosurePanel distackright1 = new DisclosureStackPanel(Constants.studioUIMsg.jobPanelTitle()) - .asWidget(); - DisclosurePanel distackright2 = new DisclosureStackPanel(Constants.studioUIMsg.modulePanelTitle()) - .asWidget(); - ScrollPanel scvp = new ScrollPanel(); - VerticalPanel verticalPanel = new VerticalPanel(); - verticalPanel.setWidth("100%"); - - HorizontalPanel btnPanel = new HorizontalPanel(); - submitBtn.setEnabled( false ); - submitBtn.removeStyleName("gwt-Button"); - submitBtn.addStyleName("button-style"); - clearBtn.removeStyleName("gwt-Button"); - clearBtn.addStyleName("button-style"); - cloneBtn.removeStyleName("gwt-Button"); - cloneBtn.addStyleName("button-style"); - refreshBtn.removeStyleName("gwt-Button"); - refreshBtn.addStyleName("button-style"); - stopBtn.removeStyleName("gwt-Button"); - stopBtn.addStyleName("button-style"); - btnPanel.add(submitBtn); - btnPanel.add(new HTML("  ")); - btnPanel.add(clearBtn); - btnPanel.add(new HTML("  ")); - btnPanel.add(cloneBtn); - btnPanel.add(new HTML("  ")); - btnPanel.add(stopBtn); - btnPanel.add(new HTML("  ")); -// btnPanel.add(suspendBtn); -// btnPanel.add(new HTML("  ")); -// btnPanel.add(resumeBtn); -// btnPanel.add(new HTML("  ")); - btnPanel.add(refreshBtn); - - - btnPanel2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); - btnPanel2.add(btnPanel); - btnPanel2.addStyleName("btnPanel"); - - splitLayout.addWest(stack, 200); - - jobDescGrid = new MonitorJobDescGrid(); - - distackright1.setContent(jobDescGrid); - distackright2.setContent(propPanel); - verticalPanel.add(distackright1); - verticalPanel.add(distackright2); - scvp.add(verticalPanel); - stackright.add(scvp, "", 0); - splitLayout.addEast(stackright, 287); - - // Use different controllers in different classes - setController(new MonitorController(Constants.CONTROLLER_WIDTH, - Constants.CONTROLLER_HEIGHT)); - rebuiltLayoutPanel(getController()); - splitLayout.add(layoutPanel); - - return splitLayout; - } - - @Override - public Button getClearButton() { - return clearBtn; - } - - @Override - public Button getSubmitButton() { - return submitBtn; - } - - @Override - public Button getRefreshButton() { - return refreshBtn; - } - - @Override - public Button getCloneButton() { - return cloneBtn; - } - - @Override - public Button getSuspendButton() { - return suspendBtn; - } - - @Override - public Button getResumeButton() { - return resumeBtn; - } - - @Override - public TabPanel getTabPanel(){ - return tabPanel; - } - - @Override - public ProgramTree getProgramTree() { - return programTree; - } - - @Override - public DatasetTree getDatasetTree() { - return datasetTree; - } - @Override - public JobTree getJobTree() { - return jobTree; - } - @Override - public SearchTree getResultTree() { - return resultTree; - } - @Override - public MonitorJobDescGrid getJobDescGrid() { - return jobDescGrid; - } - - @Override - public Button getStopButton() { - return stopBtn; - } - - @Override - public MonitorController getController() { - return (MonitorController) super.getController(); - } - - - @Override -public ParameterPopupPanel getParamPopup() { - return paramPopup; - } - - @Override -public ProgramWidget getPopupWidget() { - return programTree.getPopupWidget(); - } - - @Override - public Widget asWidget() { - - DockLayoutPanel dockLayout = new DockLayoutPanel(Unit.PX); - - dockLayout.addNorth(headerView, 35); - dockLayout.add(mainLayout); - - return dockLayout; - } - - @Override -public HeaderView getHeaderView() { - return headerView; - } - - @Override - public JobDescPopupPanel getNewJobPopup() { - return this.newJob; - } - - public LayoutPanel getLayoutPanel() { - return layoutPanel; - } - - public void setLayoutPanel(LayoutPanel layoutPanel) { - this.layoutPanel = layoutPanel; - } - @Override - public DiagramController getNowDiagramColler() { - return nowDiagramColler; - } - - public void setNowDiagramColler(DiagramController nowDiagramColler) { - this.nowDiagramColler = nowDiagramColler; - } - - public void rebuiltLayoutPanel(DiagramController controller){ - controller.setGenerator(this); - controller.setConnectionFactory(OozieConnectionFactory.singleton); - nowDiagramColler = controller; - - if(AppController.email.equals("guest") || !AppController.power.split("")[2].equals("1")){ - } - - layoutPanel.clear(); - layoutPanel.add(btnPanel2); - layoutPanel.setWidgetVerticalPosition(btnPanel2, Alignment.END); - layoutPanel.add(controller.getViewAsScrollPanel()); - } + private Button refreshBtn = new Button(Constants.studioUIMsg.refresh()); + private Button cloneBtn = new Button(Constants.studioUIMsg.clone()); + private Button stopBtn = new Button(Constants.studioUIMsg.stop()); + private Button submitBtn = new Button(Constants.studioUIMsg.submit()); + private Button clearBtn = new Button(Constants.studioUIMsg.clear()); + private Button historyBtn = new Button(Constants.studioUIMsg.runHistory()); + + private HeaderView headerView = new HeaderView(); + + private TabPanel tabPanel = new TabPanel(); + private ProgramTree programTree; + private DatasetTree datasetTree; + private JobTree jobTree; + private SearchTree resultTree; + private MonitorJobDescGrid jobDescGrid; + private SearchGrid searchGrid; + private JobDescPopupPanel newJob = new JobDescPopupPanel(Constants.studioUIMsg.createJob()); + protected ParameterPopupPanel paramPopup = new ParameterPopupPanel(); + private Widget mainLayout; + private DiagramController nowDiagramColler ; + private HistoryPopupPanel historyPopupPanel; + + LayoutPanel layoutPanel = new LayoutPanel(); + HorizontalPanel btnPanel2 = new HorizontalPanel(); + + public MonitorView() { + mainLayout = this.createMainLayout(); + } + + public void initTabPanel() { + tabPanel.clear(); + tabPanel.setWidth("100%"); + tabPanel.setTitle("myDisclosurePanel-headerView"); + tabPanel.add(programTree, Constants.studioUIMsg.program(), true); + tabPanel.add(datasetTree, Constants.studioUIMsg.data(), true); + tabPanel.add( jobTree, Constants.studioUIMsg.job(), true ); + tabPanel.selectTab(0); + } + + @Override + public Widget createMainLayout() { + SplitLayoutPanel splitLayout = new SplitLayoutPanel(); + + + StackLayoutPanel stack = new StackLayoutPanel(Unit.EM); + stack.setStyleName("sp"); + ScrollPanel leftcrp = new ScrollPanel(); + leftcrp.setSize("100%", "100%"); + VerticalPanel vPanel = new VerticalPanel(); + vPanel.setWidth("100%"); + + programTree = ProgramTreeLoader.load(AppController.email); + datasetTree = DatasetTreeLoader.load(AppController.email); + jobTree = JobTreeLoader.load(AppController.email); + resultTree = new SearchTree(); + initTabPanel(); + DisclosurePanel distackleft = new DisclosureStackPanel("Search") + .asWidget(); + searchGrid = new SearchGrid(programTree,datasetTree,jobTree,resultTree); + distackleft.setContent(searchGrid); + SimplePanel tabSimPanel = new SimplePanel(); + tabSimPanel.add(tabPanel); + + vPanel.add(tabSimPanel); + vPanel.add(distackleft); + leftcrp.add(vPanel); + stack.add(leftcrp, "", 0); + + StackLayoutPanel stackright = new StackLayoutPanel(Unit.EM); + stackright.setStyleName("sp"); + DisclosurePanel distackright1 = new DisclosureStackPanel(Constants.studioUIMsg.jobPanelTitle()) + .asWidget(); + DisclosurePanel distackright2 = new DisclosureStackPanel(Constants.studioUIMsg.modulePanelTitle()) + .asWidget(); + ScrollPanel scvp = new ScrollPanel(); + VerticalPanel verticalPanel = new VerticalPanel(); + verticalPanel.setWidth("100%"); + + HorizontalPanel btnPanel = new HorizontalPanel(); + historyBtn.removeStyleName("gwt-Button"); + historyBtn.addStyleName("history-button-style"); + submitBtn.setEnabled( false ); + submitBtn.removeStyleName("gwt-Button"); + submitBtn.addStyleName("button-style"); + clearBtn.removeStyleName("gwt-Button"); + clearBtn.addStyleName("button-style"); + cloneBtn.removeStyleName("gwt-Button"); + cloneBtn.addStyleName("button-style"); + refreshBtn.removeStyleName("gwt-Button"); + refreshBtn.addStyleName("button-style"); + stopBtn.removeStyleName("gwt-Button"); + stopBtn.addStyleName("button-style"); + + btnPanel.add(historyBtn); + btnPanel.add(new HTML("  ")); + btnPanel.add(submitBtn); + btnPanel.add(new HTML("  ")); + btnPanel.add(clearBtn); + btnPanel.add(new HTML("  ")); + btnPanel.add(cloneBtn); + btnPanel.add(new HTML("  ")); + btnPanel.add(stopBtn); + btnPanel.add(new HTML("  ")); + btnPanel.add(refreshBtn); + + + btnPanel2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); + btnPanel2.add(btnPanel); + btnPanel2.addStyleName("btnPanel"); + + splitLayout.addWest(stack, 200); + + jobDescGrid = new MonitorJobDescGrid(); + + distackright1.setContent(jobDescGrid); + distackright2.setContent(propPanel); + verticalPanel.add(distackright1); + verticalPanel.add(distackright2); + scvp.add(verticalPanel); + stackright.add(scvp, "", 0); + splitLayout.addEast(stackright, 287); + + // Use different controllers in different classes + setController(new MonitorController(Constants.CONTROLLER_WIDTH, + Constants.CONTROLLER_HEIGHT)); + rebuiltLayoutPanel(getController()); + splitLayout.add(layoutPanel); + + return splitLayout; + } + + @Override + public Button getClearButton() { + return clearBtn; + } + + @Override + public Button getSubmitButton() { + return submitBtn; + } + + @Override + public Button getRefreshButton() { + return refreshBtn; + } + + @Override + public Button getCloneButton() { + return cloneBtn; + } + + @Override + public TabPanel getTabPanel(){ + return tabPanel; + } + + @Override + public ProgramTree getProgramTree() { + return programTree; + } + + @Override + public DatasetTree getDatasetTree() { + return datasetTree; + } + @Override + public JobTree getJobTree() { + return jobTree; + } + @Override + public SearchTree getResultTree() { + return resultTree; + } + @Override + public MonitorJobDescGrid getJobDescGrid() { + return jobDescGrid; + } + + @Override + public Button getStopButton() { + return stopBtn; + } + + @Override + public Button getHistoryButton() { + return historyBtn; + } + + @Override + public MonitorController getController() { + return (MonitorController) super.getController(); + } + + + @Override + public ParameterPopupPanel getParamPopup() { + return paramPopup; + } + + @Override + public ProgramWidget getPopupWidget() { + return programTree.getPopupWidget(); + } + + @Override + public Widget asWidget() { + + DockLayoutPanel dockLayout = new DockLayoutPanel(Unit.PX); + + dockLayout.addNorth(headerView, 35); + dockLayout.add(mainLayout); + + return dockLayout; + } + + @Override + public HeaderView getHeaderView() { + return headerView; + } + + @Override + public JobDescPopupPanel getNewJobPopup() { + return this.newJob; + } + + public LayoutPanel getLayoutPanel() { + return layoutPanel; + } + + public void setLayoutPanel(LayoutPanel layoutPanel) { + this.layoutPanel = layoutPanel; + } + @Override + public DiagramController getNowDiagramColler() { + return nowDiagramColler; + } + + public void setNowDiagramColler(DiagramController nowDiagramColler) { + this.nowDiagramColler = nowDiagramColler; + } + + public void rebuiltLayoutPanel(DiagramController controller){ + controller.setGenerator(this); + controller.setConnectionFactory(OozieConnectionFactory.singleton); + nowDiagramColler = controller; + + if(AppController.email.equals("guest") || !AppController.power.split("")[2].equals("1")){ + } + + layoutPanel.clear(); + layoutPanel.add(btnPanel2); + layoutPanel.setWidgetVerticalPosition(btnPanel2, Alignment.END); + layoutPanel.add(controller.getViewAsScrollPanel()); + } + + @Override + public HistoryPopupPanel getHistoryPopup(String jobId,boolean isExample, + HandlerManager eventBus) { + // TODO Auto-generated method stub + historyPopupPanel = new HistoryPopupPanel(jobId, isExample, eventBus); + return historyPopupPanel; + } } diff --git a/src/main/java/eml/studio/client/mvp/view/RegisterView.java b/src/main/java/eml/studio/client/mvp/view/RegisterView.java index eea879f..d3bef64 100644 --- a/src/main/java/eml/studio/client/mvp/view/RegisterView.java +++ b/src/main/java/eml/studio/client/mvp/view/RegisterView.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.mvp.view; import eml.studio.client.mvp.AppController; @@ -21,131 +26,131 @@ */ public class RegisterView extends Composite { - interface ResetpwdViewUiBinder extends UiBinder { - } - - private static ResetpwdViewUiBinder ourUiBinder = GWT.create(ResetpwdViewUiBinder.class); - - @UiField - Anchor register; - - @UiField - Label registerUsr; - - @UiField - Label registerPwd; - - @UiField - Label registerVer; - - @UiField - Label registerCmp; - - @UiField - Label registerPst; - - @UiField - TextBox usrBox; - - @UiField - Label usrerrorLabel; - - @UiField - PasswordTextBox pwdBox; - - @UiField - Label pwderrorLabel; - - @UiField - PasswordTextBox verBox; - - @UiField - Label vererrorLabel; - - @UiField - TextBox cmpBox; - - @UiField - Label cmperrorLabel; - - @UiField - TextBox pstBox; - - @UiField - Label psterrorLabel; - - @UiField - Button confirmBtn; - - @UiField - HTMLPanel container; - - public RegisterView() { - initWidget(ourUiBinder.createAndBindUi(this)); - - register.setText( Constants.registerUIMsg.register() ); - registerUsr.setText( Constants.registerUIMsg.registerUsr() ); - registerPwd.setText( Constants.registerUIMsg.registerPwd() ); - registerVer.setText( Constants.registerUIMsg.registerVer() ); - registerCmp.setText( Constants.registerUIMsg.registerCmp() ); - registerPst.setText( Constants.registerUIMsg.registerPst() ); - - confirmBtn.removeStyleName("gwt-Button"); - confirmBtn.setText( Constants.registerUIMsg.confirm() ); - confirmBtn.getElement().getStyle().setMarginLeft(100, Unit.PX); - confirmBtn.getElement().getStyle().setMarginTop(50, Unit.PX); - confirmBtn.getElement().getStyle().setMarginBottom(100, Unit.PX); - } - - public TextBox getUsernameBox(){ - return usrBox; - } - - public Label getUsrerrorLabel(){ - return usrerrorLabel; - } - - public TextBox getPasswordBox(){ - return pwdBox; - } - - public Label getPwderrorLabel(){ - return pwderrorLabel; - } - - public TextBox getVerpwdBox(){ - return verBox; - } - - public Label getVererrorLabel(){ - return vererrorLabel; - } - - public TextBox getCompanyBox(){ - return cmpBox; - } - - public Label getCmperrorLabel(){ - return cmperrorLabel; - } - - public TextBox getPositionBox(){ - return pstBox; - } - - public Label getPsterrorLabel(){ - return psterrorLabel; - } - - public Button getConfirmBtn() { - return confirmBtn; - } - - public String getUsername(){ - return AppController.username; - } - - public String getEmail(){ - return AppController.email; - } + interface ResetpwdViewUiBinder extends UiBinder { + } + + private static ResetpwdViewUiBinder ourUiBinder = GWT.create(ResetpwdViewUiBinder.class); + + @UiField + Anchor register; + + @UiField + Label registerUsr; + + @UiField + Label registerPwd; + + @UiField + Label registerVer; + + @UiField + Label registerCmp; + + @UiField + Label registerPst; + + @UiField + TextBox usrBox; + + @UiField + Label usrerrorLabel; + + @UiField + PasswordTextBox pwdBox; + + @UiField + Label pwderrorLabel; + + @UiField + PasswordTextBox verBox; + + @UiField + Label vererrorLabel; + + @UiField + TextBox cmpBox; + + @UiField + Label cmperrorLabel; + + @UiField + TextBox pstBox; + + @UiField + Label psterrorLabel; + + @UiField + Button confirmBtn; + + @UiField + HTMLPanel container; + + public RegisterView() { + initWidget(ourUiBinder.createAndBindUi(this)); + + register.setText( Constants.registerUIMsg.register() ); + registerUsr.setText( Constants.registerUIMsg.registerUsr() ); + registerPwd.setText( Constants.registerUIMsg.registerPwd() ); + registerVer.setText( Constants.registerUIMsg.registerVer() ); + registerCmp.setText( Constants.registerUIMsg.registerCmp() ); + registerPst.setText( Constants.registerUIMsg.registerPst() ); + + confirmBtn.removeStyleName("gwt-Button"); + confirmBtn.setText( Constants.registerUIMsg.confirm() ); + confirmBtn.getElement().getStyle().setMarginLeft(100, Unit.PX); + confirmBtn.getElement().getStyle().setMarginTop(50, Unit.PX); + confirmBtn.getElement().getStyle().setMarginBottom(100, Unit.PX); + } + + public TextBox getUsernameBox(){ + return usrBox; + } + + public Label getUsrerrorLabel(){ + return usrerrorLabel; + } + + public TextBox getPasswordBox(){ + return pwdBox; + } + + public Label getPwderrorLabel(){ + return pwderrorLabel; + } + + public TextBox getVerpwdBox(){ + return verBox; + } + + public Label getVererrorLabel(){ + return vererrorLabel; + } + + public TextBox getCompanyBox(){ + return cmpBox; + } + + public Label getCmperrorLabel(){ + return cmperrorLabel; + } + + public TextBox getPositionBox(){ + return pstBox; + } + + public Label getPsterrorLabel(){ + return psterrorLabel; + } + + public Button getConfirmBtn() { + return confirmBtn; + } + + public String getUsername(){ + return AppController.username; + } + + public String getEmail(){ + return AppController.email; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/mvp/view/ResetpwdView.java b/src/main/java/eml/studio/client/mvp/view/ResetpwdView.java index 4d24c10..7c70be2 100644 --- a/src/main/java/eml/studio/client/mvp/view/ResetpwdView.java +++ b/src/main/java/eml/studio/client/mvp/view/ResetpwdView.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.mvp.view; import eml.studio.client.mvp.AppController; diff --git a/src/main/java/eml/studio/client/resources/Resources.java b/src/main/java/eml/studio/client/resources/Resources.java index 2578b86..587d9b2 100644 --- a/src/main/java/eml/studio/client/resources/Resources.java +++ b/src/main/java/eml/studio/client/resources/Resources.java @@ -11,14 +11,14 @@ public interface Resources extends ClientBundle { - Resources instance = GWT.create(Resources.class); + Resources instance = GWT.create(Resources.class); - @Source("dir_close.png") - ImageResource getTreeClosed(); + @Source("dir_close.png") + ImageResource getTreeClosed(); - @Source("dir_open.png") - ImageResource getTreeOpen(); + @Source("dir_open.png") + ImageResource getTreeOpen(); - @Source("dir_close.png") - ImageResource getTreeLeaf(); + @Source("dir_close.png") + ImageResource getTreeLeaf(); } diff --git a/src/main/java/eml/studio/client/rpc/AccountService.java b/src/main/java/eml/studio/client/rpc/AccountService.java index cf3a4df..365eeaa 100644 --- a/src/main/java/eml/studio/client/rpc/AccountService.java +++ b/src/main/java/eml/studio/client/rpc/AccountService.java @@ -14,37 +14,126 @@ @RemoteServiceRelativePath("accountservice") public interface AccountService extends RemoteService { - int getSize(Account account) throws Exception; + /** + * Get the quantity of all valid Accounts + * + * @param account target account + * @return size of target account + */ + int getSize(Account account) throws Exception; - // --------get all accounts --------- - List findValid(Account account, int start, int size) throws Exception; - - // ------- get account informations --------- - Account getAccountInfo(Account account); - - // ------ register -------------- - String register(Account account); + /** + * Get all valid Accounts from database(except current user & admin) + * + * @param account target account + * @param start start position + * @param size number of valid account + * @return list of target accounts + */ + List findValid(Account account, int start, int size) throws Exception; + + /** + * Get information of an account + * + * @param account target account + * @return account object with information + */ + Account getAccountInfo(Account account); + + /** + * Register an account + * + * @param account target account + * @return "[success]" + account.getUsername() + account.getEmail() or NULL + */ + String register(Account account); - Account verify(String token); + /** + * Verify a token + * + * @param verifytoken + * @return account object + */ + Account verify(String token); - // ------- login ------------- - Account login(Account account); + /** + * Login an account + * + * @param account target account + * @return account object + */ + Account login(Account account); - Account isLogin(); + /** + * Which account is in the status of login + * + * @return login account + */ + Account isLogin(); - Account autoLogin(Account account); + /** + * Auto login service + * + * @param account target account + * @return account after login + */ + Account autoLogin(Account account); - void logout(); + /** + * Log out + */ + void logout(); - // ------- modify account ------------- - String modifyInfo(Account account); - String modifyPassword(String account); - Account updatePower(Account account); - - // ------- reset account password ----- - Account resetPassword(Account account); + /** + * Change the information of user + * + * @param account + * @return status account + */ + String modifyInfo(Account account); - // --------- delete account --------- - String deleteAccount(Account account); + /** + * Change the password of user + * + * @param account format:"email password" + * @return status string, format: "[success] username email" + */ + String modifyPassword(String account); + + /** + * Change the power of user + * + * @param account format:"email" + * @return status account + */ + Account updatePower(Account account); + + /** + * Reset the password of user + * + * @param account format:"email password" + * @return status string format:"[success] username email" + */ + Account resetPassword(Account account); + + /** + * Delete an account + * + * @param account target account + * @return "success" or "email doesn't exist" + */ + String deleteAccount(Account account); + + /** + * Search account + * + * @param currentAccount + * @param account + * @param limitStart + * @param limitSize + * @return + * @throws Exception + */ + List search(Account currentAccount, Account account, int limitStart, int limitSize) throws Exception; } diff --git a/src/main/java/eml/studio/client/rpc/AccountServiceAsync.java b/src/main/java/eml/studio/client/rpc/AccountServiceAsync.java index 4205ad9..d6f96c8 100644 --- a/src/main/java/eml/studio/client/rpc/AccountServiceAsync.java +++ b/src/main/java/eml/studio/client/rpc/AccountServiceAsync.java @@ -38,4 +38,6 @@ public interface AccountServiceAsync { void resetPassword(Account account, AsyncCallback callback); void deleteAccount(Account account, AsyncCallback callback); + + void search(Account currentAccount, Account account, int limitStart, int limitSize, AsyncCallback> callback); } diff --git a/src/main/java/eml/studio/client/rpc/CategoryService.java b/src/main/java/eml/studio/client/rpc/CategoryService.java index 7c29f72..5f1fa78 100644 --- a/src/main/java/eml/studio/client/rpc/CategoryService.java +++ b/src/main/java/eml/studio/client/rpc/CategoryService.java @@ -6,25 +6,83 @@ package eml.studio.client.rpc; import java.util.List; + import eml.studio.shared.model.Category; + import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @RemoteServiceRelativePath("categoryservice") public interface CategoryService extends RemoteService { - int getSize() throws Exception; - - List getCategory() throws Exception; + /** + * Get the quantity of all valid Accounts + * + * @return + * @throws Exception + */ + int getSize() throws Exception; + + /** + * Get the category of Programs from database + * + * @return category group list + * @throws Exception + */ + List getCategory() throws Exception; + + /** + * Get the category of id from database + * + * @param id category id + * @return category object + * @throws Exception + */ + Category getCategory(String id) throws Exception; + + /** + * Get the category list searched by start and size + * + * @param start + * @param size + * @return category list + * @throws Exception + */ + List getCategory(int start, int size) throws Exception; + + /** + * Get one category's info from database + * + * @param category category + * @param str category string + */ + List getCategory(Category category, String str) throws Exception; - Category getCategory(String id) throws Exception; + /** + * Insert category to database + * + * @param category + * @return success or error string + */ + String insertCategory(Category category); - List getCategory(int start, int size) throws Exception; + /** + * Delete a category + * + * @param category target category + * @return category + */ + Category deleteCategory(Category category); - List getCategory(Category category, String str) throws Exception; - - String insertCategory(Category category); - - Category deleteCategory(Category category); + /** + * Search category + * + * @param category + * @param limitStart + * @param limitSize + * @return + * @throws Exception + */ + List search(Category category, int limitStart, int limitSize) throws Exception; } diff --git a/src/main/java/eml/studio/client/rpc/CategoryServiceAsync.java b/src/main/java/eml/studio/client/rpc/CategoryServiceAsync.java index 5d05f31..1c341a8 100644 --- a/src/main/java/eml/studio/client/rpc/CategoryServiceAsync.java +++ b/src/main/java/eml/studio/client/rpc/CategoryServiceAsync.java @@ -26,9 +26,5 @@ public interface CategoryServiceAsync { void deleteCategory(Category category, AsyncCallback callback); -// void getCateToPath(String id, String str, AsyncCallback callback); -// -// void getPathToCate(String id, String path, AsyncCallback callback); -// -// void getCateIdMap(AsyncCallback> callback); + void search(Category category, int limitStart, int limitSize, AsyncCallback> callback); } diff --git a/src/main/java/eml/studio/client/rpc/ChartService.java b/src/main/java/eml/studio/client/rpc/ChartService.java new file mode 100644 index 0000000..1f2fa83 --- /dev/null +++ b/src/main/java/eml/studio/client/rpc/ChartService.java @@ -0,0 +1,39 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.rpc; + +import java.util.List; + +import com.google.gwt.user.client.rpc.RemoteService; +import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; + +@RemoteServiceRelativePath("chartservice") +public interface ChartService extends RemoteService { + /** + * Get bar chart data option string to draw the chart + * + * @param filePath data file path + * @param dataType data type + * @param columns data all columns + * @param columnName select data column + * @param binSize top-k data frequence to show + * @param logScale if the value should be logged (log(value)) + * @return + * @throws IllegalArgumentException + */ + String barChartServer(String filePath, String dataType, List columns, String columnName,int binSize, boolean logScale) throws IllegalArgumentException; + + /** + * Get bar chart data option string to draw the chart + * + * @param name if the x_axis and y_axis should be reverse, false is reverse + * @param labels x_axis + * @param datas y_axis + * @return + * @throws IllegalArgumentException + */ + String barChartServer(Boolean name,String[] labels, double[] datas) throws IllegalArgumentException; +} diff --git a/src/main/java/eml/studio/client/rpc/ChartServiceAsync.java b/src/main/java/eml/studio/client/rpc/ChartServiceAsync.java new file mode 100644 index 0000000..1205642 --- /dev/null +++ b/src/main/java/eml/studio/client/rpc/ChartServiceAsync.java @@ -0,0 +1,20 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.rpc; + +import java.util.List; + +import com.google.gwt.user.client.rpc.AsyncCallback; + +public interface ChartServiceAsync { + + void barChartServer(Boolean input, String[] labels, double[] datas, AsyncCallback callback) + throws IllegalArgumentException; + + void barChartServer(String filePath, String dataType, List columns, String columnName, int binSize, boolean logScale, AsyncCallback callback) + throws IllegalArgumentException; + +} diff --git a/src/main/java/eml/studio/client/rpc/DataAnalysisService.java b/src/main/java/eml/studio/client/rpc/DataAnalysisService.java new file mode 100644 index 0000000..f4fb2e6 --- /dev/null +++ b/src/main/java/eml/studio/client/rpc/DataAnalysisService.java @@ -0,0 +1,59 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.rpc; + +import java.util.LinkedHashMap; +import java.util.List; + +import eml.studio.shared.util.DataFeature; + +import com.google.gwt.user.client.rpc.RemoteService; +import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; + +@RemoteServiceRelativePath("analysisservice") +public interface DataAnalysisService extends RemoteService { + /** + * Extract data list common feature + * + * @param dataPath data path on hdfs + * @param dataType data type + * @param columns all data columns + * @param columnName select data column + * @return + */ + DataFeature extDataFeature(String dataPath,String dataType, Listcolumns, String columnName); + + /** + * Get page json string data from data path, a string str is a json string + * + * @param dataPath hdfs data path + * @param dataType data type + * @param columns all data columns + * @param start start index + * @param size page size + * @return + */ + List pageData(String dataPath,String dataType, Listcolumns, int start, int size); + + /** + * Get json data column(key: data column , value : data type(String or numberic)) + * + * @param dataPath data hdfs path + * @param dataType data type + * @return + */ + LinkedHashMap getDataColumn(String dataPath, String dataType); + + /** + * Get json data size + * + * @param dataPath data hdfs path + * @param dataType data type + * @return + */ + int getDataRows(String dataPath,String dataType); + +} diff --git a/src/main/java/eml/studio/client/rpc/DataAnalysisServiceAsync.java b/src/main/java/eml/studio/client/rpc/DataAnalysisServiceAsync.java new file mode 100644 index 0000000..2a8260c --- /dev/null +++ b/src/main/java/eml/studio/client/rpc/DataAnalysisServiceAsync.java @@ -0,0 +1,24 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.rpc; + +import java.util.LinkedHashMap; +import java.util.List; + +import eml.studio.shared.util.DataFeature; + +import com.google.gwt.user.client.rpc.AsyncCallback; + +public interface DataAnalysisServiceAsync { + void extDataFeature(String dataPath,String dataType, List columns, String columnName, AsyncCallback callback) + throws IllegalArgumentException; + + void pageData(String dataPath, String dataType,Listcolumns, int start, int size, AsyncCallback> callback); + + void getDataColumn(String dataPath, String dataType, AsyncCallback> callback); + + void getDataRows(String dataPath, String dataType, AsyncCallback callback); +} diff --git a/src/main/java/eml/studio/client/rpc/DatasetService.java b/src/main/java/eml/studio/client/rpc/DatasetService.java index 66841f0..38eef62 100644 --- a/src/main/java/eml/studio/client/rpc/DatasetService.java +++ b/src/main/java/eml/studio/client/rpc/DatasetService.java @@ -15,67 +15,177 @@ @RemoteServiceRelativePath("datasetservice") public interface DatasetService extends RemoteService { - int getSize() throws Exception; - - List loadPart(int start, int size) throws Exception; - - List load() throws Exception; - - Dataset load(String id) throws Exception; - - /** Load the data module */ - Dataset loadFile(String path) throws Exception; - - /** Preview the front line of the file */ - String previewFile(String src_uri, int head) throws Exception; - - /** Save the temporarily generated file copy to the data module database */ - void save(Dataset dataset, String src_uri) throws Exception; - - Dataset upload(Dataset dataset, String src_uri) throws Exception; - - String editCategory(String oldCate, String newCate) throws Exception; - - void edit(Dataset dataset) throws Exception; - - void delete(String id) throws Exception; - - void deprecate(String id) throws Exception; - - String download(String id) throws Exception; - - void upgrade(String id, String newID) throws Exception; - - /** - * To determine whether it is a catalog - * @param path file path - * @return - * @throws Exception - */ - boolean isDirectory(String path) throws Exception; - - /** - * Get a list of file paths in the directory - * @param path Directory of the path - * @return File path list - * @throws Exception - */ - List getDirFilesPath(String path) throws Exception; - - /** - * Determine if the file or directory exists on HDFS - * @param path File or directory address - * @return does it exist - * @throws Exception - */ - boolean isFileExist(String path) throws Exception; - /** - * Get the size of the file or directory file - * - * @param path File or directory address - * @return File size(kb) - * @throws Exception - */ - double getFileSize(String path) throws Exception; + /** + * Get the quantity of all Datasets + * + * @return + * @throws Exception + */ + int getSize() throws Exception; + + /** + * Get part of Datasets from database + * + * @param start start index + * @param size size of list + * @return list of dataset + * @throws Exception + */ + List loadPart(int start, int size) throws Exception; + + /** + * Load Dataset from database + * + * @return list of dataset + * @throws Exception + */ + List load() throws Exception; + + /** + * Load a Dataset with given id + * + * @param id of target dataset + * @return target dataset + * @throws Exception + */ + Dataset load(String id) throws Exception; + + /** + * Load a file from hdfs + * + * @param path path of target dataset in HDFS + * @return target dataset + * @throws Exception + */ + Dataset loadFile(String path) throws Exception; + + /** + * Preview the front line of the file + * + * @param src_uri source url + * @param head head line size + * @return + * @throws Exception + */ + String previewFile(String src_uri, int head) throws Exception; + + /** + * Save the intermediate generated data into the dataset + * + * @param dataset dataset to save + * @param src_uri the uri of target dataset in HDFS + * @throws Exception + */ + void save(Dataset dataset, String src_uri) throws Exception; + + /** + * Upload a new dataset + * + * @param dataset target dataset + * @param src_uri uri of target dataset in HDFS + * @return new dataset + * @throws Exception + */ + Dataset upload(Dataset dataset, String src_uri) throws Exception; + + /** + * Convert oldCate to newCate + * + * @param oldCate + * @param newCate + * @return + * @throws Exception + */ + String editCategory(String oldCate, String newCate) throws Exception; + + /** + * Edit dataset + * + * @param dataset target dataset after edited + * @throws Exception + */ + void edit(Dataset dataset) throws Exception; + + /** + * Delete a Dataset from database and HDFS + * + * @param id + * @throws Exception + */ + void delete(String id) throws Exception; + + /** + * Deprecate a dataset module + * + * @param id id of target dataset module + * @throws Exception + */ + void deprecate(String id) throws Exception; + + /** + * Download dataset from HDFS by id + * + * @param id + * @return dataset path on hdfs + * @throws Exception + */ + String download(String id) throws Exception; + + /** + * Upgrade a the old dataset + * + * @param id + * @param newID + * @throws Exception + */ + void upgrade(String id, String newID) throws Exception; + + /** + * To determine whether it is a catalog + * + * @param path file path + * @return + * @throws Exception + */ + boolean isDirectory(String path) throws Exception; + + /** + * Get a list of file paths in the directory + * + * @param path Directory of the path + * @return File path list + * @throws Exception + */ + List getDirFilesPath(String path) throws Exception; + + /** + * Determine if the file or directory exists on HDFS + * + * @param path File or directory address + * @return does it exist + * @throws Exception + */ + boolean isFileExist(String path) throws Exception; + /** + * Get the size of the file or directory file + * + * @param path File or directory address + * @return File size(kb) + * @throws Exception + */ + double getFileSize(String path) throws Exception; + + /** + * Search dataset + * + * @param dataset + * @param startDate + * @param endDate + * @param limitStart + * @param limitSize + * @return + * @throws Exception + */ + List search(Dataset dataset, String startDate, String endDate, int limitStart, int limitSize) throws Exception; } diff --git a/src/main/java/eml/studio/client/rpc/DatasetServiceAsync.java b/src/main/java/eml/studio/client/rpc/DatasetServiceAsync.java index dcfbb68..a6e1559 100644 --- a/src/main/java/eml/studio/client/rpc/DatasetServiceAsync.java +++ b/src/main/java/eml/studio/client/rpc/DatasetServiceAsync.java @@ -13,42 +13,41 @@ public interface DatasetServiceAsync { - void getSize(AsyncCallback callback); - - void loadPart(int start, int size, AsyncCallback> callback); - - /** Load all available datasets */ - void load(AsyncCallback> callback); + void getSize(AsyncCallback callback); - /** Load a dataset from database given its id */ - void load(String id, AsyncCallback callback); + void loadPart(int start, int size, AsyncCallback> callback); - /** Load a dataset from database given its id */ - void loadFile(String path, AsyncCallback callback); + void load(AsyncCallback> callback); - void previewFile(String src_uri, int head, AsyncCallback callback); + void load(String id, AsyncCallback callback); - void save(Dataset dataset, String src_uri, AsyncCallback callback); + void loadFile(String path, AsyncCallback callback); - void upload(Dataset dataset, String src_uri, AsyncCallback callback); + void previewFile(String src_uri, int head, AsyncCallback callback); - void editCategory(String oldCate, String newCate, AsyncCallback callback); - - void edit(Dataset dataset, AsyncCallback callback); + void save(Dataset dataset, String src_uri, AsyncCallback callback); - void delete(String id, AsyncCallback callback); + void upload(Dataset dataset, String src_uri, AsyncCallback callback); - void deprecate(String id, AsyncCallback callback); + void editCategory(String oldCate, String newCate, AsyncCallback callback); - void download(String id, AsyncCallback callback); + void edit(Dataset dataset, AsyncCallback callback); - void upgrade(String id, String newID, AsyncCallback callback); - - void isDirectory(String path,AsyncCallback callback); - - void getDirFilesPath(String path,AsyncCallback> callback); - - void isFileExist(String path,AsyncCallback callback); - - void getFileSize(String path,AsyncCallback callback); + void delete(String id, AsyncCallback callback); + + void deprecate(String id, AsyncCallback callback); + + void download(String id, AsyncCallback callback); + + void upgrade(String id, String newID, AsyncCallback callback); + + void isDirectory(String path,AsyncCallback callback); + + void getDirFilesPath(String path,AsyncCallback> callback); + + void isFileExist(String path,AsyncCallback callback); + + void getFileSize(String path,AsyncCallback callback); + + void search(Dataset dataset, String startDate, String endDate, int limitStart, int limitSize, AsyncCallback> callback); } diff --git a/src/main/java/eml/studio/client/rpc/ETLService.java b/src/main/java/eml/studio/client/rpc/ETLService.java new file mode 100644 index 0000000..d5f757a --- /dev/null +++ b/src/main/java/eml/studio/client/rpc/ETLService.java @@ -0,0 +1,69 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.rpc; +import com.google.gwt.user.client.rpc.RemoteService; +import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; + +import java.util.ArrayList; + +@RemoteServiceRelativePath("etlservice") +public interface ETLService extends RemoteService{ + /** + * Get tables from database + * + * @param url database url + * @param user database account + * @param passwd database password + * @return + * @throws Exception + */ + ArrayList SqlETLGetTables(String url, String user, + String passwd) throws Exception; + + /** + * Get table columns from some database + * + * @param url database url + * @param user database account + * @param passwd database password + * @param table database table + * @return + * @throws Exception + */ + ArrayList SqlETLGetColumns(String url, String user, + String passwd, String table) throws Exception; + + /** + * Get tables from hive + * + * @param url hive url + * @param user hive account + * @param passwd hive password + * @return + * @throws Exception + */ + ArrayList HiveETLGetTables(String url, String user, + String passwd) throws Exception; + + /** + * Get table columns from hive + * + * @param url hive url + * @param user hive account + * @param passwd hive password + * @param table hive table + * @return + * @throws Exception + */ + ArrayList HiveETLGetColumns(String url, String user, + String passwd, String table) throws Exception; +} + diff --git a/src/main/java/eml/studio/client/rpc/ETLServiceAsync.java b/src/main/java/eml/studio/client/rpc/ETLServiceAsync.java new file mode 100644 index 0000000..955e847 --- /dev/null +++ b/src/main/java/eml/studio/client/rpc/ETLServiceAsync.java @@ -0,0 +1,26 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.rpc; + +import com.google.gwt.user.client.rpc.AsyncCallback; + +import java.util.ArrayList; + + +public interface ETLServiceAsync { + + void SqlETLGetTables(String url, String user, String passwd, + AsyncCallback> callback) throws IllegalArgumentException; + + void SqlETLGetColumns(String url, String user, String passwd, + String table,AsyncCallback> callback)throws IllegalArgumentException; + + void HiveETLGetTables(String url, String user, String passwd, + AsyncCallback> callback)throws IllegalArgumentException; + + void HiveETLGetColumns(String url, String user, String passwd, + String table,AsyncCallback> callback) throws IllegalArgumentException; +} diff --git a/src/main/java/eml/studio/client/rpc/JobService.java b/src/main/java/eml/studio/client/rpc/JobService.java index 867dad2..0e5e117 100644 --- a/src/main/java/eml/studio/client/rpc/JobService.java +++ b/src/main/java/eml/studio/client/rpc/JobService.java @@ -5,10 +5,13 @@ */ package eml.studio.client.rpc; +import java.util.Date; import java.util.List; +import java.util.Set; import eml.studio.shared.graph.OozieGraph; import eml.studio.shared.model.BdaJob; +import eml.studio.shared.oozie.OozieAction; import eml.studio.shared.oozie.OozieJob; import com.google.gwt.user.client.rpc.RemoteService; @@ -17,46 +20,227 @@ @RemoteServiceRelativePath("jobservice") public interface JobService extends RemoteService { - String getJobGraphXML(String jobId) ; - - String getJobStatus(String jobId) ; - - void killJob(String jobId) ; - - void suspendJob(String jobId) ; - - void resumeJob(String jobId) ; - - void reRun(String jobId) ; - - void startJob(String jobId) ; - - /** Get the error output of a action (program) in a job */ - String getStdErr(String jobId, String actionName) ; - - /** Get the std output of a action (program) in a job */ - String getStdOut(String jobId, String actionName) ; - - void updateJobStatus(String jobId) ; - - void deleteJob(String jobId) ; - - BdaJob getJob(String jobId) ; - - List listRecentJobs() ; - - List listRecentUserJobs(String email) ; - - List listRecentExampleJobs() ; - - /** Get bda job infomation*/ - BdaJob getBdaJob(String jobId); - - /** Get oozJob infomation for dynamic update of bda job*/ - OozieJob synCurOozJob(String bdaJobId); - - BdaJob submit(String jobName, String bdaJobId, OozieGraph graph, + /** + * Get job's graphXML + * + * @param jobId target job id + * @return job graphXML string + */ + String getJobGraphXML(String jobId) ; + + /** + * Get a job status + * + * @param jobId target job id + * @return status string + */ + String getJobStatus(String jobId) ; + + /** + * Kill a job + * + * @param jobId target job id + */ + void killJob(String jobId) ; + + /** + * Suspend job from oozie by job id + * + * @param jobId target job id + */ + void suspendJob(String jobId) ; + + /** + * Resume job from oozie by job id + * + * @param jobId target job id + */ + void resumeJob(String jobId) ; + + /** + * Re run job from oozie by job id + * + * @param jobId target job id + */ + void reRun(String jobId) ; + + /** + * Start job from oozie by job id + * + * @param jobId target job id + */ + void startJob(String jobId) ; + + /** + * Get the error output of a action (program) in a job + * + * @param jobId target job id + * @param actionId target action in this job + * @return error string + */ + String getStdErr(String jobId, String actionName) ; + + /** + * Get the std output of a action (program) in a job + * + * @param jobId target job id + * @param actionId target action in this job + * @return stdout string + */ + String getStdOut(String jobId, String actionName) ; + + /** + * Update the status of a oozie job in database + * + * @param jobId + */ + void updateJobStatus(String jobId) ; + + /** + * Delete bdajob and related ooziejob and actions via job id + * + * @param jobId + */ + void deleteJob(String jobId) ; + + /** + * Get BdaJob(all info) form mysql + * + * @param jobId target job id + * @return Bdajob object + */ + BdaJob getJob(String jobId) ; + + /** + * List recent jobs from database + * + * @return recent jobs list + */ + List listRecentJobs() ; + + /** + * List recent user jobs by user email(account) + * + * @param email + * @return list of jobs + */ + List listRecentUserJobs(String email) ; + + /** + * List recent user example jobs + * + * @return the list of recent example jobs + */ + List listRecentExampleJobs() ; + + /** + * Get bda job infomation from database by job id + * + * @param jobId + * @return + */ + BdaJob getBdaJob(String jobId); + + /** + * Get oozJob infomation for dynamic update of bda job + * + * @param bdaJobId + * @return + */ + OozieJob synCurOozJob(String bdaJobId); + + /** + * Submit a bdajob + * + * @param jobName + * @param bdaJobId + * @param graph + * @param account + * @param desc + * @return + */ + BdaJob submit(String jobName, String bdaJobId, OozieGraph graph, String account, String desc); - void setExampleJobs(String jobId); + /** + * Set a job as example by job id + * + * @param jobId + */ + void setExampleJobs(String jobId); + + /** + * Get oozie job by oozie job id + * + * @param oozieJobId + * @return + */ + OozieJob getOozieJob(String oozieJobId); + + /** + * Get synchronize oozie job by oozie job id(include oozie actions) + * + * @param oozieJobId + * @return + */ + OozieJob getSynOozieJob(String oozieJobId); + + /** + * Sychronize cyrrebt oozie job by oozie job id + * + * @param oozieJobId + * @return + */ + OozieJob synCurOozJobByOozId(String oozieJobId); + + /** + * Get oozie action by oozie job id and oozie action name + * + * @param oozieJobId oozie job id + * @param actionName oozie action name + * @return + */ + OozieAction getOozieAction(String oozieJobId, String actionName); + + /** + * Get bdajob associate ooziejob record size + * + * @param bdaJobId bdajob id + * @param startTime start time + * @param endTme end time + * @param firstLoad if is first load the page should sys the oozie database + * @return + */ + Integer getRefOozieJobNum(String bdaJobId,Date startTime,Date endTime,boolean firstLoad); + + /** + * Get bdajob associate ooziejob page size + * + * @param bdaJobId + * @param start startIndex + * @param size pageSize + * @return + */ + List getRefOozieJobPage(String bdaJobId,int start, int size,Date startTime, Date endTime); + + /** + * Delete oozieJob by oozie job id + * + * @param oozJobId + */ + public void deleteOozieJob(String oozJobId); + + /** + * Delete batch oozie jobs by job ids + * + * @param oozJobIds + */ + public void deleteBatchOozieJob(Set oozJobIds); + + /** + * Update oozie job action status + * + * @param jobId oozie job id + */ + public void updateJobActionStatus(String jobId) ; } diff --git a/src/main/java/eml/studio/client/rpc/JobServiceAsync.java b/src/main/java/eml/studio/client/rpc/JobServiceAsync.java index a3c0e1d..3ddfb6c 100644 --- a/src/main/java/eml/studio/client/rpc/JobServiceAsync.java +++ b/src/main/java/eml/studio/client/rpc/JobServiceAsync.java @@ -5,52 +5,73 @@ */ package eml.studio.client.rpc; +import java.util.Date; import java.util.List; +import java.util.Set; import eml.studio.shared.graph.OozieGraph; import eml.studio.shared.model.BdaJob; +import eml.studio.shared.oozie.OozieAction; import eml.studio.shared.oozie.OozieJob; import com.google.gwt.user.client.rpc.AsyncCallback; public interface JobServiceAsync { - void getJobGraphXML(String jobId, AsyncCallback callback); + void getJobGraphXML(String jobId, AsyncCallback callback); - void getStdOut(String jobId, String actionName, AsyncCallback callback); + void getStdOut(String jobId, String actionName, AsyncCallback callback); - void getStdErr(String jobId, String actionName, AsyncCallback callback); + void getStdErr(String jobId, String actionName, AsyncCallback callback); - void getJobStatus(String jobId, AsyncCallback callback); + void getJobStatus(String jobId, AsyncCallback callback); - void killJob(String jobId, AsyncCallback callback); + void killJob(String jobId, AsyncCallback callback); - void reRun(String jobId, AsyncCallback callback); + void reRun(String jobId, AsyncCallback callback); - void suspendJob(String jobId, AsyncCallback callback); + void suspendJob(String jobId, AsyncCallback callback); - void resumeJob(String jobId, AsyncCallback callback); + void resumeJob(String jobId, AsyncCallback callback); - void startJob(String jobId, AsyncCallback callback); + void startJob(String jobId, AsyncCallback callback); - void updateJobStatus(String jobId, AsyncCallback callback); + void updateJobStatus(String jobId, AsyncCallback callback); - void deleteJob(String jobId, AsyncCallback callback); + void deleteJob(String jobId, AsyncCallback callback); - void getJob(String jobId, AsyncCallback callback); + void getJob(String jobId, AsyncCallback callback); - void listRecentExampleJobs(AsyncCallback> callback); + void listRecentExampleJobs(AsyncCallback> callback); - void listRecentJobs(AsyncCallback> callback); + void listRecentJobs(AsyncCallback> callback); - void listRecentUserJobs(String email, AsyncCallback> callback); - - void getBdaJob(String jobId, AsyncCallback callback); + void listRecentUserJobs(String email, AsyncCallback> callback); - void synCurOozJob(String bdaJobId, AsyncCallback callback); + void getBdaJob(String jobId, AsyncCallback callback); - void setExampleJobs(String jobId, AsyncCallback callback); + void synCurOozJob(String bdaJobId, AsyncCallback callback); - void submit(String jobName, String bdaJobId, OozieGraph graph, String account, - String desc, AsyncCallback callback); + void setExampleJobs(String jobId, AsyncCallback callback); + + void submit(String jobName, String bdaJobId, OozieGraph graph, String account, + String desc, AsyncCallback callback); + + void getOozieJob(String oozieJobId,AsyncCallback callback); + + void getSynOozieJob(String oozieJobId,AsyncCallback callback); + + void synCurOozJobByOozId(String oozieJobId,AsyncCallback callback); + + void getOozieAction(String oozieJobId, String actionName, AsyncCallback callback); + + void getRefOozieJobNum(String bdaJobId,Date startTime,Date endTime, boolean firstLoad , AsyncCallback callback); + + void getRefOozieJobPage(String bdaJobId,int start, int size, Date startTime, Date endTime, AsyncCallback> callback); + + void deleteOozieJob(String oozJobId,AsyncCallback callback); + + void deleteBatchOozieJob(Set oozJobIds,AsyncCallback callback); + + void updateJobActionStatus(String jobId, AsyncCallback callback); } diff --git a/src/main/java/eml/studio/client/rpc/MailService.java b/src/main/java/eml/studio/client/rpc/MailService.java index a3d64da..ee89240 100644 --- a/src/main/java/eml/studio/client/rpc/MailService.java +++ b/src/main/java/eml/studio/client/rpc/MailService.java @@ -13,8 +13,31 @@ @RemoteServiceRelativePath("mailService") public interface MailService extends RemoteService { + /** + * Verify that the mailbox exists + * + * @param account + * @return boolean, format:true/false + * + */ Account VerifyEmail(Account account); + + /** + * Verify that the registration link is valid + * + * @param url + * @return boolean, format:true/false + */ String VerifyLink(String url); + + /** + * Send email + * + * @param base_url + * @param account + * @param flag + * @return boolean, format:true/false + */ String SendMail(String base_url, Account account, String flag); } diff --git a/src/main/java/eml/studio/client/rpc/MailServiceAsync.java b/src/main/java/eml/studio/client/rpc/MailServiceAsync.java index 129d5a6..bc6c83f 100644 --- a/src/main/java/eml/studio/client/rpc/MailServiceAsync.java +++ b/src/main/java/eml/studio/client/rpc/MailServiceAsync.java @@ -12,7 +12,9 @@ public interface MailServiceAsync { void VerifyEmail(Account account, AsyncCallback callback); + void VerifyLink(String url, AsyncCallback callback); + void SendMail(String base_url, Account account, String flag, AsyncCallback asyncCallback); } diff --git a/src/main/java/eml/studio/client/rpc/ProgramService.java b/src/main/java/eml/studio/client/rpc/ProgramService.java index ce2953e..dfcff53 100644 --- a/src/main/java/eml/studio/client/rpc/ProgramService.java +++ b/src/main/java/eml/studio/client/rpc/ProgramService.java @@ -13,30 +13,123 @@ @RemoteServiceRelativePath("programservice") public interface ProgramService extends RemoteService { - int getSize() throws Exception; - - List loadPart(int start, int size) throws Exception; - - /** Load all available programs */ - List load() throws Exception; + /** + * Get the quantity of all Programs + * + * @return size of programs + * @throws Exception + */ + int getSize() throws Exception; - /** Load a program given its id */ - Program load(String id) throws Exception; + /** + * Get part of Programs from database + * + * @param start start index + * @param size window size + * @return list of part of programs + * @throws Exception + */ + List loadPart(int start, int size) throws Exception; - List load(Program program) throws Exception; - - Program upload(Program program, String src_uri) throws Exception; + /** + * Load Programs from database + * + * @return list of programs + * @throws Exception + */ + List load() throws Exception; - String editCategory(String oldCate, String newCate) throws Exception; - - void edit(Program program) throws Exception; + /** + * Load a program with given id + * + * @param id target program id + * @return type:Program, target program module + * @throws Exception + */ + Program load(String id) throws Exception; - void upgrade(String id, String newID) throws Exception; + /** + * Load all programs + * + * @param program stochastic program + * @return type:List + * @throws Exception + */ + List load(Program program) throws Exception; - void deprecate(String id) throws Exception; + /** + * Upload a new program to mysql + * + * @param program new program + * @param uuid id of new item + * @return type:Program. new program + * @throws Exception + */ + Program upload(Program program, String src_uri) throws Exception; - void delete(String id) throws Exception; + /** + * Convert oldcat to new cate + * + * @param oldCate + * @param newCate + * @return + * @throws Exception + */ + String editCategory(String oldCate, String newCate) throws Exception; - String download(String id) throws Exception; + /** + * Edit program + * + * @param program program to be edited + * @throws Exception + */ + void edit(Program program) throws Exception; + + /** + * Upgrade a program + * + * @param id old program id + * @param new_id new program id + * @throws Exception + */ + void upgrade(String id, String newID) throws Exception; + + /** + * Deprecate a program + * + * @param id target program id + * @throws Exception + */ + void deprecate(String id) throws Exception; + + /** + * Delete a Program from database and HDFS + * + * @param id + * @throws Exception + */ + void delete(String id) throws Exception; + + /** + * Download a program from HDFS + * + * @param id + * @return program path on hdfs + * @throws Exception + */ + String download(String id) throws Exception; + + /** + * Search program + * + * @param program + * @param startDate + * @param endDate + * @param limitStart + * @param limitSize + * @return + * @throws Exception + */ + List search(Program program, String startDate, String endDate, int limitStart, int limitSize) throws Exception; } diff --git a/src/main/java/eml/studio/client/rpc/ProgramServiceAsync.java b/src/main/java/eml/studio/client/rpc/ProgramServiceAsync.java index cfc11b2..eb63c33 100644 --- a/src/main/java/eml/studio/client/rpc/ProgramServiceAsync.java +++ b/src/main/java/eml/studio/client/rpc/ProgramServiceAsync.java @@ -15,10 +15,8 @@ public interface ProgramServiceAsync { void loadPart(int start, int size, AsyncCallback> callback); - /** Load all available programs */ void load(AsyncCallback> callback); - /** Load a program given its id */ void load(String id, AsyncCallback callback); void load(Program program, AsyncCallback> callback); @@ -36,5 +34,7 @@ public interface ProgramServiceAsync { void download(String id, AsyncCallback callback); void upgrade(String id, String newID, AsyncCallback callback); + + void search(Program program, String startDate, String endDate, int limitStart, int limitSize, AsyncCallback> callback); } diff --git a/src/main/java/eml/studio/client/ui/binding/TextBinder.java b/src/main/java/eml/studio/client/ui/binding/TextBinder.java index 31d3253..6145873 100644 --- a/src/main/java/eml/studio/client/ui/binding/TextBinder.java +++ b/src/main/java/eml/studio/client/ui/binding/TextBinder.java @@ -12,7 +12,7 @@ */ public interface TextBinder { - void bind(T text, O obj); + void bind(T text, O obj); - void sync(T text, O obj); + void sync(T text, O obj); } diff --git a/src/main/java/eml/studio/client/ui/binding/TextBinderGenerator.java b/src/main/java/eml/studio/client/ui/binding/TextBinderGenerator.java index a456ce9..46df4c8 100644 --- a/src/main/java/eml/studio/client/ui/binding/TextBinderGenerator.java +++ b/src/main/java/eml/studio/client/ui/binding/TextBinderGenerator.java @@ -28,185 +28,185 @@ * This class auto generate method bind() and sync() for {@link TextBinder} */ public class TextBinderGenerator extends Generator { - private String implPackageName; - - private String implTypeName; - private JClassType parameterizedType1; - private JClassType parameterizedType2; - - @Override - public String generate(TreeLogger logger, GeneratorContext context, - String requestedClass) throws UnableToCompleteException { - - TypeOracle typeOracle = context.getTypeOracle(); - - JClassType objectType = typeOracle.findType(requestedClass); - if (objectType == null) { - logger.log(TreeLogger.ERROR, "Could not find type: " + requestedClass); - throw new UnableToCompleteException(); - } - - implTypeName = objectType.getSimpleSourceName() + "Impl"; - - implPackageName = objectType.getPackage().getName(); - - JClassType[] implementedTypes = objectType.getImplementedInterfaces(); - - // Can only implement one interface - if (implementedTypes == null - || implementedTypes.length != 1 - || !implementedTypes[0].getQualifiedSourceName().equals( - TextBinder.class.getName())) { - logger - .log( - TreeLogger.ERROR, - "The type: " + requestedClass - + " Must implement only one interface: " - + TextBinder.class.getName()); - throw new UnableToCompleteException(); - } - - // Get parameterized type - JParameterizedType parameterType = implementedTypes[0].isParameterized(); - if (parameterType == null) { - logger.log(TreeLogger.ERROR, "The type: " + requestedClass - + " Must implement only one parameterized interface: " - + TextBinder.class.getName()); - throw new UnableToCompleteException(); - } - - if (parameterType.getTypeArgs() == null - - || parameterType.getTypeArgs().length != 2) { - logger.log(TreeLogger.ERROR, - "The type: " + requestedClass - + " Must implement two parameterized interface: " - + TextBinder.class.getName() + " with two Parameter"); - throw new UnableToCompleteException(); - - } - - parameterizedType1 = parameterType.getTypeArgs()[0]; - parameterizedType2 = parameterType.getTypeArgs()[1]; - // logger.log(TreeLogger.INFO , - // parameterizedType2.getParameterizedQualifiedSourceName() +"\n" - // + parameterizedType2.getQualifiedSourceName()); - - ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory( - implPackageName, implTypeName); - - composerFactory.addImport(Map.class.getCanonicalName()); - composerFactory.addImport(List.class.getCanonicalName()); - // composerFactory.addImport(Field.class.getCanonicalName()); - composerFactory - .addImplementedInterface(objectType.getQualifiedSourceName()); - - PrintWriter printWriter = context.tryCreate(logger, implPackageName, - implTypeName); - if (printWriter != null) { - - SourceWriter sourceWriter = composerFactory.createSourceWriter(context, - printWriter); - - composeBindMethod(logger, sourceWriter); - composeSyncMethod(logger, sourceWriter); - sourceWriter.commit(logger); - - } - return implPackageName + "." + implTypeName; - } - - /** - * Generate method bind - */ - private void composeBindMethod(TreeLogger logger, SourceWriter sourceWriter) { - - logger.log(TreeLogger.INFO, ""); - String line = "public void bind(" - + parameterizedType1.getQualifiedSourceName() + " text, " - + parameterizedType2.getQualifiedSourceName() + " obj){"; - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - line = " System.out.println(\"Implement it now:)\");"; - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - ArrayList fields = new ArrayList(); - - JClassType curtype = parameterizedType2; - do { - - for (JField filed : curtype.getFields()) { - fields.add(filed); - } - curtype = curtype.getSuperclass(); - } while (!curtype.getName().equals("Object")); - - for (JField field : fields) { - String name = field.getName(); - String Name = name.substring(0, 1).toUpperCase() + name.substring(1); - line = " text.setText(\"" + name + "\", obj.get" + Name - + "().toString() );"; - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - } - line = "}"; - - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - } - - /** - * Generate method sync - */ - private void composeSyncMethod(TreeLogger logger, SourceWriter sourceWriter) { - - logger.log(TreeLogger.INFO, ""); - String line = "public void sync(" - + parameterizedType1.getQualifiedSourceName() + " text, " - + parameterizedType2.getQualifiedSourceName() + " obj){"; - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - line = " System.out.println(\"Implement it now:)\");"; - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - ArrayList fields = new ArrayList(); - - JClassType curtype = parameterizedType2; - do { - - for (JField filed : curtype.getFields()) { - fields.add(filed); - } - curtype = curtype.getSuperclass(); - } while (!curtype.getName().equals("Object")); - - for (JField field : fields) { - String name = field.getName(); - String Name = name.substring(0, 1).toUpperCase() + name.substring(1); - String type = field.getType().getQualifiedSourceName(); - String simType = field.getType().getSimpleSourceName(); - if ("java.lang.String".equals(type)) - line = " if( text.getText(\"" + name + "\") != null )obj.set" + Name - + "( text.getText(\"" + name + "\") );"; - else - line = " if( text.getText(\"" + name + "\") != null )obj.set" + Name - + "( " + type + ".parse" + simType + "( text.getText(\"" + name - + "\")) );"; - - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - } - line = "}"; - - sourceWriter.println(line); - logger.log(TreeLogger.INFO, line); - - } + private String implPackageName; + + private String implTypeName; + private JClassType parameterizedType1; + private JClassType parameterizedType2; + + @Override + public String generate(TreeLogger logger, GeneratorContext context, + String requestedClass) throws UnableToCompleteException { + + TypeOracle typeOracle = context.getTypeOracle(); + + JClassType objectType = typeOracle.findType(requestedClass); + if (objectType == null) { + logger.log(TreeLogger.ERROR, "Could not find type: " + requestedClass); + throw new UnableToCompleteException(); + } + + implTypeName = objectType.getSimpleSourceName() + "Impl"; + + implPackageName = objectType.getPackage().getName(); + + JClassType[] implementedTypes = objectType.getImplementedInterfaces(); + + // Can only implement one interface + if (implementedTypes == null + || implementedTypes.length != 1 + || !implementedTypes[0].getQualifiedSourceName().equals( + TextBinder.class.getName())) { + logger + .log( + TreeLogger.ERROR, + "The type: " + requestedClass + + " Must implement only one interface: " + + TextBinder.class.getName()); + throw new UnableToCompleteException(); + } + + // Get parameterized type + JParameterizedType parameterType = implementedTypes[0].isParameterized(); + if (parameterType == null) { + logger.log(TreeLogger.ERROR, "The type: " + requestedClass + + " Must implement only one parameterized interface: " + + TextBinder.class.getName()); + throw new UnableToCompleteException(); + } + + if (parameterType.getTypeArgs() == null + + || parameterType.getTypeArgs().length != 2) { + logger.log(TreeLogger.ERROR, + "The type: " + requestedClass + + " Must implement two parameterized interface: " + + TextBinder.class.getName() + " with two Parameter"); + throw new UnableToCompleteException(); + + } + + parameterizedType1 = parameterType.getTypeArgs()[0]; + parameterizedType2 = parameterType.getTypeArgs()[1]; + // logger.log(TreeLogger.INFO , + // parameterizedType2.getParameterizedQualifiedSourceName() +"\n" + // + parameterizedType2.getQualifiedSourceName()); + + ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory( + implPackageName, implTypeName); + + composerFactory.addImport(Map.class.getCanonicalName()); + composerFactory.addImport(List.class.getCanonicalName()); + // composerFactory.addImport(Field.class.getCanonicalName()); + composerFactory + .addImplementedInterface(objectType.getQualifiedSourceName()); + + PrintWriter printWriter = context.tryCreate(logger, implPackageName, + implTypeName); + if (printWriter != null) { + + SourceWriter sourceWriter = composerFactory.createSourceWriter(context, + printWriter); + + composeBindMethod(logger, sourceWriter); + composeSyncMethod(logger, sourceWriter); + sourceWriter.commit(logger); + + } + return implPackageName + "." + implTypeName; + } + + /** + * Generate method bind + */ + private void composeBindMethod(TreeLogger logger, SourceWriter sourceWriter) { + + logger.log(TreeLogger.INFO, ""); + String line = "public void bind(" + + parameterizedType1.getQualifiedSourceName() + " text, " + + parameterizedType2.getQualifiedSourceName() + " obj){"; + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + line = " System.out.println(\"Implement it now:)\");"; + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + ArrayList fields = new ArrayList(); + + JClassType curtype = parameterizedType2; + do { + + for (JField filed : curtype.getFields()) { + fields.add(filed); + } + curtype = curtype.getSuperclass(); + } while (!curtype.getName().equals("Object")); + + for (JField field : fields) { + String name = field.getName(); + String Name = name.substring(0, 1).toUpperCase() + name.substring(1); + line = " text.setText(\"" + name + "\", obj.get" + Name + + "().toString() );"; + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + } + line = "}"; + + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + } + + /** + * Generate method sync + */ + private void composeSyncMethod(TreeLogger logger, SourceWriter sourceWriter) { + + logger.log(TreeLogger.INFO, ""); + String line = "public void sync(" + + parameterizedType1.getQualifiedSourceName() + " text, " + + parameterizedType2.getQualifiedSourceName() + " obj){"; + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + line = " System.out.println(\"Implement it now:)\");"; + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + ArrayList fields = new ArrayList(); + + JClassType curtype = parameterizedType2; + do { + + for (JField filed : curtype.getFields()) { + fields.add(filed); + } + curtype = curtype.getSuperclass(); + } while (!curtype.getName().equals("Object")); + + for (JField field : fields) { + String name = field.getName(); + String Name = name.substring(0, 1).toUpperCase() + name.substring(1); + String type = field.getType().getQualifiedSourceName(); + String simType = field.getType().getSimpleSourceName(); + if ("java.lang.String".equals(type)) + line = " if( text.getText(\"" + name + "\") != null )obj.set" + Name + + "( text.getText(\"" + name + "\") );"; + else + line = " if( text.getText(\"" + name + "\") != null )obj.set" + Name + + "( " + type + ".parse" + simType + "( text.getText(\"" + name + + "\")) );"; + + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + } + line = "}"; + + sourceWriter.println(line); + logger.log(TreeLogger.INFO, line); + + } } diff --git a/src/main/java/eml/studio/client/ui/charts/DrawBarChart.java b/src/main/java/eml/studio/client/ui/charts/DrawBarChart.java new file mode 100644 index 0000000..aecf9cc --- /dev/null +++ b/src/main/java/eml/studio/client/ui/charts/DrawBarChart.java @@ -0,0 +1,67 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.ui.charts; + +/** + * Draw a histogram by js implementation, use java native method to generate javascript code + */ +public class DrawBarChart{ + + /** + * Draw a histogram by echart + * + * @param chartId chart id + * @param optionStr chart option string(use echart option to describe a chart) + */ + public static native void drawBarChart(String chartId, String optionStr)/*-{ + var myChart = $wnd.echarts.init($doc.getElementById(chartId)); + $wnd.onresize = myChart.resize; + option = eval('(' + optionStr + ')'); + + var magicTypes = new $wnd.Array(); + var types = option.toolbox.feature.magicType.type; + for (var i = 0; i < types.length; i++) { + magicTypes[i] = types[i]; + } + option.toolbox.feature.magicType.type = magicTypes; + + var xAxisArray = new $wnd.Array(); + for (var i = 0; i < option.xAxis.length; i++) { + var xAxisObj = option.xAxis[i]; + var xAxisDatas = new $wnd.Array(); + for (var j = 0; j < xAxisObj.data.length; j++) { + xAxisDatas[j] = xAxisObj.data[j]; + } + xAxisObj.data = xAxisDatas; + xAxisArray[i] = xAxisObj; + } + option.xAxis = xAxisArray; + + var yAxisArray = new $wnd.Array(); + for (var i = 0; i < option.yAxis.length; i++) { + yAxisArray[i] = option.yAxis[i]; + } + option.yAxis = yAxisArray; + + //seris + var serisArray = new $wnd.Array(); + for (var i = 0; i < option.series.length; i++) { + var serisObj = option.series[i]; + //series data + var dataArray = new $wnd.Array(); + for (var j = 0; j < serisObj.data.length; j++) { + dataArray[j] = serisObj.data[j]; + } + serisObj.data = dataArray; + + serisArray[i] = serisObj; + } + option.series = serisArray; + console.log(option); + myChart.setOption(option, true); + }-*/; + +} diff --git a/src/main/java/eml/studio/client/ui/connection/CommonConnectionFactory.java b/src/main/java/eml/studio/client/ui/connection/CommonConnectionFactory.java index af1da9f..b3c9b84 100644 --- a/src/main/java/eml/studio/client/ui/connection/CommonConnectionFactory.java +++ b/src/main/java/eml/studio/client/ui/connection/CommonConnectionFactory.java @@ -12,15 +12,14 @@ * Connection Factory */ public class CommonConnectionFactory extends AbstractConnectionFactory { - public static AbstractConnectionFactory singleton = new CommonConnectionFactory(); + public static AbstractConnectionFactory singleton = new CommonConnectionFactory(); - private CommonConnectionFactory() { - } + private CommonConnectionFactory() { + } - - @Override - public Connection buildConnection(DiagramController controller, Shape start, - Shape end) { - return new Connection(controller, start, end); - } + + @Override + public Connection buildConnection(DiagramController controller, Shape start, Shape end) { + return new Connection(controller, start, end); + } } diff --git a/src/main/java/eml/studio/client/ui/connection/Connection.java b/src/main/java/eml/studio/client/ui/connection/Connection.java index b210d8f..0afec9a 100644 --- a/src/main/java/eml/studio/client/ui/connection/Connection.java +++ b/src/main/java/eml/studio/client/ui/connection/Connection.java @@ -39,7 +39,7 @@ public class Connection implements Drawable, HasContextMenu { protected CssColor connectionColor = defaultConnectionColor; protected ContextMenu menu; - protected static String deleteMenuText = "删除"; + protected static String deleteMenuText = "Delete"; private boolean sync; private boolean allowSync = true; diff --git a/src/main/java/eml/studio/client/ui/menu/DatasetDeleteMenu.java b/src/main/java/eml/studio/client/ui/menu/DatasetDeleteMenu.java index ef5317e..b63dce2 100644 --- a/src/main/java/eml/studio/client/ui/menu/DatasetDeleteMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/DatasetDeleteMenu.java @@ -20,35 +20,35 @@ */ public class DatasetDeleteMenu { - public static MenuItem create(final DatasetLeaf node) { - - Command command = new MenuItemCommand(node) { - - @Override - public void execute() { - String id = node.getModule().getId(); - boolean y = Window.confirm("Ready to delete " + node.getText() + "?"); - if (y) { - DatasetServiceAsync svc = GWT.create(DatasetService.class); - svc.delete(id, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } - - @Override - public void onSuccess(Void result) { - node.delete(); - } - }); - } - - this.component.getContextMenu().hide(); - } - }; - - MenuItem item = new MenuItem("Delete", command); - return item; - } + public static MenuItem create(final DatasetLeaf node) { + + Command command = new MenuItemCommand(node) { + + @Override + public void execute() { + String id = node.getModule().getId(); + boolean y = Window.confirm("Ready to delete " + node.getText() + "?"); + if (y) { + DatasetServiceAsync svc = GWT.create(DatasetService.class); + svc.delete(id, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert(caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + node.delete(); + } + }); + } + + this.component.getContextMenu().hide(); + } + }; + + MenuItem item = new MenuItem("Delete", command); + return item; + } } diff --git a/src/main/java/eml/studio/client/ui/menu/DatasetDeprecateMenu.java b/src/main/java/eml/studio/client/ui/menu/DatasetDeprecateMenu.java index 05d2864..446f0e9 100644 --- a/src/main/java/eml/studio/client/ui/menu/DatasetDeprecateMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/DatasetDeprecateMenu.java @@ -20,33 +20,33 @@ */ public class DatasetDeprecateMenu { - public static MenuItem create(final DatasetLeaf node) { - Command command = new MenuItemCommand(node) { - @Override - public void execute() { - String id = node.getModule().getId(); - boolean y = Window.confirm("Ready to deprecate " + node.getModule().getName() + "?"); - if (y) { - DatasetServiceAsync svc = GWT.create(DatasetService.class); - svc.deprecate(id, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } - - @Override - public void onSuccess(Void result) { - node.delete(); - } - - }); - } - this.component.getContextMenu().hide(); - } - }; - - MenuItem item = new MenuItem("Deprecate", command); - return item; - } + public static MenuItem create(final DatasetLeaf node) { + Command command = new MenuItemCommand(node) { + @Override + public void execute() { + String id = node.getModule().getId(); + boolean y = Window.confirm("Ready to deprecate " + node.getModule().getName() + "?"); + if (y) { + DatasetServiceAsync svc = GWT.create(DatasetService.class); + svc.deprecate(id, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert(caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + node.delete(); + } + + }); + } + this.component.getContextMenu().hide(); + } + }; + + MenuItem item = new MenuItem("Deprecate", command); + return item; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/ui/menu/DatasetDownloadMenu.java b/src/main/java/eml/studio/client/ui/menu/DatasetDownloadMenu.java index 98efbf2..812ccd1 100644 --- a/src/main/java/eml/studio/client/ui/menu/DatasetDownloadMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/DatasetDownloadMenu.java @@ -20,59 +20,59 @@ * Create a menu for program downloading */ public class DatasetDownloadMenu { - private static final double MAX_DOWNLOAD_SIZE = 1000000; //Maximum file size (in kb) - protected static Logger logger = Logger.getLogger(DatasetDownloadMenu.class.getName()); - - public static MenuItem create(final DatasetLeaf node) { - Command command = new MenuItemCommand(node) { + private static final double MAX_DOWNLOAD_SIZE = 1000000; //Maximum file size (in kb) + protected static Logger logger = Logger.getLogger(DatasetDownloadMenu.class.getName()); - @Override - public void execute() { - String id = node.getModule().getId(); - final DatasetServiceAsync svc = GWT.create(DatasetService.class); - svc.download(id, new AsyncCallback() { + public static MenuItem create(final DatasetLeaf node) { + Command command = new MenuItemCommand(node) { - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } - - @Override - public void onSuccess(final String result) { - Window.alert("Start calculating the file size"); - svc.getFileSize(result, new AsyncCallback(){ + @Override + public void execute() { + String id = node.getModule().getId(); + final DatasetServiceAsync svc = GWT.create(DatasetService.class); + svc.download(id, new AsyncCallback() { @Override public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - logger.info("Failed to get download file size!"); + Window.alert(caught.getMessage()); } @Override - public void onSuccess(Double size) { - // TODO Auto-generated method stub - if(size(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.info("Failed to get download file size!"); + } - } + @Override + public void onSuccess(Double size) { + // TODO Auto-generated method stub + if(size() { + @Override + public void execute() { + String id = node.getModule().getJobId(); + boolean y = Window.confirm("Are you sure you want to join the example task?"); + if (y) { + JobServiceAsync srv = GWT.create(JobService.class); + srv.setExampleJobs(id, new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } + @Override + public void onFailure(Throwable caught) { + Window.alert(caught.getMessage()); + } - @Override - public void onSuccess(Void result) { - node.delete(); - } - }); - } - this.component.getContextMenu().hide(); - } - }; - MenuItem item = new MenuItem("Join example task", command); - return item; - } + @Override + public void onSuccess(Void result) { + node.delete(); + } + }); + } + this.component.getContextMenu().hide(); + } + }; + MenuItem item = new MenuItem("Join example task", command); + return item; + } } diff --git a/src/main/java/eml/studio/client/ui/menu/JobDeleteMenu.java b/src/main/java/eml/studio/client/ui/menu/JobDeleteMenu.java index 512c008..2b4bd6f 100644 --- a/src/main/java/eml/studio/client/ui/menu/JobDeleteMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/JobDeleteMenu.java @@ -20,33 +20,33 @@ */ public class JobDeleteMenu { - public static MenuItem create(final JobLeaf node) { - Command command = new MenuItemCommand(node) { - - @Override - public void execute() { - String id = node.getModule().getJobId(); - boolean y = Window.confirm("Are you sure you want to delete?"); - if (y) { - JobServiceAsync srv = GWT.create(JobService.class); - srv.deleteJob(id, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } - - @Override - public void onSuccess(Void result) { - node.delete(); - } - }); - } - this.component.getContextMenu().hide(); - } - }; - MenuItem item = new MenuItem("Delete", command); - return item; - } + public static MenuItem create(final JobLeaf node) { + Command command = new MenuItemCommand(node) { + + @Override + public void execute() { + String id = node.getModule().getJobId(); + boolean y = Window.confirm("Are you sure you want to delete?"); + if (y) { + JobServiceAsync srv = GWT.create(JobService.class); + srv.deleteJob(id, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert(caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + node.delete(); + } + }); + } + this.component.getContextMenu().hide(); + } + }; + MenuItem item = new MenuItem("Delete", command); + return item; + } } diff --git a/src/main/java/eml/studio/client/ui/menu/MenuItemCommand.java b/src/main/java/eml/studio/client/ui/menu/MenuItemCommand.java index 90ae0c6..70ff72e 100644 --- a/src/main/java/eml/studio/client/ui/menu/MenuItemCommand.java +++ b/src/main/java/eml/studio/client/ui/menu/MenuItemCommand.java @@ -13,10 +13,10 @@ */ public abstract class MenuItemCommand implements Command { - protected HasRightMouseUpMenu component; + protected HasRightMouseUpMenu component; - public MenuItemCommand(HasRightMouseUpMenu com) { - this.component = com; - } + public MenuItemCommand(HasRightMouseUpMenu com) { + this.component = com; + } } diff --git a/src/main/java/eml/studio/client/ui/menu/ProgramDeleteMenu.java b/src/main/java/eml/studio/client/ui/menu/ProgramDeleteMenu.java index 7f833fa..31d968e 100644 --- a/src/main/java/eml/studio/client/ui/menu/ProgramDeleteMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/ProgramDeleteMenu.java @@ -20,35 +20,35 @@ */ public class ProgramDeleteMenu { - public static MenuItem create(final ProgramLeaf node) { - - Command command = new MenuItemCommand(node) { - - @Override - public void execute() { - String id = node.getModule().getId(); - boolean y = Window.confirm("Are you ready to delete " + node.getText() + "?"); - if (y) { - ProgramServiceAsync svc = GWT.create(ProgramService.class); - svc.delete(id, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } - - @Override - public void onSuccess(Void result) { - node.delete(); - } - - }); - } - this.component.getContextMenu().hide(); - } - }; - - MenuItem item = new MenuItem("delete", command); - return item; - } + public static MenuItem create(final ProgramLeaf node) { + + Command command = new MenuItemCommand(node) { + + @Override + public void execute() { + String id = node.getModule().getId(); + boolean y = Window.confirm("Are you ready to delete " + node.getText() + "?"); + if (y) { + ProgramServiceAsync svc = GWT.create(ProgramService.class); + svc.delete(id, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert(caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + node.delete(); + } + + }); + } + this.component.getContextMenu().hide(); + } + }; + + MenuItem item = new MenuItem("delete", command); + return item; + } } diff --git a/src/main/java/eml/studio/client/ui/menu/ProgramDeprecateMenu.java b/src/main/java/eml/studio/client/ui/menu/ProgramDeprecateMenu.java index 572f517..d5afa30 100644 --- a/src/main/java/eml/studio/client/ui/menu/ProgramDeprecateMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/ProgramDeprecateMenu.java @@ -20,34 +20,34 @@ */ public class ProgramDeprecateMenu { - public static MenuItem create(final ProgramLeaf node) { - Command command = new MenuItemCommand(node) { - @Override - public void execute() { - String id = node.getModule().getId(); - boolean y = Window.confirm("Are you ready to deprecate " + node.getModule().getName() + "?"); - if (y) { - ProgramServiceAsync svc = GWT.create(ProgramService.class); - svc.deprecate(id, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } - - @Override - public void onSuccess(Void result) { - node.delete(); - } - - }); - } - this.component.getContextMenu().hide(); - } - - }; - - MenuItem item = new MenuItem("deprecate", command); - return item; - } + public static MenuItem create(final ProgramLeaf node) { + Command command = new MenuItemCommand(node) { + @Override + public void execute() { + String id = node.getModule().getId(); + boolean y = Window.confirm("Are you ready to deprecate " + node.getModule().getName() + "?"); + if (y) { + ProgramServiceAsync svc = GWT.create(ProgramService.class); + svc.deprecate(id, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert(caught.getMessage()); + } + + @Override + public void onSuccess(Void result) { + node.delete(); + } + + }); + } + this.component.getContextMenu().hide(); + } + + }; + + MenuItem item = new MenuItem("deprecate", command); + return item; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/ui/menu/ProgramDownloadMenu.java b/src/main/java/eml/studio/client/ui/menu/ProgramDownloadMenu.java index b08a953..a1cda1e 100644 --- a/src/main/java/eml/studio/client/ui/menu/ProgramDownloadMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/ProgramDownloadMenu.java @@ -20,34 +20,34 @@ */ public class ProgramDownloadMenu { - public static MenuItem create(final ProgramLeaf node) { - Command command = new MenuItemCommand(node) { - - @Override - public void execute() { - String id = node.getModule().getId(); - ProgramServiceAsync svc = GWT.create(ProgramService.class); - svc.download(id, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - Window.alert(caught.getMessage()); - } - - @Override - public void onSuccess(String result) { - String url = GWT.getModuleBaseURL().split("EML")[0] - + "EMLStudioMonitor/filedownload?filename=" + result; - Window.open(url, "_blank", - "status=0,toolbar=0,menubar=0,location=0"); - } - - }); - this.component.getContextMenu().hide(); - } - }; - - MenuItem item = new MenuItem("Download", command); - return item; - } + public static MenuItem create(final ProgramLeaf node) { + Command command = new MenuItemCommand(node) { + + @Override + public void execute() { + String id = node.getModule().getId(); + ProgramServiceAsync svc = GWT.create(ProgramService.class); + svc.download(id, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert(caught.getMessage()); + } + + @Override + public void onSuccess(String result) { + String url = GWT.getModuleBaseURL().split("EML")[0] + + "EMLStudioMonitor/filedownload?filename=" + result; + Window.open(url, "_blank", + "status=0,toolbar=0,menubar=0,location=0"); + } + + }); + this.component.getContextMenu().hide(); + } + }; + + MenuItem item = new MenuItem("Download", command); + return item; + } } diff --git a/src/main/java/eml/studio/client/ui/menu/ProgramEditMenu.java b/src/main/java/eml/studio/client/ui/menu/ProgramEditMenu.java index b85213d..048edc7 100644 --- a/src/main/java/eml/studio/client/ui/menu/ProgramEditMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/ProgramEditMenu.java @@ -18,19 +18,19 @@ */ public class ProgramEditMenu { - public static MenuItem create(final ProgramLeaf node, final ProgramTree tree) { + public static MenuItem create(final ProgramLeaf node, final ProgramTree tree) { - Command command = new MenuItemCommand(node) { - @Override - public void execute() { - EditProgramPanel panel = new EditProgramPanel(AppController.email,tree,node); - - panel.show(node.getModule()); - - this.component.getContextMenu().hide(); - } - }; - MenuItem item = new MenuItem("Edit", command); - return item; - } + Command command = new MenuItemCommand(node) { + @Override + public void execute() { + EditProgramPanel panel = new EditProgramPanel(AppController.email,tree,node); + + panel.show(node.getModule()); + + this.component.getContextMenu().hide(); + } + }; + MenuItem item = new MenuItem("Edit", command); + return item; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/ui/menu/ProgramUpdateMenu.java b/src/main/java/eml/studio/client/ui/menu/ProgramUpdateMenu.java index bdf2852..047c926 100644 --- a/src/main/java/eml/studio/client/ui/menu/ProgramUpdateMenu.java +++ b/src/main/java/eml/studio/client/ui/menu/ProgramUpdateMenu.java @@ -17,20 +17,20 @@ */ public class ProgramUpdateMenu { - public static MenuItem create(final ProgramLeaf node, final ProgramTree tree) { + public static MenuItem create(final ProgramLeaf node, final ProgramTree tree) { - Command command = new MenuItemCommand(node) { + Command command = new MenuItemCommand(node) { - @Override - public void execute() { - UpdateProgramPanel panel = new UpdateProgramPanel(tree,node); - panel.show(node.getModule()); - this.component.getContextMenu().hide(); - } + @Override + public void execute() { + UpdateProgramPanel panel = new UpdateProgramPanel(tree,node); + panel.show(node.getModule()); + this.component.getContextMenu().hide(); + } - }; + }; - MenuItem item = new MenuItem("Update", command); - return item; - } + MenuItem item = new MenuItem("Update", command); + return item; + } } diff --git a/src/main/java/eml/studio/client/ui/panel/AlertPanel.java b/src/main/java/eml/studio/client/ui/panel/AlertPanel.java index f901d4a..bad9c28 100644 --- a/src/main/java/eml/studio/client/ui/panel/AlertPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/AlertPanel.java @@ -27,44 +27,44 @@ public class AlertPanel extends PopupPanel { private VerticalPanel alertContent = new VerticalPanel(); private VerticalPanel mask = new VerticalPanel(); private VerticalPanel root = new VerticalPanel(); - + public AlertPanel() { bind(); - - title.setStyleName("alertTitle"); - close.setStyleName("alertClose"); - alertHeader.add(title); - alertHeader.add(close); - alertHeader.addStyleName("alertTitleBG"); - - content.removeStyleName("gwt-Label"); - content.addStyleName("alertBody"); - alertContent.add(content); - alertContent.addStyleName("alertBodyBG"); - - confirmBtn.removeStyleName("gwt-Button"); - alertButton.add(confirmBtn); - alertButton.addStyleName("alertButton1"); - - vPanel.add(alertHeader); - vPanel.add(alertContent); - vPanel.add(alertButton); - - vPanel.addStyleName("alertBox"); - mask.addStyleName("alertBack"); - - mask.addStyleName("alertBack"); + + title.setStyleName("alertTitle"); + close.setStyleName("alertClose"); + alertHeader.add(title); + alertHeader.add(close); + alertHeader.addStyleName("alertTitleBG"); + + content.removeStyleName("gwt-Label"); + content.addStyleName("alertBody"); + alertContent.add(content); + alertContent.addStyleName("alertBodyBG"); + + confirmBtn.removeStyleName("gwt-Button"); + alertButton.add(confirmBtn); + alertButton.addStyleName("alertButton1"); + + vPanel.add(alertHeader); + vPanel.add(alertContent); + vPanel.add(alertButton); + + vPanel.addStyleName("alertBox"); + mask.addStyleName("alertBack"); + + mask.addStyleName("alertBack"); mask.getElement().getStyle().setDisplay(Display.NONE); vPanel.add(mask); - - root.add(mask); - root.add(vPanel); - this.add(root); - this.removeStyleName("gwt-PopupPanel"); - this.getElement().getStyle().setPosition(Position.FIXED); - this.getElement().getStyle().setZIndex(999999999); + + root.add(mask); + root.add(vPanel); + this.add(root); + this.removeStyleName("gwt-PopupPanel"); + this.getElement().getStyle().setPosition(Position.FIXED); + this.getElement().getStyle().setZIndex(999999999); } - + /** * Event binding */ @@ -78,7 +78,7 @@ public void onClick(ClickEvent event) { AlertPanel.this.hide(); } }); - + //confirm confirmBtn.addClickHandler(new ClickHandler(){ @@ -87,15 +87,15 @@ public void onClick(ClickEvent event) { // TODO Auto-generated method stub AlertPanel.this.hide(); } - + }); } - + @Override public void setTitle(String msg){ title.setText(msg); } - + public void setContent(String msg){ content.setText(msg); } @@ -103,15 +103,15 @@ public void setContent(String msg){ public VerticalPanel getMask(){ return mask; } - + public Label getContent(){ return content; } - + public Button getConfirmBtn(){ return confirmBtn; } - + public Label getClose(){ return close; } diff --git a/src/main/java/eml/studio/client/ui/panel/BasePanel.java b/src/main/java/eml/studio/client/ui/panel/BasePanel.java index 8d6551c..bf2721d 100644 --- a/src/main/java/eml/studio/client/ui/panel/BasePanel.java +++ b/src/main/java/eml/studio/client/ui/panel/BasePanel.java @@ -19,119 +19,114 @@ */ public class BasePanel extends PopupPanel implements HasAllKeyHandlers{ - private static Logger logger = Logger.getLogger(BasePanel.class.getName()); - protected VerticalPanel verticalPanel = new VerticalPanel(); - protected FocusPanel focusPanel = new FocusPanel(); - protected HTML closeButton = new HTML("X"); - protected String[][] labarr = {null,null,null,null,null}; - protected String type = null; - protected DescribeGrid grid = null; - protected String owner; - - public BasePanel() { - this.setGlassEnabled(true); - this.setModal(false); - - closeButton.setSize("10px", "10px"); - closeButton.setStyleName("closebtn"); - - closeButton.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - clean(); - BasePanel.this.hide(); - } - }); - verticalPanel.add(closeButton); - verticalPanel.setCellHeight(closeButton, "13px"); - verticalPanel.setStyleName("vpanel"); - focusPanel.add(verticalPanel.asWidget()); - this.add(focusPanel); - this.setStyleName("loading_container"); - - this.sinkEvents(Event.ONKEYDOWN); - focusPanel.addKeyPressHandler(new KeyPressHandler() { - @Override - public void onKeyPress( KeyPressEvent event) { - event.getCharCode(); - } - }); - - } - - protected void init() { - grid = new DescribeGrid(labarr, type); - } - - @Override -public void show(){ - super.show(); - } - public void clean(){ - this.verticalPanel.clear(); - verticalPanel.add(closeButton); - verticalPanel.setCellHeight(closeButton, "13px"); - } - - public void setValues(String[] values){ - labarr[4] = values; - } - - public String getOwner() { - return owner; - } - public void setOwner(String owner) { - this.owner = owner; - } - - public String[][] getLabarr() { - return labarr; - } - public void setLabarr(String[][] labarr) { - this.labarr = labarr; - } - - public HTML getCloseButton() { - return closeButton; - } - - public void setCloseButton(HTML closeButton) { - this.closeButton = closeButton; - } - - public VerticalPanel getVerticalPanel() { - return verticalPanel; - } - - public void setVerticalPanel(VerticalPanel verticalPanel) { - this.verticalPanel = verticalPanel; - } - - public DescribeGrid getGrid() { - return grid; - } - - public void setGrid(DescribeGrid grid) { - this.grid = grid; - } - - @Override - public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) { - return this.addKeyUpHandler(handler); - } - - @Override - public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { - return this.addKeyDownHandler(handler); - } - - @Override - public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) { - return this.addKeyPressHandler(handler); - } - -/* @Override - public void onBrowserEvent(Event event) { - - }*/ + private static Logger logger = Logger.getLogger(BasePanel.class.getName()); + protected VerticalPanel verticalPanel = new VerticalPanel(); + protected FocusPanel focusPanel = new FocusPanel(); + protected HTML closeButton = new HTML("X"); + protected String[][] labarr = {null,null,null,null,null}; + protected String type = null; + protected DescribeGrid grid = null; + protected String owner; + + public BasePanel() { + this.setGlassEnabled(true); + this.setModal(false); + + closeButton.setSize("10px", "10px"); + closeButton.setStyleName("closebtn"); + + closeButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + clean(); + BasePanel.this.hide(); + } + }); + verticalPanel.add(closeButton); + verticalPanel.setCellHeight(closeButton, "13px"); + verticalPanel.setStyleName("vpanel"); + focusPanel.add(verticalPanel.asWidget()); + this.add(focusPanel); + this.setStyleName("loading_container"); + + this.sinkEvents(Event.ONKEYDOWN); + focusPanel.addKeyPressHandler(new KeyPressHandler() { + @Override + public void onKeyPress( KeyPressEvent event) { + event.getCharCode(); + } + }); + + } + + protected void init() { + grid = new DescribeGrid(labarr, type); + } + + @Override + public void show(){ + super.show(); + } + public void clean(){ + this.verticalPanel.clear(); + verticalPanel.add(closeButton); + verticalPanel.setCellHeight(closeButton, "13px"); + } + + public void setValues(String[] values){ + labarr[4] = values; + } + + public String getOwner() { + return owner; + } + public void setOwner(String owner) { + this.owner = owner; + } + + public String[][] getLabarr() { + return labarr; + } + public void setLabarr(String[][] labarr) { + this.labarr = labarr; + } + + public HTML getCloseButton() { + return closeButton; + } + + public void setCloseButton(HTML closeButton) { + this.closeButton = closeButton; + } + + public VerticalPanel getVerticalPanel() { + return verticalPanel; + } + + public void setVerticalPanel(VerticalPanel verticalPanel) { + this.verticalPanel = verticalPanel; + } + + public DescribeGrid getGrid() { + return grid; + } + + public void setGrid(DescribeGrid grid) { + this.grid = grid; + } + + @Override + public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) { + return this.addKeyUpHandler(handler); + } + + @Override + public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { + return this.addKeyDownHandler(handler); + } + + @Override + public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) { + return this.addKeyPressHandler(handler); + } } diff --git a/src/main/java/eml/studio/client/ui/panel/BasePopupPanel.java b/src/main/java/eml/studio/client/ui/panel/BasePopupPanel.java index 8098ed5..57d4f88 100644 --- a/src/main/java/eml/studio/client/ui/panel/BasePopupPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/BasePopupPanel.java @@ -17,39 +17,39 @@ * Base panel class of jocDesc */ public class BasePopupPanel extends PopupPanel { - private static Logger logger = Logger.getLogger(BasePopupPanel.class - .getName()); - public VerticalPanel verticalPanel = new VerticalPanel(); - public HTML closeButton = new HTML("X"); + private static Logger logger = Logger.getLogger(BasePopupPanel.class + .getName()); + public VerticalPanel verticalPanel = new VerticalPanel(); + public HTML closeButton = new HTML("X"); - public BasePopupPanel() { - init(); - } + public BasePopupPanel() { + init(); + } - protected void init() { - this.setGlassEnabled(true); + protected void init() { + this.setGlassEnabled(true); - this.setModal(true); - this.setCloseEnable(true); - verticalPanel.setStyleName("vpanel"); - this.add(verticalPanel); - this.setStyleName("loading_container"); - } + this.setModal(true); + this.setCloseEnable(true); + verticalPanel.setStyleName("vpanel"); + this.add(verticalPanel); + this.setStyleName("loading_container"); + } - public void setCloseEnable(boolean enable) { - if (!enable) { - verticalPanel.remove(closeButton); - } else { - closeButton.setSize("10px", "10px"); - closeButton.setStyleName("closebtn"); - closeButton.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - BasePopupPanel.this.hide(); - } - }); - verticalPanel.add(closeButton); - verticalPanel.setCellHeight(closeButton, "13px"); - } - } + public void setCloseEnable(boolean enable) { + if (!enable) { + verticalPanel.remove(closeButton); + } else { + closeButton.setSize("10px", "10px"); + closeButton.setStyleName("closebtn"); + closeButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + BasePopupPanel.this.hide(); + } + }); + verticalPanel.add(closeButton); + verticalPanel.setCellHeight(closeButton, "13px"); + } + } } diff --git a/src/main/java/eml/studio/client/ui/panel/CateAddPanel.java b/src/main/java/eml/studio/client/ui/panel/CateAddPanel.java index 5f4b8d5..241d961 100644 --- a/src/main/java/eml/studio/client/ui/panel/CateAddPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/CateAddPanel.java @@ -29,65 +29,65 @@ public class CateAddPanel extends PopupPanel { private VerticalPanel vPanel = new VerticalPanel(); private HorizontalPanel mask = new HorizontalPanel(); private VerticalPanel root = new VerticalPanel(); - + public CateAddPanel() { - bind(); - - HorizontalPanel alertHeader = new HorizontalPanel(); - HorizontalPanel alertButton = new HorizontalPanel(); - VerticalPanel alertContent = new VerticalPanel(); - title.setStyleName("cateAddBoxTitle"); - close.setStyleName("alertClose"); - alertHeader.add(title); - alertHeader.add(close); - alertHeader.addStyleName("alertTitleBG"); - - HorizontalPanel namePanel = new HorizontalPanel(); - HorizontalPanel fathPanel = new HorizontalPanel(); - nameLabel.getElement().getStyle().setMargin(9, Unit.PX); - nameBox.removeStyleName("gwt-TextBox"); - nameBox.addStyleName("admin-cate-add-input"); - nameErrorLabel.addStyleName("account-error"); - namePanel.add(nameLabel); - namePanel.add(nameBox); - namePanel.add(nameErrorLabel); - fathLabel.getElement().getStyle().setMargin(12, Unit.PX); - fathBox.removeStyleName("gwt-TextBox"); - fathBox.addStyleName("admin-cate-add-input"); - fathErrorLabel.addStyleName("account-error"); - fathPanel.add(fathLabel); - fathPanel.add(fathBox); - fathPanel.add(fathErrorLabel); - - namePanel.getElement().getStyle().setMarginTop(20, Unit.PX); - namePanel.getElement().getStyle().setMarginBottom(20, Unit.PX); - fathPanel.getElement().getStyle().setMarginTop(20, Unit.PX); - fathPanel.getElement().getStyle().setMarginBottom(20, Unit.PX); - alertContent.add(namePanel); - alertContent.add(fathPanel); - alertContent.addStyleName("margin_left_17"); - - confirmBtn.removeStyleName("gwt-Button"); - cancelBtn.removeStyleName("gwt-Button"); - cancelBtn.getElement().getStyle().setMarginLeft(105, Unit.PX); - - alertButton.add(confirmBtn); - alertButton.add(cancelBtn); - alertButton.addStyleName("alertButton2"); - - vPanel.add(alertHeader); - vPanel.add(alertContent); - vPanel.add(alertButton); - - vPanel.addStyleName("alertBox"); - mask.addStyleName("alertBack"); - - root.add(mask); - root.add(vPanel); - this.add(root); - this.removeStyleName("gwt-PopupPanel"); + bind(); + + HorizontalPanel alertHeader = new HorizontalPanel(); + HorizontalPanel alertButton = new HorizontalPanel(); + VerticalPanel alertContent = new VerticalPanel(); + title.setStyleName("cateAddBoxTitle"); + close.setStyleName("alertClose"); + alertHeader.add(title); + alertHeader.add(close); + alertHeader.addStyleName("alertTitleBG"); + + HorizontalPanel namePanel = new HorizontalPanel(); + HorizontalPanel fathPanel = new HorizontalPanel(); + nameLabel.getElement().getStyle().setMargin(9, Unit.PX); + nameBox.removeStyleName("gwt-TextBox"); + nameBox.addStyleName("admin-cate-add-input"); + nameErrorLabel.addStyleName("account-error"); + namePanel.add(nameLabel); + namePanel.add(nameBox); + namePanel.add(nameErrorLabel); + fathLabel.getElement().getStyle().setMargin(12, Unit.PX); + fathBox.removeStyleName("gwt-TextBox"); + fathBox.addStyleName("admin-cate-add-input"); + fathErrorLabel.addStyleName("account-error"); + fathPanel.add(fathLabel); + fathPanel.add(fathBox); + fathPanel.add(fathErrorLabel); + + namePanel.getElement().getStyle().setMarginTop(20, Unit.PX); + namePanel.getElement().getStyle().setMarginBottom(20, Unit.PX); + fathPanel.getElement().getStyle().setMarginTop(20, Unit.PX); + fathPanel.getElement().getStyle().setMarginBottom(20, Unit.PX); + alertContent.add(namePanel); + alertContent.add(fathPanel); + alertContent.addStyleName("margin_left_17"); + + confirmBtn.removeStyleName("gwt-Button"); + cancelBtn.removeStyleName("gwt-Button"); + cancelBtn.getElement().getStyle().setMarginLeft(105, Unit.PX); + + alertButton.add(confirmBtn); + alertButton.add(cancelBtn); + alertButton.addStyleName("alertButton2"); + + vPanel.add(alertHeader); + vPanel.add(alertContent); + vPanel.add(alertButton); + + vPanel.addStyleName("alertBox"); + mask.addStyleName("alertBack"); + + root.add(mask); + root.add(vPanel); + this.add(root); + this.removeStyleName("gwt-PopupPanel"); } - + /** * Event binding */ @@ -105,7 +105,7 @@ public void onClick(ClickEvent event) { CateAddPanel.this.hide(); } }); - + //cancel cancelBtn.addClickHandler(new ClickHandler(){ @@ -118,47 +118,47 @@ public void onClick(ClickEvent event) { CateAddPanel.this.fathErrorLabel.setText(""); CateAddPanel.this.hide(); } - + }); } - + @Override public void setTitle(String msg){ title.setText(msg); } - + public String getType(){ return type; } - + public VerticalPanel getPanel(){ return vPanel; } - + public TextBox getNameBox(){ return nameBox; } - + public Label getNameErrorLabel(){ return nameErrorLabel; } - + public TextBox getFatherBox(){ return fathBox; } - + public Label getFathErrorLabel(){ return fathErrorLabel; } - + public Button getCancelBtn(){ return cancelBtn; } - + public Button getConfirmBtn(){ return confirmBtn; } - + public Label getClose(){ return close; } diff --git a/src/main/java/eml/studio/client/ui/panel/CategoryPanel.java b/src/main/java/eml/studio/client/ui/panel/CategoryPanel.java index 6e22ffc..ce1d1fa 100644 --- a/src/main/java/eml/studio/client/ui/panel/CategoryPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/CategoryPanel.java @@ -22,6 +22,7 @@ public class CategoryPanel extends PopupPanel { private String type; private Label title = new Label(Constants.adminUIMsg.chooseCate()); + private Label change = new Label(); private Label close = new Label(); private VerticalPanel vPanel = new VerticalPanel(); private ScrollPanel sPanel = new ScrollPanel(); @@ -35,6 +36,8 @@ public CategoryPanel(String type) { HorizontalPanel alertHeader = new HorizontalPanel(); title.addStyleName("cateAddBoxTitle"); close.addStyleName("alertClose"); + change.addStyleName("change"); + change.setTitle( Constants.adminUIMsg.change()); alertHeader.add(title); alertHeader.add(close); alertHeader.addStyleName("alertTitleBG"); @@ -78,6 +81,10 @@ public void onClick(ClickEvent event) { }); } + public Label getChange(){ + return change; + } + public Label getClose(){ return close; } diff --git a/src/main/java/eml/studio/client/ui/panel/DataTypeSelectPanel.java b/src/main/java/eml/studio/client/ui/panel/DataTypeSelectPanel.java new file mode 100644 index 0000000..436f94f --- /dev/null +++ b/src/main/java/eml/studio/client/ui/panel/DataTypeSelectPanel.java @@ -0,0 +1,177 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.ui.panel; + +import java.util.logging.Logger; + +import eml.studio.shared.model.Dataset; +import eml.studio.shared.util.DatasetType; + +import com.google.gwt.event.dom.client.ChangeEvent; +import com.google.gwt.event.dom.client.ChangeHandler; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.ui.Button; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.ListBox; +import com.google.gwt.user.client.ui.PopupPanel; +import com.google.gwt.user.client.ui.VerticalPanel; + +/** + * Result data type selection popup panel( for data visiualization) + * + */ +public class DataTypeSelectPanel extends PopupPanel{ + protected static Logger logger = Logger.getLogger(DataVisualPopPanel.class.getName()); + private final Label desc = new Label("Data Type Selection"); + private HTML closeButton = new HTML("X"); + private ListBox typeListBox; + private Dataset dataset ; + private String filePath; + private Button okBtn; + private Button cancelBtn; + + public DataTypeSelectPanel(String path, Dataset dataset) + { + + this.dataset = dataset; + this.filePath = path; + init(); + bind(); + } + + /** + * UI initialization + */ + public void init() + { + this.setSize("480px", "100px"); + + //Dialog box title + closeButton.setSize("10px", "10px"); + closeButton.setStyleName("closebtn"); + + //Selection dialog + HorizontalPanel typeListPanel = new HorizontalPanel(); + typeListPanel.setStyleName("popupDatatypeSelectPanel"); + typeListBox = new ListBox(); + typeListBox.setWidth("120px"); + typeListBox.addItem("----"); + typeListBox.addItem(DatasetType.GENERAL.getDesc()); + typeListBox.addItem(DatasetType.CSV.getDesc()); + typeListBox.addItem(DatasetType.TSV.getDesc()); + typeListBox.addItem(DatasetType.JSON.getDesc()); + if(dataset.getContenttype() == null || dataset.getContenttype() .equals("")) + typeListBox.setSelectedIndex(0); + else + { + for(int i = 0 ; i dataGrid; + private SimplePager pager; + + private ListBox colListBox; + private Label meanLbl ; + private Label medianLbl ; + private Label minLbl ; + private Label maxLbl ; + private Label stdLbl ; + private Label uniqLbl ; + private Label missingLbl ; + private Label feaTypeLbl ; + private Grid advancedOptions; + + private CheckBox freLogChkbox; + private TextBox bins ; + private List colNames; //Data column name + private List colTypes; //Data column type (numeric or string) + + private final String BIN_SIZE = "10"; + private String filePath; //Data path(HDFS) + private String selectedColumn; //The selected column + private Dataset dataset; //Dataset for visualization + private int COL_WIDTH = 75; + + public DataVisualPopPanel(String filePath,Dataset dataset) + { + this.filePath =filePath; + this.dataset = dataset; + init(); + } + /** + * Initialization + * + */ + public void init() + { + //Get data rows and columns + colNames = new ArrayList(); + colTypes = new ArrayList(); + dataAnalysisService.getDataColumn(filePath, dataset.getContenttype(), new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.info("Get data column error: "+caught.getMessage()); + } + + @Override + public void onSuccess(LinkedHashMap result) { + // TODO Auto-generated method stub + Iterator> it = result.entrySet().iterator(); + while(it.hasNext()) + { + Entry column = it.next(); + colNames.add(column.getKey()); + colTypes.add(column.getValue()); + } + logger.info("Col size ="+colNames.size()); + initUI(); + bindEvent(); + } + } ); + } + /** + * UI Initialization + */ + public void initUI() + { + this.setSize("900px", "500px"); + + //Dialog title + closeButton.setSize("10px", "10px"); + closeButton.setStyleName("closebtn"); + + + //Display the number of rows and columns of the data + HorizontalPanel rowColPanel = new HorizontalPanel(); + Label row = new Label("Rows:"); + rowLbl = new Label(); + setDataRows(filePath); + Label cols = new Label("Cols:"); + colLbl = new Label(); + colLbl.setText(String.valueOf(colNames.size())); + rowColPanel.add(row); + rowColPanel.add(rowLbl); + rowColPanel.add(cols); + rowColPanel.add(colLbl); + + //Data content split panel + HorizontalSplitPanel contentPanel = new HorizontalSplitPanel(); + contentPanel.setPixelSize(900, 400); + + //Data table in the left + buildCellTable(); + VerticalPanel dataPanel = new VerticalPanel(); + dataPanel.add(dataGrid); + dataPanel.add(pager); + + //Data feature panel in the right + VerticalPanel featurePanel = new VerticalPanel(); + featurePanel.setSize("400px", "400px"); + + //Column selection panel in the top right + HorizontalPanel colListPanel = new HorizontalPanel(); + colListBox = new ListBox(); + colListBox.addItem("----"); + for(int i=0; i(){ + + @Override + public void onValueChange(ValueChangeEvent event) { + // TODO Auto-generated method stub + + drawBarCharts(selectedColumn); + } + + }); + } + + @Override + public void center(){ + super.center(); + } + + /** + * Draw bar charts + * + * @param selectedColumn select column + */ + private void drawBarCharts(String selectedColumn) + { + barService.barChartServer(filePath,dataset.getContenttype(),colNames,selectedColumn, Integer.valueOf(bins.getText()),freLogChkbox.getValue(),new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.info(caught.toString()); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + DrawBarChart.drawBarChart("datachart",result); + freLogChkbox.setEnabled(true); + bins.setEnabled(true); + } + }); + } + + /** + * Wrap data statics feature + * + * @param selectedColumn select column + */ + private void wrapDataStatics(String selectedColumn) + { + dataAnalysisService.extDataFeature(filePath,dataset.getContenttype(),colNames,selectedColumn,new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.info("Wrap data statics feature error!"); + } + + @Override + public void onSuccess(DataFeature feature) { + // TODO Auto-generated method stub + if(feature.isNumberic()) + { + meanLbl.setText(String.valueOf(feature.getMean())); + medianLbl.setText(String.valueOf(feature.getMedian())); + minLbl.setText(String.valueOf(feature.getMin())); + maxLbl.setText(String.valueOf(feature.getMax())); + stdLbl.setText(String.valueOf(feature.getStandDeviation())); + uniqLbl.setText(String.valueOf(feature.getUniqueValues())); + missingLbl.setText(String.valueOf(feature.getMissingValues())); + feaTypeLbl.setText("Numberic"); + }else{ + meanLbl.setText("-----"); + medianLbl.setText("-----"); + minLbl.setText("-----"); + maxLbl.setText("-----"); + stdLbl.setText("-----"); + uniqLbl.setText(String.valueOf(feature.getUniqueValues())); + missingLbl.setText(String.valueOf(feature.getMissingValues())); + feaTypeLbl.setText("String"); + } + } + + }); + } + + /** + * Build dynamic cell box by data + * + */ + public void buildCellTable() + { + dataGrid = new DataGrid(); + + //Set the grid size + int totalWidth = COL_WIDTH*colNames.size(); + if(totalWidth < 500) + totalWidth = 500; + dataGrid.setSize(totalWidth+"px", "350px"); + dataGrid.setAutoHeaderRefreshDisabled(true); + dataGrid.setEmptyTableWidget(new Label("Data is empty")); + + //Add data + dataGrid.setVisibleRange(0, 50); + if(!rowLbl.getText().equals("")) + { + int rowCount = Integer.valueOf(rowLbl.getText()); + if(rowCount > LIMIT_LINE) + dataGrid.setRowCount(LIMIT_LINE); + else + dataGrid.setRowCount(rowCount); + } + + AsyncDataProvider dataProvider = new AsyncDataProvider() { + @Override + protected void onRangeChanged(HasData display) { + final Range range = display.getVisibleRange(); + final int start = range.getStart(); + dataAnalysisService.pageData(filePath, dataset.getContenttype(), colNames, start, range.getLength(), new AsyncCallback> (){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.info("Get range data error:" + caught.getMessage()); + } + + @Override + public void onSuccess(List result) { + // TODO Auto-generated method stub + if(result.size()==0) + logger.info("cxj"); + List jsonObjs = new ArrayList(); + for(int i=0;i column = new Column(new TextCell()) { + @Override + public String getValue(JSONObject object) { + try { + return object.get(colName).toString(); + } catch (JSONException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return ""; + } + } + }; + dataGrid.addColumn(column, colName); + dataGrid.setColumnWidth(column, COL_WIDTH, Unit.PCT); + } + else + { + Column column = new Column(new NumberCell()) { + @Override + public Number getValue(JSONObject object) { + try { + return Double.valueOf(DataTools.getJSONValue(object.get(colName).toString())); + } catch (JSONException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return -1; + } + } + }; + dataGrid.addColumn(column, colName); + dataGrid.setColumnWidth(column, COL_WIDTH, Unit.PCT); + } + } + + //Add a paging + SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class); + pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true); + pager.setDisplay(dataGrid); + + } + + /** + * Bin value change handler + */ + private class BinValueChangeListener extends KeyboardListenerAdapter { + @Override + public void onKeyPress(Widget sender, char key, int mods) { + if (KeyboardListener.KEY_ENTER == key) + { + if(!DataTools.isPosInteger(bins.getText())) + Window.alert("Bin size should be a positive integer, please fill again!"); + else + drawBarCharts(selectedColumn); + } + } + } + /** + * Get data row number + * + * @param filePath data path + */ + private void setDataRows(String filePath) + { + dataAnalysisService.getDataRows(filePath, dataset.getContenttype(), new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.info("Get data row error:"+caught.getMessage()); + rowLbl.setText("0"); + } + + @Override + public void onSuccess(Integer result) { + // TODO Auto-generated method stub + rowLbl.setText(String.valueOf(result)); + if(dataGrid!=null) + { + if(result>LIMIT_LINE) + dataGrid.setRowCount(LIMIT_LINE); + else + dataGrid.setRowCount(result); + } + } + }); + } + + /** + * Get popup panel title label + * + * @return + */ + public Label getDescLabel() + { + return desc; + } +} diff --git a/src/main/java/eml/studio/client/ui/panel/DeletePanel.java b/src/main/java/eml/studio/client/ui/panel/DeletePanel.java index 7c8456a..21da809 100644 --- a/src/main/java/eml/studio/client/ui/panel/DeletePanel.java +++ b/src/main/java/eml/studio/client/ui/panel/DeletePanel.java @@ -26,40 +26,40 @@ public class DeletePanel extends PopupPanel { private VerticalPanel alertContent = new VerticalPanel(); private VerticalPanel mask = new VerticalPanel(); private VerticalPanel root = new VerticalPanel(); - + public DeletePanel() { - title.setStyleName("alertTitle"); - close.setStyleName("alertClose"); - alertHeader.add(title); - alertHeader.add(close); - alertHeader.addStyleName("alertTitleBG"); - - content.removeStyleName("gwt-Label"); - content.addStyleName("alertBody"); - alertContent.add(content); - alertContent.addStyleName("alertBodyBG"); - - confirmBtn.removeStyleName("gwt-Button"); - cancelBtn.removeStyleName("gwt-Button"); - cancelBtn.getElement().getStyle().setMarginLeft(105, Unit.PX); - alertButton.add(confirmBtn); - alertButton.add(cancelBtn); - alertButton.addStyleName("alertButton2"); - - vPanel.add(alertHeader); - vPanel.add(alertContent); - vPanel.add(alertButton); - - vPanel.addStyleName("alertBox"); - mask.addStyleName("alertBack"); - - bind(); - root.add(mask); - root.add(vPanel); - this.add(root); - this.removeStyleName("gwt-PopupPanel"); + title.setStyleName("alertTitle"); + close.setStyleName("alertClose"); + alertHeader.add(title); + alertHeader.add(close); + alertHeader.addStyleName("alertTitleBG"); + + content.removeStyleName("gwt-Label"); + content.addStyleName("alertBody"); + alertContent.add(content); + alertContent.addStyleName("alertBodyBG"); + + confirmBtn.removeStyleName("gwt-Button"); + cancelBtn.removeStyleName("gwt-Button"); + cancelBtn.getElement().getStyle().setMarginLeft(105, Unit.PX); + alertButton.add(confirmBtn); + alertButton.add(cancelBtn); + alertButton.addStyleName("alertButton2"); + + vPanel.add(alertHeader); + vPanel.add(alertContent); + vPanel.add(alertButton); + + vPanel.addStyleName("alertBox"); + mask.addStyleName("alertBack"); + + bind(); + root.add(mask); + root.add(vPanel); + this.add(root); + this.removeStyleName("gwt-PopupPanel"); } - + /** * Event binding */ @@ -81,19 +81,19 @@ public void onClick(ClickEvent event) { // TODO Auto-generated method stub DeletePanel.this.hide(); } - + }); } - + @Override public void setTitle(String msg){ title.setText(msg); } - + public void setContent(String msg){ content.setText(msg); } - + public VerticalPanel getPanel(){ return vPanel; } @@ -101,7 +101,7 @@ public VerticalPanel getPanel(){ public Label getContent(){ return content; } - + public Button getConfirmBtn(){ return confirmBtn; } diff --git a/src/main/java/eml/studio/client/ui/panel/ETLPopPanel.java b/src/main/java/eml/studio/client/ui/panel/ETLPopPanel.java new file mode 100644 index 0000000..9c1182d --- /dev/null +++ b/src/main/java/eml/studio/client/ui/panel/ETLPopPanel.java @@ -0,0 +1,344 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.ui.panel; + +import eml.studio.client.rpc.ETLService; +import eml.studio.client.rpc.ETLServiceAsync; +import eml.studio.client.ui.panel.Grid.SqlETLGrid; +import eml.studio.client.ui.panel.component.DescListBox; +import eml.studio.client.ui.widget.command.Parameter; +import eml.studio.client.ui.widget.panel.ParameterPanel; +import eml.studio.client.ui.widget.program.CommonProgramWidget; +import eml.studio.client.ui.widget.program.ProgramWidget; +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Style; +import com.google.gwt.event.dom.client.ChangeEvent; +import com.google.gwt.event.dom.client.ChangeHandler; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; + +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.*; + +import java.util.List; +import java.util.logging.Logger; + +import java.util.ArrayList; + +/** + * + * ETL Connected Information Configuration Panel + * + */ +public class ETLPopPanel extends BasePanel { + private static final Logger logger = Logger.getLogger(ETLPopPanel.class.getName()); + //button + protected Button submitBtn = new Button("OK"); + protected Button connectBtn = new Button("Connect"); + + protected HorizontalPanel northPanel = new HorizontalPanel(); + protected HorizontalPanel midPanel = new HorizontalPanel(); + protected HorizontalPanel southPanel = new HorizontalPanel(); + protected VerticalPanel mid_westPanel = new VerticalPanel(); + protected VerticalPanel mid_eastPanel = new VerticalPanel(); + + protected DescListBox category = new DescListBox(); + protected SqlETLGrid sqlGrid = new SqlETLGrid(); + + protected Grid rightGrid; + protected DescListBox tableLB; + protected DescListBox columnLB; + protected DescListBox formatLB; + protected ParameterPanel panel; + + protected ProgramWidget widget; + + protected ETLServiceAsync svc = GWT.create(ETLService.class); + + public ETLPopPanel(ProgramWidget widget) { + this.widget = widget; + init_UI(); + init_function(); + } + /** + * Init UI + */ + public void init_UI(){ + this.addStyleName("bda-etlpanel"); + + //north + northPanel.add(new Label("Type: ")); + category.addItem("Sql"); + category.addItem("Hive"); + category.setVisibleItemCount(1); + northPanel.add(category); + + //mid + init_rightGrid(); + mid_eastPanel.add(sqlGrid); + mid_westPanel.add(rightGrid); + midPanel.add(mid_eastPanel.asWidget()); + midPanel.add(mid_westPanel.asWidget()); + + //south + submitBtn.removeStyleName("gwt-Button"); + connectBtn.removeStyleName("gwt-Button"); + submitBtn.addStyleName("button-style"); + connectBtn.addStyleName("button-style"); + connectBtn.getElement().getStyle().setMarginLeft(310, Style.Unit.PX); + verticalPanel.removeStyleName("vpanel"); + + verticalPanel.addStyleName("bda-etlpanel-panel"); + southPanel.setStyleName("bda-etlpanel-south"); + northPanel.setStyleName("bda-etlpanel-north"); + midPanel.setStyleName("bda-etlpanel-mid"); + mid_eastPanel.setStyleName("bda-etlpanel-mideast"); + mid_westPanel.setStyleName("bda-etlpanel-midwest"); + southPanel.add(connectBtn); + southPanel.add(submitBtn); + + verticalPanel.add(northPanel); + verticalPanel.add(midPanel); + verticalPanel.add(southPanel); + } + /** + * Init button bind event + */ + public void init_function(){ + addSubmitHandler(); + addConnectHandeler(); + } + + /** + * Bind event to submit button + */ + private void addSubmitHandler() { + + submitBtn.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent clickEvent) { + logger.info(widget.getProgram().getPath()); + if(tableLB.getItemCount()==0) {Window.alert("Please make sure the database is properly connectedï¼");return;} + if(panel!= null) setParameterPanel(panel); + ETLPopPanel.this.hide(); + } + }); + } + + /** + * Bind event to connect button + */ + private void addConnectHandeler(){ + connectBtn.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent clickEvent) { + tableLB.clear(); + columnLB.clear(); + connectBtn.setEnabled(false); + gettable(); + } + }); + } + + /** + * Init etl program widget' right grid panel + */ + public void init_rightGrid(){ + Label table = new Label("table"); + Label column = new Label("column"); + Label format = new Label("format"); + rightGrid = new Grid(3,2); + rightGrid.setWidget(1,0,table); + tableLB = new DescListBox(); + tableLB.setVisibleItemCount(1); + tableLB.setStyleName("bda-etlpanel-listbox"); + rightGrid.setWidget(1,1,tableLB); + + rightGrid.setWidget(2,0,column); + columnLB = new DescListBox(); + columnLB.setMultipleSelect(true); + columnLB.setVisibleItemCount(2); + columnLB.setStyleName("bda-etlpanel-Multilistbox"); + rightGrid.setWidget(2,1,columnLB); + + rightGrid.setWidget(0,0,format); + formatLB = new DescListBox(); + formatLB.addItem("json"); + formatLB.addItem("tsv"); + formatLB.addItem("csv"); + formatLB.addItem("parquet"); + formatLB.setVisibleItemCount(1); + formatLB.setStyleName("bda-etlpanel-listbox"); + rightGrid.setWidget(0,1,formatLB); + mid_westPanel.add(rightGrid); + + tableLB.addChangeHandler(new ChangeHandler() { + @Override + public void onChange(ChangeEvent changeEvent) { + getColumn(); + } + }); + } + + + public void setETLPanel(ParameterPanel panel) { + if (panel == null) + return; + CommonProgramWidget w = (CommonProgramWidget) widget; + List params = w.getProgramConf().getParameters(); + if(w.getProgram().getName().contains("ive")){ + category.setValue("Hive"); + } + sqlGrid.setUrlTB(params.get(0).getParamValue()); + sqlGrid.setUserTB(params.get(1).getParamValue()); + sqlGrid.setPasswordTB(params.get(2).getParamValue()); + this.panel = panel; + } + + public void setParameterPanel(ParameterPanel panel){ + if (panel == null) + return; + CommonProgramWidget w = (CommonProgramWidget) widget; + List params = w.getProgramConf().getParameters(); + String columnStr = ""; + for(int i : columnLB.getSelectedItems()){ + columnStr += columnLB.getValue(i)+","; + } + columnStr = columnStr.substring(0,columnStr.length()-1); + params.get(0).setParamValue(sqlGrid.getUrlTB().getValue().toString()); + params.get(1).setParamValue(sqlGrid.getUserTB().getValue().toString()); + params.get(2).setParamValue(sqlGrid.getPasswordTB().getValue().toString()); + params.get(3).setParamValue(tableLB.getValue().toString()); + params.get(4).setParamValue(columnStr); + logger.info("urlLB: "+sqlGrid.getUrlTB().getValue().toString()); + logger.info("userLB: "+sqlGrid.getUserTB().getValue().toString()); + logger.info("passwordLB: "+sqlGrid.getPasswordTB().getValue().toString()); + logger.info("formateLB: "+formatLB.getValue().toString()); + logger.info("columnLB: "+columnStr); + logger.info("tableLB: "+tableLB.getValue().toString()); + params.get(5).setParamValue(formatLB.getValue().toString()); + ((TextBox)panel.getParamBoxs().get(0)).setText(sqlGrid.getUrlTB().getValue()); + ((TextBox)panel.getParamBoxs().get(1)).setText(sqlGrid.getUserTB().getValue()); + ((TextBox)panel.getParamBoxs().get(2)).setText(sqlGrid.getPasswordTB().getValue()); + ((TextBox)panel.getParamBoxs().get(3)).setText(tableLB.getValue()); + ((TextBox)panel.getParamBoxs().get(4)).setText(columnStr); + ((TextBox)panel.getParamBoxs().get(5)).setText(formatLB.getValue()); + this.panel = panel; + } + /** + * Get connected database table column + */ + public void getColumn(){ + columnLB.clear(); + if(category.getValue().equals("Sql")){ + svc.SqlETLGetColumns(sqlGrid.getUrlTB().getValue(),sqlGrid.getUserTB().getValue(), + sqlGrid.getPasswordTB().getValue(),tableLB.getValue(),new AsyncCallback>() { + @Override + public void onFailure(Throwable caught) { + Window.alert("Loading "+tableLB.getValue()+" content failed"); + } + + @Override + public void onSuccess(ArrayList result) { + for(String e:result){ + logger.info("column: "+result); + columnLB.addItem(e); + } + } + }); + }else{ + svc.HiveETLGetColumns(sqlGrid.getUrlTB().getValue(),sqlGrid.getUserTB().getValue(), + sqlGrid.getPasswordTB().getValue(),tableLB.getValue(),new AsyncCallback>() { + @Override + public void onFailure(Throwable caught) { + Window.alert("Loading "+tableLB.getValue()+" content failed"); + } + + @Override + public void onSuccess(ArrayList result) { + for(String e:result){ + logger.info("column "+result); + columnLB.addItem(e); + } + } + }); + } + } + + /** + * Get connected database table + */ + public void gettable(){ + if(category.getValue().equals("Sql")){ + svc.SqlETLGetTables(sqlGrid.getUrlTB().getValue(),sqlGrid.getUserTB().getValue(), + sqlGrid.getPasswordTB().getValue(),new AsyncCallback>() { + @Override + public void onFailure(Throwable caught) { + Window.alert("Loading table failed"); + } + + @Override + public void onSuccess(ArrayList result) { + for(String e:result){ + logger.info("table: "+result); + if(e.contains("Database connection failed")) {Window.alert(e); connectBtn.setEnabled(true); return;} + tableLB.addItem(e); + } + connectBtn.setEnabled(true); + getColumn(); + } + }); + }else{ + svc.HiveETLGetTables(sqlGrid.getUrlTB().getValue(),sqlGrid.getUserTB().getValue(), + sqlGrid.getPasswordTB().getValue(),new AsyncCallback>() { + @Override + public void onFailure(Throwable caught) { + Window.alert("Loading table failed"); + } + + @Override + public void onSuccess(ArrayList result) { + for(String e:result){ + logger.info("table: "+result); + if(e.contains("Database connection failed")) {Window.alert(e); connectBtn.setEnabled(true); return;} + tableLB.addItem(e); + } + connectBtn.setEnabled(true); + getColumn(); + } + }); + } + } + public ParameterPanel getPanel() { + return panel; + } + + public DescListBox getColumnLB() { + return columnLB; + } + + public void setColumnLB(DescListBox columnLB) { + this.columnLB = columnLB; + } + + public DescListBox getTableLB() { + return tableLB; + } + + public void setTableLB(DescListBox tableLB) { + this.tableLB = tableLB; + } + + public DescListBox getFormatLB() { + return formatLB; + } + + public void setFormatLB(DescListBox formatLB) { + this.formatLB = formatLB; + } + +} diff --git a/src/main/java/eml/studio/client/ui/panel/EditDatasetPanel.java b/src/main/java/eml/studio/client/ui/panel/EditDatasetPanel.java index 260b29b..aaf42d4 100644 --- a/src/main/java/eml/studio/client/ui/panel/EditDatasetPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/EditDatasetPanel.java @@ -38,16 +38,16 @@ public EditDatasetPanel(String emailAccount,final DatasetTree tree,final Dataset super(); owner = emailAccount; labarr = new String[][]{ - {"Name", "Category", "DataType", "Version", "CreateDate", "Owner", "Description"}, - {Constants.studioUIMsg.dataName(), Constants.studioUIMsg.dataCategory(), - Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), - Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), - Constants.studioUIMsg.dataDescription()}, - {"textbox", "tree", "listbox", "textbox", "textbox", "textbox", "textarea"}, - {"true", "true", "true", "true", "false", "false", "true"}, - {"", Constants.studioUIMsg.chooseCategory(), "General/CSV/TSV", "0.1", - TimeUtils.timeNow(), AppController.email, ""}, - {"left", "left", "left", "left", "left", "left", "right"} + {"Name", "Category", "DataType", "Version", "CreateDate", "Owner", "Description"}, + {Constants.studioUIMsg.dataName(), Constants.studioUIMsg.dataCategory(), + Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), + Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), + Constants.studioUIMsg.dataDescription()}, + {"textbox", "tree", "listbox", "textbox", "textbox", "textbox", "textarea"}, + {"true", "true", "true", "true", "false", "false", "true"}, + {"", Constants.studioUIMsg.chooseCategory(), "General/CSV/TSV", "0.1", + TimeUtils.timeNow(), AppController.email, ""}, + {"left", "left", "left", "left", "left", "left", "right"} }; this.tree = tree; this.node = node; @@ -76,19 +76,19 @@ public void setUpdatebt (Button updatebt){ } public void show(Dataset dataset){ this.dataset = dataset; - final String values[] = DBController.getDatasetPanelValue(dataset,false); - final String category = dataset.getCategory(); - if("我的数æ®".equals(category) || "my data".equals(category.toLowerCase()) - || "共享数æ®".equals(category) || "shared data".equals(category.toLowerCase()) - || "系统数æ®".equals(category) || "system data".equals(category.toLowerCase()) ){ - values[1] = category; + final String values[] = DBController.getDatasetPanelValue(dataset,false); + final String category = dataset.getCategory(); + if("我的数æ®".equals(category) || "my data".equals(category.toLowerCase()) + || "共享数æ®".equals(category) || "shared data".equals(category.toLowerCase()) + || "系统数æ®".equals(category) || "system data".equals(category.toLowerCase()) ){ + values[1] = category; EditDatasetPanel.this.setValues(values); EditDatasetPanel.this.init(); EditDatasetPanel.this.center(); EditDatasetPanel.this.show(); - }else{ - categorySrv.getCategory(category, new AsyncCallback(){ - + }else{ + categorySrv.getCategory(category, new AsyncCallback(){ + @Override public void onFailure(Throwable caught) { // TODO Auto-generated method stub @@ -98,7 +98,7 @@ public void onFailure(Throwable caught) { EditDatasetPanel.this.center(); EditDatasetPanel.this.show(); } - + @Override public void onSuccess(Category result) { // TODO Auto-generated method stub @@ -106,15 +106,15 @@ public void onSuccess(Category result) { values[1] = result.getName(); }else values[1] = result.getPath(); - + EditDatasetPanel.this.setValues( values ); EditDatasetPanel.this.init(); EditDatasetPanel.this.center(); EditDatasetPanel.this.show(); } - - }); - } + + }); + } } } diff --git a/src/main/java/eml/studio/client/ui/panel/EditProgramPanel.java b/src/main/java/eml/studio/client/ui/panel/EditProgramPanel.java index dfffe6f..6382676 100644 --- a/src/main/java/eml/studio/client/ui/panel/EditProgramPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/EditProgramPanel.java @@ -38,22 +38,22 @@ public class EditProgramPanel extends BasePanel{ public EditProgramPanel(String emailAccount,final ProgramTree tree,final ProgramLeaf node) { super(); labarr = new String[][]{ - {"Name","Category","Type","Programable","Isdeterministic","Version","CreateDate", - "Owner","Description","CommandLine"}, + {"Name","Category","Type","Programable","Isdeterministic","Version","CreateDate", + "Owner","Description","CommandLine"}, {Constants.studioUIMsg.moduleName(), Constants.studioUIMsg.moduleCategory(), - Constants.studioUIMsg.moduleType(), Constants.studioUIMsg.programable(), - Constants.studioUIMsg.moduleDeterminacy(),Constants.studioUIMsg.moduleVersion(), - Constants.studioUIMsg.moduleCreateTime(), Constants.studioUIMsg.moduleOwner(), - Constants.studioUIMsg.dataDescription(),Constants.studioUIMsg.moduleCMDFormat()}, - {"textbox","tree","listbox","listbox","listbox","textbox","textbox", - "textbox","textarea","textarea"}, - {"true","true","true","true","true","true","false","false","true","true"}, - {"", Constants.studioUIMsg.chooseCategory(), - Constants.studioUIMsg.standalone() + "/" + Constants.studioUIMsg.distributed()+"/ETL", - Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), - Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), - "0.1", TimeUtils.timeNow(), AppController.email, "", ""}, - {"left","left","left","left","left","left","left","left","left","right"} + Constants.studioUIMsg.moduleType(), Constants.studioUIMsg.programable(), + Constants.studioUIMsg.moduleDeterminacy(),Constants.studioUIMsg.moduleVersion(), + Constants.studioUIMsg.moduleCreateTime(), Constants.studioUIMsg.moduleOwner(), + Constants.studioUIMsg.dataDescription(),Constants.studioUIMsg.moduleCMDFormat()}, + {"textbox","tree","listbox","listbox","listbox","textbox","textbox", + "textbox","textarea","textarea"}, + {"true","true","true","true","true","true","false","false","true","true"}, + {"", Constants.studioUIMsg.chooseCategory(), + Constants.studioUIMsg.standalone() + "/" + Constants.studioUIMsg.distributed()+"/ETL", + Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), + Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), + "0.1", TimeUtils.timeNow(), AppController.email, "", ""}, + {"left","left","left","left","left","left","left","left","left","right"} }; owner = emailAccount; this.tree = tree; @@ -85,19 +85,19 @@ public Program getProgram() { } public void show(Program program){ this.program = program; - final String values[] =DBController.getProgramPanelValue(program,false); - final String category = program.getCategory(); - if("我的程åº".equals(category) || "my program".equals(category.toLowerCase()) - || "共享程åº".equals(category) || "shared program".equals(category.toLowerCase()) - || "系统程åº".equals(category) || "system program".equals(category.toLowerCase()) ){ - values[1] = category; - EditProgramPanel.this.setValues(values); - EditProgramPanel.this.init(); - EditProgramPanel.this.center(); - EditProgramPanel.this.show(); - }else{ - categorySrv.getCategory(category, new AsyncCallback(){ - + final String values[] =DBController.getProgramPanelValue(program,false); + final String category = program.getCategory(); + if("我的程åº".equals(category) || "my program".equals(category.toLowerCase()) + || "共享程åº".equals(category) || "shared program".equals(category.toLowerCase()) + || "系统程åº".equals(category) || "system program".equals(category.toLowerCase()) ){ + values[1] = category; + EditProgramPanel.this.setValues(values); + EditProgramPanel.this.init(); + EditProgramPanel.this.center(); + EditProgramPanel.this.show(); + }else{ + categorySrv.getCategory(category, new AsyncCallback(){ + @Override public void onFailure(Throwable caught) { // TODO Auto-generated method stub @@ -107,7 +107,7 @@ public void onFailure(Throwable caught) { EditProgramPanel.this.center(); EditProgramPanel.this.show(); } - + @Override public void onSuccess(Category result) { // TODO Auto-generated method stub @@ -115,15 +115,15 @@ public void onSuccess(Category result) { values[1] = result.getName(); }else values[1] = result.getPath(); - + EditProgramPanel.this.setValues( values ); EditProgramPanel.this.init(); EditProgramPanel.this.center(); EditProgramPanel.this.show(); } - - }); - } + + }); + } } } diff --git a/src/main/java/eml/studio/client/ui/panel/Grid/ETLGrid.java b/src/main/java/eml/studio/client/ui/panel/Grid/ETLGrid.java new file mode 100644 index 0000000..e0e0d86 --- /dev/null +++ b/src/main/java/eml/studio/client/ui/panel/Grid/ETLGrid.java @@ -0,0 +1,34 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.ui.panel.Grid; + +import com.google.gwt.user.client.ui.FocusWidget; +import com.google.gwt.user.client.ui.Grid; +import java.util.ArrayList; +import java.util.List; + +/** + * ETL base information grid. + */ +public abstract class ETLGrid extends Grid { + // Store the values of TextBox for value check + List paramBoxs = new ArrayList(); + + public ETLGrid(){ + super(3,2); + } + public void lock(){ + for( FocusWidget wgt : paramBoxs ){ + wgt.setEnabled( false ); + } + } + + public void unlock(){ + for( FocusWidget wgt : paramBoxs ){ + wgt.setEnabled( true ); + } + } +} diff --git a/src/main/java/eml/studio/client/ui/panel/Grid/HiveETLGrid.java b/src/main/java/eml/studio/client/ui/panel/Grid/HiveETLGrid.java new file mode 100644 index 0000000..6d863e9 --- /dev/null +++ b/src/main/java/eml/studio/client/ui/panel/Grid/HiveETLGrid.java @@ -0,0 +1,30 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ +package eml.studio.client.ui.panel.Grid; + +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.ListBox; +import com.google.gwt.user.client.ui.TextBox; + +/** + * Hive ETL Information grid + */ +public class HiveETLGrid extends ETLGrid { + protected Label urs = new Label("account"); + protected Label password = new Label("password"); + protected Label url = new Label("URL"); + + protected TextBox ursTB; + protected TextBox passwordTB; + protected TextBox urlTB; + + protected ListBox tableLB; + protected ListBox columnLB; + protected ListBox formatLB; + public HiveETLGrid(){ + + } +} diff --git a/src/main/java/eml/studio/client/ui/panel/Grid/MonitorJobDescGrid.java b/src/main/java/eml/studio/client/ui/panel/Grid/MonitorJobDescGrid.java index fe02f04..f4b9dbd 100644 --- a/src/main/java/eml/studio/client/ui/panel/Grid/MonitorJobDescGrid.java +++ b/src/main/java/eml/studio/client/ui/panel/Grid/MonitorJobDescGrid.java @@ -7,7 +7,6 @@ import eml.studio.client.util.Constants; -import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.ui.Grid; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.TextArea; @@ -26,7 +25,6 @@ public class MonitorJobDescGrid extends Grid { private TextBox useTimeBox = new TextBox(); private TextBox endTimeBox = new TextBox(); private TextArea descBox = new TextArea(); - private ClickHandler handler = null; /** * Init Grid diff --git a/src/main/java/eml/studio/client/ui/panel/Grid/SearchGrid.java b/src/main/java/eml/studio/client/ui/panel/Grid/SearchGrid.java index 250f246..eac56c0 100644 --- a/src/main/java/eml/studio/client/ui/panel/Grid/SearchGrid.java +++ b/src/main/java/eml/studio/client/ui/panel/Grid/SearchGrid.java @@ -18,135 +18,135 @@ * Search Grid */ public class SearchGrid extends Grid { - protected static Logger logger = Logger.getLogger(SearchGrid.class.getName()); - private TextBox sbox = new TextBox(); - private String keyword; - private ProgramTree programTree; - private DatasetTree datasetTree; - private JobTree jobTree; - private SearchTree resultTree; + protected static Logger logger = Logger.getLogger(SearchGrid.class.getName()); + private TextBox sbox = new TextBox(); + private String keyword; + private ProgramTree programTree; + private DatasetTree datasetTree; + private JobTree jobTree; + private SearchTree resultTree; - private void init() - { - this.setWidget(0,0,new Label("name: ")); - sbox.setEnabled(true); - sbox.setStyleName("gwt-SuggestBox"); - this.setWidget(1, 0, sbox); - SearchListener sl = new SearchListener(); - sbox.addKeyboardListener(sl); - setResultWidget(); - //this.setWidget(3, 0, programTree); - } + private void init() + { + this.setWidget(0,0,new Label("name: ")); + sbox.setEnabled(true); + sbox.setStyleName("gwt-SuggestBox"); + this.setWidget(1, 0, sbox); + SearchListener sl = new SearchListener(); + sbox.addKeyboardListener(sl); + setResultWidget(); + //this.setWidget(3, 0, programTree); + } - public SearchGrid(ProgramTree programTree, DatasetTree datasetTree, JobTree jobTree, SearchTree resultTree){ - super(4, 2); - this.programTree = programTree; - this.datasetTree = datasetTree; - this.jobTree = jobTree; - this.resultTree = resultTree; + public SearchGrid(ProgramTree programTree, DatasetTree datasetTree, JobTree jobTree, SearchTree resultTree){ + super(4, 2); + this.programTree = programTree; + this.datasetTree = datasetTree; + this.jobTree = jobTree; + this.resultTree = resultTree; - init(); - } + init(); + } - private class SearchListener extends KeyboardListenerAdapter { - @Override - public void onKeyDown(Widget sender, char key, int mods) { - if (KeyboardListener.KEY_ENTER == key) - { - keyword = sbox.getText(); - resultTree.clearTree(); - getProgramResultree(); - getDatasetResultree(); - getJobResultree(); + private class SearchListener extends KeyboardListenerAdapter { + @Override + public void onKeyDown(Widget sender, char key, int mods) { + if (KeyboardListener.KEY_ENTER == key) + { + keyword = sbox.getText(); + resultTree.clearTree(); + getProgramResultree(); + getDatasetResultree(); + getJobResultree(); - } + } - } - } - private void getProgramResultree(){ - //programTree - if(programTree.getItemCount()==0) { - }else{ - for(int i= 0;i delOozieJobs = new HashSet(); + private HashMap totalViewChkBox = new HashMap(); //Total delete checkbox + private HashMap pageChkBox = new HashMap();//Current page checkbox + + public HistoryPopupPanel(String jobId,boolean isExample, HandlerManager eventBus) { + this.eventBus = eventBus; + this.bdaJobId = jobId; + this.isExample = isExample; + init(); + eventBind(); + } + + /** + * UI Initialization + */ + protected void init() { + this.setSize("850px", "400px"); + this.setGlassEnabled(true); + this.setModal(true); + + desc.setText(desc.getText()+" Job Id - "+bdaJobId); + closeButton.setSize("10px", "10px"); + closeButton.setStyleName("closebtn"); + + VerticalPanel topPanel = new VerticalPanel(); //Outermost vertical panel + topPanel.add(closeButton); + topPanel.setCellHeight(closeButton, "13px"); + topPanel.setStyleName("vpanel"); + desc.setStyleName("popupTitle"); + topPanel.add(desc); + topPanel.setCellHeight(desc, "30px"); + + HorizontalPanel optPanel = new HorizontalPanel(); //Operation panel(include search, batch delete.etc) + optPanel.addStyleName("run-history-optPanel"); + DateTimeFormat pickerFormat = DateTimeFormat.getFormat("yyyy-MM-dd"); + startTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat)); + startTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup"); + endTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat)); + endTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup"); + searchBtn.removeStyleName("gwt-Button"); + searchBtn.addStyleName("run-history-search-button"); + //The initial time is set to 2016-1-1 + endTime = new Date(); + DateTimeFormat tmpFormatter = DateTimeFormat.getFormat("yyyy-MM-dd"); + startTime = tmpFormatter.parse("2016-01-01"); + selectAllChkBox.setVisible(false); + batchDelBtn.removeStyleName("gwt-Button"); + batchDelBtn.addStyleName("run-history-batch-del-button"); + + optPanel.add(startTimeLabel); + optPanel.add(startTimeBox); + optPanel.add(endTimeLabel); + optPanel.add(endTimeBox); + optPanel.add(searchBtn); + if(isExample && !AppController.power.equals("111")) //Example job only can be deleted by administrator privileges + {} + else + optPanel.add(batchDelBtn); + optPanel.add(selectAllChkBox); + + runHistoryGrid.addStyleName("run-history-table"); //Data view + runHistoryGrid.addStyleName("table-striped"); + runHistoryGrid.addStyleName("table-hover"); + runHistoryGrid.resize(rowNum, colNum); + for(int i=0;i entry : totalViewChkBox.entrySet()) { + CheckBox curBox = entry.getValue(); + curBox.setVisible(true); + curBox.setValue(false, true); + } + } + else if(delOozieJobs.size() ==0 && selectAllChkBox.isVisible()) //If user not select oozie job to delete and the select all checkbox is visible, then set the select all checkbox imvisible + { + selectAllChkBox.setVisible(false); + for (Map.Entry entry : totalViewChkBox.entrySet()) { + CheckBox curBox = entry.getValue(); + curBox.setVisible(false); + } + } + else + { + if(totalPage == 1 && delOozieJobs.size() == curPageRealSize) + Window.alert("Can't delete all record, you should keep at least one record!"); + else{ + final DeletePanel deletePanel = new DeletePanel(); + deletePanel.setContent(Constants.studioUIMsg.historyDelHint()+ delOozieJobs.size()+" ?"); + deletePanel.show(); + deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + + deleteBatchOozJob(delOozieJobs); + deletePanel.hide(); + selectAllChkBox.setValue(false); + } + + }); + } + } + } + }); + //Select all check box only valid for the current page + selectAllChkBox.addValueChangeHandler(new ValueChangeHandler(){ + + @Override + public void onValueChange(ValueChangeEvent event) { + // TODO Auto-generated method stub + if(event.getValue()) + { + for (Map.Entry entry : totalViewChkBox.entrySet()) { + CheckBox curBox = entry.getValue(); + curBox.setValue(false, true); + } + for (Map.Entry entry : pageChkBox.entrySet()) { + CheckBox curBox = entry.getValue(); + curBox.setValue(true,true); + } + } + else + { + for (Map.Entry entry : totalViewChkBox.entrySet()) { + CheckBox curBox = entry.getValue(); + curBox.setValue(false, true); + } + for (Map.Entry entry : pageChkBox.entrySet()) { + CheckBox curBox = entry.getValue(); + curBox.setValue(false,true); + } + } + }}); + + pageGrid.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + int index = pageGrid.getCellForEvent(event).getCellIndex(); + String pageText = pageGrid.getText(0, index); + currentPage = pagination.getCurrentPage(currentPage, pageText, totalPage); + pagination.reload(currentPage); + pageLoader(currentPage); + } + }); + } + + /** + * Job run history data list initialization + */ + public void initGridData() + { + jobSrv.getRefOozieJobNum(bdaJobId,startTime,endTime,firstLoad,new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning("The number of run history record statistics failedï¼"); + } + + @Override + public void onSuccess(Integer result) { + // TODO Auto-generated method stub + if(result != null) + { + firstLoad = false; + totalRecords = result; + totalPage = result/everyPageSize; + if(result%everyPageSize>0) + totalPage = totalPage + 1; + logger.info("record size = "+result+";totalPage="+totalPage+";startTime = "+startTime.toString() +";endTime ="+endTime.toString()); + initPageGrid(); + pageLoader(currentPage); + } + } + + }); + } + + /** + * Paging control initialization + */ + public void initPageGrid() + { + pagination = new Pagination(pageGrid,totalPage,PageType.MIDDLE); + if(currentPage ==1) + pagination.load(); //Initialize first page + else + pagination.reload(currentPage); + } + + /** + * Paging data loading + * + * @param currentPage current page number + */ + public void pageLoader(final int currentPage) + { + logger.info("current page="+currentPage); + final int startIndex = (currentPage-1)*everyPageSize; + int endIndex = startIndex; + if(currentPage == totalPage) + endIndex = totalRecords; + else + endIndex = startIndex + everyPageSize; + final int size = endIndex - startIndex; + pageChkBox = new HashMap(); + + jobSrv.getRefOozieJobPage(bdaJobId, startIndex, size, startTime, endTime, new AsyncCallback>(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning("The paging data of run history records loading failed! Page="+currentPage); + } + + @Override + public void onSuccess(final List result) { + // TODO Auto-generated method stub + if(result != null) + { + curPageRealSize = result.size(); + logger.info("start="+startIndex+";end="+(startIndex+size)+";curSize = "+ result.size()); + pageGrid.addStyleName("run-history-page"); + + clearHistoryGridData(); + for(int i = 0 ; i < result.size() ; i++) + { + final OozieJob oozieJob = result.get(i); + runHistoryGrid.setText(i+1, 0, oozieJob.getAppName()); + runHistoryGrid.setText(i+1, 1, oozieJob.getStatus()); + runHistoryGrid.setText(i+1, 2, oozieJob.getAccount()); + runHistoryGrid.setText(i+1, 3, oozieJob.getDescription()); + if(oozieJob.getCreatedTime() == null) + runHistoryGrid.setText(i+1, 4, ""); + else + runHistoryGrid.setText(i+1, 4, formatter.format(oozieJob.getCreatedTime())); + if(oozieJob.getEndTime() == null) + runHistoryGrid.setText(i+1, 5, ""); + else + runHistoryGrid.setText(i+1, 5, formatter.format(oozieJob.getEndTime())); + final HorizontalPanel optPanel = new HorizontalPanel(); + Label historyViewLabel = new Label(); + historyViewLabel.setTitle( Constants.studioUIMsg.historyView()); + historyViewLabel.addStyleName("run-history-view"); + historyViewLabel.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + HistoryPopupPanel.this.hide(); + String message =bdaJobId +"&instance="+oozieJob.getId(); + goToOozInstance(oozieJob.getId(),message); + } + }); + + Label deleteLabel = new Label(); + deleteLabel.setTitle(Constants.studioUIMsg.historyDelete()); + deleteLabel.setStyleName("run-history-delete"); + deleteLabel.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + if(result.size()==1 && totalPage == 1) //Only one page and only include one record + Window.alert("There has only one record, can't be deleted!"); + else + { + final DeletePanel deletePanel = new DeletePanel(); + deletePanel.setContent("Sure to delete this history record?"); + deletePanel.show(); + deletePanel.getConfirmBtn().addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + deleteOozJob(oozieJob.getId()); + deletePanel.hide(); + } + }); + } + } + + }); + + CheckBox delChkBox = null; + if(totalViewChkBox.containsKey(oozieJob.getId())) + delChkBox = totalViewChkBox.get(oozieJob.getId()); + else + { + delChkBox = new CheckBox(); + delChkBox.setStyleName("run-history-record-chk-box"); + delChkBox.addValueChangeHandler(new ValueChangeHandler(){ + + @Override + public void onValueChange( + ValueChangeEvent event) { + // TODO Auto-generated method stub + if(event.getValue()) + { + delOozieJobs.add(oozieJob.getId()); + } + else + { + if(delOozieJobs.contains(oozieJob.getId())) + delOozieJobs.remove(oozieJob.getId()); + } + } + + }); + totalViewChkBox.put(oozieJob.getId(), delChkBox); + } + pageChkBox.put(oozieJob.getId(), delChkBox); + + if(selectAllChkBox.isVisible()) + delChkBox.setVisible(true); + else + delChkBox.setVisible(false); + + optPanel.add(historyViewLabel); + if(isExample && !AppController.power.equals("111")) + {} + else + optPanel.add(deleteLabel); + optPanel.add(delChkBox); + runHistoryGrid.setWidget(i+1, 6, optPanel); + } + } + }}); + } + + /** + * Batch delete some job history records + * + * @param oozJobIds oozie job id list to delete + */ + public void deleteBatchOozJob(final Set oozJobIds) + { + jobSrv.deleteBatchOozieJob(oozJobIds, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning("Batch delete run history record failedï¼ History record number="+oozJobIds.size()); + } + + @Override + public void onSuccess(Void result) { + // TODO Auto-generated method stub + + totalRecords = totalRecords - oozJobIds.size(); + totalPage = totalRecords/everyPageSize; + if(totalRecords%everyPageSize>0) + totalPage = totalPage + 1; + logger.info("current record size = "+totalRecords+"totalPage="+totalPage); + if(currentPage > totalPage) + currentPage = totalPage; + delOozieJobs = new HashSet(); + for(String jobId : oozJobIds) + { + if(totalViewChkBox.containsKey(jobId)) + totalViewChkBox.remove(jobId); + } + initPageGrid(); + pageLoader(currentPage); + } + + }); + } + + /** + * Delete a run history record + * + * @param oozJobId oozie job id to delete + */ + public void deleteOozJob(final String oozJobId) + { + jobSrv.deleteOozieJob(oozJobId, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning("Delete run history record failed! OozJobId="+oozJobId); + } + + @Override + public void onSuccess(Void result) { + // TODO Auto-generated method stub + totalRecords = totalRecords - 1; + totalPage = totalRecords/everyPageSize; + if(totalRecords%everyPageSize>0) + totalPage = totalPage + 1; + logger.info("current record size = "+totalRecords+"totalPage="+totalPage); + if(currentPage > totalPage) + currentPage = totalPage; + initPageGrid(); + pageLoader(currentPage); + } + + }); + } + + /** + * Clear history data + */ + public void clearHistoryGridData() + { + for(int i=1 ; i(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + logger.warning("Synchronize current oozie instance actions status failed! Oozie job id ="+oozJobId); + } + + @Override + public void onSuccess(Void result) { + // TODO Auto-generated method stub + eventBus.fireEvent(new ToMonitorEvent(message)); + } + }); + } + + @Override + public void center(){ + super.center(); + } + +} diff --git a/src/main/java/eml/studio/client/ui/panel/JobDescPopupPanel.java b/src/main/java/eml/studio/client/ui/panel/JobDescPopupPanel.java index 9bb587b..929b1b8 100644 --- a/src/main/java/eml/studio/client/ui/panel/JobDescPopupPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/JobDescPopupPanel.java @@ -24,100 +24,100 @@ * Job Desc confirm Panel */ public class JobDescPopupPanel extends BasePopupPanel { - private TextBox namebox = new TextBox(); - private TextArea descArea = new TextArea(); - private Label errorLabel = new Label(); - - Button submitBtn = new Button(Constants.studioUIMsg.confirm()); - - public JobDescPopupPanel(String title) { - - Label label = new Label(title); - label.setStyleName("bda-newjob-head"); - verticalPanel.add(label); - verticalPanel.add(createGrid()); - HorizontalPanel hpanel = new HorizontalPanel(); - - hpanel.setStyleName("bda-newjob-hpanel"); - verticalPanel.add(errorLabel); - Button cancelBtn = new Button(Constants.studioUIMsg.cancel()); - cancelBtn.addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - JobDescPopupPanel.this.hide(); - } - - }); - - hpanel.add(submitBtn); - hpanel.add(cancelBtn); - submitBtn.removeStyleName("gwt-Button"); - cancelBtn.removeStyleName("gwt-Button"); - submitBtn.addStyleName("button-style"); - cancelBtn.addStyleName("button-style"); - errorLabel.setStyleName("error-label"); - verticalPanel.add(hpanel); - verticalPanel.addStyleName("bda-newjob"); - this.setCloseEnable(false); - } - - /** - * Create a Grid that describes the job - */ - @SuppressWarnings("deprecation") - private Grid createGrid() { - Grid grid = new Grid(2, 2); - grid.setWidth("280px"); - grid.setWidget(0, 0, new Label(Constants.studioUIMsg.jobName())); - /** - * Panel information - */ - - namebox.setStyleName("boxstyle"); - grid.setWidget(0, 1, namebox); - grid.setWidget(1, 0, new Label(Constants.studioUIMsg.jobDescription())); - - SubmitListener sl = new SubmitListener(); - namebox.addKeyboardListener(sl); - - descArea.setStyleName("boxstyle"); - descArea.setHeight("auto"); - grid.setWidget(1, 1, descArea); - grid.setStyleName("bda-newjob-grid"); - return grid; - } - - public void setJobName(String name) { - namebox.setText(name); - } - - public void setJobDesc(String desc) { - descArea.setText(desc); - } - - public String getJobName() { - return namebox.getText(); - } - - public String getJobDesc() { - return descArea.getText(); - } - - public HasClickHandlers getSubmitBtn() { - return submitBtn; - } - - public void setErrorMsg(String msg) { - errorLabel.setText(msg); - } - - private class SubmitListener extends KeyboardListenerAdapter { - @Override - public void onKeyPress(Widget sender, char key, int mods) { - if (KeyboardListener.KEY_ENTER == key) - submitBtn.click(); - } - } + private TextBox namebox = new TextBox(); + private TextArea descArea = new TextArea(); + private Label errorLabel = new Label(); + + Button submitBtn = new Button(Constants.studioUIMsg.confirm()); + + public JobDescPopupPanel(String title) { + + Label label = new Label(title); + label.setStyleName("bda-newjob-head"); + verticalPanel.add(label); + verticalPanel.add(createGrid()); + HorizontalPanel hpanel = new HorizontalPanel(); + + hpanel.setStyleName("bda-newjob-hpanel"); + verticalPanel.add(errorLabel); + Button cancelBtn = new Button(Constants.studioUIMsg.cancel()); + cancelBtn.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + JobDescPopupPanel.this.hide(); + } + + }); + + hpanel.add(submitBtn); + hpanel.add(cancelBtn); + submitBtn.removeStyleName("gwt-Button"); + cancelBtn.removeStyleName("gwt-Button"); + submitBtn.addStyleName("button-style"); + cancelBtn.addStyleName("button-style"); + errorLabel.setStyleName("error-label"); + verticalPanel.add(hpanel); + verticalPanel.addStyleName("bda-newjob"); + this.setCloseEnable(false); + } + + /** + * Create a Grid that describes the job + */ + @SuppressWarnings("deprecation") + private Grid createGrid() { + Grid grid = new Grid(2, 2); + grid.setWidth("280px"); + grid.setWidget(0, 0, new Label(Constants.studioUIMsg.jobName())); + /** + * Panel information + */ + + namebox.setStyleName("boxstyle"); + grid.setWidget(0, 1, namebox); + grid.setWidget(1, 0, new Label(Constants.studioUIMsg.jobDescription())); + + SubmitListener sl = new SubmitListener(); + namebox.addKeyboardListener(sl); + + descArea.setStyleName("boxstyle"); + descArea.setHeight("auto"); + grid.setWidget(1, 1, descArea); + grid.setStyleName("bda-newjob-grid"); + return grid; + } + + public void setJobName(String name) { + namebox.setText(name); + } + + public void setJobDesc(String desc) { + descArea.setText(desc); + } + + public String getJobName() { + return namebox.getText(); + } + + public String getJobDesc() { + return descArea.getText(); + } + + public HasClickHandlers getSubmitBtn() { + return submitBtn; + } + + public void setErrorMsg(String msg) { + errorLabel.setText(msg); + } + + private class SubmitListener extends KeyboardListenerAdapter { + @Override + public void onKeyPress(Widget sender, char key, int mods) { + if (KeyboardListener.KEY_ENTER == key) + submitBtn.click(); + } + } } diff --git a/src/main/java/eml/studio/client/ui/panel/LoginPanel.java b/src/main/java/eml/studio/client/ui/panel/LoginPanel.java index 29243a4..b0ad1fc 100644 --- a/src/main/java/eml/studio/client/ui/panel/LoginPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/LoginPanel.java @@ -33,125 +33,125 @@ * Login Panel */ public class LoginPanel extends PopupPanel { - protected AccountServiceAsync accountSrv = GWT.create(AccountService.class); - - public final Label errorLabel = new Label(); - protected TextBox emailField = new TextBox(); - protected PasswordTextBox passwordField = new PasswordTextBox(); - final CheckBox checkBox = new CheckBox(Constants.logUIMsg.remember()); - final Label guestLabel = new Label(Constants.logUIMsg.guest()); - final Label forgetLabel = new Label(Constants.logUIMsg.forget()); - final Button signinButton = new Button(Constants.logUIMsg.login().toLowerCase()); - final Button signupButton = new Button(Constants.logUIMsg.register()); - private VerticalPanel loginContainer = new VerticalPanel(); - private HorizontalPanel pwdPanel = new HorizontalPanel(); - private HorizontalPanel btnPanel = new HorizontalPanel(); - - protected boolean autoLogin = true; - - public LoginPanel() { - this.setStyleName("bda-login"); - boolean checked = Boolean.parseBoolean(Cookies.getCookie("bdachecked")); - checkBox.setValue(checked); - - Label emailLabel = new Label(Constants.logUIMsg.email()); - emailField.setStyleName("form-control"); - emailField.setValue(Cookies.getCookie("bdaemail")); - Label passwordLabel = new Label(Constants.logUIMsg.password()); - passwordField.setStyleName("form-control"); - if (checked) - passwordField.setValue(UUID.randomID()); - - errorLabel.addStyleName("bad-login-error"); - - checkBox.setStyleName("bda-login-checkbox"); - forgetLabel.setStyleName("bda-login-forgetpwd"); - pwdPanel.setStyleName("bda-form-group"); - pwdPanel.add(checkBox); - pwdPanel.add(forgetLabel); - - signinButton.addStyleName("button-style"); - signinButton.getElement().getStyle().setMarginLeft(7, Unit.PX); - signinButton.getElement().getStyle().setMarginRight(60, Unit.PX); - signupButton.addStyleName("button-style"); - btnPanel.setStyleName("bda-form-group"); - btnPanel.add(signinButton); - btnPanel.add(signupButton); - - HorizontalPanel hp = new HorizontalPanel(); - hp.add(emailLabel); - hp.add(guestLabel); - guestLabel.getElement().getStyle().setWidth(100, Unit.PX); - guestLabel.getElement().getStyle().setTextAlign(TextAlign.RIGHT); - guestLabel.getElement().getStyle().setMarginLeft(80, Unit.PX); - guestLabel.getElement().getStyle().setCursor(Cursor.POINTER); - loginContainer.add(hp); - loginContainer.add(emailField); - loginContainer.add(passwordLabel); - loginContainer.add(passwordField); - loginContainer.add(errorLabel); - loginContainer.add(pwdPanel); - loginContainer.add(btnPanel); - - loginContainer.setStyleName("bda-login-form"); - loginContainer.setBorderWidth(0); - loginContainer.setStyleName((String) null); - - this.add(loginContainer); - - passwordField.addChangeHandler(new ChangeHandler() { - - @Override - public void onChange(ChangeEvent event) { - autoLogin = false; - } - - }); - - checkBox.addValueChangeHandler(new ValueChangeHandler() { - - @Override - public void onValueChange(ValueChangeEvent event) { - // Window.alert( checkBox.getValue().toString() ); - Cookies.setCookie("bdachecked", checkBox.getValue().toString(), Util.getCookieExpireDate()); - if (!getRemmenber()) { - Cookies.removeCookie("bdaserial"); - Cookies.removeCookie("bdatoken"); - } - } - - }); - } - - public void addGuestLoginHandler(ClickHandler handler){ - guestLabel.addClickHandler(handler); - } - - public void addSignInHandler(ClickHandler handler) { - signinButton.addClickHandler(handler); - } - - public void addSignUpHandler(ClickHandler handler) { - signupButton.addClickHandler(handler); - } - - public void addForgetPwdHandler(ClickHandler handler){ - forgetLabel.addClickHandler(handler); - } - - public String getEmail() { - return emailField.getValue(); - } - - public String getPassword() { - return passwordField.getValue(); - } - - public boolean getRemmenber() { - return checkBox.getValue(); - } - - public boolean getAutoLogin() { - return autoLogin && getRemmenber(); - } + protected AccountServiceAsync accountSrv = GWT.create(AccountService.class); + + public final Label errorLabel = new Label(); + protected TextBox emailField = new TextBox(); + protected PasswordTextBox passwordField = new PasswordTextBox(); + final CheckBox checkBox = new CheckBox(Constants.logUIMsg.remember()); + final Label guestLabel = new Label(Constants.logUIMsg.guest()); + final Label forgetLabel = new Label(Constants.logUIMsg.forget()); + final Button signinButton = new Button(Constants.logUIMsg.login().toLowerCase()); + final Button signupButton = new Button(Constants.logUIMsg.register()); + private VerticalPanel loginContainer = new VerticalPanel(); + private HorizontalPanel pwdPanel = new HorizontalPanel(); + private HorizontalPanel btnPanel = new HorizontalPanel(); + + protected boolean autoLogin = true; + + public LoginPanel() { + this.setStyleName("bda-login"); + boolean checked = Boolean.parseBoolean(Cookies.getCookie("bdachecked")); + checkBox.setValue(checked); + + Label emailLabel = new Label(Constants.logUIMsg.email()); + emailField.setStyleName("form-control"); + emailField.setValue(Cookies.getCookie("bdaemail")); + Label passwordLabel = new Label(Constants.logUIMsg.password()); + passwordField.setStyleName("form-control"); + if (checked) + passwordField.setValue(UUID.randomID()); + + errorLabel.addStyleName("bad-login-error"); + + checkBox.setStyleName("bda-login-checkbox"); + forgetLabel.setStyleName("bda-login-forgetpwd"); + pwdPanel.setStyleName("bda-form-group"); + pwdPanel.add(checkBox); + pwdPanel.add(forgetLabel); + + signinButton.addStyleName("button-style"); + signinButton.getElement().getStyle().setMarginLeft(7, Unit.PX); + signinButton.getElement().getStyle().setMarginRight(60, Unit.PX); + signupButton.addStyleName("button-style"); + btnPanel.setStyleName("bda-form-group"); + btnPanel.add(signinButton); + btnPanel.add(signupButton); + + HorizontalPanel hp = new HorizontalPanel(); + hp.add(emailLabel); + hp.add(guestLabel); + guestLabel.getElement().getStyle().setWidth(100, Unit.PX); + guestLabel.getElement().getStyle().setTextAlign(TextAlign.RIGHT); + guestLabel.getElement().getStyle().setMarginLeft(80, Unit.PX); + guestLabel.getElement().getStyle().setCursor(Cursor.POINTER); + loginContainer.add(hp); + loginContainer.add(emailField); + loginContainer.add(passwordLabel); + loginContainer.add(passwordField); + loginContainer.add(errorLabel); + loginContainer.add(pwdPanel); + loginContainer.add(btnPanel); + + loginContainer.setStyleName("bda-login-form"); + loginContainer.setBorderWidth(0); + loginContainer.setStyleName((String) null); + + this.add(loginContainer); + + passwordField.addChangeHandler(new ChangeHandler() { + + @Override + public void onChange(ChangeEvent event) { + autoLogin = false; + } + + }); + + checkBox.addValueChangeHandler(new ValueChangeHandler() { + + @Override + public void onValueChange(ValueChangeEvent event) { + // Window.alert( checkBox.getValue().toString() ); + Cookies.setCookie("bdachecked", checkBox.getValue().toString(), Util.getCookieExpireDate()); + if (!getRemmenber()) { + Cookies.removeCookie("bdaserial"); + Cookies.removeCookie("bdatoken"); + } + } + + }); + } + + public void addGuestLoginHandler(ClickHandler handler){ + guestLabel.addClickHandler(handler); + } + + public void addSignInHandler(ClickHandler handler) { + signinButton.addClickHandler(handler); + } + + public void addSignUpHandler(ClickHandler handler) { + signupButton.addClickHandler(handler); + } + + public void addForgetPwdHandler(ClickHandler handler){ + forgetLabel.addClickHandler(handler); + } + + public String getEmail() { + return emailField.getValue(); + } + + public String getPassword() { + return passwordField.getValue(); + } + + public boolean getRemmenber() { + return checkBox.getValue(); + } + + public boolean getAutoLogin() { + return autoLogin && getRemmenber(); + } } diff --git a/src/main/java/eml/studio/client/ui/panel/ParameterPopupPanel.java b/src/main/java/eml/studio/client/ui/panel/ParameterPopupPanel.java index 0bfdf12..7506041 100644 --- a/src/main/java/eml/studio/client/ui/panel/ParameterPopupPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/ParameterPopupPanel.java @@ -18,41 +18,39 @@ */ public class ParameterPopupPanel extends BasePopupPanel { - protected Button submitBtn = new Button(Constants.studioUIMsg.confirm()); - protected ParameterPanel panel; - - HorizontalPanel hpanel = new HorizontalPanel(); - - public ParameterPopupPanel() { - submitBtn.removeStyleName("gwt-Button"); - submitBtn.addStyleName("button-style"); - submitBtn.getElement().getStyle().setMarginLeft(180, Unit.PX); - submitBtn.getElement().getStyle().setMarginTop(20, Unit.PX); - submitBtn.getElement().getStyle().setMarginBottom(-20, Unit.PX); - hpanel.setStyleName("bda-newjob-hpanel"); - // verticalPanel.add( errorLabel ); - hpanel.add(submitBtn); - // errorLabel.setStyleName("error-label"); - verticalPanel.add(hpanel); - verticalPanel.addStyleName("bda-parameter-vpanel"); - this.setCloseEnable(false); - } - - public void addSubmitHandler(ClickHandler handler) { - submitBtn.addClickHandler(handler); - } - - public void setParameterPanel(ParameterPanel panel) { - if (panel == null) - return; - verticalPanel.clear(); - verticalPanel.add(panel); - verticalPanel.add(submitBtn); - this.panel = panel; - } - - public ParameterPanel getPanel() { - return panel; - } + protected Button submitBtn = new Button(Constants.studioUIMsg.confirm()); + protected ParameterPanel panel; + + HorizontalPanel hpanel = new HorizontalPanel(); + + public ParameterPopupPanel() { + submitBtn.removeStyleName("gwt-Button"); + submitBtn.addStyleName("button-style"); + submitBtn.getElement().getStyle().setMarginLeft(180, Unit.PX); + submitBtn.getElement().getStyle().setMarginTop(20, Unit.PX); + submitBtn.getElement().getStyle().setMarginBottom(-20, Unit.PX); + hpanel.setStyleName("bda-newjob-hpanel"); + hpanel.add(submitBtn); + verticalPanel.add(hpanel); + verticalPanel.addStyleName("bda-parameter-vpanel"); + this.setCloseEnable(false); + } + + public void addSubmitHandler(ClickHandler handler) { + submitBtn.addClickHandler(handler); + } + + public void setParameterPanel(ParameterPanel panel) { + if (panel == null) + return; + verticalPanel.clear(); + verticalPanel.add(panel); + verticalPanel.add(submitBtn); + this.panel = panel; + } + + public ParameterPanel getPanel() { + return panel; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/ui/panel/PreviewPopupPanel.java b/src/main/java/eml/studio/client/ui/panel/PreviewPopupPanel.java index 611030d..78f333f 100644 --- a/src/main/java/eml/studio/client/ui/panel/PreviewPopupPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/PreviewPopupPanel.java @@ -169,9 +169,9 @@ public void onSuccess(Double size) { else Window.alert("Download file over limit size (1g), can not download the file!"); } - + }); - + } }); savebtn.addClickHandler(new ClickHandler() { @@ -190,7 +190,7 @@ public void onClick(ClickEvent clickEvent) { @Override public void onSelection(SelectionEvent event) { // TODO Auto-generated method stub - TreeItem item = event.getSelectedItem(); + TreeItem item = event.getSelectedItem(); if (item instanceof PopupRetDirLeaf) { PopupRetDirLeaf leaf = (PopupRetDirLeaf)item; fileLabel.setText(leaf.getText()); @@ -198,7 +198,7 @@ public void onSelection(SelectionEvent event) { String filePath = leaf.getPath(); //Only the root directory for data loading tips if(leaf.getName().equals(resultDirTree.getRoot().getName()) && leaf.getChildCount() == resultDirTree.getRoot().getChildCount()) - fileTextArea.setText("The data is loading, please be patient ..."); + fileTextArea.setText("The data is loading, please be patient ..."); datasetSrv.previewFile(filePath, 100,new AsyncCallback(){ @Override public void onFailure(Throwable caught) { diff --git a/src/main/java/eml/studio/client/ui/panel/RegisterPanel.java b/src/main/java/eml/studio/client/ui/panel/RegisterPanel.java index 7135398..3e96504 100644 --- a/src/main/java/eml/studio/client/ui/panel/RegisterPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/RegisterPanel.java @@ -25,100 +25,100 @@ */ public class RegisterPanel extends PopupPanel { - protected AccountServiceAsync accountSrv = GWT.create(AccountService.class); - protected MailServiceAsync mailSrv = GWT.create(MailService.class); - - TextBox mailbox = new TextBox(); - TextBox validateBox = new TextBox(); - Label mailerrorLabel; - - Button confirmBtn = new Button(Constants.logUIMsg.registerConfirm()); - Button verityBtn = new Button(Constants.logUIMsg.registerVerify()); - - HorizontalPanel btnPanel = new HorizontalPanel(); - VerticalPanel vpanel = new VerticalPanel(); - - public RegisterPanel() { - this.setStyleName("bda-login"); - vpanel.setStyleName("bda-login-form"); - - Label mailLabel = new Label(Constants.logUIMsg.registerEmail()); - mailbox.setStyleName("form-control"); - mailerrorLabel = new Label(); - mailerrorLabel.addStyleName("bad-login-error"); - - Button cancelBtn = new Button(Constants.logUIMsg.registerCancel()); - cancelBtn.getElement().getStyle().setMarginLeft(7, Unit.PX); - cancelBtn.getElement().getStyle().setMarginRight(60, Unit.PX); - cancelBtn.addStyleName("button-style"); - verityBtn.addStyleName("button-style"); - - btnPanel.setStyleName("bda-form-group"); - btnPanel.getElement().getStyle().setMarginTop(15, Unit.PX); - btnPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); - btnPanel.add(cancelBtn); - btnPanel.add(verityBtn); - - vpanel.add(mailLabel); - vpanel.add(mailbox); - vpanel.add(mailerrorLabel); - vpanel.add(btnPanel); - - this.add(vpanel); - - - cancelBtn.addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - mailbox.setValue(""); - mailerrorLabel.setText(""); - RegisterPanel.this.hide(); - } - - }); - - //Send a verification email - verityBtn.addClickHandler(new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - if( !mailbox.getValue().matches("^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$") ){ - mailerrorLabel.setText(Constants.registerUIMsg.emailFormatErrorMsg()); - }else{ - String href = Window.Location.getHref(); - if(href.split("=").length > 1){ - href = href.split("=")[1]; - } - int splitIdx = href.lastIndexOf('/'); - final String base_url = href.substring(0, splitIdx); - - final Account account = new Account(); - account.setEmail(mailbox.getValue()); - mailSrv.SendMail(base_url, account, "r", new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - mailerrorLabel.setText(caught.getMessage()); - } + protected AccountServiceAsync accountSrv = GWT.create(AccountService.class); + protected MailServiceAsync mailSrv = GWT.create(MailService.class); + + TextBox mailbox = new TextBox(); + TextBox validateBox = new TextBox(); + Label mailerrorLabel; + + Button confirmBtn = new Button(Constants.logUIMsg.registerConfirm()); + Button verityBtn = new Button(Constants.logUIMsg.registerVerify()); + + HorizontalPanel btnPanel = new HorizontalPanel(); + VerticalPanel vpanel = new VerticalPanel(); + + public RegisterPanel() { + this.setStyleName("bda-login"); + vpanel.setStyleName("bda-login-form"); + + Label mailLabel = new Label(Constants.logUIMsg.registerEmail()); + mailbox.setStyleName("form-control"); + mailerrorLabel = new Label(); + mailerrorLabel.addStyleName("bad-login-error"); + + Button cancelBtn = new Button(Constants.logUIMsg.registerCancel()); + cancelBtn.getElement().getStyle().setMarginLeft(7, Unit.PX); + cancelBtn.getElement().getStyle().setMarginRight(60, Unit.PX); + cancelBtn.addStyleName("button-style"); + verityBtn.addStyleName("button-style"); + + btnPanel.setStyleName("bda-form-group"); + btnPanel.getElement().getStyle().setMarginTop(15, Unit.PX); + btnPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); + btnPanel.add(cancelBtn); + btnPanel.add(verityBtn); + + vpanel.add(mailLabel); + vpanel.add(mailbox); + vpanel.add(mailerrorLabel); + vpanel.add(btnPanel); - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result.equals("email existed")){ - mailerrorLabel.setText( Constants.registerUIMsg.emailHasRegisteredMsg()); - }else if(result.equals("send email failed")){ - mailerrorLabel.setText(Constants.registerUIMsg.verifyEmailErrMsg()); - }else if(result.equals("success")){ - mailerrorLabel.setText(Constants.registerUIMsg.verifyEmailSuccessMsg()); - }else - mailerrorLabel.setText(result); - } - }); + this.add(vpanel); + + + cancelBtn.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + mailbox.setValue(""); + mailerrorLabel.setText(""); + RegisterPanel.this.hide(); + } + + }); + + //Send a verification email + verityBtn.addClickHandler(new ClickHandler(){ + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + if( !mailbox.getValue().matches("^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$") ){ + mailerrorLabel.setText(Constants.registerUIMsg.emailFormatErrorMsg()); + }else{ + String href = Window.Location.getHref(); + if(href.split("=").length > 1){ + href = href.split("=")[1]; + } + int splitIdx = href.lastIndexOf('/'); + final String base_url = href.substring(0, splitIdx); + + final Account account = new Account(); + account.setEmail(mailbox.getValue()); + mailSrv.SendMail(base_url, account, "r", new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + mailerrorLabel.setText(caught.getMessage()); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result.equals("email existed")){ + mailerrorLabel.setText( Constants.registerUIMsg.emailHasRegisteredMsg()); + }else if(result.equals("send email failed")){ + mailerrorLabel.setText(Constants.registerUIMsg.verifyEmailErrMsg()); + }else if(result.equals("success")){ + mailerrorLabel.setText(Constants.registerUIMsg.verifyEmailSuccessMsg()); + }else + mailerrorLabel.setText(result); + } + }); + } } - } - }); - } + }); + } } diff --git a/src/main/java/eml/studio/client/ui/panel/ResetpwdPanel.java b/src/main/java/eml/studio/client/ui/panel/ResetpwdPanel.java index 1e65619..0824af8 100644 --- a/src/main/java/eml/studio/client/ui/panel/ResetpwdPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/ResetpwdPanel.java @@ -29,94 +29,94 @@ */ public class ResetpwdPanel extends PopupPanel { - protected MailServiceAsync mailService = GWT.create(MailService.class); - - private Label mailLabel = new Label(Constants.logUIMsg.resetEmail()); - private TextBox mailBox = new TextBox(); - private Label mailerrorLabel = new Label(); - private Button cancelBtn = new Button(Constants.logUIMsg.resetCancel()); - private Button sendBtn = new Button(Constants.logUIMsg.resetSend()); - private HorizontalPanel btnHpanel = new HorizontalPanel(); - private VerticalPanel container = new VerticalPanel(); - - public ResetpwdPanel() { - this.setStyleName("bda-login"); - mailBox.setStyleName("form-control"); - mailerrorLabel.addStyleName("bad-login-error"); - - cancelBtn.addStyleName("button-style"); - cancelBtn.getElement().getStyle().setMarginLeft(7, Unit.PX); - cancelBtn.getElement().getStyle().setMarginRight(30, Unit.PX); - sendBtn.addStyleName("button-style"); - sendBtn.getElement().getStyle().setWidth(100, Unit.PX); - btnHpanel.add(cancelBtn); - btnHpanel.add(sendBtn); - btnHpanel.setStyleName("bda-form-group"); - btnHpanel.getElement().getStyle().setMarginTop(15, Unit.PX); - btnHpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); - - container.add(mailLabel); - container.add(mailBox); - container.add(mailerrorLabel); - container.add(btnHpanel); - - container.setStyleName("bda-login-form"); - - this.add(container); - - cancelBtn.addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - mailBox.setValue(""); - mailerrorLabel.setText(""); - ResetpwdPanel.this.hide(); - } - - }); - - //Send a verification email - sendBtn.addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - // TODO Auto-generated method stub - if( !mailBox.getValue().matches("^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$") ){ - mailerrorLabel.setText(Constants.resetpwdUIMsg.emailFormatErrorMsg()); - }else{ - String href = Window.Location.getHref(); - if(href.split("=").length > 1){ - href = href.split("=")[1]; - } - int splitIdx = href.lastIndexOf('/'); - final String base_url = href.substring(0, splitIdx); - - final Account account = new Account(); - account.setEmail(mailBox.getValue()); - mailService.SendMail(base_url, account, "m", new AsyncCallback(){ - - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - mailerrorLabel.setText(caught.getMessage()); + protected MailServiceAsync mailService = GWT.create(MailService.class); + + private Label mailLabel = new Label(Constants.logUIMsg.resetEmail()); + private TextBox mailBox = new TextBox(); + private Label mailerrorLabel = new Label(); + private Button cancelBtn = new Button(Constants.logUIMsg.resetCancel()); + private Button sendBtn = new Button(Constants.logUIMsg.resetSend()); + private HorizontalPanel btnHpanel = new HorizontalPanel(); + private VerticalPanel container = new VerticalPanel(); + + public ResetpwdPanel() { + this.setStyleName("bda-login"); + mailBox.setStyleName("form-control"); + mailerrorLabel.addStyleName("bad-login-error"); + + cancelBtn.addStyleName("button-style"); + cancelBtn.getElement().getStyle().setMarginLeft(7, Unit.PX); + cancelBtn.getElement().getStyle().setMarginRight(30, Unit.PX); + sendBtn.addStyleName("button-style"); + sendBtn.getElement().getStyle().setWidth(100, Unit.PX); + btnHpanel.add(cancelBtn); + btnHpanel.add(sendBtn); + btnHpanel.setStyleName("bda-form-group"); + btnHpanel.getElement().getStyle().setMarginTop(15, Unit.PX); + btnHpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); + + container.add(mailLabel); + container.add(mailBox); + container.add(mailerrorLabel); + container.add(btnHpanel); + + container.setStyleName("bda-login-form"); + + this.add(container); + + cancelBtn.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + mailBox.setValue(""); + mailerrorLabel.setText(""); + ResetpwdPanel.this.hide(); + } + + }); + + //Send a verification email + sendBtn.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + // TODO Auto-generated method stub + if( !mailBox.getValue().matches("^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$") ){ + mailerrorLabel.setText(Constants.resetpwdUIMsg.emailFormatErrorMsg()); + }else{ + String href = Window.Location.getHref(); + if(href.split("=").length > 1){ + href = href.split("=")[1]; } - - @Override - public void onSuccess(String result) { - // TODO Auto-generated method stub - if(result.equals("success")){ - mailerrorLabel.setText(Constants.resetpwdUIMsg.sendEmailSuccessMsg()); - }else if(result.equals("send email failed")){ - mailerrorLabel.setText(Constants.resetpwdUIMsg.sendEmailErrMsg()); - }else if(result.equals("email doesn't exist")){ - mailerrorLabel.setText(Constants.resetpwdUIMsg.emailNotExistMsg()); - }else - mailerrorLabel.setText(result); + int splitIdx = href.lastIndexOf('/'); + final String base_url = href.substring(0, splitIdx); + + final Account account = new Account(); + account.setEmail(mailBox.getValue()); + mailService.SendMail(base_url, account, "m", new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + mailerrorLabel.setText(caught.getMessage()); + } + + @Override + public void onSuccess(String result) { + // TODO Auto-generated method stub + if(result.equals("success")){ + mailerrorLabel.setText(Constants.resetpwdUIMsg.sendEmailSuccessMsg()); + }else if(result.equals("send email failed")){ + mailerrorLabel.setText(Constants.resetpwdUIMsg.sendEmailErrMsg()); + }else if(result.equals("email doesn't exist")){ + mailerrorLabel.setText(Constants.resetpwdUIMsg.emailNotExistMsg()); + }else + mailerrorLabel.setText(result); } }); } - } - }); - } + } + }); + } } diff --git a/src/main/java/eml/studio/client/ui/panel/SaveDatasetPanel.java b/src/main/java/eml/studio/client/ui/panel/SaveDatasetPanel.java index cedb6fc..d1d669e 100644 --- a/src/main/java/eml/studio/client/ui/panel/SaveDatasetPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/SaveDatasetPanel.java @@ -21,57 +21,56 @@ * Save Data Set Panel */ public class SaveDatasetPanel extends BasePanel{ - private DBController dbController = new DBController(); - protected Button savebtn = new Button(Constants.studioUIMsg.submit()); - protected Dataset dataset = new Dataset(); - private PreviewPopupPanel panel; - public SaveDatasetPanel (PreviewPopupPanel panel) { - super(); - this.panel = panel; - labarr = new String[][]{ - {"Name","Category","DataType","Version","CreateDate","Owner","Description"},//字段 - {Constants.studioUIMsg.dataName(), Constants.studioUIMsg.dataCategory() - , Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), - Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), Constants.studioUIMsg.dataDescription()},//显示的标签 - {"textbox","listbox","listbox","textbox","textbox","textbox","textarea"},//框的类型 - {"true","true","true","true","false","false","true"}, - {"", Constants.studioUIMsg.myData() + "/" + Constants.studioUIMsg.sharedData(), - "General/CSV/TSV", "0.1", TimeUtils.timeNow(), AppController.email, ""}, - {"left","left","left","left","left","left","right"} - }; - //init(); - } - @Override -protected void init(){ - grid = new DescribeGrid(labarr, "data"); - verticalPanel.add(grid); - grid.addStyleName("bda-descgrid-savedata"); - savebtn.setStyleName("bda-descgrid-savedata-submitbtn"); - SimplePanel simPanel = new SimplePanel(); - simPanel.add( savebtn ); - simPanel.setStyleName("bda-descgrid-savedata-simpanel"); - verticalPanel.add(simPanel); - savebtn.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - dbController.submitSaveDataset2DB(panel,SaveDatasetPanel.this, dataset,grid); - } - }); - } + private DBController dbController = new DBController(); + protected Button savebtn = new Button(Constants.studioUIMsg.submit()); + protected Dataset dataset = new Dataset(); + private PreviewPopupPanel panel; + public SaveDatasetPanel (PreviewPopupPanel panel) { + super(); + this.panel = panel; + labarr = new String[][]{ + {"Name","Category","DataType","Version","CreateDate","Owner","Description"},//Fields + {Constants.studioUIMsg.dataName(), Constants.studioUIMsg.dataCategory() + , Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), + Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), Constants.studioUIMsg.dataDescription()},//显示的标签 + {"textbox","listbox","listbox","textbox","textbox","textbox","textarea"},//The type of field box + {"true","true","true","true","false","false","true"}, + {"", Constants.studioUIMsg.myData() + "/" + Constants.studioUIMsg.sharedData(), + "General/CSV/TSV", "0.1", TimeUtils.timeNow(), AppController.email, ""}, + {"left","left","left","left","left","left","right"} + }; + } + @Override + protected void init(){ + grid = new DescribeGrid(labarr, "data"); + verticalPanel.add(grid); + grid.addStyleName("bda-descgrid-savedata"); + savebtn.setStyleName("bda-descgrid-savedata-submitbtn"); + SimplePanel simPanel = new SimplePanel(); + simPanel.add( savebtn ); + simPanel.setStyleName("bda-descgrid-savedata-simpanel"); + verticalPanel.add(simPanel); + savebtn.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + dbController.submitSaveDataset2DB(panel,SaveDatasetPanel.this, dataset,grid); + } + }); + } - public Button getSavebtn() { - return savebtn; - } + public Button getSavebtn() { + return savebtn; + } - public void setSavebtn(Button savebtn) { - this.savebtn = savebtn; - } + public void setSavebtn(Button savebtn) { + this.savebtn = savebtn; + } - public Dataset getDataset() { - return dataset; - } + public Dataset getDataset() { + return dataset; + } - public void setDataset(Dataset dataset) { - this.dataset = dataset; - } + public void setDataset(Dataset dataset) { + this.dataset = dataset; + } } \ No newline at end of file diff --git a/src/main/java/eml/studio/client/ui/panel/StdPanel.java b/src/main/java/eml/studio/client/ui/panel/StdPanel.java index 24fda17..a459e47 100644 --- a/src/main/java/eml/studio/client/ui/panel/StdPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/StdPanel.java @@ -19,44 +19,44 @@ */ public class StdPanel extends PopupPanel { - public StdPanel(String msg, String title) { - init(msg, title); - } - - protected void init(String msg, String title) { - this.setTitle("stdErr"); - this.setGlassEnabled(true); - - HTML closeButton = new HTML("X"); - closeButton.setSize("10px", "10px"); - closeButton.setStyleName("closebtn"); - closeButton.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - StdPanel.this.hide(); - } - }); - - ScrollPanel scvp = new ScrollPanel(); - VerticalPanel verticalPanel = new VerticalPanel(); - - verticalPanel.add(closeButton); - verticalPanel.setCellHeight(closeButton, "30px"); - verticalPanel.setStyleName("vpanel"); - HTML desc = new HTML(title); - desc.setStyleName("popupTitle"); - verticalPanel.add(desc); - verticalPanel.setCellHeight(desc, "30px"); - - TextArea label = new TextArea(); - label.setText(msg); - label.setReadOnly(true); - label.setSize("650px", "400px"); - verticalPanel.add(label); - scvp.add(verticalPanel); - this.add(scvp); - this.setStyleName("loading_container"); - this.center(); - this.show(); - } + public StdPanel(String msg, String title) { + init(msg, title); + } + + protected void init(String msg, String title) { + this.setTitle("stdErr"); + this.setGlassEnabled(true); + + HTML closeButton = new HTML("X"); + closeButton.setSize("10px", "10px"); + closeButton.setStyleName("closebtn"); + closeButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + StdPanel.this.hide(); + } + }); + + ScrollPanel scvp = new ScrollPanel(); + VerticalPanel verticalPanel = new VerticalPanel(); + + verticalPanel.add(closeButton); + verticalPanel.setCellHeight(closeButton, "30px"); + verticalPanel.setStyleName("vpanel"); + HTML desc = new HTML(title); + desc.setStyleName("popupTitle"); + verticalPanel.add(desc); + verticalPanel.setCellHeight(desc, "30px"); + + TextArea label = new TextArea(); + label.setText(msg); + label.setReadOnly(true); + label.setSize("650px", "400px"); + verticalPanel.add(label); + scvp.add(verticalPanel); + this.add(scvp); + this.setStyleName("loading_container"); + this.center(); + this.show(); + } } diff --git a/src/main/java/eml/studio/client/ui/panel/UpdateDatasetPanel.java b/src/main/java/eml/studio/client/ui/panel/UpdateDatasetPanel.java index 903a24c..c28e70f 100644 --- a/src/main/java/eml/studio/client/ui/panel/UpdateDatasetPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/UpdateDatasetPanel.java @@ -55,136 +55,136 @@ * Update Data set Panel */ public class UpdateDatasetPanel extends BasePanel{ - private static Logger logger = Logger.getLogger(UploadDatasetPanel.class.getName()); - private CategoryServiceAsync categorySrv = GWT.create(CategoryService.class); - private DBController dbController = new DBController(); - private DatasetTree tree; - private DatasetLeaf node; - protected UploadFileModule uploaderPanel; - private Dataset dataset = new Dataset(); - - public UpdateDatasetPanel(final DatasetTree tree,final DatasetLeaf node) { - super(); - labarr = new String[][]{ - {"Name","Category","DataType","Version","CreateDate","Owner","Description"}, - {Constants.studioUIMsg.dataName(), Constants.studioUIMsg.dataCategory(), - Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), - Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), Constants.studioUIMsg.dataDescription()}, - {"textbox","tree","listbox","textbox","textbox","textbox","textarea"}, - {"true","true","true","true","false","false","true"}, - {"", Constants.studioUIMsg.chooseCategory(),"General/CSV/TSV", "0.1", TimeUtils.timeNow(), AppController.email, ""}, - {"left","left","left","left","left","left","right"} - }; - this.tree = tree; - this.node = node; - } - - @Override - public void init() { - grid = new DescribeGrid(labarr, "data"); - verticalPanel.add(grid); - initFileUploader(); - grid.addStyleName("bda-descgrid-model"); - - } - - public void initFileUploader(){ - uploaderPanel = new UploadFileModule(); - uploaderPanel.setUpLoadDataset(dataset); - verticalPanel.add(uploaderPanel); - uploaderPanel.getUploader().setUploadCompleteHandler(new UploadCompleteHandler() { - @Override - public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) { - uploaderPanel.getCancelButtons().get(uploadCompleteEvent.getFile().getId()) - .removeFromParent(); - DatasetLeaf node = new DatasetLeaf(uploaderPanel.getUpLoadDataset()); - DatasetTreeLoader.addContextMenu(tree,node); - DatasetTreeLoader.addDatasetLeaf(tree, node,AppController.email); - Window.alert("update successedï¼"); - UpdateDatasetPanel.this.hide(); - UpdateDatasetPanel.this.clean(); - //Add code here so that the UploadModelPanel is hidden - uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); - return true; - } - }); - uploaderPanel.getStartbt().addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - JSONObject params = new JSONObject(); - if (!uploaderPanel.getIsFileQueued()) { - Window.alert("Please choose a file to upload, can not be empty"); - return; - } - if (uploaderPanel.getFileQueuedName().endsWith(".zip")) { - uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); - uploaderPanel.getProgressBars().clear(); - Window.alert("Data can not be zip-formatted files, please re-select the file"); - return; - } - uploaderPanel.setNewFileUUID(UUID.randomUUID()); - params.put("Datauuid", new JSONString(uploaderPanel.getNewFileUUID())); - uploaderPanel.getUploader().setOption("post_params", params).setPostParams(params); - try { - if (dbController.submitUpdateDataset2DB(uploaderPanel,tree,node,dataset,grid)) { - uploaderPanel.getUploader().startUpload(); - uploaderPanel.getStartbt().setEnabled(false); - } - } catch (CommandParseException e) { - Window.alert(e.getMessage()); - } - } - }); - } - - public UploadFileModule getUploaderPanel() { - return uploaderPanel; - } - - public void setUploaderPanel(UploadFileModule uploaderPanel) { - this.uploaderPanel = uploaderPanel; - } - - public void show(Dataset dataset){ - this.dataset = dataset; - final String values[] = DBController.getDatasetPanelValue(dataset,false); - final String category = dataset.getCategory(); - if("我的数æ®".equals(category) || "my data".equals(category.toLowerCase()) - || "共享数æ®".equals(category) || "shared data".equals(category.toLowerCase()) - || "系统数æ®".equals(category) || "system data".equals(category.toLowerCase()) ){ - values[1] = category; - UpdateDatasetPanel.this.setValues(values); - UpdateDatasetPanel.this.init(); - UpdateDatasetPanel.this.center(); - UpdateDatasetPanel.this.show(); - }else{ - categorySrv.getCategory(category, new AsyncCallback(){ - + private static Logger logger = Logger.getLogger(UploadDatasetPanel.class.getName()); + private CategoryServiceAsync categorySrv = GWT.create(CategoryService.class); + private DBController dbController = new DBController(); + private DatasetTree tree; + private DatasetLeaf node; + protected UploadFileModule uploaderPanel; + private Dataset dataset = new Dataset(); + + public UpdateDatasetPanel(final DatasetTree tree,final DatasetLeaf node) { + super(); + labarr = new String[][]{ + {"Name","Category","DataType","Version","CreateDate","Owner","Description"}, + {Constants.studioUIMsg.dataName(), Constants.studioUIMsg.dataCategory(), + Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), + Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), Constants.studioUIMsg.dataDescription()}, + {"textbox","tree","listbox","textbox","textbox","textbox","textarea"}, + {"true","true","true","true","false","false","true"}, + {"", Constants.studioUIMsg.chooseCategory(),"General/CSV/TSV", "0.1", TimeUtils.timeNow(), AppController.email, ""}, + {"left","left","left","left","left","left","right"} + }; + this.tree = tree; + this.node = node; + } + + @Override + public void init() { + grid = new DescribeGrid(labarr, "data"); + verticalPanel.add(grid); + initFileUploader(); + grid.addStyleName("bda-descgrid-model"); + + } + + public void initFileUploader(){ + uploaderPanel = new UploadFileModule(); + uploaderPanel.setUpLoadDataset(dataset); + verticalPanel.add(uploaderPanel); + uploaderPanel.getUploader().setUploadCompleteHandler(new UploadCompleteHandler() { @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - values[1] = category; - UpdateDatasetPanel.this.setValues(values); - UpdateDatasetPanel.this.init(); - UpdateDatasetPanel.this.center(); - UpdateDatasetPanel.this.show(); + public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) { + uploaderPanel.getCancelButtons().get(uploadCompleteEvent.getFile().getId()) + .removeFromParent(); + DatasetLeaf node = new DatasetLeaf(uploaderPanel.getUpLoadDataset()); + DatasetTreeLoader.addContextMenu(tree,node); + DatasetTreeLoader.addDatasetLeaf(tree, node,AppController.email); + Window.alert("update successedï¼"); + UpdateDatasetPanel.this.hide(); + UpdateDatasetPanel.this.clean(); + //Add code here so that the UploadModelPanel is hidden + uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); + return true; } - + }); + uploaderPanel.getStartbt().addClickHandler(new ClickHandler() { @Override - public void onSuccess(Category result) { - // TODO Auto-generated method stub - if("".equals(result.getPath())){ - values[1] = result.getName(); - }else - values[1] = result.getPath(); - - UpdateDatasetPanel.this.setValues( values ); - UpdateDatasetPanel.this.init(); - UpdateDatasetPanel.this.center(); - UpdateDatasetPanel.this.show(); + public void onClick(ClickEvent event) { + JSONObject params = new JSONObject(); + if (!uploaderPanel.getIsFileQueued()) { + Window.alert("Please choose a file to upload, can not be empty"); + return; + } + if (uploaderPanel.getFileQueuedName().endsWith(".zip")) { + uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); + uploaderPanel.getProgressBars().clear(); + Window.alert("Data can not be zip-formatted files, please re-select the file"); + return; + } + uploaderPanel.setNewFileUUID(UUID.randomUUID()); + params.put("Datauuid", new JSONString(uploaderPanel.getNewFileUUID())); + uploaderPanel.getUploader().setOption("post_params", params).setPostParams(params); + try { + if (dbController.submitUpdateDataset2DB(uploaderPanel,tree,node,dataset,grid)) { + uploaderPanel.getUploader().startUpload(); + uploaderPanel.getStartbt().setEnabled(false); + } + } catch (CommandParseException e) { + Window.alert(e.getMessage()); + } } - - }); + }); + } + + public UploadFileModule getUploaderPanel() { + return uploaderPanel; + } + + public void setUploaderPanel(UploadFileModule uploaderPanel) { + this.uploaderPanel = uploaderPanel; + } + + public void show(Dataset dataset){ + this.dataset = dataset; + final String values[] = DBController.getDatasetPanelValue(dataset,false); + final String category = dataset.getCategory(); + if("我的数æ®".equals(category) || "my data".equals(category.toLowerCase()) + || "共享数æ®".equals(category) || "shared data".equals(category.toLowerCase()) + || "系统数æ®".equals(category) || "system data".equals(category.toLowerCase()) ){ + values[1] = category; + UpdateDatasetPanel.this.setValues(values); + UpdateDatasetPanel.this.init(); + UpdateDatasetPanel.this.center(); + UpdateDatasetPanel.this.show(); + }else{ + categorySrv.getCategory(category, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + values[1] = category; + UpdateDatasetPanel.this.setValues(values); + UpdateDatasetPanel.this.init(); + UpdateDatasetPanel.this.center(); + UpdateDatasetPanel.this.show(); + } + + @Override + public void onSuccess(Category result) { + // TODO Auto-generated method stub + if("".equals(result.getPath())){ + values[1] = result.getName(); + }else + values[1] = result.getPath(); + + UpdateDatasetPanel.this.setValues( values ); + UpdateDatasetPanel.this.init(); + UpdateDatasetPanel.this.center(); + UpdateDatasetPanel.this.show(); + } + + }); + } } - } } diff --git a/src/main/java/eml/studio/client/ui/panel/UpdateProgramPanel.java b/src/main/java/eml/studio/client/ui/panel/UpdateProgramPanel.java index 67df22c..98d7177 100644 --- a/src/main/java/eml/studio/client/ui/panel/UpdateProgramPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/UpdateProgramPanel.java @@ -32,147 +32,145 @@ import org.moxieapps.gwt.uploader.client.events.UploadCompleteEvent; import org.moxieapps.gwt.uploader.client.events.UploadCompleteHandler; - - /** * Update Program Panel */ public class UpdateProgramPanel extends BasePanel { - private DBController dbController = new DBController(); - private CategoryServiceAsync categorySrv = GWT.create(CategoryService.class); - private ProgramTree tree; - private ProgramLeaf node; - protected UploadFileModule uploaderPanel = null; - private Program program = new Program(); - public UpdateProgramPanel(final ProgramTree tree,final ProgramLeaf node) { - super(); - labarr = new String[][]{ - {"Name","Category","Type","Programable","Isdeterministic","Version","CreateDate", - "Owner","Description","CommandLine"}, - {Constants.studioUIMsg.moduleName(), Constants.studioUIMsg.moduleCategory() - , Constants.studioUIMsg.moduleType(), Constants.studioUIMsg.programable(), - Constants.studioUIMsg.moduleDeterminacy(),Constants.studioUIMsg.moduleVersion(), - Constants.studioUIMsg.moduleCreateTime(), Constants.studioUIMsg.moduleOwner(), - Constants.studioUIMsg.dataDescription(),Constants.studioUIMsg.moduleCMDFormat()},//显示的标签 - {"textbox","tree","listbox","listbox","listbox","textbox","textbox", - "textbox","textarea","textarea"}, - {"true","true","true","true","true","true","false","false","true","true"}, - {"", Constants.studioUIMsg.chooseCategory(), - Constants.studioUIMsg.standalone() + "/" + Constants.studioUIMsg.distributed()+"/ETL",// "å•æœº/分布å¼", - Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), - Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), - "0.1", TimeUtils.timeNow(), AppController.email, "", ""}, - {"left","left","left","left","left","left","left","left","left","right"} - }; - this.tree = tree; - this.node = node; - } - - @Override -public void init() { - grid = new DescribeGrid(labarr, "prog"); - verticalPanel.add(grid); - initFileUploader(); - grid.addStyleName("bda-descgrid-model"); - } - - public void initFileUploader(){ - uploaderPanel = new UploadFileModule(); - uploaderPanel.setUpLoadProgram(program); - verticalPanel.add(uploaderPanel); - uploaderPanel.getUploader().setUploadCompleteHandler(new UploadCompleteHandler() { - @Override - public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) { - uploaderPanel.getCancelButtons().get(uploadCompleteEvent.getFile().getId()).removeFromParent(); - uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); - ProgramLeaf node = new ProgramLeaf(uploaderPanel.getUpLoadProgram()); - ProgramTreeLoader.addContextMenu(tree, node); - ProgramTreeLoader.addProgramLeaf(tree, node,AppController.email); - Window.alert("Uploaded Successï¼"); - UpdateProgramPanel.this.hide(); - UpdateProgramPanel.this.clean(); - return true; - } - }); - uploaderPanel.getStartbt().addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - JSONObject params = new JSONObject(); - if (!uploaderPanel.getIsFileQueued()) { - Window.alert("Please choose a file to upload, can not be empty"); - return; - } - if (!uploaderPanel.getFileQueuedName().endsWith(".zip")) { - uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); - uploaderPanel.getProgressBars().clear(); - Window.alert("The file must be in the standard zip format, please re-select the file"); - return; - } - uploaderPanel.setNewFileUUID(UUID.randomUUID()); - params.put("Fileuuid", new JSONString(uploaderPanel.getNewFileUUID())); - uploaderPanel.getUploader().setOption("post_params", params).setPostParams(params); - try { - if (dbController.submitUpdateProgram2DB(uploaderPanel,tree,node,program,grid)) { - uploaderPanel.getUploader().startUpload(); - uploaderPanel.getStartbt().setEnabled(false); - } - } catch (CommandParseException e) { - Window.alert(e.getMessage()); - } - } - }); - } - - - public UploadFileModule getUploaderPanel() { - return uploaderPanel; - } + private DBController dbController = new DBController(); + private CategoryServiceAsync categorySrv = GWT.create(CategoryService.class); + private ProgramTree tree; + private ProgramLeaf node; + protected UploadFileModule uploaderPanel = null; + private Program program = new Program(); + public UpdateProgramPanel(final ProgramTree tree,final ProgramLeaf node) { + super(); + labarr = new String[][]{ + {"Name","Category","Type","Programable","Isdeterministic","Version","CreateDate", + "Owner","Description","CommandLine"}, + {Constants.studioUIMsg.moduleName(), Constants.studioUIMsg.moduleCategory() + , Constants.studioUIMsg.moduleType(), Constants.studioUIMsg.programable(), + Constants.studioUIMsg.moduleDeterminacy(),Constants.studioUIMsg.moduleVersion(), + Constants.studioUIMsg.moduleCreateTime(), Constants.studioUIMsg.moduleOwner(), + Constants.studioUIMsg.dataDescription(),Constants.studioUIMsg.moduleCMDFormat()},//显示的标签 + {"textbox","tree","listbox","listbox","listbox","textbox","textbox", + "textbox","textarea","textarea"}, + {"true","true","true","true","true","true","false","false","true","true"}, + {"", Constants.studioUIMsg.chooseCategory(), + Constants.studioUIMsg.standalone() + "/" + Constants.studioUIMsg.distributed()+"/ETL",// "å•æœº/分布å¼", + Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), + Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), + "0.1", TimeUtils.timeNow(), AppController.email, "", ""}, + {"left","left","left","left","left","left","left","left","left","right"} + }; + this.tree = tree; + this.node = node; + } - public void setUploaderPanel(UploadFileModule uploaderPanel) { - this.uploaderPanel = uploaderPanel; - } + @Override + public void init() { + grid = new DescribeGrid(labarr, "prog"); + verticalPanel.add(grid); + initFileUploader(); + grid.addStyleName("bda-descgrid-model"); + } - public void show(Program program){ - this.program = program; - final String values[] = DBController.getProgramPanelValue(program,false); - final String category = program.getCategory(); - if("我的程åº".equals(category) || "my program".equals(category.toLowerCase()) - || "共享程åº".equals(category) || "shared program".equals(category.toLowerCase()) - || "系统程åº".equals(category) || "system program".equals(category.toLowerCase()) ){ - values[1] = category; - UpdateProgramPanel.this.setValues(values); - UpdateProgramPanel.this.init(); - UpdateProgramPanel.this.center(); - UpdateProgramPanel.this.show(); - }else{ - categorySrv.getCategory(category, new AsyncCallback(){ - + public void initFileUploader(){ + uploaderPanel = new UploadFileModule(); + uploaderPanel.setUpLoadProgram(program); + verticalPanel.add(uploaderPanel); + uploaderPanel.getUploader().setUploadCompleteHandler(new UploadCompleteHandler() { @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - values[1] = category; - UpdateProgramPanel.this.setValues(values); - UpdateProgramPanel.this.init(); - UpdateProgramPanel.this.center(); - UpdateProgramPanel.this.show(); + public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) { + uploaderPanel.getCancelButtons().get(uploadCompleteEvent.getFile().getId()).removeFromParent(); + uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); + ProgramLeaf node = new ProgramLeaf(uploaderPanel.getUpLoadProgram()); + ProgramTreeLoader.addContextMenu(tree, node); + ProgramTreeLoader.addProgramLeaf(tree, node,AppController.email); + Window.alert("Uploaded Successï¼"); + UpdateProgramPanel.this.hide(); + UpdateProgramPanel.this.clean(); + return true; } - + }); + uploaderPanel.getStartbt().addClickHandler(new ClickHandler() { @Override - public void onSuccess(Category result) { - // TODO Auto-generated method stub - if("".equals(result.getPath())){ - values[1] = result.getName(); - }else - values[1] = result.getPath(); - - UpdateProgramPanel.this.setValues( values ); - UpdateProgramPanel.this.init(); - UpdateProgramPanel.this.center(); - UpdateProgramPanel.this.show(); + public void onClick(ClickEvent event) { + JSONObject params = new JSONObject(); + if (!uploaderPanel.getIsFileQueued()) { + Window.alert("Please choose a file to upload, can not be empty"); + return; + } + if (!uploaderPanel.getFileQueuedName().endsWith(".zip")) { + uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); + uploaderPanel.getProgressBars().clear(); + Window.alert("The file must be in the standard zip format, please re-select the file"); + return; + } + uploaderPanel.setNewFileUUID(UUID.randomUUID()); + params.put("Fileuuid", new JSONString(uploaderPanel.getNewFileUUID())); + uploaderPanel.getUploader().setOption("post_params", params).setPostParams(params); + try { + if (dbController.submitUpdateProgram2DB(uploaderPanel,tree,node,program,grid)) { + uploaderPanel.getUploader().startUpload(); + uploaderPanel.getStartbt().setEnabled(false); + } + } catch (CommandParseException e) { + Window.alert(e.getMessage()); + } } - - }); + }); + } + + + public UploadFileModule getUploaderPanel() { + return uploaderPanel; + } + + public void setUploaderPanel(UploadFileModule uploaderPanel) { + this.uploaderPanel = uploaderPanel; + } + + public void show(Program program){ + this.program = program; + final String values[] = DBController.getProgramPanelValue(program,false); + final String category = program.getCategory(); + if("我的程åº".equals(category) || "my program".equals(category.toLowerCase()) + || "共享程åº".equals(category) || "shared program".equals(category.toLowerCase()) + || "系统程åº".equals(category) || "system program".equals(category.toLowerCase()) ){ + values[1] = category; + UpdateProgramPanel.this.setValues(values); + UpdateProgramPanel.this.init(); + UpdateProgramPanel.this.center(); + UpdateProgramPanel.this.show(); + }else{ + categorySrv.getCategory(category, new AsyncCallback(){ + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + values[1] = category; + UpdateProgramPanel.this.setValues(values); + UpdateProgramPanel.this.init(); + UpdateProgramPanel.this.center(); + UpdateProgramPanel.this.show(); + } + + @Override + public void onSuccess(Category result) { + // TODO Auto-generated method stub + if("".equals(result.getPath())){ + values[1] = result.getName(); + }else + values[1] = result.getPath(); + + UpdateProgramPanel.this.setValues( values ); + UpdateProgramPanel.this.init(); + UpdateProgramPanel.this.center(); + UpdateProgramPanel.this.show(); + } + + }); + } } - } } diff --git a/src/main/java/eml/studio/client/ui/panel/UploadDatasetPanel.java b/src/main/java/eml/studio/client/ui/panel/UploadDatasetPanel.java index 9c500d6..ce74824 100644 --- a/src/main/java/eml/studio/client/ui/panel/UploadDatasetPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/UploadDatasetPanel.java @@ -5,12 +5,9 @@ */ package eml.studio.client.ui.panel; - import java.util.logging.Logger; - import org.moxieapps.gwt.uploader.client.events.UploadCompleteEvent; import org.moxieapps.gwt.uploader.client.events.UploadCompleteHandler; - import eml.studio.client.controller.DBController; import eml.studio.client.mvp.AppController; import eml.studio.client.mvp.presenter.MonitorPresenter; @@ -34,10 +31,10 @@ * Upload Data Set Panel */ public class UploadDatasetPanel extends BasePanel{ - private static Logger logger = Logger.getLogger(UploadDatasetPanel.class.getName()); + private static Logger logger = Logger.getLogger(UploadDatasetPanel.class.getName()); private DBController dbController = new DBController(); private final MonitorPresenter presenter; - protected UploadFileModule uploaderPanel; + protected UploadFileModule uploaderPanel; private Dataset dataset = new Dataset(); public UploadDatasetPanel(String emailAccount,MonitorPresenter presenter) { @@ -46,14 +43,14 @@ public UploadDatasetPanel(String emailAccount,MonitorPresenter presenter) { labarr = new String[][]{ {"Name","Category","DataType","Version","CreateDate","Owner","Description"}, {Constants.studioUIMsg.dataName(), Constants.studioUIMsg.dataCategory(), - Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), - Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), - Constants.studioUIMsg.dataDescription()}, - {"textbox","tree","listbox","textbox","textbox","textbox","textarea"}, - {"true","true","true","true","false","false","true"}, - {"", Constants.studioUIMsg.chooseCategory(), "General/CSV/TSV", "0.1", - TimeUtils.timeNow(), AppController.email, ""}, - {"left","left","left","left","left","left","right"} + Constants.studioUIMsg.dataType(), Constants.studioUIMsg.dataVersion(), + Constants.studioUIMsg.dataCreateTime(), Constants.studioUIMsg.dataOwner(), + Constants.studioUIMsg.dataDescription()}, + {"textbox","tree","listbox","textbox","textbox","textbox","textarea"}, + {"true","true","true","true","false","false","true"}, + {"", Constants.studioUIMsg.chooseCategory(), "General/CSV/TSV", "0.1", + TimeUtils.timeNow(), AppController.email, ""}, + {"left","left","left","left","left","left","right"} }; owner = emailAccount; init(); @@ -76,15 +73,15 @@ public void initFileUploader(){ @Override public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) { uploaderPanel.getCancelButtons().get(uploadCompleteEvent.getFile().getId()) - .removeFromParent(); + .removeFromParent(); + + DatasetLeaf node = new DatasetLeaf(uploaderPanel.getUpLoadDataset()); + DatasetTreeLoader.addContextMenu( presenter.getView().getDatasetTree() + ,node); + DatasetTreeLoader.addDatasetLeaf( presenter.getView().getDatasetTree(), + node,AppController.email); - DatasetLeaf node = new DatasetLeaf(uploaderPanel.getUpLoadDataset()); - DatasetTreeLoader.addContextMenu( presenter.getView().getDatasetTree() - ,node); - DatasetTreeLoader.addDatasetLeaf( presenter.getView().getDatasetTree(), - node,AppController.email); - Window.alert("Uploaded successfullyï¼"); UploadDatasetPanel.this.hide(); UploadDatasetPanel.this.clean(); @@ -122,13 +119,13 @@ public void onClick(ClickEvent event) { }); } - public UploadFileModule getUploaderPanel() { - return uploaderPanel; - } + public UploadFileModule getUploaderPanel() { + return uploaderPanel; + } - public void setUploaderPanel(UploadFileModule uploaderPanel) { - this.uploaderPanel = uploaderPanel; - } + public void setUploaderPanel(UploadFileModule uploaderPanel) { + this.uploaderPanel = uploaderPanel; + } public void setDataset(Dataset dataset){ this.dataset = dataset; diff --git a/src/main/java/eml/studio/client/ui/panel/UploadProgramPanel.java b/src/main/java/eml/studio/client/ui/panel/UploadProgramPanel.java index 3443e2f..7c9e007 100644 --- a/src/main/java/eml/studio/client/ui/panel/UploadProgramPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/UploadProgramPanel.java @@ -31,107 +31,107 @@ * Upload Program Panel */ public class UploadProgramPanel extends BasePanel { - private static Logger logger = Logger.getLogger( UploadProgramPanel.class.getName() ); - private DBController dbController = new DBController(); - private final MonitorPresenter presenter; - protected UploadFileModule uploaderPanel = null; - private Program program = new Program(); - public UploadProgramPanel(String emailAccount,MonitorPresenter presenter) { - this.presenter = presenter; - labarr = new String[][]{ - {"Name","Category","Type","Programable","Isdeterministic","Version","CreateDate", - "Owner","Description","CommandLine"}, - {Constants.studioUIMsg.moduleName(), Constants.studioUIMsg.moduleCategory() - , Constants.studioUIMsg.moduleType(), Constants.studioUIMsg.programable(), - Constants.studioUIMsg.moduleDeterminacy(),Constants.studioUIMsg.moduleVersion(), - Constants.studioUIMsg.moduleCreateTime(), Constants.studioUIMsg.moduleOwner(), - Constants.studioUIMsg.dataDescription(),Constants.studioUIMsg.moduleCMDFormat()}, - {"textbox","tree","listbox","listbox","listbox","textbox","textbox", - "textbox","textarea","textarea"}, - {"true","true","true","true","true","true","false","false","true","true"}, - {"", Constants.studioUIMsg.chooseCategory(), - Constants.studioUIMsg.standalone() + "/" + Constants.studioUIMsg.distributed()+"/ETL", - Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), - Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), - "0.1", TimeUtils.timeNow(), AppController.email, "", ""}, - {"left","left","left","left","left","left","left","left","left","right"} - }; - owner = emailAccount; - init(); - } + private static Logger logger = Logger.getLogger( UploadProgramPanel.class.getName() ); + private DBController dbController = new DBController(); + private final MonitorPresenter presenter; + protected UploadFileModule uploaderPanel = null; + private Program program = new Program(); + public UploadProgramPanel(String emailAccount,MonitorPresenter presenter) { + this.presenter = presenter; + labarr = new String[][]{ + {"Name","Category","Type","Programable","Isdeterministic","Version","CreateDate", + "Owner","Description","CommandLine"}, + {Constants.studioUIMsg.moduleName(), Constants.studioUIMsg.moduleCategory() + , Constants.studioUIMsg.moduleType(), Constants.studioUIMsg.programable(), + Constants.studioUIMsg.moduleDeterminacy(),Constants.studioUIMsg.moduleVersion(), + Constants.studioUIMsg.moduleCreateTime(), Constants.studioUIMsg.moduleOwner(), + Constants.studioUIMsg.dataDescription(),Constants.studioUIMsg.moduleCMDFormat()}, + {"textbox","tree","listbox","listbox","listbox","textbox","textbox", + "textbox","textarea","textarea"}, + {"true","true","true","true","true","true","false","false","true","true"}, + {"", Constants.studioUIMsg.chooseCategory(), + Constants.studioUIMsg.standalone() + "/" + Constants.studioUIMsg.distributed()+"/ETL", + Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), + Constants.studioUIMsg.no()+"/" + Constants.studioUIMsg.yes(), + "0.1", TimeUtils.timeNow(), AppController.email, "", ""}, + {"left","left","left","left","left","left","left","left","left","right"} + }; + owner = emailAccount; + init(); + } - @Override -public void init() { - grid = new DescribeGrid(labarr, "prog"); - verticalPanel.add(grid); - initFileUploader(); - grid.addStyleName("bda-descgrid-model"); - } + @Override + public void init() { + grid = new DescribeGrid(labarr, "prog"); + verticalPanel.add(grid); + initFileUploader(); + grid.addStyleName("bda-descgrid-model"); + } - public void initFileUploader(){ - uploaderPanel = new UploadFileModule(); - uploaderPanel.setUpLoadProgram(program); - verticalPanel.add(uploaderPanel); - uploaderPanel.getUploader().setUploadCompleteHandler(new UploadCompleteHandler() { - @Override - public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) { - uploaderPanel.getCancelButtons().get(uploadCompleteEvent.getFile().getId()) - .removeFromParent(); - uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); + public void initFileUploader(){ + uploaderPanel = new UploadFileModule(); + uploaderPanel.setUpLoadProgram(program); + verticalPanel.add(uploaderPanel); + uploaderPanel.getUploader().setUploadCompleteHandler(new UploadCompleteHandler() { + @Override + public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) { + uploaderPanel.getCancelButtons().get(uploadCompleteEvent.getFile().getId()) + .removeFromParent(); + uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); - ProgramLeaf node = new ProgramLeaf(uploaderPanel.getUpLoadProgram()); - ProgramTreeLoader.addContextMenu( presenter.getView().getProgramTree(), - node); - ProgramTreeLoader.addProgramLeaf( presenter.getView().getProgramTree(), - node,AppController.email); - - Window.alert("Uploaded successfullyï¼"); - UploadProgramPanel.this.hide(); - UploadProgramPanel.this.clean(); - return true; - } - }); - uploaderPanel.getStartbt().addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - JSONObject params = new JSONObject(); - if (!uploaderPanel.getIsFileQueued()) { - Window.alert("Please choose a file to upload, can not be empty"); - return; - } - if (!uploaderPanel.getFileQueuedName().endsWith(".zip")) { - uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); - uploaderPanel.getProgressBars().clear(); - Window.alert("The file must be in the standard zip format, please re-select the file"); - return; - } - uploaderPanel.setNewFileUUID(UUID.randomUUID()); - params.put("Fileuuid", new JSONString(uploaderPanel.getNewFileUUID())); - uploaderPanel.getUploader().setOption("post_params", params).setPostParams(params); - try { - if (dbController.submitUploadProgram2DB(presenter,uploaderPanel,program,grid)) { - uploaderPanel.getUploader().startUpload(); - uploaderPanel.getStartbt().setEnabled(false); - } - } catch (CommandParseException e) { - logger.info(e.getMessage()); - Window.alert(e.getMessage()); - } - } - }); - } + ProgramLeaf node = new ProgramLeaf(uploaderPanel.getUpLoadProgram()); + ProgramTreeLoader.addContextMenu( presenter.getView().getProgramTree(), + node); + ProgramTreeLoader.addProgramLeaf( presenter.getView().getProgramTree(), + node,AppController.email); + Window.alert("Uploaded successfullyï¼"); + UploadProgramPanel.this.hide(); + UploadProgramPanel.this.clean(); + return true; + } + }); + uploaderPanel.getStartbt().addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + JSONObject params = new JSONObject(); + if (!uploaderPanel.getIsFileQueued()) { + Window.alert("Please choose a file to upload, can not be empty"); + return; + } + if (!uploaderPanel.getFileQueuedName().endsWith(".zip")) { + uploaderPanel.getUploader().cancelUpload(uploaderPanel.getFileQueuedId(), false); + uploaderPanel.getProgressBars().clear(); + Window.alert("The file must be in the standard zip format, please re-select the file"); + return; + } + uploaderPanel.setNewFileUUID(UUID.randomUUID()); + params.put("Fileuuid", new JSONString(uploaderPanel.getNewFileUUID())); + uploaderPanel.getUploader().setOption("post_params", params).setPostParams(params); + try { + if (dbController.submitUploadProgram2DB(presenter,uploaderPanel,program,grid)) { + uploaderPanel.getUploader().startUpload(); + uploaderPanel.getStartbt().setEnabled(false); + } + } catch (CommandParseException e) { + logger.info(e.getMessage()); + Window.alert(e.getMessage()); + } + } + }); + } - public UploadFileModule getUploaderPanel() { - return uploaderPanel; - } - public void setUploaderPanel(UploadFileModule uploaderPanel) { - this.uploaderPanel = uploaderPanel; - } + public UploadFileModule getUploaderPanel() { + return uploaderPanel; + } - public void setProgram(Program program){ - this.program = program; - this.setValues(DBController.getProgramPanelValue(program,true)); - } + public void setUploaderPanel(UploadFileModule uploaderPanel) { + this.uploaderPanel = uploaderPanel; + } + + public void setProgram(Program program){ + this.program = program; + this.setValues(DBController.getProgramPanelValue(program,true)); + } } diff --git a/src/main/java/eml/studio/client/ui/panel/Uploader/FileUploader.java b/src/main/java/eml/studio/client/ui/panel/Uploader/FileUploader.java index 3b85c3b..6d8dc22 100644 --- a/src/main/java/eml/studio/client/ui/panel/Uploader/FileUploader.java +++ b/src/main/java/eml/studio/client/ui/panel/Uploader/FileUploader.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.ui.panel.Uploader; import java.util.LinkedHashMap; @@ -36,13 +41,15 @@ import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.widgetideas.client.ProgressBar; +/** + * File uploader for dataset or program + */ public class FileUploader extends VerticalPanel { - // private static Logger logger = - // Logger.getLogger(FileUploader.class.getName()); + final Map progressBars = new LinkedHashMap(); final Map cancelButtons = new LinkedHashMap(); - protected final Button cancelButton = new Button("å–消"); + protected final Button cancelButton = new Button("Cancel"); protected HorizontalPanel progressBarAndButtonPanel = new HorizontalPanel(); protected HorizontalPanel horizontalPanel = new HorizontalPanel(); protected final VerticalPanel progressBarPanel = new VerticalPanel(); @@ -53,7 +60,6 @@ public class FileUploader extends VerticalPanel { protected String fileQueuedId = null; protected Boolean isFileQueued = false; protected String newFileUUID = null; - //protected DescribeGrid grid = null; public FileUploader() { init(); @@ -61,23 +67,18 @@ public FileUploader() { public void init() { - // .setButtonWindowMode(Uploader.WindowMode.TRANSPARENT) uploader.setButtonImageURL("img/uploadimg.png").setButtonWidth(32) - .setButtonHeight(32) - .setButtonCursor(Uploader.Cursor.HAND); - + .setButtonHeight(32) + .setButtonCursor(Uploader.Cursor.HAND); horizontalPanel.setStyleName("bda-fileupload-bottom-hpanel"); horizontalPanel.setSpacing(10); horizontalPanel.add(uploader); if (Uploader.isAjaxUploadWithProgressEventsSupported()) { - // final Label dropFilesLabel = new Label("拖动到此区域"); dropFilesLabel.getElement().getStyle().setCursor(Cursor.POINTER); dropFilesLabel.setSize("32px", "32px"); - dropFilesLabel.setTitle("å¯æ‹–动文件上传区域"); - // dropFilesLabel.setVisible(null, true); - + dropFilesLabel.setTitle("File dragable upload area"); } horizontalPanel.add(dropFilesLabel); horizontalPanel.add(progressBarPanel); @@ -89,118 +90,117 @@ public void init() { private void initFacet(){ this.getUploader() - .setUploadURL(GWT.getModuleBaseURL() + "fileupload") - .setFileSizeLimit("20 GB") - .setButtonAction(Uploader.ButtonAction.SELECT_FILES) - .setFileQueueLimit(2) - .setFileQueuedHandler(new FileQueuedHandler() { - - @Override - public boolean onFileQueued(final FileQueuedEvent fileQueuedEvent) { - // Create a Progress Bar for this file - if (FileUploader.this.getFileQueuedId() != null) - FileUploader.this.getUploader().cancelUpload(FileUploader.this.getFileQueuedId(), false);// delete the last - FileUploader.this.getProgressBarPanel().clear(); - FileUploader.this.getProgressBarAndButtonPanel().clear(); - // choose file - FileUploader.this.setIsFileQueued(true); - final ProgressBar progressBar = new ProgressBar(0.0, 1.0, 0.0, - FileUploader.this.getCancelProgressBarTextFormatter()); - progressBar.setTitle(fileQueuedEvent.getFile().getName()); - FileUploader.this.setFileQueuedName(fileQueuedEvent.getFile().getName()); - FileUploader.this.setFileQueuedId(fileQueuedEvent.getFile().getId()); - progressBar.addStyleName("bda-fileupload-progressbar"); - progressBar.setTextVisible(true); - FileUploader.this.getProgressBars().put(fileQueuedEvent.getFile().getId(), progressBar); - // - // Add Cancel Button Image - FileUploader.this.getCancelButton().setStyleName("cancelButton"); - // - FileUploader.this.getCancelButton().addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - FileUploader.this.getUploader().cancelUpload(fileQueuedEvent.getFile().getId(), false); - FileUploader.this.getProgressBars().get(fileQueuedEvent.getFile().getId()) - .setProgress(-1.0d); - FileUploader.this.getCancelButton().removeFromParent(); - FileUploader.this.setIsFileQueued(false); - } - }); - FileUploader.this.getCancelButtons().put(fileQueuedEvent.getFile().getId(), FileUploader.this.getCancelButton()); - // Add the Bar and Button to the interface - progressBarAndButtonPanel.setSpacing(5); - Label tit = new Label(fileQueuedEvent.getFile().getName()); - // tit.setWidth("100px"); - progressBarAndButtonPanel.add(tit); - progressBarAndButtonPanel.setCellVerticalAlignment(tit, - HasVerticalAlignment.ALIGN_MIDDLE); - progressBarAndButtonPanel.add(progressBar); - progressBarAndButtonPanel.setCellVerticalAlignment(progressBar, - HasVerticalAlignment.ALIGN_MIDDLE); - progressBarAndButtonPanel.add(FileUploader.this.getCancelButton()); - progressBarAndButtonPanel.setCellVerticalAlignment(FileUploader.this.getCancelButton(), - HasVerticalAlignment.ALIGN_MIDDLE); - progressBarPanel.add(FileUploader.this.getProgressBarAndButtonPanel()); - progressBarPanel.setCellVerticalAlignment( - progressBarAndButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE); - return true; - } - }).setUploadProgressHandler(new UploadProgressHandler() { - @Override - public boolean onUploadProgress( - UploadProgressEvent uploadProgressEvent) { - ProgressBar progressBar = FileUploader.this.getProgressBars().get(uploadProgressEvent - .getFile().getId()); - progressBar.setProgress((double) uploadProgressEvent - .getBytesComplete() / uploadProgressEvent.getBytesTotal()); - - return true; - } - }).setFileDialogStartHandler(new FileDialogStartHandler() { - @Override - public boolean onFileDialogStartEvent( - FileDialogStartEvent fileDialogStartEvent) { - if (FileUploader.this.getUploader().getStats().getUploadsInProgress() <= 0) { - // Clear the uploads that have completed, if none are in process - FileUploader.this.getProgressBarPanel().clear(); - FileUploader.this.getProgressBars().clear(); - FileUploader.this.getCancelButtons().clear(); - } - return true; - } - }).setFileDialogCompleteHandler(new FileDialogCompleteHandler() { - @Override - public boolean onFileDialogComplete( - FileDialogCompleteEvent fileDialogCompleteEvent) { - if (fileDialogCompleteEvent.getTotalFilesInQueue() > 0) { - if (FileUploader.this.getUploader().getStats().getUploadsInProgress() <= 0) { - // uploader.startUpload(); - } - } - return true; - } - }).setFileQueueErrorHandler(new FileQueueErrorHandler() { - @Override - public boolean onFileQueueError( - FileQueueErrorEvent fileQueueErrorEvent) { - Window.alert("Upload of file " - + fileQueueErrorEvent.getFile().getName() + " failed due to [" - + fileQueueErrorEvent.getErrorCode().toString() + "]: " - + fileQueueErrorEvent.getMessage()); - return true; - } - }).setUploadErrorHandler(new UploadErrorHandler() { - @Override - public boolean onUploadError(UploadErrorEvent uploadErrorEvent) { - FileUploader.this.getCancelButtons().get(uploadErrorEvent.getFile().getId()) - .removeFromParent(); - Window.alert("Upload of file " - + uploadErrorEvent.getFile().getName() + " failed due to [" - + uploadErrorEvent.getErrorCode().toString() + "]: " - + uploadErrorEvent.getMessage()); - return true; - } - }); + .setUploadURL(GWT.getModuleBaseURL() + "fileupload") + .setFileSizeLimit("20 GB") + .setButtonAction(Uploader.ButtonAction.SELECT_FILES) + .setFileQueueLimit(2) + .setFileQueuedHandler(new FileQueuedHandler() { + + @Override + public boolean onFileQueued(final FileQueuedEvent fileQueuedEvent) { + // Create a Progress Bar for this file + if (FileUploader.this.getFileQueuedId() != null) + FileUploader.this.getUploader().cancelUpload(FileUploader.this.getFileQueuedId(), false);// delete the last + FileUploader.this.getProgressBarPanel().clear(); + FileUploader.this.getProgressBarAndButtonPanel().clear(); + // choose file + FileUploader.this.setIsFileQueued(true); + final ProgressBar progressBar = new ProgressBar(0.0, 1.0, 0.0, + FileUploader.this.getCancelProgressBarTextFormatter()); + progressBar.setTitle(fileQueuedEvent.getFile().getName()); + FileUploader.this.setFileQueuedName(fileQueuedEvent.getFile().getName()); + FileUploader.this.setFileQueuedId(fileQueuedEvent.getFile().getId()); + progressBar.addStyleName("bda-fileupload-progressbar"); + progressBar.setTextVisible(true); + FileUploader.this.getProgressBars().put(fileQueuedEvent.getFile().getId(), progressBar); + + // Add Cancel Button Image + FileUploader.this.getCancelButton().setStyleName("cancelButton"); + FileUploader.this.getCancelButton().addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + FileUploader.this.getUploader().cancelUpload(fileQueuedEvent.getFile().getId(), false); + FileUploader.this.getProgressBars().get(fileQueuedEvent.getFile().getId()) + .setProgress(-1.0d); + FileUploader.this.getCancelButton().removeFromParent(); + FileUploader.this.setIsFileQueued(false); + } + }); + FileUploader.this.getCancelButtons().put(fileQueuedEvent.getFile().getId(), FileUploader.this.getCancelButton()); + // Add the Bar and Button to the interface + progressBarAndButtonPanel.setSpacing(5); + Label tit = new Label(fileQueuedEvent.getFile().getName()); + // tit.setWidth("100px"); + progressBarAndButtonPanel.add(tit); + progressBarAndButtonPanel.setCellVerticalAlignment(tit, + HasVerticalAlignment.ALIGN_MIDDLE); + progressBarAndButtonPanel.add(progressBar); + progressBarAndButtonPanel.setCellVerticalAlignment(progressBar, + HasVerticalAlignment.ALIGN_MIDDLE); + progressBarAndButtonPanel.add(FileUploader.this.getCancelButton()); + progressBarAndButtonPanel.setCellVerticalAlignment(FileUploader.this.getCancelButton(), + HasVerticalAlignment.ALIGN_MIDDLE); + progressBarPanel.add(FileUploader.this.getProgressBarAndButtonPanel()); + progressBarPanel.setCellVerticalAlignment( + progressBarAndButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE); + return true; + } + }).setUploadProgressHandler(new UploadProgressHandler() { + @Override + public boolean onUploadProgress( + UploadProgressEvent uploadProgressEvent) { + ProgressBar progressBar = FileUploader.this.getProgressBars().get(uploadProgressEvent + .getFile().getId()); + progressBar.setProgress((double) uploadProgressEvent + .getBytesComplete() / uploadProgressEvent.getBytesTotal()); + + return true; + } + }).setFileDialogStartHandler(new FileDialogStartHandler() { + @Override + public boolean onFileDialogStartEvent( + FileDialogStartEvent fileDialogStartEvent) { + if (FileUploader.this.getUploader().getStats().getUploadsInProgress() <= 0) { + // Clear the uploads that have completed, if none are in process + FileUploader.this.getProgressBarPanel().clear(); + FileUploader.this.getProgressBars().clear(); + FileUploader.this.getCancelButtons().clear(); + } + return true; + } + }).setFileDialogCompleteHandler(new FileDialogCompleteHandler() { + @Override + public boolean onFileDialogComplete( + FileDialogCompleteEvent fileDialogCompleteEvent) { + if (fileDialogCompleteEvent.getTotalFilesInQueue() > 0) { + if (FileUploader.this.getUploader().getStats().getUploadsInProgress() <= 0) { + // uploader.startUpload(); + } + } + return true; + } + }).setFileQueueErrorHandler(new FileQueueErrorHandler() { + @Override + public boolean onFileQueueError( + FileQueueErrorEvent fileQueueErrorEvent) { + Window.alert("Upload of file " + + fileQueueErrorEvent.getFile().getName() + " failed due to [" + + fileQueueErrorEvent.getErrorCode().toString() + "]: " + + fileQueueErrorEvent.getMessage()); + return true; + } + }).setUploadErrorHandler(new UploadErrorHandler() { + @Override + public boolean onUploadError(UploadErrorEvent uploadErrorEvent) { + FileUploader.this.getCancelButtons().get(uploadErrorEvent.getFile().getId()) + .removeFromParent(); + Window.alert("Upload of file " + + uploadErrorEvent.getFile().getName() + " failed due to [" + + uploadErrorEvent.getErrorCode().toString() + "]: " + + uploadErrorEvent.getMessage()); + return true; + } + }); FileUploader.this.getDropFilesLabel().addDragOverHandler(new DragOverHandler() { @Override public void onDragOver(DragOverEvent event) { @@ -227,14 +227,14 @@ public void onDrop(DropEvent event) { } FileUploader.this.getUploader().addFilesToQueue(Uploader.getDroppedFiles(event - .getNativeEvent())); + .getNativeEvent())); event.preventDefault(); } }); } public class CancelProgressBarTextFormatter extends - ProgressBar.TextFormatter { + ProgressBar.TextFormatter { @Override protected String getText(ProgressBar bar, double curProgress) { if (curProgress < 0) { @@ -244,14 +244,6 @@ protected String getText(ProgressBar bar, double curProgress) { } } -/* public DescribeGrid getGrid() { - return grid; - } - - public void setGrid(DescribeGrid grid) { - this.grid = grid; - }*/ - public String getFileQueuedName() { return fileQueuedName; } diff --git a/src/main/java/eml/studio/client/ui/panel/Uploader/UpdateFileModule.java b/src/main/java/eml/studio/client/ui/panel/Uploader/UpdateFileModule.java index 99da369..918f6da 100644 --- a/src/main/java/eml/studio/client/ui/panel/Uploader/UpdateFileModule.java +++ b/src/main/java/eml/studio/client/ui/panel/Uploader/UpdateFileModule.java @@ -1,3 +1,8 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.ui.panel.Uploader; import eml.studio.client.ui.binding.DatasetBinder; @@ -9,58 +14,61 @@ import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.HorizontalPanel; +/** + * Update file module for program or dataset + */ public class UpdateFileModule extends FileUploader { - final Button startbt = new Button("æ交"); - protected Program upLoadProgram = new Program(); - protected Dataset upLoadDataset = new Dataset(); - public static ProgramBinder programBinder = GWT.create(ProgramBinder.class); - public static DatasetBinder datsetBinder = GWT.create(DatasetBinder.class); + final Button startbt = new Button("Submit"); + protected Program upLoadProgram = new Program(); + protected Dataset upLoadDataset = new Dataset(); + public static ProgramBinder programBinder = GWT.create(ProgramBinder.class); + public static DatasetBinder datsetBinder = GWT.create(DatasetBinder.class); - public UpdateFileModule() { - super(); - startbt.setStyleName("bda-fileupload-btn"); - this.setBorderWidth(1); - HorizontalPanel horizontalPanel = (HorizontalPanel) this.getWidget(0); - horizontalPanel.add(startbt); - this.getElement().getStyle().setBorderColor("#cccccc"); - this.setWidth("100%"); - this.setStyleName("bda-fileupload-bottom-vpanel"); - } + public UpdateFileModule() { + super(); + startbt.setStyleName("bda-fileupload-btn"); + this.setBorderWidth(1); + HorizontalPanel horizontalPanel = (HorizontalPanel) this.getWidget(0); + horizontalPanel.add(startbt); + this.getElement().getStyle().setBorderColor("#cccccc"); + this.setWidth("100%"); + this.setStyleName("bda-fileupload-bottom-vpanel"); + } - public Button getStartbt() { - return startbt; - } + public Button getStartbt() { + return startbt; + } - public Program getUpLoadProgram() { - return upLoadProgram; - } + public Program getUpLoadProgram() { + return upLoadProgram; + } - public void setUpLoadProgram(Program upLoadProgram) { - this.upLoadProgram = upLoadProgram; - } + public void setUpLoadProgram(Program upLoadProgram) { + this.upLoadProgram = upLoadProgram; + } - public Dataset getUpLoadDataset() { - return upLoadDataset; - } + public Dataset getUpLoadDataset() { + return upLoadDataset; + } - public void setUpLoadDataset(Dataset upLoadDataset) { - this.upLoadDataset = upLoadDataset; - } + public void setUpLoadDataset(Dataset upLoadDataset) { + this.upLoadDataset = upLoadDataset; + } - public static ProgramBinder getProgramBinder() { - return programBinder; - } + public static ProgramBinder getProgramBinder() { + return programBinder; + } - public static void setProgramBinder(ProgramBinder programBinder) { - UpdateFileModule.programBinder = programBinder; - } + public static void setProgramBinder(ProgramBinder programBinder) { + UpdateFileModule.programBinder = programBinder; + } - public static DatasetBinder getDatsetBinder() { - return datsetBinder; - } + public static DatasetBinder getDatsetBinder() { + return datsetBinder; + } - public static void setDatsetBinder(DatasetBinder datsetBinder) { - UpdateFileModule.datsetBinder = datsetBinder; - } + public static void setDatsetBinder(DatasetBinder datsetBinder) { + UpdateFileModule.datsetBinder = datsetBinder; + } } diff --git a/src/main/java/eml/studio/client/ui/panel/Uploader/UploadFileModule.java b/src/main/java/eml/studio/client/ui/panel/Uploader/UploadFileModule.java index 9926528..2cb8f19 100644 --- a/src/main/java/eml/studio/client/ui/panel/Uploader/UploadFileModule.java +++ b/src/main/java/eml/studio/client/ui/panel/Uploader/UploadFileModule.java @@ -1,6 +1,10 @@ +/** + * Copyright 2017 Institute of Computing Technology, Chinese Academy of Sciences. + * Licensed under the terms of the Apache 2.0 license. + * Please see LICENSE file in the project root for terms + */ package eml.studio.client.ui.panel.Uploader; - import eml.studio.client.util.Constants; import eml.studio.shared.model.Dataset; import eml.studio.shared.model.Program; @@ -10,42 +14,44 @@ import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.HorizontalPanel; +/** + * Upload file module for program or dataset + */ public class UploadFileModule extends FileUploader { - protected Program upLoadProgram = new Program(); - protected Dataset upLoadDataset = new Dataset(); - - final Button startbt = new Button(Constants.studioUIMsg.submit()); - - public UploadFileModule() { - super(); - startbt.setStyleName("bda-fileupload-btn"); - this.setBorderWidth(1); - HorizontalPanel horizontalPanel = (HorizontalPanel) this.getWidget(0); - horizontalPanel.add(startbt); - this.getElement().getStyle().setBorderColor("#cccccc"); - this.setWidth("100%"); - this.setStyleName("bda-fileupload-bottom-vpanel"); - - } - - //get and set method - public Program getUpLoadProgram() { - return upLoadProgram; - } - - public void setUpLoadProgram(Program upLoadProgram) { - this.upLoadProgram = upLoadProgram; - } - - public Dataset getUpLoadDataset() { - return upLoadDataset; - } - - public void setUpLoadDataset(Dataset upLoadDataset) { - this.upLoadDataset = upLoadDataset; - } - - public Button getStartbt() { - return startbt; - } + protected Program upLoadProgram = new Program(); + protected Dataset upLoadDataset = new Dataset(); + + final Button startbt = new Button(Constants.studioUIMsg.submit()); + + public UploadFileModule() { + super(); + startbt.setStyleName("bda-fileupload-btn"); + this.setBorderWidth(1); + HorizontalPanel horizontalPanel = (HorizontalPanel) this.getWidget(0); + horizontalPanel.add(startbt); + this.getElement().getStyle().setBorderColor("#cccccc"); + this.setWidth("100%"); + this.setStyleName("bda-fileupload-bottom-vpanel"); + + } + + public Program getUpLoadProgram() { + return upLoadProgram; + } + + public void setUpLoadProgram(Program upLoadProgram) { + this.upLoadProgram = upLoadProgram; + } + + public Dataset getUpLoadDataset() { + return upLoadDataset; + } + + public void setUpLoadDataset(Dataset upLoadDataset) { + this.upLoadDataset = upLoadDataset; + } + + public Button getStartbt() { + return startbt; + } } diff --git a/src/main/java/eml/studio/client/ui/panel/component/DescCmdPanel.java b/src/main/java/eml/studio/client/ui/panel/component/DescCmdPanel.java index 1cff291..be673cd 100644 --- a/src/main/java/eml/studio/client/ui/panel/component/DescCmdPanel.java +++ b/src/main/java/eml/studio/client/ui/panel/component/DescCmdPanel.java @@ -18,250 +18,249 @@ * Generate command line panel */ public class DescCmdPanel extends VerticalPanel implements DescWidget { - // ArrayList