diff --git a/README.md b/README.md index 2534136d8..5412a24f3 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,19 @@ Fess is Solr based search server, but knowledge/experience about Solr is NOT nee Please file an [issue](https://github.com/codelibs/fess/issues "issue"). (Japanese forum is [here](https://github.com/codelibs/codelibs-ja-forum "here").) +### Development +First of all, clone Fess's repositories: + + $ cd ~/workspace + $ git clone https://github.com/codelibs/fess.git + $ git clone https://github.com/codelibs/fess-db.git + $ git clone https://github.com/codelibs/fess-suggest.git + $ git clone https://github.com/codelibs/fess-solr-plugin.git + +and then imports them as Maven project. +If you want to re-create H2 database for Fess, runs: + + $ cd fess-db/fess-db-h2 + $ mvn dbflute:download + $ mvn dbflute:replace-schema diff --git a/pom.xml b/pom.xml index 4c87ed7f9..aca63c673 100644 --- a/pom.xml +++ b/pom.xml @@ -44,11 +44,6 @@ com.h2database h2 1.4.181 - org.h2.Driver - jdbc:h2:file:${basedir}/src/main/webapp/WEB-INF/db/fess - jdbc:h2:file:${basedir}/target/test-classes/db/fess - sa - @@ -58,11 +53,6 @@ mysql mysql-connector-java 5.1.32 - com.mysql.jdbc.Driver - jdbc:mysql://localhost:3306/fess_db?noDatetimeStringSync=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true - jdbc:mysql://localhost:3306/fess_testdb?noDatetimeStringSync=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true - fess_user - fess_pass @@ -90,6 +80,7 @@ maven-compiler-plugin + 3.2 1.8 1.8 @@ -98,6 +89,7 @@ maven-source-plugin + 2.4 source-jar @@ -109,8 +101,8 @@ - org.apache.maven.plugins maven-war-plugin + 2.6 @@ -126,7 +118,7 @@ com.mycila.maven-license-plugin maven-license-plugin - 1.5.0 + 1.10.b1 @@ -157,16 +149,9 @@ - - maven-site-plugin - - en,ja - UTF-8 - UTF-8 - - maven-javadoc-plugin + 2.10.1 UTF-8 UTF-8 @@ -182,50 +167,11 @@ http://s2robot.sandbox.seasar.org/apidocs/ - - - site - - javadoc - - - - - - org.codehaus.mojo - sql-maven-plugin - - - ${databaseGroupId} - ${databaseArtifactId} - ${databaseVersion} - - - - ${databaseDriver} - ${databaseTestUrl} - ${databaseUsername} - ${databasePassword} - - - - test-compile - - execute - - - - ${basedir}/src/main/config/${database}/fess.ddl - - true - continue - - - net.alchim31.maven yuicompressor-maven-plugin + 1.5.1 compile @@ -316,11 +262,6 @@ fess-suggest 1.3.2 - - jp.sf.fess - fess-launcher - 1.0.2 - jstl jstl diff --git a/src/main/java/org/codelibs/fess/Constants.java b/src/main/java/org/codelibs/fess/Constants.java index 7a46b8507..68b0a4445 100644 --- a/src/main/java/org/codelibs/fess/Constants.java +++ b/src/main/java/org/codelibs/fess/Constants.java @@ -30,6 +30,8 @@ public class Constants extends CoreLibConstants { public static final String LINE_SEPARATOR = System.getProperty("line.separator"); + public static final int DEFAULT_ADMIN_PAGE_NUMBER = 1; + public static final int DEFAULT_ADMIN_PAGE_SIZE = 25; public static final String WEB_API_VERSION = FESS_VERSION; @@ -155,8 +157,6 @@ public class Constants extends CoreLibConstants { public static final String SEARCH_DESKTOP_PROPERTY = "search.desktop"; - public static final String SEARCH_FILE_LAUNCHER_PROPERTY = "search.file.launcher"; - public static final String SEARCH_RESULT_MAX_PAGE_SIZE = "search.result.max_page_size"; public static final String NOTIFICATION_TO_PROPERTY = "notification.to"; diff --git a/src/main/java/org/codelibs/fess/action/AppletAction.java b/src/main/java/org/codelibs/fess/action/AppletAction.java deleted file mode 100644 index 60d924433..000000000 --- a/src/main/java/org/codelibs/fess/action/AppletAction.java +++ /dev/null @@ -1,96 +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.action; - -import java.io.IOException; - -import javax.annotation.Resource; - -import org.apache.commons.lang.StringEscapeUtils; -import org.codelibs.core.util.StringUtil; -import org.codelibs.fess.Constants; -import org.codelibs.fess.form.AppletForm; -import org.codelibs.fess.helper.SystemHelper; -import org.codelibs.sastruts.core.exception.SSCActionMessagesException; -import org.seasar.struts.annotation.ActionForm; -import org.seasar.struts.annotation.Execute; -import org.seasar.struts.util.RequestUtil; -import org.seasar.struts.util.ResponseUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AppletAction { - - private static final Logger logger = LoggerFactory.getLogger(AppletAction.class); - - @ActionForm - @Resource - protected AppletForm appletForm; - - @Resource - protected SystemHelper systemHelper; - - public String path; - - public String referrer; - - public String launcherJarFile; - - public String launcherJnlpFile; - - @Execute(validator = true, input = "../index") - public String index() { - try { - ResponseUtil.getResponse().sendRedirect(appletForm.uri); - } catch (final IOException e) { - if (logger.isDebugEnabled()) { - logger.debug(e.getMessage(), e); - } - throw new SSCActionMessagesException(e, "errors.failed_to_redirect", appletForm.uri); - } - return null; - } - - @Execute(validator = true, input = "../index") - public String launcher() { - launcherJarFile = systemHelper.getLauncherJarPath(); - if (StringUtil.isBlank(launcherJarFile)) { - throw new SSCActionMessagesException("errors.no_launcher_applet_jar"); - } - launcherJnlpFile = systemHelper.getLauncherJnlpPath(); - if (StringUtil.isBlank(launcherJnlpFile)) { - throw new SSCActionMessagesException("errors.no_launcher_applet_jar"); - } - - String encoding = appletForm.encoding; - if (StringUtil.isBlank(encoding)) { - encoding = Constants.UTF_8; - } - - path = StringEscapeUtils.escapeJavaScript(appletForm.uri); - - final String url = RequestUtil.getRequest().getHeader("REFERER"); - if (StringUtil.isBlank(url)) { - referrer = StringUtil.EMPTY; - } else { - referrer = StringEscapeUtils.escapeJavaScript(url); - } - - return "launcher.jsp"; - } - -} \ No newline at end of file diff --git a/src/main/java/org/codelibs/fess/action/IndexAction.java b/src/main/java/org/codelibs/fess/action/IndexAction.java index 51408b9a1..ba5b7e993 100644 --- a/src/main/java/org/codelibs/fess/action/IndexAction.java +++ b/src/main/java/org/codelibs/fess/action/IndexAction.java @@ -460,9 +460,6 @@ public class IndexAction { ResponseUtil.getResponse().setStatus(HttpServletResponse.SC_NO_CONTENT); return null; - } else if (Constants.TRUE.equals(crawlerProperties.getProperty(Constants.SEARCH_FILE_LAUNCHER_PROPERTY, Constants.TRUE))) { - ResponseUtil.getResponse().sendRedirect( - RequestUtil.getRequest().getContextPath() + "/applet/launcher?uri=" + S2Functions.u(url)); } else { ResponseUtil.getResponse().sendRedirect(url + hash); } diff --git a/src/main/java/org/codelibs/fess/action/admin/BoostDocumentRuleAction.java b/src/main/java/org/codelibs/fess/action/admin/BoostDocumentRuleAction.java index 1ad80ccd0..9225d1e3d 100644 --- a/src/main/java/org/codelibs/fess/action/admin/BoostDocumentRuleAction.java +++ b/src/main/java/org/codelibs/fess/action/admin/BoostDocumentRuleAction.java @@ -17,27 +17,51 @@ package org.codelibs.fess.action.admin; import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import javax.annotation.Resource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.codelibs.fess.action.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.action.admin.BsBoostDocumentRuleAction; import org.codelibs.fess.crud.util.SAStrutsUtil; import org.codelibs.fess.db.exentity.BoostDocumentRule; +import org.codelibs.fess.form.admin.BoostDocumentRuleForm; import org.codelibs.fess.helper.SystemHelper; +import org.codelibs.fess.pager.BoostDocumentRulePager; +import org.codelibs.fess.service.BoostDocumentRuleService; +import org.codelibs.sastruts.core.annotation.Token; import org.codelibs.sastruts.core.exception.SSCActionMessagesException; +import org.seasar.framework.beans.util.Beans; +import org.seasar.framework.util.StringUtil; +import org.seasar.struts.annotation.ActionForm; import org.seasar.struts.annotation.Execute; import org.seasar.struts.exception.ActionMessagesException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -public class BoostDocumentRuleAction extends BsBoostDocumentRuleAction { +public class BoostDocumentRuleAction extends FessAdminAction { - private static final long serialVersionUID = 1L; + private static final Logger logger = LoggerFactory.getLogger(BoostDocumentRuleAction.class); - private static final Log log = LogFactory.getLog(BoostDocumentRuleAction.class); + // for list + + public List boostDocumentRuleItems; + + // for edit/confirm/delete + + @ActionForm + @Resource + protected BoostDocumentRuleForm boostDocumentRuleForm; + + @Resource + protected BoostDocumentRuleService boostDocumentRuleService; + + @Resource + protected BoostDocumentRulePager boostDocumentRulePager; @Resource protected SystemHelper systemHelper; @@ -46,7 +70,198 @@ public class BoostDocumentRuleAction extends BsBoostDocumentRuleAction { return systemHelper.getHelpLink("boostDocumentRule"); } - @Override + protected String displayList(final boolean redirect) { + // page navi + boostDocumentRuleItems = boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager); + + // restore from pager + Beans.copy(boostDocumentRulePager, boostDocumentRuleForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) + + .execute(); + + if (redirect) { + return "index?redirect=true"; + } else { + return "index.jsp"; + } + } + + @Execute(validator = false, input = "error.jsp") + public String index() { + return displayList(false); + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + public String list() { + // page navi + if (StringUtil.isNotBlank(boostDocumentRuleForm.pageNumber)) { + try { + boostDocumentRulePager.setCurrentPageNumber(Integer.parseInt(boostDocumentRuleForm.pageNumber)); + } catch (final NumberFormatException e) { + if (logger.isDebugEnabled()) { + logger.debug("Invalid value: " + boostDocumentRuleForm.pageNumber, e); + } + } + } + + return displayList(false); + } + + @Execute(validator = false, input = "error.jsp") + public String search() { + Beans.copy(boostDocumentRuleForm.searchParams, boostDocumentRulePager).excludes(CommonConstants.PAGER_CONVERSION_RULE).execute(); + + return displayList(false); + } + + @Execute(validator = false, input = "error.jsp") + public String reset() { + boostDocumentRulePager.clear(); + + return displayList(false); + } + + @Execute(validator = false, input = "error.jsp") + public String back() { + return displayList(false); + } + + @Token(save = true, validate = false) + @Execute(validator = false, input = "error.jsp") + public String editagain() { + return "edit.jsp"; + } + + @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, + boostDocumentRuleForm.crudMode }); + } + + loadBoostDocumentRule(); + + return "confirm.jsp"; + } + + @Token(save = true, validate = false) + @Execute(validator = false, input = "error.jsp") + public String createpage() { + // page navi + boostDocumentRuleForm.initialize(); + boostDocumentRuleForm.crudMode = CommonConstants.CREATE_MODE; + + return "edit.jsp"; + } + + @Token(save = true, validate = false) + @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, + boostDocumentRuleForm.crudMode }); + } + + loadBoostDocumentRule(); + + return "edit.jsp"; + } + + @Token(save = true, validate = false) + @Execute(validator = false, input = "error.jsp") + public String editfromconfirm() { + boostDocumentRuleForm.crudMode = CommonConstants.EDIT_MODE; + + loadBoostDocumentRule(); + + return "edit.jsp"; + } + + @Token(save = false, validate = true, keep = true) + @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") + public String confirmfromupdate() { + return "confirm.jsp"; + } + + @Token(save = true, validate = false) + @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, + boostDocumentRuleForm.crudMode }); + } + + loadBoostDocumentRule(); + + return "confirm.jsp"; + } + + @Token(save = true, validate = false) + @Execute(validator = false, input = "error.jsp") + public String deletefromconfirm() { + boostDocumentRuleForm.crudMode = CommonConstants.DELETE_MODE; + + loadBoostDocumentRule(); + + return "confirm.jsp"; + } + + @Token(save = false, validate = true) + @Execute(validator = true, input = "edit.jsp") + public String create() { + try { + final BoostDocumentRule boostDocumentRule = createBoostDocumentRule(); + boostDocumentRuleService.store(boostDocumentRule); + SAStrutsUtil.addSessionMessage("success.crud_create_crud_table"); + + return displayList(true); + } catch (final ActionMessagesException e) { + logger.error(e.getMessage(), e); + throw e; + } catch (final CrudMessageException e) { + logger.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); + } catch (final Exception e) { + logger.error(e.getMessage(), e); + throw new ActionMessagesException("errors.crud_failed_to_create_crud_table"); + } + } + + @Token(save = false, validate = true) + @Execute(validator = true, input = "edit.jsp") + public String update() { + try { + final BoostDocumentRule boostDocumentRule = createBoostDocumentRule(); + boostDocumentRuleService.store(boostDocumentRule); + SAStrutsUtil.addSessionMessage("success.crud_update_crud_table"); + + return displayList(true); + } catch (final ActionMessagesException e) { + logger.error(e.getMessage(), e); + throw e; + } catch (final CrudMessageException e) { + logger.error(e.getMessage(), e); + throw new ActionMessagesException(e.getMessageId(), e.getArgs()); + } catch (final Exception e) { + logger.error(e.getMessage(), e); + throw new ActionMessagesException("errors.crud_failed_to_update_crud_table"); + } + } + + protected Map createKeyMap() { + final Map keys = new HashMap(); + + keys.put("id", boostDocumentRuleForm.id); + + return keys; + } + protected void loadBoostDocumentRule() { final BoostDocumentRule boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap()); @@ -58,7 +273,6 @@ public class BoostDocumentRuleAction extends BsBoostDocumentRuleAction { FessBeans.copy(boostDocumentRule, boostDocumentRuleForm).commonColumnDateConverter().excludes("searchParams", "mode").execute(); } - @Override protected BoostDocumentRule createBoostDocumentRule() { BoostDocumentRule boostDocumentRule; final String username = systemHelper.getUsername(); @@ -81,7 +295,6 @@ public class BoostDocumentRuleAction extends BsBoostDocumentRuleAction { return boostDocumentRule; } - @Override @Execute(validator = false, input = "error.jsp") public String delete() { if (boostDocumentRuleForm.crudMode != CommonConstants.DELETE_MODE) { @@ -96,7 +309,6 @@ public class BoostDocumentRuleAction extends BsBoostDocumentRuleAction { throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { boostDocumentRuleForm.id }); } - // boostDocumentRuleService.delete(boostDocumentRule); final String username = systemHelper.getUsername(); final LocalDateTime currentTime = systemHelper.getCurrentTime(); boostDocumentRule.setDeletedBy(username); @@ -106,13 +318,13 @@ public class BoostDocumentRuleAction extends BsBoostDocumentRuleAction { return displayList(true); } catch (final ActionMessagesException e) { - log.error(e.getMessage(), e); + logger.error(e.getMessage(), e); throw e; } catch (final CrudMessageException e) { - log.error(e.getMessage(), e); + logger.error(e.getMessage(), e); throw new SSCActionMessagesException(e, e.getMessageId(), e.getArgs()); } catch (final Exception e) { - log.error(e.getMessage(), e); + logger.error(e.getMessage(), e); throw new SSCActionMessagesException(e, "errors.crud_failed_to_delete_crud_table"); } } diff --git a/src/main/java/org/codelibs/fess/action/base/FessAdminAction.java b/src/main/java/org/codelibs/fess/action/base/FessAdminAction.java new file mode 100644 index 000000000..6f01c9805 --- /dev/null +++ b/src/main/java/org/codelibs/fess/action/base/FessAdminAction.java @@ -0,0 +1,20 @@ +/* + * 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.action.base; + +public abstract class FessAdminAction extends FessBaseAction { + +} diff --git a/src/main/java/org/codelibs/fess/action/base/FessBaseAction.java b/src/main/java/org/codelibs/fess/action/base/FessBaseAction.java index fe587723a..4240e7eda 100644 --- a/src/main/java/org/codelibs/fess/action/base/FessBaseAction.java +++ b/src/main/java/org/codelibs/fess/action/base/FessBaseAction.java @@ -1,3 +1,18 @@ +/* + * 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. + */ /* * Copyright 2014-2015 the original author or authors. diff --git a/src/main/java/org/codelibs/fess/action/base/FessSearchAction.java b/src/main/java/org/codelibs/fess/action/base/FessSearchAction.java new file mode 100644 index 000000000..603c47e52 --- /dev/null +++ b/src/main/java/org/codelibs/fess/action/base/FessSearchAction.java @@ -0,0 +1,20 @@ +/* + * 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.action.base; + +public abstract class FessSearchAction extends FessBaseAction { + +} diff --git a/src/main/java/org/codelibs/fess/beans/converter/LocalDateTimeConverter.java b/src/main/java/org/codelibs/fess/beans/converter/LocalDateTimeConverter.java index 370044b95..e0a80f13c 100644 --- a/src/main/java/org/codelibs/fess/beans/converter/LocalDateTimeConverter.java +++ b/src/main/java/org/codelibs/fess/beans/converter/LocalDateTimeConverter.java @@ -1,3 +1,18 @@ +/* + * 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; diff --git a/src/main/java/org/codelibs/fess/crud/action/admin/BsBoostDocumentRuleAction.java b/src/main/java/org/codelibs/fess/crud/action/admin/BsBoostDocumentRuleAction.java deleted file mode 100644 index c80813dcf..000000000 --- a/src/main/java/org/codelibs/fess/crud/action/admin/BsBoostDocumentRuleAction.java +++ /dev/null @@ -1,328 +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.crud.action.admin; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelibs.fess.crud.CommonConstants; -import org.codelibs.fess.crud.CrudMessageException; -import org.codelibs.fess.crud.util.SAStrutsUtil; -import org.codelibs.fess.db.exentity.BoostDocumentRule; -import org.codelibs.fess.form.admin.BoostDocumentRuleForm; -import org.codelibs.fess.pager.BoostDocumentRulePager; -import org.codelibs.fess.service.BoostDocumentRuleService; -import org.codelibs.sastruts.core.annotation.Token; -import org.seasar.framework.beans.util.Beans; -import org.seasar.framework.util.StringUtil; -import org.seasar.struts.annotation.ActionForm; -import org.seasar.struts.annotation.Execute; -import org.seasar.struts.exception.ActionMessagesException; - -public class BsBoostDocumentRuleAction implements Serializable { - - private static final long serialVersionUID = 1L; - - private static final Log log = LogFactory.getLog(BsBoostDocumentRuleAction.class); - - // for list - - public List boostDocumentRuleItems; - - // for edit/confirm/delete - - @ActionForm - @Resource - protected BoostDocumentRuleForm boostDocumentRuleForm; - - @Resource - protected BoostDocumentRuleService boostDocumentRuleService; - - @Resource - protected BoostDocumentRulePager boostDocumentRulePager; - - protected String displayList(final boolean redirect) { - // page navi - boostDocumentRuleItems = boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager); - - // restore from pager - Beans.copy(boostDocumentRulePager, boostDocumentRuleForm.searchParams).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); - - if (redirect) { - return "index?redirect=true"; - } else { - return "index.jsp"; - } - } - - @Execute(validator = false, input = "error.jsp") - public String index() { - return displayList(false); - } - - @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") - public String list() { - // page navi - if (StringUtil.isNotBlank(boostDocumentRuleForm.pageNumber)) { - try { - boostDocumentRulePager.setCurrentPageNumber(Integer.parseInt(boostDocumentRuleForm.pageNumber)); - } catch (final NumberFormatException e) { - if (log.isDebugEnabled()) { - log.debug("Invalid value: " + boostDocumentRuleForm.pageNumber, e); - } - } - } - - return displayList(false); - } - - @Execute(validator = false, input = "error.jsp") - public String search() { - Beans.copy(boostDocumentRuleForm.searchParams, boostDocumentRulePager).excludes(CommonConstants.PAGER_CONVERSION_RULE) - - .execute(); - - return displayList(false); - } - - @Execute(validator = false, input = "error.jsp") - public String reset() { - boostDocumentRulePager.clear(); - - return displayList(false); - } - - @Execute(validator = false, input = "error.jsp") - public String back() { - return displayList(false); - } - - @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") - public String editagain() { - return "edit.jsp"; - } - - @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, - boostDocumentRuleForm.crudMode }); - } - - loadBoostDocumentRule(); - - return "confirm.jsp"; - } - - @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") - public String createpage() { - // page navi - boostDocumentRuleForm.initialize(); - boostDocumentRuleForm.crudMode = CommonConstants.CREATE_MODE; - - return "edit.jsp"; - } - - @Token(save = true, validate = false) - @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, - boostDocumentRuleForm.crudMode }); - } - - loadBoostDocumentRule(); - - return "edit.jsp"; - } - - @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") - public String editfromconfirm() { - boostDocumentRuleForm.crudMode = CommonConstants.EDIT_MODE; - - loadBoostDocumentRule(); - - return "edit.jsp"; - } - - @Token(save = false, validate = true, keep = true) - @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") - public String confirmfromupdate() { - return "confirm.jsp"; - } - - @Token(save = true, validate = false) - @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, - boostDocumentRuleForm.crudMode }); - } - - loadBoostDocumentRule(); - - return "confirm.jsp"; - } - - @Token(save = true, validate = false) - @Execute(validator = false, input = "error.jsp") - public String deletefromconfirm() { - boostDocumentRuleForm.crudMode = CommonConstants.DELETE_MODE; - - loadBoostDocumentRule(); - - return "confirm.jsp"; - } - - @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") - public String create() { - try { - final BoostDocumentRule boostDocumentRule = createBoostDocumentRule(); - boostDocumentRuleService.store(boostDocumentRule); - SAStrutsUtil.addSessionMessage("success.crud_create_crud_table"); - - return displayList(true); - } catch (final ActionMessagesException e) { - log.error(e.getMessage(), e); - throw e; - } catch (final CrudMessageException e) { - log.error(e.getMessage(), e); - throw new ActionMessagesException(e.getMessageId(), e.getArgs()); - } catch (final Exception e) { - log.error(e.getMessage(), e); - throw new ActionMessagesException("errors.crud_failed_to_create_crud_table"); - } - } - - @Token(save = false, validate = true) - @Execute(validator = true, input = "edit.jsp") - public String update() { - try { - final BoostDocumentRule boostDocumentRule = createBoostDocumentRule(); - boostDocumentRuleService.store(boostDocumentRule); - SAStrutsUtil.addSessionMessage("success.crud_update_crud_table"); - - return displayList(true); - } catch (final ActionMessagesException e) { - log.error(e.getMessage(), e); - throw e; - } catch (final CrudMessageException e) { - log.error(e.getMessage(), e); - throw new ActionMessagesException(e.getMessageId(), e.getArgs()); - } catch (final Exception e) { - log.error(e.getMessage(), e); - throw new ActionMessagesException("errors.crud_failed_to_update_crud_table"); - } - } - - @Token(save = false, validate = true) - @Execute(validator = false, input = "error.jsp") - public String delete() { - if (boostDocumentRuleForm.crudMode != CommonConstants.DELETE_MODE) { - throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE, - boostDocumentRuleForm.crudMode }); - } - - try { - final BoostDocumentRule boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap()); - if (boostDocumentRule == null) { - // throw an exception - throw new ActionMessagesException("errors.crud_could_not_find_crud_table", - - new Object[] { boostDocumentRuleForm.id }); - - } - - boostDocumentRuleService.delete(boostDocumentRule); - SAStrutsUtil.addSessionMessage("success.crud_delete_crud_table"); - - return displayList(true); - } catch (final ActionMessagesException e) { - log.error(e.getMessage(), e); - throw e; - } catch (final CrudMessageException e) { - log.error(e.getMessage(), e); - throw new ActionMessagesException(e.getMessageId(), e.getArgs()); - } catch (final Exception e) { - log.error(e.getMessage(), e); - throw new ActionMessagesException("errors.crud_failed_to_delete_crud_table"); - } - } - - protected void loadBoostDocumentRule() { - - final BoostDocumentRule boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap()); - if (boostDocumentRule == null) { - // throw an exception - throw new ActionMessagesException("errors.crud_could_not_find_crud_table", - - new Object[] { boostDocumentRuleForm.id }); - - } - - Beans.copy(boostDocumentRule, boostDocumentRuleForm).excludes("searchParams", "mode") - - .execute(); - } - - protected BoostDocumentRule createBoostDocumentRule() { - BoostDocumentRule boostDocumentRule; - if (boostDocumentRuleForm.crudMode == CommonConstants.EDIT_MODE) { - boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap()); - if (boostDocumentRule == null) { - // throw an exception - throw new ActionMessagesException("errors.crud_could_not_find_crud_table", - - new Object[] { boostDocumentRuleForm.id }); - - } - } else { - boostDocumentRule = new BoostDocumentRule(); - } - Beans.copy(boostDocumentRuleForm, boostDocumentRule).excludes("searchParams", "mode") - - .execute(); - - return boostDocumentRule; - } - - protected Map createKeyMap() { - final Map keys = new HashMap(); - - keys.put("id", boostDocumentRuleForm.id); - - return keys; - } -} diff --git a/src/main/java/org/codelibs/fess/crud/form/admin/BsBoostDocumentRuleForm.java b/src/main/java/org/codelibs/fess/crud/form/admin/BsBoostDocumentRuleForm.java deleted file mode 100644 index 6fd27f4c3..000000000 --- a/src/main/java/org/codelibs/fess/crud/form/admin/BsBoostDocumentRuleForm.java +++ /dev/null @@ -1,99 +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.crud.form.admin; - -import java.util.HashMap; -import java.util.Map; - -import org.codelibs.fess.Constants; -import org.seasar.struts.annotation.DateType; -import org.seasar.struts.annotation.IntRange; -import org.seasar.struts.annotation.IntegerType; -import org.seasar.struts.annotation.LongType; -import org.seasar.struts.annotation.Maxbytelength; -import org.seasar.struts.annotation.Required; - -public abstract class BsBoostDocumentRuleForm { - @IntegerType - public String pageNumber; - - public Map searchParams = new HashMap(); - - @IntegerType - public int crudMode; - - public String getCurrentPageNumber() { - return pageNumber; - } - - @Required(target = "confirmfromupdate,update,delete") - @LongType - public String id; - - @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 4000) - public String urlExpr; - - @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) - public String sortOrder; - - @Required(target = "confirmfromupdate,update,delete") - @Maxbytelength(maxbytelength = 255) - public String createdBy; - - @Required(target = "confirmfromupdate,update,delete") - @DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) - public String createdTime; - - @Maxbytelength(maxbytelength = 255) - public String updatedBy; - - @DateType - public String updatedTime; - - public String deletedBy; - - @DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) - public String deletedTime; - - @Required(target = "confirmfromupdate,update,delete") - @IntegerType - public String versionNo; - - public void initialize() { - - id = null; - urlExpr = null; - boostExpr = null; - sortOrder = null; - createdBy = null; - createdTime = null; - updatedBy = null; - updatedTime = null; - deletedBy = null; - deletedTime = null; - versionNo = null; - - } - -} diff --git a/src/main/java/org/codelibs/fess/crud/pager/BsBoostDocumentRulePager.java b/src/main/java/org/codelibs/fess/crud/pager/BsBoostDocumentRulePager.java deleted file mode 100644 index 74c2aefca..000000000 --- a/src/main/java/org/codelibs/fess/crud/pager/BsBoostDocumentRulePager.java +++ /dev/null @@ -1,140 +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.crud.pager; - -import java.io.Serializable; -import java.util.List; - -public abstract class BsBoostDocumentRulePager implements Serializable { - private static final long serialVersionUID = 1L; - - public static final int DEFAULT_PAGE_SIZE = 20; - - public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1; - - private int allRecordCount; - - private int allPageCount; - - private boolean existPrePage; - - private boolean existNextPage; - - private List pageNumberList; - - private int pageSize; - - private int currentPageNumber; - - public String id; - - public String urlExpr; - - public String boostExpr; - - public String sortOrder; - - public String createdBy; - - public String createdTime; - - public String versionNo; - - public void clear() { - pageSize = getDefaultPageSize(); - currentPageNumber = getDefaultCurrentPageNumber(); - - id = null; - urlExpr = null; - boostExpr = null; - sortOrder = null; - createdBy = null; - createdTime = null; - versionNo = null; - - } - - protected int getDefaultPageSize() { - return DEFAULT_PAGE_SIZE; - } - - protected int getDefaultCurrentPageNumber() { - return DEFAULT_CURRENT_PAGE_NUMBER; - } - - public int getAllRecordCount() { - return allRecordCount; - } - - public void setAllRecordCount(final int allRecordCount) { - this.allRecordCount = allRecordCount; - } - - public int getAllPageCount() { - return allPageCount; - } - - public void setAllPageCount(final int allPageCount) { - this.allPageCount = allPageCount; - } - - public boolean isExistPrePage() { - return existPrePage; - } - - public void setExistPrePage(final boolean existPrePage) { - this.existPrePage = existPrePage; - } - - public boolean isExistNextPage() { - return existNextPage; - } - - public void setExistNextPage(final boolean existNextPage) { - this.existNextPage = existNextPage; - } - - public int getPageSize() { - if (pageSize <= 0) { - pageSize = getDefaultPageSize(); - } - return pageSize; - } - - public void setPageSize(final int pageSize) { - this.pageSize = pageSize; - } - - public int getCurrentPageNumber() { - if (currentPageNumber <= 0) { - currentPageNumber = getDefaultCurrentPageNumber(); - } - return currentPageNumber; - } - - public void setCurrentPageNumber(final int currentPageNumber) { - this.currentPageNumber = currentPageNumber; - } - - public List getPageNumberList() { - return pageNumberList; - } - - public void setPageNumberList(final List pageNumberList) { - this.pageNumberList = pageNumberList; - } -} diff --git a/src/main/java/org/codelibs/fess/form/admin/BoostDocumentRuleForm.java b/src/main/java/org/codelibs/fess/form/admin/BoostDocumentRuleForm.java index 33440f5c1..066ee6893 100644 --- a/src/main/java/org/codelibs/fess/form/admin/BoostDocumentRuleForm.java +++ b/src/main/java/org/codelibs/fess/form/admin/BoostDocumentRuleForm.java @@ -16,17 +16,85 @@ package org.codelibs.fess.form.admin; -import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; -import org.codelibs.fess.crud.form.admin.BsBoostDocumentRuleForm; +import org.codelibs.fess.Constants; +import org.seasar.struts.annotation.DateType; +import org.seasar.struts.annotation.IntRange; +import org.seasar.struts.annotation.IntegerType; +import org.seasar.struts.annotation.LongType; +import org.seasar.struts.annotation.Maxbytelength; +import org.seasar.struts.annotation.Required; -public class BoostDocumentRuleForm extends BsBoostDocumentRuleForm implements Serializable { +public class BoostDocumentRuleForm { + @IntegerType + public String pageNumber; - private static final long serialVersionUID = 1L; + public Map searchParams = new HashMap(); + + @IntegerType + public int crudMode; + + public String getCurrentPageNumber() { + return pageNumber; + } + + @Required(target = "confirmfromupdate,update,delete") + @LongType + public String id; + + @Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete") + @Maxbytelength(maxbytelength = 4000) + public String urlExpr; + + @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) + public String sortOrder; + + @Required(target = "confirmfromupdate,update,delete") + @Maxbytelength(maxbytelength = 255) + public String createdBy; + + @Required(target = "confirmfromupdate,update,delete") + @DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) + public String createdTime; + + @Maxbytelength(maxbytelength = 255) + public String updatedBy; + + @DateType + public String updatedTime; + + public String deletedBy; + + @DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT) + public String deletedTime; + + @Required(target = "confirmfromupdate,update,delete") + @IntegerType + public String versionNo; - @Override public void initialize() { - super.initialize(); + + id = null; + urlExpr = null; + boostExpr = null; + sortOrder = null; + createdBy = null; + createdTime = null; + updatedBy = null; + updatedTime = null; + deletedBy = null; + deletedTime = null; + versionNo = null; + sortOrder = "0"; } + } diff --git a/src/main/java/org/codelibs/fess/lasta/core/direction/FessConfig.java b/src/main/java/org/codelibs/fess/lasta/core/direction/FessConfig.java index 5be907099..a239ef0b1 100644 --- a/src/main/java/org/codelibs/fess/lasta/core/direction/FessConfig.java +++ b/src/main/java/org/codelibs/fess/lasta/core/direction/FessConfig.java @@ -1,3 +1,18 @@ +/* + * 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.lasta.core.direction; import org.codelibs.fess.lasta.core.direction.FessEnv; diff --git a/src/main/java/org/codelibs/fess/lasta/core/direction/FessEnv.java b/src/main/java/org/codelibs/fess/lasta/core/direction/FessEnv.java index 7846d3c28..2fc635951 100644 --- a/src/main/java/org/codelibs/fess/lasta/core/direction/FessEnv.java +++ b/src/main/java/org/codelibs/fess/lasta/core/direction/FessEnv.java @@ -1,3 +1,18 @@ +/* + * 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.lasta.core.direction; import org.dbflute.saflute.core.direction.ObjectiveConfig; diff --git a/src/main/java/org/codelibs/fess/lasta/core/direction/FessFwAssistantDirector.java b/src/main/java/org/codelibs/fess/lasta/core/direction/FessFwAssistantDirector.java index 8f9a27e67..a4a0e1019 100644 --- a/src/main/java/org/codelibs/fess/lasta/core/direction/FessFwAssistantDirector.java +++ b/src/main/java/org/codelibs/fess/lasta/core/direction/FessFwAssistantDirector.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessActionAdjustmentProvider.java b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessActionAdjustmentProvider.java index 59c41bef1..01bb714f4 100644 --- a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessActionAdjustmentProvider.java +++ b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessActionAdjustmentProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessTimeResourceProvider.java b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessTimeResourceProvider.java index c7ccff05b..1e625498f 100644 --- a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessTimeResourceProvider.java +++ b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessTimeResourceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserLocaleProcessProvider.java b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserLocaleProcessProvider.java index fb8ea3d6d..7c1fa7627 100644 --- a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserLocaleProcessProvider.java +++ b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserLocaleProcessProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserTimeZoneProcessProvider.java b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserTimeZoneProcessProvider.java index 6f4dd8a73..57a4d6783 100644 --- a/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserTimeZoneProcessProvider.java +++ b/src/main/java/org/codelibs/fess/lasta/core/direction/sponsor/FessUserTimeZoneProcessProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/lasta/web/action/FessJspPath.java b/src/main/java/org/codelibs/fess/lasta/web/action/FessJspPath.java index f6bf2ea94..4fdf24f91 100644 --- a/src/main/java/org/codelibs/fess/lasta/web/action/FessJspPath.java +++ b/src/main/java/org/codelibs/fess/lasta/web/action/FessJspPath.java @@ -1,3 +1,18 @@ +/* + * 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.lasta.web.action; /** @@ -339,9 +354,6 @@ public interface FessJspPath { /** The path of the JSP: /admin/wizard/startCrawling.jsp */ String path_AdminWizard_StartCrawlingJsp = "/admin/wizard/startCrawling.jsp"; - /** The path of the JSP: /applet/launcher.jsp */ - String path_Applet_LauncherJsp = "/applet/launcher.jsp"; - /** The path of the JSP: /error/badRequest.jsp */ String path_Error_BadRequestJsp = "/error/badRequest.jsp"; diff --git a/src/main/java/org/codelibs/fess/lasta/web/action/FessLoginRequired.java b/src/main/java/org/codelibs/fess/lasta/web/action/FessLoginRequired.java index d794a11d9..5f646a34d 100644 --- a/src/main/java/org/codelibs/fess/lasta/web/action/FessLoginRequired.java +++ b/src/main/java/org/codelibs/fess/lasta/web/action/FessLoginRequired.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/lasta/web/action/FessMessages.java b/src/main/java/org/codelibs/fess/lasta/web/action/FessMessages.java index c366631c5..50204b59a 100644 --- a/src/main/java/org/codelibs/fess/lasta/web/action/FessMessages.java +++ b/src/main/java/org/codelibs/fess/lasta/web/action/FessMessages.java @@ -1,3 +1,18 @@ +/* + * 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.lasta.web.action; import org.apache.struts.action.ActionMessages; diff --git a/src/main/java/org/codelibs/fess/lasta/web/action/FessPerformLogin.java b/src/main/java/org/codelibs/fess/lasta/web/action/FessPerformLogin.java index fecca3e44..2b380190e 100644 --- a/src/main/java/org/codelibs/fess/lasta/web/action/FessPerformLogin.java +++ b/src/main/java/org/codelibs/fess/lasta/web/action/FessPerformLogin.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/lasta/web/action/FessUserBean.java b/src/main/java/org/codelibs/fess/lasta/web/action/FessUserBean.java index e67ee3d00..fcf64b36b 100644 --- a/src/main/java/org/codelibs/fess/lasta/web/action/FessUserBean.java +++ b/src/main/java/org/codelibs/fess/lasta/web/action/FessUserBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * 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. diff --git a/src/main/java/org/codelibs/fess/pager/BoostDocumentRulePager.java b/src/main/java/org/codelibs/fess/pager/BoostDocumentRulePager.java index 4d527c57f..3c4eba929 100644 --- a/src/main/java/org/codelibs/fess/pager/BoostDocumentRulePager.java +++ b/src/main/java/org/codelibs/fess/pager/BoostDocumentRulePager.java @@ -16,23 +16,124 @@ package org.codelibs.fess.pager; +import java.io.Serializable; +import java.util.List; + import org.codelibs.fess.Constants; -import org.codelibs.fess.crud.pager.BsBoostDocumentRulePager; - -public class BoostDocumentRulePager extends BsBoostDocumentRulePager { +public class BoostDocumentRulePager implements Serializable { private static final long serialVersionUID = 1L; - public BoostDocumentRulePager() { - super(); - } + public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1; + + private int allRecordCount; + + private int allPageCount; + + private boolean existPrePage; + + private boolean existNextPage; + + private List pageNumberList; + + private int pageSize; + + private int currentPageNumber; + + public String id; + + public String urlExpr; + + public String boostExpr; + + public String sortOrder; + + public String createdBy; + + public String createdTime; + + public String versionNo; - @Override public void clear() { - super.clear(); + pageSize = getDefaultPageSize(); + currentPageNumber = getDefaultCurrentPageNumber(); + + id = null; + urlExpr = null; + boostExpr = null; + sortOrder = null; + createdBy = null; + createdTime = null; + versionNo = null; + + } + + public int getAllRecordCount() { + return allRecordCount; + } + + public void setAllRecordCount(final int allRecordCount) { + this.allRecordCount = allRecordCount; + } + + public int getAllPageCount() { + return allPageCount; + } + + public void setAllPageCount(final int allPageCount) { + this.allPageCount = allPageCount; + } + + public boolean isExistPrePage() { + return existPrePage; + } + + public void setExistPrePage(final boolean existPrePage) { + this.existPrePage = existPrePage; + } + + public boolean isExistNextPage() { + return existNextPage; + } + + public void setExistNextPage(final boolean existNextPage) { + this.existNextPage = existNextPage; + } + + public int getPageSize() { + if (pageSize <= 0) { + pageSize = getDefaultPageSize(); + } + return pageSize; + } + + public void setPageSize(final int pageSize) { + this.pageSize = pageSize; + } + + public int getCurrentPageNumber() { + if (currentPageNumber <= 0) { + currentPageNumber = getDefaultCurrentPageNumber(); + } + return currentPageNumber; + } + + public void setCurrentPageNumber(final int currentPageNumber) { + this.currentPageNumber = currentPageNumber; + } + + public List getPageNumberList() { + return pageNumberList; + } + + public void setPageNumberList(final List pageNumberList) { + this.pageNumberList = pageNumberList; + } + + protected int getDefaultCurrentPageNumber() { + return Constants.DEFAULT_ADMIN_PAGE_NUMBER; } - @Override protected int getDefaultPageSize() { return Constants.DEFAULT_ADMIN_PAGE_SIZE; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9f112e633..11e01f474 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -65,7 +65,6 @@ errors.target_file_does_not_exist={0} file does not exist. errors.failed_to_download_file=Failed to download {0} file. errors.failed_to_delete_file=Failed to delete {0} file. errors.failed_to_redirect=Failed to redirect {0}. -errors.no_launcher_applet_jar=No launcher file. errors.unsupported_encoding={0} is not supported as encoding. errors.docid_not_found=Not found Doc ID:{0} errors.document_not_found=Not found URL of Doc ID:{0} @@ -467,9 +466,6 @@ labels.footer_back_to_top=Back to top labels.header_brand_name=Fess labels.header_form_option_btn=Options -# view/applet/launcher.jsp -labels.open_uri=Accessing {0}
At a first time starting, it might take a little more time to open the file. - # view/admin/fileCrawlingConfig/edit.jsp labels.file_crawling_configuration=File Crawling Configuration labels.file_crawling_title_details=File Crawling Configuration @@ -960,7 +956,6 @@ labels.design_file_help=Help Page (Content) labels.design_file_header=Header labels.design_file_error=Search Error Page labels.design_file_cache=Cache Page -labels.design_file_appletLauncher=File Launcher Page labels.design_file_errorHeader=Error Page (Header) labels.design_file_errorFooter=Error Page (Footer) labels.design_file_errorNotFound=Error Page (Not Found) diff --git a/src/main/resources/application_ja.properties b/src/main/resources/application_ja.properties index 2c15e4612..4d2ee61b0 100644 --- a/src/main/resources/application_ja.properties +++ b/src/main/resources/application_ja.properties @@ -65,7 +65,6 @@ errors.target_file_does_not_exist=\u30d5\u30a1\u30a4\u30eb {0} \u304c\u5b58\u572 errors.failed_to_download_file={0} \u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.failed_to_delete_file=\u30d5\u30a1\u30a4\u30eb {0} \u306e\u524a\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 errors.failed_to_redirect={0}\u3078\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -errors.no_launcher_applet_jar=\u8d77\u52d5\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u307e\u305b\u3093\u3002 errors.unsupported_encoding={0}\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u3059\u3002 errors.docid_not_found=ID:{0}\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 errors.document_not_found=ID:{0}\u306eURL\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 @@ -467,9 +466,6 @@ labels.footer_back_to_top=\u4e0a\u90e8\u3078\u79fb\u52d5 labels.header_brand_name=Fess labels.header_form_option_btn=\u30aa\u30d7\u30b7\u30e7\u30f3 -# view/applet/launcher.jsp -labels.open_uri=\u30a2\u30af\u30bb\u30b9\u4e2d: {0}
\u521d\u56de\u8d77\u52d5\u6642\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 - # view/admin/fileCrawlingConfig/edit.jsp labels.file_crawling_configuration=\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30af\u30ed\u30fc\u30eb\u306e\u8a2d\u5b9a labels.file_crawling_title_details=\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30af\u30ed\u30fc\u30eb\u306e\u8a2d\u5b9a @@ -960,7 +956,6 @@ labels.design_file_error=\u691c\u7d22\u30a8\u30e9\u30fc\u30da\u30fc\u30b8 labels.design_file_cache=\u30ad\u30e3\u30c3\u30b7\u30e5\u30da\u30fc\u30b8 labels.design_file_help=\u30d8\u30eb\u30d7\u30da\u30fc\u30b8 (\u30d5\u30ec\u30fc\u30e0) labels.design_file_header=\u30d8\u30c3\u30c0\u30fc -labels.design_file_appletLauncher=\u30d5\u30a1\u30a4\u30eb\u8d77\u52d5\u30da\u30fc\u30b8 labels.design_file_errorHeader=\u30a8\u30e9\u30fc\u30da\u30fc\u30b8 (\u30d8\u30c3\u30c0\u30fc) labels.design_file_errorFooter=\u30a8\u30e9\u30fc\u30da\u30fc\u30b8 (\u30d5\u30c3\u30bf\u30fc) labels.design_file_errorNotFound=\u30a8\u30e9\u30fc\u30da\u30fc\u30b8 (\u30da\u30fc\u30b8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093) diff --git a/src/main/resources/creator.dicon b/src/main/resources/creator.dicon index 2a24e4d0f..c4c5f4b5f 100644 --- a/src/main/resources/creator.dicon +++ b/src/main/resources/creator.dicon @@ -8,7 +8,6 @@ - diff --git a/src/main/resources/customizer.dicon b/src/main/resources/customizer.dicon index 641fd6f0d..f9704f3da 100644 --- a/src/main/resources/customizer.dicon +++ b/src/main/resources/customizer.dicon @@ -40,29 +40,6 @@ - - - "aop.traceInterceptor" - - "do.*, initialize, destroy" - - - - taskSupportAspectCustomizer - - - - - "aop.traceInterceptor" - - ".*" - - - - triggerSupportAspectCustomizer - - - diff --git a/src/main/resources/fess.dicon b/src/main/resources/fess.dicon index 08660ec7e..b420a245b 100644 --- a/src/main/resources/fess.dicon +++ b/src/main/resources/fess.dicon @@ -110,10 +110,6 @@ new String[] { "error" "error.jsp" - - "appletLauncher" - "applet/launcher.jsp" - "errorHeader" "error/header.jsp" diff --git a/src/main/webapp/WEB-INF/orig/view/applet/launcher.jsp b/src/main/webapp/WEB-INF/orig/view/applet/launcher.jsp deleted file mode 100644 index 3ce679844..000000000 --- a/src/main/webapp/WEB-INF/orig/view/applet/launcher.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> - - - - - - -${f:h(displayQuery)} - <bean:message - key="labels.search_title" /> - - - - - - -
-
-
-
- -
- - -
-
- -
- - diff --git a/src/main/webapp/WEB-INF/view/applet/launcher.jsp b/src/main/webapp/WEB-INF/view/applet/launcher.jsp deleted file mode 100644 index 3ce679844..000000000 --- a/src/main/webapp/WEB-INF/view/applet/launcher.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> - - - - - - -${f:h(displayQuery)} - <bean:message - key="labels.search_title" /> - - - - - - -
-
-
-
- -
- - -
-
- -
- - diff --git a/src/test/resources/jdbc.dicon b/src/test/resources/jdbc.dicon index 94148274b..a07f11afc 100644 --- a/src/test/resources/jdbc.dicon +++ b/src/test/resources/jdbc.dicon @@ -30,7 +30,7 @@ "jdbc:h2:file:" + @org.seasar.framework.util.ResourceUtil@getBuildDir(@org.codelibs.fess.FessClass@class).getCanonicalPath() - + "/db/fess;DB_CLOSE_ON_EXIT=FALSE;LOG=2;MVCC=true" + + "../../../src/main/h2/webapp/WEB-INF/db/fess;DB_CLOSE_ON_EXIT=FALSE;LOG=2;MVCC=true" "sa" diff --git a/src/test/resources/org/codelibs/fess/helper/overlappingHost.dicon b/src/test/resources/org/codelibs/fess/helper/overlappingHost.dicon index 3c1b31471..9e64cb440 100644 --- a/src/test/resources/org/codelibs/fess/helper/overlappingHost.dicon +++ b/src/test/resources/org/codelibs/fess/helper/overlappingHost.dicon @@ -3,6 +3,7 @@ "http://www.seasar.org/dtd/components24.dtd"> +