modify package structure

This commit is contained in:
Shinsuke Sugaya 2015-07-25 17:56:42 +09:00
parent ec1cfa07b7
commit 82c6347bc4
133 changed files with 1349 additions and 1528 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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<String, Object> 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<String, Object> 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;
}

View file

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

View file

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

View file

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

View file

@ -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<String, Object> 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<String, Object> 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;
}

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

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

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String>();
final List<File> 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<File> fileList = getAccessibleFileList(baseDir);
boolean exist = false;
for (final File file : fileList) {

View file

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

View file

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

View file

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

View file

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

View file

@ -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<Map<String, String>> serverStatusList = new ArrayList<Map<String, String>>();
@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;
}

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String> jobStatusList = new ArrayList<String>();
jobStatusList.add(Constants.OK);

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

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

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

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

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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;

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

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

View file

@ -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<Map<String, String>>();
propItems = new ArrayList<Map<String, String>>();

View file

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

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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() {

View file

@ -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<ScheduledJob> scheduledJobList = scheduledJobService.getCrawloerJobList();

View file

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

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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;

View file

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

View file

@ -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<String, String> searchParams = new HashMap<String, String>();
@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;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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<CharSequence> list = new ArrayList<CharSequence>();
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;
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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<String, String> infoMap = crawlingSessionHelper.getInfoMap(options.sessionId);

View file

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

View file

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

View file

@ -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;
/**

View file

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

View file

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

View file

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

View file

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

View file

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

Some files were not shown because too many files have changed in this diff Show more