Selaa lähdekoodia

add notification display

Kaoru FUZITA 9 vuotta sitten
vanhempi
commit
3c8cc1b18a

+ 4 - 0
src/main/java/org/codelibs/fess/Constants.java

@@ -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";

+ 9 - 3
src/main/java/org/codelibs/fess/app/web/RootAction.java

@@ -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));
+                });
     }
 
 }

+ 4 - 0
src/main/java/org/codelibs/fess/app/web/admin/general/AdminGeneralAction.java

@@ -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) {

+ 6 - 0
src/main/java/org/codelibs/fess/app/web/admin/general/EditForm.java

@@ -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;
 }

+ 6 - 1
src/main/java/org/codelibs/fess/app/web/login/LoginAction.java

@@ -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

+ 6 - 0
src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java

@@ -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");
 

+ 8 - 2
src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java

@@ -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}";

+ 5 - 0
src/main/resources/fess_label.properties

@@ -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

+ 3 - 0
src/main/resources/fess_label_en.properties

@@ -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

+ 5 - 2
src/main/resources/fess_label_ja.properties

@@ -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

+ 22 - 0
src/main/webapp/WEB-INF/view/admin/general/admin_general.jsp

@@ -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">

+ 1 - 0
src/main/webapp/WEB-INF/view/index.jsp

@@ -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>

+ 1 - 0
src/main/webapp/WEB-INF/view/login/index.jsp

@@ -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" />

+ 4 - 0
src/main/webapp/css/admin/style.css

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