├── application └── jspmyadmin │ ├── .gitignore │ └── src │ └── main │ ├── webapp │ ├── components │ │ ├── icons │ │ │ ├── eye.png │ │ │ ├── blank.png │ │ │ ├── code.png │ │ │ ├── home.png │ │ │ ├── index.png │ │ │ ├── info.png │ │ │ ├── link.png │ │ │ ├── mysql.png │ │ │ ├── pages.png │ │ │ ├── split.png │ │ │ ├── time.png │ │ │ ├── users.png │ │ │ ├── arrow-up.png │ │ │ ├── database.png │ │ │ ├── edit-24.png │ │ │ ├── import-g.png │ │ │ ├── index-b.png │ │ │ ├── minus-g.png │ │ │ ├── minus-r.png │ │ │ ├── plus-g.png │ │ │ ├── reload.png │ │ │ ├── report-g.png │ │ │ ├── search-9.png │ │ │ ├── server.png │ │ │ ├── settings.png │ │ │ ├── sort-asc.png │ │ │ ├── time-b.png │ │ │ ├── add-list-g.png │ │ │ ├── arrow-down.png │ │ │ ├── database-g.png │ │ │ ├── historical.png │ │ │ ├── newspaper.png │ │ │ ├── sort-asc-w.png │ │ │ ├── sort-desc.png │ │ │ ├── statistics.png │ │ │ ├── structure.png │ │ │ ├── text-file.png │ │ │ ├── arrow-24-24.png │ │ │ ├── arrow-88-24.png │ │ │ ├── arrow-down-24.png │ │ │ ├── arrow-up-24.png │ │ │ ├── column-view.png │ │ │ ├── historical-b.png │ │ │ ├── newspaper-b.png │ │ │ ├── puzzle-piece.png │ │ │ ├── send-file-g.png │ │ │ ├── sort-desc-w.png │ │ │ ├── text-justify.png │ │ │ ├── database-config.png │ │ │ ├── delete-database.png │ │ │ └── user-priveleges-w.png │ │ ├── images │ │ │ ├── logo.png │ │ │ ├── favicon.ico │ │ │ ├── favicon1.ico │ │ │ └── jspmyadmin.jpg │ │ ├── cryptojs │ │ │ └── components │ │ │ │ └── mode-ecb.js │ │ └── codemirror │ │ │ └── addon │ │ │ └── hint │ │ │ └── show-hint.css │ ├── index.jsp │ └── WEB-INF │ │ ├── views │ │ ├── includes │ │ │ └── Footer.jsp │ │ ├── common │ │ │ └── Error.jsp │ │ └── view │ │ │ └── Header.jsp │ │ └── messages.tld │ └── java │ └── com │ └── jspmyadmin │ ├── framework │ ├── web │ │ ├── utils │ │ │ ├── MethodType.java │ │ │ ├── ResolveType.java │ │ │ ├── ViewType.java │ │ │ ├── Messages.java │ │ │ ├── RequestLevel.java │ │ │ ├── DetectType.java │ │ │ ├── FileInput.java │ │ │ ├── RedirectParams.java │ │ │ ├── RequestAdaptor.java │ │ │ ├── View.java │ │ │ ├── CleanTimerTask.java │ │ │ ├── RedirectParamsImpl.java │ │ │ └── RequestAdaptorAbstract.java │ │ ├── annotations │ │ │ ├── Model.java │ │ │ ├── Rest.java │ │ │ ├── Detect.java │ │ │ ├── Download.java │ │ │ ├── HandleGet.java │ │ │ ├── HandlePost.java │ │ │ ├── ValidateToken.java │ │ │ ├── HandleGetOrPost.java │ │ │ └── WebController.java │ │ └── logic │ │ │ └── EncodeHelper.java │ ├── connection │ │ ├── ConnectionType.java │ │ ├── ConnectionTypeCheck.java │ │ └── ApiConnection.java │ ├── constants │ │ └── BeanConstants.java │ ├── exception │ │ └── EncodingException.java │ └── taglib │ │ ├── jma │ │ ├── DefaultTag.java │ │ ├── RedirectTag.java │ │ └── VarTag.java │ │ └── messages │ │ ├── MessageOpenTag.java │ │ ├── PrintTag.java │ │ └── StoreTag.java │ └── app │ ├── view │ ├── data │ │ ├── beans │ │ │ └── DownloadBean.java │ │ └── controllers │ │ │ └── ViewDataController.java │ ├── structure │ │ ├── beans │ │ │ └── ColumnListBean.java │ │ └── controllers │ │ │ └── StructureShowController.java │ ├── sql │ │ └── controllers │ │ │ └── ViewSqlController.java │ └── export │ │ └── beans │ │ └── ExportBean.java │ ├── table │ ├── data │ │ ├── beans │ │ │ ├── DownloadBean.java │ │ │ └── DataUpdateBean.java │ │ └── controllers │ │ │ ├── TableBlobDownloadController.java │ │ │ ├── TableDataController.java │ │ │ ├── TableDataDeleteController.java │ │ │ └── TableDataUpdateController.java │ ├── sql │ │ └── controllers │ │ │ └── TableSqlController.java │ ├── common │ │ └── controllers │ │ │ ├── InformationController.java │ │ │ ├── FetchColumnsController.java │ │ │ ├── ForeignKeyController.java │ │ │ ├── AddFKController.java │ │ │ ├── DropFKController.java │ │ │ └── MaintenanceController.java │ ├── partition │ │ └── controllers │ │ │ ├── PartitionDropController.java │ │ │ ├── PartitionAddController.java │ │ │ └── PartitionController.java │ ├── structure │ │ └── controllers │ │ │ ├── StructureShowController.java │ │ │ ├── DropColumnsController.java │ │ │ └── AlterTableController.java │ ├── insert │ │ └── controllers │ │ │ ├── InsertUpdateController.java │ │ │ └── InsertUpdatePostController.java │ └── export │ │ └── beans │ │ └── ExportBean.java │ ├── common │ ├── beans │ │ ├── SideBarBean.java │ │ └── LanguageBean.java │ ├── logic │ │ └── LoginLogic.java │ └── controllers │ │ ├── LanguageController.java │ │ ├── LoginController.java │ │ └── ErrorController.java │ ├── server │ ├── common │ │ ├── beans │ │ │ ├── VariableBean.java │ │ │ └── CommonListBean.java │ │ └── controllers │ │ │ ├── VariableListController.java │ │ │ ├── StatusController.java │ │ │ ├── EngineController.java │ │ │ ├── PluginController.java │ │ │ ├── CharsetController.java │ │ │ └── VariableSaveController.java │ ├── users │ │ ├── beans │ │ │ ├── UserListBean.java │ │ │ ├── PrivilegeInfo.java │ │ │ └── GlobalPrivilegeBean.java │ │ └── controllers │ │ │ ├── ServerUserController.java │ │ │ └── UserDropController.java │ ├── sql │ │ └── controllers │ │ │ └── ServerSqlController.java │ └── database │ │ └── controllers │ │ ├── DatabaseDropController.java │ │ ├── DatabaseListController.java │ │ └── DatabaseCreateController.java │ └── database │ ├── sql │ ├── beans │ │ └── ExternalSqlBean.java │ └── controllers │ │ └── DatabaseSqlController.java │ ├── trigger │ ├── beans │ │ └── TriggerListBean.java │ └── controllers │ │ ├── TriggerListController.java │ │ ├── TriggerDropController.java │ │ ├── ShowCreateController.java │ │ └── TriggerTableListController.java │ ├── event │ ├── controllers │ │ ├── EventListController.java │ │ ├── DropController.java │ │ ├── EnableController.java │ │ ├── RenameController.java │ │ ├── DisableController.java │ │ ├── CreateEventController.java │ │ └── ShowCreateController.java │ └── beans │ │ └── EventListBean.java │ ├── routine │ ├── beans │ │ └── RoutineListBean.java │ └── controllers │ │ ├── FunctionListController.java │ │ ├── ProcedureListController.java │ │ ├── FunctionDropController.java │ │ ├── ProcedureDropController.java │ │ ├── ProcedureShowCreateController.java │ │ ├── FunctionShowCreateController.java │ │ ├── ProcedureCreateController.java │ │ └── FunctionCreateController.java │ └── structure │ └── controllers │ ├── CopyController.java │ ├── TableDropController.java │ ├── ViewDropController.java │ ├── ViewListController.java │ ├── TableListController.java │ ├── TruncateController.java │ ├── DuplicateController.java │ ├── UtilsController.java │ ├── CreateViewController.java │ └── ShowCreateController.java ├── bin └── jspmyadmin.war ├── .travis.yml └── .gitignore /application/jspmyadmin/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | **/config.ser 3 | **/*.iml -------------------------------------------------------------------------------- /bin/jspmyadmin.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/bin/jspmyadmin.war -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | before_install: cd application/jspmyadmin/ 3 | script: "mvn clean compile package" 4 | jdk: 5 | - openjdk7 6 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/eye.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/blank.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/code.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/home.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/index.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/info.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/link.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/mysql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/mysql.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/pages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/pages.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/split.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/time.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/users.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/images/logo.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/arrow-up.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/database.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/edit-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/edit-24.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/import-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/import-g.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/index-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/index-b.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/minus-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/minus-g.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/minus-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/minus-r.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/plus-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/plus-g.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/reload.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/report-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/report-g.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/search-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/search-9.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/server.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/settings.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/sort-asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/sort-asc.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/time-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/time-b.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/images/favicon.ico -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/add-list-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/add-list-g.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/arrow-down.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/database-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/database-g.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/historical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/historical.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/newspaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/newspaper.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/sort-asc-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/sort-asc-w.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/sort-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/sort-desc.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/statistics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/statistics.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/structure.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/text-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/text-file.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/images/favicon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/images/favicon1.ico -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/arrow-24-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/arrow-24-24.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/arrow-88-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/arrow-88-24.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/arrow-down-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/arrow-down-24.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/arrow-up-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/arrow-up-24.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/column-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/column-view.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/historical-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/historical-b.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/newspaper-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/newspaper-b.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/puzzle-piece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/puzzle-piece.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/send-file-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/send-file-g.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/sort-desc-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/sort-desc-w.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/text-justify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/text-justify.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/images/jspmyadmin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/images/jspmyadmin.jpg -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/database-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/database-config.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/delete-database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/delete-database.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/icons/user-priveleges-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yugandhargangu/JspMyAdmin2/HEAD/application/jspmyadmin/src/main/webapp/components/icons/user-priveleges-w.png -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="jma" uri="http://jspmyadmin.com/taglib/jsp/jma"%> 4 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/MethodType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/01/29 9 | * 10 | */ 11 | public enum MethodType { 12 | GET, POST; 13 | } 14 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/ResolveType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/01/29 9 | * 10 | */ 11 | enum ResolveType { 12 | ANY, GET, POST; 13 | } 14 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/ViewType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/01/29 9 | * 10 | */ 11 | public enum ViewType { 12 | DEFAULT, FORWARD, REDIRECT; 13 | } 14 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/WEB-INF/views/includes/Footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="m" uri="http://jspmyadmin.com/taglib/jsp/messages"%> 4 | 5 |
6 | 7 |
-------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/connection/ConnectionType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.connection; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/02/02 9 | * 10 | */ 11 | public enum ConnectionType { 12 | CONFIG, HALF_CONFIG, LOGIN; 13 | } 14 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/Messages.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/02/12 9 | * 10 | */ 11 | public interface Messages { 12 | 13 | public String getMessage(String key); 14 | } 15 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/RequestLevel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/08/31 9 | * 10 | */ 11 | public enum RequestLevel { 12 | DEFAULT, SERVER, DATABASE, TABLE, VIEW 13 | } 14 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/DetectType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/01/29 9 | * 10 | */ 11 | public enum DetectType { 12 | ENCODE_HELPER, REQUEST_ADAPTOR, REDIRECT_PARAMS, REQUEST, RESPONSE, SESSION, MESSAGES, VIEW; 13 | } 14 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/view/data/beans/DownloadBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.view.data.beans; 5 | 6 | import com.jspmyadmin.framework.web.utils.Bean; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/07/13 11 | * 12 | */ 13 | public class DownloadBean extends Bean { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/data/beans/DownloadBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.data.beans; 5 | 6 | import com.jspmyadmin.framework.web.utils.Bean; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/07/13 11 | * 12 | */ 13 | public class DownloadBean extends Bean { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/Model.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/09/01 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.FIELD) 18 | public @interface Model { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/Rest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/29 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.TYPE) 18 | public @interface Rest { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/connection/ConnectionTypeCheck.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.connection; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/08/29 9 | * 10 | */ 11 | public final class ConnectionTypeCheck { 12 | 13 | /** 14 | * 15 | */ 16 | private ConnectionTypeCheck() { 17 | // nothing 18 | } 19 | 20 | /** 21 | * 22 | * @return 23 | */ 24 | public static ConnectionType check() { 25 | return ConnectionFactory.connectionType; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/Detect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/09/01 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.FIELD) 18 | public @interface Detect { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/Download.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/29 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.METHOD) 18 | public @interface Download { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/HandleGet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/29 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.METHOD) 18 | public @interface HandleGet { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/HandlePost.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/29 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.METHOD) 18 | public @interface HandlePost { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/constants/BeanConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.constants; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/07/11 9 | * 10 | */ 11 | public class BeanConstants { 12 | 13 | private BeanConstants() { 14 | 15 | } 16 | 17 | public static final int _LIMIT = 1024; 18 | public static final String _B = " B"; 19 | public static final String _KIB = " KiB"; 20 | public static final String _MIB = " MiB"; 21 | public static final String _GIB = " GiB"; 22 | } 23 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/ValidateToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/29 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.METHOD) 18 | public @interface ValidateToken { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/HandleGetOrPost.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/29 14 | * 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(value = ElementType.METHOD) 18 | public @interface HandleGetOrPost { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.java.hsp 2 | *.sonarj 3 | *.sw* 4 | .DS_Store 5 | **/.settings 6 | .springBeans 7 | bin 8 | build.sh 9 | integration-repo 10 | ivy-cache 11 | jxl.log 12 | jmx.log 13 | derby.log 14 | spring-test/test-output/ 15 | .gradle 16 | argfile* 17 | pom.xml 18 | activemq-data/ 19 | 20 | classes/ 21 | **/build 22 | buildSrc/build 23 | /spring-*/build 24 | /src/asciidoc/build 25 | **/target 26 | 27 | # Eclipse artifacts, including WTP generated manifests 28 | .classpath 29 | .project 30 | spring-*/src/main/java/META-INF/MANIFEST.MF 31 | 32 | # IDEA artifacts and output dirs 33 | *.iml 34 | *.ipr 35 | *.iws 36 | .idea 37 | out 38 | test-output 39 | atlassian-ide-plugin.xml 40 | .gradletasknamecache 41 | **.iml -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/common/beans/SideBarBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.common.beans; 5 | 6 | import com.jspmyadmin.framework.web.utils.Bean; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/02/05 11 | * 12 | */ 13 | public class SideBarBean extends Bean { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String type = null; 18 | 19 | /** 20 | * @return the type 21 | */ 22 | public String getType() { 23 | return type; 24 | } 25 | 26 | /** 27 | * @param type 28 | * the type to set 29 | */ 30 | public void setType(String type) { 31 | this.type = type; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/exception/EncodingException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.exception; 5 | 6 | /** 7 | * @author Yugandhar Gangu 8 | * @created_at 2016/08/31 9 | * 10 | */ 11 | public class EncodingException extends Exception { 12 | 13 | private static final long serialVersionUID = 3952529595092203014L; 14 | 15 | public EncodingException() { 16 | super(); 17 | } 18 | 19 | public EncodingException(String message) { 20 | super(message); 21 | } 22 | 23 | public EncodingException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public EncodingException(Throwable cause) { 28 | super(cause); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/annotations/WebController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.annotations; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | import com.jspmyadmin.framework.web.utils.RequestLevel; 12 | 13 | /** 14 | * @author Yugandhar Gangu 15 | * @created_at 2016/01/29 16 | * 17 | */ 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Target(value = ElementType.TYPE) 20 | public @interface WebController { 21 | 22 | public String path(); 23 | 24 | public boolean authentication() default true; 25 | 26 | public RequestLevel requestLevel(); 27 | } 28 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/cryptojs/components/mode-ecb.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | /** 8 | * Electronic Codebook block mode. 9 | */ 10 | CryptoJS.mode.ECB = (function () { 11 | var ECB = CryptoJS.lib.BlockCipherMode.extend(); 12 | 13 | ECB.Encryptor = ECB.extend({ 14 | processBlock: function (words, offset) { 15 | this._cipher.encryptBlock(words, offset); 16 | } 17 | }); 18 | 19 | ECB.Decryptor = ECB.extend({ 20 | processBlock: function (words, offset) { 21 | this._cipher.decryptBlock(words, offset); 22 | } 23 | }); 24 | 25 | return ECB; 26 | }()); 27 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/FileInput.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.Serializable; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/07/12 13 | * 14 | */ 15 | public interface FileInput extends Serializable { 16 | 17 | /** 18 | * 19 | * @return 20 | */ 21 | String getFileName(); 22 | 23 | /** 24 | * 25 | * @return 26 | */ 27 | long getFileSize(); 28 | 29 | /** 30 | * 31 | * @param path 32 | * @throws IOException 33 | */ 34 | void copyTo(String path) throws IOException; 35 | 36 | /** 37 | * 38 | * @return 39 | * @throws IOException 40 | */ 41 | InputStream getInputStream() throws IOException; 42 | } 43 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/RedirectParams.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/08/29 11 | * 12 | */ 13 | public interface RedirectParams { 14 | /** 15 | * 16 | * @param key 17 | * @param value 18 | */ 19 | public void put(String key, Object value); 20 | 21 | /** 22 | * 23 | * @param key 24 | * @return 25 | */ 26 | public Object get(String key); 27 | 28 | /** 29 | * 30 | * @param key 31 | * @return 32 | */ 33 | public boolean has(String key); 34 | 35 | /** 36 | * 37 | * @return 38 | */ 39 | public Map getAsMap(); 40 | 41 | /** 42 | * 43 | * @return 44 | */ 45 | boolean isEmpty() ; 46 | } 47 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/RequestAdaptor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | import java.util.WeakHashMap; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | import com.jspmyadmin.framework.exception.EncodingException; 13 | 14 | /** 15 | * @author Yugandhar Gangu 16 | * @created_at 2016/08/30 17 | * 18 | */ 19 | public interface RequestAdaptor { 20 | 21 | public static final Map REQUEST_MAP = Collections 22 | .synchronizedMap(new WeakHashMap()); 23 | 24 | /** 25 | * 26 | * @return 27 | * @throws EncodingException 28 | */ 29 | public abstract String generateToken() throws EncodingException; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/components/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | li.CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/beans/VariableBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.beans; 5 | 6 | import com.jspmyadmin.framework.web.utils.Bean; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/02/12 11 | * 12 | */ 13 | public class VariableBean extends Bean { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String name = null; 18 | private String value = null; 19 | 20 | /** 21 | * @return the name 22 | */ 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | /** 28 | * @param name 29 | * the name to set 30 | */ 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | /** 36 | * @return the value 37 | */ 38 | public String getValue() { 39 | return value; 40 | } 41 | 42 | /** 43 | * @param value 44 | * the value to set 45 | */ 46 | public void setValue(String value) { 47 | this.value = value; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/connection/ApiConnection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.connection; 5 | 6 | import java.sql.DatabaseMetaData; 7 | import java.sql.PreparedStatement; 8 | import java.sql.SQLException; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/02/02 13 | * 14 | */ 15 | public interface ApiConnection { 16 | 17 | /** 18 | * 19 | * @param query 20 | * @return 21 | * @throws SQLException 22 | */ 23 | PreparedStatement getStmtSelect(String query) throws SQLException; 24 | 25 | /** 26 | * 27 | * @param query 28 | * @return 29 | * @throws SQLException 30 | */ 31 | PreparedStatement getStmt(String query) throws SQLException; 32 | 33 | /** 34 | * 35 | * @return 36 | * @throws SQLException 37 | */ 38 | DatabaseMetaData getDatabaseMetaData() throws SQLException; 39 | 40 | /** 41 | * 42 | */ 43 | void commit(); 44 | 45 | /** 46 | * 47 | */ 48 | void rollback(); 49 | 50 | /** 51 | * 52 | */ 53 | void close(); 54 | } 55 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/View.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | 9 | /** 10 | * @author Yugandhar Gangu 11 | * @created_at 2016/01/29 12 | * 13 | */ 14 | public interface View { 15 | 16 | /** 17 | * 18 | * @param type 19 | */ 20 | public void setType(ViewType type); 21 | 22 | /** 23 | * 24 | * @param path 25 | */ 26 | public void setPath(String path); 27 | 28 | /** 29 | * 30 | * @param token 31 | */ 32 | public void setToken(String token); 33 | 34 | /** 35 | * 36 | * @param key 37 | * @param value 38 | */ 39 | public void addAttribute(String key, Object value); 40 | 41 | /** 42 | * 43 | * @param file 44 | * @param deleteAfterDownload 45 | * @param filename 46 | * @throws Exception 47 | */ 48 | public void handleDownload(File file, boolean deleteAfterDownload, String filename) throws IOException; 49 | 50 | /** 51 | * 52 | * @param view 53 | */ 54 | public void handleDefault(); 55 | } 56 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/taglib/jma/DefaultTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.taglib.jma; 5 | 6 | import javax.servlet.jsp.JspException; 7 | import javax.servlet.jsp.tagext.Tag; 8 | 9 | import com.jspmyadmin.framework.taglib.support.AbstractTagSupport; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/28 14 | * 15 | */ 16 | public class DefaultTag extends AbstractTagSupport { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | @Override 21 | public int doStartTag() throws JspException { 22 | 23 | Tag parentTag = super.getParent(); 24 | SwitchTag switchTag = null; 25 | if (parentTag instanceof SwitchTag) { 26 | switchTag = (SwitchTag) parentTag; 27 | } else { 28 | throw new JspException("No switch tag found."); 29 | } 30 | 31 | if (switchTag.isSubDone()) { 32 | return SKIP_BODY; 33 | } 34 | 35 | return EVAL_BODY_INCLUDE; 36 | } 37 | 38 | @Override 39 | public int doEndTag() throws JspException { 40 | SwitchTag switchTag = (SwitchTag) super.getParent(); 41 | switchTag.setSubDone(true); 42 | return SKIP_BODY; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/CleanTimerTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | import java.util.Calendar; 7 | import java.util.Date; 8 | import java.util.Timer; 9 | import java.util.TimerTask; 10 | 11 | /** 12 | * @author Yugandhar Gangu 13 | * @created_at 2016/01/29 14 | * 15 | */ 16 | class CleanTimerTask extends TimerTask { 17 | 18 | private final static long _ONCE_PER_DAY = 1000 * 60 * 60 * 24; 19 | 20 | private final static int _ONE_AM = 1; 21 | private final static int _ZERO_MINUTES = 0; 22 | 23 | @Override 24 | public void run() { 25 | // clean 26 | } 27 | 28 | /** 29 | * 30 | * @return 31 | */ 32 | private static Date getTomorrowMorning2AM() { 33 | 34 | Calendar calendar = Calendar.getInstance(); 35 | calendar.set(Calendar.HOUR, _ONE_AM); 36 | calendar.set(Calendar.MINUTE, _ZERO_MINUTES); 37 | return calendar.getTime(); 38 | } 39 | 40 | /** 41 | * 42 | */ 43 | public static void startClean() { 44 | CleanTimerTask task = new CleanTimerTask(); 45 | task.run(); 46 | Timer timer = new Timer(); 47 | timer.schedule(task, getTomorrowMorning2AM(), _ONCE_PER_DAY); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/view/structure/beans/ColumnListBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.view.structure.beans; 5 | 6 | import java.util.List; 7 | 8 | import com.jspmyadmin.framework.web.utils.Bean; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/04/13 13 | * 14 | */ 15 | public class ColumnListBean extends Bean { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private List column_list = null; 20 | 21 | /** 22 | * @return the column_list 23 | */ 24 | public List getColumn_list() { 25 | return column_list; 26 | } 27 | 28 | /** 29 | * @param column_list 30 | * the column_list to set 31 | */ 32 | public void setColumn_list(List column_list) { 33 | this.column_list = column_list; 34 | } 35 | 36 | /** 37 | * @return the serialversionuid 38 | */ 39 | public static long getSerialversionuid() { 40 | return serialVersionUID; 41 | } 42 | 43 | // extra get methods 44 | /** 45 | * 46 | * @return 47 | */ 48 | public int getColumns_size() { 49 | if (column_list != null) { 50 | return column_list.size(); 51 | } 52 | return 0; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/taglib/jma/RedirectTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.taglib.jma; 5 | 6 | import java.io.IOException; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import javax.servlet.jsp.JspException; 11 | 12 | import com.jspmyadmin.framework.taglib.support.AbstractTagSupport; 13 | 14 | /** 15 | * @author Yugandhar Gangu 16 | * @created_at 2016/01/28 17 | * 18 | */ 19 | public class RedirectTag extends AbstractTagSupport { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | private String url = null; 24 | 25 | /** 26 | * @param url 27 | * the url to set 28 | */ 29 | public void setUrl(String url) { 30 | this.url = url; 31 | } 32 | 33 | @Override 34 | public int doStartTag() throws JspException { 35 | HttpServletRequest request = (HttpServletRequest) pageContext 36 | .getRequest(); 37 | HttpServletResponse response = (HttpServletResponse) pageContext 38 | .getResponse(); 39 | try { 40 | response.sendRedirect(request.getContextPath() + url); 41 | } catch (IOException e) { 42 | } 43 | return SKIP_PAGE; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/common/beans/LanguageBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.common.beans; 5 | 6 | import com.jspmyadmin.framework.web.utils.Bean; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/02/05 11 | * 12 | */ 13 | public class LanguageBean extends Bean { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String language = null; 18 | private String redirect = null; 19 | 20 | /** 21 | * @return the language 22 | */ 23 | public String getLanguage() { 24 | return language; 25 | } 26 | 27 | /** 28 | * @param language 29 | * the language to set 30 | */ 31 | public void setLanguage(String language) { 32 | this.language = language; 33 | } 34 | 35 | /** 36 | * @return the redirect 37 | */ 38 | public String getRedirect() { 39 | return redirect; 40 | } 41 | 42 | /** 43 | * @param redirect 44 | * the redirect to set 45 | */ 46 | public void setRedirect(String redirect) { 47 | this.redirect = redirect; 48 | } 49 | 50 | /** 51 | * @return the serialversionuid 52 | */ 53 | public static long getSerialversionuid() { 54 | return serialVersionUID; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/sql/beans/ExternalSqlBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.sql.beans; 5 | 6 | import com.jspmyadmin.framework.web.utils.Bean; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/07/22 11 | * 12 | */ 13 | public class ExternalSqlBean extends Bean { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String edit_type = null; 18 | private String edit_name = null; 19 | 20 | /** 21 | * @return the edit_type 22 | */ 23 | public String getEdit_type() { 24 | return edit_type; 25 | } 26 | 27 | /** 28 | * @param edit_type 29 | * the edit_type to set 30 | */ 31 | public void setEdit_type(String edit_type) { 32 | this.edit_type = edit_type; 33 | } 34 | 35 | /** 36 | * @return the edit_name 37 | */ 38 | public String getEdit_name() { 39 | return edit_name; 40 | } 41 | 42 | /** 43 | * @param edit_name 44 | * the edit_name to set 45 | */ 46 | public void setEdit_name(String edit_name) { 47 | this.edit_name = edit_name; 48 | } 49 | 50 | /** 51 | * @return the serialversionuid 52 | */ 53 | public static long getSerialversionuid() { 54 | return serialVersionUID; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/users/beans/UserListBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.users.beans; 5 | 6 | import java.util.List; 7 | 8 | import com.jspmyadmin.framework.web.utils.Bean; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/07/14 13 | * 14 | */ 15 | public class UserListBean extends Bean { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private String error = null; 20 | private List user_info_list = null; 21 | 22 | /** 23 | * @return the error 24 | */ 25 | public String getError() { 26 | return error; 27 | } 28 | 29 | /** 30 | * @param error 31 | * the error to set 32 | */ 33 | public void setError(String error) { 34 | this.error = error; 35 | } 36 | 37 | /** 38 | * @return the user_info_list 39 | */ 40 | public List getUser_info_list() { 41 | return user_info_list; 42 | } 43 | 44 | /** 45 | * @param user_info_list 46 | * the user_info_list to set 47 | */ 48 | public void setUser_info_list(List user_info_list) { 49 | this.user_info_list = user_info_list; 50 | } 51 | 52 | /** 53 | * @return the serialversionuid 54 | */ 55 | public static long getSerialversionuid() { 56 | return serialVersionUID; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/data/controllers/TableBlobDownloadController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.data.controllers; 5 | 6 | import com.jspmyadmin.app.table.data.beans.DataSelectBean; 7 | import com.jspmyadmin.framework.web.annotations.Detect; 8 | import com.jspmyadmin.framework.web.annotations.Download; 9 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 10 | import com.jspmyadmin.framework.web.annotations.Model; 11 | import com.jspmyadmin.framework.web.annotations.WebController; 12 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 13 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 14 | import com.jspmyadmin.framework.web.utils.RequestLevel; 15 | import com.jspmyadmin.framework.web.utils.View; 16 | 17 | /** 18 | * @author Yugandhar Gangu 19 | * @created_at 2016/02/22 20 | * 21 | */ 22 | @WebController(authentication = true, path = "/table_blob_download.html", requestLevel = RequestLevel.TABLE) 23 | public class TableBlobDownloadController { 24 | 25 | @Detect 26 | private EncodeHelper encodeObj; 27 | @Detect 28 | private RequestAdaptor requestAdaptor; 29 | @Detect 30 | private View view; 31 | @Model 32 | private DataSelectBean bean; 33 | 34 | @HandleGetOrPost 35 | @Download 36 | private void download() { 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/RedirectParamsImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * @author Yugandhar Gangu 11 | * @created_at 2016/08/29 12 | * 13 | */ 14 | class RedirectParamsImpl implements RedirectParams { 15 | 16 | private Map _paramsMap; 17 | 18 | /** 19 | * 20 | */ 21 | public void put(String key, Object value) { 22 | if (_paramsMap == null) { 23 | _paramsMap = new HashMap(); 24 | } 25 | _paramsMap.put(key, value); 26 | } 27 | 28 | /** 29 | * 30 | */ 31 | public Object get(String key) { 32 | if (_paramsMap != null && _paramsMap.containsKey(key)) { 33 | return _paramsMap.get(key); 34 | } 35 | return null; 36 | } 37 | 38 | /** 39 | * 40 | */ 41 | public Map getAsMap() { 42 | return _paramsMap; 43 | } 44 | 45 | /** 46 | * 47 | * @return 48 | */ 49 | public boolean isEmpty() { 50 | if (_paramsMap == null || _paramsMap.isEmpty()) { 51 | return true; 52 | } 53 | return false; 54 | } 55 | 56 | /** 57 | * 58 | */ 59 | public boolean has(String key) { 60 | if (_paramsMap != null && _paramsMap.containsKey(key)) { 61 | return true; 62 | } 63 | return false; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/taglib/messages/MessageOpenTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.taglib.messages; 5 | 6 | import javax.servlet.http.HttpSession; 7 | import javax.servlet.jsp.JspException; 8 | import javax.servlet.jsp.PageContext; 9 | 10 | import com.jspmyadmin.framework.constants.Constants; 11 | import com.jspmyadmin.framework.taglib.support.AbstractSimpleTagSupport; 12 | import com.jspmyadmin.framework.web.utils.MessageReader; 13 | 14 | /** 15 | * 16 | * @author Yugandhar Gangu 17 | * @created_at 2016/01/27 18 | * 19 | */ 20 | public class MessageOpenTag extends AbstractSimpleTagSupport { 21 | 22 | @Override 23 | public void doTag() throws JspException { 24 | PageContext pageContext = (PageContext) super.getJspContext(); 25 | HttpSession httpSession = pageContext.getSession(); 26 | MessageReader messageReader = null; 27 | if (httpSession != null) { 28 | Object temp = httpSession 29 | .getAttribute(Constants.SESSION_LOCALE); 30 | if (temp != null) { 31 | messageReader = new MessageReader(temp.toString()); 32 | } else { 33 | messageReader = new MessageReader(null); 34 | } 35 | } else { 36 | messageReader = new MessageReader(null); 37 | } 38 | pageContext.setAttribute(Constants.PAGE_CONTEXT_MESSAGES, 39 | messageReader, PageContext.PAGE_SCOPE); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/controllers/VariableListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.common.beans.CommonListBean; 11 | import com.jspmyadmin.app.server.common.logic.VariableLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/02/10 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/server_variables.html", requestLevel = RequestLevel.SERVER) 27 | public class VariableListController { 28 | 29 | @Detect 30 | private View view; 31 | @Model 32 | private CommonListBean bean; 33 | 34 | @HandleGetOrPost 35 | private void variables() throws SQLException, JSONException { 36 | VariableLogic variableLogic = new VariableLogic(); 37 | variableLogic.fillBean(bean); 38 | view.setType(ViewType.FORWARD); 39 | view.setPath(AppConstants.JSP_SERVER_COMMON_VARIABLELIST); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/sql/controllers/TableSqlController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.sql.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.table.sql.beans.SqlBean; 11 | import com.jspmyadmin.app.table.sql.logic.SqlLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/02/22 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/table_sql.html", requestLevel = RequestLevel.TABLE) 27 | public class TableSqlController { 28 | 29 | @Detect 30 | private View view; 31 | @Model 32 | private SqlBean bean; 33 | 34 | @HandleGetOrPost 35 | private void sqlEditor() throws JSONException { 36 | 37 | SqlLogic sqlLogic = null; 38 | try { 39 | sqlLogic = new SqlLogic(); 40 | sqlLogic.fillBean(bean); 41 | } catch (SQLException e) { 42 | bean.setError(e.getMessage()); 43 | } 44 | view.setType(ViewType.FORWARD); 45 | view.setPath(AppConstants.JSP_TABLE_SQL_SQL); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/view/sql/controllers/ViewSqlController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.view.sql.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.view.sql.beans.SqlBean; 11 | import com.jspmyadmin.app.view.sql.logic.SqlLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/02/22 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/view_sql.html", requestLevel = RequestLevel.VIEW) 27 | public class ViewSqlController { 28 | 29 | @Detect 30 | private View view; 31 | @Model 32 | private SqlBean bean; 33 | 34 | @HandleGetOrPost 35 | private void sqlEditor() throws JSONException { 36 | 37 | SqlLogic sqlLogic = null; 38 | try { 39 | sqlLogic = new SqlLogic(); 40 | sqlLogic.fillBean(bean); 41 | } catch (SQLException e) { 42 | bean.setError(e.getMessage()); 43 | } 44 | view.setType(ViewType.FORWARD); 45 | view.setPath(AppConstants.JSP_VIEW_SQL_SQL); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/sql/controllers/ServerSqlController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.sql.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.sql.beans.SqlBean; 11 | import com.jspmyadmin.app.server.sql.logic.SqlLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/02/22 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/server_sql.html", requestLevel = RequestLevel.SERVER) 27 | public class ServerSqlController { 28 | 29 | @Detect 30 | private View view; 31 | @Model 32 | private SqlBean bean; 33 | 34 | @HandleGetOrPost 35 | private void sqlEditor() throws JSONException { 36 | 37 | SqlLogic sqlLogic = null; 38 | try { 39 | sqlLogic = new SqlLogic(); 40 | sqlLogic.fillBean(bean); 41 | } catch (SQLException e) { 42 | bean.setError(e.getMessage()); 43 | } 44 | view.setType(ViewType.FORWARD); 45 | view.setPath(AppConstants.JSP_SERVER_SQL_SQL); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/controllers/StatusController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.server.common.beans.StatusBean; 9 | import com.jspmyadmin.app.server.common.logic.StatusLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.web.annotations.Detect; 12 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 13 | import com.jspmyadmin.framework.web.annotations.Model; 14 | import com.jspmyadmin.framework.web.annotations.WebController; 15 | import com.jspmyadmin.framework.web.utils.Messages; 16 | import com.jspmyadmin.framework.web.utils.RequestLevel; 17 | import com.jspmyadmin.framework.web.utils.View; 18 | import com.jspmyadmin.framework.web.utils.ViewType; 19 | 20 | /** 21 | * @author Yugandhar Gangu 22 | * @created_at 2016/02/12 23 | * 24 | */ 25 | @WebController(authentication = true, path = "/server_status.html", requestLevel = RequestLevel.SERVER) 26 | public class StatusController { 27 | 28 | @Detect 29 | private Messages messages; 30 | @Detect 31 | private View view; 32 | @Model 33 | private StatusBean bean; 34 | 35 | @HandleGetOrPost 36 | private void status() throws SQLException { 37 | StatusLogic statusLogic = new StatusLogic(); 38 | statusLogic.setMessages(messages); 39 | statusLogic.fillBean(bean); 40 | view.setType(ViewType.FORWARD); 41 | view.setPath(AppConstants.JSP_SERVER_COMMON_STATUSLIST); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/common/controllers/InformationController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.common.beans.InformationBean; 9 | import com.jspmyadmin.app.table.common.logic.InformationLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.web.annotations.Detect; 12 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 13 | import com.jspmyadmin.framework.web.annotations.Model; 14 | import com.jspmyadmin.framework.web.annotations.WebController; 15 | import com.jspmyadmin.framework.web.utils.RequestLevel; 16 | import com.jspmyadmin.framework.web.utils.View; 17 | import com.jspmyadmin.framework.web.utils.ViewType; 18 | 19 | /** 20 | * @author Yugandhar Gangu 21 | * @created_at 2016/07/06 22 | * 23 | */ 24 | @WebController(authentication = true, path = "/table_info.html", requestLevel = RequestLevel.TABLE) 25 | public class InformationController { 26 | 27 | @Detect 28 | private View view; 29 | @Model 30 | private InformationBean bean; 31 | 32 | @HandleGetOrPost 33 | private void tableInfo() { 34 | 35 | InformationLogic informationLogic = null; 36 | try { 37 | informationLogic = new InformationLogic(bean.getRequest_table()); 38 | informationLogic.fillBean(bean); 39 | view.setType(ViewType.FORWARD); 40 | view.setPath(AppConstants.JSP_TABLE_COMMON_INFORMATION); 41 | } catch (SQLException e) { 42 | view.handleDefault(); 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/trigger/beans/TriggerListBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.trigger.beans; 5 | 6 | import java.util.List; 7 | 8 | import com.jspmyadmin.framework.web.utils.Bean; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/03/28 13 | * 14 | */ 15 | public class TriggerListBean extends Bean { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private List trigger_list = null; 20 | private String total = null; 21 | private String[] triggers = null; 22 | 23 | /** 24 | * @return the trigger_list 25 | */ 26 | public List getTrigger_list() { 27 | return trigger_list; 28 | } 29 | 30 | /** 31 | * @param trigger_list 32 | * the trigger_list to set 33 | */ 34 | public void setTrigger_list(List trigger_list) { 35 | this.trigger_list = trigger_list; 36 | } 37 | 38 | /** 39 | * @return the total 40 | */ 41 | public String getTotal() { 42 | return total; 43 | } 44 | 45 | /** 46 | * @param total 47 | * the total to set 48 | */ 49 | public void setTotal(String total) { 50 | this.total = total; 51 | } 52 | 53 | /** 54 | * @return the triggers 55 | */ 56 | public String[] getTriggers() { 57 | return triggers; 58 | } 59 | 60 | /** 61 | * @param triggers 62 | * the triggers to set 63 | */ 64 | public void setTriggers(String[] triggers) { 65 | this.triggers = triggers; 66 | } 67 | 68 | /** 69 | * @return the serialversionuid 70 | */ 71 | public static long getSerialversionuid() { 72 | return serialVersionUID; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/data/beans/DataUpdateBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.data.beans; 5 | 6 | import com.jspmyadmin.framework.web.utils.Bean; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/06/28 11 | * 12 | */ 13 | public class DataUpdateBean extends Bean { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String column_name = null; 18 | private String column_value = null; 19 | private String primary_key = null; 20 | 21 | /** 22 | * @return the column_name 23 | */ 24 | public String getColumn_name() { 25 | return column_name; 26 | } 27 | 28 | /** 29 | * @param column_name 30 | * the column_name to set 31 | */ 32 | public void setColumn_name(String column_name) { 33 | this.column_name = column_name; 34 | } 35 | 36 | /** 37 | * @return the column_value 38 | */ 39 | public String getColumn_value() { 40 | return column_value; 41 | } 42 | 43 | /** 44 | * @param column_value 45 | * the column_value to set 46 | */ 47 | public void setColumn_value(String column_value) { 48 | this.column_value = column_value; 49 | } 50 | 51 | /** 52 | * @return the primary_key 53 | */ 54 | public String getPrimary_key() { 55 | return primary_key; 56 | } 57 | 58 | /** 59 | * @param primary_key 60 | * the primary_key to set 61 | */ 62 | public void setPrimary_key(String primary_key) { 63 | this.primary_key = primary_key; 64 | } 65 | 66 | /** 67 | * @return the serialversionuid 68 | */ 69 | public static long getSerialversionuid() { 70 | return serialVersionUID; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/controllers/EventListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.event.beans.EventListBean; 9 | import com.jspmyadmin.app.database.event.logic.EventLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/03/17 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/database_events.html", requestLevel = RequestLevel.DATABASE) 27 | public class EventListController { 28 | 29 | @Detect 30 | private RequestAdaptor requestAdaptor; 31 | @Detect 32 | private View view; 33 | @Model 34 | private EventListBean bean; 35 | 36 | @HandleGetOrPost 37 | private void events() throws SQLException, EncodingException { 38 | EventLogic eventLogic = new EventLogic(); 39 | eventLogic.fillListBean(bean); 40 | bean.setToken(requestAdaptor.generateToken()); 41 | view.setType(ViewType.FORWARD); 42 | view.setPath(AppConstants.JSP_DATABASE_EVENT_EVENTS); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/beans/RoutineListBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.beans; 5 | 6 | import java.util.List; 7 | 8 | import com.jspmyadmin.framework.web.utils.Bean; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/03/03 13 | * 14 | */ 15 | public class RoutineListBean extends Bean { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private String[] routines = null; 20 | private String total = null; 21 | private List routine_info_list = null; 22 | 23 | /** 24 | * @return the routines 25 | */ 26 | public String[] getRoutines() { 27 | return routines; 28 | } 29 | 30 | /** 31 | * @param routines 32 | * the routines to set 33 | */ 34 | public void setRoutines(String[] routines) { 35 | this.routines = routines; 36 | } 37 | 38 | /** 39 | * @return the routine_info_list 40 | */ 41 | public List getRoutine_info_list() { 42 | return routine_info_list; 43 | } 44 | 45 | /** 46 | * @param routine_info_list 47 | * the routine_info_list to set 48 | */ 49 | public void setRoutine_info_list(List routine_info_list) { 50 | this.routine_info_list = routine_info_list; 51 | } 52 | 53 | /** 54 | * @return the total 55 | */ 56 | public String getTotal() { 57 | return total; 58 | } 59 | 60 | /** 61 | * @param total 62 | * the total to set 63 | */ 64 | public void setTotal(String total) { 65 | this.total = total; 66 | } 67 | 68 | /** 69 | * @return the serialversionuid 70 | */ 71 | public static long getSerialversionuid() { 72 | return serialVersionUID; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/common/controllers/FetchColumnsController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.table.common.beans.ForeignKeyBean; 14 | import com.jspmyadmin.app.table.common.logic.ForeignKeyLogic; 15 | import com.jspmyadmin.framework.web.annotations.Detect; 16 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 17 | import com.jspmyadmin.framework.web.annotations.Model; 18 | import com.jspmyadmin.framework.web.annotations.Rest; 19 | import com.jspmyadmin.framework.web.annotations.WebController; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/05 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/table_fetch_columns.text", requestLevel = RequestLevel.TABLE) 28 | @Rest 29 | public class FetchColumnsController { 30 | 31 | @Detect 32 | private HttpServletResponse response; 33 | @Model 34 | private ForeignKeyBean bean; 35 | 36 | @HandleGetOrPost 37 | private JSONObject fetchColumns() { 38 | if (bean.getRef_table_name() != null) { 39 | JSONObject jsonObject = null; 40 | ForeignKeyLogic foreignKeyLogic = null; 41 | try { 42 | foreignKeyLogic = new ForeignKeyLogic(bean.getRef_table_name()); 43 | jsonObject = foreignKeyLogic.fetchColumns(bean.getRequest_db()); 44 | } catch (SQLException e) { 45 | } catch (JSONException e) { 46 | } 47 | return jsonObject; 48 | } 49 | return null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/controllers/EngineController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.common.beans.CommonListBean; 11 | import com.jspmyadmin.app.server.common.logic.EngineLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestLevel; 20 | import com.jspmyadmin.framework.web.utils.View; 21 | import com.jspmyadmin.framework.web.utils.ViewType; 22 | 23 | /** 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/02/10 26 | * 27 | */ 28 | @WebController(authentication = true, path = "/server_engines.html", requestLevel = RequestLevel.SERVER) 29 | public class EngineController { 30 | 31 | @Detect 32 | private EncodeHelper encodeObj; 33 | @Detect 34 | private View view; 35 | @Model 36 | private CommonListBean bean; 37 | 38 | @HandleGetOrPost 39 | private void engines() throws SQLException, JSONException, EncodingException { 40 | EngineLogic engineLogic = new EngineLogic(); 41 | engineLogic.setEncodeObj(encodeObj); 42 | engineLogic.fillBean(bean); 43 | view.setType(ViewType.FORWARD); 44 | view.setPath(AppConstants.JSP_SERVER_COMMON_ENGINELIST); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/controllers/PluginController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.common.beans.CommonListBean; 11 | import com.jspmyadmin.app.server.common.logic.PluginLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestLevel; 20 | import com.jspmyadmin.framework.web.utils.View; 21 | import com.jspmyadmin.framework.web.utils.ViewType; 22 | 23 | /** 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/02/10 26 | * 27 | */ 28 | @WebController(authentication = true, path = "/server_plugins.html", requestLevel = RequestLevel.SERVER) 29 | public class PluginController { 30 | 31 | @Detect 32 | private EncodeHelper encodeObj; 33 | @Detect 34 | private View view; 35 | @Model 36 | private CommonListBean bean; 37 | 38 | @HandleGetOrPost 39 | private void plugins() throws SQLException, JSONException, EncodingException { 40 | PluginLogic pluginLogic = new PluginLogic(); 41 | pluginLogic.setEncodeObj(encodeObj); 42 | pluginLogic.fillBean(bean); 43 | view.setType(ViewType.FORWARD); 44 | view.setPath(AppConstants.JSP_SERVER_COMMON_PLUGINLIST); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/trigger/controllers/TriggerListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.trigger.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.trigger.beans.TriggerListBean; 9 | import com.jspmyadmin.app.database.trigger.logic.TriggerLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/03/30 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/database_triggers.html", requestLevel = RequestLevel.DATABASE) 27 | public class TriggerListController { 28 | 29 | @Detect 30 | private RequestAdaptor requestAdaptor; 31 | @Detect 32 | private View view; 33 | @Model 34 | private TriggerListBean bean; 35 | 36 | @HandleGetOrPost 37 | private void triggers() throws EncodingException, SQLException { 38 | 39 | TriggerLogic triggerLogic = new TriggerLogic(); 40 | triggerLogic.fillListBean(bean); 41 | bean.setToken(requestAdaptor.generateToken()); 42 | view.setType(ViewType.FORWARD); 43 | view.setPath(AppConstants.JSP_DATABASE_TRIGGER_TRIGGERS); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/controllers/CharsetController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.common.beans.CommonListBean; 11 | import com.jspmyadmin.app.server.common.logic.CharsetLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestLevel; 20 | import com.jspmyadmin.framework.web.utils.View; 21 | import com.jspmyadmin.framework.web.utils.ViewType; 22 | 23 | /** 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/02/10 26 | * 27 | */ 28 | @WebController(authentication = true, path = "/server_charsets.html", requestLevel = RequestLevel.SERVER) 29 | public class CharsetController { 30 | 31 | @Detect 32 | private EncodeHelper encodeObj; 33 | @Detect 34 | private View view; 35 | @Model 36 | private CommonListBean bean; 37 | 38 | @HandleGetOrPost 39 | protected void charsets() throws SQLException, JSONException, EncodingException { 40 | CharsetLogic charsetLogic = new CharsetLogic(); 41 | charsetLogic.setEncodeObj(encodeObj); 42 | charsetLogic.fillBean(bean); 43 | view.setType(ViewType.FORWARD); 44 | view.setPath(AppConstants.JSP_SERVER_COMMON_CHARSETLIST); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/view/structure/controllers/StructureShowController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.view.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.view.structure.beans.ColumnListBean; 9 | import com.jspmyadmin.app.view.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/02/22 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/view_structure.html", requestLevel = RequestLevel.VIEW) 27 | public class StructureShowController { 28 | 29 | @Detect 30 | private RequestAdaptor requestAdaptor; 31 | @Detect 32 | private View view; 33 | @Model 34 | private ColumnListBean bean; 35 | 36 | @HandleGetOrPost 37 | private void structure() throws SQLException, EncodingException { 38 | StructureLogic structureLogic = new StructureLogic(bean.getRequest_view()); 39 | structureLogic.fillStructureBean(bean); 40 | bean.setToken(requestAdaptor.generateToken()); 41 | view.setType(ViewType.FORWARD); 42 | view.setPath(AppConstants.JSP_VIEW_STRUCTURE_STRUCTURE); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/partition/controllers/PartitionDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.partition.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.partition.beans.PartinitionBean; 9 | import com.jspmyadmin.app.table.partition.logic.PartitionLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.RedirectParams; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/07/11 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/table_partition_drop.html", requestLevel = RequestLevel.TABLE) 28 | public class PartitionDropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private PartinitionBean bean; 36 | 37 | @HandlePost 38 | private void dropPartition() { 39 | PartitionLogic partitionLogic = null; 40 | try { 41 | partitionLogic = new PartitionLogic(bean.getRequest_table()); 42 | partitionLogic.dropPartitions(bean); 43 | } catch (SQLException e) { 44 | redirectParams.put(Constants.ERR, e.getMessage()); 45 | } 46 | view.setType(ViewType.REDIRECT); 47 | view.setPath(AppConstants.PATH_TABLE_PARTITIONS); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/FunctionListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.routine.beans.RoutineListBean; 9 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.exception.EncodingException; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/03/03 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_functions.html", requestLevel = RequestLevel.DATABASE) 28 | public class FunctionListController { 29 | 30 | @Detect 31 | private RequestAdaptor requestAdaptor; 32 | @Detect 33 | private View view; 34 | @Model 35 | private RoutineListBean bean; 36 | 37 | @HandleGetOrPost 38 | private void functions() throws SQLException, EncodingException { 39 | RoutineLogic routineLogic = new RoutineLogic(); 40 | routineLogic.fillListBean(bean, Constants.FUNCTION); 41 | bean.setToken(requestAdaptor.generateToken()); 42 | view.setType(ViewType.FORWARD); 43 | view.setPath(AppConstants.JSP_DATABASE_ROUTINE_FUNCTIONS); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/ProcedureListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.routine.beans.RoutineListBean; 9 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.exception.EncodingException; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/03/03 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_procedures.html", requestLevel = RequestLevel.DATABASE) 28 | public class ProcedureListController { 29 | 30 | @Detect 31 | private RequestAdaptor requestAdaptor; 32 | @Detect 33 | private View view; 34 | @Model 35 | private RoutineListBean bean; 36 | 37 | @HandleGetOrPost 38 | private void procedures() throws SQLException, EncodingException { 39 | RoutineLogic routineLogic = new RoutineLogic(); 40 | routineLogic.fillListBean(bean, Constants.PROCEDURE); 41 | bean.setToken(requestAdaptor.generateToken()); 42 | view.setType(ViewType.FORWARD); 43 | view.setPath(AppConstants.JSP_DATABASE_ROUTINE_PROCEDURES); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/common/logic/LoginLogic.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.common.logic; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpSession; 9 | 10 | import com.jspmyadmin.app.common.beans.LoginBean; 11 | import com.jspmyadmin.framework.connection.AbstractLogic; 12 | import com.jspmyadmin.framework.connection.ApiConnection; 13 | import com.jspmyadmin.framework.constants.Constants; 14 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 15 | 16 | /** 17 | * @author Yugandhar Gangu 18 | * @created_at 2016/02/05 19 | */ 20 | public class LoginLogic extends AbstractLogic { 21 | 22 | /** 23 | * @param bean 24 | * @return 25 | */ 26 | public boolean isValidConnection(LoginBean bean) { 27 | ApiConnection apiConnection = null; 28 | HttpSession httpSession = RequestAdaptor.REQUEST_MAP.get(Thread.currentThread().getId()).getSession(); 29 | try { 30 | httpSession.setAttribute(Constants.SESSION_HOST, bean.getHostname()); 31 | httpSession.setAttribute(Constants.SESSION_PORT, bean.getPortnumber()); 32 | httpSession.setAttribute(Constants.SESSION_USER, bean.getUsername()); 33 | httpSession.setAttribute(Constants.SESSION_PASS, bean.getPassword()); 34 | apiConnection = super.getConnection(); 35 | if (apiConnection != null) { 36 | httpSession.setAttribute(Constants.SESSION, true); 37 | return true; 38 | } 39 | 40 | } catch (SQLException e) { 41 | RequestAdaptor.REQUEST_MAP.get(Thread.currentThread().getId()).setAttribute(Constants.MYSQL_ERROR, e.getMessage()); 42 | } finally { 43 | close(apiConnection); 44 | } 45 | return false; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/users/controllers/ServerUserController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.users.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.users.beans.UserListBean; 11 | import com.jspmyadmin.app.server.users.logic.UserLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.constants.Constants; 14 | import com.jspmyadmin.framework.exception.EncodingException; 15 | import com.jspmyadmin.framework.web.annotations.Detect; 16 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 17 | import com.jspmyadmin.framework.web.annotations.Model; 18 | import com.jspmyadmin.framework.web.annotations.WebController; 19 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/07/15 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/server_users.html", requestLevel = RequestLevel.SERVER) 30 | public class ServerUserController { 31 | 32 | @Detect 33 | private EncodeHelper encodeObj; 34 | @Detect 35 | private View view; 36 | @Model 37 | private UserListBean bean; 38 | 39 | @HandleGetOrPost 40 | private void users() throws JSONException, EncodingException { 41 | try { 42 | UserLogic userLogic = new UserLogic(); 43 | userLogic.setEncodeObj(encodeObj); 44 | userLogic.fillBean(bean); 45 | } catch (SQLException e) { 46 | bean.setError(Constants.ONE); 47 | } 48 | view.setType(ViewType.FORWARD); 49 | view.setPath(AppConstants.JSP_SERVER_USERS_USERS); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/common/controllers/LanguageController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.common.controllers; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpSession; 8 | 9 | import com.jspmyadmin.app.common.beans.LanguageBean; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/02/05 24 | * 25 | */ 26 | @WebController(authentication = false, path = "/language.html", requestLevel = RequestLevel.DEFAULT) 27 | public class LanguageController { 28 | 29 | @Detect 30 | private HttpServletRequest request; 31 | @Detect 32 | private View view; 33 | @Model 34 | private LanguageBean bean; 35 | 36 | @HandlePost 37 | @ValidateToken 38 | private void change() { 39 | if (bean.getLanguage() != null && !Constants.BLANK.equals(bean.getLanguage().trim())) { 40 | HttpSession httpSession = request.getSession(); 41 | httpSession.setAttribute(Constants.SESSION_LOCALE, bean.getLanguage()); 42 | } 43 | view.setType(ViewType.REDIRECT); 44 | if (bean.getRedirect() != null && !Constants.BLANK.equals(bean.getRedirect())) { 45 | view.setPath(bean.getRedirect()); 46 | } else { 47 | view.setPath(AppConstants.PATH_LOGIN); 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/users/beans/PrivilegeInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.users.beans; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @author Yugandhar Gangu 10 | * @created_at 2016/07/15 11 | * 12 | */ 13 | public class PrivilegeInfo implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String privilege = null; 18 | private String context = null; 19 | private String comment = null; 20 | private String value = null; 21 | 22 | /** 23 | * @return the privilege 24 | */ 25 | public String getPrivilege() { 26 | return privilege; 27 | } 28 | 29 | /** 30 | * @param privilege 31 | * the privilege to set 32 | */ 33 | public void setPrivilege(String privilege) { 34 | this.privilege = privilege; 35 | } 36 | 37 | /** 38 | * @return the context 39 | */ 40 | public String getContext() { 41 | return context; 42 | } 43 | 44 | /** 45 | * @param context 46 | * the context to set 47 | */ 48 | public void setContext(String context) { 49 | this.context = context; 50 | } 51 | 52 | /** 53 | * @return the comment 54 | */ 55 | public String getComment() { 56 | return comment; 57 | } 58 | 59 | /** 60 | * @param comment 61 | * the comment to set 62 | */ 63 | public void setComment(String comment) { 64 | this.comment = comment; 65 | } 66 | 67 | /** 68 | * @return the value 69 | */ 70 | public String getValue() { 71 | return value; 72 | } 73 | 74 | /** 75 | * @param value 76 | * the value to set 77 | */ 78 | public void setValue(String value) { 79 | this.value = value; 80 | } 81 | 82 | /** 83 | * @return the serialversionuid 84 | */ 85 | public static long getSerialversionuid() { 86 | return serialVersionUID; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/structure/controllers/StructureShowController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.structure.beans.ColumnListBean; 9 | import com.jspmyadmin.app.table.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.Messages; 17 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/22 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/table_structure.html", requestLevel = RequestLevel.TABLE) 28 | public class StructureShowController { 29 | 30 | @Detect 31 | private Messages messages; 32 | @Detect 33 | private RequestAdaptor requestAdaptor; 34 | @Detect 35 | private View view; 36 | @Model 37 | private ColumnListBean bean; 38 | 39 | @HandleGetOrPost 40 | private void structure() throws SQLException, EncodingException { 41 | StructureLogic structureLogic = new StructureLogic(bean.getRequest_table(), messages); 42 | structureLogic.fillStructureBean(bean); 43 | bean.setToken(requestAdaptor.generateToken()); 44 | view.setType(ViewType.FORWARD); 45 | view.setPath(AppConstants.JSP_TABLE_STRUCTURE_STRUCTURE); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/controllers/DropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.event.beans.EventListBean; 9 | import com.jspmyadmin.app.database.event.logic.EventLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/03/17 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_event_drop.html", requestLevel = RequestLevel.DATABASE) 28 | public class DropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private EventListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void dropEvent() { 40 | EventLogic eventLogic = null; 41 | try { 42 | eventLogic = new EventLogic(); 43 | eventLogic.dropEvent(bean); 44 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_EVENT_DROP_SUCCESS); 45 | } catch (SQLException e) { 46 | redirectParams.put(Constants.ERR, e.getMessage()); 47 | } 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_DATABASE_EVENTS); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/partition/controllers/PartitionAddController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.partition.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.partition.beans.PartinitionBean; 9 | import com.jspmyadmin.app.table.partition.logic.PartitionLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/07/11 26 | * 27 | */ 28 | @WebController(authentication = true, path = "/table_partition_add.html", requestLevel = RequestLevel.TABLE) 29 | public class PartitionAddController { 30 | 31 | @Detect 32 | private RedirectParams redirectParams; 33 | @Detect 34 | private View view; 35 | @Model 36 | private PartinitionBean bean; 37 | 38 | @HandlePost 39 | @ValidateToken 40 | private void addPrtition() { 41 | PartitionLogic partitionLogic = null; 42 | try { 43 | partitionLogic = new PartitionLogic(bean.getRequest_table()); 44 | partitionLogic.addPartition(bean); 45 | } catch (SQLException e) { 46 | redirectParams.put(Constants.ERR, e.getMessage()); 47 | } 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_TABLE_PARTITIONS); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/controllers/EnableController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.event.beans.EventListBean; 9 | import com.jspmyadmin.app.database.event.logic.EventLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/03/17 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_event_enable.html", requestLevel = RequestLevel.DATABASE) 28 | public class EnableController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private EventListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void enableEvent() { 40 | EventLogic eventLogic = null; 41 | try { 42 | eventLogic = new EventLogic(); 43 | eventLogic.enableEvent(bean); 44 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_EXECUTED_SUCCESSFULLY); 45 | } catch (SQLException e) { 46 | redirectParams.put(Constants.ERR, e.getMessage()); 47 | } 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_DATABASE_EVENTS); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/controllers/RenameController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.event.beans.EventListBean; 9 | import com.jspmyadmin.app.database.event.logic.EventLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/03/17 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_event_rename.html", requestLevel = RequestLevel.DATABASE) 28 | public class RenameController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private EventListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void renameEvent() { 40 | EventLogic eventLogic = null; 41 | try { 42 | eventLogic = new EventLogic(); 43 | eventLogic.renameEvent(bean); 44 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_EXECUTED_SUCCESSFULLY); 45 | } catch (SQLException e) { 46 | redirectParams.put(Constants.ERR, e.getMessage()); 47 | } 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_DATABASE_EVENTS); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/trigger/controllers/TriggerDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.trigger.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.trigger.beans.TriggerListBean; 9 | import com.jspmyadmin.app.database.trigger.logic.TriggerLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/03/30 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_trigger_drop.html", requestLevel = RequestLevel.DATABASE) 28 | public class TriggerDropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private TriggerListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void dropTrigger() { 40 | try { 41 | TriggerLogic triggerLogic = new TriggerLogic(); 42 | triggerLogic.drop(bean); 43 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_TRIGGER_DROP_SUCCESS); 44 | } catch (SQLException e) { 45 | redirectParams.put(Constants.ERR, e.getMessage()); 46 | } 47 | view.setType(ViewType.REDIRECT); 48 | view.setPath(AppConstants.PATH_DATABASE_TRIGGERS); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/controllers/DisableController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.event.beans.EventListBean; 9 | import com.jspmyadmin.app.database.event.logic.EventLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/03/17 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_event_disable.html", requestLevel = RequestLevel.DATABASE) 28 | public class DisableController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private EventListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void disableEvent() { 40 | EventLogic eventLogic = null; 41 | try { 42 | eventLogic = new EventLogic(); 43 | eventLogic.disableEvent(bean); 44 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_EXECUTED_SUCCESSFULLY); 45 | } catch (SQLException e) { 46 | redirectParams.put(Constants.ERR, e.getMessage()); 47 | } 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_DATABASE_EVENTS); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/common/controllers/ForeignKeyController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.common.beans.ForeignKeyBean; 9 | import com.jspmyadmin.app.table.common.logic.ForeignKeyLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/07/06 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/table_foreign_keys.html", requestLevel = RequestLevel.TABLE) 27 | public class ForeignKeyController { 28 | 29 | @Detect 30 | private RequestAdaptor requestAdaptor; 31 | @Detect 32 | private View view; 33 | @Model 34 | private ForeignKeyBean bean; 35 | 36 | @HandleGetOrPost 37 | private void foreignKeys() throws EncodingException { 38 | 39 | ForeignKeyLogic foreignKeyLogic = null; 40 | try { 41 | foreignKeyLogic = new ForeignKeyLogic(bean.getRequest_table()); 42 | foreignKeyLogic.fillBean(bean); 43 | bean.setToken(requestAdaptor.generateToken()); 44 | view.setType(ViewType.FORWARD); 45 | view.setPath(AppConstants.JSP_TABLE_COMMON_FOREIGNKEY); 46 | } catch (SQLException e) { 47 | view.setType(ViewType.REDIRECT); 48 | view.setPath(AppConstants.PATH_HOME); 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/partition/controllers/PartitionController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.partition.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.partition.beans.PartinitionBean; 9 | import com.jspmyadmin.app.table.partition.logic.PartitionLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/07/11 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/table_partitions.html", requestLevel = RequestLevel.TABLE) 28 | public class PartitionController { 29 | 30 | @Detect 31 | private RequestAdaptor requestAdaptor; 32 | @Detect 33 | private View view; 34 | @Model 35 | private PartinitionBean bean; 36 | 37 | @HandleGetOrPost 38 | private void partitions() throws EncodingException { 39 | 40 | PartitionLogic partitionLogic = null; 41 | try { 42 | partitionLogic = new PartitionLogic(bean.getRequest_table()); 43 | partitionLogic.fillBean(bean); 44 | bean.setToken(requestAdaptor.generateToken()); 45 | view.setType(ViewType.FORWARD); 46 | view.setPath(AppConstants.JSP_TABLE_COMMON_PARTITIONS); 47 | } catch (SQLException e) { 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_HOME); 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/CopyController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 9 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/16 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_structure_copy.html", requestLevel = RequestLevel.DATABASE) 28 | public class CopyController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private StructureBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void copyTables() { 40 | 41 | StructureLogic structureLogic = null; 42 | try { 43 | structureLogic = new StructureLogic(); 44 | structureLogic.copyTables(bean); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_COPY_DONE); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(AppConstants.PATH_DATABASE_STRUCTURE); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/database/controllers/DatabaseDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.database.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.server.database.beans.DatabaseListBean; 9 | import com.jspmyadmin.app.server.database.logic.DatabaseLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/10 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/server_database_drop.html", requestLevel = RequestLevel.SERVER) 28 | public class DatabaseDropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private DatabaseListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void dropDatabase() { 40 | 41 | DatabaseLogic databaseLogic = null; 42 | try { 43 | databaseLogic = new DatabaseLogic(); 44 | databaseLogic.dropDatabase(bean); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_DROP_DB_SUCCESS); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(AppConstants.PATH_SERVER_DATABASES); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/common/controllers/AddFKController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.common.beans.ForeignKeyBean; 9 | import com.jspmyadmin.app.table.common.logic.ForeignKeyLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/07/05 26 | * 27 | */ 28 | @WebController(authentication = true, path = "/table_fk_add.html", requestLevel = RequestLevel.TABLE) 29 | public class AddFKController { 30 | 31 | @Detect 32 | private RedirectParams redirectParams; 33 | @Detect 34 | private View view; 35 | @Model 36 | private ForeignKeyBean bean; 37 | 38 | @HandlePost 39 | @ValidateToken 40 | private void addFK() { 41 | 42 | ForeignKeyLogic foreignKeyLogic = null; 43 | try { 44 | foreignKeyLogic = new ForeignKeyLogic(bean.getRequest_table()); 45 | foreignKeyLogic.addForeignKey(bean); 46 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_FK_ADD_SUCCESS); 47 | } catch (SQLException e) { 48 | redirectParams.put(Constants.ERR, e.getMessage()); 49 | } 50 | view.setType(ViewType.REDIRECT); 51 | view.setPath(AppConstants.PATH_TABLE_FOREIGN_KEYS); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/TableDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 9 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/16 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_structure_drop.html", requestLevel = RequestLevel.DATABASE) 28 | public class TableDropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private StructureBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void dropTables() { 40 | 41 | StructureLogic structureLogic = null; 42 | try { 43 | structureLogic = new StructureLogic(); 44 | structureLogic.dropTables(bean, true); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_TABLES_DROPPED_SUCCESSFULLY); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(bean.getAction()); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/ViewDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 9 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/16 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_structure_drop_view.html", requestLevel = RequestLevel.DATABASE) 28 | public class ViewDropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private StructureBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void dropViews() { 40 | 41 | StructureLogic structureLogic = null; 42 | try { 43 | structureLogic = new StructureLogic(); 44 | structureLogic.dropTables(bean, false); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_VIEW_DROPPED_SUCCESSFULLY); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(bean.getAction()); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/database/controllers/DatabaseListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.database.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.database.beans.DatabaseListBean; 11 | import com.jspmyadmin.app.server.database.logic.DatabaseLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/02/09 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/server_databases.html", requestLevel = RequestLevel.SERVER) 30 | public class DatabaseListController { 31 | 32 | @Detect 33 | private EncodeHelper encodeObj; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private DatabaseListBean bean; 40 | 41 | @HandleGetOrPost 42 | private void databases() throws SQLException, JSONException, EncodingException { 43 | DatabaseLogic databaseLogic = new DatabaseLogic(); 44 | databaseLogic.setEncodeObj(encodeObj); 45 | databaseLogic.fillBean(bean); 46 | bean.setToken(requestAdaptor.generateToken()); 47 | view.setType(ViewType.FORWARD); 48 | view.setPath(AppConstants.JSP_SERVER_DATABASE_DATABASELIST); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/common/controllers/DropFKController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.common.beans.ForeignKeyBean; 9 | import com.jspmyadmin.app.table.common.logic.ForeignKeyLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/07/05 26 | * 27 | */ 28 | @WebController(authentication = true, path = "/table_fk_drop.html", requestLevel = RequestLevel.TABLE) 29 | public class DropFKController { 30 | 31 | @Detect 32 | private RedirectParams redirectParams; 33 | @Detect 34 | private View view; 35 | @Model 36 | private ForeignKeyBean bean; 37 | 38 | @HandlePost 39 | @ValidateToken 40 | private void dropFK() { 41 | 42 | ForeignKeyLogic foreignKeyLogic = null; 43 | try { 44 | foreignKeyLogic = new ForeignKeyLogic(bean.getRequest_table()); 45 | foreignKeyLogic.dropForeignKeys(bean); 46 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_DROP_FK_SUCCESS); 47 | } catch (SQLException e) { 48 | redirectParams.put(Constants.ERR, e.getMessage()); 49 | } 50 | view.setType(ViewType.REDIRECT); 51 | view.setPath(AppConstants.PATH_TABLE_FOREIGN_KEYS); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/database/controllers/DatabaseCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.database.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.server.database.beans.DatabaseListBean; 9 | import com.jspmyadmin.app.server.database.logic.DatabaseLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/10 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/server_database_create.html", requestLevel = RequestLevel.SERVER) 28 | public class DatabaseCreateController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private DatabaseListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void createDatabase() { 40 | 41 | DatabaseLogic databaseLogic = null; 42 | try { 43 | databaseLogic = new DatabaseLogic(); 44 | databaseLogic.createDatabase(bean); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_CREATE_DB_SUCCESS); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(AppConstants.PATH_SERVER_DATABASES); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/WEB-INF/views/common/Error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="m" uri="http://jspmyadmin.com/taglib/jsp/messages"%> 4 | <%@ taglib prefix="jma" uri="http://jspmyadmin.com/taglib/jsp/jma"%> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 18 | 20 | <m:print key="title" /> 21 | 23 | 28 | 30 | 31 | 32 |
33 |
34 | 36 |
37 |
38 |
39 | MySql Error: 40 | ${requestScope.mysql_error} 41 |
42 |

43 | 44 | 45 | 47 | 48 | 49 |

50 | 51 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/FunctionDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.routine.beans.RoutineListBean; 9 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/16 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_function_drop.html", requestLevel = RequestLevel.DATABASE) 28 | public class FunctionDropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private RoutineListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void functionDrop() { 40 | 41 | RoutineLogic routineLogic = null; 42 | try { 43 | routineLogic = new RoutineLogic(); 44 | routineLogic.dropRoutines(bean, false); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_FUNCTION_DROP_SUCCESS); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(AppConstants.PATH_DATABASE_FUNCTIONS); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/ViewListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 11 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/02/15 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/database_view_list.html", requestLevel = RequestLevel.DATABASE) 30 | public class ViewListController { 31 | 32 | @Detect 33 | private EncodeHelper encodeObj; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private StructureBean bean; 40 | 41 | @HandleGetOrPost 42 | private void views() throws SQLException, JSONException, EncodingException { 43 | 44 | StructureLogic structureLogic = new StructureLogic(); 45 | structureLogic.setEncodeObj(encodeObj); 46 | structureLogic.fillBean(bean, false); 47 | bean.setToken(requestAdaptor.generateToken()); 48 | view.setType(ViewType.FORWARD); 49 | view.setPath(AppConstants.JSP_DATABASE_STRUCTURE_VIEWS); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/ProcedureDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.routine.beans.RoutineListBean; 9 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/16 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_procedure_drop.html", requestLevel = RequestLevel.DATABASE) 28 | public class ProcedureDropController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private RoutineListBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void dropProcedure() { 40 | 41 | RoutineLogic routineLogic = null; 42 | try { 43 | routineLogic = new RoutineLogic(); 44 | routineLogic.dropRoutines(bean, true); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_PROCEDURE_DROP_SUCCESS); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(AppConstants.PATH_DATABASE_PROCEDURES); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/TableListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 11 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/02/15 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/database_structure.html", requestLevel = RequestLevel.DATABASE) 30 | public class TableListController { 31 | 32 | @Detect 33 | private EncodeHelper encodeObj; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private StructureBean bean; 40 | 41 | @HandleGetOrPost 42 | private void tables() throws SQLException, JSONException, EncodingException { 43 | 44 | StructureLogic structureLogic = new StructureLogic(); 45 | structureLogic.setEncodeObj(encodeObj); 46 | structureLogic.fillBean(bean, true); 47 | bean.setToken(requestAdaptor.generateToken()); 48 | view.setType(ViewType.FORWARD); 49 | view.setPath(AppConstants.JSP_DATABASE_STRUCTURE_TABLES); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/TruncateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 9 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/16 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_structure_truncate.html", requestLevel = RequestLevel.DATABASE) 28 | public class TruncateController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private StructureBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void truncate() { 40 | 41 | StructureLogic structureLogic = null; 42 | try { 43 | structureLogic = new StructureLogic(); 44 | structureLogic.truncateTables(bean); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_TABLES_TRUNCATE_SUCCESSFULLY); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(AppConstants.PATH_DATABASE_STRUCTURE); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/beans/EventListBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.beans; 5 | 6 | import java.util.List; 7 | 8 | import com.jspmyadmin.framework.web.utils.Bean; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/03/16 13 | * 14 | */ 15 | public class EventListBean extends Bean { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private List event_list = null; 20 | private String total = null; 21 | private String[] events = null; 22 | private String new_event = null; 23 | 24 | /** 25 | * @return the event_list 26 | */ 27 | public List getEvent_list() { 28 | return event_list; 29 | } 30 | 31 | /** 32 | * @param event_list 33 | * the event_list to set 34 | */ 35 | public void setEvent_list(List event_list) { 36 | this.event_list = event_list; 37 | } 38 | 39 | /** 40 | * @return the total 41 | */ 42 | public String getTotal() { 43 | return total; 44 | } 45 | 46 | /** 47 | * @param total 48 | * the total to set 49 | */ 50 | public void setTotal(String total) { 51 | this.total = total; 52 | } 53 | 54 | /** 55 | * @return the events 56 | */ 57 | public String[] getEvents() { 58 | return events; 59 | } 60 | 61 | /** 62 | * @param events 63 | * the events to set 64 | */ 65 | public void setEvents(String[] events) { 66 | this.events = events; 67 | } 68 | 69 | /** 70 | * @return the new_event 71 | */ 72 | public String getNew_event() { 73 | return new_event; 74 | } 75 | 76 | /** 77 | * @param new_event 78 | * the new_event to set 79 | */ 80 | public void setNew_event(String new_event) { 81 | this.new_event = new_event; 82 | } 83 | 84 | /** 85 | * @return the serialversionuid 86 | */ 87 | public static long getSerialversionuid() { 88 | return serialVersionUID; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/DuplicateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 9 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RedirectParams; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/02/16 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/database_structure_duplicate.html", requestLevel = RequestLevel.DATABASE) 28 | public class DuplicateController { 29 | 30 | @Detect 31 | private RedirectParams redirectParams; 32 | @Detect 33 | private View view; 34 | @Model 35 | private StructureBean bean; 36 | 37 | @HandlePost 38 | @ValidateToken 39 | private void duplidateTables() { 40 | 41 | StructureLogic structureLogic = null; 42 | try { 43 | structureLogic = new StructureLogic(); 44 | structureLogic.duplicateTable(bean); 45 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_DUPLICATE_TABLE_SUCCESSFULLY); 46 | } catch (SQLException e) { 47 | redirectParams.put(Constants.ERR, e.getMessage()); 48 | } 49 | view.setType(ViewType.REDIRECT); 50 | view.setPath(AppConstants.PATH_DATABASE_STRUCTURE); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/logic/EncodeHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.logic; 5 | 6 | import java.io.IOException; 7 | import java.io.UnsupportedEncodingException; 8 | 9 | import javax.servlet.http.HttpSession; 10 | 11 | import org.apache.commons.codec.EncoderException; 12 | 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | 15 | /** 16 | * @author Yugandhar Gangu 17 | * @created_at 2016/01/29 18 | * 19 | */ 20 | public interface EncodeHelper { 21 | 22 | /** 23 | * 24 | * @param data 25 | * @return 26 | * @throws EncodingException 27 | */ 28 | public String encrypt(String data) throws EncodingException; 29 | 30 | /** 31 | * 32 | * @param encryptedData 33 | * @return 34 | * @throws EncodingException 35 | */ 36 | public String decrypt(String encryptedData) throws EncodingException; 37 | 38 | /** 39 | * 40 | * @return 41 | * @throws Exception 42 | */ 43 | public String generateToken(); 44 | 45 | /** 46 | * 47 | * @param session 48 | * @throws EncoderException 49 | */ 50 | public void generateKey(HttpSession session); 51 | 52 | /** 53 | * 54 | * @param data 55 | * @return 56 | * @throws EncodingException 57 | * @throws Exception 58 | */ 59 | public String encode(String data) throws EncodingException; 60 | 61 | /** 62 | * 63 | * @param data 64 | * @return 65 | * @throws EncodingException 66 | * @throws Exception 67 | */ 68 | public String decode(String data) throws EncodingException; 69 | 70 | /** 71 | * 72 | * @param data 73 | * @return 74 | * @throws IOException 75 | */ 76 | public String encodeInstall(String data) throws IOException; 77 | 78 | /** 79 | * 80 | * @param data 81 | * @return 82 | * @throws EncodingException 83 | * @throws UnsupportedEncodingException 84 | */ 85 | public String decodeInstall(String data) throws EncodingException, UnsupportedEncodingException; 86 | } 87 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/controllers/CreateEventController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.controllers; 5 | 6 | import com.jspmyadmin.app.database.event.beans.EventBean; 7 | import com.jspmyadmin.app.database.event.logic.EventLogic; 8 | import com.jspmyadmin.framework.constants.AppConstants; 9 | import com.jspmyadmin.framework.exception.EncodingException; 10 | import com.jspmyadmin.framework.web.annotations.Detect; 11 | import com.jspmyadmin.framework.web.annotations.HandlePost; 12 | import com.jspmyadmin.framework.web.annotations.Model; 13 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 14 | import com.jspmyadmin.framework.web.annotations.WebController; 15 | import com.jspmyadmin.framework.web.utils.Messages; 16 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/03/17 24 | * 25 | */ 26 | @WebController(authentication = true, path = "/database_event_create.html", requestLevel = RequestLevel.DATABASE) 27 | public class CreateEventController { 28 | 29 | @Detect 30 | private Messages messages; 31 | @Detect 32 | private RequestAdaptor requestAdaptor; 33 | @Detect 34 | private View view; 35 | @Model 36 | private EventBean bean; 37 | 38 | @HandlePost 39 | @ValidateToken 40 | private void createEvent() throws EncodingException { 41 | 42 | EventLogic eventLogic = new EventLogic(); 43 | eventLogic.setMessages(messages); 44 | bean.setStart_interval(eventLogic.getStartInterval(bean.getInterval_list())); 45 | bean.setEnd_interval(eventLogic.getEndInterval(bean.getInterval_list())); 46 | bean.setToken(requestAdaptor.generateToken()); 47 | view.setType(ViewType.FORWARD); 48 | view.setPath(AppConstants.JSP_DATABASE_EVENT_CREATEEVENT); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/taglib/jma/VarTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.taglib.jma; 5 | 6 | import javax.servlet.jsp.JspException; 7 | import javax.servlet.jsp.PageContext; 8 | 9 | import com.jspmyadmin.framework.constants.Constants; 10 | import com.jspmyadmin.framework.taglib.support.AbstractSimpleTagSupport; 11 | 12 | /** 13 | * @author Yugandhar Gangu 14 | * @created_at 2016/01/28 15 | * 16 | */ 17 | public class VarTag extends AbstractSimpleTagSupport { 18 | 19 | private String name = null; 20 | private String value = null; 21 | private String scope = null; 22 | 23 | /** 24 | * @param name 25 | * the name to set 26 | */ 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | /** 32 | * @param value 33 | * the value to set 34 | */ 35 | public void setValue(String value) { 36 | this.value = value; 37 | } 38 | 39 | /** 40 | * @param scope 41 | * the scope to set 42 | */ 43 | public void setScope(String scope) { 44 | this.scope = scope; 45 | } 46 | 47 | @Override 48 | public void doTag() throws JspException { 49 | PageContext pageContext = (PageContext) super.getJspContext(); 50 | if (value.startsWith(Constants.SYMBOL_HASH)) { 51 | Object temp = null; 52 | if (scope == null || Constants.PAGE.equals(scope)) { 53 | temp = pageContext.getAttribute(new String(value.substring(1))); 54 | } else if (Constants.COMMAND.equals(scope)) { 55 | temp = pageContext.getRequest().getAttribute(Constants.COMMAND); 56 | temp = super.getReflectValue(temp, new String(value.substring(1))); 57 | } else if (Constants.REQUEST.equals(scope)) { 58 | temp = pageContext.getRequest().getAttribute(new String(value.substring(1))); 59 | } 60 | if (temp != null) { 61 | pageContext.setAttribute(name, temp, PageContext.PAGE_SCOPE); 62 | } 63 | } else { 64 | pageContext.setAttribute(name, value, PageContext.PAGE_SCOPE); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/common/controllers/LoginController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.common.controllers; 5 | 6 | import com.jspmyadmin.app.common.beans.LoginBean; 7 | import com.jspmyadmin.app.common.logic.LoginLogic; 8 | import com.jspmyadmin.framework.constants.AppConstants; 9 | import com.jspmyadmin.framework.exception.EncodingException; 10 | import com.jspmyadmin.framework.web.annotations.Detect; 11 | import com.jspmyadmin.framework.web.annotations.HandleGet; 12 | import com.jspmyadmin.framework.web.annotations.HandlePost; 13 | import com.jspmyadmin.framework.web.annotations.Model; 14 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 17 | import com.jspmyadmin.framework.web.utils.RequestLevel; 18 | import com.jspmyadmin.framework.web.utils.View; 19 | import com.jspmyadmin.framework.web.utils.ViewType; 20 | 21 | /** 22 | * @author Yugandhar Gangu 23 | * @created_at 2016/02/05 24 | * 25 | */ 26 | @WebController(authentication = false, path = "/login.html", requestLevel = RequestLevel.DEFAULT) 27 | public class LoginController { 28 | 29 | @Detect 30 | private RequestAdaptor requestAdaptor; 31 | @Detect 32 | private View view; 33 | @Model 34 | private LoginBean bean; 35 | 36 | @HandleGet 37 | private void load() throws EncodingException { 38 | bean.setToken(requestAdaptor.generateToken()); 39 | view.setType(ViewType.FORWARD); 40 | view.setPath(AppConstants.JSP_COMMON_LOGIN); 41 | } 42 | 43 | @HandlePost 44 | @ValidateToken 45 | private void check() { 46 | LoginLogic loginLogic = new LoginLogic(); 47 | if (loginLogic.isValidConnection(bean)) { 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_HOME); 50 | } else { 51 | view.setType(ViewType.FORWARD); 52 | bean.setErr_key(AppConstants.ERR_INVALID_SETTINGS); 53 | view.setPath(AppConstants.JSP_COMMON_LOGIN); 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/UtilsController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONObject; 11 | 12 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 13 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 14 | import com.jspmyadmin.framework.constants.Constants; 15 | import com.jspmyadmin.framework.web.annotations.Detect; 16 | import com.jspmyadmin.framework.web.annotations.HandlePost; 17 | import com.jspmyadmin.framework.web.annotations.Model; 18 | import com.jspmyadmin.framework.web.annotations.Rest; 19 | import com.jspmyadmin.framework.web.annotations.WebController; 20 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 21 | import com.jspmyadmin.framework.web.utils.RequestLevel; 22 | 23 | /** 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/02/23 26 | * 27 | */ 28 | @WebController(authentication = true, path = "/database_structure_utils.text", requestLevel = RequestLevel.DEFAULT) 29 | @Rest 30 | public class UtilsController { 31 | 32 | @Detect 33 | private RequestAdaptor requestAdaptor; 34 | @Detect 35 | private HttpServletResponse response; 36 | @Model 37 | private StructureBean bean; 38 | 39 | @HandlePost 40 | private JSONObject getColumnCreate() throws Exception { 41 | StructureLogic structureLogic = null; 42 | JSONObject jsonObject = new JSONObject(); 43 | try { 44 | structureLogic = new StructureLogic(); 45 | if (Constants.COLUMN.equalsIgnoreCase(bean.getType())) { 46 | String result = structureLogic.getNewColumn(bean); 47 | jsonObject.put(Constants.ERR, Constants.BLANK); 48 | jsonObject.put(Constants.DATA, result); 49 | } 50 | } catch (SQLException e) { 51 | jsonObject.put(Constants.ERR, e.getMessage()); 52 | } 53 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 54 | return jsonObject; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/view/data/controllers/ViewDataController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.view.data.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.view.data.beans.DataSelectBean; 11 | import com.jspmyadmin.app.view.data.logic.DataSelectLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/02/22 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/view_data.html", requestLevel = RequestLevel.VIEW) 30 | public class ViewDataController { 31 | 32 | @Detect 33 | private EncodeHelper encodeObj; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private DataSelectBean bean; 40 | 41 | @HandleGetOrPost 42 | private void data() throws JSONException, EncodingException { 43 | 44 | DataSelectLogic dataSelectLogic = null; 45 | try { 46 | dataSelectLogic = new DataSelectLogic(bean.getRequest_view()); 47 | dataSelectLogic.setEncodeObj(encodeObj); 48 | dataSelectLogic.fillBean(bean); 49 | bean.setToken(requestAdaptor.generateToken()); 50 | view.setType(ViewType.FORWARD); 51 | view.setPath(AppConstants.JSP_VIEW_DATA_DATA); 52 | } catch (SQLException e) { 53 | view.setType(ViewType.REDIRECT); 54 | view.setPath(AppConstants.PATH_HOME); 55 | } 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/common/controllers/MaintenanceController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.common.beans.MaintenanceBean; 9 | import com.jspmyadmin.app.table.common.logic.MaintenanceLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGet; 14 | import com.jspmyadmin.framework.web.annotations.HandlePost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/07/06 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/table_maintenance.html", requestLevel = RequestLevel.TABLE) 28 | public class MaintenanceController { 29 | 30 | @Detect 31 | private RequestAdaptor requestAdaptor; 32 | @Detect 33 | private View view; 34 | @Model 35 | private MaintenanceBean bean; 36 | 37 | @HandleGet 38 | private void loadMaintenance() throws EncodingException { 39 | 40 | bean.setToken(requestAdaptor.generateToken()); 41 | view.setType(ViewType.FORWARD); 42 | view.setPath(AppConstants.JSP_TABLE_COMMON_MAINTENANCE); 43 | } 44 | 45 | @HandlePost 46 | private void saveMaintenance() { 47 | MaintenanceLogic maintenanceLogic = null; 48 | try { 49 | maintenanceLogic = new MaintenanceLogic(bean.getRequest_table()); 50 | maintenanceLogic.fillBean(bean); 51 | view.setType(ViewType.FORWARD); 52 | view.setPath(AppConstants.JSP_TABLE_COMMON_MAINTENANCE); 53 | } catch (SQLException e) { 54 | view.handleDefault(); 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/insert/controllers/InsertUpdateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.insert.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.insert.beans.InsertUpdateBean; 9 | import com.jspmyadmin.app.table.insert.logic.InsertUpdateLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.exception.EncodingException; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.WebController; 16 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 17 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 18 | import com.jspmyadmin.framework.web.utils.RequestLevel; 19 | import com.jspmyadmin.framework.web.utils.View; 20 | import com.jspmyadmin.framework.web.utils.ViewType; 21 | 22 | /** 23 | * @author Yugandhar Gangu 24 | * @created_at 2016/07/11 25 | * 26 | */ 27 | @WebController(authentication = true, path = "/table_insert_update.html", requestLevel = RequestLevel.TABLE) 28 | public class InsertUpdateController { 29 | 30 | @Detect 31 | private EncodeHelper encodeObj; 32 | @Detect 33 | private RequestAdaptor requestAdaptor; 34 | @Detect 35 | private View view; 36 | @Model 37 | private InsertUpdateBean bean; 38 | 39 | @HandleGetOrPost 40 | private void insertUpdate() throws EncodingException { 41 | InsertUpdateLogic insertUpdateLogic = null; 42 | try { 43 | insertUpdateLogic = new InsertUpdateLogic(bean.getRequest_table()); 44 | insertUpdateLogic.setEncodeObj(encodeObj); 45 | insertUpdateLogic.fillBean(bean); 46 | bean.setToken(requestAdaptor.generateToken()); 47 | view.setType(ViewType.FORWARD); 48 | view.setPath(AppConstants.JSP_TABLE_INSERT_INSERTUPDATE); 49 | } catch (SQLException e) { 50 | view.setType(ViewType.REDIRECT); 51 | view.setPath(AppConstants.PATH_HOME); 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/structure/controllers/DropColumnsController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.table.structure.beans.ColumnListBean; 9 | import com.jspmyadmin.app.table.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.web.annotations.Detect; 13 | import com.jspmyadmin.framework.web.annotations.HandlePost; 14 | import com.jspmyadmin.framework.web.annotations.Model; 15 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 16 | import com.jspmyadmin.framework.web.annotations.WebController; 17 | import com.jspmyadmin.framework.web.utils.Messages; 18 | import com.jspmyadmin.framework.web.utils.RedirectParams; 19 | import com.jspmyadmin.framework.web.utils.RequestLevel; 20 | import com.jspmyadmin.framework.web.utils.View; 21 | import com.jspmyadmin.framework.web.utils.ViewType; 22 | 23 | /** 24 | * 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/07/05 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/table_column_drop.html", requestLevel = RequestLevel.TABLE) 30 | public class DropColumnsController { 31 | 32 | @Detect 33 | private Messages messages; 34 | @Detect 35 | private RedirectParams redirectParams; 36 | @Detect 37 | private View view; 38 | @Model 39 | private ColumnListBean bean; 40 | 41 | @HandlePost 42 | @ValidateToken 43 | private void dropColumns() { 44 | 45 | StructureLogic structureLogic = null; 46 | try { 47 | structureLogic = new StructureLogic(bean.getRequest_table(), messages); 48 | structureLogic.dropColums(bean); 49 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_COLUMN_DROPPED_SUCCESSFULLY); 50 | } catch (SQLException e) { 51 | redirectParams.put(Constants.ERR, e.getMessage()); 52 | } 53 | view.setType(ViewType.REDIRECT); 54 | view.setPath(AppConstants.PATH_TABLE_STRUCTURE); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/WEB-INF/views/view/Header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="m" uri="http://jspmyadmin.com/taglib/jsp/messages"%> 4 | <%@ taglib prefix="jma" uri="http://jspmyadmin.com/taglib/jsp/jma"%> 5 | 6 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/web/utils/RequestAdaptorAbstract.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.web.utils; 5 | 6 | import javax.servlet.http.HttpSession; 7 | 8 | import org.json.JSONObject; 9 | 10 | import com.jspmyadmin.framework.exception.EncodingException; 11 | 12 | /** 13 | * @author Yugandhar Gangu 14 | * @created_at 2016/08/30 15 | * 16 | */ 17 | abstract class RequestAdaptorAbstract implements RequestAdaptor { 18 | 19 | /** 20 | * @param session 21 | * the session to set 22 | */ 23 | abstract void setSession(HttpSession session); 24 | 25 | /** 26 | * @param redirectParams 27 | * the redirectParams to set 28 | */ 29 | abstract void setRedirectParams(RedirectParams redirectParams); 30 | 31 | /** 32 | * @param jsonToken 33 | * the jsonToken to set 34 | */ 35 | abstract void setJsonToken(JSONObject jsonToken); 36 | 37 | /** 38 | * 39 | * @param bean 40 | * @param request 41 | * @param encDecLogic 42 | */ 43 | abstract void fillRequestBean(Bean bean, RequestLevel requestLevel); 44 | 45 | /** 46 | * 47 | * @param bean 48 | * @param encDecLogic 49 | */ 50 | abstract void fillRequestToken(Bean bean); 51 | 52 | /** 53 | * 54 | * @param bean 55 | * @param encDecLogic 56 | * @return 57 | */ 58 | abstract String createRequestToken(Bean bean); 59 | 60 | /** 61 | * 62 | * @param bean 63 | * @param token 64 | * @param encDecLogic 65 | */ 66 | abstract String createRequestToken(Bean bean, String token); 67 | 68 | /** 69 | * 70 | * @param token 71 | * @return 72 | */ 73 | abstract boolean isValidToken(String token); 74 | 75 | /** 76 | * 77 | * @param bean 78 | */ 79 | abstract void fillBasics(Bean bean); 80 | 81 | /** 82 | * 83 | * @param bean 84 | * @param requestLevel 85 | */ 86 | abstract boolean canProceed(Bean bean, RequestLevel requestLevel); 87 | 88 | /** 89 | * 90 | * @return 91 | * @throws EncodingException 92 | */ 93 | public abstract String generateToken() throws EncodingException; 94 | 95 | } 96 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/users/beans/GlobalPrivilegeBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.users.beans; 5 | 6 | import java.util.List; 7 | 8 | import com.jspmyadmin.framework.web.utils.Bean; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/07/15 13 | * 14 | */ 15 | public class GlobalPrivilegeBean extends Bean { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private String revoke_all = null; 20 | private String[] privileges = null; 21 | 22 | private String user = null; 23 | private List privilege_info_list = null; 24 | 25 | /** 26 | * @return the revoke_all 27 | */ 28 | public String getRevoke_all() { 29 | return revoke_all; 30 | } 31 | 32 | /** 33 | * @param revoke_all 34 | * the revoke_all to set 35 | */ 36 | public void setRevoke_all(String revoke_all) { 37 | this.revoke_all = revoke_all; 38 | } 39 | 40 | /** 41 | * @return the privileges 42 | */ 43 | public String[] getPrivileges() { 44 | return privileges; 45 | } 46 | 47 | /** 48 | * @param privileges 49 | * the privileges to set 50 | */ 51 | public void setPrivileges(String[] privileges) { 52 | this.privileges = privileges; 53 | } 54 | 55 | /** 56 | * @return the user 57 | */ 58 | public String getUser() { 59 | return user; 60 | } 61 | 62 | /** 63 | * @param user 64 | * the user to set 65 | */ 66 | public void setUser(String user) { 67 | this.user = user; 68 | } 69 | 70 | /** 71 | * @return the privilege_info_list 72 | */ 73 | public List getPrivilege_info_list() { 74 | return privilege_info_list; 75 | } 76 | 77 | /** 78 | * @param privilege_info_list 79 | * the privilege_info_list to set 80 | */ 81 | public void setPrivilege_info_list(List privilege_info_list) { 82 | this.privilege_info_list = privilege_info_list; 83 | } 84 | 85 | /** 86 | * @return the serialversionuid 87 | */ 88 | public static long getSerialversionuid() { 89 | return serialVersionUID; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/data/controllers/TableDataController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.data.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.table.data.beans.DataSelectBean; 11 | import com.jspmyadmin.app.table.data.logic.DataSelectLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.exception.EncodingException; 14 | import com.jspmyadmin.framework.web.annotations.Detect; 15 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 16 | import com.jspmyadmin.framework.web.annotations.Model; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/02/22 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/table_data.html", requestLevel = RequestLevel.TABLE) 30 | public class TableDataController { 31 | 32 | @Detect 33 | private EncodeHelper encodeObj; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private DataSelectBean bean; 40 | 41 | @HandleGetOrPost 42 | private void tableData() throws JSONException, EncodingException { 43 | 44 | DataSelectLogic dataSelectLogic = null; 45 | try { 46 | bean.setEncodeObj(encodeObj); 47 | dataSelectLogic = new DataSelectLogic(bean.getRequest_table()); 48 | dataSelectLogic.setEncodeObj(encodeObj); 49 | dataSelectLogic.fillBean(bean); 50 | bean.setToken(requestAdaptor.generateToken()); 51 | view.setType(ViewType.FORWARD); 52 | view.setPath(AppConstants.JSP_TABLE_DATA_DATA); 53 | } catch (SQLException e) { 54 | view.setType(ViewType.REDIRECT); 55 | view.setPath(AppConstants.PATH_HOME); 56 | } 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/taglib/messages/PrintTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.taglib.messages; 5 | 6 | import java.io.IOException; 7 | 8 | import javax.servlet.jsp.JspException; 9 | import javax.servlet.jsp.JspWriter; 10 | import javax.servlet.jsp.PageContext; 11 | 12 | import com.jspmyadmin.framework.constants.Constants; 13 | import com.jspmyadmin.framework.taglib.support.AbstractSimpleTagSupport; 14 | import com.jspmyadmin.framework.web.utils.MessageReader; 15 | 16 | /** 17 | * 18 | * @author Yugandhar Gangu 19 | * @created_at 2016/01/27 20 | * 21 | */ 22 | public class PrintTag extends AbstractSimpleTagSupport { 23 | 24 | private String key = null; 25 | private String scope = null; 26 | 27 | /** 28 | * @param key 29 | * the key to set 30 | */ 31 | public void setKey(String key) { 32 | this.key = key; 33 | } 34 | 35 | /** 36 | * @param scope 37 | * the scope to set 38 | */ 39 | public void setScope(String scope) { 40 | this.scope = scope; 41 | } 42 | 43 | @Override 44 | public void doTag() throws JspException, IOException { 45 | 46 | PageContext pageContext = (PageContext) super.getJspContext(); 47 | MessageReader messageReader = (MessageReader) pageContext 48 | .getAttribute(Constants.PAGE_CONTEXT_MESSAGES); 49 | Object temp = null; 50 | if (scope == null) { 51 | key = messageReader.getMessage(key); 52 | JspWriter jspWriter = pageContext.getOut(); 53 | jspWriter.write(key); 54 | return; 55 | } else if (Constants.COMMAND.equals(scope)) { 56 | temp = pageContext.getRequest().getAttribute( 57 | Constants.COMMAND); 58 | temp = super.getReflectValue(temp, key); 59 | } else if (Constants.PAGE.equals(scope)) { 60 | temp = pageContext.getAttribute(key); 61 | } else if (Constants.REQUEST.equals(scope)) { 62 | temp = pageContext.getRequest().getAttribute(key); 63 | } 64 | if (temp != null) { 65 | key = messageReader.getMessage(temp.toString()); 66 | if (key != null) { 67 | JspWriter jspWriter = pageContext.getOut(); 68 | jspWriter.write(key); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/event/controllers/ShowCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.event.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.database.event.beans.EventListBean; 14 | import com.jspmyadmin.app.database.event.logic.EventLogic; 15 | import com.jspmyadmin.framework.constants.Constants; 16 | import com.jspmyadmin.framework.exception.EncodingException; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandlePost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.Rest; 21 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 24 | import com.jspmyadmin.framework.web.utils.RequestLevel; 25 | 26 | /** 27 | * @author Yugandhar Gangu 28 | * @created_at 2016/03/18 29 | * 30 | */ 31 | @WebController(authentication = true, path = "/database_event_show_create.text", requestLevel = RequestLevel.DATABASE) 32 | @Rest 33 | public class ShowCreateController { 34 | 35 | @Detect 36 | private RequestAdaptor requestAdaptor; 37 | @Detect 38 | private HttpServletResponse response; 39 | @Model 40 | private EventListBean bean; 41 | 42 | @HandlePost 43 | @ValidateToken 44 | private JSONObject showCreateEvent() throws JSONException, EncodingException { 45 | JSONObject jsonObject = new JSONObject(); 46 | EventLogic eventLogic = null; 47 | try { 48 | eventLogic = new EventLogic(); 49 | String result = eventLogic.getShowCreate(bean); 50 | jsonObject.put(Constants.ERR, Constants.BLANK); 51 | jsonObject.put(Constants.DATA, result); 52 | } catch (SQLException e) { 53 | jsonObject.put(Constants.ERR, e.getMessage()); 54 | } 55 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 56 | return jsonObject; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/trigger/controllers/ShowCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.trigger.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.database.trigger.beans.TriggerListBean; 14 | import com.jspmyadmin.app.database.trigger.logic.TriggerLogic; 15 | import com.jspmyadmin.framework.constants.Constants; 16 | import com.jspmyadmin.framework.exception.EncodingException; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandlePost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.Rest; 21 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 24 | import com.jspmyadmin.framework.web.utils.RequestLevel; 25 | 26 | /** 27 | * @author Yugandhar Gangu 28 | * @created_at 2016/03/30 29 | * 30 | */ 31 | @WebController(authentication = true, path = "/database_trigger_show_create.text", requestLevel = RequestLevel.DATABASE) 32 | @Rest 33 | public class ShowCreateController { 34 | 35 | @Detect 36 | private RequestAdaptor requestAdaptor; 37 | @Detect 38 | private HttpServletResponse response; 39 | @Model 40 | private TriggerListBean bean; 41 | 42 | @HandlePost 43 | @ValidateToken 44 | private JSONObject showCreateTriggier() throws JSONException, EncodingException { 45 | JSONObject jsonObject = new JSONObject(); 46 | TriggerLogic triggerLogic = null; 47 | try { 48 | triggerLogic = new TriggerLogic(); 49 | String result = triggerLogic.showCreate(bean); 50 | jsonObject.put(Constants.DATA, result); 51 | jsonObject.put(Constants.ERR, Constants.BLANK); 52 | } catch (SQLException e) { 53 | jsonObject.put(Constants.ERR, e.getMessage()); 54 | } 55 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 56 | return jsonObject; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/data/controllers/TableDataDeleteController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.data.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.table.data.beans.DataSelectBean; 14 | import com.jspmyadmin.app.table.data.logic.DataSelectLogic; 15 | import com.jspmyadmin.framework.constants.Constants; 16 | import com.jspmyadmin.framework.exception.EncodingException; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandlePost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.Rest; 21 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 24 | import com.jspmyadmin.framework.web.utils.RequestLevel; 25 | 26 | /** 27 | * @author Yugandhar Gangu 28 | * @created_at 2016/02/22 29 | * 30 | */ 31 | @WebController(authentication = true, path = "/table_data_delete.text", requestLevel = RequestLevel.TABLE) 32 | @Rest 33 | public class TableDataDeleteController { 34 | 35 | @Detect 36 | private RequestAdaptor requestAdaptor; 37 | @Detect 38 | private HttpServletResponse response; 39 | @Model 40 | private DataSelectBean bean; 41 | 42 | @HandlePost 43 | @ValidateToken 44 | private JSONObject deleteData() throws JSONException, EncodingException { 45 | 46 | DataSelectLogic dataSelectLogic = null; 47 | JSONObject jsonObject = new JSONObject(); 48 | try { 49 | dataSelectLogic = new DataSelectLogic(bean.getRequest_table()); 50 | int result = dataSelectLogic.delete(bean); 51 | jsonObject.append(Constants.ERR, Constants.BLANK); 52 | jsonObject.append(Constants.DATA, result); 53 | } catch (SQLException e) { 54 | jsonObject.append(Constants.ERR, e.getMessage()); 55 | } 56 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 57 | return jsonObject; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/data/controllers/TableDataUpdateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.data.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.table.data.beans.DataUpdateBean; 14 | import com.jspmyadmin.app.table.data.logic.DataSelectLogic; 15 | import com.jspmyadmin.framework.constants.Constants; 16 | import com.jspmyadmin.framework.exception.EncodingException; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandlePost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.Rest; 21 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 24 | import com.jspmyadmin.framework.web.utils.RequestLevel; 25 | 26 | /** 27 | * @author Yugandhar Gangu 28 | * @created_at 2016/02/22 29 | * 30 | */ 31 | @WebController(authentication = true, path = "/table_data_update.text", requestLevel = RequestLevel.TABLE) 32 | @Rest 33 | public class TableDataUpdateController { 34 | 35 | @Detect 36 | private RequestAdaptor requestAdaptor; 37 | @Detect 38 | private HttpServletResponse response; 39 | @Model 40 | private DataUpdateBean bean; 41 | 42 | @HandlePost 43 | @ValidateToken 44 | private JSONObject updateData() throws JSONException, EncodingException { 45 | 46 | DataSelectLogic dataSelectLogic = null; 47 | JSONObject jsonObject = new JSONObject(); 48 | try { 49 | dataSelectLogic = new DataSelectLogic(bean.getRequest_table()); 50 | String result = dataSelectLogic.update(bean); 51 | jsonObject.append(Constants.ERR, Constants.BLANK); 52 | jsonObject.append(Constants.DATA, result); 53 | } catch (SQLException e) { 54 | jsonObject.append(Constants.ERR, e.getMessage()); 55 | } 56 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 57 | return jsonObject; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/common/controllers/ErrorController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpSession; 10 | 11 | import com.jspmyadmin.app.common.beans.InstallBean; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.constants.Constants; 14 | import com.jspmyadmin.framework.exception.EncodingException; 15 | import com.jspmyadmin.framework.web.annotations.Detect; 16 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 17 | import com.jspmyadmin.framework.web.annotations.Model; 18 | import com.jspmyadmin.framework.web.annotations.WebController; 19 | import com.jspmyadmin.framework.web.utils.RequestLevel; 20 | import com.jspmyadmin.framework.web.utils.View; 21 | import com.jspmyadmin.framework.web.utils.ViewType; 22 | 23 | /** 24 | * @author Yugandhar Gangu 25 | * @created_at 2016/02/03 26 | */ 27 | @WebController(authentication = false, path = "/connection_error.html", requestLevel = RequestLevel.DEFAULT) 28 | public class ErrorController { 29 | 30 | @Detect 31 | private HttpSession session; 32 | @Detect 33 | private HttpServletRequest request; 34 | @Detect 35 | private View view; 36 | @Model 37 | private InstallBean bean; 38 | 39 | @HandleGetOrPost 40 | private void load() throws EncodingException, SQLException { 41 | 42 | if (session.getAttribute(Constants.SESSION_CONNECT) != null) { 43 | if (session.getAttribute(Constants.MYSQL_ERROR) != null) { 44 | request.setAttribute(Constants.MYSQL_ERROR, session.getAttribute(Constants.MYSQL_ERROR)); 45 | } else { 46 | request.setAttribute(Constants.MYSQL_ERROR, Constants.BLANK); 47 | } 48 | session.invalidate(); 49 | view.setType(ViewType.FORWARD); 50 | view.setPath(AppConstants.JSP_COMMON_ERROR); 51 | } else { 52 | view.setType(ViewType.REDIRECT); 53 | view.setPath(AppConstants.PATH_HOME); 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/export/beans/ExportBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.export.beans; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import com.jspmyadmin.framework.constants.Constants; 10 | import com.jspmyadmin.framework.web.utils.Bean; 11 | 12 | /** 13 | * @author Yugandhar Gangu 14 | * @created_at 2016/09/05 15 | * 16 | */ 17 | public class ExportBean extends Bean { 18 | 19 | private static final long serialVersionUID = 1339002439220829682L; 20 | 21 | private String[] column_list = null; 22 | private String export_type = null; 23 | private String filename = null; 24 | 25 | private List type_list = new ArrayList(Constants.Utils.EXPORT_TYPE_LIST); 26 | 27 | /** 28 | * @return the column_list 29 | */ 30 | public String[] getColumn_list() { 31 | return column_list; 32 | } 33 | 34 | /** 35 | * @param column_list 36 | * the column_list to set 37 | */ 38 | public void setColumn_list(String[] column_list) { 39 | this.column_list = column_list; 40 | } 41 | 42 | /** 43 | * @return the export_type 44 | */ 45 | public String getExport_type() { 46 | return export_type; 47 | } 48 | 49 | /** 50 | * @param export_type 51 | * the export_type to set 52 | */ 53 | public void setExport_type(String export_type) { 54 | this.export_type = export_type; 55 | } 56 | 57 | /** 58 | * @return the filename 59 | */ 60 | public String getFilename() { 61 | return filename; 62 | } 63 | 64 | /** 65 | * @param filename 66 | * the filename to set 67 | */ 68 | public void setFilename(String filename) { 69 | this.filename = filename; 70 | } 71 | 72 | /** 73 | * @return the type_list 74 | */ 75 | public List getType_list() { 76 | return type_list; 77 | } 78 | 79 | /** 80 | * @param type_list 81 | * the type_list to set 82 | */ 83 | public void setType_list(List type_list) { 84 | this.type_list = type_list; 85 | } 86 | 87 | /** 88 | * @return the serialversionuid 89 | */ 90 | public static long getSerialversionuid() { 91 | return serialVersionUID; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/view/export/beans/ExportBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.view.export.beans; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import com.jspmyadmin.framework.constants.Constants; 10 | import com.jspmyadmin.framework.web.utils.Bean; 11 | 12 | /** 13 | * @author Yugandhar Gangu 14 | * @created_at 2016/09/05 15 | * 16 | */ 17 | public class ExportBean extends Bean { 18 | 19 | private static final long serialVersionUID = 1339002439220829682L; 20 | 21 | private String[] column_list = null; 22 | private String export_type = null; 23 | private String filename = null; 24 | 25 | private List type_list = new ArrayList(Constants.Utils.EXPORT_TYPE_LIST); 26 | 27 | /** 28 | * @return the column_list 29 | */ 30 | public String[] getColumn_list() { 31 | return column_list; 32 | } 33 | 34 | /** 35 | * @param column_list 36 | * the column_list to set 37 | */ 38 | public void setColumn_list(String[] column_list) { 39 | this.column_list = column_list; 40 | } 41 | 42 | /** 43 | * @return the export_type 44 | */ 45 | public String getExport_type() { 46 | return export_type; 47 | } 48 | 49 | /** 50 | * @param export_type 51 | * the export_type to set 52 | */ 53 | public void setExport_type(String export_type) { 54 | this.export_type = export_type; 55 | } 56 | 57 | /** 58 | * @return the filename 59 | */ 60 | public String getFilename() { 61 | return filename; 62 | } 63 | 64 | /** 65 | * @param filename 66 | * the filename to set 67 | */ 68 | public void setFilename(String filename) { 69 | this.filename = filename; 70 | } 71 | 72 | /** 73 | * @return the type_list 74 | */ 75 | public List getType_list() { 76 | return type_list; 77 | } 78 | 79 | /** 80 | * @param type_list 81 | * the type_list to set 82 | */ 83 | public void setType_list(List type_list) { 84 | this.type_list = type_list; 85 | } 86 | 87 | /** 88 | * @return the serialversionuid 89 | */ 90 | public static long getSerialversionuid() { 91 | return serialVersionUID; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/ProcedureShowCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.database.routine.beans.RoutineListBean; 14 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 15 | import com.jspmyadmin.framework.constants.Constants; 16 | import com.jspmyadmin.framework.exception.EncodingException; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandlePost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.Rest; 21 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 24 | import com.jspmyadmin.framework.web.utils.RequestLevel; 25 | 26 | /** 27 | * @author Yugandhar Gangu 28 | * @created_at 2016/02/16 29 | * 30 | */ 31 | @WebController(authentication = true, path = "/database_procedure_show_create.text", requestLevel = RequestLevel.DATABASE) 32 | @Rest 33 | public class ProcedureShowCreateController { 34 | 35 | @Detect 36 | private RequestAdaptor requestAdaptor; 37 | @Detect 38 | private HttpServletResponse response; 39 | @Model 40 | private RoutineListBean bean; 41 | 42 | @HandlePost 43 | @ValidateToken 44 | private JSONObject procedureShowCreate() throws JSONException, EncodingException { 45 | 46 | RoutineLogic routineLogic = null; 47 | JSONObject jsonObject = new JSONObject(); 48 | try { 49 | routineLogic = new RoutineLogic(); 50 | String result = routineLogic.showCreate(bean, true); 51 | jsonObject.put(Constants.ERR, Constants.BLANK); 52 | jsonObject.put(Constants.DATA, result); 53 | } catch (SQLException e) { 54 | jsonObject.put(Constants.ERR, e.getMessage()); 55 | } 56 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 57 | return jsonObject; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/sql/controllers/DatabaseSqlController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.sql.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpSession; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.database.sql.beans.SqlBean; 14 | import com.jspmyadmin.app.database.sql.logic.SqlLogic; 15 | import com.jspmyadmin.framework.constants.AppConstants; 16 | import com.jspmyadmin.framework.constants.Constants; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.WebController; 21 | import com.jspmyadmin.framework.web.utils.RequestLevel; 22 | import com.jspmyadmin.framework.web.utils.View; 23 | import com.jspmyadmin.framework.web.utils.ViewType; 24 | 25 | /** 26 | * @author Yugandhar Gangu 27 | * @created_at 2016/02/22 28 | * 29 | */ 30 | @WebController(authentication = true, path = "/database_sql.html", requestLevel = RequestLevel.DATABASE) 31 | public class DatabaseSqlController { 32 | 33 | @Detect 34 | private HttpSession session; 35 | @Detect 36 | private View view; 37 | @Model 38 | private SqlBean bean; 39 | 40 | @HandleGetOrPost 41 | private void sqlEditor() throws Exception { 42 | 43 | SqlLogic sqlLogic = null; 44 | try { 45 | boolean fetch = true; 46 | Object temp = session.getAttribute(Constants.QUERY); 47 | if (temp != null) { 48 | session.removeAttribute(Constants.QUERY); 49 | try { 50 | JSONObject jsonObject = new JSONObject(temp.toString()); 51 | if (jsonObject.has(Constants.QUERY)) { 52 | bean.setQuery(jsonObject.getString(Constants.QUERY)); 53 | fetch = false; 54 | } 55 | } catch (JSONException e) { 56 | } 57 | } 58 | sqlLogic = new SqlLogic(); 59 | sqlLogic.fillBean(bean, fetch); 60 | } catch (SQLException e) { 61 | bean.setError(e.getMessage()); 62 | } 63 | view.setType(ViewType.FORWARD); 64 | view.setPath(AppConstants.JSP_DATABASE_SQL_SQL); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/framework/taglib/messages/StoreTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.framework.taglib.messages; 5 | 6 | import javax.servlet.jsp.JspException; 7 | import javax.servlet.jsp.PageContext; 8 | 9 | import com.jspmyadmin.framework.constants.Constants; 10 | import com.jspmyadmin.framework.taglib.support.AbstractSimpleTagSupport; 11 | import com.jspmyadmin.framework.web.utils.MessageReader; 12 | 13 | /** 14 | * 15 | * @author Yugandhar Gangu 16 | * @created_at 2016/01/27 17 | * 18 | */ 19 | public class StoreTag extends AbstractSimpleTagSupport { 20 | 21 | private String key = null; 22 | private String name = null; 23 | private String scope = null; 24 | 25 | /** 26 | * @param key 27 | * the key to set 28 | */ 29 | public void setKey(String key) { 30 | this.key = key; 31 | } 32 | 33 | /** 34 | * @param scope 35 | * the scope to set 36 | */ 37 | public void setScope(String scope) { 38 | this.scope = scope; 39 | } 40 | 41 | /** 42 | * @param name 43 | * the name to set 44 | */ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | @Override 50 | public void doTag() throws JspException { 51 | PageContext pageContext = (PageContext) super.getJspContext(); 52 | MessageReader messageReader = (MessageReader) pageContext 53 | .getAttribute(Constants.PAGE_CONTEXT_MESSAGES); 54 | Object temp = null; 55 | if (scope == null) { 56 | key = messageReader.getMessage(key); 57 | pageContext.setAttribute(name, key, PageContext.PAGE_SCOPE); 58 | return; 59 | } else if (Constants.COMMAND.equals(scope)) { 60 | temp = pageContext.getRequest().getAttribute( 61 | Constants.COMMAND); 62 | temp = super.getReflectValue(temp, key); 63 | } else if (Constants.PAGE.equals(scope)) { 64 | temp = pageContext.getAttribute(key); 65 | } else if (Constants.REQUEST.equals(scope)) { 66 | temp = pageContext.getRequest().getAttribute(key); 67 | } 68 | if (temp != null) { 69 | key = messageReader.getMessage(temp.toString()); 70 | if (key != null) { 71 | pageContext.setAttribute(name, key, PageContext.PAGE_SCOPE); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/beans/CommonListBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.beans; 5 | 6 | import java.util.List; 7 | 8 | import com.jspmyadmin.framework.web.utils.Bean; 9 | 10 | /** 11 | * @author Yugandhar Gangu 12 | * @created_at 2016/02/10 13 | * 14 | */ 15 | public class CommonListBean extends Bean { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private String field = null; 20 | private String type = null; 21 | private String[] columnInfo = null; 22 | private String[] sortInfo = null; 23 | private List data_list = null; 24 | 25 | /** 26 | * @return the field 27 | */ 28 | public String getField() { 29 | return field; 30 | } 31 | 32 | /** 33 | * @param field 34 | * the field to set 35 | */ 36 | public void setField(String field) { 37 | this.field = field; 38 | } 39 | 40 | /** 41 | * @return the type 42 | */ 43 | public String getType() { 44 | return type; 45 | } 46 | 47 | /** 48 | * @param type 49 | * the type to set 50 | */ 51 | public void setType(String type) { 52 | this.type = type; 53 | } 54 | 55 | /** 56 | * @return the columnInfo 57 | */ 58 | public String[] getColumnInfo() { 59 | return columnInfo; 60 | } 61 | 62 | /** 63 | * @param columnInfo 64 | * the columnInfo to set 65 | */ 66 | public void setColumnInfo(String[] columnInfo) { 67 | this.columnInfo = columnInfo; 68 | } 69 | 70 | /** 71 | * @return the sortInfo 72 | */ 73 | public String[] getSortInfo() { 74 | return sortInfo; 75 | } 76 | 77 | /** 78 | * @param sortInfo 79 | * the sortInfo to set 80 | */ 81 | public void setSortInfo(String[] sortInfo) { 82 | this.sortInfo = sortInfo; 83 | } 84 | 85 | /** 86 | * @return the data_list 87 | */ 88 | public List getData_list() { 89 | return data_list; 90 | } 91 | 92 | /** 93 | * @param data_list 94 | * the data_list to set 95 | */ 96 | public void setData_list(List data_list) { 97 | this.data_list = data_list; 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/FunctionShowCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.database.routine.beans.RoutineListBean; 14 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 15 | import com.jspmyadmin.framework.constants.Constants; 16 | import com.jspmyadmin.framework.exception.EncodingException; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandlePost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.Rest; 21 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 24 | import com.jspmyadmin.framework.web.utils.RequestLevel; 25 | 26 | /** 27 | * @author Yugandhar Gangu 28 | * @created_at 2016/02/16 29 | * 30 | */ 31 | @WebController(authentication = true, path = "/database_function_show_create.text", requestLevel = RequestLevel.DATABASE) 32 | @Rest 33 | public class FunctionShowCreateController { 34 | 35 | @Detect 36 | private RequestAdaptor requestAdaptor; 37 | @Detect 38 | private HttpServletResponse response; 39 | @Model 40 | private RoutineListBean bean; 41 | 42 | @HandlePost 43 | @ValidateToken 44 | private JSONObject showFunctionCreate() throws JSONException, EncodingException { 45 | 46 | RoutineLogic routineLogic = null; 47 | JSONObject jsonObject = new JSONObject(); 48 | try { 49 | routineLogic = new RoutineLogic(); 50 | String result = routineLogic.showCreate(bean, false); 51 | jsonObject.put(Constants.ERR, Constants.BLANK); 52 | jsonObject.put(Constants.DATA, result); 53 | } catch (SQLException e) { 54 | jsonObject.put(Constants.ERR, e.getMessage()); 55 | } finally { 56 | routineLogic = null; 57 | } 58 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 59 | return jsonObject; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/CreateViewController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.structure.beans.CreateViewBean; 9 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.exception.EncodingException; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandlePost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.utils.RedirectParams; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/02/22 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/database_create_view.html", requestLevel = RequestLevel.DATABASE) 30 | public class CreateViewController { 31 | 32 | @Detect 33 | private RedirectParams redirectParams; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private CreateViewBean bean; 40 | 41 | @HandlePost 42 | @ValidateToken 43 | private void createView() throws EncodingException, SQLException { 44 | StructureLogic structureLogic = new StructureLogic(); 45 | if (structureLogic.isTableExisted(bean.getView_name(), bean.getRequest_db())) { 46 | redirectParams.put(Constants.ERR_KEY, AppConstants.MSG_VIEW_ALREADY_EXISTED); 47 | view.setType(ViewType.REDIRECT); 48 | view.setPath(AppConstants.PATH_DATABASE_VIEW_LIST); 49 | return; 50 | } 51 | 52 | bean.setToken(requestAdaptor.generateToken()); 53 | view.setType(ViewType.FORWARD); 54 | view.setPath(AppConstants.JSP_DATABASE_STRUCTURE_CREATE_VIEW); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/structure/controllers/ShowCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.database.structure.beans.StructureBean; 14 | import com.jspmyadmin.app.database.structure.logic.StructureLogic; 15 | import com.jspmyadmin.framework.constants.Constants; 16 | import com.jspmyadmin.framework.exception.EncodingException; 17 | import com.jspmyadmin.framework.web.annotations.Detect; 18 | import com.jspmyadmin.framework.web.annotations.HandlePost; 19 | import com.jspmyadmin.framework.web.annotations.Model; 20 | import com.jspmyadmin.framework.web.annotations.Rest; 21 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 24 | import com.jspmyadmin.framework.web.utils.RequestLevel; 25 | 26 | /** 27 | * @author Yugandhar Gangu 28 | * @created_at 2016/02/16 29 | * 30 | */ 31 | @WebController(authentication = true, path = "/database_structure_show_create.text", requestLevel = RequestLevel.DATABASE) 32 | @Rest 33 | public class ShowCreateController { 34 | 35 | @Detect 36 | private RequestAdaptor requestAdaptor; 37 | @Detect 38 | private HttpServletResponse response; 39 | @Model 40 | private StructureBean bean; 41 | 42 | @HandlePost 43 | @ValidateToken 44 | private JSONObject tableCreateShow() throws JSONException, EncodingException { 45 | 46 | StructureLogic structureLogic = null; 47 | JSONObject jsonObject = new JSONObject(); 48 | try { 49 | structureLogic = new StructureLogic(); 50 | String result = structureLogic.showCreate(bean, true); 51 | jsonObject.put(Constants.ERR, Constants.BLANK); 52 | jsonObject.put(Constants.DATA, result); 53 | } catch (SQLException e) { 54 | jsonObject.put(Constants.ERR, e.getMessage()); 55 | } finally { 56 | structureLogic = null; 57 | } 58 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 59 | return jsonObject; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/users/controllers/UserDropController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.users.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import org.json.JSONException; 9 | 10 | import com.jspmyadmin.app.server.users.beans.UserListBean; 11 | import com.jspmyadmin.app.server.users.logic.UserLogic; 12 | import com.jspmyadmin.framework.constants.AppConstants; 13 | import com.jspmyadmin.framework.constants.Constants; 14 | import com.jspmyadmin.framework.exception.EncodingException; 15 | import com.jspmyadmin.framework.web.annotations.Detect; 16 | import com.jspmyadmin.framework.web.annotations.HandleGetOrPost; 17 | import com.jspmyadmin.framework.web.annotations.Model; 18 | import com.jspmyadmin.framework.web.annotations.WebController; 19 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 20 | import com.jspmyadmin.framework.web.utils.RedirectParams; 21 | import com.jspmyadmin.framework.web.utils.RequestLevel; 22 | import com.jspmyadmin.framework.web.utils.View; 23 | import com.jspmyadmin.framework.web.utils.ViewType; 24 | 25 | /** 26 | * @author Yugandhar Gangu 27 | * @created_at 2016/07/15 28 | * 29 | */ 30 | @WebController(authentication = true, path = "/server_user_drop.html", requestLevel = RequestLevel.SERVER) 31 | public class UserDropController { 32 | 33 | @Detect 34 | private EncodeHelper encodeObj; 35 | @Detect 36 | private RedirectParams redirectParams; 37 | @Detect 38 | private View view; 39 | @Model 40 | private UserListBean bean; 41 | 42 | @HandleGetOrPost 43 | private void dropUser() { 44 | try { 45 | UserLogic userLogic = new UserLogic(); 46 | userLogic.setEncodeObj(encodeObj); 47 | userLogic.dropUser(bean.getToken()); 48 | redirectParams.put(Constants.MSG_KEY, AppConstants.MSG_USER_DROP_SUCCESS); 49 | } catch (SQLException e) { 50 | redirectParams.put(Constants.ERR, e.getMessage()); 51 | } catch (JSONException e) { 52 | redirectParams.put(Constants.ERR_KEY, AppConstants.ERR_INVALID_ACCESS); 53 | } catch (EncodingException e) { 54 | redirectParams.put(Constants.ERR_KEY, AppConstants.ERR_INVALID_ACCESS); 55 | } 56 | view.setType(ViewType.REDIRECT); 57 | view.setPath(AppConstants.PATH_SERVER_USERS); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/ProcedureCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.routine.beans.RoutineBean; 9 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.exception.EncodingException; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandlePost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.utils.RedirectParams; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/03/04 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/database_procedure_create.html", requestLevel = RequestLevel.DATABASE) 30 | public class ProcedureCreateController { 31 | 32 | @Detect 33 | private RedirectParams redirectParams; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private RoutineBean bean; 40 | 41 | @HandlePost 42 | @ValidateToken 43 | private void procedureCtreate() throws SQLException, EncodingException { 44 | RoutineLogic routineLogic = new RoutineLogic(); 45 | if (routineLogic.isExisted(bean.getName(), Constants.PROCEDURE, bean.getRequest_db())) { 46 | view.setType(ViewType.REDIRECT); 47 | view.setPath(AppConstants.PATH_DATABASE_PROCEDURES); 48 | redirectParams.put(Constants.ERR_KEY, AppConstants.MSG_PROCEDURE_ALREADY_EXISTED); 49 | return; 50 | } 51 | bean.init(); 52 | bean.setToken(requestAdaptor.generateToken()); 53 | view.setType(ViewType.FORWARD); 54 | view.setPath(AppConstants.JSP_DATABASE_ROUTINE_CREATEPROCEDURE); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/structure/controllers/AlterTableController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.structure.controllers; 5 | 6 | import java.sql.SQLException; 7 | import java.util.LinkedHashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import com.jspmyadmin.app.table.structure.beans.AlterColumnBean; 12 | import com.jspmyadmin.app.table.structure.logic.StructureLogic; 13 | import com.jspmyadmin.framework.constants.AppConstants; 14 | import com.jspmyadmin.framework.constants.Constants; 15 | import com.jspmyadmin.framework.exception.EncodingException; 16 | import com.jspmyadmin.framework.web.annotations.Detect; 17 | import com.jspmyadmin.framework.web.annotations.HandlePost; 18 | import com.jspmyadmin.framework.web.annotations.Model; 19 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 20 | import com.jspmyadmin.framework.web.annotations.WebController; 21 | import com.jspmyadmin.framework.web.utils.Messages; 22 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 23 | import com.jspmyadmin.framework.web.utils.RequestLevel; 24 | import com.jspmyadmin.framework.web.utils.View; 25 | import com.jspmyadmin.framework.web.utils.ViewType; 26 | 27 | /** 28 | * @author Yugandhar Gangu 29 | * @created_at 2016/02/22 30 | * 31 | */ 32 | @WebController(authentication = true, path = "/table_alter.html", requestLevel = RequestLevel.TABLE) 33 | public class AlterTableController { 34 | 35 | @Detect 36 | private Messages messages; 37 | @Detect 38 | private RequestAdaptor requestAdaptor; 39 | @Detect 40 | private View view; 41 | @Model 42 | private AlterColumnBean bean; 43 | 44 | @HandlePost 45 | @ValidateToken 46 | private void alterTable() throws SQLException, EncodingException { 47 | 48 | StructureLogic structureLogic = new StructureLogic(bean.getRequest_table(), messages); 49 | structureLogic.fillAlterBean(bean); 50 | 51 | Map> data_types_map = new LinkedHashMap>(); 52 | data_types_map.putAll(Constants.Utils.DATA_TYPES_MAP); 53 | bean.setData_types_map(data_types_map); 54 | bean.setToken(requestAdaptor.generateToken()); 55 | view.setType(ViewType.FORWARD); 56 | view.setPath(AppConstants.JSP_TABLE_STRUCTURE_ALTER_TABLE); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/table/insert/controllers/InsertUpdatePostController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.table.insert.controllers; 5 | 6 | import java.io.IOException; 7 | import java.sql.SQLException; 8 | 9 | import com.jspmyadmin.app.table.insert.beans.InsertUpdateBean; 10 | import com.jspmyadmin.app.table.insert.logic.InsertUpdateLogic; 11 | import com.jspmyadmin.framework.constants.AppConstants; 12 | import com.jspmyadmin.framework.exception.EncodingException; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandlePost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/02/22 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/table_data_insert_update.html", requestLevel = RequestLevel.TABLE) 30 | public class InsertUpdatePostController { 31 | 32 | @Detect 33 | private EncodeHelper encodeObj; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private InsertUpdateBean bean; 40 | 41 | @HandlePost 42 | @ValidateToken 43 | private void insertUpdate() throws EncodingException, SQLException, IOException { 44 | 45 | InsertUpdateLogic insertUpdateLogic = new InsertUpdateLogic(bean.getRequest_table()); 46 | try { 47 | insertUpdateLogic.insertUpdate(bean); 48 | view.setType(ViewType.REDIRECT); 49 | view.setPath(AppConstants.PATH_TABLE_DATA); 50 | } catch (SQLException e) { 51 | insertUpdateLogic.setEncodeObj(encodeObj); 52 | insertUpdateLogic.fillBean(bean); 53 | insertUpdateLogic.fillValues(bean); 54 | bean.setToken(requestAdaptor.generateToken()); 55 | bean.setErr(e.getMessage()); 56 | view.setType(ViewType.FORWARD); 57 | view.setPath(AppConstants.JSP_TABLE_INSERT_INSERTUPDATE); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/routine/controllers/FunctionCreateController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.routine.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import com.jspmyadmin.app.database.routine.beans.RoutineBean; 9 | import com.jspmyadmin.app.database.routine.logic.RoutineLogic; 10 | import com.jspmyadmin.framework.constants.AppConstants; 11 | import com.jspmyadmin.framework.constants.Constants; 12 | import com.jspmyadmin.framework.exception.EncodingException; 13 | import com.jspmyadmin.framework.web.annotations.Detect; 14 | import com.jspmyadmin.framework.web.annotations.HandlePost; 15 | import com.jspmyadmin.framework.web.annotations.Model; 16 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 17 | import com.jspmyadmin.framework.web.annotations.WebController; 18 | import com.jspmyadmin.framework.web.utils.RedirectParams; 19 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 20 | import com.jspmyadmin.framework.web.utils.RequestLevel; 21 | import com.jspmyadmin.framework.web.utils.View; 22 | import com.jspmyadmin.framework.web.utils.ViewType; 23 | 24 | /** 25 | * @author Yugandhar Gangu 26 | * @created_at 2016/03/04 27 | * 28 | */ 29 | @WebController(authentication = true, path = "/database_function_create.html", requestLevel = RequestLevel.DATABASE) 30 | public class FunctionCreateController { 31 | 32 | @Detect 33 | private RedirectParams redirectParams; 34 | @Detect 35 | private RequestAdaptor requestAdaptor; 36 | @Detect 37 | private View view; 38 | @Model 39 | private RoutineBean bean; 40 | 41 | @HandlePost 42 | @ValidateToken 43 | private void functionCreate() throws SQLException, EncodingException { 44 | RoutineLogic routineLogic = new RoutineLogic(); 45 | if (routineLogic.isExisted(bean.getName(), Constants.FUNCTION, bean.getRequest_db())) { 46 | view.setType(ViewType.REDIRECT); 47 | view.setPath(AppConstants.PATH_DATABASE_FUNCTIONS); 48 | redirectParams.put(Constants.ERR_KEY, AppConstants.MSG_FUNCTION_ALREADY_EXISTED); 49 | return; 50 | } 51 | bean.init(); 52 | bean.setData_types_map(Constants.Utils.DATA_TYPES_MAP); 53 | bean.setToken(requestAdaptor.generateToken()); 54 | view.setType(ViewType.FORWARD); 55 | view.setPath(AppConstants.JSP_DATABASE_ROUTINE_CREATEFUNCTION); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/webapp/WEB-INF/messages.tld: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 1.0 7 | 2.0 8 | m 9 | http://jspmyadmin.com/taglib/jsp/messages 10 | JspMyadmin Message Tags 11 | 12 | open 13 | com.jspmyadmin.framework.taglib.messages.MessageOpenTag 14 | 15 | empty 16 | To load messages with locale. 17 | 18 | 19 | print 20 | com.jspmyadmin.framework.taglib.messages.PrintTag 21 | empty 22 | 23 | key 24 | true 25 | 26 | 27 | scope 28 | 29 | 30 | To print message. 31 | Examples: 32 | Properties - <m:store key="one" id="ones" />, 33 | PageContext - 34 | <m:store key="#one" id="ones" scope="page" />, 35 | Command - 36 | <m:store key="#one" id="ones" scope="command" />, 37 | Request - 38 | <m:store key="#one" id="ones" scope="request" /> 39 | 40 | 41 | 42 | store 43 | com.jspmyadmin.framework.taglib.messages.StoreTag 44 | empty 45 | 46 | key 47 | true 48 | 49 | 50 | name 51 | true 52 | 53 | 54 | scope 55 | 56 | 57 | To store message in pageContext object. 58 | Examples: 59 | Properties - <m:store key="one" id="ones" />, 60 | PageContext - 61 | <m:store key="#one" name="ones" scope="page" />, 62 | Command - 63 | <m:store key="#one" name="ones" scope="command" />, 64 | Request - 65 | <m:store key="#one" name="ones" scope="request" /> 66 | 67 | 68 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/server/common/controllers/VariableSaveController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.server.common.controllers; 5 | 6 | import java.sql.SQLException; 7 | 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | 13 | import com.jspmyadmin.app.server.common.beans.VariableBean; 14 | import com.jspmyadmin.app.server.common.logic.VariableLogic; 15 | import com.jspmyadmin.framework.constants.AppConstants; 16 | import com.jspmyadmin.framework.constants.Constants; 17 | import com.jspmyadmin.framework.exception.EncodingException; 18 | import com.jspmyadmin.framework.web.annotations.Detect; 19 | import com.jspmyadmin.framework.web.annotations.HandlePost; 20 | import com.jspmyadmin.framework.web.annotations.Model; 21 | import com.jspmyadmin.framework.web.annotations.Rest; 22 | import com.jspmyadmin.framework.web.annotations.WebController; 23 | import com.jspmyadmin.framework.web.utils.Messages; 24 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 25 | import com.jspmyadmin.framework.web.utils.RequestLevel; 26 | 27 | /** 28 | * @author Yugandhar Gangu 29 | * @created_at 2016/02/12 30 | * 31 | */ 32 | @WebController(authentication = true, path = "/server_variable.text", requestLevel = RequestLevel.SERVER) 33 | @Rest 34 | public class VariableSaveController { 35 | 36 | @Detect 37 | private Messages messages; 38 | @Detect 39 | private RequestAdaptor requestAdaptor; 40 | @Detect 41 | private HttpServletResponse response; 42 | @Model 43 | private VariableBean bean; 44 | 45 | @HandlePost 46 | private JSONObject variableSave() throws JSONException, EncodingException { 47 | JSONObject jsonObject = new JSONObject(); 48 | VariableLogic variableLogic = null; 49 | try { 50 | variableLogic = new VariableLogic(); 51 | String result = variableLogic.save(bean); 52 | jsonObject.put(Constants.COLUMN, result); 53 | jsonObject.put(Constants.TYPE, Constants.MSG); 54 | jsonObject.put(Constants.MSG, messages.getMessage(AppConstants.MSG_SAVE_SUCCESS)); 55 | } catch (SQLException e) { 56 | jsonObject.put(Constants.TYPE, Constants.ERR); 57 | jsonObject.put(Constants.MSG, e.getMessage()); 58 | } 59 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 60 | return jsonObject; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /application/jspmyadmin/src/main/java/com/jspmyadmin/app/database/trigger/controllers/TriggerTableListController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.jspmyadmin.app.database.trigger.controllers; 5 | 6 | import java.sql.SQLException; 7 | import java.util.List; 8 | 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.json.JSONException; 12 | import org.json.JSONObject; 13 | 14 | import com.jspmyadmin.app.common.logic.DataLogic; 15 | import com.jspmyadmin.app.database.trigger.beans.TriggerBean; 16 | import com.jspmyadmin.framework.constants.Constants; 17 | import com.jspmyadmin.framework.exception.EncodingException; 18 | import com.jspmyadmin.framework.web.annotations.Detect; 19 | import com.jspmyadmin.framework.web.annotations.HandlePost; 20 | import com.jspmyadmin.framework.web.annotations.Model; 21 | import com.jspmyadmin.framework.web.annotations.Rest; 22 | import com.jspmyadmin.framework.web.annotations.ValidateToken; 23 | import com.jspmyadmin.framework.web.annotations.WebController; 24 | import com.jspmyadmin.framework.web.logic.EncodeHelper; 25 | import com.jspmyadmin.framework.web.utils.RequestAdaptor; 26 | import com.jspmyadmin.framework.web.utils.RequestLevel; 27 | 28 | /** 29 | * @author Yugandhar Gangu 30 | * @created_at 2016/04/11 31 | * 32 | */ 33 | @WebController(authentication = true, path = "/database_trigger_table_list.text", requestLevel = RequestLevel.DATABASE) 34 | @Rest 35 | public class TriggerTableListController { 36 | 37 | @Detect 38 | private RequestAdaptor requestAdaptor; 39 | @Detect 40 | private EncodeHelper encodeObj; 41 | @Detect 42 | private HttpServletResponse response; 43 | @Model 44 | private TriggerBean bean; 45 | 46 | @HandlePost 47 | @ValidateToken 48 | private JSONObject handlePost() throws EncodingException, JSONException { 49 | 50 | JSONObject jsonObject = new JSONObject(); 51 | DataLogic dataLogic = null; 52 | try { 53 | dataLogic = new DataLogic(); 54 | dataLogic.setEncodeObj(encodeObj); 55 | List tableList = dataLogic.getTableList(bean.getDatabase_name(), false); 56 | jsonObject.put(Constants.ERR, Constants.BLANK); 57 | jsonObject.put(Constants.DATA, tableList); 58 | } catch (SQLException e) { 59 | jsonObject.put(Constants.ERR, e.getMessage()); 60 | } 61 | jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken()); 62 | return jsonObject; 63 | } 64 | 65 | } 66 | --------------------------------------------------------------------------------