fix #102
This commit is contained in:
parent
33ff1b9779
commit
ec330a1c2c
5 changed files with 33 additions and 6 deletions
|
@ -27,6 +27,7 @@ import jp.sf.fess.Constants;
|
|||
import jp.sf.fess.crud.CommonConstants;
|
||||
import jp.sf.fess.crud.CrudMessageException;
|
||||
import jp.sf.fess.crud.util.SAStrutsUtil;
|
||||
import jp.sf.fess.dict.DictionaryExpiredException;
|
||||
import jp.sf.fess.dict.synonym.SynonymItem;
|
||||
import jp.sf.fess.form.admin.dict.SynonymForm;
|
||||
import jp.sf.fess.helper.SystemHelper;
|
||||
|
@ -223,6 +224,8 @@ public class SynonymAction {
|
|||
SAStrutsUtil.addSessionMessage("success.crud_create_crud_table");
|
||||
|
||||
return displayList(true);
|
||||
} catch (final DictionaryExpiredException e) {
|
||||
throw e;
|
||||
} catch (final ActionMessagesException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw e;
|
||||
|
@ -246,6 +249,8 @@ public class SynonymAction {
|
|||
SAStrutsUtil.addSessionMessage("success.crud_update_crud_table");
|
||||
|
||||
return displayList(true);
|
||||
} catch (final DictionaryExpiredException e) {
|
||||
throw e;
|
||||
} catch (final ActionMessagesException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw e;
|
||||
|
@ -285,6 +290,8 @@ public class SynonymAction {
|
|||
SAStrutsUtil.addSessionMessage("success.crud_delete_crud_table");
|
||||
|
||||
return displayList(true);
|
||||
} catch (final DictionaryExpiredException e) {
|
||||
throw e;
|
||||
} catch (final ActionMessagesException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw e;
|
||||
|
|
|
@ -26,6 +26,7 @@ import jp.sf.fess.Constants;
|
|||
import jp.sf.fess.crud.CommonConstants;
|
||||
import jp.sf.fess.crud.CrudMessageException;
|
||||
import jp.sf.fess.crud.util.SAStrutsUtil;
|
||||
import jp.sf.fess.dict.DictionaryExpiredException;
|
||||
import jp.sf.fess.dict.userdict.UserDictItem;
|
||||
import jp.sf.fess.form.admin.dict.UserDictForm;
|
||||
import jp.sf.fess.helper.SystemHelper;
|
||||
|
@ -221,6 +222,8 @@ public class UserDictAction {
|
|||
SAStrutsUtil.addSessionMessage("success.crud_create_crud_table");
|
||||
|
||||
return displayList(true);
|
||||
} catch (final DictionaryExpiredException e) {
|
||||
throw e;
|
||||
} catch (final ActionMessagesException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw e;
|
||||
|
@ -244,6 +247,8 @@ public class UserDictAction {
|
|||
SAStrutsUtil.addSessionMessage("success.crud_update_crud_table");
|
||||
|
||||
return displayList(true);
|
||||
} catch (final DictionaryExpiredException e) {
|
||||
throw e;
|
||||
} catch (final ActionMessagesException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw e;
|
||||
|
@ -283,6 +288,8 @@ public class UserDictAction {
|
|||
SAStrutsUtil.addSessionMessage("success.crud_delete_crud_table");
|
||||
|
||||
return displayList(true);
|
||||
} catch (final DictionaryExpiredException e) {
|
||||
throw e;
|
||||
} catch (final ActionMessagesException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw e;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package jp.sf.fess.dict;
|
||||
|
||||
import org.seasar.struts.exception.ActionMessagesException;
|
||||
|
||||
public class DictionaryExpiredException extends ActionMessagesException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DictionaryExpiredException() {
|
||||
super("errors.expired_dict_id");
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ import java.util.Map;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
import jp.sf.fess.crud.CommonConstants;
|
||||
import jp.sf.fess.dict.DictionaryExpiredException;
|
||||
import jp.sf.fess.dict.DictionaryFile;
|
||||
import jp.sf.fess.dict.DictionaryFile.PagingList;
|
||||
import jp.sf.fess.dict.DictionaryManager;
|
||||
|
@ -31,7 +32,6 @@ import jp.sf.fess.pager.SynonymPager;
|
|||
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
import org.seasar.framework.util.StringUtil;
|
||||
import org.seasar.struts.exception.ActionMessagesException;
|
||||
|
||||
public class SynonymService {
|
||||
@Resource
|
||||
|
@ -61,7 +61,7 @@ public class SynonymService {
|
|||
if (dictionaryFile instanceof SynonymFile) {
|
||||
return (SynonymFile) dictionaryFile;
|
||||
}
|
||||
throw new ActionMessagesException("errors.expired_dict_id");
|
||||
throw new DictionaryExpiredException();
|
||||
}
|
||||
|
||||
public SynonymItem getSynonym(final String dictId,
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.Map;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
import jp.sf.fess.crud.CommonConstants;
|
||||
import jp.sf.fess.dict.DictionaryExpiredException;
|
||||
import jp.sf.fess.dict.DictionaryFile;
|
||||
import jp.sf.fess.dict.DictionaryFile.PagingList;
|
||||
import jp.sf.fess.dict.DictionaryManager;
|
||||
|
@ -31,7 +32,6 @@ import jp.sf.fess.pager.UserDictPager;
|
|||
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
import org.seasar.framework.util.StringUtil;
|
||||
import org.seasar.struts.exception.ActionMessagesException;
|
||||
|
||||
public class UserDictService {
|
||||
@Resource
|
||||
|
@ -42,8 +42,9 @@ public class UserDictService {
|
|||
final UserDictFile userDictFile = getUserDictFile(dictId);
|
||||
|
||||
final int pageSize = userDictPager.getPageSize();
|
||||
final PagingList<UserDictItem> userDictList = userDictFile.selectList(
|
||||
(userDictPager.getCurrentPageNumber() - 1) * pageSize, pageSize);
|
||||
final PagingList<UserDictItem> userDictList = userDictFile
|
||||
.selectList((userDictPager.getCurrentPageNumber() - 1)
|
||||
* pageSize, pageSize);
|
||||
|
||||
// update pager
|
||||
Beans.copy(userDictList, userDictPager)
|
||||
|
@ -61,7 +62,7 @@ public class UserDictService {
|
|||
if (dictionaryFile instanceof UserDictFile) {
|
||||
return (UserDictFile) dictionaryFile;
|
||||
}
|
||||
throw new ActionMessagesException("errors.expired_dict_id");
|
||||
throw new DictionaryExpiredException();
|
||||
}
|
||||
|
||||
public UserDictItem getUserDict(final String dictId,
|
||||
|
|
Loading…
Add table
Reference in a new issue