diff --git a/src/main/java/org/codelibs/fess/Constants.java b/src/main/java/org/codelibs/fess/Constants.java index 89a994a34..60cc1633c 100644 --- a/src/main/java/org/codelibs/fess/Constants.java +++ b/src/main/java/org/codelibs/fess/Constants.java @@ -324,5 +324,4 @@ public class Constants extends CoreLibConstants { public static final String PROCESS_TYPE_BOTH = "B"; public static final long ONE_DAY_IN_MILLIS = 24L * 60L * 60L * 1000L; - } diff --git a/src/main/java/org/codelibs/sastruts/core/SSCConstants.java b/src/main/java/org/codelibs/fess/SSCConstants.java similarity index 96% rename from src/main/java/org/codelibs/sastruts/core/SSCConstants.java rename to src/main/java/org/codelibs/fess/SSCConstants.java index 6e313bf9d..52bfd6856 100644 --- a/src/main/java/org/codelibs/sastruts/core/SSCConstants.java +++ b/src/main/java/org/codelibs/fess/SSCConstants.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core; +package org.codelibs.fess; import org.codelibs.core.CoreLibConstants; diff --git a/src/main/java/org/codelibs/fess/annotation/CronExpression.java b/src/main/java/org/codelibs/fess/annotation/CronExpression.java index bd75fd818..2ee243fb1 100644 --- a/src/main/java/org/codelibs/fess/annotation/CronExpression.java +++ b/src/main/java/org/codelibs/fess/annotation/CronExpression.java @@ -25,21 +25,21 @@ import org.codelibs.core.lang.StringUtil; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) -@Validator("cronExpression") +//@Validator("cronExpression") public @interface CronExpression { /** * A validation message. * * @return */ - Msg msg() default @Msg(key = "errors.cronexpression"); + //Msg msg() default @Msg(key = "errors.cronexpression"); /** * Argument for a message * * @return */ - Arg arg0() default @Arg(key = StringUtil.EMPTY); + //Arg arg0() default @Arg(key = StringUtil.EMPTY); /** * a target name for this validation diff --git a/src/main/java/org/codelibs/sastruts/core/annotation/Token.java b/src/main/java/org/codelibs/fess/annotation/Token.java similarity index 95% rename from src/main/java/org/codelibs/sastruts/core/annotation/Token.java rename to src/main/java/org/codelibs/fess/annotation/Token.java index bb55cbdc0..f53c35d0d 100644 --- a/src/main/java/org/codelibs/sastruts/core/annotation/Token.java +++ b/src/main/java/org/codelibs/fess/annotation/Token.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.annotation; +package org.codelibs.fess.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/org/codelibs/fess/annotation/UriType.java b/src/main/java/org/codelibs/fess/annotation/UriType.java index 4ffc901fa..6e0f9ef83 100644 --- a/src/main/java/org/codelibs/fess/annotation/UriType.java +++ b/src/main/java/org/codelibs/fess/annotation/UriType.java @@ -25,7 +25,7 @@ import org.codelibs.core.lang.StringUtil; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) -@Validator("uriType") +//@Validator("uriType") public @interface UriType { String protocols(); @@ -35,14 +35,14 @@ public @interface UriType { * * @return */ - Msg msg() default @Msg(key = "errors.cronexpression"); + //Msg msg() default @Msg(key = "errors.cronexpression"); /** * Argument for a message * * @return */ - Arg arg0() default @Arg(key = StringUtil.EMPTY); + //Arg arg0() default @Arg(key = StringUtil.EMPTY); /** * a target name for this validation diff --git a/src/main/java/org/codelibs/sastruts/core/annotation/User.java b/src/main/java/org/codelibs/fess/annotation/User.java similarity index 95% rename from src/main/java/org/codelibs/sastruts/core/annotation/User.java rename to src/main/java/org/codelibs/fess/annotation/User.java index 182304d50..ef79bafde 100644 --- a/src/main/java/org/codelibs/sastruts/core/annotation/User.java +++ b/src/main/java/org/codelibs/fess/annotation/User.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.annotation; +package org.codelibs.fess.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/org/codelibs/fess/web/AppletForm.java b/src/main/java/org/codelibs/fess/app/web/AppletForm.java similarity index 93% rename from src/main/java/org/codelibs/fess/web/AppletForm.java rename to src/main/java/org/codelibs/fess/app/web/AppletForm.java index 2db9c2658..de688a1fb 100644 --- a/src/main/java/org/codelibs/fess/web/AppletForm.java +++ b/src/main/java/org/codelibs/fess/app/web/AppletForm.java @@ -14,10 +14,10 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web; +package org.codelibs.fess.app.web; public class AppletForm { - @Required + //@Required public String uri; public String encoding; diff --git a/src/main/java/org/codelibs/fess/web/ErrorAction.java b/src/main/java/org/codelibs/fess/app/web/ErrorAction.java similarity index 82% rename from src/main/java/org/codelibs/fess/web/ErrorAction.java rename to src/main/java/org/codelibs/fess/app/web/ErrorAction.java index ba9a82891..4acb3f4a4 100644 --- a/src/main/java/org/codelibs/fess/web/ErrorAction.java +++ b/src/main/java/org/codelibs/fess/app/web/ErrorAction.java @@ -14,34 +14,32 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web; +package org.codelibs.fess.app.web; import javax.annotation.Resource; -import org.lastaflute.web.Execute; - public class ErrorAction { - @ActionForm + //@ActionForm @Resource protected ErrorForm errorForm; - @Execute(validator = false) + //@Execute(validator = false) public String index() { return "notFound.jsp"; } - @Execute(validator = false) + //@Execute(validator = false) public String systemError() { return "system.jsp"; } - @Execute(validator = false) + //@Execute(validator = false) public String badRequest() { return "badRequest.jsp"; } - @Execute(validator = false) + //@Execute(validator = false) public String notFound() { return "notFound.jsp"; } diff --git a/src/main/java/org/codelibs/fess/web/ErrorForm.java b/src/main/java/org/codelibs/fess/app/web/ErrorForm.java similarity index 95% rename from src/main/java/org/codelibs/fess/web/ErrorForm.java rename to src/main/java/org/codelibs/fess/app/web/ErrorForm.java index d53927591..29b6c556b 100644 --- a/src/main/java/org/codelibs/fess/web/ErrorForm.java +++ b/src/main/java/org/codelibs/fess/app/web/ErrorForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web; +package org.codelibs.fess.app.web; import java.io.Serializable; diff --git a/src/main/java/org/codelibs/fess/web/IndexAction.java b/src/main/java/org/codelibs/fess/app/web/IndexAction.java similarity index 97% rename from src/main/java/org/codelibs/fess/web/IndexAction.java rename to src/main/java/org/codelibs/fess/app/web/IndexAction.java index a468803b3..9c34ad017 100644 --- a/src/main/java/org/codelibs/fess/web/IndexAction.java +++ b/src/main/java/org/codelibs/fess/app/web/IndexAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web; +package org.codelibs.fess.app.web; import java.awt.Desktop; import java.beans.Beans; @@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.io.IOUtils; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.io.InputStreamUtil; import org.codelibs.core.io.OutputStreamUtil; import org.codelibs.core.lang.StringUtil; @@ -55,6 +56,7 @@ import org.codelibs.core.net.URLUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.InvalidQueryException; import org.codelibs.fess.ResultOffsetExceededException; +import org.codelibs.fess.SSCConstants; import org.codelibs.fess.UnsupportedSearchException; import org.codelibs.fess.client.FessEsClient; import org.codelibs.fess.client.FessEsClient.SearchConditionBuilder; @@ -62,6 +64,7 @@ import org.codelibs.fess.entity.LoginInfo; import org.codelibs.fess.es.exentity.ClickLog; import org.codelibs.fess.es.exentity.SearchLog; import org.codelibs.fess.es.exentity.UserInfo; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.CrawlingConfigHelper; import org.codelibs.fess.helper.FieldHelper; import org.codelibs.fess.helper.HotSearchWordHelper; @@ -81,12 +84,10 @@ import org.codelibs.fess.util.MoreLikeThisResponse; import org.codelibs.fess.util.QueryResponseList; import org.codelibs.fess.util.WebApiUtil; import org.codelibs.robot.util.CharUtil; -import org.codelibs.sastruts.core.SSCConstants; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; import org.dbflute.optional.OptionalEntity; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.TermQueryBuilder; -import org.lastaflute.web.Execute; +import org.lastaflute.taglib.function.LaFunctions; import org.lastaflute.web.util.LaRequestUtil; import org.lastaflute.web.util.LaResponseUtil; import org.slf4j.Logger; @@ -112,7 +113,7 @@ public class IndexAction { protected static final Pattern FIELD_EXTRACTION_PATTERN = Pattern.compile("^([a-zA-Z0-9_]+):.*"); - @ActionForm + //@ActionForm @Resource protected IndexForm indexForm; @@ -267,7 +268,7 @@ public class IndexAction { return pagingQuery; } - @Execute(validator = false, input = "index.jsp") + //@Execute(validator = false, input = "index.jsp") public String index() { searchAvailable(); @@ -313,7 +314,7 @@ public class IndexAction { return "search.jsp"; } - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String cache() { Map doc = null; try { @@ -343,7 +344,7 @@ public class IndexAction { return null; } - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String go() throws IOException { Map doc = null; try { @@ -451,7 +452,7 @@ public class IndexAction { return null; } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String search() { if (viewHelper.isUseSession() && StringUtil.isNotBlank(indexForm.num)) { normalizePageNum(); @@ -464,22 +465,22 @@ public class IndexAction { return doSearch(); } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String prev() { return doMove(-1); } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String next() { return doMove(1); } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String move() { return doMove(0); } - @Execute(validator = false) + //@Execute(validator = false) public String screenshot() { OutputStream out = null; BufferedInputStream in = null; @@ -521,7 +522,7 @@ public class IndexAction { return null; } - @Execute(validator = false) + //@Execute(validator = false) public String searchApi() { try { WebApiUtil.setObject("searchQuery", doSearchInternal()); @@ -541,7 +542,7 @@ public class IndexAction { return null; } - @Execute(validator = false) + //@Execute(validator = false) public String suggestApi() { if (Constants.FALSE.equals(crawlerProperties.getProperty(Constants.WEB_API_SUGGEST_PROPERTY, Constants.TRUE))) { WebApiUtil.setError(9, "Unsupported operation."); @@ -604,7 +605,7 @@ public class IndexAction { return null; } - @Execute(validator = false) + //@Execute(validator = false) public String hotSearchWordApi() { if (Constants.FALSE.equals(crawlerProperties.getProperty(Constants.WEB_API_HOT_SEARCH_WORD_PROPERTY, Constants.TRUE))) { WebApiUtil.setError(9, "Unsupported operation."); @@ -637,7 +638,7 @@ public class IndexAction { } - @Execute(validator = false) + //@Execute(validator = false) public String favoriteApi() { if (Constants.FALSE.equals(crawlerProperties.getProperty(Constants.USER_FAVORITE_PROPERTY, Constants.FALSE))) { WebApiUtil.setError(9, "Unsupported operation."); @@ -704,13 +705,13 @@ public class IndexAction { } - @Execute(validator = false) + //@Execute(validator = false) public String osdd() { openSearchHelper.write(LaResponseUtil.getResponse()); return null; } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String help() { buildViewParams(); buildInitParams(); @@ -931,10 +932,9 @@ public class IndexAction { appendHighlightQueries = buf.toString(); } - Beans.copy(documentItems, this) - .includes("pageSize", "currentPageNumber", "allRecordCount", "allPageCount", "existNextPage", "existPrevPage", - "currentStartRecordNumber", "currentEndRecordNumber", "pageNumberList", "partialResults", "queryTime", "searchTime") - .execute(); + BeanUtil.copyBeanToBean(documentItems, this, option -> option.include("pageSize", "currentPageNumber", "allRecordCount", + "allPageCount", "existNextPage", "existPrevPage", "currentStartRecordNumber", "currentEndRecordNumber", "pageNumberList", + "partialResults", "queryTime", "searchTime")); return query; } diff --git a/src/main/java/org/codelibs/fess/web/IndexForm.java b/src/main/java/org/codelibs/fess/app/web/IndexForm.java similarity index 73% rename from src/main/java/org/codelibs/fess/web/IndexForm.java rename to src/main/java/org/codelibs/fess/app/web/IndexForm.java index 0ef5cc09d..f26a4cb20 100644 --- a/src/main/java/org/codelibs/fess/web/IndexForm.java +++ b/src/main/java/org/codelibs/fess/app/web/IndexForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web; +package org.codelibs.fess.app.web; import java.io.Serializable; @@ -26,61 +26,61 @@ public class IndexForm implements Serializable { private static final long serialVersionUID = 1L; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String query; public String additional[]; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String sort; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String op; - @IntegerType + //@IntegerType public String start; - @IntegerType + //@IntegerType public String pn; - @IntegerType + //@IntegerType public String num; public String[] lang; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String queryId; public SearchParamMap fields = new SearchParamMap(); // response redirect - @Required(target = "go") - @Maxbytelength(maxbytelength = 4000) + //@Required(target = "go") + //@Maxbytelength(maxbytelength = 4000) public String rt; - @Required(target = "go,cache") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "go,cache") + //@Maxbytelength(maxbytelength = 100) public String docId; public String[] hq; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String hash; // xml/json - @Maxbytelength(maxbytelength = 20) + //@Maxbytelength(maxbytelength = 20) public String type; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String callback; public String[] fn; // hotsearchword - @Maxbytelength(maxbytelength = 100) + //@Maxbytelength(maxbytelength = 100) public String range; // geo diff --git a/src/main/java/org/codelibs/fess/web/LoginAction.java b/src/main/java/org/codelibs/fess/app/web/LoginAction.java similarity index 95% rename from src/main/java/org/codelibs/fess/web/LoginAction.java rename to src/main/java/org/codelibs/fess/app/web/LoginAction.java index 9cd26568e..84f8d5a8c 100644 --- a/src/main/java/org/codelibs/fess/web/LoginAction.java +++ b/src/main/java/org/codelibs/fess/app/web/LoginAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web; +package org.codelibs.fess.app.web; import java.io.IOException; import java.io.Serializable; @@ -33,12 +33,11 @@ import org.codelibs.core.crypto.CachedCipher; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.FessSystemException; +import org.codelibs.fess.SSCConstants; import org.codelibs.fess.entity.LoginInfo; import org.codelibs.fess.helper.SystemHelper; +import org.codelibs.fess.util.ActivityUtil; import org.codelibs.fess.util.ComponentUtil; -import org.codelibs.sastruts.core.SSCConstants; -import org.codelibs.sastruts.core.util.ActivityUtil; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaRequestUtil; import org.lastaflute.web.util.LaResponseUtil; import org.slf4j.Logger; @@ -49,14 +48,14 @@ public class LoginAction implements Serializable { private static final long serialVersionUID = 1L; - @ActionForm + //@ActionForm @Resource protected LoginForm loginForm; @Resource protected SystemHelper systemHelper; - @Execute(validator = false, input = "../index") + //@Execute(validator = false, input = "../index") public String index() { final HttpServletRequest request = LaRequestUtil.getRequest(); final HttpSession session = request.getSession(); @@ -101,7 +100,7 @@ public class LoginAction implements Serializable { return "login?redirect=true"; } - @Execute(validator = false, input = "../index") + //@Execute(validator = false, input = "../index") public String login() { final HttpServletRequest request = LaRequestUtil.getRequest(); final HttpSession oldSession = request.getSession(); @@ -183,7 +182,7 @@ public class LoginAction implements Serializable { return returnPath; } - @Execute(validator = false, input = "../index") + //@Execute(validator = false, input = "../index") public String logout() { final HttpServletRequest request = LaRequestUtil.getRequest(); ActivityUtil.logout(request.getRemoteUser(), request); diff --git a/src/main/java/org/codelibs/fess/web/LoginForm.java b/src/main/java/org/codelibs/fess/app/web/LoginForm.java similarity index 95% rename from src/main/java/org/codelibs/fess/web/LoginForm.java rename to src/main/java/org/codelibs/fess/app/web/LoginForm.java index 1c48b029b..c3b268834 100644 --- a/src/main/java/org/codelibs/fess/web/LoginForm.java +++ b/src/main/java/org/codelibs/fess/app/web/LoginForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web; +package org.codelibs.fess.app.web; import java.io.Serializable; diff --git a/src/main/java/org/codelibs/fess/app/web/RootAction.java b/src/main/java/org/codelibs/fess/app/web/RootAction.java index d9e340ecd..1ea3228a9 100644 --- a/src/main/java/org/codelibs/fess/app/web/RootAction.java +++ b/src/main/java/org/codelibs/fess/app/web/RootAction.java @@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.io.IOUtils; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.io.InputStreamUtil; import org.codelibs.core.io.OutputStreamUtil; import org.codelibs.core.lang.StringUtil; @@ -55,6 +56,7 @@ import org.codelibs.core.net.URLUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.InvalidQueryException; import org.codelibs.fess.ResultOffsetExceededException; +import org.codelibs.fess.SSCConstants; import org.codelibs.fess.UnsupportedSearchException; import org.codelibs.fess.client.FessEsClient; import org.codelibs.fess.client.FessEsClient.SearchConditionBuilder; @@ -62,6 +64,7 @@ import org.codelibs.fess.entity.LoginInfo; import org.codelibs.fess.es.exentity.ClickLog; import org.codelibs.fess.es.exentity.SearchLog; import org.codelibs.fess.es.exentity.UserInfo; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.CrawlingConfigHelper; import org.codelibs.fess.helper.FieldHelper; import org.codelibs.fess.helper.HotSearchWordHelper; @@ -81,13 +84,10 @@ import org.codelibs.fess.util.MoreLikeThisResponse; import org.codelibs.fess.util.QueryResponseList; import org.codelibs.fess.util.WebApiUtil; import org.codelibs.robot.util.CharUtil; -import org.codelibs.sastruts.core.SSCConstants; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; import org.dbflute.optional.OptionalEntity; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.TermQueryBuilder; import org.lastaflute.taglib.function.LaFunctions; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaRequestUtil; import org.lastaflute.web.util.LaResponseUtil; import org.slf4j.Logger; @@ -113,7 +113,7 @@ public class RootAction { protected static final Pattern FIELD_EXTRACTION_PATTERN = Pattern.compile("^([a-zA-Z0-9_]+):.*"); - @ActionForm + //@ActionForm @Resource protected IndexForm indexForm; @@ -268,7 +268,7 @@ public class RootAction { return pagingQuery; } - @Execute(validator = false, input = "index.jsp") + //@Execute(validator = false, input = "index.jsp") public String index() { searchAvailable(); @@ -314,7 +314,7 @@ public class RootAction { return "search.jsp"; } - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String cache() { Map doc = null; try { @@ -344,7 +344,7 @@ public class RootAction { return null; } - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String go() throws IOException { Map doc = null; try { @@ -452,7 +452,7 @@ public class RootAction { return null; } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String search() { if (viewHelper.isUseSession() && StringUtil.isNotBlank(indexForm.num)) { normalizePageNum(); @@ -465,22 +465,22 @@ public class RootAction { return doSearch(); } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String prev() { return doMove(-1); } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String next() { return doMove(1); } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String move() { return doMove(0); } - @Execute(validator = false) + //@Execute(validator = false) public String screenshot() { OutputStream out = null; BufferedInputStream in = null; @@ -522,7 +522,7 @@ public class RootAction { return null; } - @Execute(validator = false) + //@Execute(validator = false) public String searchApi() { try { WebApiUtil.setObject("searchQuery", doSearchInternal()); @@ -542,7 +542,7 @@ public class RootAction { return null; } - @Execute(validator = false) + //@Execute(validator = false) public String suggestApi() { if (Constants.FALSE.equals(crawlerProperties.getProperty(Constants.WEB_API_SUGGEST_PROPERTY, Constants.TRUE))) { WebApiUtil.setError(9, "Unsupported operation."); @@ -605,7 +605,7 @@ public class RootAction { return null; } - @Execute(validator = false) + //@Execute(validator = false) public String hotSearchWordApi() { if (Constants.FALSE.equals(crawlerProperties.getProperty(Constants.WEB_API_HOT_SEARCH_WORD_PROPERTY, Constants.TRUE))) { WebApiUtil.setError(9, "Unsupported operation."); @@ -638,7 +638,7 @@ public class RootAction { } - @Execute(validator = false) + //@Execute(validator = false) public String favoriteApi() { if (Constants.FALSE.equals(crawlerProperties.getProperty(Constants.USER_FAVORITE_PROPERTY, Constants.FALSE))) { WebApiUtil.setError(9, "Unsupported operation."); @@ -705,13 +705,13 @@ public class RootAction { } - @Execute(validator = false) + //@Execute(validator = false) public String osdd() { openSearchHelper.write(LaResponseUtil.getResponse()); return null; } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String help() { buildViewParams(); buildInitParams(); @@ -932,10 +932,9 @@ public class RootAction { appendHighlightQueries = buf.toString(); } - Beans.copy(documentItems, this) - .includes("pageSize", "currentPageNumber", "allRecordCount", "allPageCount", "existNextPage", "existPrevPage", - "currentStartRecordNumber", "currentEndRecordNumber", "pageNumberList", "partialResults", "queryTime", "searchTime") - .execute(); + BeanUtil.copyBeanToBean(documentItems, this, option -> option.include("pageSize", "currentPageNumber", "allRecordCount", + "allPageCount", "existNextPage", "existPrevPage", "currentStartRecordNumber", "currentEndRecordNumber", "pageNumberList", + "partialResults", "queryTime", "searchTime")); return query; } diff --git a/src/main/java/org/codelibs/fess/web/admin/BoostDocumentRuleAction.java b/src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/BoostDocumentRuleAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleAction.java index dc4dcdeba..0f760fdb0 100644 --- a/src/main/java/org/codelibs/fess/web/admin/BoostDocumentRuleAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,18 +23,19 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.BoostDocumentRule; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.BoostDocumentRulePager; import org.codelibs.fess.service.BoostDocumentRuleService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +49,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected BoostDocumentRuleForm boostDocumentRuleForm; @@ -70,9 +71,8 @@ public class BoostDocumentRuleAction extends FessAdminAction { boostDocumentRuleItems = boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager); // restore from pager - Beans.copy(boostDocumentRulePager, boostDocumentRuleForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(boostDocumentRulePager, boostDocumentRuleForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -81,12 +81,12 @@ public class BoostDocumentRuleAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(boostDocumentRuleForm.pageNumber)) { @@ -102,32 +102,33 @@ public class BoostDocumentRuleAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(boostDocumentRuleForm.searchParams, boostDocumentRulePager).excludes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(boostDocumentRuleForm.searchParams, boostDocumentRulePager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { boostDocumentRulePager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (boostDocumentRuleForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -140,7 +141,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi boostDocumentRuleForm.initialize(); @@ -150,7 +151,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (boostDocumentRuleForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -163,7 +164,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { boostDocumentRuleForm.crudMode = CommonConstants.EDIT_MODE; @@ -173,19 +174,19 @@ public class BoostDocumentRuleAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (boostDocumentRuleForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -198,7 +199,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { boostDocumentRuleForm.crudMode = CommonConstants.DELETE_MODE; @@ -208,7 +209,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final BoostDocumentRule boostDocumentRule = createBoostDocumentRule(); @@ -229,7 +230,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final BoostDocumentRule boostDocumentRule = createBoostDocumentRule(); @@ -265,7 +266,7 @@ public class BoostDocumentRuleAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { boostDocumentRuleForm.id }); } - FessBeans.copy(boostDocumentRule, boostDocumentRuleForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(boostDocumentRule, boostDocumentRuleForm, option -> option.exclude("searchParams", "mode")); } protected BoostDocumentRule createBoostDocumentRule() { @@ -285,12 +286,12 @@ public class BoostDocumentRuleAction extends FessAdminAction { } boostDocumentRule.setUpdatedBy(username); boostDocumentRule.setUpdatedTime(currentTime); - FessBeans.copy(boostDocumentRuleForm, boostDocumentRule).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(boostDocumentRuleForm, boostDocumentRule, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return boostDocumentRule; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (boostDocumentRuleForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/BoostDocumentRuleForm.java b/src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleForm.java similarity index 63% rename from src/main/java/org/codelibs/fess/web/admin/BoostDocumentRuleForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleForm.java index dbead69bc..a83624f23 100644 --- a/src/main/java/org/codelibs/fess/web/admin/BoostDocumentRuleForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.util.HashMap; import java.util.Map; @@ -22,51 +22,51 @@ import java.util.Map; import org.codelibs.fess.util.ComponentUtil; public class BoostDocumentRuleForm { - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 4000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 4000) public String urlExpr; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 4000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 4000) public String boostExpr; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntegerType - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntegerType + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/CrawlAction.java b/src/main/java/org/codelibs/fess/app/web/admin/CrawlAction.java similarity index 97% rename from src/main/java/org/codelibs/fess/web/admin/CrawlAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/CrawlAction.java index 3e8d3b8ee..e42e729c1 100644 --- a/src/main/java/org/codelibs/fess/web/admin/CrawlAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/CrawlAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.ArrayList; @@ -27,11 +27,10 @@ import javax.annotation.Resource; import org.codelibs.core.lang.StringUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.crud.util.SAStrutsUtil; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaRequestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +40,7 @@ public class CrawlAction implements Serializable { private static final long serialVersionUID = 1L; - @ActionForm + //@ActionForm @Resource protected CrawlForm crawlForm; @@ -90,13 +89,13 @@ public class CrawlAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false) + //@Execute(validator = false) public String index() { return showIndex(false); } @Token(save = false, validate = true) - @Execute(validator = true, input = "index.jsp") + //@Execute(validator = true, input = "index.jsp") public String update() { crawlerProperties.setProperty(Constants.DIFF_CRAWLING_PROPERTY, crawlForm.diffCrawling != null && Constants.ON.equalsIgnoreCase(crawlForm.diffCrawling) ? Constants.TRUE : Constants.FALSE); diff --git a/src/main/java/org/codelibs/fess/web/admin/CrawlForm.java b/src/main/java/org/codelibs/fess/app/web/admin/CrawlForm.java similarity index 60% rename from src/main/java/org/codelibs/fess/web/admin/CrawlForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/CrawlForm.java index de171ead7..024226335 100644 --- a/src/main/java/org/codelibs/fess/web/admin/CrawlForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/CrawlForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; @@ -22,78 +22,78 @@ public class CrawlForm implements Serializable { private static final long serialVersionUID = 1L; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String diffCrawling; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String useAclAsRole; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String serverRotation; - @Required - @IntRange(min = -1, max = 1000) + //@Required + //@IntRange(min = -1, max = 1000) public String dayForCleanup; - @Required - @LongRange(min = 0, max = 100) + //@Required + //@LongRange(min = 0, max = 100) public String crawlingThreadCount; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String searchLog; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String userInfo; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String userFavorite; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String webApiXml; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String webApiJson; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String defaultLabelValue; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String appendQueryParameter; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String supportedSearch; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String ignoreFailureType; - @IntRange(min = -1, max = 10000) + //@IntRange(min = -1, max = 10000) public String failureCountThreshold; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String hotSearchWord; - @Required - @Maxbytelength(maxbytelength = 20) + //@Required + //@Maxbytelength(maxbytelength = 20) public String csvFileEncoding; - @IntRange(min = 0, max = 100000) + //@IntRange(min = 0, max = 100000) public String purgeSearchLogDay; - @IntRange(min = 0, max = 100000) + //@IntRange(min = 0, max = 100000) public String purgeJobLogDay; - @IntRange(min = 0, max = 100000) + //@IntRange(min = 0, max = 100000) public String purgeUserInfoDay; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String purgeByBots; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String notificationTo; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String suggestSearchLog; - @IntRange(min = 0, max = 100000) + //@IntRange(min = 0, max = 100000) public String purgeSuggestSearchLogDay; } diff --git a/src/main/java/org/codelibs/fess/web/admin/CrawlingSessionAction.java b/src/main/java/org/codelibs/fess/app/web/admin/CrawlingSessionAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/CrawlingSessionAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/CrawlingSessionAction.java index 613874339..f629c717b 100644 --- a/src/main/java/org/codelibs/fess/web/admin/CrawlingSessionAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/CrawlingSessionAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.Collections; @@ -24,6 +24,9 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; @@ -33,9 +36,6 @@ import org.codelibs.fess.helper.JobHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.CrawlingSessionPager; import org.codelibs.fess.service.CrawlingSessionService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,7 +47,7 @@ public class CrawlingSessionAction extends FessAdminAction { public List crawlingSessionItems; // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected CrawlingSessionForm crawlingSessionForm; @@ -72,9 +72,8 @@ public class CrawlingSessionAction extends FessAdminAction { crawlingSessionItems = crawlingSessionService.getCrawlingSessionList(crawlingSessionPager); // restore from pager - Beans.copy(crawlingSessionPager, crawlingSessionForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(crawlingSessionPager, crawlingSessionForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -90,19 +89,19 @@ public class CrawlingSessionAction extends FessAdminAction { return Collections.emptyList(); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deleteall() { crawlingSessionService.deleteOldSessions(jobHelper.getRunningSessionIdSet()); SAStrutsUtil.addSessionMessage("success.crawling_session_delete_all"); return displayList(true); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(crawlingSessionForm.pageNumber)) { @@ -118,34 +117,33 @@ public class CrawlingSessionAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(crawlingSessionForm.searchParams, crawlingSessionPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(crawlingSessionForm.searchParams, crawlingSessionPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { crawlingSessionPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (crawlingSessionForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -158,7 +156,7 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi crawlingSessionForm.initialize(); @@ -168,7 +166,7 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (crawlingSessionForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -181,7 +179,7 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { crawlingSessionForm.crudMode = CommonConstants.EDIT_MODE; @@ -191,19 +189,19 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (crawlingSessionForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -216,7 +214,7 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { crawlingSessionForm.crudMode = CommonConstants.DELETE_MODE; @@ -226,7 +224,7 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final CrawlingSession crawlingSession = createCrawlingSession(); @@ -247,7 +245,7 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final CrawlingSession crawlingSession = createCrawlingSession(); @@ -268,7 +266,7 @@ public class CrawlingSessionAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (crawlingSessionForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -312,9 +310,7 @@ public class CrawlingSessionAction extends FessAdminAction { } - Beans.copy(crawlingSession, crawlingSessionForm).excludes("searchParams", "mode") - - .execute(); + BeanUtil.copyBeanToBean(crawlingSession, crawlingSessionForm, option -> option.exclude("searchParams", "mode")); } protected CrawlingSession createCrawlingSession() { @@ -331,9 +327,7 @@ public class CrawlingSessionAction extends FessAdminAction { } else { crawlingSession = new CrawlingSession(); } - Beans.copy(crawlingSessionForm, crawlingSession).excludes("searchParams", "mode") - - .execute(); + BeanUtil.copyBeanToBean(crawlingSessionForm, crawlingSession, option -> option.exclude("searchParams", "mode")); return crawlingSession; } diff --git a/src/main/java/org/codelibs/fess/web/admin/CrawlingSessionForm.java b/src/main/java/org/codelibs/fess/app/web/admin/CrawlingSessionForm.java similarity index 76% rename from src/main/java/org/codelibs/fess/web/admin/CrawlingSessionForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/CrawlingSessionForm.java index 82377b712..e99cc77fd 100644 --- a/src/main/java/org/codelibs/fess/web/admin/CrawlingSessionForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/CrawlingSessionForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -24,34 +24,34 @@ public class CrawlingSessionForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 20) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 20) public String sessionId; - @Maxbytelength(maxbytelength = 20) + //@Maxbytelength(maxbytelength = 20) public String name; - @DateType + //@DateType public String expiredTime; - @Required(target = "confirmfromupdate,update,delete") - @DateType + //@Required(target = "confirmfromupdate,update,delete") + //@DateType public String createdTime; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/DataAction.java b/src/main/java/org/codelibs/fess/app/web/admin/DataAction.java similarity index 95% rename from src/main/java/org/codelibs/fess/web/admin/DataAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/DataAction.java index 2dd552a09..69023d209 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DataAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DataAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.BufferedInputStream; import java.io.BufferedReader; @@ -36,14 +36,14 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.codelibs.core.CoreLibConstants; +import org.codelibs.core.io.CopyUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; import org.codelibs.fess.FessSystemException; import org.codelibs.fess.crud.util.SAStrutsUtil; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.service.CrawlingSessionService; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,7 +55,7 @@ public class DataAction implements Serializable { private static final Logger logger = LoggerFactory.getLogger(DataAction.class); @Resource - @ActionForm + //@ActionForm protected DataForm dataForm; @Resource @@ -71,14 +71,14 @@ public class DataAction implements Serializable { return systemHelper.getHelpLink("data"); } - @Execute(validator = false) + //@Execute(validator = false) public String index() { // set a default value dataForm.overwrite = "on"; return "index.jsp"; } - @Execute(validator = false) + //@Execute(validator = false) public String downloadCrawlingSession() { final DateFormat df = new SimpleDateFormat(CoreLibConstants.DATE_FORMAT_DIGIT_ONLY); final StringBuilder buf = new StringBuilder(); @@ -106,7 +106,7 @@ public class DataAction implements Serializable { } } - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String upload() { final String fileName = dataForm.uploadedFile.getFileName(); if (fileName.endsWith(".csv")) { @@ -123,7 +123,7 @@ public class DataAction implements Serializable { } is.reset(); fos = new FileOutputStream(tempFile); - StreamUtil.drain(is, fos); + CopyUtil.copy(is, fos); } catch (final Exception e) { if (tempFile != null && !tempFile.delete()) { logger.warn("Could not delete " + tempFile.getAbsolutePath()); diff --git a/src/main/java/org/codelibs/fess/web/admin/DataConfigAction.java b/src/main/java/org/codelibs/fess/app/web/admin/DataConfigAction.java similarity index 84% rename from src/main/java/org/codelibs/fess/web/admin/DataConfigAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/DataConfigAction.java index 6772f0b82..3c7e46a55 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DataConfigAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DataConfigAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.ArrayList; @@ -24,7 +24,11 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.Constants; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -33,16 +37,13 @@ import org.codelibs.fess.ds.DataStoreFactory; import org.codelibs.fess.es.exentity.DataConfig; import org.codelibs.fess.es.exentity.LabelType; import org.codelibs.fess.es.exentity.RoleType; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.DataConfigPager; import org.codelibs.fess.service.DataConfigService; import org.codelibs.fess.service.FailureUrlService; import org.codelibs.fess.service.LabelTypeService; import org.codelibs.fess.service.RoleTypeService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,7 +57,7 @@ public class DataConfigAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected DataConfigForm dataConfigForm; @@ -90,9 +91,8 @@ public class DataConfigAction extends FessAdminAction { dataConfigItems = dataConfigService.getDataConfigList(dataConfigPager); // restore from pager - Beans.copy(dataConfigPager, dataConfigForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(dataConfigPager, dataConfigForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -101,12 +101,12 @@ public class DataConfigAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(dataConfigForm.pageNumber)) { @@ -122,34 +122,33 @@ public class DataConfigAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(dataConfigForm.searchParams, dataConfigPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(dataConfigForm.searchParams, dataConfigPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { dataConfigPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (dataConfigForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -162,7 +161,7 @@ public class DataConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi dataConfigForm.initialize(); @@ -172,7 +171,7 @@ public class DataConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (dataConfigForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -185,7 +184,7 @@ public class DataConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { dataConfigForm.crudMode = CommonConstants.EDIT_MODE; @@ -195,19 +194,19 @@ public class DataConfigAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (dataConfigForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -220,7 +219,7 @@ public class DataConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { dataConfigForm.crudMode = CommonConstants.DELETE_MODE; @@ -230,7 +229,7 @@ public class DataConfigAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final DataConfig dataConfig = createDataConfig(); @@ -251,7 +250,7 @@ public class DataConfigAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final DataConfig dataConfig = createDataConfig(); @@ -287,7 +286,7 @@ public class DataConfigAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { dataConfigForm.id }); } - FessBeans.copy(dataConfig, dataConfigForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(dataConfig, dataConfigForm, option -> option.excludes("searchParams", "mode")); // normalize boost if (dataConfigForm.boost != null && dataConfigForm.boost.indexOf('.') > 0) { @@ -312,12 +311,12 @@ public class DataConfigAction extends FessAdminAction { } dataConfig.setUpdatedBy(username); dataConfig.setUpdatedTime(currentTime); - FessBeans.copy(dataConfigForm, dataConfig).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(dataConfigForm, dataConfig, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return dataConfig; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (dataConfigForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/DataConfigForm.java b/src/main/java/org/codelibs/fess/app/web/admin/DataConfigForm.java similarity index 63% rename from src/main/java/org/codelibs/fess/web/admin/DataConfigForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/DataConfigForm.java index 3d9f9a3c2..61bc4f9b3 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DataConfigForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DataConfigForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -30,64 +30,64 @@ public class DataConfigForm implements Serializable { public String[] labelTypeIds; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 200) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 200) public String name; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 4000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 4000) public String handlerName; public String handlerParameter; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String handlerScript; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String boost; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 5) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 5) public String available; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/DataForm.java b/src/main/java/org/codelibs/fess/app/web/admin/DataForm.java similarity index 89% rename from src/main/java/org/codelibs/fess/web/admin/DataForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/DataForm.java index 404d3023a..bb2648a1c 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DataForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DataForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; @@ -22,8 +22,8 @@ public class DataForm implements Serializable { private static final long serialVersionUID = 1L; - @Required - public FormFile uploadedFile; + //@Required + //public FormFile uploadedFile; public String overwrite; } diff --git a/src/main/java/org/codelibs/fess/web/admin/DesignAction.java b/src/main/java/org/codelibs/fess/app/web/admin/DesignAction.java similarity index 88% rename from src/main/java/org/codelibs/fess/web/admin/DesignAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/DesignAction.java index 0bd8b0c92..1c6e9a8ef 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DesignAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DesignAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.BufferedInputStream; import java.io.File; @@ -29,16 +29,17 @@ import javax.annotation.Resource; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; +import org.codelibs.core.io.FileUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; import org.codelibs.fess.FessSystemException; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.crud.util.SAStrutsUtil; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaResponseUtil; +import org.lastaflute.web.util.LaServletContextUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,7 +48,7 @@ public class DesignAction implements Serializable { private static final Logger logger = LoggerFactory.getLogger(DesignAction.class); - @ActionForm + //@ActionForm @Resource protected DesignForm designForm; @@ -66,7 +67,7 @@ public class DesignAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String index() { checkEditorStatus(); loadFileNameItems(); @@ -74,7 +75,7 @@ public class DesignAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false) + //@Execute(validator = false) public String back() { checkEditorStatus(); loadFileNameItems(); @@ -94,7 +95,7 @@ public class DesignAction implements Serializable { return false; } - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String upload() { checkEditorStatus(); final String uploadedFileName = designForm.designFile.getFileName(); @@ -133,7 +134,7 @@ public class DesignAction implements Serializable { throw new SSCActionMessagesException("errors.design_file_is_unsupported_type"); } - final File uploadFile = new File(ServletContextUtil.getServletContext().getRealPath(baseDir + fileName)); + final File uploadFile = new File(LaServletContextUtil.getServletContext().getRealPath(baseDir + fileName)); final File parentFile = uploadFile.getParentFile(); if (!parentFile.exists() && !parentFile.mkdirs()) { logger.warn("Could not create " + parentFile.getAbsolutePath()); @@ -151,14 +152,14 @@ public class DesignAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String edit() { checkEditorStatus(); final String jspType = "view"; final File jspFile = getJspFile(jspType); try { - designForm.content = new String(FileUtil.getBytes(jspFile), Constants.UTF_8); + designForm.content = new String(FileUtil.readBytes(jspFile), Constants.UTF_8); } catch (final UnsupportedEncodingException e) { throw new FessSystemException("Invalid encoding", e); } @@ -167,14 +168,14 @@ public class DesignAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String editAsUseDefault() { checkEditorStatus(); final String jspType = "orig/view"; final File jspFile = getJspFile(jspType); try { - designForm.content = new String(FileUtil.getBytes(jspFile), Constants.UTF_8); + designForm.content = new String(FileUtil.readBytes(jspFile), Constants.UTF_8); } catch (final UnsupportedEncodingException e) { throw new FessSystemException("Invalid encoding", e); } @@ -183,7 +184,7 @@ public class DesignAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String update() { checkEditorStatus(); final String jspType = "view"; @@ -203,7 +204,7 @@ public class DesignAction implements Serializable { } } - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String download() { checkEditorStatus(); @@ -226,7 +227,7 @@ public class DesignAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = false, input = "index") + //@Execute(validator = false, input = "index") public String delete() { checkEditorStatus(); @@ -264,7 +265,7 @@ public class DesignAction implements Serializable { } private void loadFileNameItems() { - final File baseDir = new File(ServletContextUtil.getServletContext().getRealPath("/")); + final File baseDir = new File(LaServletContextUtil.getServletContext().getRealPath("/")); fileNameItems = new ArrayList(); final List fileList = getAccessibleFileList(baseDir); final int length = baseDir.getAbsolutePath().length(); @@ -282,8 +283,8 @@ public class DesignAction implements Serializable { } private File getTargetFile() { - final File baseDir = new File(ServletContextUtil.getServletContext().getRealPath("/")); - final File targetFile = new File(ServletContextUtil.getServletContext().getRealPath(designForm.fileName)); + final File baseDir = new File(LaServletContextUtil.getServletContext().getRealPath("/")); + final File targetFile = new File(LaServletContextUtil.getServletContext().getRealPath(designForm.fileName)); final List fileList = getAccessibleFileList(baseDir); boolean exist = false; for (final File file : fileList) { diff --git a/src/main/java/org/codelibs/fess/web/admin/DesignForm.java b/src/main/java/org/codelibs/fess/app/web/admin/DesignForm.java similarity index 82% rename from src/main/java/org/codelibs/fess/web/admin/DesignForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/DesignForm.java index 68d706d9e..4c7b173cb 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DesignForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DesignForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; @@ -22,12 +22,12 @@ public class DesignForm implements Serializable { private static final long serialVersionUID = 1L; - @Required(target = "upload") - public FormFile designFile; + //@Required(target = "upload") + //public FormFile designFile; public String designFileName; - @Required(target = "edit,editAsUseDefault,download,delete") + //@Required(target = "edit,editAsUseDefault,download,delete") public String fileName; public String content; diff --git a/src/main/java/org/codelibs/fess/web/admin/DictAction.java b/src/main/java/org/codelibs/fess/app/web/admin/DictAction.java similarity index 91% rename from src/main/java/org/codelibs/fess/web/admin/DictAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/DictAction.java index 51d6c453c..e59158571 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DictAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DictAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; @@ -24,13 +24,12 @@ import org.codelibs.fess.dict.DictionaryFile; import org.codelibs.fess.dict.DictionaryItem; import org.codelibs.fess.dict.DictionaryManager; import org.codelibs.fess.helper.SystemHelper; -import org.lastaflute.web.Execute; public class DictAction implements Serializable { private static final long serialVersionUID = 1L; @Resource - @ActionForm + //@ActionForm protected DictForm dictForm; @Resource @@ -45,7 +44,7 @@ public class DictAction implements Serializable { return systemHelper.getHelpLink("dict"); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { dictFiles = dictionaryManager.getDictionaryFiles(); return "index.jsp"; diff --git a/src/main/java/org/codelibs/fess/web/admin/DictForm.java b/src/main/java/org/codelibs/fess/app/web/admin/DictForm.java similarity index 94% rename from src/main/java/org/codelibs/fess/web/admin/DictForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/DictForm.java index 2d6f43c42..5baa105db 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DictForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DictForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; diff --git a/src/main/java/org/codelibs/fess/web/admin/DocumentAction.java b/src/main/java/org/codelibs/fess/app/web/admin/DocumentAction.java similarity index 94% rename from src/main/java/org/codelibs/fess/web/admin/DocumentAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/DocumentAction.java index 26d38c819..d106a3cbf 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DocumentAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DocumentAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.ArrayList; @@ -24,15 +24,15 @@ import java.util.Set; import javax.annotation.Resource; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.client.FessEsClient; import org.codelibs.fess.crud.util.SAStrutsUtil; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.FieldHelper; import org.codelibs.fess.helper.JobHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.helper.WebManagementHelper; import org.codelibs.fess.util.ComponentUtil; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -40,7 +40,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket; import org.elasticsearch.search.aggregations.bucket.terms.Terms.Order; import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder; -import org.lastaflute.web.Execute; +import org.lastaflute.taglib.function.LaFunctions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +49,7 @@ public class DocumentAction implements Serializable { private static final long serialVersionUID = 1L; - @ActionForm + //@ActionForm @Resource protected DocumentForm documentForm; @@ -85,13 +85,13 @@ public class DocumentAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false) + //@Execute(validator = false) public String index() { return showIndex(false); } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String commit() { // TODO change to flush if (jobHelper.isCrawlProcessRunning()) { @@ -104,7 +104,7 @@ public class DocumentAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String optimize() { // TODO change to optimize if (jobHelper.isCrawlProcessRunning()) { @@ -116,7 +116,7 @@ public class DocumentAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String delete() { QueryBuilder deleteQuery; if ("*".equals(documentForm.sessionId)) { @@ -128,14 +128,14 @@ public class DocumentAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String confirmByUrl() { final String confirmQuery = fieldHelper.urlField + ":\"" + documentForm.deleteUrl + "\""; return "/admin/searchList/search?query=" + LaFunctions.u(confirmQuery) + "&redirect=true"; } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String deleteByUrl() { return deleteByQuery(QueryBuilders.termQuery(fieldHelper.urlField, documentForm.deleteUrl)); } @@ -200,7 +200,7 @@ public class DocumentAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String deleteSuggest() { // TODO /* diff --git a/src/main/java/org/codelibs/fess/web/admin/DocumentForm.java b/src/main/java/org/codelibs/fess/app/web/admin/DocumentForm.java similarity index 80% rename from src/main/java/org/codelibs/fess/web/admin/DocumentForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/DocumentForm.java index 83bc25c0f..090688756 100644 --- a/src/main/java/org/codelibs/fess/web/admin/DocumentForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/DocumentForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.ArrayList; @@ -35,18 +35,18 @@ public class DocumentForm implements Serializable { public List> serverStatusList = new ArrayList>(); - @Required(target = "commit,optimize,delete") + //@Required(target = "commit,optimize,delete") public String groupName; - @Required(target = "delete") + //@Required(target = "delete") public String sessionId; - @Required(target = "deleteByUrl,confirmByUrl") + //@Required(target = "deleteByUrl,confirmByUrl") public String deleteUrl; - @Required(target = "startSolrInstance,stopSolrInstance,reloadSolrInstance") + //@Required(target = "startSolrInstance,stopSolrInstance,reloadSolrInstance") public String solrInstanceName; - @Required(target = "deleteSuggest") + //@Required(target = "deleteSuggest") public String deleteSuggestType; } diff --git a/src/main/java/org/codelibs/fess/web/admin/FailureUrlAction.java b/src/main/java/org/codelibs/fess/app/web/admin/FailureUrlAction.java similarity index 82% rename from src/main/java/org/codelibs/fess/web/admin/FailureUrlAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/FailureUrlAction.java index a61d450dc..f42e8bf43 100644 --- a/src/main/java/org/codelibs/fess/web/admin/FailureUrlAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/FailureUrlAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,6 +23,9 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; @@ -30,9 +33,6 @@ import org.codelibs.fess.es.exentity.FailureUrl; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.FailureUrlPager; import org.codelibs.fess.service.FailureUrlService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,7 +46,7 @@ public class FailureUrlAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected FailureUrlForm failureUrlForm; @@ -68,9 +68,8 @@ public class FailureUrlAction extends FessAdminAction { failureUrlItems = failureUrlService.getFailureUrlList(failureUrlPager); // restore from pager - Beans.copy(failureUrlPager, failureUrlForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(failureUrlPager, failureUrlForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -79,12 +78,12 @@ public class FailureUrlAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(failureUrlForm.pageNumber)) { @@ -100,34 +99,33 @@ public class FailureUrlAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(failureUrlForm.searchParams, failureUrlPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(failureUrlForm.searchParams, failureUrlPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { failureUrlPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (failureUrlForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -140,7 +138,7 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi failureUrlForm.initialize(); @@ -150,7 +148,7 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (failureUrlForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -163,7 +161,7 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { failureUrlForm.crudMode = CommonConstants.EDIT_MODE; @@ -173,19 +171,19 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (failureUrlForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -198,7 +196,7 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { failureUrlForm.crudMode = CommonConstants.DELETE_MODE; @@ -208,7 +206,7 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final FailureUrl failureUrl = createFailureUrl(); @@ -229,7 +227,7 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final FailureUrl failureUrl = createFailureUrl(); @@ -250,7 +248,7 @@ public class FailureUrlAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (failureUrlForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -294,9 +292,7 @@ public class FailureUrlAction extends FessAdminAction { } - Beans.copy(failureUrl, failureUrlForm).excludes("searchParams", "mode") - - .execute(); + BeanUtil.copyBeanToBean(failureUrl, failureUrlForm, option -> option.exclude("searchParams", "mode")); } protected FailureUrl createFailureUrl() { @@ -313,9 +309,7 @@ public class FailureUrlAction extends FessAdminAction { } else { failureUrl = new FailureUrl(); } - Beans.copy(failureUrlForm, failureUrl).excludes("searchParams", "mode") - - .execute(); + BeanUtil.copyBeanToBean(failureUrlForm, failureUrl, option -> option.exclude("searchParams", "mode")); return failureUrl; } @@ -328,7 +322,7 @@ public class FailureUrlAction extends FessAdminAction { return keys; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deleteall() { failureUrlService.deleteAll(failureUrlPager); SAStrutsUtil.addSessionMessage("success.failure_url_delete_all"); diff --git a/src/main/java/org/codelibs/fess/web/admin/FailureUrlForm.java b/src/main/java/org/codelibs/fess/app/web/admin/FailureUrlForm.java similarity index 70% rename from src/main/java/org/codelibs/fess/web/admin/FailureUrlForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/FailureUrlForm.java index 5ee8f6f0b..8c75d1bcd 100644 --- a/src/main/java/org/codelibs/fess/web/admin/FailureUrlForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/FailureUrlForm.java @@ -14,14 +14,12 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; import java.util.Map; -import org.codelibs.fess.Constants; - public class FailureUrlForm implements Serializable { private static final long serialVersionUID = 1L; @@ -30,41 +28,41 @@ public class FailureUrlForm implements Serializable { public String fileConfigName; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String url; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String threadName; public String errorName; public String errorLog; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntegerType public String errorCount; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) public String lastAccessTime; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String configId; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/FileAuthenticationAction.java b/src/main/java/org/codelibs/fess/app/web/admin/FileAuthenticationAction.java similarity index 85% rename from src/main/java/org/codelibs/fess/web/admin/FileAuthenticationAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/FileAuthenticationAction.java index 047301550..50e4f81a7 100644 --- a/src/main/java/org/codelibs/fess/web/admin/FileAuthenticationAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/FileAuthenticationAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.ArrayList; @@ -24,22 +24,22 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.Constants; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.FileAuthentication; import org.codelibs.fess.es.exentity.FileConfig; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.FileAuthenticationPager; import org.codelibs.fess.service.FileAuthenticationService; import org.codelibs.fess.service.FileConfigService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaRequestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +53,7 @@ public class FileAuthenticationAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected FileAuthenticationForm fileAuthenticationForm; @@ -78,9 +78,8 @@ public class FileAuthenticationAction extends FessAdminAction { fileAuthenticationItems = fileAuthenticationService.getFileAuthenticationList(fileAuthenticationPager); // restore from pager - Beans.copy(fileAuthenticationPager, fileAuthenticationForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(fileAuthenticationPager, fileAuthenticationForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -89,12 +88,12 @@ public class FileAuthenticationAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(fileAuthenticationForm.pageNumber)) { @@ -110,34 +109,33 @@ public class FileAuthenticationAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(fileAuthenticationForm.searchParams, fileAuthenticationPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(fileAuthenticationForm.searchParams, fileAuthenticationPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { fileAuthenticationPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (fileAuthenticationForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -150,7 +148,7 @@ public class FileAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi fileAuthenticationForm.initialize(); @@ -160,7 +158,7 @@ public class FileAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (fileAuthenticationForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -173,7 +171,7 @@ public class FileAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { fileAuthenticationForm.crudMode = CommonConstants.EDIT_MODE; @@ -183,19 +181,19 @@ public class FileAuthenticationAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (fileAuthenticationForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -208,7 +206,7 @@ public class FileAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { fileAuthenticationForm.crudMode = CommonConstants.DELETE_MODE; @@ -218,7 +216,7 @@ public class FileAuthenticationAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final FileAuthentication fileAuthentication = createFileAuthentication(); @@ -239,7 +237,7 @@ public class FileAuthenticationAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final FileAuthentication fileAuthentication = createFileAuthentication(); @@ -267,7 +265,7 @@ public class FileAuthenticationAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { fileAuthenticationForm.id }); } - FessBeans.copy(fileAuthentication, fileAuthenticationForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(fileAuthentication, fileAuthenticationForm, option -> option.excludes("searchParams", "mode")); if ("-1".equals(fileAuthenticationForm.port)) { fileAuthenticationForm.port = StringUtil.EMPTY; } @@ -293,12 +291,13 @@ public class FileAuthenticationAction extends FessAdminAction { if (StringUtil.isBlank(fileAuthenticationForm.port)) { fileAuthenticationForm.port = "-1"; } - FessBeans.copy(fileAuthenticationForm, fileAuthentication).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(fileAuthenticationForm, fileAuthentication, + option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return fileAuthentication; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (fileAuthenticationForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/FileAuthenticationForm.java b/src/main/java/org/codelibs/fess/app/web/admin/FileAuthenticationForm.java similarity index 67% rename from src/main/java/org/codelibs/fess/web/admin/FileAuthenticationForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/FileAuthenticationForm.java index 1c9e58cc6..5106f5a2d 100644 --- a/src/main/java/org/codelibs/fess/web/admin/FileAuthenticationForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/FileAuthenticationForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,61 +26,61 @@ public class FileAuthenticationForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Maxbytelength(maxbytelength = 100) + //@Maxbytelength(maxbytelength = 100) public String hostname; - @IntRange(min = -1, max = 2147483647) + //@IntRange(min = -1, max = 2147483647) public String port; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String protocolScheme; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String username; - @Maxbytelength(maxbytelength = 100) + //@Maxbytelength(maxbytelength = 100) public String password; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String parameters; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@LongType public String fileConfigId; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/FileConfigAction.java b/src/main/java/org/codelibs/fess/app/web/admin/FileConfigAction.java similarity index 84% rename from src/main/java/org/codelibs/fess/web/admin/FileConfigAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/FileConfigAction.java index e94f018e2..3b4ba2a7d 100644 --- a/src/main/java/org/codelibs/fess/web/admin/FileConfigAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/FileConfigAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,6 +23,9 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -30,16 +33,13 @@ import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.FileConfig; import org.codelibs.fess.es.exentity.LabelType; import org.codelibs.fess.es.exentity.RoleType; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.FileConfigPager; import org.codelibs.fess.service.FailureUrlService; import org.codelibs.fess.service.FileConfigService; import org.codelibs.fess.service.LabelTypeService; import org.codelibs.fess.service.RoleTypeService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +53,7 @@ public class FileConfigAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected FileConfigForm fileConfigForm; @@ -84,9 +84,8 @@ public class FileConfigAction extends FessAdminAction { fileConfigItems = fileConfigService.getFileConfigList(fileConfigPager); // restore from pager - Beans.copy(fileConfigPager, fileConfigForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(fileConfigPager, fileConfigForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -95,12 +94,12 @@ public class FileConfigAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(fileConfigForm.pageNumber)) { @@ -116,34 +115,33 @@ public class FileConfigAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(fileConfigForm.searchParams, fileConfigPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(fileConfigForm.searchParams, fileConfigPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { fileConfigPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (fileConfigForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -156,7 +154,7 @@ public class FileConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi fileConfigForm.initialize(); @@ -166,7 +164,7 @@ public class FileConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (fileConfigForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -179,7 +177,7 @@ public class FileConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { fileConfigForm.crudMode = CommonConstants.EDIT_MODE; @@ -189,19 +187,19 @@ public class FileConfigAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (fileConfigForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -214,7 +212,7 @@ public class FileConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { fileConfigForm.crudMode = CommonConstants.DELETE_MODE; @@ -224,7 +222,7 @@ public class FileConfigAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final FileConfig fileConfig = createFileConfig(); @@ -245,7 +243,7 @@ public class FileConfigAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final FileConfig fileConfig = createFileConfig(); @@ -281,7 +279,7 @@ public class FileConfigAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { fileConfigForm.id }); } - FessBeans.copy(fileConfig, fileConfigForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(fileConfig, fileConfigForm, option -> option.exclude("searchParams", "mode")); // normalize boost if (fileConfigForm.boost != null && fileConfigForm.boost.indexOf('.') > 0) { @@ -306,12 +304,12 @@ public class FileConfigAction extends FessAdminAction { } fileConfig.setUpdatedBy(username); fileConfig.setUpdatedTime(currentTime); - FessBeans.copy(fileConfigForm, fileConfig).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(fileConfigForm, fileConfig, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return fileConfig; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (fileConfigForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/FileConfigForm.java b/src/main/java/org/codelibs/fess/app/web/admin/FileConfigForm.java similarity index 61% rename from src/main/java/org/codelibs/fess/web/admin/FileConfigForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/FileConfigForm.java index 21dca75c8..b261de2cf 100644 --- a/src/main/java/org/codelibs/fess/web/admin/FileConfigForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/FileConfigForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -32,89 +32,89 @@ public class FileConfigForm implements Serializable { public String[] labelTypeIds; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 200) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 200) public String name; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") @UriType(protocols = "file:,smb:") - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String paths; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String includedPaths; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String excludedPaths; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String includedDocPaths; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String excludedDocPaths; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String configParameter; - @IntRange(min = 0, max = 2147483647) + //@IntRange(min = 0, max = 2147483647) public String depth; - @LongRange(min = 0, max = 9223372036854775807l) + //@LongRange(min = 0, max = 9223372036854775807l) public String maxAccessCount; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String numOfThread; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String intervalTime; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String boost; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 5) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 5) public String available; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/IndexAction.java b/src/main/java/org/codelibs/fess/app/web/admin/IndexAction.java similarity index 87% rename from src/main/java/org/codelibs/fess/web/admin/IndexAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/IndexAction.java index d46334173..a9d38dde2 100644 --- a/src/main/java/org/codelibs/fess/web/admin/IndexAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/IndexAction.java @@ -14,14 +14,13 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.codelibs.fess.helper.SystemHelper; -import org.codelibs.sastruts.core.util.ActivityUtil; -import org.lastaflute.web.Execute; +import org.codelibs.fess.util.ActivityUtil; import org.lastaflute.web.util.LaRequestUtil; public class IndexAction { @@ -33,12 +32,12 @@ public class IndexAction { return systemHelper.getHelpLink("wizard"); } - @Execute(validator = false) + //@Execute(validator = false) public String index() { return "/admin/wizard/index?redirect=true"; } - @Execute(validator = false) + //@Execute(validator = false) public String logout() { final HttpServletRequest request = LaRequestUtil.getRequest(); ActivityUtil.logout(request.getRemoteUser(), request); diff --git a/src/main/java/org/codelibs/fess/web/admin/JobLogAction.java b/src/main/java/org/codelibs/fess/app/web/admin/JobLogAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/JobLogAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/JobLogAction.java index 54653f0c0..16fe49f54 100644 --- a/src/main/java/org/codelibs/fess/web/admin/JobLogAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/JobLogAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.ArrayList; @@ -24,7 +24,10 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.Constants; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; @@ -32,9 +35,6 @@ import org.codelibs.fess.es.exentity.JobLog; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.JobLogPager; import org.codelibs.fess.service.JobLogService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +48,7 @@ public class JobLogAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected JobLogForm jobLogForm; @@ -70,9 +70,7 @@ public class JobLogAction extends FessAdminAction { jobLogItems = jobLogService.getJobLogList(jobLogPager); // restore from pager - Beans.copy(jobLogPager, jobLogForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(jobLogPager, jobLogForm.searchParams, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -81,12 +79,12 @@ public class JobLogAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(jobLogForm.pageNumber)) { @@ -102,34 +100,32 @@ public class JobLogAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(jobLogForm.searchParams, jobLogPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(jobLogForm.searchParams, jobLogPager, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { jobLogPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (jobLogForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -142,7 +138,7 @@ public class JobLogAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi jobLogForm.initialize(); @@ -152,7 +148,7 @@ public class JobLogAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (jobLogForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, jobLogForm.crudMode }); @@ -164,7 +160,7 @@ public class JobLogAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { jobLogForm.crudMode = CommonConstants.EDIT_MODE; @@ -174,19 +170,19 @@ public class JobLogAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (jobLogForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, jobLogForm.crudMode }); @@ -198,7 +194,7 @@ public class JobLogAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { jobLogForm.crudMode = CommonConstants.DELETE_MODE; @@ -208,7 +204,7 @@ public class JobLogAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final JobLog jobLog = createJobLog(); @@ -229,7 +225,7 @@ public class JobLogAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final JobLog jobLog = createJobLog(); @@ -250,7 +246,7 @@ public class JobLogAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (jobLogForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, jobLogForm.crudMode }); @@ -293,9 +289,7 @@ public class JobLogAction extends FessAdminAction { } - Beans.copy(jobLog, jobLogForm).excludes("searchParams", "mode") - - .execute(); + BeanUtil.copyBeanToBean(jobLog, jobLogForm, option -> option.exclude("searchParams", "mode")); } protected JobLog createJobLog() { @@ -312,9 +306,7 @@ public class JobLogAction extends FessAdminAction { } else { jobLog = new JobLog(); } - Beans.copy(jobLogForm, jobLog).excludes("searchParams", "mode") - - .execute(); + BeanUtil.copyBeanToBean(jobLogForm, jobLog, option -> option.exclude("searchParams", "mode")); return jobLog; } @@ -327,7 +319,7 @@ public class JobLogAction extends FessAdminAction { return keys; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deleteall() { final List jobStatusList = new ArrayList(); jobStatusList.add(Constants.OK); diff --git a/src/main/java/org/codelibs/fess/web/admin/JobLogForm.java b/src/main/java/org/codelibs/fess/app/web/admin/JobLogForm.java similarity index 68% rename from src/main/java/org/codelibs/fess/web/admin/JobLogForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/JobLogForm.java index 73154aeaa..69d96d11d 100644 --- a/src/main/java/org/codelibs/fess/web/admin/JobLogForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/JobLogForm.java @@ -14,55 +14,53 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; import java.util.Map; -import org.codelibs.fess.Constants; - public class JobLogForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String jobName; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String jobStatus; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String target; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String scriptType; public String scriptData; public String scriptResult; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) public String startTime; - @DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) + //@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) public String endTime; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/KeyMatchAction.java b/src/main/java/org/codelibs/fess/app/web/admin/KeyMatchAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/KeyMatchAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/KeyMatchAction.java index dfd138575..8d22704be 100644 --- a/src/main/java/org/codelibs/fess/web/admin/KeyMatchAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/KeyMatchAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,19 +23,19 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.KeyMatch; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.KeyMatchPager; import org.codelibs.fess.service.KeyMatchService; import org.codelibs.fess.util.ComponentUtil; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +49,7 @@ public class KeyMatchAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected KeyMatchForm keyMatchForm; @@ -71,9 +71,7 @@ public class KeyMatchAction extends FessAdminAction { keyMatchItems = keyMatchService.getKeyMatchList(keyMatchPager); // restore from pager - Beans.copy(keyMatchPager, keyMatchForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(keyMatchPager, keyMatchForm.searchParams, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -82,12 +80,12 @@ public class KeyMatchAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(keyMatchForm.pageNumber)) { @@ -103,34 +101,32 @@ public class KeyMatchAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(keyMatchForm.searchParams, keyMatchPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(keyMatchForm.searchParams, keyMatchPager, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { keyMatchPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (keyMatchForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -143,7 +139,7 @@ public class KeyMatchAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi keyMatchForm.initialize(); @@ -153,7 +149,7 @@ public class KeyMatchAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (keyMatchForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, keyMatchForm.crudMode }); @@ -165,7 +161,7 @@ public class KeyMatchAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { keyMatchForm.crudMode = CommonConstants.EDIT_MODE; @@ -175,19 +171,19 @@ public class KeyMatchAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (keyMatchForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -200,7 +196,7 @@ public class KeyMatchAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { keyMatchForm.crudMode = CommonConstants.DELETE_MODE; @@ -225,7 +221,7 @@ public class KeyMatchAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { keyMatchForm.id }); } - FessBeans.copy(keyMatch, keyMatchForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(keyMatch, keyMatchForm, option -> option.exclude("searchParams", "mode")); } protected KeyMatch createKeyMatch() { @@ -245,13 +241,13 @@ public class KeyMatchAction extends FessAdminAction { } keyMatch.setUpdatedBy(username); keyMatch.setUpdatedTime(currentTime); - FessBeans.copy(keyMatchForm, keyMatch).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(keyMatchForm, keyMatch, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return keyMatch; } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { ComponentUtil.getKeyMatchHelper().update(); try { @@ -273,7 +269,7 @@ public class KeyMatchAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final KeyMatch keyMatch = createKeyMatch(); @@ -295,7 +291,7 @@ public class KeyMatchAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (keyMatchForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/KeyMatchForm.java b/src/main/java/org/codelibs/fess/app/web/admin/KeyMatchForm.java similarity index 64% rename from src/main/java/org/codelibs/fess/web/admin/KeyMatchForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/KeyMatchForm.java index eac9b18d4..fb589a306 100644 --- a/src/main/java/org/codelibs/fess/web/admin/KeyMatchForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/KeyMatchForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,54 +26,54 @@ public class KeyMatchForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String term; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 4000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 4000) public String query; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntegerType - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntegerType + //@IntRange(min = 0, max = 2147483647) public String maxSize; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String boost; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/LabelTypeAction.java b/src/main/java/org/codelibs/fess/app/web/admin/LabelTypeAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/LabelTypeAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/LabelTypeAction.java index d31bb126f..13a52a61b 100644 --- a/src/main/java/org/codelibs/fess/web/admin/LabelTypeAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/LabelTypeAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,20 +23,20 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.LabelType; import org.codelibs.fess.es.exentity.RoleType; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.LabelTypePager; import org.codelibs.fess.service.LabelTypeService; import org.codelibs.fess.service.RoleTypeService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +50,7 @@ public class LabelTypeAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected LabelTypeForm labelTypeForm; @@ -75,9 +75,7 @@ public class LabelTypeAction extends FessAdminAction { labelTypeItems = labelTypeService.getLabelTypeList(labelTypePager); // restore from pager - Beans.copy(labelTypePager, labelTypeForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(labelTypePager, labelTypeForm.searchParams, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -86,12 +84,12 @@ public class LabelTypeAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(labelTypeForm.pageNumber)) { @@ -107,34 +105,32 @@ public class LabelTypeAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(labelTypeForm.searchParams, labelTypePager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(labelTypeForm.searchParams, labelTypePager, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { labelTypePager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (labelTypeForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -147,7 +143,7 @@ public class LabelTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi labelTypeForm.initialize(); @@ -157,7 +153,7 @@ public class LabelTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (labelTypeForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -170,7 +166,7 @@ public class LabelTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { labelTypeForm.crudMode = CommonConstants.EDIT_MODE; @@ -180,19 +176,19 @@ public class LabelTypeAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (labelTypeForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -205,7 +201,7 @@ public class LabelTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { labelTypeForm.crudMode = CommonConstants.DELETE_MODE; @@ -215,7 +211,7 @@ public class LabelTypeAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final LabelType labelType = createLabelType(); @@ -236,7 +232,7 @@ public class LabelTypeAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final LabelType labelType = createLabelType(); @@ -272,7 +268,7 @@ public class LabelTypeAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { labelTypeForm.id }); } - FessBeans.copy(labelType, labelTypeForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(labelType, labelTypeForm, option -> option.exclude("searchParams", "mode")); } protected LabelType createLabelType() { @@ -292,12 +288,12 @@ public class LabelTypeAction extends FessAdminAction { } labelType.setUpdatedBy(username); labelType.setUpdatedTime(currentTime); - FessBeans.copy(labelTypeForm, labelType).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(labelTypeForm, labelType, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return labelType; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (labelTypeForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/LabelTypeForm.java b/src/main/java/org/codelibs/fess/app/web/admin/LabelTypeForm.java similarity index 64% rename from src/main/java/org/codelibs/fess/web/admin/LabelTypeForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/LabelTypeForm.java index 6a29efc05..555625a4b 100644 --- a/src/main/java/org/codelibs/fess/web/admin/LabelTypeForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/LabelTypeForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -28,57 +28,57 @@ public class LabelTypeForm implements Serializable { public String[] roleTypeIds; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String name; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 20) - @Mask(mask = "^[a-zA-Z0-9_-]+$", msg = @Msg(key = "errors.alphaDigitOnly")) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 20) + //@Mask(mask = "^[a-zA-Z0-9_-]+$", msg = @Msg(key = "errors.alphaDigitOnly")) public String value; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String includedPaths; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String excludedPaths; - @Required(target = "confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/LogAction.java b/src/main/java/org/codelibs/fess/app/web/admin/LogAction.java similarity index 94% rename from src/main/java/org/codelibs/fess/web/admin/LogAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/LogAction.java index 0c81aa809..f0baf652c 100644 --- a/src/main/java/org/codelibs/fess/web/admin/LogAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/LogAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.File; import java.io.FileInputStream; @@ -35,10 +35,9 @@ import javax.annotation.Resource; import org.apache.commons.codec.binary.Base64; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.Constants; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +48,7 @@ public class LogAction implements Serializable { private static final Logger logger = LoggerFactory.getLogger(LogAction.class); - @ActionForm + //@ActionForm @Resource protected LogForm logForm; @@ -60,12 +59,12 @@ public class LogAction implements Serializable { return systemHelper.getHelpLink("log"); } - @Execute(validator = false) + //@Execute(validator = false) public String index() { return "index.jsp"; } - @Execute(validator = true, input = "index", urlPattern = "download/{logFileName}") + //@Execute(validator = true, input = "index", urlPattern = "download/{logFileName}") public String download() { final String logFilePath = ComponentUtil.getSystemHelper().getLogFilePath(); if (StringUtil.isNotBlank(logFilePath)) { diff --git a/src/main/java/org/codelibs/fess/web/admin/LogForm.java b/src/main/java/org/codelibs/fess/app/web/admin/LogForm.java similarity index 95% rename from src/main/java/org/codelibs/fess/web/admin/LogForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/LogForm.java index dd05f17be..f3829bc8e 100644 --- a/src/main/java/org/codelibs/fess/web/admin/LogForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/LogForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; diff --git a/src/main/java/org/codelibs/fess/web/admin/OverlappingHostAction.java b/src/main/java/org/codelibs/fess/app/web/admin/OverlappingHostAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/OverlappingHostAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/OverlappingHostAction.java index f4d05a2db..e84ea9338 100644 --- a/src/main/java/org/codelibs/fess/web/admin/OverlappingHostAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/OverlappingHostAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,18 +23,18 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.OverlappingHost; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.OverlappingHostPager; import org.codelibs.fess.service.OverlappingHostService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +48,7 @@ public class OverlappingHostAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected OverlappingHostForm overlappingHostForm; @@ -70,9 +70,8 @@ public class OverlappingHostAction extends FessAdminAction { overlappingHostItems = overlappingHostService.getOverlappingHostList(overlappingHostPager); // restore from pager - Beans.copy(overlappingHostPager, overlappingHostForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(overlappingHostPager, overlappingHostForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -81,12 +80,12 @@ public class OverlappingHostAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(overlappingHostForm.pageNumber)) { @@ -102,34 +101,33 @@ public class OverlappingHostAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(overlappingHostForm.searchParams, overlappingHostPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(overlappingHostForm.searchParams, overlappingHostPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { overlappingHostPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (overlappingHostForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -142,7 +140,7 @@ public class OverlappingHostAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi overlappingHostForm.initialize(); @@ -152,7 +150,7 @@ public class OverlappingHostAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (overlappingHostForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -165,7 +163,7 @@ public class OverlappingHostAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { overlappingHostForm.crudMode = CommonConstants.EDIT_MODE; @@ -175,19 +173,19 @@ public class OverlappingHostAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (overlappingHostForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -200,7 +198,7 @@ public class OverlappingHostAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { overlappingHostForm.crudMode = CommonConstants.DELETE_MODE; @@ -210,7 +208,7 @@ public class OverlappingHostAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final OverlappingHost overlappingHost = createOverlappingHost(); @@ -231,7 +229,7 @@ public class OverlappingHostAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final OverlappingHost overlappingHost = createOverlappingHost(); @@ -267,7 +265,7 @@ public class OverlappingHostAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { overlappingHostForm.id }); } - FessBeans.copy(overlappingHost, overlappingHostForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(overlappingHost, overlappingHostForm, option -> option.exclude("searchParams", "mode")); } protected OverlappingHost createOverlappingHost() { @@ -287,12 +285,12 @@ public class OverlappingHostAction extends FessAdminAction { } overlappingHost.setUpdatedBy(username); overlappingHost.setUpdatedTime(currentTime); - FessBeans.copy(overlappingHostForm, overlappingHost).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(overlappingHostForm, overlappingHost, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return overlappingHost; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (overlappingHostForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/OverlappingHostForm.java b/src/main/java/org/codelibs/fess/app/web/admin/OverlappingHostForm.java similarity index 66% rename from src/main/java/org/codelibs/fess/web/admin/OverlappingHostForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/OverlappingHostForm.java index b633ea8b5..1baf7904b 100644 --- a/src/main/java/org/codelibs/fess/web/admin/OverlappingHostForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/OverlappingHostForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,50 +26,50 @@ public class OverlappingHostForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String regularName; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String overlappingName; - @Required(target = "confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/PathMappingAction.java b/src/main/java/org/codelibs/fess/app/web/admin/PathMappingAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/PathMappingAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/PathMappingAction.java index e4538a8f6..bcb44437e 100644 --- a/src/main/java/org/codelibs/fess/web/admin/PathMappingAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/PathMappingAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,19 +23,19 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.PathMapping; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.PathMappingHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.PathMappingPager; import org.codelibs.fess.service.PathMappingService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +49,7 @@ public class PathMappingAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected PathMappingForm pathMappingForm; @@ -78,9 +78,8 @@ public class PathMappingAction extends FessAdminAction { pathMappingItems = pathMappingService.getPathMappingList(pathMappingPager); // restore from pager - Beans.copy(pathMappingPager, pathMappingForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(pathMappingPager, pathMappingForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -89,12 +88,12 @@ public class PathMappingAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(pathMappingForm.pageNumber)) { @@ -110,34 +109,33 @@ public class PathMappingAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(pathMappingForm.searchParams, pathMappingPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(pathMappingForm.searchParams, pathMappingPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { pathMappingPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (pathMappingForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -150,7 +148,7 @@ public class PathMappingAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi pathMappingForm.initialize(); @@ -160,7 +158,7 @@ public class PathMappingAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (pathMappingForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -173,7 +171,7 @@ public class PathMappingAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { pathMappingForm.crudMode = CommonConstants.EDIT_MODE; @@ -183,19 +181,19 @@ public class PathMappingAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (pathMappingForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -208,7 +206,7 @@ public class PathMappingAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { pathMappingForm.crudMode = CommonConstants.DELETE_MODE; @@ -218,7 +216,7 @@ public class PathMappingAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final PathMapping pathMapping = createPathMapping(); @@ -239,7 +237,7 @@ public class PathMappingAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final PathMapping pathMapping = createPathMapping(); @@ -275,7 +273,7 @@ public class PathMappingAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { pathMappingForm.id }); } - FessBeans.copy(pathMapping, pathMappingForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(pathMapping, pathMappingForm, option -> option.exclude("searchParams", "mode")); } protected PathMapping createPathMapping() { @@ -295,12 +293,12 @@ public class PathMappingAction extends FessAdminAction { } pathMapping.setUpdatedBy(username); pathMapping.setUpdatedTime(currentTime); - FessBeans.copy(pathMappingForm, pathMapping).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(pathMappingForm, pathMapping, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return pathMapping; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (pathMappingForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/PathMappingForm.java b/src/main/java/org/codelibs/fess/app/web/admin/PathMappingForm.java similarity index 65% rename from src/main/java/org/codelibs/fess/web/admin/PathMappingForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/PathMappingForm.java index acdb397b2..191944760 100644 --- a/src/main/java/org/codelibs/fess/web/admin/PathMappingForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/PathMappingForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,53 +26,53 @@ public class PathMappingForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String regex; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String replacement; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String processType; - @Required(target = "confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/RequestHeaderAction.java b/src/main/java/org/codelibs/fess/app/web/admin/RequestHeaderAction.java similarity index 85% rename from src/main/java/org/codelibs/fess/web/admin/RequestHeaderAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/RequestHeaderAction.java index 83bc177ea..d6bf42af1 100644 --- a/src/main/java/org/codelibs/fess/web/admin/RequestHeaderAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/RequestHeaderAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.ArrayList; @@ -24,20 +24,20 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.RequestHeader; import org.codelibs.fess.es.exentity.WebConfig; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.RequestHeaderPager; import org.codelibs.fess.service.RequestHeaderService; import org.codelibs.fess.service.WebConfigService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaRequestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +52,7 @@ public class RequestHeaderAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected RequestHeaderForm requestHeaderForm; @@ -77,9 +77,8 @@ public class RequestHeaderAction extends FessAdminAction { requestHeaderItems = requestHeaderService.getRequestHeaderList(requestHeaderPager); // restore from pager - Beans.copy(requestHeaderPager, requestHeaderForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(requestHeaderPager, requestHeaderForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -88,12 +87,12 @@ public class RequestHeaderAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(requestHeaderForm.pageNumber)) { @@ -109,34 +108,33 @@ public class RequestHeaderAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(requestHeaderForm.searchParams, requestHeaderPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(requestHeaderForm.searchParams, requestHeaderPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { requestHeaderPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (requestHeaderForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -149,7 +147,7 @@ public class RequestHeaderAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi requestHeaderForm.initialize(); @@ -159,7 +157,7 @@ public class RequestHeaderAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (requestHeaderForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -172,7 +170,7 @@ public class RequestHeaderAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { requestHeaderForm.crudMode = CommonConstants.EDIT_MODE; @@ -182,19 +180,19 @@ public class RequestHeaderAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (requestHeaderForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -207,7 +205,7 @@ public class RequestHeaderAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { requestHeaderForm.crudMode = CommonConstants.DELETE_MODE; @@ -217,7 +215,7 @@ public class RequestHeaderAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final RequestHeader requestHeader = createRequestHeader(); @@ -238,7 +236,7 @@ public class RequestHeaderAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final RequestHeader requestHeader = createRequestHeader(); @@ -274,7 +272,7 @@ public class RequestHeaderAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { requestHeaderForm.id }); } - FessBeans.copy(requestHeader, requestHeaderForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(requestHeader, requestHeaderForm, option -> option.excludes("searchParams", "mode")); } protected RequestHeader createRequestHeader() { @@ -294,12 +292,12 @@ public class RequestHeaderAction extends FessAdminAction { } requestHeader.setUpdatedBy(username); requestHeader.setUpdatedTime(currentTime); - FessBeans.copy(requestHeaderForm, requestHeader).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(requestHeaderForm, requestHeader, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return requestHeader; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (requestHeaderForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/RequestHeaderForm.java b/src/main/java/org/codelibs/fess/app/web/admin/RequestHeaderForm.java similarity index 65% rename from src/main/java/org/codelibs/fess/web/admin/RequestHeaderForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/RequestHeaderForm.java index aa6b32cb8..02fd45762 100644 --- a/src/main/java/org/codelibs/fess/web/admin/RequestHeaderForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/RequestHeaderForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,50 +26,50 @@ public class RequestHeaderForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String name; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String value; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String webConfigId; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/RoleTypeAction.java b/src/main/java/org/codelibs/fess/app/web/admin/RoleTypeAction.java similarity index 83% rename from src/main/java/org/codelibs/fess/web/admin/RoleTypeAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/RoleTypeAction.java index 538ba36fa..9ac59dd76 100644 --- a/src/main/java/org/codelibs/fess/web/admin/RoleTypeAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/RoleTypeAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,18 +23,18 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.RoleType; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.RoleTypePager; import org.codelibs.fess.service.RoleTypeService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +50,7 @@ public class RoleTypeAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected RoleTypeForm roleTypeForm; @@ -65,25 +65,25 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { roleTypeForm.value = roleTypeForm.value.trim(); return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { roleTypeForm.value = roleTypeForm.value.trim(); return "confirm.jsp"; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(roleTypeForm.pageNumber)) { @@ -99,34 +99,32 @@ public class RoleTypeAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(roleTypeForm.searchParams, roleTypePager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(roleTypeForm.searchParams, roleTypePager, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { roleTypePager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (roleTypeForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -139,7 +137,7 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi roleTypeForm.initialize(); @@ -149,7 +147,7 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (roleTypeForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, roleTypeForm.crudMode }); @@ -161,7 +159,7 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { roleTypeForm.crudMode = CommonConstants.EDIT_MODE; @@ -171,7 +169,7 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (roleTypeForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -184,7 +182,7 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { roleTypeForm.crudMode = CommonConstants.DELETE_MODE; @@ -194,7 +192,7 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final RoleType roleType = createRoleType(); @@ -215,7 +213,7 @@ public class RoleTypeAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final RoleType roleType = createRoleType(); @@ -242,7 +240,7 @@ public class RoleTypeAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { roleTypeForm.id }); } - FessBeans.copy(roleType, roleTypeForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(roleType, roleTypeForm, option -> option.exclude("searchParams", "mode")); } protected Map createKeyMap() { @@ -271,13 +269,13 @@ public class RoleTypeAction extends FessAdminAction { roleType.setUpdatedBy(username); roleType.setUpdatedTime(currentTime); roleTypeForm.value = roleTypeForm.value.trim(); - FessBeans.copy(roleTypeForm, roleType).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(roleTypeForm, roleType, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return roleType; } @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (roleTypeForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -312,9 +310,7 @@ public class RoleTypeAction extends FessAdminAction { roleTypeItems = roleTypeService.getRoleTypeList(roleTypePager); // restore from pager - Beans.copy(roleTypePager, roleTypeForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(roleTypePager, roleTypeForm.searchParams, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; diff --git a/src/main/java/org/codelibs/fess/web/admin/RoleTypeForm.java b/src/main/java/org/codelibs/fess/app/web/admin/RoleTypeForm.java similarity index 64% rename from src/main/java/org/codelibs/fess/web/admin/RoleTypeForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/RoleTypeForm.java index 68b477161..7a7f02d05 100644 --- a/src/main/java/org/codelibs/fess/web/admin/RoleTypeForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/RoleTypeForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,51 +26,51 @@ public class RoleTypeForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String name; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 20) - @Mask(mask = "^[a-zA-Z0-9_-| ]+$", msg = @Msg(key = "errors.alphaDigitSpaceOnly")) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 20) + //@Mask(mask = "^[a-zA-Z0-9_-| ]+$", msg = @Msg(key = "errors.alphaDigitSpaceOnly")) public String value; - @Required(target = "confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/ScheduledJobAction.java b/src/main/java/org/codelibs/fess/app/web/admin/ScheduledJobAction.java similarity index 84% rename from src/main/java/org/codelibs/fess/web/admin/ScheduledJobAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/ScheduledJobAction.java index 0e7f8b843..1a590f5ad 100644 --- a/src/main/java/org/codelibs/fess/web/admin/ScheduledJobAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/ScheduledJobAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,23 +23,23 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.Constants; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.RoleType; import org.codelibs.fess.es.exentity.ScheduledJob; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.JobHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.job.JobExecutor; import org.codelibs.fess.pager.ScheduledJobPager; import org.codelibs.fess.service.RoleTypeService; import org.codelibs.fess.service.ScheduledJobService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -62,7 +62,7 @@ public class ScheduledJobAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected ScheduledJobForm scheduledJobForm; @@ -82,7 +82,7 @@ public class ScheduledJobAction extends FessAdminAction { final ScheduledJob scheduledJob = getScheduledJob(); - FessBeans.copy(scheduledJob, scheduledJobForm).commonColumnDateConverter().excludes("searchParams", "mode", "jobLogging").execute(); + BeanUtil.copyBeanToBean(scheduledJob, scheduledJobForm, option -> option.exclude("searchParams", "mode", "jobLogging")); scheduledJobForm.jobLogging = scheduledJob.isLoggingEnabled() ? Constants.ON : null; scheduledJobForm.crawler = scheduledJob.isCrawlerJob() ? Constants.ON : null; scheduledJobForm.available = scheduledJob.isEnabled() ? Constants.ON : null; @@ -106,7 +106,7 @@ public class ScheduledJobAction extends FessAdminAction { } scheduledJob.setUpdatedBy(username); scheduledJob.setUpdatedTime(currentTime); - FessBeans.copy(scheduledJobForm, scheduledJob).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(scheduledJobForm, scheduledJob, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); scheduledJob.setJobLogging(Constants.ON.equals(scheduledJobForm.jobLogging) ? Constants.T : Constants.F); scheduledJob.setCrawler(Constants.ON.equals(scheduledJobForm.crawler) ? Constants.T : Constants.F); scheduledJob.setAvailable(Constants.ON.equals(scheduledJobForm.available) ? Constants.T : Constants.F); @@ -114,7 +114,7 @@ public class ScheduledJobAction extends FessAdminAction { return scheduledJob; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (scheduledJobForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -140,7 +140,7 @@ public class ScheduledJobAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String start() { final ScheduledJob scheduledJob = getScheduledJob(); try { @@ -154,7 +154,7 @@ public class ScheduledJobAction extends FessAdminAction { } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String stop() { final ScheduledJob scheduledJob = getScheduledJob(); try { @@ -186,9 +186,8 @@ public class ScheduledJobAction extends FessAdminAction { scheduledJobItems = scheduledJobService.getScheduledJobList(scheduledJobPager); // restore from pager - Beans.copy(scheduledJobPager, scheduledJobForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(scheduledJobPager, scheduledJobForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -197,12 +196,12 @@ public class ScheduledJobAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(scheduledJobForm.pageNumber)) { @@ -218,34 +217,33 @@ public class ScheduledJobAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(scheduledJobForm.searchParams, scheduledJobPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(scheduledJobForm.searchParams, scheduledJobPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { scheduledJobPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (scheduledJobForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -258,7 +256,7 @@ public class ScheduledJobAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi scheduledJobForm.initialize(); @@ -268,7 +266,7 @@ public class ScheduledJobAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (scheduledJobForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -281,7 +279,7 @@ public class ScheduledJobAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { scheduledJobForm.crudMode = CommonConstants.EDIT_MODE; @@ -291,19 +289,19 @@ public class ScheduledJobAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (scheduledJobForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -316,7 +314,7 @@ public class ScheduledJobAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { scheduledJobForm.crudMode = CommonConstants.DELETE_MODE; @@ -326,7 +324,7 @@ public class ScheduledJobAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final ScheduledJob scheduledJob = createScheduledJob(); @@ -347,7 +345,7 @@ public class ScheduledJobAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final ScheduledJob scheduledJob = createScheduledJob(); diff --git a/src/main/java/org/codelibs/fess/web/admin/ScheduledJobForm.java b/src/main/java/org/codelibs/fess/app/web/admin/ScheduledJobForm.java similarity index 67% rename from src/main/java/org/codelibs/fess/web/admin/ScheduledJobForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/ScheduledJobForm.java index 6cb7278ed..c954a7e77 100644 --- a/src/main/java/org/codelibs/fess/web/admin/ScheduledJobForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/ScheduledJobForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -28,40 +28,40 @@ public class ScheduledJobForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String name; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String target; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) @CronExpression public String cronExpression; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String scriptType; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String scriptData; // ignore @@ -73,25 +73,25 @@ public class ScheduledJobForm implements Serializable { // ignore public String available; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntegerType - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntegerType + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") + //@Required(target = "confirmfromupdate,update,delete") public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/SearchListAction.java b/src/main/java/org/codelibs/fess/app/web/admin/SearchListAction.java similarity index 91% rename from src/main/java/org/codelibs/fess/web/admin/SearchListAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/SearchListAction.java index a3cccfbbc..5e3a67237 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SearchListAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SearchListAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.io.Serializable; @@ -25,24 +25,25 @@ import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; import org.codelibs.fess.InvalidQueryException; import org.codelibs.fess.ResultOffsetExceededException; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.client.FessEsClient; import org.codelibs.fess.client.FessEsClient.SearchConditionBuilder; import org.codelibs.fess.crud.util.SAStrutsUtil; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.FieldHelper; import org.codelibs.fess.helper.JobHelper; import org.codelibs.fess.helper.QueryHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.QueryResponseList; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; -import org.lastaflute.web.Execute; +import org.lastaflute.taglib.function.LaFunctions; import org.lastaflute.web.util.LaRequestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +53,7 @@ public class SearchListAction implements Serializable { private static final long serialVersionUID = 1L; - @ActionForm + //@ActionForm @Resource protected SearchListForm searchListForm; @@ -103,7 +104,7 @@ public class SearchListAction implements Serializable { return systemHelper.getHelpLink("searchList"); } - @Execute(validator = false) + //@Execute(validator = false) public String index() { return "index.jsp"; } @@ -175,29 +176,28 @@ public class SearchListAction implements Serializable { execTime = nf.format((double) queryResponseList.getExecTime() / 1000); } catch (final Exception e) {} - Beans.copy(documentItems, this) - .includes("pageSize", "currentPageNumber", "allRecordCount", "allPageCount", "existNextPage", "existPrevPage", - "currentStartRecordNumber", "currentEndRecordNumber", "pageNumberList").execute(); + BeanUtil.copyBeanToBean(documentItems, this, option -> option.include("pageSize", "currentPageNumber", "allRecordCount", + "allPageCount", "existNextPage", "existPrevPage", "currentStartRecordNumber", "currentEndRecordNumber", "pageNumberList")); return query; } - @Execute(validator = false) + //@Execute(validator = false) public String search() { return doSearch(); } - @Execute(validator = false) + //@Execute(validator = false) public String prev() { return doMove(-1); } - @Execute(validator = false) + //@Execute(validator = false) public String next() { return doMove(1); } - @Execute(validator = false) + //@Execute(validator = false) public String move() { return doMove(0); } @@ -233,13 +233,13 @@ public class SearchListAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String confirmDelete() { return "confirmDelete.jsp"; } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String delete() { return deleteByQuery(searchListForm.docId); } diff --git a/src/main/java/org/codelibs/fess/web/admin/SearchListForm.java b/src/main/java/org/codelibs/fess/app/web/admin/SearchListForm.java similarity index 79% rename from src/main/java/org/codelibs/fess/web/admin/SearchListForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/SearchListForm.java index d19de6062..72ea3dfac 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SearchListForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SearchListForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; @@ -22,22 +22,22 @@ public class SearchListForm implements Serializable { private static final long serialVersionUID = 1L; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String query; - @IntegerType + //@IntegerType public String start; - @IntegerType + //@IntegerType public String pn; - @IntegerType + //@IntegerType public String num; - @Required(target = "confirmDelete,delete") + //@Required(target = "confirmDelete,delete") public String docId; - @Required(target = "confirmDelete") + //@Required(target = "confirmDelete") public String url; } diff --git a/src/main/java/org/codelibs/fess/web/admin/SuggestBadWordAction.java b/src/main/java/org/codelibs/fess/app/web/admin/SuggestBadWordAction.java similarity index 86% rename from src/main/java/org/codelibs/fess/web/admin/SuggestBadWordAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/SuggestBadWordAction.java index 863be9332..cdaff227c 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SuggestBadWordAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SuggestBadWordAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.io.BufferedInputStream; @@ -35,22 +35,23 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.core.io.CopyUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; import org.codelibs.fess.FessSystemException; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.SuggestBadWord; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SuggestHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.SuggestBadWordPager; import org.codelibs.fess.service.SuggestBadWordService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,7 +66,7 @@ public class SuggestBadWordAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected SuggestBadWordForm suggestBadWordForm; @@ -89,9 +90,8 @@ public class SuggestBadWordAction extends FessAdminAction { suggestBadWordItems = suggestBadWordService.getSuggestBadWordList(suggestBadWordPager); // restore from pager - Beans.copy(suggestBadWordPager, suggestBadWordForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(suggestBadWordPager, suggestBadWordForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -100,12 +100,12 @@ public class SuggestBadWordAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(suggestBadWordForm.pageNumber)) { @@ -121,34 +121,33 @@ public class SuggestBadWordAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(suggestBadWordForm.searchParams, suggestBadWordPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(suggestBadWordForm.searchParams, suggestBadWordPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { suggestBadWordPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (suggestBadWordForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -161,7 +160,7 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi suggestBadWordForm.initialize(); @@ -171,7 +170,7 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (suggestBadWordForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -184,7 +183,7 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { suggestBadWordForm.crudMode = CommonConstants.EDIT_MODE; @@ -194,19 +193,19 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (suggestBadWordForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -219,7 +218,7 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { suggestBadWordForm.crudMode = CommonConstants.DELETE_MODE; @@ -248,7 +247,7 @@ public class SuggestBadWordAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { suggestBadWordForm.id }); } - FessBeans.copy(suggestBadWord, suggestBadWordForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(suggestBadWord, suggestBadWordForm, option -> option.exclude("searchParams", "mode")); } protected SuggestBadWord createSuggestBadWord() { @@ -268,12 +267,12 @@ public class SuggestBadWordAction extends FessAdminAction { } suggestBadWord.setUpdatedBy(username); suggestBadWord.setUpdatedTime(currentTime); - FessBeans.copy(suggestBadWordForm, suggestBadWord).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(suggestBadWordForm, suggestBadWord, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return suggestBadWord; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (suggestBadWordForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -306,7 +305,7 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final SuggestBadWord suggestBadWord = createSuggestBadWord(); @@ -329,7 +328,7 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final SuggestBadWord suggestBadWord = createSuggestBadWord(); @@ -352,13 +351,13 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String downloadpage() { return "download.jsp"; } @Token(save = false, validate = true) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String download() { final HttpServletResponse response = LaResponseUtil.getResponse(); @@ -377,13 +376,13 @@ public class SuggestBadWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "uploadpage") + //@Execute(validator = false, input = "uploadpage") public String uploadpage() { return "upload.jsp"; } @Token(save = false, validate = true) - @Execute(validator = true, input = "uploadpage") + //@Execute(validator = true, input = "uploadpage") public String upload() { BufferedInputStream is = null; File tempFile = null; @@ -398,7 +397,7 @@ public class SuggestBadWordAction extends FessAdminAction { } is.reset(); fos = new FileOutputStream(tempFile); - StreamUtil.drain(is, fos); + CopyUtil.copy(is, fos); } catch (final Exception e) { if (tempFile != null && !tempFile.delete()) { logger.warn("Could not delete " + tempFile.getAbsolutePath()); diff --git a/src/main/java/org/codelibs/fess/web/admin/SuggestBadWordForm.java b/src/main/java/org/codelibs/fess/app/web/admin/SuggestBadWordForm.java similarity index 71% rename from src/main/java/org/codelibs/fess/web/admin/SuggestBadWordForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/SuggestBadWordForm.java index 2268aa930..a6052d391 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SuggestBadWordForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SuggestBadWordForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,49 +26,49 @@ public class SuggestBadWordForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String suggestWord; public String targetRole; public String targetLabel; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; - @Required(target = "upload") - public FormFile suggestBadWordFile; + //@Required(target = "upload") + //public FormFile suggestBadWordFile; public void initialize() { id = null; diff --git a/src/main/java/org/codelibs/fess/web/admin/SuggestElevateWordAction.java b/src/main/java/org/codelibs/fess/app/web/admin/SuggestElevateWordAction.java similarity index 86% rename from src/main/java/org/codelibs/fess/web/admin/SuggestElevateWordAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/SuggestElevateWordAction.java index 640efafd8..03356f1a4 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SuggestElevateWordAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SuggestElevateWordAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.io.BufferedInputStream; @@ -35,22 +35,23 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.core.io.CopyUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; import org.codelibs.fess.FessSystemException; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.SuggestElevateWord; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SuggestHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.SuggestElevateWordPager; import org.codelibs.fess.service.SuggestElevateWordService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -74,7 +75,7 @@ public class SuggestElevateWordAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected SuggestElevateWordForm suggestElevateWordForm; @@ -89,9 +90,8 @@ public class SuggestElevateWordAction extends FessAdminAction { suggestElevateWordItems = suggestElevateWordService.getSuggestElevateWordList(suggestElevateWordPager); // restore from pager - Beans.copy(suggestElevateWordPager, suggestElevateWordForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(suggestElevateWordPager, suggestElevateWordForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -100,12 +100,12 @@ public class SuggestElevateWordAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(suggestElevateWordForm.pageNumber)) { @@ -121,34 +121,33 @@ public class SuggestElevateWordAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(suggestElevateWordForm.searchParams, suggestElevateWordPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(suggestElevateWordForm.searchParams, suggestElevateWordPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { suggestElevateWordPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (suggestElevateWordForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -161,7 +160,7 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi suggestElevateWordForm.initialize(); @@ -171,7 +170,7 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (suggestElevateWordForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -184,7 +183,7 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { suggestElevateWordForm.crudMode = CommonConstants.EDIT_MODE; @@ -194,19 +193,19 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (suggestElevateWordForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -219,7 +218,7 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { suggestElevateWordForm.crudMode = CommonConstants.DELETE_MODE; @@ -248,7 +247,7 @@ public class SuggestElevateWordAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { suggestElevateWordForm.id }); } - FessBeans.copy(suggestElevateWord, suggestElevateWordForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(suggestElevateWord, suggestElevateWordForm, option -> option.excludes("searchParams", "mode")); } protected SuggestElevateWord createSuggestElevateWord() { @@ -268,13 +267,14 @@ public class SuggestElevateWordAction extends FessAdminAction { } suggestElevateWord.setUpdatedBy(username); suggestElevateWord.setUpdatedTime(currentTime); - FessBeans.copy(suggestElevateWordForm, suggestElevateWord).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(suggestElevateWordForm, suggestElevateWord, + option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return suggestElevateWord; } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final SuggestElevateWord suggestElevateWord = createSuggestElevateWord(); @@ -296,7 +296,7 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final SuggestElevateWord suggestElevateWord = createSuggestElevateWord(); @@ -317,7 +317,7 @@ public class SuggestElevateWordAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (suggestElevateWordForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -349,13 +349,13 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String downloadpage() { return "download.jsp"; } @Token(save = false, validate = true) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String download() { final HttpServletResponse response = LaResponseUtil.getResponse(); @@ -374,13 +374,13 @@ public class SuggestElevateWordAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "uploadpage") + //@Execute(validator = false, input = "uploadpage") public String uploadpage() { return "upload.jsp"; } @Token(save = false, validate = true) - @Execute(validator = true, input = "uploadpage") + //@Execute(validator = true, input = "uploadpage") public String upload() { BufferedInputStream is = null; File tempFile = null; @@ -395,7 +395,7 @@ public class SuggestElevateWordAction extends FessAdminAction { } is.reset(); fos = new FileOutputStream(tempFile); - StreamUtil.drain(is, fos); + CopyUtil.copy(is, fos); } catch (final Exception e) { if (tempFile != null && !tempFile.delete()) { logger.warn("Could not delete " + tempFile.getAbsolutePath()); diff --git a/src/main/java/org/codelibs/fess/web/admin/SuggestElevateWordForm.java b/src/main/java/org/codelibs/fess/app/web/admin/SuggestElevateWordForm.java similarity index 71% rename from src/main/java/org/codelibs/fess/web/admin/SuggestElevateWordForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/SuggestElevateWordForm.java index df7404568..48a3aedff 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SuggestElevateWordForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SuggestElevateWordForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,26 +26,26 @@ public class SuggestElevateWordForm implements Serializable { private static final long serialVersionUID = 1L; - @Required(target = "upload") - public FormFile suggestElevateWordFile; + //@Required(target = "upload") + //public FormFile suggestElevateWordFile; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") public String suggestWord; public String reading; @@ -54,26 +54,26 @@ public class SuggestElevateWordForm implements Serializable { public String targetLabel; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") @FloatType public String boost; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/SystemAction.java b/src/main/java/org/codelibs/fess/app/web/admin/SystemAction.java similarity index 93% rename from src/main/java/org/codelibs/fess/web/admin/SystemAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/SystemAction.java index b823ae950..36d5e010c 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SystemAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SystemAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.List; @@ -24,14 +24,13 @@ import javax.annotation.Resource; import javax.servlet.http.HttpSession; import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.client.FessEsClient; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.ScheduledJob; import org.codelibs.fess.helper.JobHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.service.ScheduledJobService; -import org.codelibs.sastruts.core.annotation.Token; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaRequestUtil; public class SystemAction implements Serializable { @@ -39,7 +38,7 @@ public class SystemAction implements Serializable { private static final long serialVersionUID = 1L; - @ActionForm + //@ActionForm @Resource protected SystemForm systemForm; @@ -73,13 +72,13 @@ public class SystemAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false) + //@Execute(validator = false) public String index() { return showIndex(false); } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String start() { if (!jobHelper.isCrawlProcessRunning()) { final List scheduledJobList = scheduledJobService.getCrawloerJobList(); @@ -95,7 +94,7 @@ public class SystemAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = true, input = "index") + //@Execute(validator = true, input = "index") public String stop() { if (jobHelper.isCrawlProcessRunning()) { if (StringUtil.isNotBlank(systemForm.sessionId)) { diff --git a/src/main/java/org/codelibs/fess/web/admin/SystemForm.java b/src/main/java/org/codelibs/fess/app/web/admin/SystemForm.java similarity index 91% rename from src/main/java/org/codelibs/fess/web/admin/SystemForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/SystemForm.java index ff3088457..9f3ae1a7d 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SystemForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SystemForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; @@ -22,7 +22,7 @@ public class SystemForm implements Serializable { private static final long serialVersionUID = 1L; - @Required(target = "delete") + //@Required(target = "delete") public String sessionId; } diff --git a/src/main/java/org/codelibs/fess/web/admin/SystemInfoAction.java b/src/main/java/org/codelibs/fess/app/web/admin/SystemInfoAction.java similarity index 97% rename from src/main/java/org/codelibs/fess/web/admin/SystemInfoAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/SystemInfoAction.java index fb91d6490..7f77cbdd8 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SystemInfoAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SystemInfoAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.ArrayList; @@ -28,13 +28,12 @@ import org.codelibs.core.lang.StringUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; import org.codelibs.fess.helper.SystemHelper; -import org.lastaflute.web.Execute; public class SystemInfoAction implements Serializable { private static final long serialVersionUID = 1L; - @ActionForm + //@ActionForm @Resource protected SystemInfoForm systemInfoForm; @@ -56,7 +55,7 @@ public class SystemInfoAction implements Serializable { return systemHelper.getHelpLink("systemInfo"); } - @Execute(validator = false) + //@Execute(validator = false) public String index() { envItems = new ArrayList>(); propItems = new ArrayList>(); diff --git a/src/main/java/org/codelibs/fess/web/admin/SystemInfoForm.java b/src/main/java/org/codelibs/fess/app/web/admin/SystemInfoForm.java similarity index 94% rename from src/main/java/org/codelibs/fess/web/admin/SystemInfoForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/SystemInfoForm.java index 4b0adcd19..5792ce1a2 100644 --- a/src/main/java/org/codelibs/fess/web/admin/SystemInfoForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/SystemInfoForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; diff --git a/src/main/java/org/codelibs/fess/web/admin/WebAuthenticationAction.java b/src/main/java/org/codelibs/fess/app/web/admin/WebAuthenticationAction.java similarity index 85% rename from src/main/java/org/codelibs/fess/web/admin/WebAuthenticationAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/WebAuthenticationAction.java index 18992b557..7b48fbb89 100644 --- a/src/main/java/org/codelibs/fess/web/admin/WebAuthenticationAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/WebAuthenticationAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.ArrayList; @@ -24,22 +24,23 @@ import java.util.Map; import javax.annotation.Resource; +import org.apache.lucene.queryparser.flexible.standard.CommonQueryParserConfiguration; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.Constants; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.WebAuthentication; import org.codelibs.fess.es.exentity.WebConfig; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.WebAuthenticationPager; import org.codelibs.fess.service.WebAuthenticationService; import org.codelibs.fess.service.WebConfigService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaRequestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,7 +55,7 @@ public class WebAuthenticationAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected WebAuthenticationForm webAuthenticationForm; @@ -75,9 +76,8 @@ public class WebAuthenticationAction extends FessAdminAction { webAuthenticationItems = webAuthenticationService.getWebAuthenticationList(webAuthenticationPager); // restore from pager - Beans.copy(webAuthenticationPager, webAuthenticationForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(webAuthenticationPager, webAuthenticationForm.searchParams, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -86,12 +86,12 @@ public class WebAuthenticationAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(webAuthenticationForm.pageNumber)) { @@ -107,34 +107,33 @@ public class WebAuthenticationAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(webAuthenticationForm.searchParams, webAuthenticationPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(webAuthenticationForm.searchParams, webAuthenticationPager, + option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { webAuthenticationPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (webAuthenticationForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -147,7 +146,7 @@ public class WebAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi webAuthenticationForm.initialize(); @@ -157,7 +156,7 @@ public class WebAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (webAuthenticationForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, @@ -170,7 +169,7 @@ public class WebAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { webAuthenticationForm.crudMode = CommonConstants.EDIT_MODE; @@ -180,19 +179,19 @@ public class WebAuthenticationAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (webAuthenticationForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -205,7 +204,7 @@ public class WebAuthenticationAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { webAuthenticationForm.crudMode = CommonConstants.DELETE_MODE; @@ -215,7 +214,7 @@ public class WebAuthenticationAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final WebAuthentication webAuthentication = createWebAuthentication(); @@ -236,7 +235,7 @@ public class WebAuthenticationAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final WebAuthentication webAuthentication = createWebAuthentication(); @@ -276,7 +275,7 @@ public class WebAuthenticationAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { webAuthenticationForm.id }); } - FessBeans.copy(webAuthentication, webAuthenticationForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(webAuthentication, webAuthenticationForm, option -> option.excludes("searchParams", "mode")); if ("-1".equals(webAuthenticationForm.port)) { webAuthenticationForm.port = StringUtil.EMPTY; } @@ -302,13 +301,13 @@ public class WebAuthenticationAction extends FessAdminAction { if (StringUtil.isBlank(webAuthenticationForm.port)) { webAuthenticationForm.port = "-1"; } - FessBeans.copy(webAuthenticationForm, webAuthentication).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(webAuthenticationForm, webAuthentication, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return webAuthentication; } @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (webAuthenticationForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/WebAuthenticationForm.java b/src/main/java/org/codelibs/fess/app/web/admin/WebAuthenticationForm.java similarity index 66% rename from src/main/java/org/codelibs/fess/web/admin/WebAuthenticationForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/WebAuthenticationForm.java index 3318942f1..69a5be92e 100644 --- a/src/main/java/org/codelibs/fess/web/admin/WebAuthenticationForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/WebAuthenticationForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -26,64 +26,64 @@ public class WebAuthenticationForm implements Serializable { private static final long serialVersionUID = 1L; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Maxbytelength(maxbytelength = 100) + //@Maxbytelength(maxbytelength = 100) public String hostname; - @IntRange(min = -1, max = 2147483647) + //@IntRange(min = -1, max = 2147483647) public String port; - @Maxbytelength(maxbytelength = 100) + //@Maxbytelength(maxbytelength = 100) public String authRealm; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String protocolScheme; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 100) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 100) public String username; - @Maxbytelength(maxbytelength = 100) + //@Maxbytelength(maxbytelength = 100) public String password; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String parameters; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String webConfigId; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/WebConfigAction.java b/src/main/java/org/codelibs/fess/app/web/admin/WebConfigAction.java similarity index 84% rename from src/main/java/org/codelibs/fess/web/admin/WebConfigAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/WebConfigAction.java index ff3349cf8..2a6c5bc02 100644 --- a/src/main/java/org/codelibs/fess/web/admin/WebConfigAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/WebConfigAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.beans.Beans; import java.util.HashMap; @@ -23,6 +23,9 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; +import org.codelibs.fess.annotation.Token; +import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.beans.FessBeans; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -31,16 +34,13 @@ import org.codelibs.fess.es.exentity.CrawlingConfig; import org.codelibs.fess.es.exentity.LabelType; import org.codelibs.fess.es.exentity.RoleType; import org.codelibs.fess.es.exentity.WebConfig; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.WebConfigPager; import org.codelibs.fess.service.FailureUrlService; import org.codelibs.fess.service.LabelTypeService; import org.codelibs.fess.service.RoleTypeService; import org.codelibs.fess.service.WebConfigService; -import org.codelibs.fess.web.base.FessAdminAction; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,7 +54,7 @@ public class WebConfigAction extends FessAdminAction { // for edit/confirm/delete - @ActionForm + //@ActionForm @Resource protected WebConfigForm webConfigForm; @@ -85,9 +85,7 @@ public class WebConfigAction extends FessAdminAction { webConfigItems = webConfigService.getWebConfigList(webConfigPager); // restore from pager - Beans.copy(webConfigPager, webConfigForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(webConfigPager, webConfigForm.searchParams, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?redirect=true"; @@ -96,12 +94,12 @@ public class WebConfigAction extends FessAdminAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(webConfigForm.pageNumber)) { @@ -117,34 +115,32 @@ public class WebConfigAction extends FessAdminAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(webConfigForm.searchParams, webConfigPager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); + BeanUtil.copyBeanToBean(webConfigForm.searchParams, webConfigPager, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { webConfigPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}") public String confirmpage() { if (webConfigForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -157,7 +153,7 @@ public class WebConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi webConfigForm.initialize(); @@ -167,7 +163,7 @@ public class WebConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}") public String editpage() { if (webConfigForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -180,7 +176,7 @@ public class WebConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { webConfigForm.crudMode = CommonConstants.EDIT_MODE; @@ -190,19 +186,19 @@ public class WebConfigAction extends FessAdminAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}") public String deletepage() { if (webConfigForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, @@ -215,7 +211,7 @@ public class WebConfigAction extends FessAdminAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { webConfigForm.crudMode = CommonConstants.DELETE_MODE; @@ -225,7 +221,7 @@ public class WebConfigAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final WebConfig webConfig = createWebConfig(); @@ -246,7 +242,7 @@ public class WebConfigAction extends FessAdminAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final WebConfig webConfig = createWebConfig(); @@ -282,7 +278,7 @@ public class WebConfigAction extends FessAdminAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { webConfigForm.id }); } - FessBeans.copy(webConfig, webConfigForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); + BeanUtil.copyBeanToBean(webConfig, webConfigForm, option -> option.exclude("searchParams", "mode")); // normalize boost if (webConfigForm.boost != null && webConfigForm.boost.indexOf('.') > 0) { @@ -307,12 +303,12 @@ public class WebConfigAction extends FessAdminAction { } webConfig.setUpdatedBy(username); webConfig.setUpdatedTime(currentTime); - FessBeans.copy(webConfigForm, webConfig).excludesCommonColumns().execute(); + BeanUtil.copyBeanToBean(webConfigForm, webConfig, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE)); return webConfig; } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (webConfigForm.crudMode != CommonConstants.DELETE_MODE) { throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, diff --git a/src/main/java/org/codelibs/fess/web/admin/WebConfigForm.java b/src/main/java/org/codelibs/fess/app/web/admin/WebConfigForm.java similarity index 62% rename from src/main/java/org/codelibs/fess/web/admin/WebConfigForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/WebConfigForm.java index 0eba0f2c6..7697a9c0e 100644 --- a/src/main/java/org/codelibs/fess/web/admin/WebConfigForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/WebConfigForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.util.HashMap; @@ -33,92 +33,92 @@ public class WebConfigForm implements Serializable { public String[] labelTypeIds; - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 200) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 200) public String name; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") @UriType(protocols = "http:,https:") - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String urls; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String includedUrls; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String excludedUrls; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String includedDocUrls; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String excludedDocUrls; - @Maxbytelength(maxbytelength = 4000) + //@Maxbytelength(maxbytelength = 4000) public String configParameter; - @IntRange(min = 0, max = 2147483647) + //@IntRange(min = 0, max = 2147483647) public String depth; - @LongRange(min = 0, max = 9223372036854775807l) + //@LongRange(min = 0, max = 9223372036854775807l) public String maxAccessCount; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 200) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 200) public String userAgent; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String numOfThread; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String intervalTime; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String boost; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 5) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 5) public String available; - @Required(target = "confirmfromupdate,update,delete") - @IntRange(min = 0, max = 2147483647) + //@Required(target = "confirmfromupdate,update,delete") + //@IntRange(min = 0, max = 2147483647) public String sortOrder; - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) + //@Required(target = "confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 255) public String createdBy; - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String createdTime; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String updatedBy; - @LongType + //@LongType public String updatedTime; - @Required(target = "confirmfromupdate,update,delete") - @IntegerType + //@Required(target = "confirmfromupdate,update,delete") + //@IntegerType public String versionNo; public void initialize() { diff --git a/src/main/java/org/codelibs/fess/web/admin/WizardAction.java b/src/main/java/org/codelibs/fess/app/web/admin/WizardAction.java similarity index 95% rename from src/main/java/org/codelibs/fess/web/admin/WizardAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/WizardAction.java index f9df847c7..63a842316 100644 --- a/src/main/java/org/codelibs/fess/web/admin/WizardAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/WizardAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; import java.io.UnsupportedEncodingException; @@ -26,10 +26,12 @@ import javax.annotation.Resource; import org.codelibs.core.lang.StringUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.es.exentity.FileConfig; import org.codelibs.fess.es.exentity.ScheduledJob; import org.codelibs.fess.es.exentity.WebConfig; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.JobHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.job.TriggeredJob; @@ -38,9 +40,6 @@ import org.codelibs.fess.service.ScheduledJobService; import org.codelibs.fess.service.WebConfigService; import org.codelibs.fess.util.ComponentUtil; import org.codelibs.robot.util.CharUtil; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +48,7 @@ public class WizardAction implements Serializable { private static final Logger logger = LoggerFactory.getLogger(WizardAction.class); - @ActionForm + //@ActionForm @Resource protected WizardForm wizardForm; @@ -75,19 +74,19 @@ public class WizardAction implements Serializable { return systemHelper.getHelpLink("wizard"); } - @Execute(validator = false) + //@Execute(validator = false) public String index() { return "index.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false) + //@Execute(validator = false) public String crawlingConfigForm() { return "crawlingConfig.jsp"; } @Token(save = false, validate = true) - @Execute(validator = true, input = "crawlingConfigForm") + //@Execute(validator = true, input = "crawlingConfigForm") public String crawlingConfig() { final String name = crawlingConfigInternal(wizardForm.crawlingConfigName, wizardForm.crawlingConfigPath); SAStrutsUtil.addSessionMessage("success.create_crawling_config_at_wizard", name); @@ -95,7 +94,7 @@ public class WizardAction implements Serializable { } @Token(save = false, validate = true) - @Execute(validator = true, input = "crawlingConfigForm") + //@Execute(validator = true, input = "crawlingConfigForm") public String crawlingConfigNext() { final String name = crawlingConfigInternal(wizardForm.crawlingConfigName, wizardForm.crawlingConfigPath); SAStrutsUtil.addSessionMessage("success.create_crawling_config_at_wizard", name); @@ -250,13 +249,13 @@ public class WizardAction implements Serializable { } @Token(save = true, validate = false) - @Execute(validator = false) + //@Execute(validator = false) public String startCrawlingForm() { return "startCrawling.jsp"; } @Token(save = false, validate = true) - @Execute(validator = false) + //@Execute(validator = false) public String startCrawling() { if (!jobHelper.isCrawlProcessRunning()) { final List scheduledJobList = scheduledJobService.getCrawloerJobList(); diff --git a/src/main/java/org/codelibs/fess/web/admin/WizardForm.java b/src/main/java/org/codelibs/fess/app/web/admin/WizardForm.java similarity index 72% rename from src/main/java/org/codelibs/fess/web/admin/WizardForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/WizardForm.java index 6c6e3dfa9..bdd0551d5 100644 --- a/src/main/java/org/codelibs/fess/web/admin/WizardForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/WizardForm.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin; +package org.codelibs.fess.app.web.admin; import java.io.Serializable; @@ -22,17 +22,17 @@ public class WizardForm implements Serializable { private static final long serialVersionUID = 1L; - @Maxbytelength(maxbytelength = 200, target = "crawlingConfig,crawlingConfigNext") + //@Maxbytelength(maxbytelength = 200, target = "crawlingConfig,crawlingConfigNext") public String crawlingConfigName; - @Required(target = "crawlingConfig,crawlingConfigNext") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "crawlingConfig,crawlingConfigNext") + //@Maxbytelength(maxbytelength = 1000) public String crawlingConfigPath; - @LongRange(min = 0, max = Long.MAX_VALUE, target = "crawlingConfig,crawlingConfigNext") + //@LongRange(min = 0, max = Long.MAX_VALUE, target = "crawlingConfig,crawlingConfigNext") public String maxAccessCount; - @IntRange(min = 0, max = Integer.MAX_VALUE, target = "crawlingConfig,crawlingConfigNext") + //@IntRange(min = 0, max = Integer.MAX_VALUE, target = "crawlingConfig,crawlingConfigNext") public String depth; public WizardForm() { diff --git a/src/main/java/org/codelibs/fess/web/admin/dict/SynonymAction.java b/src/main/java/org/codelibs/fess/app/web/admin/dict/SynonymAction.java similarity index 87% rename from src/main/java/org/codelibs/fess/web/admin/dict/SynonymAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/dict/SynonymAction.java index b0c433e85..7df8edcd7 100644 --- a/src/main/java/org/codelibs/fess/web/admin/dict/SynonymAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/dict/SynonymAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin.dict; +package org.codelibs.fess.app.web.admin.dict; import java.beans.Beans; import java.io.IOException; @@ -29,19 +29,19 @@ import javax.annotation.Resource; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.dict.DictionaryExpiredException; import org.codelibs.fess.dict.synonym.SynonymFile; import org.codelibs.fess.dict.synonym.SynonymItem; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.SynonymPager; import org.codelibs.fess.service.SynonymService; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaResponseUtil; public class SynonymAction { @@ -49,7 +49,7 @@ public class SynonymAction { private static final Log log = LogFactory.getLog(SynonymAction.class); @Resource - @ActionForm + //@ActionForm protected SynonymForm synonymForm; @Resource @@ -74,7 +74,7 @@ public class SynonymAction { synonymItemItems = synonymService.getSynonymList(synonymForm.dictId, synonymPager); // restore from pager - Beans.copy(synonymPager, synonymForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(synonymPager, synonymForm.searchParams, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?dictId=" + synonymForm.dictId + "&redirect=true"; @@ -83,12 +83,12 @@ public class SynonymAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{dictId}/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{dictId}/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(synonymForm.pageNumber)) { @@ -104,32 +104,32 @@ public class SynonymAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(synonymForm.searchParams, synonymPager).excludes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(synonymForm.searchParams, synonymPager, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { synonymPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{dictId}/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{dictId}/{crudMode}/{id}") public String confirmpage() { if (synonymForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -142,7 +142,7 @@ public class SynonymAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi synonymForm.initialize(); @@ -152,7 +152,7 @@ public class SynonymAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{dictId}/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{dictId}/{crudMode}/{id}") public String editpage() { if (synonymForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, synonymForm.crudMode }); @@ -164,7 +164,7 @@ public class SynonymAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { synonymForm.crudMode = CommonConstants.EDIT_MODE; @@ -174,19 +174,19 @@ public class SynonymAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{dictId}/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{dictId}/{crudMode}/{id}") public String deletepage() { if (synonymForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -199,7 +199,7 @@ public class SynonymAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { synonymForm.crudMode = CommonConstants.DELETE_MODE; @@ -209,7 +209,7 @@ public class SynonymAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final SynonymItem synonymItem = createSynonym(); @@ -232,7 +232,7 @@ public class SynonymAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final SynonymItem synonymItem = createSynonym(); @@ -255,7 +255,7 @@ public class SynonymAction { } @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (synonymForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -291,7 +291,7 @@ public class SynonymAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String downloadpage() { final SynonymFile synonymFile = synonymService.getSynonymFile(synonymForm.dictId); if (synonymFile == null) { @@ -302,7 +302,7 @@ public class SynonymAction { } @Token(save = true, validate = true) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String download() { final SynonymFile synonymFile = synonymService.getSynonymFile(synonymForm.dictId); if (synonymFile == null) { @@ -318,7 +318,7 @@ public class SynonymAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "uploadpage") + //@Execute(validator = false, input = "uploadpage") public String uploadpage() { final SynonymFile synonymFile = synonymService.getSynonymFile(synonymForm.dictId); if (synonymFile == null) { @@ -329,7 +329,7 @@ public class SynonymAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "uploadpage") + //@Execute(validator = true, input = "uploadpage") public String upload() { final SynonymFile synonymFile = synonymService.getSynonymFile(synonymForm.dictId); if (synonymFile == null) { diff --git a/src/main/java/org/codelibs/fess/web/admin/dict/SynonymForm.java b/src/main/java/org/codelibs/fess/app/web/admin/dict/SynonymForm.java similarity index 68% rename from src/main/java/org/codelibs/fess/web/admin/dict/SynonymForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/dict/SynonymForm.java index c494c0859..1c97c6227 100644 --- a/src/main/java/org/codelibs/fess/web/admin/dict/SynonymForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/dict/SynonymForm.java @@ -14,41 +14,41 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin.dict; +package org.codelibs.fess.app.web.admin.dict; import java.util.HashMap; import java.util.Map; public class SynonymForm { - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @Required + //@Required public String dictId; - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String inputs; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String outputs; - @Required(target = "upload") - public FormFile synonymFile; + //@Required(target = "upload") + //public FormFile synonymFile; public void initialize() { id = null; diff --git a/src/main/java/org/codelibs/fess/web/admin/dict/UserDictAction.java b/src/main/java/org/codelibs/fess/app/web/admin/dict/UserDictAction.java similarity index 86% rename from src/main/java/org/codelibs/fess/web/admin/dict/UserDictAction.java rename to src/main/java/org/codelibs/fess/app/web/admin/dict/UserDictAction.java index 64a6d93b4..857d14a28 100644 --- a/src/main/java/org/codelibs/fess/web/admin/dict/UserDictAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/dict/UserDictAction.java @@ -14,7 +14,7 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin.dict; +package org.codelibs.fess.app.web.admin.dict; import java.beans.Beans; import java.io.IOException; @@ -27,19 +27,19 @@ import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.annotation.Token; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.dict.DictionaryExpiredException; import org.codelibs.fess.dict.userdict.UserDictFile; import org.codelibs.fess.dict.userdict.UserDictItem; +import org.codelibs.fess.exception.SSCActionMessagesException; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.pager.UserDictPager; import org.codelibs.fess.service.UserDictService; -import org.codelibs.sastruts.core.annotation.Token; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.lastaflute.web.Execute; import org.lastaflute.web.util.LaResponseUtil; public class UserDictAction { @@ -47,7 +47,7 @@ public class UserDictAction { private static final Log log = LogFactory.getLog(UserDictAction.class); @Resource - @ActionForm + //@ActionForm protected UserDictForm userDictForm; @Resource @@ -72,7 +72,7 @@ public class UserDictAction { userDictItemItems = userDictService.getUserDictList(userDictForm.dictId, userDictPager); // restore from pager - Beans.copy(userDictPager, userDictForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(userDictPager, userDictForm.searchParams, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); if (redirect) { return "index?dictId=" + userDictForm.dictId + "&redirect=true"; @@ -81,12 +81,12 @@ public class UserDictAction { } } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String index() { return displayList(false); } - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{dictId}/{pageNumber}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{dictId}/{pageNumber}") public String list() { // page navi if (StringUtil.isNotBlank(userDictForm.pageNumber)) { @@ -102,32 +102,32 @@ public class UserDictAction { return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String search() { - Beans.copy(userDictForm.searchParams, userDictPager).excludes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(userDictForm.searchParams, userDictPager, option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE)); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String reset() { userDictPager.clear(); return displayList(false); } - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String back() { return displayList(false); } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editagain() { return "edit.jsp"; } - @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{dictId}/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{dictId}/{crudMode}/{id}") public String confirmpage() { if (userDictForm.crudMode != CommonConstants.CONFIRM_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE, @@ -140,7 +140,7 @@ public class UserDictAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String createpage() { // page navi userDictForm.initialize(); @@ -150,7 +150,7 @@ public class UserDictAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{dictId}/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{dictId}/{crudMode}/{id}") public String editpage() { if (userDictForm.crudMode != CommonConstants.EDIT_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE, userDictForm.crudMode }); @@ -162,7 +162,7 @@ public class UserDictAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String editfromconfirm() { userDictForm.crudMode = CommonConstants.EDIT_MODE; @@ -172,19 +172,19 @@ public class UserDictAction { } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromcreate() { return "confirm.jsp"; } @Token(save = false, validate = true, keep = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String confirmfromupdate() { return "confirm.jsp"; } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{dictId}/{crudMode}/{id}") + //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{dictId}/{crudMode}/{id}") public String deletepage() { if (userDictForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -197,7 +197,7 @@ public class UserDictAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String deletefromconfirm() { userDictForm.crudMode = CommonConstants.DELETE_MODE; @@ -207,7 +207,7 @@ public class UserDictAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String create() { try { final UserDictItem userDictItem = createUserDict(); @@ -230,7 +230,7 @@ public class UserDictAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") + //@Execute(validator = true, input = "edit.jsp") public String update() { try { final UserDictItem userDictItem = createUserDict(); @@ -253,7 +253,7 @@ public class UserDictAction { } @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") + //@Execute(validator = false, input = "error.jsp") public String delete() { if (userDictForm.crudMode != CommonConstants.DELETE_MODE) { throw new ActionMessagesException("errors.crud_invalid_mode", @@ -289,7 +289,7 @@ public class UserDictAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String downloadpage() { final UserDictFile userdictFile = userDictService.getUserDictFile(userDictForm.dictId); if (userdictFile == null) { @@ -300,7 +300,7 @@ public class UserDictAction { } @Token(save = true, validate = true) - @Execute(validator = false, input = "downloadpage") + //@Execute(validator = false, input = "downloadpage") public String download() { final UserDictFile userdictFile = userDictService.getUserDictFile(userDictForm.dictId); if (userdictFile == null) { @@ -316,7 +316,7 @@ public class UserDictAction { } @Token(save = true, validate = false) - @Execute(validator = false, input = "uploadpage") + //@Execute(validator = false, input = "uploadpage") public String uploadpage() { final UserDictFile userdictFile = userDictService.getUserDictFile(userDictForm.dictId); if (userdictFile == null) { @@ -327,7 +327,7 @@ public class UserDictAction { } @Token(save = false, validate = true) - @Execute(validator = true, input = "uploadpage") + //@Execute(validator = true, input = "uploadpage") public String upload() { final UserDictFile userdictFile = userDictService.getUserDictFile(userDictForm.dictId); if (userdictFile == null) { diff --git a/src/main/java/org/codelibs/fess/web/admin/dict/UserDictForm.java b/src/main/java/org/codelibs/fess/app/web/admin/dict/UserDictForm.java similarity index 59% rename from src/main/java/org/codelibs/fess/web/admin/dict/UserDictForm.java rename to src/main/java/org/codelibs/fess/app/web/admin/dict/UserDictForm.java index 35009389f..e4a8311d3 100644 --- a/src/main/java/org/codelibs/fess/web/admin/dict/UserDictForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/dict/UserDictForm.java @@ -14,49 +14,49 @@ * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.admin.dict; +package org.codelibs.fess.app.web.admin.dict; import java.util.HashMap; import java.util.Map; public class UserDictForm { - @IntegerType + //@IntegerType public String pageNumber; public Map searchParams = new HashMap(); - @Required + //@Required public String dictId; - @IntegerType + //@IntegerType public int crudMode; public String getCurrentPageNumber() { return pageNumber; } - @Required(target = "confirmfromupdate,update,delete") - @LongType + //@Required(target = "confirmfromupdate,update,delete") + //@LongType public String id; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String token; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String segmentation; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String reading; - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 1000) + //@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + //@Maxbytelength(maxbytelength = 1000) public String pos; - @Required(target = "upload") - public FormFile userDictFile; + //@Required(target = "upload") + //public FormFile userDictFile; public void initialize() { id = null; diff --git a/src/main/java/org/codelibs/sastruts/core/action/AbstractLoginAction.java b/src/main/java/org/codelibs/fess/app/web/base/AbstractLoginAction.java similarity index 90% rename from src/main/java/org/codelibs/sastruts/core/action/AbstractLoginAction.java rename to src/main/java/org/codelibs/fess/app/web/base/AbstractLoginAction.java index 8d2ff175c..e9ec4d979 100644 --- a/src/main/java/org/codelibs/sastruts/core/action/AbstractLoginAction.java +++ b/src/main/java/org/codelibs/fess/app/web/base/AbstractLoginAction.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.action; +package org.codelibs.fess.app.web.base; import java.io.IOException; import java.io.Serializable; @@ -27,15 +27,18 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.codelibs.core.crypto.CachedCipher; -import org.codelibs.sastruts.core.SSCConstants; -import org.codelibs.sastruts.core.entity.UserInfo; -import org.codelibs.sastruts.core.exception.LoginException; -import org.codelibs.sastruts.core.form.AbstractLoginForm; -import org.codelibs.sastruts.core.util.ActivityUtil; +import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.SSCConstants; +import org.codelibs.fess.entity.UserInfo; +import org.codelibs.fess.exception.LoginException; +import org.codelibs.fess.struts.form.AbstractLoginForm; +import org.codelibs.fess.util.ActivityUtil; import org.lastaflute.web.util.LaResponseUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AbstractLoginAction implements Serializable { - private static final Logger logger = Logger.getLogger(AbstractLoginAction.class); + private static final Logger logger = LoggerFactory.getLogger(AbstractLoginAction.class); private static final long serialVersionUID = 1L; @@ -58,7 +61,7 @@ public abstract class AbstractLoginAction implements Serializable { if ("forbidden".equals(form.type)) { // invalid user if (logger.isInfoEnabled()) { - logger.log("ISSC0001", new Object[] { request.getRemoteUser() }); + logger.info("ISSC0001", new Object[] { request.getRemoteUser() }); } if (session != null) { session = invalidateSession(session); diff --git a/src/main/java/org/codelibs/fess/web/base/FessAdminAction.java b/src/main/java/org/codelibs/fess/app/web/base/FessAdminAction.java similarity index 94% rename from src/main/java/org/codelibs/fess/web/base/FessAdminAction.java rename to src/main/java/org/codelibs/fess/app/web/base/FessAdminAction.java index c7315b27f..a0ebc6df3 100644 --- a/src/main/java/org/codelibs/fess/web/base/FessAdminAction.java +++ b/src/main/java/org/codelibs/fess/app/web/base/FessAdminAction.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.base; +package org.codelibs.fess.app.web.base; public abstract class FessAdminAction extends FessBaseAction { diff --git a/src/main/java/org/codelibs/fess/web/base/FessBaseAction.java b/src/main/java/org/codelibs/fess/app/web/base/FessBaseAction.java similarity index 99% rename from src/main/java/org/codelibs/fess/web/base/FessBaseAction.java rename to src/main/java/org/codelibs/fess/app/web/base/FessBaseAction.java index bd0eecbd7..598524eaf 100644 --- a/src/main/java/org/codelibs/fess/web/base/FessBaseAction.java +++ b/src/main/java/org/codelibs/fess/app/web/base/FessBaseAction.java @@ -29,7 +29,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.base; +package org.codelibs.fess.app.web.base; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/src/main/java/org/codelibs/fess/web/base/FessSearchAction.java b/src/main/java/org/codelibs/fess/app/web/base/FessSearchAction.java similarity index 94% rename from src/main/java/org/codelibs/fess/web/base/FessSearchAction.java rename to src/main/java/org/codelibs/fess/app/web/base/FessSearchAction.java index ab3eb7474..5771cc37c 100644 --- a/src/main/java/org/codelibs/fess/web/base/FessSearchAction.java +++ b/src/main/java/org/codelibs/fess/app/web/base/FessSearchAction.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.fess.web.base; +package org.codelibs.fess.app.web.base; public abstract class FessSearchAction extends FessBaseAction { diff --git a/src/main/java/org/codelibs/fess/beans/FessBeans.java b/src/main/java/org/codelibs/fess/beans/FessBeans.java deleted file mode 100644 index 52c4c7f6c..000000000 --- a/src/main/java/org/codelibs/fess/beans/FessBeans.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2009-2015 the CodeLibs Project and the Others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language - * governing permissions and limitations under the License. - */ - -package org.codelibs.fess.beans; - -public class FessBeans { - protected FessBeans() { - // nothing - } - - public static FessCopy copy(final Object src, final Object dest) { - return new FessCopy(src, dest); - } -} diff --git a/src/main/java/org/codelibs/fess/beans/FessCopy.java b/src/main/java/org/codelibs/fess/beans/FessCopy.java deleted file mode 100644 index 81f7ed1e3..000000000 --- a/src/main/java/org/codelibs/fess/beans/FessCopy.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2009-2015 the CodeLibs Project and the Others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language - * governing permissions and limitations under the License. - */ - -package org.codelibs.fess.beans; - -import java.util.ArrayList; -import java.util.List; - -public class FessCopy extends Copy { - - public FessCopy(final Object src, final Object dest) { - super(src, dest); - } - - public Copy excludesCommonColumns() { - return excludesCommonColumns(new CharSequence[0]); - } - - public Copy excludesCommonColumns(final CharSequence... propertyNames) { - final List list = new ArrayList(); - list.add("searchParams"); - list.add("mode"); - list.add("createdBy"); - list.add("createdTime"); - list.add("updatedBy"); - list.add("updatedTime"); - if (propertyNames.length > 0) { - for (final CharSequence propertyName : propertyNames) { - list.add(propertyName); - } - } - return super.excludes(list.toArray(new CharSequence[list.size()])); - } - - public Copy commonColumnDateConverter() { - return this; - } - -} diff --git a/src/main/java/org/codelibs/fess/beans/converter/LocalDateTimeConverter.java b/src/main/java/org/codelibs/fess/beans/converter/LocalDateTimeConverter.java deleted file mode 100644 index f2133e5fb..000000000 --- a/src/main/java/org/codelibs/fess/beans/converter/LocalDateTimeConverter.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2009-2015 the CodeLibs Project and the Others. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language - * governing permissions and limitations under the License. - */ -package org.codelibs.fess.beans.converter; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -import org.lastaflute.di.exception.EmptyRuntimeException; - -public class LocalDateTimeConverter implements Converter { - - protected String pattern; - - public LocalDateTimeConverter(String pattern) { - if (StringUtil.isEmpty(pattern)) { - throw new EmptyRuntimeException("pattern"); - } - this.pattern = pattern; - } - - @Override - public Object getAsObject(String value) { - if (StringUtil.isEmpty(value)) { - return null; - } - return LocalDateTime.parse(value, DateTimeFormatter.ofPattern(pattern)); - } - - @Override - public String getAsString(Object value) { - return ((LocalDateTime) value).format(DateTimeFormatter.ofPattern(pattern)); - } - - @Override - public boolean isTarget(Class clazz) { - return clazz == LocalDateTime.class; - } - -} diff --git a/src/main/java/org/codelibs/fess/crud/CommonConstants.java b/src/main/java/org/codelibs/fess/crud/CommonConstants.java index a38b9531f..7fa971df3 100644 --- a/src/main/java/org/codelibs/fess/crud/CommonConstants.java +++ b/src/main/java/org/codelibs/fess/crud/CommonConstants.java @@ -36,6 +36,9 @@ public class CommonConstants { public static final String[] PAGER_CONVERSION_RULE = { "allRecordCount", "pageSize", "currentPageNumber", "allPageCount", "existPrePage", "existNextPage" }; + public static final String[] COMMON_CONVERSION_RULE = new String[] { "searchParams", "mode", "createdBy", "createdTime", "updatedBy", + "updatedTime" }; + protected CommonConstants() { // nothing } diff --git a/src/main/java/org/codelibs/fess/crud/util/SAStrutsUtil.java b/src/main/java/org/codelibs/fess/crud/util/SAStrutsUtil.java index d41f0743d..ce095715c 100644 --- a/src/main/java/org/codelibs/fess/crud/util/SAStrutsUtil.java +++ b/src/main/java/org/codelibs/fess/crud/util/SAStrutsUtil.java @@ -18,7 +18,7 @@ package org.codelibs.fess.crud.util; import javax.servlet.http.HttpServletRequest; -import org.codelibs.sastruts.core.util.ActionMessagesUtil; +import org.codelibs.fess.util.ActionMessagesUtil; import org.lastaflute.web.ruts.message.ActionMessage; import org.lastaflute.web.ruts.message.ActionMessages; import org.lastaflute.web.util.LaRequestUtil; diff --git a/src/main/java/org/codelibs/fess/entity/FacetInfo.java b/src/main/java/org/codelibs/fess/entity/FacetInfo.java index f1398a88c..237403eda 100644 --- a/src/main/java/org/codelibs/fess/entity/FacetInfo.java +++ b/src/main/java/org/codelibs/fess/entity/FacetInfo.java @@ -19,25 +19,25 @@ package org.codelibs.fess.entity; import java.util.Arrays; public class FacetInfo { - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String[] field; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String[] query; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String prefix; - @IntegerType + //@IntegerType public String limit; - @IntegerType + //@IntegerType public String minCount; - @Maxbytelength(maxbytelength = 255) + //@Maxbytelength(maxbytelength = 255) public String sort; - @Maxbytelength(maxbytelength = 10) + //@Maxbytelength(maxbytelength = 10) public String missing; @Override diff --git a/src/main/java/org/codelibs/fess/entity/GeoInfo.java b/src/main/java/org/codelibs/fess/entity/GeoInfo.java index 5d8d61a1d..3c31154ba 100644 --- a/src/main/java/org/codelibs/fess/entity/GeoInfo.java +++ b/src/main/java/org/codelibs/fess/entity/GeoInfo.java @@ -22,16 +22,16 @@ import org.elasticsearch.index.query.FilterBuilder; import org.elasticsearch.index.query.FilterBuilders; public class GeoInfo { - @Mask(mask = "-?([0-9]+|[0-9]+\\.[0-9]+)") - @Maxbytelength(maxbytelength = 20) + //@Mask(mask = "-?([0-9]+|[0-9]+\\.[0-9]+)") + //@Maxbytelength(maxbytelength = 20) public String latitude; - @Mask(mask = "-?([0-9]+|[0-9]+\\.[0-9]+)") - @Maxbytelength(maxbytelength = 20) + //@Mask(mask = "-?([0-9]+|[0-9]+\\.[0-9]+)") + //@Maxbytelength(maxbytelength = 20) public String longitude; - @Mask(mask = "-?([0-9]+|[0-9]+\\.[0-9]+)") - @Maxbytelength(maxbytelength = 20) + //@Mask(mask = "-?([0-9]+|[0-9]+\\.[0-9]+)") + //@Maxbytelength(maxbytelength = 20) public String distance; private boolean isInit = false; diff --git a/src/main/java/org/codelibs/fess/entity/LoginInfo.java b/src/main/java/org/codelibs/fess/entity/LoginInfo.java index 26dc48078..e7989125e 100644 --- a/src/main/java/org/codelibs/fess/entity/LoginInfo.java +++ b/src/main/java/org/codelibs/fess/entity/LoginInfo.java @@ -17,7 +17,6 @@ package org.codelibs.fess.entity; import org.codelibs.fess.util.ComponentUtil; -import org.codelibs.sastruts.core.entity.UserInfo; public class LoginInfo extends UserInfo { diff --git a/src/main/java/org/codelibs/sastruts/core/entity/UserInfo.java b/src/main/java/org/codelibs/fess/entity/UserInfo.java similarity index 97% rename from src/main/java/org/codelibs/sastruts/core/entity/UserInfo.java rename to src/main/java/org/codelibs/fess/entity/UserInfo.java index 52aadc49e..bb1026941 100644 --- a/src/main/java/org/codelibs/sastruts/core/entity/UserInfo.java +++ b/src/main/java/org/codelibs/fess/entity/UserInfo.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.entity; +package org.codelibs.fess.entity; import java.io.Serializable; import java.util.Set; diff --git a/src/main/java/org/codelibs/sastruts/core/exception/LoginException.java b/src/main/java/org/codelibs/fess/exception/LoginException.java similarity index 96% rename from src/main/java/org/codelibs/sastruts/core/exception/LoginException.java rename to src/main/java/org/codelibs/fess/exception/LoginException.java index f7bb08051..44662b6cd 100644 --- a/src/main/java/org/codelibs/sastruts/core/exception/LoginException.java +++ b/src/main/java/org/codelibs/fess/exception/LoginException.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.exception; +package org.codelibs.fess.exception; /** * @author shinsuke diff --git a/src/main/java/org/codelibs/sastruts/core/exception/SSCActionMessagesException.java b/src/main/java/org/codelibs/fess/exception/SSCActionMessagesException.java similarity index 96% rename from src/main/java/org/codelibs/sastruts/core/exception/SSCActionMessagesException.java rename to src/main/java/org/codelibs/fess/exception/SSCActionMessagesException.java index 8c1ed9d57..8d2e481ba 100644 --- a/src/main/java/org/codelibs/sastruts/core/exception/SSCActionMessagesException.java +++ b/src/main/java/org/codelibs/fess/exception/SSCActionMessagesException.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.exception; +package org.codelibs.fess.exception; /** * SSCActionMessagesException allows you to pass a root cause. diff --git a/src/main/java/org/codelibs/sastruts/core/exception/SSCRuntimeException.java b/src/main/java/org/codelibs/fess/exception/SSCRuntimeException.java similarity index 96% rename from src/main/java/org/codelibs/sastruts/core/exception/SSCRuntimeException.java rename to src/main/java/org/codelibs/fess/exception/SSCRuntimeException.java index 4e25dd106..ec8e860e4 100644 --- a/src/main/java/org/codelibs/sastruts/core/exception/SSCRuntimeException.java +++ b/src/main/java/org/codelibs/fess/exception/SSCRuntimeException.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.exception; +package org.codelibs.fess.exception; import org.codelibs.core.exception.ClRuntimeException; diff --git a/src/main/java/org/codelibs/fess/exec/Crawler.java b/src/main/java/org/codelibs/fess/exec/Crawler.java index 97c4559fe..271db48ea 100644 --- a/src/main/java/org/codelibs/fess/exec/Crawler.java +++ b/src/main/java/org/codelibs/fess/exec/Crawler.java @@ -29,9 +29,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Resource; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.codelibs.core.CoreLibConstants; import org.codelibs.core.lang.StringUtil; @@ -40,7 +37,6 @@ import org.codelibs.fess.Constants; import org.codelibs.fess.client.FessEsClient; import org.codelibs.fess.helper.CrawlingSessionHelper; import org.codelibs.fess.helper.DataIndexHelper; -import org.codelibs.fess.helper.DatabaseHelper; import org.codelibs.fess.helper.FieldHelper; import org.codelibs.fess.helper.MailHelper; import org.codelibs.fess.helper.OverlappingHostHelper; @@ -56,6 +52,7 @@ import org.elasticsearch.index.query.QueryBuilders; import org.kohsuke.args4j.CmdLineException; import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Option; +import org.lastaflute.di.core.LaContainer; import org.lastaflute.di.core.SingletonLaContainer; import org.lastaflute.di.core.factory.SingletonLaContainerFactory; import org.slf4j.Logger; @@ -66,8 +63,6 @@ import com.github.jknack.handlebars.Handlebars; import com.github.jknack.handlebars.Template; import com.github.jknack.handlebars.io.FileTemplateLoader; -import net.arnx.jsonic.web.extension.S2Container; - public class Crawler implements Serializable { private static final long serialVersionUID = 1L; @@ -183,24 +178,16 @@ public class Crawler implements Serializable { int exitCode; try { - final ServletContext servletContext = new MockServletContextImpl("/fess"); - final HttpServletRequest request = new MockHttpServletRequestImpl(servletContext, "/crawler"); - final HttpServletResponse response = new MockHttpServletResponseImpl(request); - final SingletonLaContainerInitializer initializer = new SingletonLaContainerInitializer(); - initializer.setConfigPath("app.dicon"); - initializer.setApplication(servletContext); - initializer.initialize(); + SingletonLaContainerFactory.setConfigPath("app.xml"); + SingletonLaContainerFactory.init(); - final S2Container container = SingletonLaContainerFactory.getContainer(); - final ExternalContext externalContext = container.getExternalContext(); - externalContext.setRequest(request); - externalContext.setResponse(response); + final LaContainer container = SingletonLaContainerFactory.getContainer(); final Thread shutdownCallback = new Thread("ShutdownHook") { @Override public void run() { if (logger.isDebugEnabled()) { - logger.debug("Destroying S2Container.."); + logger.debug("Destroying LaContainer.."); } SingletonLaContainerFactory.destroy(); } @@ -223,9 +210,6 @@ public class Crawler implements Serializable { private static int process(final Options options) { final Crawler crawler = SingletonLaContainer.getComponent(Crawler.class); - final DatabaseHelper databaseHelper = ComponentUtil.getDatabaseHelper(); - databaseHelper.optimize(); - if (StringUtil.isBlank(options.sessionId)) { // use a default session id final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); @@ -275,7 +259,6 @@ public class Crawler implements Serializable { } catch (final Exception e) { logger.warn("Failed to store crawling information.", e); } - databaseHelper.optimize(); final Map infoMap = crawlingSessionHelper.getInfoMap(options.sessionId); diff --git a/src/main/java/org/codelibs/fess/filter/AdLoginInfoFilter.java b/src/main/java/org/codelibs/fess/filter/AdLoginInfoFilter.java index 2dd63b9ab..233350507 100644 --- a/src/main/java/org/codelibs/fess/filter/AdLoginInfoFilter.java +++ b/src/main/java/org/codelibs/fess/filter/AdLoginInfoFilter.java @@ -32,10 +32,10 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.SSCConstants; import org.codelibs.fess.entity.LoginInfo; import org.codelibs.fess.helper.AdRoleHelper; import org.codelibs.fess.util.ComponentUtil; -import org.codelibs.sastruts.core.SSCConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/codelibs/fess/filter/AdminAuthFilter.java b/src/main/java/org/codelibs/fess/filter/AdminAuthFilter.java index 5eab12902..f330a04e9 100644 --- a/src/main/java/org/codelibs/fess/filter/AdminAuthFilter.java +++ b/src/main/java/org/codelibs/fess/filter/AdminAuthFilter.java @@ -19,10 +19,9 @@ package org.codelibs.fess.filter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.codelibs.fess.SSCConstants; import org.codelibs.fess.entity.LoginInfo; -import org.codelibs.sastruts.core.SSCConstants; -import org.codelibs.sastruts.core.entity.UserInfo; -import org.codelibs.sastruts.core.filter.AuthFilter; +import org.codelibs.fess.entity.UserInfo; public class AdminAuthFilter extends AuthFilter { @Override diff --git a/src/main/java/org/codelibs/sastruts/core/filter/AuthFilter.java b/src/main/java/org/codelibs/fess/filter/AuthFilter.java similarity index 96% rename from src/main/java/org/codelibs/sastruts/core/filter/AuthFilter.java rename to src/main/java/org/codelibs/fess/filter/AuthFilter.java index 83d30c9de..7f057a893 100644 --- a/src/main/java/org/codelibs/sastruts/core/filter/AuthFilter.java +++ b/src/main/java/org/codelibs/fess/filter/AuthFilter.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.filter; +package org.codelibs.fess.filter; import java.io.IOException; import java.net.URLEncoder; @@ -34,9 +34,10 @@ import javax.servlet.http.HttpServletResponse; import org.codelibs.core.CoreLibConstants; import org.codelibs.core.crypto.CachedCipher; -import org.codelibs.sastruts.core.SSCConstants; -import org.codelibs.sastruts.core.entity.UserInfo; -import org.codelibs.sastruts.core.util.ActivityUtil; +import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.SSCConstants; +import org.codelibs.fess.entity.UserInfo; +import org.codelibs.fess.util.ActivityUtil; import org.lastaflute.di.core.SingletonLaContainer; /** diff --git a/src/main/java/org/codelibs/fess/filter/LoginInfoFilter.java b/src/main/java/org/codelibs/fess/filter/LoginInfoFilter.java index 972b874ec..4a26f9803 100644 --- a/src/main/java/org/codelibs/fess/filter/LoginInfoFilter.java +++ b/src/main/java/org/codelibs/fess/filter/LoginInfoFilter.java @@ -29,10 +29,10 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.codelibs.fess.SSCConstants; import org.codelibs.fess.entity.LoginInfo; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; -import org.codelibs.sastruts.core.SSCConstants; // TODO refactoring... public class LoginInfoFilter implements Filter { diff --git a/src/main/java/org/codelibs/fess/helper/impl/RoleQueryHelperImpl.java b/src/main/java/org/codelibs/fess/helper/impl/RoleQueryHelperImpl.java index 8a32398a6..ce5adcd56 100644 --- a/src/main/java/org/codelibs/fess/helper/impl/RoleQueryHelperImpl.java +++ b/src/main/java/org/codelibs/fess/helper/impl/RoleQueryHelperImpl.java @@ -30,10 +30,10 @@ import javax.servlet.http.HttpSession; import org.codelibs.core.crypto.CachedCipher; import org.codelibs.core.lang.StringUtil; +import org.codelibs.fess.SSCConstants; import org.codelibs.fess.entity.LoginInfo; import org.codelibs.fess.helper.RoleQueryHelper; import org.codelibs.fess.helper.SystemHelper; -import org.codelibs.sastruts.core.SSCConstants; import org.lastaflute.web.util.LaRequestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/codelibs/fess/helper/impl/SearchLogHelperImpl.java b/src/main/java/org/codelibs/fess/helper/impl/SearchLogHelperImpl.java index 2a65b3f1c..3e94931dd 100644 --- a/src/main/java/org/codelibs/fess/helper/impl/SearchLogHelperImpl.java +++ b/src/main/java/org/codelibs/fess/helper/impl/SearchLogHelperImpl.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Queue; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.beans.FessBeans; @@ -137,7 +138,7 @@ public class SearchLogHelperImpl extends SearchLogHelper { for (final UserInfo userInfo : list) { final String code = userInfo.getCode(); final UserInfo entity = userInfoMap.get(code); - FessBeans.copy(userInfo, entity).includes("id", "createdTime").execute(); + BeanUtil.copyBeanToBean(userInfo, entity, option -> option.include("id", "createdTime")); updateList.add(entity); insertList.remove(entity); } diff --git a/src/main/java/org/codelibs/sastruts/core/interceptor/TokenInterceptor.java b/src/main/java/org/codelibs/fess/interceptor/TokenInterceptor.java similarity index 95% rename from src/main/java/org/codelibs/sastruts/core/interceptor/TokenInterceptor.java rename to src/main/java/org/codelibs/fess/interceptor/TokenInterceptor.java index d40f820ce..e0e7da35b 100644 --- a/src/main/java/org/codelibs/sastruts/core/interceptor/TokenInterceptor.java +++ b/src/main/java/org/codelibs/fess/interceptor/TokenInterceptor.java @@ -13,11 +13,11 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.interceptor; +package org.codelibs.fess.interceptor; import javax.servlet.http.HttpServletRequest; -import org.codelibs.sastruts.core.annotation.Token; +import org.codelibs.fess.annotation.Token; import org.lastaflute.di.core.aop.frame.MethodInvocation; import org.lastaflute.di.core.aop.interceptors.AbstractInterceptor; import org.lastaflute.web.util.LaRequestUtil; diff --git a/src/main/java/org/codelibs/sastruts/core/interceptor/UserInfoInterceptor.java b/src/main/java/org/codelibs/fess/interceptor/UserInfoInterceptor.java similarity index 94% rename from src/main/java/org/codelibs/sastruts/core/interceptor/UserInfoInterceptor.java rename to src/main/java/org/codelibs/fess/interceptor/UserInfoInterceptor.java index 13cc6ba0e..f9d670e36 100644 --- a/src/main/java/org/codelibs/sastruts/core/interceptor/UserInfoInterceptor.java +++ b/src/main/java/org/codelibs/fess/interceptor/UserInfoInterceptor.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.interceptor; +package org.codelibs.fess.interceptor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -22,8 +22,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.codelibs.core.lang.FieldUtil; -import org.codelibs.sastruts.core.SSCConstants; -import org.codelibs.sastruts.core.annotation.User; +import org.codelibs.fess.SSCConstants; +import org.codelibs.fess.annotation.User; import org.lastaflute.di.core.aop.frame.MethodInvocation; import org.lastaflute.di.core.aop.interceptors.AbstractInterceptor; import org.lastaflute.web.util.LaRequestUtil; diff --git a/src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java b/src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java index 078b47e01..2e5b7f37e 100644 --- a/src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java +++ b/src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java @@ -2490,7 +2490,8 @@ public class FessLabels extends ActionMessages { public static final String LABELS_system_info_bug_report_title = "{labels.system_info_bug_report_title}"; /** The key of the message: crawler.properties does not exist. Default values are applied. */ - public static final String LABELS_system_info_crawler_properties_does_not_exist = "{labels.system_info_crawler_properties_does_not_exist}"; + public static final String LABELS_system_info_crawler_properties_does_not_exist = + "{labels.system_info_crawler_properties_does_not_exist}"; /** The key of the message: File Authentication */ public static final String LABELS_file_authentication_configuration = "{labels.file_authentication_configuration}"; @@ -2529,7 +2530,8 @@ public class FessLabels extends ActionMessages { public static final String LABELS_file_authentication_list_hostname = "{labels.file_authentication_list_hostname}"; /** The key of the message: Config Name */ - public static final String LABELS_file_authentication_list_file_crawling_config = "{labels.file_authentication_list_file_crawling_config}"; + public static final String LABELS_file_authentication_list_file_crawling_config = + "{labels.file_authentication_list_file_crawling_config}"; /** The key of the message: Any */ public static final String LABELS_file_authentication_any = "{labels.file_authentication_any}"; diff --git a/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java b/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java index 743908a59..c0b19ccc7 100644 --- a/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java +++ b/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java @@ -1,6 +1,5 @@ package org.codelibs.fess.mylasta.action; -import org.codelibs.fess.mylasta.action.FessLabels; import org.lastaflute.web.ruts.message.ActionMessage; /** @@ -124,7 +123,8 @@ public class FessMessages extends FessLabels { public static final String ERRORS_failed_to_delete_solr_index = "{errors.failed_to_delete_solr_index}"; /** The key of the message: Failed to start a process because of running solr process. */ - public static final String ERRORS_failed_to_start_solr_process_because_of_running = "{errors.failed_to_start_solr_process_because_of_running}"; + public static final String ERRORS_failed_to_start_solr_process_because_of_running = + "{errors.failed_to_start_solr_process_because_of_running}"; /** The key of the message: Failed to restore data. */ public static final String ERRORS_failed_to_import_data = "{errors.failed_to_import_data}"; diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java index bed6ac8f2..fe4526280 100644 --- a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java +++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java @@ -1,6 +1,5 @@ package org.codelibs.fess.mylasta.direction; -import org.codelibs.fess.mylasta.direction.FessEnv; import org.lastaflute.core.direction.exception.ConfigPropertyNotFoundException; /** diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessEnv.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessEnv.java index 495776f55..d9ec10759 100644 --- a/src/main/java/org/codelibs/fess/mylasta/direction/FessEnv.java +++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessEnv.java @@ -102,7 +102,7 @@ public interface FessEnv { /** * Get the value for the key 'time.adjust.time.millis'.
* The value is, e.g. 0
- * comment: The milliseconds for (relative or absolute) adjust time (set only when test) @LongType *dynamic in development + * comment: The milliseconds for (relative or absolute) adjust time (set only when test) //@LongType *dynamic in development * @return The value of found property. (NotNull: if not found, exception but basically no way) */ String getTimeAdjustTimeMillis(); @@ -110,7 +110,7 @@ public interface FessEnv { /** * Get the value for the key 'time.adjust.time.millis' as {@link Long}.
* The value is, e.g. 0
- * comment: The milliseconds for (relative or absolute) adjust time (set only when test) @LongType *dynamic in development + * comment: The milliseconds for (relative or absolute) adjust time (set only when test) //@LongType *dynamic in development * @return The value of found property. (NotNull: if not found, exception but basically no way) * @throws NumberFormatException When the property is not long. */ diff --git a/src/main/java/org/codelibs/fess/pager/FailureUrlPager.java b/src/main/java/org/codelibs/fess/pager/FailureUrlPager.java index 46b423f44..31e0923c9 100644 --- a/src/main/java/org/codelibs/fess/pager/FailureUrlPager.java +++ b/src/main/java/org/codelibs/fess/pager/FailureUrlPager.java @@ -22,16 +22,16 @@ import org.codelibs.fess.Constants; public class FailureUrlPager { - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String url; - @IntRange(min = 0, max = 2147483647) + //@IntRange(min = 0, max = 2147483647) public String errorCountMin; - @IntRange(min = 0, max = 2147483647) + //@IntRange(min = 0, max = 2147483647) public String errorCountMax; - @Maxbytelength(maxbytelength = 1000) + //@Maxbytelength(maxbytelength = 1000) public String errorName; public static final int DEFAULT_PAGE_SIZE = 20; diff --git a/src/main/java/org/codelibs/fess/service/BoostDocumentRuleService.java b/src/main/java/org/codelibs/fess/service/BoostDocumentRuleService.java index 746974312..52e4bd952 100644 --- a/src/main/java/org/codelibs/fess/service/BoostDocumentRuleService.java +++ b/src/main/java/org/codelibs/fess/service/BoostDocumentRuleService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.BoostDocumentRuleCB; @@ -50,7 +51,8 @@ public class BoostDocumentRuleService implements Serializable { }); // update pager - Beans.copy(boostDocumentRuleList, boostDocumentRulePager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(boostDocumentRuleList, boostDocumentRulePager, + option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); boostDocumentRulePager.setPageNumberList(boostDocumentRuleList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/CrawlingSessionService.java b/src/main/java/org/codelibs/fess/service/CrawlingSessionService.java index 6b6367876..6d504bf7f 100644 --- a/src/main/java/org/codelibs/fess/service/CrawlingSessionService.java +++ b/src/main/java/org/codelibs/fess/service/CrawlingSessionService.java @@ -37,6 +37,7 @@ import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codelibs.core.CoreLibConstants; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.FessSystemException; import org.codelibs.fess.crud.CommonConstants; @@ -80,7 +81,7 @@ public class CrawlingSessionService implements Serializable { }); // update pager - Beans.copy(crawlingSessionList, crawlingSessionPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(crawlingSessionList, crawlingSessionPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); crawlingSessionPager.setPageNumberList(crawlingSessionList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/DataConfigService.java b/src/main/java/org/codelibs/fess/service/DataConfigService.java index edf6f9e84..56e26409d 100644 --- a/src/main/java/org/codelibs/fess/service/DataConfigService.java +++ b/src/main/java/org/codelibs/fess/service/DataConfigService.java @@ -24,6 +24,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -63,7 +64,7 @@ public class DataConfigService implements Serializable { }); // update pager - Beans.copy(dataConfigList, dataConfigPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(dataConfigList, dataConfigPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); dataConfigPager.setPageNumberList(dataConfigList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/FailureUrlService.java b/src/main/java/org/codelibs/fess/service/FailureUrlService.java index 676ad8399..d4ea6f52e 100644 --- a/src/main/java/org/codelibs/fess/service/FailureUrlService.java +++ b/src/main/java/org/codelibs/fess/service/FailureUrlService.java @@ -27,6 +27,8 @@ import java.util.regex.Pattern; import javax.annotation.Resource; +import org.apache.commons.lang3.StringUtils; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.core.misc.DynamicProperties; import org.codelibs.fess.Constants; @@ -65,7 +67,7 @@ public class FailureUrlService implements Serializable { }); // update pager - Beans.copy(failureUrlList, failureUrlPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(failureUrlList, failureUrlPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); failureUrlPager.setPageNumberList(failureUrlList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/FileAuthenticationService.java b/src/main/java/org/codelibs/fess/service/FileAuthenticationService.java index 9f016cd9d..704ccd9e8 100644 --- a/src/main/java/org/codelibs/fess/service/FileAuthenticationService.java +++ b/src/main/java/org/codelibs/fess/service/FileAuthenticationService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.FileAuthenticationCB; @@ -50,7 +51,8 @@ public class FileAuthenticationService implements Serializable { }); // update pager - Beans.copy(fileAuthenticationList, fileAuthenticationPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(fileAuthenticationList, fileAuthenticationPager, + option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); fileAuthenticationPager.setPageNumberList(fileAuthenticationList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/FileConfigService.java b/src/main/java/org/codelibs/fess/service/FileConfigService.java index e45ab191e..349083e91 100644 --- a/src/main/java/org/codelibs/fess/service/FileConfigService.java +++ b/src/main/java/org/codelibs/fess/service/FileConfigService.java @@ -24,6 +24,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -62,7 +63,7 @@ public class FileConfigService implements Serializable { }); // update pager - Beans.copy(fileConfigList, fileConfigPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(fileConfigList, fileConfigPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); fileConfigPager.setPageNumberList(fileConfigList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/JobLogService.java b/src/main/java/org/codelibs/fess/service/JobLogService.java index 6413ccead..726f2868a 100644 --- a/src/main/java/org/codelibs/fess/service/JobLogService.java +++ b/src/main/java/org/codelibs/fess/service/JobLogService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.JobLogCB; @@ -51,7 +52,7 @@ public class JobLogService implements Serializable { }); // update pager - Beans.copy(jobLogList, jobLogPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(jobLogList, jobLogPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); jobLogPager.setPageNumberList(jobLogList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/KeyMatchService.java b/src/main/java/org/codelibs/fess/service/KeyMatchService.java index 966fed827..ced75db43 100644 --- a/src/main/java/org/codelibs/fess/service/KeyMatchService.java +++ b/src/main/java/org/codelibs/fess/service/KeyMatchService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.KeyMatchCB; @@ -50,7 +51,7 @@ public class KeyMatchService implements Serializable { }); // update pager - Beans.copy(keyMatchList, keyMatchPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(keyMatchList, keyMatchPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); keyMatchPager.setPageNumberList(keyMatchList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/LabelTypeService.java b/src/main/java/org/codelibs/fess/service/LabelTypeService.java index 9970eb1ea..2d6ac594f 100644 --- a/src/main/java/org/codelibs/fess/service/LabelTypeService.java +++ b/src/main/java/org/codelibs/fess/service/LabelTypeService.java @@ -24,6 +24,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.LabelTypeCB; @@ -59,7 +60,7 @@ public class LabelTypeService implements Serializable { }); // update pager - Beans.copy(labelTypeList, labelTypePager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(labelTypeList, labelTypePager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); labelTypePager.setPageNumberList(labelTypeList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/OverlappingHostService.java b/src/main/java/org/codelibs/fess/service/OverlappingHostService.java index f16c9c358..75c540d05 100644 --- a/src/main/java/org/codelibs/fess/service/OverlappingHostService.java +++ b/src/main/java/org/codelibs/fess/service/OverlappingHostService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.OverlappingHostCB; @@ -50,7 +51,7 @@ public class OverlappingHostService implements Serializable { }); // update pager - Beans.copy(overlappingHostList, overlappingHostPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(overlappingHostList, overlappingHostPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); overlappingHostPager.setPageNumberList(overlappingHostList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/PathMappingService.java b/src/main/java/org/codelibs/fess/service/PathMappingService.java index 962bc70ae..0c04e150f 100644 --- a/src/main/java/org/codelibs/fess/service/PathMappingService.java +++ b/src/main/java/org/codelibs/fess/service/PathMappingService.java @@ -24,6 +24,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.PathMappingCB; @@ -47,7 +48,7 @@ public class PathMappingService implements Serializable { }); // update pager - Beans.copy(pathMappingList, pathMappingPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(pathMappingList, pathMappingPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); pathMappingPager.setPageNumberList(pathMappingList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/RequestHeaderService.java b/src/main/java/org/codelibs/fess/service/RequestHeaderService.java index 763ff32a6..66b06f276 100644 --- a/src/main/java/org/codelibs/fess/service/RequestHeaderService.java +++ b/src/main/java/org/codelibs/fess/service/RequestHeaderService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.RequestHeaderCB; @@ -50,7 +51,7 @@ public class RequestHeaderService implements Serializable { }); // update pager - Beans.copy(requestHeaderList, requestHeaderPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(requestHeaderList, requestHeaderPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); requestHeaderPager.setPageNumberList(requestHeaderList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/RoleTypeService.java b/src/main/java/org/codelibs/fess/service/RoleTypeService.java index f8a3d1421..7bd5a3f93 100644 --- a/src/main/java/org/codelibs/fess/service/RoleTypeService.java +++ b/src/main/java/org/codelibs/fess/service/RoleTypeService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.RoleTypeCB; @@ -50,7 +51,7 @@ public class RoleTypeService implements Serializable { }); // update pager - Beans.copy(roleTypeList, roleTypePager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(roleTypeList, roleTypePager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); roleTypePager.setPageNumberList(roleTypeList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/ScheduledJobService.java b/src/main/java/org/codelibs/fess/service/ScheduledJobService.java index d2d851e2a..7aaf9fe47 100644 --- a/src/main/java/org/codelibs/fess/service/ScheduledJobService.java +++ b/src/main/java/org/codelibs/fess/service/ScheduledJobService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -52,7 +53,7 @@ public class ScheduledJobService implements Serializable { }); // update pager - Beans.copy(scheduledJobList, scheduledJobPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(scheduledJobList, scheduledJobPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); scheduledJobPager.setPageNumberList(scheduledJobList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/SuggestBadWordService.java b/src/main/java/org/codelibs/fess/service/SuggestBadWordService.java index 257061895..2e802c2cf 100644 --- a/src/main/java/org/codelibs/fess/service/SuggestBadWordService.java +++ b/src/main/java/org/codelibs/fess/service/SuggestBadWordService.java @@ -29,6 +29,7 @@ import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -67,7 +68,7 @@ public class SuggestBadWordService implements Serializable { }); // update pager - Beans.copy(suggestBadWordList, suggestBadWordPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(suggestBadWordList, suggestBadWordPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); suggestBadWordPager.setPageNumberList(suggestBadWordList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/SuggestElevateWordService.java b/src/main/java/org/codelibs/fess/service/SuggestElevateWordService.java index bcceec8d2..94e4dd4a0 100644 --- a/src/main/java/org/codelibs/fess/service/SuggestElevateWordService.java +++ b/src/main/java/org/codelibs/fess/service/SuggestElevateWordService.java @@ -29,6 +29,7 @@ import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -65,7 +66,8 @@ public class SuggestElevateWordService implements Serializable { }); // update pager - Beans.copy(suggestElevateWordList, suggestElevateWordPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(suggestElevateWordList, suggestElevateWordPager, + option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); suggestElevateWordPager.setPageNumberList(suggestElevateWordList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/SynonymService.java b/src/main/java/org/codelibs/fess/service/SynonymService.java index 3f84997f3..6978c096d 100644 --- a/src/main/java/org/codelibs/fess/service/SynonymService.java +++ b/src/main/java/org/codelibs/fess/service/SynonymService.java @@ -22,6 +22,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.dict.DictionaryExpiredException; @@ -43,7 +44,7 @@ public class SynonymService { final PagingList synonymList = synonymFile.selectList((synonymPager.getCurrentPageNumber() - 1) * pageSize, pageSize); // update pager - Beans.copy(synonymList, synonymPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(synonymList, synonymPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); synonymList.setPageRangeSize(5); synonymPager.setPageNumberList(synonymList.createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/UserDictService.java b/src/main/java/org/codelibs/fess/service/UserDictService.java index 2cc1dbf95..630d32d0d 100644 --- a/src/main/java/org/codelibs/fess/service/UserDictService.java +++ b/src/main/java/org/codelibs/fess/service/UserDictService.java @@ -22,6 +22,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.dict.DictionaryExpiredException; @@ -44,7 +45,7 @@ public class UserDictService { userDictFile.selectList((userDictPager.getCurrentPageNumber() - 1) * pageSize, pageSize); // update pager - Beans.copy(userDictList, userDictPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(userDictList, userDictPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); userDictList.setPageRangeSize(5); userDictPager.setPageNumberList(userDictList.createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/WebAuthenticationService.java b/src/main/java/org/codelibs/fess/service/WebAuthenticationService.java index fa2622d0b..b1b9c0f78 100644 --- a/src/main/java/org/codelibs/fess/service/WebAuthenticationService.java +++ b/src/main/java/org/codelibs/fess/service/WebAuthenticationService.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; import org.codelibs.fess.es.cbean.WebAuthenticationCB; @@ -50,7 +51,8 @@ public class WebAuthenticationService implements Serializable { }); // update pager - Beans.copy(webAuthenticationList, webAuthenticationPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(webAuthenticationList, webAuthenticationPager, + option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); webAuthenticationPager.setPageNumberList(webAuthenticationList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/fess/service/WebConfigService.java b/src/main/java/org/codelibs/fess/service/WebConfigService.java index dd2d1cde4..8527d39a0 100644 --- a/src/main/java/org/codelibs/fess/service/WebConfigService.java +++ b/src/main/java/org/codelibs/fess/service/WebConfigService.java @@ -24,6 +24,7 @@ import java.util.Map; import javax.annotation.Resource; +import org.codelibs.core.beans.util.BeanUtil; import org.codelibs.fess.Constants; import org.codelibs.fess.crud.CommonConstants; import org.codelibs.fess.crud.CrudMessageException; @@ -62,7 +63,7 @@ public class WebConfigService implements Serializable { }); // update pager - Beans.copy(webConfigList, webConfigPager).includes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + BeanUtil.copyBeanToBean(webConfigList, webConfigPager, option -> option.include(CommonConstants.PAGER_CONVERSION_RULE)); webConfigPager.setPageNumberList(webConfigList.pageRange(op -> { op.rangeSize(5); }).createPageNumberList()); diff --git a/src/main/java/org/codelibs/sastruts/core/struts/action/SSCRequestProcessor.java b/src/main/java/org/codelibs/fess/struts/action/SSCRequestProcessor.java similarity index 98% rename from src/main/java/org/codelibs/sastruts/core/struts/action/SSCRequestProcessor.java rename to src/main/java/org/codelibs/fess/struts/action/SSCRequestProcessor.java index 3b2ae4800..1fecba7c3 100644 --- a/src/main/java/org/codelibs/sastruts/core/struts/action/SSCRequestProcessor.java +++ b/src/main/java/org/codelibs/fess/struts/action/SSCRequestProcessor.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.struts.action; +package org.codelibs.fess.struts.action; import javax.servlet.ServletException; diff --git a/src/main/java/org/codelibs/sastruts/core/form/AbstractLoginForm.java b/src/main/java/org/codelibs/fess/struts/form/AbstractLoginForm.java similarity index 95% rename from src/main/java/org/codelibs/sastruts/core/form/AbstractLoginForm.java rename to src/main/java/org/codelibs/fess/struts/form/AbstractLoginForm.java index b029d2857..ee58a7d5c 100644 --- a/src/main/java/org/codelibs/sastruts/core/form/AbstractLoginForm.java +++ b/src/main/java/org/codelibs/fess/struts/form/AbstractLoginForm.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.form; +package org.codelibs.fess.struts.form; import java.io.Serializable; diff --git a/src/main/java/org/codelibs/sastruts/core/servlet/SSCActionServlet.java b/src/main/java/org/codelibs/fess/struts/servlet/SSCActionServlet.java similarity index 94% rename from src/main/java/org/codelibs/sastruts/core/servlet/SSCActionServlet.java rename to src/main/java/org/codelibs/fess/struts/servlet/SSCActionServlet.java index 0a64eeaca..ddfc8e6eb 100644 --- a/src/main/java/org/codelibs/sastruts/core/servlet/SSCActionServlet.java +++ b/src/main/java/org/codelibs/fess/struts/servlet/SSCActionServlet.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.servlet; +package org.codelibs.fess.struts.servlet; import java.io.IOException; @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse; * @author shinsuke * */ +// TODO Lastafluteでは不要 public class SSCActionServlet extends ActionServlet { private static final long serialVersionUID = 1L; diff --git a/src/main/java/org/codelibs/sastruts/core/upload/SSCMultipartRequestHandler.java b/src/main/java/org/codelibs/fess/struts/upload/SSCMultipartRequestHandler.java similarity index 98% rename from src/main/java/org/codelibs/sastruts/core/upload/SSCMultipartRequestHandler.java rename to src/main/java/org/codelibs/fess/struts/upload/SSCMultipartRequestHandler.java index 24928f72f..a38d4b4ed 100644 --- a/src/main/java/org/codelibs/sastruts/core/upload/SSCMultipartRequestHandler.java +++ b/src/main/java/org/codelibs/fess/struts/upload/SSCMultipartRequestHandler.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.upload; +package org.codelibs.fess.struts.upload; import java.io.File; import java.io.InputStream; diff --git a/src/main/java/org/codelibs/fess/taglib/FessFunctions.java b/src/main/java/org/codelibs/fess/taglib/FessFunctions.java index 948be9853..32c66d4b6 100644 --- a/src/main/java/org/codelibs/fess/taglib/FessFunctions.java +++ b/src/main/java/org/codelibs/fess/taglib/FessFunctions.java @@ -214,9 +214,9 @@ public class FessFunctions { if (values != null) { for (final String value : values) { buf.append(""); } } diff --git a/src/main/java/org/codelibs/sastruts/core/util/ActionMessagesUtil.java b/src/main/java/org/codelibs/fess/util/ActionMessagesUtil.java similarity index 99% rename from src/main/java/org/codelibs/sastruts/core/util/ActionMessagesUtil.java rename to src/main/java/org/codelibs/fess/util/ActionMessagesUtil.java index 20e491d90..30ed76bd9 100644 --- a/src/main/java/org/codelibs/sastruts/core/util/ActionMessagesUtil.java +++ b/src/main/java/org/codelibs/fess/util/ActionMessagesUtil.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.util; +package org.codelibs.fess.util; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; diff --git a/src/main/java/org/codelibs/sastruts/core/util/ActivityUtil.java b/src/main/java/org/codelibs/fess/util/ActivityUtil.java similarity index 97% rename from src/main/java/org/codelibs/sastruts/core/util/ActivityUtil.java rename to src/main/java/org/codelibs/fess/util/ActivityUtil.java index 36cc988e9..39b3d112a 100644 --- a/src/main/java/org/codelibs/sastruts/core/util/ActivityUtil.java +++ b/src/main/java/org/codelibs/fess/util/ActivityUtil.java @@ -13,7 +13,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.codelibs.sastruts.core.util; +package org.codelibs.fess.util; import javax.servlet.http.HttpServletRequest; diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 08a4a2c17..49e80f4c7 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -234,7 +234,7 @@ action - org.codelibs.sastruts.core.servlet.SSCActionServlet + org.codelibs.fess.struts.servlet.SSCActionServlet config /WEB-INF/struts-config.xml