add notification display

This commit is contained in:
Kaoru FUZITA 2016-02-17 00:19:50 +09:00
parent 655f455526
commit 3c8cc1b18a
14 changed files with 84 additions and 8 deletions

View file

@ -359,6 +359,10 @@ public class Constants extends CoreLibConstants {
public static final String LDAP_ACCOUNT_FILTER = "ldap.account.filter";
public static final String NOTIFICATION_LOGIN = "notification.login";
public static final String NOTIFICATION_SEARCH_TOP = "notification.search.top";
public static final String MAPPING_TYPE_ARRAY = "array";
public static final String MAPPING_TYPE_STRING = "string";

View file

@ -15,8 +15,11 @@
*/
package org.codelibs.fess.app.web;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.web.base.FessSearchAction;
import org.codelibs.fess.app.web.base.SearchForm;
import org.codelibs.fess.util.RenderDataUtil;
import org.lastaflute.web.Execute;
import org.lastaflute.web.response.HtmlResponse;
@ -43,9 +46,12 @@ public class RootAction extends FessSearchAction {
op.setup(form -> {
buildLabelParams(form.fields);
});
}).renderWith(data -> {
buildInitParams();
});
}).renderWith(
data -> {
buildInitParams();
RenderDataUtil.register(data, "notification",
systemProperties.getProperty(Constants.NOTIFICATION_SEARCH_TOP, StringUtil.EMPTY));
});
}
}

View file

@ -142,6 +142,8 @@ public class AdminGeneralAction extends FessAdminAction {
updateProperty(Constants.LDAP_SECURITY_PRINCIPAL, form.ldapSecurityPrincipal);
updateProperty(Constants.LDAP_BASE_DN, form.ldapBaseDn);
updateProperty(Constants.LDAP_ACCOUNT_FILTER, form.ldapAccountFilter);
updateProperty(Constants.NOTIFICATION_LOGIN, form.notificationLogin);
updateProperty(Constants.NOTIFICATION_SEARCH_TOP, form.notificationSearchTop);
fessConfig.storeSystemProperties();
saveInfo(messages -> messages.addSuccessUpdateCrawlerParams(GLOBAL));
@ -185,6 +187,8 @@ public class AdminGeneralAction extends FessAdminAction {
form.ldapSecurityPrincipal = systemProperties.getProperty(Constants.LDAP_SECURITY_PRINCIPAL, StringUtil.EMPTY);
form.ldapBaseDn = systemProperties.getProperty(Constants.LDAP_BASE_DN, StringUtil.EMPTY);
form.ldapAccountFilter = systemProperties.getProperty(Constants.LDAP_ACCOUNT_FILTER, StringUtil.EMPTY);
form.notificationLogin = systemProperties.getProperty(Constants.NOTIFICATION_LOGIN, StringUtil.EMPTY);
form.notificationSearchTop = systemProperties.getProperty(Constants.NOTIFICATION_SEARCH_TOP, StringUtil.EMPTY);
}
private void updateProperty(final String key, final String value) {

View file

@ -127,4 +127,10 @@ public class EditForm implements Serializable {
@Size(max = 1000)
public String ldapAccountFilter;
@Size(max = 3000)
public String notificationLogin;
@Size(max = 3000)
public String notificationSearchTop;
}

View file

@ -15,10 +15,13 @@
*/
package org.codelibs.fess.app.web.login;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.web.admin.dashboard.AdminDashboardAction;
import org.codelibs.fess.app.web.base.FessSearchAction;
import org.codelibs.fess.mylasta.action.FessUserBean;
import org.codelibs.fess.util.ActivityUtil;
import org.codelibs.fess.util.RenderDataUtil;
import org.lastaflute.web.Execute;
import org.lastaflute.web.login.exception.LoginFailureException;
import org.lastaflute.web.response.HtmlResponse;
@ -43,7 +46,9 @@ public class LoginAction extends FessSearchAction {
@Execute
public HtmlResponse index() {
return getHtmlResponse().useForm(LoginForm.class);
return asHtml(path_Login_IndexJsp).renderWith(data -> {
RenderDataUtil.register(data, "notification", systemProperties.getProperty(Constants.NOTIFICATION_LOGIN, StringUtil.EMPTY));
}).useForm(LoginForm.class);
}
@Execute

View file

@ -317,6 +317,12 @@ public interface FessHtmlPath {
/** The path of the HTML: /index.jsp */
HtmlNext path_IndexJsp = new HtmlNext("/index.jsp");
/** The path of the HTML: /info/login_info.jsp */
HtmlNext path_Info_LoginInfoJsp = new HtmlNext("/info/login_info.jsp");
/** The path of the HTML: /info/search_info.jsp */
HtmlNext path_Info_SearchInfoJsp = new HtmlNext("/info/search_info.jsp");
/** The path of the HTML: /login/footer.jsp */
HtmlNext path_Login_FooterJsp = new HtmlNext("/login/footer.jsp");

View file

@ -2022,8 +2022,14 @@ public class FessLabels extends ActionMessages {
/** The key of the message: Account Filter */
public static final String LABELS_ldap_account_filter = "{labels.ldap_account_filter}";
/** The key of the message: Send TestMail */
public static final String LABELS_send_testmail = "{labels.send_testmail}";
/** The key of the message: Login page */
public static final String LABELS_notification_login = "{labels.notification_login}";
/** The key of the message: Search top page */
public static final String LABELS_notification_search_top = "{labels.notification_search_top}";
/** The key of the message: Notification */
public static final String LABELS_general_menu_notification = "{labels.general_menu_notification}";
/** The key of the message: Back Up */
public static final String LABELS_backup_configuration = "{labels.backup_configuration}";

View file

@ -667,10 +667,15 @@ labels.general_menu_crawler=Crawler
labels.general_menu_logging=Logging
labels.general_menu_suggest=Suggest
labels.general_menu_ldap=LDAP
labels.general_menu_notification=Notification
labels.ldap_provider_url=LDAP URL
labels.ldap_security_principal=Bind DN
labels.ldap_base_dn=Base DN
labels.ldap_account_filter=Account Filter
labels.ldap_account_filter=Account Filter
labels.notification_login=Login page
labels.notification_search_top=Search top page
labels.general_menu_notification=Notification
labels.send_testmail=Send TestMail
labels.backup_configuration=Back Up
labels.backup_name=Name

View file

@ -667,10 +667,13 @@ labels.general_menu_crawler=Crawler
labels.general_menu_logging=Logging
labels.general_menu_suggest=Suggest
labels.general_menu_ldap=LDAP
labels.general_menu_notification=Notification
labels.ldap_provider_url=LDAP URL
labels.ldap_security_principal=Bind DN
labels.ldap_base_dn=Base DN
labels.ldap_account_filter=Account Filter
labels.notification_login=Login page
labels.notification_search_top=Search top page
labels.send_testmail=Send TestMail
labels.backup_configuration=Back Up
labels.backup_name=Name

View file

@ -654,15 +654,18 @@ labels.general_menu_system = \u30b7\u30b9\u30c6\u30e0
labels.general_menu_crawler = \u30af\u30ed\u30fc\u30e9
labels.general_menu_logging = \u30ed\u30ae\u30f3\u30b0
labels.general_menu_suggest = \u30b5\u30b8\u30a7\u30b9\u30c8
labels.send_testmail=\u30c6\u30b9\u30c8\u30e1\u30fc\u30eb\u306e\u9001\u4fe1
labels.general_menu_ldap=LDAP
labels.general_menu_notification=\u304a\u77e5\u3089\u305b\u8868\u793a
labels.ldapProviderUrl=LDAP URL
labels.ldapSecurityPrincipal=Bind DN
labels.ldapBaseDn=Base DN
labels.general_menu_ldap=LDAP
labels.ldap_provider_url=LDAP URL
labels.ldap_security_principal=Bind DN
labels.ldap_base_dn=Base DN
labels.ldapAccountFilter=\u30a2\u30ab\u30a6\u30f3\u30c8\u30d5\u30a3\u30eb\u30bf
labels.ldap_account_filter=\u30a2\u30ab\u30a6\u30f3\u30c8\u30d5\u30a3\u30eb\u30bf
labels.notification_login=\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8
labels.notification_search_top=\u691c\u7d22\u30c8\u30c3\u30d7\u30da\u30fc\u30b8
labels.send_testmail=\u30c6\u30b9\u30c8\u30e1\u30fc\u30eb\u306e\u9001\u4fe1
labels.backup_configuration=\u30d0\u30c3\u30af\u30a2\u30c3\u30d7
labels.backup_name=\u540d\u524d

View file

@ -329,6 +329,28 @@
styleClass="form-control" />
</div>
</div>
<%-- Nortification --%>
<h4><la:message key="labels.general_menu_notification" /></h4>
<div class="form-group">
<label for="notificationLogin"
class="col-sm-3 control-label"><la:message
key="labels.notification_login" /></label>
<div class="col-sm-9">
<la:errors property="notificationLogin" />
<la:textarea property="notificationLogin"
styleClass="form-control" />
</div>
</div>
<div class="form-group">
<label for="notificationSearchTop"
class="col-sm-3 control-label"><la:message
key="labels.notification_search_top" /></label>
<div class="col-sm-9">
<la:errors property="notificationSearchTop" />
<la:textarea property="notificationSearchTop"
styleClass="form-control" />
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">

View file

@ -54,6 +54,7 @@
<img src="${f:url('/images/logo.png')}"
alt="<la:message key="labels.index_title" />" />
</h1>
<div class="notification">${notification}</div>
<div>
<la:info id="msg" message="true">
<div class="alert-message info">${msg}</div>

View file

@ -31,6 +31,7 @@
</la:link>
</div>
<!-- /.login-logo -->
<div class="notification">${notification}</div>
<div class="login-box-body">
<p class="login-box-msg">
<la:message key="labels.login" />

View file

@ -48,6 +48,10 @@
font-size: 13px;
}
.notification {
text-align: center;
}
.login-box i, section.content i {
margin-right: 0.2em;
}