Skip to content

Commit

Permalink
Merge pull request #10 from yugandhargangu/BugFix#1
Browse files Browse the repository at this point in the history
Bug Fix
  • Loading branch information
yugandhargangu authored Feb 25, 2017
2 parents e74ed19 + ea8cd55 commit c0cb587
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion application/jspmyadmin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<tomcat_url>http://localhost:8080/manager/html</tomcat_url>

<!-- For tomcat6, tomcat7 plugins -->
<tomcat_port>8000</tomcat_port>
<tomcat_port>8010</tomcat_port>
<project_path>/</project_path>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ private void save() {
view.setType(ViewType.REDIRECT);
view.setPath(AppConstants.PATH_HOME);
} catch (IOException e) {
e.printStackTrace();
redirectParams.put(Constants.ERR_KEY, AppConstants.ERR_UNABLE_TO_CONNECT_WITH_SERVER);
view.setType(ViewType.REDIRECT);
view.setPath(AppConstants.PATH_INSTALL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public void enableEvent(Bean bean) throws SQLException {
builder.append(enable);
statement = apiConnection.getStmt(builder.toString());
statement.execute();
statement = null;
builder.delete(0, builder.length());
}
apiConnection.commit();
Expand Down Expand Up @@ -190,7 +189,6 @@ public void dropEvent(Bean bean) throws SQLException {
builder.append(Constants.SYMBOL_TEN);
statement = apiConnection.getStmt(builder.toString());
statement.execute();
statement = null;
builder.delete(0, builder.length());
}
apiConnection.commit();
Expand Down Expand Up @@ -230,7 +228,6 @@ public void disableEvent(Bean bean) throws SQLException {
builder.append(disable);
statement = apiConnection.getStmt(builder.toString());
statement.execute();
statement = null;
builder.delete(0, builder.length());
}
apiConnection.commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private void alterSql() throws JSONException, SQLException {
case 1:
// alter view
StructureBean structureBean = new StructureBean();
structureBean.setRequest_db(bean.getRequest_db());
structureBean.setTables(new String[] { bean.getEdit_name() });
StructureLogic structureLogic = new StructureLogic();
String result = structureLogic.showCreate(structureBean, false);
Expand All @@ -75,6 +76,7 @@ private void alterSql() throws JSONException, SQLException {
case 2:
// alter procedure
RoutineListBean routineListBean = new RoutineListBean();
routineListBean.setRequest_db(bean.getRequest_db());
routineListBean.setRoutines(new String[] { bean.getEdit_name() });
RoutineLogic routineLogic = new RoutineLogic();
result = routineLogic.showCreate(routineListBean, true);
Expand Down Expand Up @@ -109,6 +111,7 @@ private void alterSql() throws JSONException, SQLException {
case 4:
// alter function
routineListBean = new RoutineListBean();
routineListBean.setRequest_db(bean.getRequest_db());
routineListBean.setRoutines(new String[] { bean.getEdit_name() });
routineLogic = new RoutineLogic();
result = routineLogic.showCreate(routineListBean, false);
Expand Down Expand Up @@ -143,6 +146,7 @@ private void alterSql() throws JSONException, SQLException {
case 6:
// alter event
EventListBean eventListBean = new EventListBean();
eventListBean.setRequest_db(bean.getRequest_db());
eventListBean.setEvents(new String[] { bean.getEdit_name() });
EventLogic eventLogic = new EventLogic();
result = eventLogic.getShowCreate(eventListBean);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private JSONObject createView() throws JSONException, EncodingException {
}
} catch (SQLException e) {
jsonObject.append(Constants.ERR, e.getMessage());
}
}
jsonObject.put(Constants.TOKEN, requestAdaptor.generateToken());
return jsonObject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
import com.jspmyadmin.app.database.trigger.logic.TriggerLogic;
import com.jspmyadmin.framework.constants.AppConstants;
import com.jspmyadmin.framework.constants.Constants;
import com.jspmyadmin.framework.exception.EncodingException;
import com.jspmyadmin.framework.web.annotations.Detect;
import com.jspmyadmin.framework.web.annotations.HandlePost;
import com.jspmyadmin.framework.web.annotations.Model;
import com.jspmyadmin.framework.web.annotations.ValidateToken;
import com.jspmyadmin.framework.web.annotations.WebController;
import com.jspmyadmin.framework.web.utils.Messages;
import com.jspmyadmin.framework.web.utils.RedirectParams;
import com.jspmyadmin.framework.web.utils.RequestAdaptor;
import com.jspmyadmin.framework.web.utils.RequestLevel;
import com.jspmyadmin.framework.web.utils.View;
import com.jspmyadmin.framework.web.utils.ViewType;
Expand All @@ -29,6 +31,8 @@
@WebController(authentication = true, path = "/database_trigger_create.html", requestLevel = RequestLevel.DATABASE)
public class CreateTriggerController {

@Detect
private RequestAdaptor requestAdaptor;
@Detect
private RedirectParams redirectParams;
@Detect
Expand All @@ -40,7 +44,7 @@ public class CreateTriggerController {

@HandlePost
@ValidateToken
private void createTrigger() {
private void createTrigger() throws EncodingException {
try {
TriggerLogic triggerLogic = new TriggerLogic();
if (triggerLogic.isExisted(bean.getTrigger_name(), bean.getRequest_db())) {
Expand All @@ -54,6 +58,7 @@ private void createTrigger() {
bean.setDatabase_name(bean.getRequest_db());
DataLogic dataLogic = new DataLogic();
bean.setDatabase_name_list(dataLogic.getDatabaseList());
bean.setToken(requestAdaptor.generateToken());
} catch (SQLException e) {
redirectParams.put(Constants.ERR, e.getMessage());
view.setType(ViewType.REDIRECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public void fillAlterBean(Bean bean) throws SQLException {
alterColumnBean.setNew_comments(alterColumnBean.getOld_comments());
}
close(resultSet);
close(statement);

String uniqueQuery = "SHOW KEYS FROM `" + _table + "` WHERE key_name <> ? AND non_unique = ?";
statement = apiConnection.getStmtSelect(uniqueQuery);
Expand All @@ -263,6 +264,7 @@ public void fillAlterBean(Bean bean) throws SQLException {
oldUniqueList.add(resultSet.getString("column_name"));
}
close(resultSet);
close(statement);

builder = new StringBuilder();
builder.append("SHOW FULL COLUMNS FROM `");
Expand Down Expand Up @@ -659,6 +661,7 @@ public String alterColumns(Bean bean) throws SQLException {
old_primary_key = resultSet.getString("column_name");
}
close(resultSet);
close(statement);

boolean oldPKStatus = false;
for (int i = 0; i < alterColumnBean.getOld_columns().length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@
return;
}
$('#sql-form').find('input[name="edit_type"]').val('6');
$('#sql-form').find('input[name="edit_name"]').val($('input[name="tables"]:checked:first').val());
$('#sql-form').find('input[name="edit_name"]').val($('input[name="events"]:checked:first').val());
$('#sql-form').submit();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
</div>
<div class="group-widget group-footer">
<button type="button" class="btn" id="btn-duplicate-go"
value="${pageContext.request.contextPath}/database_structure_duplicate.html?token=${requestScope.command.request_token}">
value="${pageContext.request.contextPath}/database_structure_duplicate.html">
<m:print key="lbl.run" />
</button>
</div>
Expand Down Expand Up @@ -436,7 +436,7 @@
</div>
<div class="group-widget group-footer">
<button type="button" class="btn" id="btn-prefix-go"
value="${pageContext.request.contextPath}/database_structure_prefix.html?token=${requestScope.command.request_token}">
value="${pageContext.request.contextPath}/database_structure_prefix.html">
<m:print key="lbl.run" />
</button>
</div>
Expand Down Expand Up @@ -503,7 +503,7 @@
</div>
<div class="group-widget group-footer">
<button type="button" class="btn" id="btn-suffix-go"
value="${pageContext.request.contextPath}/database_structure_suffix.html?token=${requestScope.command.request_token}">
value="${pageContext.request.contextPath}/database_structure_suffix.html">
<m:print key="lbl.run" />
</button>
</div>
Expand Down Expand Up @@ -584,7 +584,7 @@
</div>
<div class="group-widget group-footer">
<button type="button" class="btn" id="btn-copy-go"
value="${pageContext.request.contextPath}/database_structure_copy.html?token=${requestScope.command.request_token}">
value="${pageContext.request.contextPath}/database_structure_copy.html">
<m:print key="lbl.run" />
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
</div>
<div class="group-widget group-footer">
<button type="button" class="btn" id="btn-prefix-go"
value="${pageContext.request.contextPath}/database_structure_prefix.html?token=${requestScope.command.request_token}">
value="${pageContext.request.contextPath}/database_structure_prefix.html">
<m:print key="lbl.run" />
</button>
</div>
Expand Down Expand Up @@ -311,7 +311,7 @@
</div>
<div class="group-widget group-footer">
<button type="button" class="btn" id="btn-suffix-go"
value="${pageContext.request.contextPath}/database_structure_suffix.html?token=${requestScope.command.request_token}">
value="${pageContext.request.contextPath}/database_structure_suffix.html">
<m:print key="lbl.run" />
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ input[readonly] {
</jma:notEmpty>
<jma:notEmpty name="#select_list" scope="command">
<a
href="${pageContext.request.contextPath}/table_data,html?token=${requestScope.command.next_page}"><button
href="${pageContext.request.contextPath}/table_data.html?token=${requestScope.command.next_page}"><button
type="button" class="btn" style="float: right;">
<m:print key="lbl.next" />
&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,8 @@ select optgroup option {
background-color: #0072C6;
border: 1px solid #0072C6;
cursor: pointer;
padding: 0.2em 1em 0.3em 1em;
padding: 0.3em 1em 0.3em 1em;
color: #FFF;
text-shadow: 0px 1px 0px #FFF;
margin: 0.1em 1em;
}

Expand Down

0 comments on commit c0cb587

Please sign in to comment.