瀏覽代碼

fix #529 : add login link checkbox

Shinsuke Sugaya 9 年之前
父節點
當前提交
1c22f7e54a

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

@@ -115,6 +115,8 @@ public class Constants extends CoreLibConstants {
 
     public static final String LOGIN_REQUIRED_PROPERTY = "login.required";
 
+    public static final String LOGIN_LINK_ENALBED_PROPERTY = "login.link.enabled";
+
     public static final String IGNORE_FAILURE_TYPE_PROPERTY = "failure.ignoretype";
 
     public static final String FAILURE_COUNT_THRESHOLD_PROPERTY = "failure.countthreshold";

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

@@ -118,6 +118,7 @@ public class AdminGeneralAction extends FessAdminAction {
         });
 
         fessConfig.setLoginRequired(Constants.ON.equalsIgnoreCase(form.loginRequired));
+        fessConfig.setLoginLinkEnabled(Constants.ON.equalsIgnoreCase(form.loginLink));
         fessConfig.setIncrementalCrawling(Constants.ON.equalsIgnoreCase(form.incrementalCrawling));
         fessConfig.setDayForCleanup(form.dayForCleanup);
         fessConfig.setCrawlingThreadCount(form.crawlingThreadCount);
@@ -154,6 +155,7 @@ public class AdminGeneralAction extends FessAdminAction {
 
     protected void updateForm(final EditForm form) {
         form.loginRequired = fessConfig.isLoginRequired() ? Constants.TRUE : Constants.FALSE;
+        form.loginLink = fessConfig.isLoginLinkEnabled() ? Constants.TRUE : Constants.FALSE;
         form.incrementalCrawling = fessConfig.isIncrementalCrawling() ? Constants.TRUE : Constants.FALSE;
         form.dayForCleanup = fessConfig.getDayForCleanup();
         form.crawlingThreadCount = fessConfig.getCrawlingThreadCount();

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

@@ -71,6 +71,9 @@ public class EditForm implements Serializable {
     @Size(max = 10)
     public String loginRequired;
 
+    @Size(max = 10)
+    public String loginLink;
+
     @Size(max = 1000)
     public String ignoreFailureType;
 

+ 1 - 1
src/main/java/org/codelibs/fess/app/web/base/FessSearchAction.java

@@ -120,7 +120,7 @@ public abstract class FessSearchAction extends FessBaseAction {
         runtime.registerData("username", username);
         runtime.registerData("adminUser", fessConfig.isAdminUser(username));
 
-        runtime.registerData("pageLoginLink", fessConfig.isPageLoginLink());
+        runtime.registerData("pageLoginLink", fessConfig.isLoginLinkEnabled());
     }
 
     // ===================================================================================

+ 0 - 27
src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java

@@ -496,9 +496,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
     /** The key of the configuration. e.g. true */
     String PAGING_PAGE_RANGE_FILL_LIMIT = "paging.page.range.fill.limit";
 
-    /** The key of the configuration. e.g. true */
-    String PAGE_LOGIN_LINK = "page.login.link";
-
     /** The key of the configuration. e.g. 1000 */
     String PAGE_DOCBOOST_MAX_FETCH_SIZE = "page.docboost.max.fetch.size";
 
@@ -2329,22 +2326,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
      */
     boolean isPagingPageRangeFillLimit();
 
-    /**
-     * Get the value for the key 'page.login.link'. <br>
-     * The value is, e.g. true <br>
-     * comment: The option 'loginLink' of page link button for search page
-     * @return The value of found property. (NotNull: if not found, exception but basically no way)
-     */
-    String getPageLoginLink();
-
-    /**
-     * Is the property for the key 'page.login.link' true? <br>
-     * The value is, e.g. true <br>
-     * comment: The option 'loginLink' of page link button for search page
-     * @return The determination, true or false. (if not found, exception but basically no way)
-     */
-    boolean isPageLoginLink();
-
     /**
      * Get the value for the key 'page.docboost.max.fetch.size'. <br>
      * The value is, e.g. 1000 <br>
@@ -4414,14 +4395,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             return is(FessConfig.PAGING_PAGE_RANGE_FILL_LIMIT);
         }
 
-        public String getPageLoginLink() {
-            return get(FessConfig.PAGE_LOGIN_LINK);
-        }
-
-        public boolean isPageLoginLink() {
-            return is(FessConfig.PAGE_LOGIN_LINK);
-        }
-
         public String getPageDocboostMaxFetchSize() {
             return get(FessConfig.PAGE_DOCBOOST_MAX_FETCH_SIZE);
         }

+ 8 - 0
src/main/java/org/codelibs/fess/mylasta/direction/FessProp.java

@@ -238,6 +238,14 @@ public interface FessProp {
         return getSystemPropertyAsBoolean(Constants.LOGIN_REQUIRED_PROPERTY, false);
     }
 
+    public default void setLoginLinkEnabled(final boolean value) {
+        setSystemPropertyAsBoolean(Constants.LOGIN_LINK_ENALBED_PROPERTY, value);
+    }
+
+    public default boolean isLoginLinkEnabled() {
+        return getSystemPropertyAsBoolean(Constants.LOGIN_LINK_ENALBED_PROPERTY, true);
+    }
+
     public default void setIncrementalCrawling(final boolean value) {
         setSystemPropertyAsBoolean(Constants.INCREMENTAL_CRAWLING_PROPERTY, value);
     }

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

@@ -291,9 +291,6 @@ paging.page.range.size = 3
 # The option 'fillLimit' of page range for paging
 paging.page.range.fill.limit = true
 
-# The option 'loginLink' of page link button for search page
-page.login.link = true
-
 # fetch page size
 page.docboost.max.fetch.size=1000
 page.keymatch.max.fetch.size=1000

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

@@ -77,6 +77,7 @@ labels.searchLog=Search Log
 labels.sort=Sort
 labels.start=Start Pos
 labels.loginRequired=Login Required
+labels.loginLink=Login Link
 labels.threadName=Thread Name
 labels.url=URL
 labels.userFavorite=Favorite Log
@@ -320,6 +321,7 @@ labels.default_label_value=Default Label Value
 labels.default_sort_value=Default Sort Value
 labels.append_query_param_enabled=Append Params to URL
 labels.login_required=Login Required
+labels.login_link=Login Link
 labels.ignore_failure_type=Excluded Failure Type
 labels.failure_count_threshold=Failure Count Threshold
 labels.popular_word_word_enabled=Popular Word Response

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

@@ -77,6 +77,7 @@ labels.searchLog=Search Log
 labels.sort=Sort
 labels.start=Start Pos
 labels.loginRequired=Login Required
+labels.loginLink=Login Link
 labels.threadName=Thread Name
 labels.url=URL
 labels.userFavorite=Favorite Log
@@ -320,6 +321,7 @@ labels.default_label_value=Default Label Value
 labels.default_sort_value=Default Sort Value
 labels.append_query_param_enabled=Append Params to URL
 labels.login_required=Login Required
+labels.login_link=Login Link
 labels.ignore_failure_type=Excluded Failure Type
 labels.failure_count_threshold=Failure Count Threshold
 labels.popular_word_word_enabled=Popular Word Response

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

@@ -77,6 +77,7 @@ labels.searchLog=\u691c\u7d22\u30ed\u30b0
 labels.sort=\u30bd\u30fc\u30c8
 labels.start=\u30b9\u30bf\u30fc\u30c8\u4f4d\u7f6e
 labels.loginRequired=\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981
+labels.loginLink=\u30ed\u30b0\u30a4\u30f3\u30ea\u30f3\u30af\u8868\u793a
 labels.threadName=\u30b9\u30ec\u30c3\u30c9\u540d
 labels.url=URL
 labels.userFavorite=\u304a\u6c17\u306b\u5165\u308a\u30ed\u30b0
@@ -316,6 +317,7 @@ labels.default_label_value=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30e9\u30d9\u30e
 labels.default_sort_value=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30bd\u30fc\u30c8\u5024
 labels.append_query_param_enabled=\u691c\u7d22\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8ffd\u52a0
 labels.login_required=\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981
+labels.login_link=\u30ed\u30b0\u30a4\u30f3\u30ea\u30f3\u30af\u8868\u793a
 labels.ignore_failure_type=\u9664\u5916\u3059\u308b\u30a8\u30e9\u30fc\u306e\u7a2e\u985e
 labels.failure_count_threshold=\u969c\u5bb3\u6570\u306e\u3057\u304d\u3044\u5024
 labels.popular_word_word_enabled=\u4eba\u6c17\u30ef\u30fc\u30c9\u306e\u30ec\u30b9\u30dd\u30f3\u30b9

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

@@ -57,6 +57,18 @@
 											</div>
 										</div>
 									</div>
+									<div class="form-group">
+										<label for="loginLink" class="col-sm-3 control-label"><la:message
+												key="labels.login_link" /></label>
+										<div class="col-sm-9">
+											<la:errors property="loginLink" />
+											<div class="checkbox">
+												<label> <la:checkbox property="loginLink" /> <la:message
+														key="labels.enabled" />
+												</label>
+											</div>
+										</div>
+									</div>
 									<div class="form-group">
 										<label for="defaultLabelValue" class="col-sm-3 control-label"><la:message
 												key="labels.default_label_value" /></label>