Skip to content

Commit

Permalink
Merge pull request #372 from support-project/feature/issue40_postgres…
Browse files Browse the repository at this point in the history
…_msg

#40 add recommend message of change database
  • Loading branch information
koda-masaru committed May 18, 2016
2 parents 55b2854 + abd4c3b commit b4fadb4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
Expand Up @@ -183,8 +183,17 @@ public Boundary connect() {
ConnectionManager.getInstance().addConnectionConfig(connectionConfig); // 新しいコネクション設定をセット
}
}

setAttributeOnProperty(connectionConfig);

Boolean postgres = Boolean.FALSE;
if (DBConnenctionLogic.get().getCustomConnectionConfig() != null) {
ConnectionConfig config = DBConnenctionLogic.get().getCustomConnectionConfig();
if (config.getDriverClass().indexOf("postgres") != -1) {
postgres = Boolean.TRUE;
}
}
setAttribute("postgres", postgres);

return forward("connection.jsp");
}

Expand Down
Expand Up @@ -3,16 +3,26 @@
import org.support.project.di.DI;
import org.support.project.di.Instance;
import org.support.project.knowledge.control.Control;
import org.support.project.ormapping.config.ConnectionConfig;
import org.support.project.web.annotation.Auth;
import org.support.project.web.boundary.Boundary;
import org.support.project.web.control.service.Get;
import org.support.project.web.logic.DBConnenctionLogic;

@DI(instance = Instance.Prototype)
public class SystemConfigControl extends Control {

@Get
@Auth(roles = "admin")
public Boundary index() {
Boolean postgres = Boolean.FALSE;
if (DBConnenctionLogic.get().getCustomConnectionConfig() != null) {
ConnectionConfig config = DBConnenctionLogic.get().getCustomConnectionConfig();
if (config.getDriverClass().indexOf("postgres") != -1) {
postgres = Boolean.TRUE;
}
}
setAttribute("postgres", postgres);
return forward("index.jsp");
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/appresource.properties
Expand Up @@ -148,6 +148,7 @@ knowledge.navbar.data.export=Export
knowledge.navbar.add.knowledge=Add
knowledge.navbar.list.knowledge=List
knowledge.navbar.search=Advanced search
knowledge.sysconfig.msg.recommend.postgres=You can change on "Change Database" menu.

knowledge.footer.about=About
knowledge.footer.list=List
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/appresource_ja.properties
Expand Up @@ -148,6 +148,7 @@ knowledge.navbar.data.export=エクスポート
knowledge.navbar.add.knowledge=作成
knowledge.navbar.list.knowledge=一覧
knowledge.navbar.search=詳細検索
knowledge.sysconfig.msg.recommend.postgres=「データベースの接続先変更」のメニューから変更が可能です

knowledge.footer.about=Knowledgeとは
knowledge.footer.list=一覧
Expand Down
6 changes: 5 additions & 1 deletion src/main/webapp/WEB-INF/views/admin/database/connection.jsp
Expand Up @@ -60,14 +60,18 @@
<c:param name="PARAM_CONTENT">
<h4 class="title"><%=jspUtil.label("knowledge.navbar.data.connect")%></h4>

<%
if (!jspUtil.is(Boolean.TRUE, "postgres")) {
%>
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<strong>Information</strong>
<%=jspUtil.label("knowledge.connection.msg.recommend.postgres")%>
</div>

<% } %>

<%
if (jspUtil.is(Boolean.TRUE, "custom")) {
%>
Expand Down
15 changes: 15 additions & 0 deletions src/main/webapp/WEB-INF/views/admin/systemconfig/index.jsp
Expand Up @@ -21,6 +21,21 @@
<c:param name="PARAM_CONTENT">
<h4 class="title"><%=jspUtil.label("knowledge.navbar.config.system")%></h4>

<%
if (!jspUtil.is(Boolean.TRUE, "postgres")) {
%>
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<strong>Information</strong>
<%=jspUtil.label("knowledge.connection.msg.recommend.postgres")%>
<br/>
<%=jspUtil.label("knowledge.sysconfig.msg.recommend.postgres")%>
</div>
<% } %>



<h4 class="sub_title"><%=jspUtil.label("knowledge.navbar.config.admin")%></h4>
<ul role="menu" class="menu_list">
Expand Down

0 comments on commit b4fadb4

Please sign in to comment.