modify crawler and apply code formatter
This commit is contained in:
parent
a68f47db52
commit
8b9ef2fc13
120 changed files with 1036 additions and 848 deletions
|
@ -225,5 +225,10 @@ public abstract class Bs${table.camelizedName}Bhv extends AbstractBehavior<${tab
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -305,14 +305,14 @@ public class Constants extends CoreLibConstants {
|
|||
|
||||
public static final String INVALID_NUMERIC_PARAMETER = "-1";
|
||||
|
||||
public static final String NOW = "NOW";
|
||||
|
||||
public static final String FACET_FIELD_PREFIX = "field:";
|
||||
|
||||
public static final String FACET_QUERY_PREFIX = "query:";
|
||||
|
||||
public static final String FESS_ES_TRANSPORT_ADDRESSES = "fess.es.transport_addresses";
|
||||
|
||||
public static final String FESS_ES_CLUSTER_NAME = "fess.es.cluster_name";
|
||||
|
||||
public static final int DEFAULT_PAGE_SIZE = 20;
|
||||
|
||||
public static final int DEFAULT_START_COUNT = 0;
|
||||
|
|
|
@ -70,7 +70,7 @@ public class BaseApiManager {
|
|||
}
|
||||
}
|
||||
|
||||
public static void write(String text, String contentType, String encoding) {
|
||||
public static void write(final String text, String contentType, String encoding) {
|
||||
if (contentType == null) {
|
||||
contentType = "text/plain";
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class BaseApiManager {
|
|||
encoding = "UTF-8";
|
||||
}
|
||||
}
|
||||
HttpServletResponse response = LaResponseUtil.getResponse();
|
||||
final HttpServletResponse response = LaResponseUtil.getResponse();
|
||||
response.setContentType(contentType + "; charset=" + encoding);
|
||||
try {
|
||||
PrintWriter out = null;
|
||||
|
@ -92,7 +92,7 @@ public class BaseApiManager {
|
|||
out.close();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (final IOException e) {
|
||||
throw new IORuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("boostDocumentRule"));
|
||||
}
|
||||
|
@ -62,14 +62,14 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(BoostDocumentRuleSearchForm form) {
|
||||
public HtmlResponse index(final BoostDocumentRuleSearchForm form) {
|
||||
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, BoostDocumentRuleSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final BoostDocumentRuleSearchForm form) {
|
||||
boostDocumentRulePager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -77,7 +77,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(BoostDocumentRuleSearchForm form) {
|
||||
public HtmlResponse search(final BoostDocumentRuleSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, boostDocumentRulePager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -85,7 +85,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(BoostDocumentRuleSearchForm form) {
|
||||
public HtmlResponse reset(final BoostDocumentRuleSearchForm form) {
|
||||
boostDocumentRulePager.clear();
|
||||
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -93,13 +93,13 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(BoostDocumentRuleSearchForm form) {
|
||||
public HtmlResponse back(final BoostDocumentRuleSearchForm form) {
|
||||
return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, BoostDocumentRuleSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final BoostDocumentRuleSearchForm form) {
|
||||
data.register("boostDocumentRuleItems", boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -114,7 +114,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse createpage(final BoostDocumentRuleEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminBoostdocumentrule_EditJsp);
|
||||
|
@ -122,7 +122,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final BoostDocumentRuleEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -132,13 +132,13 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse editagain(final BoostDocumentRuleEditForm form) {
|
||||
return asHtml(path_AdminBoostdocumentrule_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final BoostDocumentRuleEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadBoostDocumentRule(form);
|
||||
return asHtml(path_AdminBoostdocumentrule_EditJsp);
|
||||
|
@ -146,7 +146,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final BoostDocumentRuleEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -156,7 +156,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final BoostDocumentRuleEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadBoostDocumentRule(form);
|
||||
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
|
||||
|
@ -166,7 +166,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final BoostDocumentRuleEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -176,14 +176,14 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final BoostDocumentRuleEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final BoostDocumentRuleEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse create(final BoostDocumentRuleEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
boostDocumentRuleService.store(createBoostDocumentRule(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -202,7 +202,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse update(final BoostDocumentRuleEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
boostDocumentRuleService.store(createBoostDocumentRule(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -210,7 +210,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(BoostDocumentRuleEditForm form) {
|
||||
public HtmlResponse delete(final BoostDocumentRuleEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
boostDocumentRuleService.delete(getBoostDocumentRule(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -220,11 +220,11 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadBoostDocumentRule(BoostDocumentRuleEditForm form) {
|
||||
protected void loadBoostDocumentRule(final BoostDocumentRuleEditForm form) {
|
||||
copyBeanToBean(getBoostDocumentRule(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected BoostDocumentRule getBoostDocumentRule(BoostDocumentRuleEditForm form) {
|
||||
protected BoostDocumentRule getBoostDocumentRule(final BoostDocumentRuleEditForm form) {
|
||||
final BoostDocumentRule boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap(form));
|
||||
if (boostDocumentRule == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -232,7 +232,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
return boostDocumentRule;
|
||||
}
|
||||
|
||||
protected BoostDocumentRule createBoostDocumentRule(BoostDocumentRuleEditForm form) {
|
||||
protected BoostDocumentRule createBoostDocumentRule(final BoostDocumentRuleEditForm form) {
|
||||
BoostDocumentRule boostDocumentRule;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -249,7 +249,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
return boostDocumentRule;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(BoostDocumentRuleEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final BoostDocumentRuleEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -258,7 +258,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(BoostDocumentRuleEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final BoostDocumentRuleEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -65,19 +65,19 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
public ActionResponse hookBefore(ActionRuntime runtime) {
|
||||
public ActionResponse hookBefore(final ActionRuntime runtime) {
|
||||
checkEditorStatus(runtime);
|
||||
return super.hookBefore(runtime);
|
||||
}
|
||||
|
||||
private void checkEditorStatus(ActionRuntime runtime) {
|
||||
private void checkEditorStatus(final ActionRuntime runtime) {
|
||||
if (cannotEdit()) {
|
||||
throwValidationError(messages -> messages.addErrorsDesignEditorDisabled(GLOBAL), toMainHtml());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("editable", cannotEdit());
|
||||
runtime.registerData("fileNameItems", loadFileNameItems());
|
||||
|
@ -109,7 +109,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse upload(DesignForm form) {
|
||||
public HtmlResponse upload(final DesignForm form) {
|
||||
validate(form, messages -> {}, toMainHtml());
|
||||
final String uploadedFileName = form.designFile.getFileName();
|
||||
String fileName = form.designFileName;
|
||||
|
@ -178,7 +178,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public StreamResponse download(DesignForm form) {
|
||||
public StreamResponse download(final DesignForm form) {
|
||||
final File file = getTargetFile(form);
|
||||
if (file == null) {
|
||||
throwValidationError(messages -> messages.addErrorsTargetFileDoesNotExist(GLOBAL, form.fileName), toMainHtml());
|
||||
|
@ -192,7 +192,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse delete(DesignForm form) {
|
||||
public HtmlResponse delete(final DesignForm form) {
|
||||
final File file = getTargetFile(form);
|
||||
if (file == null) {
|
||||
throwValidationError(messages -> messages.addErrorsTargetFileDoesNotExist(GLOBAL, form.fileName), toMainHtml());
|
||||
|
@ -210,7 +210,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
// ------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse edit(DesignEditForm form) {
|
||||
public HtmlResponse edit(final DesignEditForm form) {
|
||||
final String jspType = "view";
|
||||
final File jspFile = getJspFile(form.fileName, jspType);
|
||||
try {
|
||||
|
@ -223,7 +223,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editAsUseDefault(DesignEditForm form) {
|
||||
public HtmlResponse editAsUseDefault(final DesignEditForm form) {
|
||||
final String jspType = "orig/view";
|
||||
final File jspFile = getJspFile(form.fileName, jspType);
|
||||
try {
|
||||
|
@ -236,7 +236,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(DesignEditForm form) {
|
||||
public HtmlResponse update(final DesignEditForm form) {
|
||||
final String jspType = "view";
|
||||
final File jspFile = getJspFile(form.fileName, jspType);
|
||||
|
||||
|
@ -263,7 +263,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
private File getTargetFile(DesignForm form) {
|
||||
private File getTargetFile(final DesignForm form) {
|
||||
final File baseDir = new File(getServletContext().getRealPath("/"));
|
||||
final File targetFile = new File(getServletContext().getRealPath(form.fileName));
|
||||
final List<File> fileList = getAccessibleFileList(baseDir);
|
||||
|
@ -288,7 +288,7 @@ public class AdminDesignAction extends FessAdminAction implements Serializable {
|
|||
return fileList;
|
||||
}
|
||||
|
||||
private File getJspFile(String fileName, String jspType) {
|
||||
private File getJspFile(final String fileName, final String jspType) {
|
||||
final String jspFileName = systemHelper.getDesignJspFileName(fileName);
|
||||
if (jspFileName == null) {
|
||||
throwValidationError(messages -> messages.addErrorsInvalidDesignJspFileName(GLOBAL), toMainHtml());
|
||||
|
|
|
@ -55,7 +55,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("keyMatch"));
|
||||
}
|
||||
|
@ -64,14 +64,14 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(KeyMatchSearchForm form) {
|
||||
public HtmlResponse index(final KeyMatchSearchForm form) {
|
||||
return asHtml(path_AdminKeymatch_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, KeyMatchSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final KeyMatchSearchForm form) {
|
||||
keyMatchPager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminKeymatch_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -79,7 +79,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(KeyMatchSearchForm form) {
|
||||
public HtmlResponse search(final KeyMatchSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, keyMatchPager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminKeymatch_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -87,7 +87,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(KeyMatchSearchForm form) {
|
||||
public HtmlResponse reset(final KeyMatchSearchForm form) {
|
||||
keyMatchPager.clear();
|
||||
return asHtml(path_AdminKeymatch_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -95,13 +95,13 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(KeyMatchSearchForm form) {
|
||||
public HtmlResponse back(final KeyMatchSearchForm form) {
|
||||
return asHtml(path_AdminKeymatch_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, KeyMatchSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final KeyMatchSearchForm form) {
|
||||
data.register("keyMatchItems", keyMatchService.getKeyMatchList(keyMatchPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -116,7 +116,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(KeyMatchEditForm form) {
|
||||
public HtmlResponse createpage(final KeyMatchEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminKeymatch_EditJsp);
|
||||
|
@ -124,7 +124,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, KeyMatchEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final KeyMatchEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -134,13 +134,13 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(KeyMatchEditForm form) {
|
||||
public HtmlResponse editagain(final KeyMatchEditForm form) {
|
||||
return asHtml(path_AdminKeymatch_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(KeyMatchEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final KeyMatchEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadKeyMatch(form);
|
||||
return asHtml(path_AdminKeymatch_EditJsp);
|
||||
|
@ -148,7 +148,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, KeyMatchEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final KeyMatchEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -158,7 +158,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(KeyMatchEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final KeyMatchEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadKeyMatch(form);
|
||||
return asHtml(path_AdminKeymatch_ConfirmJsp);
|
||||
|
@ -168,7 +168,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, KeyMatchEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final KeyMatchEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -178,14 +178,14 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(KeyMatchEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final KeyMatchEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminKeymatch_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(KeyMatchEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final KeyMatchEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminKeymatch_ConfirmJsp);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(KeyMatchEditForm form) {
|
||||
public HtmlResponse create(final KeyMatchEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
keyMatchService.store(createKeyMatch(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -205,7 +205,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(KeyMatchEditForm form) {
|
||||
public HtmlResponse update(final KeyMatchEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
keyMatchService.store(createKeyMatch(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -214,7 +214,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(KeyMatchEditForm form) {
|
||||
public HtmlResponse delete(final KeyMatchEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
keyMatchService.delete(getKeyMatch(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -225,11 +225,11 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadKeyMatch(KeyMatchEditForm form) {
|
||||
protected void loadKeyMatch(final KeyMatchEditForm form) {
|
||||
copyBeanToBean(getKeyMatch(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected KeyMatch getKeyMatch(KeyMatchEditForm form) {
|
||||
protected KeyMatch getKeyMatch(final KeyMatchEditForm form) {
|
||||
final KeyMatch keyMatch = keyMatchService.getKeyMatch(createKeyMap(form));
|
||||
if (keyMatch == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -237,7 +237,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
return keyMatch;
|
||||
}
|
||||
|
||||
protected KeyMatch createKeyMatch(KeyMatchEditForm form) {
|
||||
protected KeyMatch createKeyMatch(final KeyMatchEditForm form) {
|
||||
KeyMatch keyMatch;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -254,7 +254,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
return keyMatch;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(KeyMatchEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final KeyMatchEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -263,7 +263,7 @@ public class AdminKeymatchAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(KeyMatchEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final KeyMatchEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("labelType"));
|
||||
}
|
||||
|
@ -62,14 +62,14 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(LabelTypeSearchForm form) {
|
||||
public HtmlResponse index(final LabelTypeSearchForm form) {
|
||||
return asHtml(path_AdminLabeltype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, LabelTypeSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final LabelTypeSearchForm form) {
|
||||
labelTypePager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminLabeltype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -77,7 +77,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(LabelTypeSearchForm form) {
|
||||
public HtmlResponse search(final LabelTypeSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, labelTypePager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminLabeltype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -85,7 +85,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(LabelTypeSearchForm form) {
|
||||
public HtmlResponse reset(final LabelTypeSearchForm form) {
|
||||
labelTypePager.clear();
|
||||
return asHtml(path_AdminLabeltype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -93,13 +93,13 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(LabelTypeSearchForm form) {
|
||||
public HtmlResponse back(final LabelTypeSearchForm form) {
|
||||
return asHtml(path_AdminLabeltype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, LabelTypeSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final LabelTypeSearchForm form) {
|
||||
data.register("labelTypeItems", labelTypeService.getLabelTypeList(labelTypePager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -114,7 +114,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(LabelTypeEditForm form) {
|
||||
public HtmlResponse createpage(final LabelTypeEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminLabeltype_EditJsp);
|
||||
|
@ -122,7 +122,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, LabelTypeEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final LabelTypeEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -132,13 +132,13 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(LabelTypeEditForm form) {
|
||||
public HtmlResponse editagain(final LabelTypeEditForm form) {
|
||||
return asHtml(path_AdminLabeltype_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(LabelTypeEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final LabelTypeEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadLabelType(form);
|
||||
return asHtml(path_AdminLabeltype_EditJsp);
|
||||
|
@ -146,7 +146,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, LabelTypeEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final LabelTypeEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -156,7 +156,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(LabelTypeEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final LabelTypeEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadLabelType(form);
|
||||
return asHtml(path_AdminLabeltype_ConfirmJsp);
|
||||
|
@ -166,7 +166,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, LabelTypeEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final LabelTypeEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -176,14 +176,14 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(LabelTypeEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final LabelTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminLabeltype_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(LabelTypeEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final LabelTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminLabeltype_ConfirmJsp);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(LabelTypeEditForm form) {
|
||||
public HtmlResponse create(final LabelTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
labelTypeService.store(createLabelType(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -202,7 +202,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(LabelTypeEditForm form) {
|
||||
public HtmlResponse update(final LabelTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
labelTypeService.store(createLabelType(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -210,7 +210,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(LabelTypeEditForm form) {
|
||||
public HtmlResponse delete(final LabelTypeEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
labelTypeService.delete(getLabelType(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -220,11 +220,11 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadLabelType(LabelTypeEditForm form) {
|
||||
protected void loadLabelType(final LabelTypeEditForm form) {
|
||||
copyBeanToBean(getLabelType(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected LabelType getLabelType(LabelTypeEditForm form) {
|
||||
protected LabelType getLabelType(final LabelTypeEditForm form) {
|
||||
final LabelType labelType = labelTypeService.getLabelType(createKeyMap(form));
|
||||
if (labelType == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -232,7 +232,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
return labelType;
|
||||
}
|
||||
|
||||
protected LabelType createLabelType(LabelTypeEditForm form) {
|
||||
protected LabelType createLabelType(final LabelTypeEditForm form) {
|
||||
LabelType labelType;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -249,7 +249,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
return labelType;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(LabelTypeEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final LabelTypeEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -258,7 +258,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(LabelTypeEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final LabelTypeEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -54,7 +54,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("overlappingHost"));
|
||||
}
|
||||
|
@ -63,14 +63,14 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(OverlappingHostSearchForm form) {
|
||||
public HtmlResponse index(final OverlappingHostSearchForm form) {
|
||||
return asHtml(path_AdminOverlappinghost_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, OverlappingHostSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final OverlappingHostSearchForm form) {
|
||||
overlappingHostPager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminOverlappinghost_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -78,7 +78,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(OverlappingHostSearchForm form) {
|
||||
public HtmlResponse search(final OverlappingHostSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, overlappingHostPager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminOverlappinghost_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -86,7 +86,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(OverlappingHostSearchForm form) {
|
||||
public HtmlResponse reset(final OverlappingHostSearchForm form) {
|
||||
overlappingHostPager.clear();
|
||||
return asHtml(path_AdminOverlappinghost_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -94,13 +94,13 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(OverlappingHostSearchForm form) {
|
||||
public HtmlResponse back(final OverlappingHostSearchForm form) {
|
||||
return asHtml(path_AdminOverlappinghost_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, OverlappingHostSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final OverlappingHostSearchForm form) {
|
||||
data.register("overlappingHostItems", overlappingHostService.getOverlappingHostList(overlappingHostPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -115,7 +115,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(OverlappingHostEditForm form) {
|
||||
public HtmlResponse createpage(final OverlappingHostEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminOverlappinghost_EditJsp);
|
||||
|
@ -123,7 +123,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, OverlappingHostEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final OverlappingHostEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -133,13 +133,13 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(OverlappingHostEditForm form) {
|
||||
public HtmlResponse editagain(final OverlappingHostEditForm form) {
|
||||
return asHtml(path_AdminOverlappinghost_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(OverlappingHostEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final OverlappingHostEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadOverlappingHost(form);
|
||||
return asHtml(path_AdminOverlappinghost_EditJsp);
|
||||
|
@ -147,7 +147,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, OverlappingHostEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final OverlappingHostEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -157,7 +157,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(OverlappingHostEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final OverlappingHostEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadOverlappingHost(form);
|
||||
return asHtml(path_AdminOverlappinghost_ConfirmJsp);
|
||||
|
@ -167,7 +167,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, OverlappingHostEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final OverlappingHostEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -177,14 +177,14 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(OverlappingHostEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final OverlappingHostEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminOverlappinghost_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(OverlappingHostEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final OverlappingHostEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminOverlappinghost_ConfirmJsp);
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(OverlappingHostEditForm form) {
|
||||
public HtmlResponse create(final OverlappingHostEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
overlappingHostService.store(createOverlappingHost(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -203,7 +203,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(OverlappingHostEditForm form) {
|
||||
public HtmlResponse update(final OverlappingHostEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
overlappingHostService.store(createOverlappingHost(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -211,7 +211,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(OverlappingHostEditForm form) {
|
||||
public HtmlResponse delete(final OverlappingHostEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
overlappingHostService.delete(getOverlappingHost(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -221,11 +221,11 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadOverlappingHost(OverlappingHostEditForm form) {
|
||||
protected void loadOverlappingHost(final OverlappingHostEditForm form) {
|
||||
copyBeanToBean(getOverlappingHost(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected OverlappingHost getOverlappingHost(OverlappingHostEditForm form) {
|
||||
protected OverlappingHost getOverlappingHost(final OverlappingHostEditForm form) {
|
||||
final OverlappingHost overlappingHost = overlappingHostService.getOverlappingHost(createKeyMap(form));
|
||||
if (overlappingHost == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -233,7 +233,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
return overlappingHost;
|
||||
}
|
||||
|
||||
protected OverlappingHost createOverlappingHost(OverlappingHostEditForm form) {
|
||||
protected OverlappingHost createOverlappingHost(final OverlappingHostEditForm form) {
|
||||
OverlappingHost overlappingHost;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -250,7 +250,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
return overlappingHost;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(OverlappingHostEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final OverlappingHostEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -259,7 +259,7 @@ public class AdminOverlappinghostAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(OverlappingHostEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final OverlappingHostEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("pathMapping"));
|
||||
}
|
||||
|
@ -62,14 +62,14 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(PathMappingSearchForm form) {
|
||||
public HtmlResponse index(final PathMappingSearchForm form) {
|
||||
return asHtml(path_AdminPathmapping_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, PathMappingSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final PathMappingSearchForm form) {
|
||||
pathMappingPager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminPathmapping_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -77,7 +77,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(PathMappingSearchForm form) {
|
||||
public HtmlResponse search(final PathMappingSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, pathMappingPager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminPathmapping_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -85,7 +85,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(PathMappingSearchForm form) {
|
||||
public HtmlResponse reset(final PathMappingSearchForm form) {
|
||||
pathMappingPager.clear();
|
||||
return asHtml(path_AdminPathmapping_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -93,13 +93,13 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(PathMappingSearchForm form) {
|
||||
public HtmlResponse back(final PathMappingSearchForm form) {
|
||||
return asHtml(path_AdminPathmapping_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, PathMappingSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final PathMappingSearchForm form) {
|
||||
data.register("pathMappingItems", pathMappingService.getPathMappingList(pathMappingPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -114,7 +114,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(PathMappingEditForm form) {
|
||||
public HtmlResponse createpage(final PathMappingEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminPathmapping_EditJsp);
|
||||
|
@ -122,7 +122,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, PathMappingEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final PathMappingEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -132,13 +132,13 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(PathMappingEditForm form) {
|
||||
public HtmlResponse editagain(final PathMappingEditForm form) {
|
||||
return asHtml(path_AdminPathmapping_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(PathMappingEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final PathMappingEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadPathMapping(form);
|
||||
return asHtml(path_AdminPathmapping_EditJsp);
|
||||
|
@ -146,7 +146,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, PathMappingEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final PathMappingEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -156,7 +156,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(PathMappingEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final PathMappingEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadPathMapping(form);
|
||||
return asHtml(path_AdminPathmapping_ConfirmJsp);
|
||||
|
@ -166,7 +166,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, PathMappingEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final PathMappingEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -176,14 +176,14 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(PathMappingEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final PathMappingEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminPathmapping_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(PathMappingEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final PathMappingEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminPathmapping_ConfirmJsp);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(PathMappingEditForm form) {
|
||||
public HtmlResponse create(final PathMappingEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
pathMappingService.store(createPathMapping(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -202,7 +202,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(PathMappingEditForm form) {
|
||||
public HtmlResponse update(final PathMappingEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
pathMappingService.store(createPathMapping(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -210,7 +210,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(PathMappingEditForm form) {
|
||||
public HtmlResponse delete(final PathMappingEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
pathMappingService.delete(getPathMapping(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -220,11 +220,11 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadPathMapping(PathMappingEditForm form) {
|
||||
protected void loadPathMapping(final PathMappingEditForm form) {
|
||||
copyBeanToBean(getPathMapping(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected PathMapping getPathMapping(PathMappingEditForm form) {
|
||||
protected PathMapping getPathMapping(final PathMappingEditForm form) {
|
||||
final PathMapping pathMapping = pathMappingService.getPathMapping(createKeyMap(form));
|
||||
if (pathMapping == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -232,7 +232,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
return pathMapping;
|
||||
}
|
||||
|
||||
protected PathMapping createPathMapping(PathMappingEditForm form) {
|
||||
protected PathMapping createPathMapping(final PathMappingEditForm form) {
|
||||
PathMapping pathMapping;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -249,7 +249,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
return pathMapping;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(PathMappingEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final PathMappingEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -258,7 +258,7 @@ public class AdminPathmappingAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(PathMappingEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final PathMappingEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("requestHeader"));
|
||||
}
|
||||
|
@ -62,14 +62,14 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(RequestHeaderSearchForm form) {
|
||||
public HtmlResponse index(final RequestHeaderSearchForm form) {
|
||||
return asHtml(path_AdminRequestheader_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, RequestHeaderSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final RequestHeaderSearchForm form) {
|
||||
requestHeaderPager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminRequestheader_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -77,7 +77,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(RequestHeaderSearchForm form) {
|
||||
public HtmlResponse search(final RequestHeaderSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, requestHeaderPager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminRequestheader_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -85,7 +85,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(RequestHeaderSearchForm form) {
|
||||
public HtmlResponse reset(final RequestHeaderSearchForm form) {
|
||||
requestHeaderPager.clear();
|
||||
return asHtml(path_AdminRequestheader_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -93,13 +93,13 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(RequestHeaderSearchForm form) {
|
||||
public HtmlResponse back(final RequestHeaderSearchForm form) {
|
||||
return asHtml(path_AdminRequestheader_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, RequestHeaderSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final RequestHeaderSearchForm form) {
|
||||
data.register("requestHeaderItems", requestHeaderService.getRequestHeaderList(requestHeaderPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -114,7 +114,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(RequestHeaderEditForm form) {
|
||||
public HtmlResponse createpage(final RequestHeaderEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminRequestheader_EditJsp);
|
||||
|
@ -122,7 +122,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, RequestHeaderEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final RequestHeaderEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -132,13 +132,13 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(RequestHeaderEditForm form) {
|
||||
public HtmlResponse editagain(final RequestHeaderEditForm form) {
|
||||
return asHtml(path_AdminRequestheader_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(RequestHeaderEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final RequestHeaderEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadRequestHeader(form);
|
||||
return asHtml(path_AdminRequestheader_EditJsp);
|
||||
|
@ -146,7 +146,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, RequestHeaderEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final RequestHeaderEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -156,7 +156,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(RequestHeaderEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final RequestHeaderEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadRequestHeader(form);
|
||||
return asHtml(path_AdminRequestheader_ConfirmJsp);
|
||||
|
@ -166,7 +166,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, RequestHeaderEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final RequestHeaderEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -176,14 +176,14 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(RequestHeaderEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final RequestHeaderEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminRequestheader_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(RequestHeaderEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final RequestHeaderEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminRequestheader_ConfirmJsp);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(RequestHeaderEditForm form) {
|
||||
public HtmlResponse create(final RequestHeaderEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
requestHeaderService.store(createRequestHeader(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -202,7 +202,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(RequestHeaderEditForm form) {
|
||||
public HtmlResponse update(final RequestHeaderEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
requestHeaderService.store(createRequestHeader(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -210,7 +210,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(RequestHeaderEditForm form) {
|
||||
public HtmlResponse delete(final RequestHeaderEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
requestHeaderService.delete(getRequestHeader(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -220,11 +220,11 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadRequestHeader(RequestHeaderEditForm form) {
|
||||
protected void loadRequestHeader(final RequestHeaderEditForm form) {
|
||||
copyBeanToBean(getRequestHeader(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected RequestHeader getRequestHeader(RequestHeaderEditForm form) {
|
||||
protected RequestHeader getRequestHeader(final RequestHeaderEditForm form) {
|
||||
final RequestHeader requestHeader = requestHeaderService.getRequestHeader(createKeyMap(form));
|
||||
if (requestHeader == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -232,7 +232,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
return requestHeader;
|
||||
}
|
||||
|
||||
protected RequestHeader createRequestHeader(RequestHeaderEditForm form) {
|
||||
protected RequestHeader createRequestHeader(final RequestHeaderEditForm form) {
|
||||
RequestHeader requestHeader;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -249,7 +249,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
return requestHeader;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(RequestHeaderEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final RequestHeaderEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -258,7 +258,7 @@ public class AdminRequestheaderAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(RequestHeaderEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final RequestHeaderEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -54,7 +54,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("roleType"));
|
||||
}
|
||||
|
@ -63,14 +63,14 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(RoleTypeSearchForm form) {
|
||||
public HtmlResponse index(final RoleTypeSearchForm form) {
|
||||
return asHtml(path_AdminRoletype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, RoleTypeSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final RoleTypeSearchForm form) {
|
||||
roleTypePager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminRoletype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -78,7 +78,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(RoleTypeSearchForm form) {
|
||||
public HtmlResponse search(final RoleTypeSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, roleTypePager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminRoletype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -86,7 +86,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(RoleTypeSearchForm form) {
|
||||
public HtmlResponse reset(final RoleTypeSearchForm form) {
|
||||
roleTypePager.clear();
|
||||
return asHtml(path_AdminRoletype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -94,13 +94,13 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(RoleTypeSearchForm form) {
|
||||
public HtmlResponse back(final RoleTypeSearchForm form) {
|
||||
return asHtml(path_AdminRoletype_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, RoleTypeSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final RoleTypeSearchForm form) {
|
||||
data.register("roleTypeItems", roleTypeService.getRoleTypeList(roleTypePager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -115,14 +115,14 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(RoleTypeEditForm form) {
|
||||
public HtmlResponse createpage(final RoleTypeEditForm form) {
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminRoletype_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, RoleTypeEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final RoleTypeEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -132,13 +132,13 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(RoleTypeEditForm form) {
|
||||
public HtmlResponse editagain(final RoleTypeEditForm form) {
|
||||
return asHtml(path_AdminRoletype_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(RoleTypeEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final RoleTypeEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadRoleType(form);
|
||||
return asHtml(path_AdminRoletype_EditJsp);
|
||||
|
@ -146,7 +146,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, RoleTypeEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final RoleTypeEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -156,7 +156,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(RoleTypeEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final RoleTypeEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadRoleType(form);
|
||||
return asHtml(path_AdminRoletype_ConfirmJsp);
|
||||
|
@ -166,7 +166,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, RoleTypeEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final RoleTypeEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -176,14 +176,14 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(RoleTypeEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final RoleTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminRoletype_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(RoleTypeEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final RoleTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminRoletype_ConfirmJsp);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(RoleTypeEditForm form) {
|
||||
public HtmlResponse create(final RoleTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
roleTypeService.store(createRoleType(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -202,7 +202,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(RoleTypeEditForm form) {
|
||||
public HtmlResponse update(final RoleTypeEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
roleTypeService.store(createRoleType(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -210,7 +210,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(RoleTypeEditForm form) {
|
||||
public HtmlResponse delete(final RoleTypeEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
roleTypeService.delete(getRoleType(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -220,11 +220,11 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadRoleType(RoleTypeEditForm form) {
|
||||
protected void loadRoleType(final RoleTypeEditForm form) {
|
||||
copyBeanToBean(getRoleType(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected RoleType getRoleType(RoleTypeEditForm form) {
|
||||
protected RoleType getRoleType(final RoleTypeEditForm form) {
|
||||
final RoleType roleType = roleTypeService.getRoleType(createKeyMap(form));
|
||||
if (roleType == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -232,7 +232,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
return roleType;
|
||||
}
|
||||
|
||||
protected RoleType createRoleType(RoleTypeEditForm form) {
|
||||
protected RoleType createRoleType(final RoleTypeEditForm form) {
|
||||
RoleType roleType;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -249,7 +249,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
return roleType;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(RoleTypeEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final RoleTypeEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -258,7 +258,7 @@ public class AdminRoletypeAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(RoleTypeEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final RoleTypeEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -63,7 +63,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("scheduledJob"));
|
||||
}
|
||||
|
@ -72,14 +72,14 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(ScheduledjobSearchForm form) {
|
||||
public HtmlResponse index(final ScheduledjobSearchForm form) {
|
||||
return asHtml(path_AdminScheduledjob_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, ScheduledjobSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final ScheduledjobSearchForm form) {
|
||||
scheduledJobPager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminScheduledjob_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -87,7 +87,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(ScheduledjobSearchForm form) {
|
||||
public HtmlResponse search(final ScheduledjobSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, scheduledJobPager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminScheduledjob_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -95,7 +95,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(ScheduledjobSearchForm form) {
|
||||
public HtmlResponse reset(final ScheduledjobSearchForm form) {
|
||||
scheduledJobPager.clear();
|
||||
return asHtml(path_AdminScheduledjob_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -103,13 +103,13 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(ScheduledjobSearchForm form) {
|
||||
public HtmlResponse back(final ScheduledjobSearchForm form) {
|
||||
return asHtml(path_AdminScheduledjob_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, ScheduledjobSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final ScheduledjobSearchForm form) {
|
||||
data.register("scheduledJobItems", scheduledJobService.getScheduledJobList(scheduledJobPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -124,7 +124,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(ScheduledjobEditForm form) {
|
||||
public HtmlResponse createpage(final ScheduledjobEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminScheduledjob_EditJsp);
|
||||
|
@ -132,7 +132,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, ScheduledjobEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final ScheduledjobEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -142,13 +142,13 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(ScheduledjobEditForm form) {
|
||||
public HtmlResponse editagain(final ScheduledjobEditForm form) {
|
||||
return asHtml(path_AdminScheduledjob_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(ScheduledjobEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final ScheduledjobEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadScheduledJob(form);
|
||||
return asHtml(path_AdminScheduledjob_EditJsp);
|
||||
|
@ -156,7 +156,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, ScheduledjobEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final ScheduledjobEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -166,7 +166,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(ScheduledjobEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final ScheduledjobEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadScheduledJob(form);
|
||||
return asHtml(path_AdminScheduledjob_ConfirmJsp);
|
||||
|
@ -176,7 +176,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, ScheduledjobEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final ScheduledjobEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
|
@ -188,7 +188,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(ScheduledjobEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final ScheduledjobEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminScheduledjob_ConfirmJsp).renderWith(data -> {
|
||||
data.register("running", running);
|
||||
|
@ -197,7 +197,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(ScheduledjobEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final ScheduledjobEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminScheduledjob_ConfirmJsp).renderWith(data -> {
|
||||
data.register("running", running);
|
||||
|
@ -209,7 +209,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(ScheduledjobEditForm form) {
|
||||
public HtmlResponse create(final ScheduledjobEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
scheduledJobService.store(createScheduledJob(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -218,7 +218,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(ScheduledjobEditForm form) {
|
||||
public HtmlResponse update(final ScheduledjobEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
scheduledJobService.store(createScheduledJob(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -226,7 +226,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(ScheduledjobEditForm form) {
|
||||
public HtmlResponse delete(final ScheduledjobEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
scheduledJobService.delete(getScheduledJob(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -234,13 +234,13 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse start(ScheduledjobEditForm form) {
|
||||
public HtmlResponse start(final ScheduledjobEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
ScheduledJob scheduledJob = getScheduledJob(form);
|
||||
final ScheduledJob scheduledJob = getScheduledJob(form);
|
||||
try {
|
||||
scheduledJob.start();
|
||||
saveInfo(messages -> messages.addSuccessJobStarted(GLOBAL, scheduledJob.getName()));
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsFailedToStartJob(GLOBAL, scheduledJob.getName());
|
||||
}, toEditHtml());
|
||||
|
@ -249,14 +249,14 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse stop(ScheduledjobEditForm form) {
|
||||
public HtmlResponse stop(final ScheduledjobEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
ScheduledJob scheduledJob = getScheduledJob(form);
|
||||
final ScheduledJob scheduledJob = getScheduledJob(form);
|
||||
try {
|
||||
final JobExecutor jobExecutoer = jobHelper.getJobExecutoer(scheduledJob.getId());
|
||||
jobExecutoer.shutdown();
|
||||
saveInfo(messages -> messages.addSuccessJobStopped(GLOBAL, scheduledJob.getName()));
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsFailedToStopJob(GLOBAL, scheduledJob.getName());
|
||||
}, toEditHtml());
|
||||
|
@ -267,8 +267,8 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadScheduledJob(ScheduledjobEditForm form) {
|
||||
ScheduledJob scheduledJob = getScheduledJob(form);
|
||||
protected void loadScheduledJob(final ScheduledjobEditForm form) {
|
||||
final ScheduledJob scheduledJob = getScheduledJob(form);
|
||||
copyBeanToBean(scheduledJob, form, op -> op.exclude("crudMode"));
|
||||
form.jobLogging = scheduledJob.isLoggingEnabled() ? Constants.ON : null;
|
||||
form.crawler = scheduledJob.isCrawlerJob() ? Constants.ON : null;
|
||||
|
@ -276,7 +276,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
running = scheduledJob.isRunning();
|
||||
}
|
||||
|
||||
protected ScheduledJob getScheduledJob(ScheduledjobEditForm form) {
|
||||
protected ScheduledJob getScheduledJob(final ScheduledjobEditForm form) {
|
||||
final ScheduledJob scheduledJob = scheduledJobService.getScheduledJob(createKeyMap(form));
|
||||
if (scheduledJob == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -284,7 +284,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
return scheduledJob;
|
||||
}
|
||||
|
||||
protected ScheduledJob createScheduledJob(ScheduledjobEditForm form) {
|
||||
protected ScheduledJob createScheduledJob(final ScheduledjobEditForm form) {
|
||||
ScheduledJob scheduledJob;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -304,7 +304,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
return scheduledJob;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(ScheduledjobEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final ScheduledjobEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -313,7 +313,7 @@ public class AdminScheduledjobAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(ScheduledjobEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final ScheduledjobEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink("webConfig"));
|
||||
}
|
||||
|
@ -62,14 +62,14 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(WebConfigSearchForm form) {
|
||||
public HtmlResponse index(final WebConfigSearchForm form) {
|
||||
return asHtml(path_AdminWebconfig_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(Integer pageNumber, WebConfigSearchForm form) {
|
||||
public HtmlResponse list(final Integer pageNumber, final WebConfigSearchForm form) {
|
||||
webConfigPager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminWebconfig_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -77,7 +77,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(WebConfigSearchForm form) {
|
||||
public HtmlResponse search(final WebConfigSearchForm form) {
|
||||
copyBeanToBean(form.searchParams, webConfigPager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminWebconfig_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -85,7 +85,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(WebConfigSearchForm form) {
|
||||
public HtmlResponse reset(final WebConfigSearchForm form) {
|
||||
webConfigPager.clear();
|
||||
return asHtml(path_AdminWebconfig_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
|
@ -93,13 +93,13 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(WebConfigSearchForm form) {
|
||||
public HtmlResponse back(final WebConfigSearchForm form) {
|
||||
return asHtml(path_AdminWebconfig_IndexJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(RenderData data, WebConfigSearchForm form) {
|
||||
protected void searchPaging(final RenderData data, final WebConfigSearchForm form) {
|
||||
data.register("webConfigItems", webConfigService.getWebConfigList(webConfigPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
|
@ -114,7 +114,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
// ----------
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse createpage(WebConfigEditForm form) {
|
||||
public HtmlResponse createpage(final WebConfigEditForm form) {
|
||||
form.initialize();
|
||||
form.crudMode = CommonConstants.CREATE_MODE;
|
||||
return asHtml(path_AdminWebconfig_EditJsp);
|
||||
|
@ -122,7 +122,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editpage(int crudMode, String id, WebConfigEditForm form) {
|
||||
public HtmlResponse editpage(final int crudMode, final String id, final WebConfigEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.EDIT_MODE);
|
||||
|
@ -132,13 +132,13 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editagain(WebConfigEditForm form) {
|
||||
public HtmlResponse editagain(final WebConfigEditForm form) {
|
||||
return asHtml(path_AdminWebconfig_EditJsp);
|
||||
}
|
||||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse editfromconfirm(WebConfigEditForm form) {
|
||||
public HtmlResponse editfromconfirm(final WebConfigEditForm form) {
|
||||
form.crudMode = CommonConstants.EDIT_MODE;
|
||||
loadWebConfig(form);
|
||||
return asHtml(path_AdminWebconfig_EditJsp);
|
||||
|
@ -146,7 +146,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletepage(int crudMode, String id, WebConfigEditForm form) {
|
||||
public HtmlResponse deletepage(final int crudMode, final String id, final WebConfigEditForm form) {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
|
@ -156,7 +156,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
|
||||
@Token(save = true, validate = false)
|
||||
@Execute
|
||||
public HtmlResponse deletefromconfirm(WebConfigEditForm form) {
|
||||
public HtmlResponse deletefromconfirm(final WebConfigEditForm form) {
|
||||
form.crudMode = CommonConstants.DELETE_MODE;
|
||||
loadWebConfig(form);
|
||||
return asHtml(path_AdminWebconfig_ConfirmJsp);
|
||||
|
@ -166,14 +166,14 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
// Confirm
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse confirmpage(int crudMode, String id, WebConfigEditForm form) {
|
||||
public HtmlResponse confirmpage(final int crudMode, final String id, final WebConfigEditForm form) {
|
||||
try {
|
||||
form.crudMode = crudMode;
|
||||
form.id = id;
|
||||
verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
|
||||
loadWebConfig(form);
|
||||
return asHtml(path_AdminWebconfig_ConfirmJsp);
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
return asHtml(path_AdminWebconfig_ConfirmJsp);
|
||||
}
|
||||
|
@ -182,14 +182,14 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromcreate(WebConfigEditForm form) {
|
||||
public HtmlResponse confirmfromcreate(final WebConfigEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminWebconfig_ConfirmJsp);
|
||||
}
|
||||
|
||||
@Token(save = false, validate = true, keep = true)
|
||||
@Execute
|
||||
public HtmlResponse confirmfromupdate(WebConfigEditForm form) {
|
||||
public HtmlResponse confirmfromupdate(final WebConfigEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
return asHtml(path_AdminWebconfig_ConfirmJsp);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
// -------------
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse create(WebConfigEditForm form) {
|
||||
public HtmlResponse create(final WebConfigEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
webConfigService.store(createWebConfig(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
|
@ -208,7 +208,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
|
||||
@Token(save = false, validate = true)
|
||||
@Execute
|
||||
public HtmlResponse update(WebConfigEditForm form) {
|
||||
public HtmlResponse update(final WebConfigEditForm form) {
|
||||
validate(form, messages -> {}, toEditHtml());
|
||||
webConfigService.store(createWebConfig(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
|
@ -216,7 +216,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(WebConfigEditForm form) {
|
||||
public HtmlResponse delete(final WebConfigEditForm form) {
|
||||
verifyCrudMode(form, CommonConstants.DELETE_MODE);
|
||||
webConfigService.delete(getWebConfig(form));
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
|
@ -226,11 +226,11 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected void loadWebConfig(WebConfigEditForm form) {
|
||||
protected void loadWebConfig(final WebConfigEditForm form) {
|
||||
copyBeanToBean(getWebConfig(form), form, op -> op.exclude("crudMode"));
|
||||
}
|
||||
|
||||
protected WebConfig getWebConfig(WebConfigEditForm form) {
|
||||
protected WebConfig getWebConfig(final WebConfigEditForm form) {
|
||||
final WebConfig webConfig = webConfigService.getWebConfig(createKeyMap(form));
|
||||
if (webConfig == null) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
|
||||
|
@ -238,7 +238,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
return webConfig;
|
||||
}
|
||||
|
||||
protected WebConfig createWebConfig(WebConfigEditForm form) {
|
||||
protected WebConfig createWebConfig(final WebConfigEditForm form) {
|
||||
WebConfig webConfig;
|
||||
final String username = systemHelper.getUsername();
|
||||
final long currentTime = systemHelper.getCurrentTimeAsLong();
|
||||
|
@ -255,7 +255,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
return webConfig;
|
||||
}
|
||||
|
||||
protected Map<String, String> createKeyMap(WebConfigEditForm form) {
|
||||
protected Map<String, String> createKeyMap(final WebConfigEditForm form) {
|
||||
final Map<String, String> keys = new HashMap<String, String>();
|
||||
keys.put("id", form.id);
|
||||
return keys;
|
||||
|
@ -264,7 +264,7 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(WebConfigEditForm form, int expectedMode) {
|
||||
protected void verifyCrudMode(final WebConfigEditForm form, final int expectedMode) {
|
||||
if (form.crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
|
||||
|
|
|
@ -43,17 +43,17 @@ public abstract class FessAdminAction extends FessBaseAction {
|
|||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void saveInfo(VaMessenger<FessMessages> validationMessagesLambda) {
|
||||
FessMessages messages = createMessages();
|
||||
protected void saveInfo(final VaMessenger<FessMessages> validationMessagesLambda) {
|
||||
final FessMessages messages = createMessages();
|
||||
validationMessagesLambda.message(messages);
|
||||
sessionManager.info().save(messages);
|
||||
}
|
||||
|
||||
protected void write(String path, byte[] data) {
|
||||
protected void write(final String path, final byte[] data) {
|
||||
LdiFileUtil.write(path, data);
|
||||
}
|
||||
|
||||
protected void copyBeanToBean(Object src, Object dest, Consumer<CopyOptions> option) {
|
||||
protected void copyBeanToBean(final Object src, final Object dest, final Consumer<CopyOptions> option) {
|
||||
BeanUtil.copyBeanToBean(src, dest, option);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,28 +74,28 @@ public abstract class FessBaseAction extends TypicalAction // has several interf
|
|||
// to suppress unexpected override by sub-class
|
||||
// you should remove the 'final' if you need to override this
|
||||
@Override
|
||||
public final ActionResponse godHandPrologue(ActionRuntime runtime) {
|
||||
public final ActionResponse godHandPrologue(final ActionRuntime runtime) {
|
||||
return super.godHandPrologue(runtime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ActionResponse godHandMonologue(ActionRuntime runtime) {
|
||||
public final ActionResponse godHandMonologue(final ActionRuntime runtime) {
|
||||
return super.godHandMonologue(runtime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void godHandEpilogue(ActionRuntime runtime) {
|
||||
public final void godHandEpilogue(final ActionRuntime runtime) {
|
||||
super.godHandEpilogue(runtime);
|
||||
}
|
||||
|
||||
// #app_customize you can customize the action hook
|
||||
@Override
|
||||
public ActionResponse hookBefore(ActionRuntime runtime) { // application may override
|
||||
public ActionResponse hookBefore(final ActionRuntime runtime) { // application may override
|
||||
return super.hookBefore(runtime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hookFinally(ActionRuntime runtime) {
|
||||
public void hookFinally(final ActionRuntime runtime) {
|
||||
super.hookFinally(runtime);
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public abstract class FessSearchAction extends FessBaseAction {
|
|||
protected boolean favoriteSupport;
|
||||
|
||||
@Override
|
||||
public ActionResponse hookBefore(ActionRuntime runtime) { // application may override
|
||||
public ActionResponse hookBefore(final ActionRuntime runtime) { // application may override
|
||||
searchLogSupport = Constants.TRUE.equals(crawlerProperties.getProperty(Constants.SEARCH_LOG_PROPERTY, Constants.TRUE));
|
||||
favoriteSupport = Constants.TRUE.equals(crawlerProperties.getProperty(Constants.USER_FAVORITE_PROPERTY, Constants.FALSE));
|
||||
runtime.registerData("searchLogSupport", searchLogSupport);
|
||||
|
@ -102,12 +102,12 @@ public abstract class FessSearchAction extends FessBaseAction {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void setupHtmlData(ActionRuntime runtime) {
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("osddLink", openSearchHelper.hasOpenSearchFile());
|
||||
runtime.registerData("helpPage", viewHelper.getPagePath("common/help"));
|
||||
|
||||
List<Map<String, String>> labelTypeItems = labelTypeHelper.getLabelTypeItemList();
|
||||
final List<Map<String, String>> labelTypeItems = labelTypeHelper.getLabelTypeItemList();
|
||||
runtime.registerData("labelTypeItems", labelTypeItems);
|
||||
runtime.registerData("displayLabelTypeItems", labelTypeItems != null && !labelTypeItems.isEmpty());
|
||||
|
||||
|
@ -135,9 +135,9 @@ public abstract class FessSearchAction extends FessBaseAction {
|
|||
}
|
||||
}
|
||||
|
||||
protected void buildLabelParams(SearchParamMap fields) {
|
||||
protected void buildLabelParams(final SearchParamMap fields) {
|
||||
// label
|
||||
List<Map<String, String>> labelTypeItems = labelTypeHelper.getLabelTypeItemList();
|
||||
final List<Map<String, String>> labelTypeItems = labelTypeHelper.getLabelTypeItemList();
|
||||
|
||||
if (!labelTypeItems.isEmpty() && !fields.containsKey(FessSearchAction.LABEL_FIELD)) {
|
||||
final String defaultLabelValue = crawlerProperties.getProperty(Constants.DEFAULT_LABEL_VALUE_PROPERTY, StringUtil.EMPTY);
|
||||
|
|
|
@ -49,7 +49,7 @@ public class FessLoginAssist extends TypicalLoginAssist<String, FessUserBean, Ob
|
|||
// Find User
|
||||
// =========
|
||||
@Override
|
||||
protected boolean doCheckUserLoginable(String email, String cipheredPassword) {
|
||||
protected boolean doCheckUserLoginable(final String email, final String cipheredPassword) {
|
||||
//return memberBhv.selectCount(cb -> {
|
||||
// cb.query().arrangeLogin(email, cipheredPassword);
|
||||
//}) > 0;
|
||||
|
@ -57,7 +57,7 @@ public class FessLoginAssist extends TypicalLoginAssist<String, FessUserBean, Ob
|
|||
}
|
||||
|
||||
@Override
|
||||
protected OptionalEntity<Object> doFindLoginUser(String email, String cipheredPassword) {
|
||||
protected OptionalEntity<Object> doFindLoginUser(final String email, final String cipheredPassword) {
|
||||
//return memberBhv.selectEntity(cb -> {
|
||||
// cb.query().arrangeLogin(email, cipheredPassword);
|
||||
//});
|
||||
|
@ -65,7 +65,7 @@ public class FessLoginAssist extends TypicalLoginAssist<String, FessUserBean, Ob
|
|||
}
|
||||
|
||||
@Override
|
||||
protected OptionalEntity<Object> doFindLoginUser(String userId) {
|
||||
protected OptionalEntity<Object> doFindLoginUser(final String userId) {
|
||||
//return memberBhv.selectEntity(cb -> {
|
||||
// cb.query().arrangeLoginByIdentity(userId);
|
||||
//});
|
||||
|
@ -76,7 +76,7 @@ public class FessLoginAssist extends TypicalLoginAssist<String, FessUserBean, Ob
|
|||
// Login Process
|
||||
// =============
|
||||
@Override
|
||||
protected FessUserBean createUserBean(Object userEntity) {
|
||||
protected FessUserBean createUserBean(final Object userEntity) {
|
||||
return new FessUserBean();
|
||||
}
|
||||
|
||||
|
@ -88,17 +88,17 @@ public class FessLoginAssist extends TypicalLoginAssist<String, FessUserBean, Ob
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void saveLoginHistory(Object member, FessUserBean userBean, LoginSpecifiedOption option) {
|
||||
protected void saveLoginHistory(final Object member, final FessUserBean userBean, final LoginSpecifiedOption option) {
|
||||
asyncManager.async(() -> {
|
||||
insertLogin(member);
|
||||
});
|
||||
}
|
||||
|
||||
protected void insertLogin(Object member) {
|
||||
protected void insertLogin(final Object member) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkPermission(LoginHandlingResource resource) throws LoginRequiredException {
|
||||
protected void checkPermission(final LoginHandlingResource resource) throws LoginRequiredException {
|
||||
super.checkPermission(resource);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class HelpAction extends FessSearchAction {
|
|||
// ==============
|
||||
|
||||
@Execute
|
||||
public HtmlResponse help(HelpForm form) {
|
||||
public HtmlResponse help(final HelpForm form) {
|
||||
return asHtml(path_HelpJsp).renderWith(data -> {
|
||||
buildLabelParams(form.fields);
|
||||
buildInitParams();
|
||||
|
|
|
@ -40,7 +40,7 @@ public class OsddAction extends FessSearchAction {
|
|||
// ==============
|
||||
|
||||
@Execute
|
||||
public HtmlResponse osdd(OsddForm form) {
|
||||
public HtmlResponse osdd(final OsddForm form) {
|
||||
searchAvailable();
|
||||
openSearchHelper.write(LaResponseUtil.getResponse());
|
||||
return null;
|
||||
|
|
|
@ -84,7 +84,7 @@ public class SearchAction extends FessSearchAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(SearchForm form) {
|
||||
public HtmlResponse search(final SearchForm form) {
|
||||
if (viewHelper.isUseSession() && StringUtil.isNotBlank(form.num)) {
|
||||
normalizePageNum(form);
|
||||
final HttpSession session = request.getSession();
|
||||
|
@ -97,21 +97,21 @@ public class SearchAction extends FessSearchAction {
|
|||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse prev(SearchForm form) {
|
||||
public HtmlResponse prev(final SearchForm form) {
|
||||
return doMove(form, -1);
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse next(SearchForm form) {
|
||||
public HtmlResponse next(final SearchForm form) {
|
||||
return doMove(form, 1);
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse move(SearchForm form) {
|
||||
public HtmlResponse move(final SearchForm form) {
|
||||
return doMove(form, 0);
|
||||
}
|
||||
|
||||
protected HtmlResponse doSearch(SearchForm form) {
|
||||
protected HtmlResponse doSearch(final SearchForm form) {
|
||||
searchAvailable();
|
||||
|
||||
if (viewHelper.isUseSession()) {
|
||||
|
@ -151,7 +151,7 @@ public class SearchAction extends FessSearchAction {
|
|||
});
|
||||
}
|
||||
|
||||
protected HtmlResponse doMove(SearchForm form, final int move) {
|
||||
protected HtmlResponse doMove(final SearchForm form, final int move) {
|
||||
int pageNum = getDefaultPageSize();
|
||||
if (StringUtil.isBlank(form.num)) {
|
||||
form.num = String.valueOf(getDefaultPageSize());
|
||||
|
@ -181,7 +181,7 @@ public class SearchAction extends FessSearchAction {
|
|||
return doSearch(form);
|
||||
}
|
||||
|
||||
protected String doSearchInternal(RenderData data, SearchForm form) {
|
||||
protected String doSearchInternal(final RenderData data, final SearchForm form) {
|
||||
final StringBuilder queryBuf = new StringBuilder(255);
|
||||
if (StringUtil.isNotBlank(form.query)) {
|
||||
queryBuf.append(form.query);
|
||||
|
@ -436,7 +436,7 @@ public class SearchAction extends FessSearchAction {
|
|||
}
|
||||
}
|
||||
|
||||
protected void updateSearchParams(SearchForm form) {
|
||||
protected void updateSearchParams(final SearchForm form) {
|
||||
if (form.facet == null) {
|
||||
form.facet = queryHelper.getDefaultFacetInfo();
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ public class SearchAction extends FessSearchAction {
|
|||
}
|
||||
}
|
||||
|
||||
protected String getDisplayQuery(RootForm form, List<Map<String, String>> labelTypeItems) {
|
||||
protected String getDisplayQuery(final RootForm form, final List<Map<String, String>> labelTypeItems) {
|
||||
final StringBuilder buf = new StringBuilder(100);
|
||||
buf.append(form.query);
|
||||
if (!form.fields.isEmpty() && form.fields.containsKey(LABEL_FIELD)) {
|
||||
|
@ -470,7 +470,7 @@ public class SearchAction extends FessSearchAction {
|
|||
return buf.toString();
|
||||
}
|
||||
|
||||
protected void normalizePageNum(RootForm form) {
|
||||
protected void normalizePageNum(final RootForm form) {
|
||||
try {
|
||||
final int num = Integer.parseInt(form.num);
|
||||
if (num > getMaxPageSize()) {
|
||||
|
@ -512,7 +512,7 @@ public class SearchAction extends FessSearchAction {
|
|||
return false;
|
||||
}
|
||||
|
||||
protected String getPagingQuery(SearchForm form) {
|
||||
protected String getPagingQuery(final SearchForm form) {
|
||||
final StringBuilder buf = new StringBuilder(200);
|
||||
if (form.additional != null) {
|
||||
final Set<String> fieldSet = new HashSet<String>();
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.codelibs.fess.entity.GeoInfo;
|
|||
import org.codelibs.fess.entity.PingResponse;
|
||||
import org.codelibs.fess.entity.SearchQuery;
|
||||
import org.codelibs.fess.entity.SearchQuery.SortField;
|
||||
import org.codelibs.fess.helper.QueryHelper;
|
||||
import org.codelibs.fess.solr.FessSolrQueryException;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
|
@ -158,7 +159,7 @@ public class FessEsClient implements Client {
|
|||
|
||||
protected Client client;
|
||||
|
||||
protected String clusterName = "elasticsearch";
|
||||
protected String clusterName = "fess";
|
||||
|
||||
protected Map<String, String> settings;
|
||||
|
||||
|
@ -168,11 +169,11 @@ public class FessEsClient implements Client {
|
|||
|
||||
protected Map<String, List<String>> configListMap = new HashMap<>();
|
||||
|
||||
public void addIndexConfig(String path) {
|
||||
public void addIndexConfig(final String path) {
|
||||
indexConfigList.add(path);
|
||||
}
|
||||
|
||||
public void addConfigFile(String index, String path) {
|
||||
public void addConfigFile(final String index, final String path) {
|
||||
List<String> list = configListMap.get(index);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
|
@ -181,7 +182,7 @@ public class FessEsClient implements Client {
|
|||
list.add(path);
|
||||
}
|
||||
|
||||
public void setSettings(Map<String, String> settings) {
|
||||
public void setSettings(final Map<String, String> settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
|
@ -189,20 +190,24 @@ public class FessEsClient implements Client {
|
|||
return clusterName;
|
||||
}
|
||||
|
||||
public void setClusterName(String clusterName) {
|
||||
public void setClusterName(final String clusterName) {
|
||||
this.clusterName = clusterName;
|
||||
}
|
||||
|
||||
public void setRunner(ElasticsearchClusterRunner runner) {
|
||||
public void setRunner(final ElasticsearchClusterRunner runner) {
|
||||
this.runner = runner;
|
||||
}
|
||||
|
||||
public void addTransportAddress(String host, int port) {
|
||||
public void addTransportAddress(final String host, final int port) {
|
||||
transportAddressList.add(new InetSocketTransportAddress(host, port));
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void open() {
|
||||
final String clusterNameValue = System.getProperty(Constants.FESS_ES_CLUSTER_NAME);
|
||||
if (StringUtil.isNotBlank(clusterNameValue)) {
|
||||
clusterName = clusterNameValue;
|
||||
}
|
||||
final String transportAddressesValue = System.getProperty(Constants.FESS_ES_TRANSPORT_ADDRESSES);
|
||||
if (StringUtil.isNotBlank(transportAddressesValue)) {
|
||||
for (final String transportAddressValue : transportAddressesValue.split(",")) {
|
||||
|
@ -249,6 +254,10 @@ public class FessEsClient implements Client {
|
|||
client = transportClient;
|
||||
}
|
||||
|
||||
if (StringUtil.isBlank(clusterNameValue)) {
|
||||
System.setProperty(Constants.FESS_ES_CLUSTER_NAME, clusterName);
|
||||
}
|
||||
|
||||
if (StringUtil.isBlank(transportAddressesValue)) {
|
||||
final StringBuilder buf = new StringBuilder();
|
||||
for (final TransportAddress transportAddress : transportAddressList) {
|
||||
|
@ -342,7 +351,7 @@ public class FessEsClient implements Client {
|
|||
logger.warn("Failed to create " + configIndex + "/" + configType + " mapping.");
|
||||
}
|
||||
|
||||
String dataPath = indexConfigPath + "/" + configIndex + "/" + configType + ".bulk";
|
||||
final String dataPath = indexConfigPath + "/" + configIndex + "/" + configType + ".bulk";
|
||||
if (ResourceUtil.isExist(dataPath)) {
|
||||
try {
|
||||
final BulkRequestBuilder builder = client.prepareBulk();
|
||||
|
@ -356,16 +365,16 @@ public class FessEsClient implements Client {
|
|||
return StringUtil.EMPTY;
|
||||
}
|
||||
} else if (prev.startsWith("{\"index\":{")) {
|
||||
IndexRequestBuilder requestBuilder = client.prepareIndex(configIndex, configType).setSource(line);
|
||||
final IndexRequestBuilder requestBuilder = client.prepareIndex(configIndex, configType).setSource(line);
|
||||
builder.add(requestBuilder);
|
||||
}
|
||||
return StringUtil.EMPTY;
|
||||
});
|
||||
BulkResponse response = builder.execute().actionGet();
|
||||
final BulkResponse response = builder.execute().actionGet();
|
||||
if (response.hasFailures()) {
|
||||
logger.warn("Failed to register " + dataPath.toString() + ": " + response.buildFailureMessage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Failed to create " + configIndex + "/" + configType + " mapping.");
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +404,7 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
}
|
||||
|
||||
public void deleteByQuery(String index, String type, QueryBuilder queryBuilder) {
|
||||
public void deleteByQuery(final String index, final String type, final QueryBuilder queryBuilder) {
|
||||
try {
|
||||
// TODO replace with deleting bulk ids with scroll/scan
|
||||
client.prepareDeleteByQuery(index).setQuery(queryBuilder).setTypes(type).execute().actionGet().forEach(res -> {
|
||||
|
@ -414,26 +423,59 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
}
|
||||
|
||||
public <T> T search(String index, String type, SearchCondition condition, SearchResult<T> searchResult) {
|
||||
public <T> T get(final String index, final String type, final String id, final SearchCondition<GetRequestBuilder> condition,
|
||||
final SearchResult<T, GetRequestBuilder, GetResponse> searchResult) {
|
||||
final long startTime = System.currentTimeMillis();
|
||||
|
||||
GetResponse response = null;
|
||||
final GetRequestBuilder requestBuilder = client.prepareGet(index, type, id);
|
||||
if (condition.build(requestBuilder)) {
|
||||
|
||||
if (ComponentUtil.hasQueryHelper()) {
|
||||
final QueryHelper queryHelper = ComponentUtil.getQueryHelper();
|
||||
for (final Map.Entry<String, String[]> entry : queryHelper.getQueryParamMap().entrySet()) {
|
||||
requestBuilder.putHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
final Set<Entry<String, String[]>> paramSet = queryHelper.getRequestParameterSet();
|
||||
if (!paramSet.isEmpty()) {
|
||||
for (final Map.Entry<String, String[]> entry : paramSet) {
|
||||
requestBuilder.putHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
response = requestBuilder.execute().actionGet();
|
||||
}
|
||||
final long execTime = System.currentTimeMillis() - startTime;
|
||||
|
||||
return searchResult.build(requestBuilder, execTime, Optional.ofNullable(response));
|
||||
}
|
||||
|
||||
public <T> T search(final String index, final String type, final SearchCondition<SearchRequestBuilder> condition,
|
||||
final SearchResult<T, SearchRequestBuilder, SearchResponse> searchResult) {
|
||||
final long startTime = System.currentTimeMillis();
|
||||
|
||||
SearchResponse searchResponse = null;
|
||||
final SearchRequestBuilder searchRequestBuilder = client.prepareSearch(index).setTypes(type);
|
||||
if (condition.build(searchRequestBuilder)) {
|
||||
|
||||
if (ComponentUtil.getQueryHelper().getTimeAllowed() >= 0) {
|
||||
searchRequestBuilder.setTimeout(TimeValue.timeValueMillis(ComponentUtil.getQueryHelper().getTimeAllowed()));
|
||||
}
|
||||
if (ComponentUtil.hasQueryHelper()) {
|
||||
final QueryHelper queryHelper = ComponentUtil.getQueryHelper();
|
||||
if (queryHelper.getTimeAllowed() >= 0) {
|
||||
searchRequestBuilder.setTimeout(TimeValue.timeValueMillis(queryHelper.getTimeAllowed()));
|
||||
}
|
||||
|
||||
for (final Map.Entry<String, String[]> entry : ComponentUtil.getQueryHelper().getQueryParamMap().entrySet()) {
|
||||
searchRequestBuilder.putHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
final Set<Entry<String, String[]>> paramSet = ComponentUtil.getQueryHelper().getRequestParameterSet();
|
||||
if (!paramSet.isEmpty()) {
|
||||
for (final Map.Entry<String, String[]> entry : paramSet) {
|
||||
for (final Map.Entry<String, String[]> entry : queryHelper.getQueryParamMap().entrySet()) {
|
||||
searchRequestBuilder.putHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
final Set<Entry<String, String[]>> paramSet = queryHelper.getRequestParameterSet();
|
||||
if (!paramSet.isEmpty()) {
|
||||
for (final Map.Entry<String, String[]> entry : paramSet) {
|
||||
searchRequestBuilder.putHeader(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
searchResponse = searchRequestBuilder.execute().actionGet();
|
||||
|
@ -443,13 +485,15 @@ public class FessEsClient implements Client {
|
|||
return searchResult.build(searchRequestBuilder, execTime, Optional.ofNullable(searchResponse));
|
||||
}
|
||||
|
||||
public Optional<Map<String, Object>> getDocument(String index, String type, final SearchCondition condition) {
|
||||
public Optional<Map<String, Object>> getDocument(final String index, final String type,
|
||||
final SearchCondition<SearchRequestBuilder> condition) {
|
||||
return getDocument(index, type, condition, (response, hit) -> {
|
||||
return hit.getSource();
|
||||
});
|
||||
}
|
||||
|
||||
public <T> Optional<T> getDocument(String index, String type, final SearchCondition condition, EntityCreator<T> creator) {
|
||||
public <T> Optional<T> getDocument(final String index, final String type, final SearchCondition<SearchRequestBuilder> condition,
|
||||
final EntityCreator<T, SearchResponse, SearchHit> creator) {
|
||||
return search(index, type, condition, (queryBuilder, execTime, searchResponse) -> {
|
||||
return searchResponse.map(response -> {
|
||||
final SearchHit[] hits = response.getHits().hits();
|
||||
|
@ -461,13 +505,31 @@ public class FessEsClient implements Client {
|
|||
});
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getDocumentList(String index, String type, final SearchCondition condition) {
|
||||
public Optional<Map<String, Object>> getDocument(final String index, final String type, final String id,
|
||||
final SearchCondition<GetRequestBuilder> condition) {
|
||||
return getDocument(index, type, id, condition, (response, result) -> {
|
||||
return response.getSource();
|
||||
});
|
||||
}
|
||||
|
||||
public <T> Optional<T> getDocument(final String index, final String type, final String id,
|
||||
final SearchCondition<GetRequestBuilder> condition, final EntityCreator<T, GetResponse, GetResponse> creator) {
|
||||
return get(index, type, id, condition, (queryBuilder, execTime, getResponse) -> {
|
||||
return getResponse.map(response -> {
|
||||
return creator.build(response, response);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getDocumentList(final String index, final String type,
|
||||
final SearchCondition<SearchRequestBuilder> condition) {
|
||||
return getDocumentList(index, type, condition, (response, hit) -> {
|
||||
return hit.getSource();
|
||||
});
|
||||
}
|
||||
|
||||
public <T> List<T> getDocumentList(String index, String type, final SearchCondition condition, EntityCreator<T> creator) {
|
||||
public <T> List<T> getDocumentList(final String index, final String type, final SearchCondition<SearchRequestBuilder> condition,
|
||||
final EntityCreator<T, SearchResponse, SearchHit> creator) {
|
||||
return search(index, type, condition, (searchRequestBuilder, execTime, searchResponse) -> {
|
||||
final List<T> list = new ArrayList<>();
|
||||
searchResponse.ifPresent(response -> {
|
||||
|
@ -479,7 +541,7 @@ public class FessEsClient implements Client {
|
|||
});
|
||||
}
|
||||
|
||||
public boolean update(String index, String type, String id, String field, Object value) {
|
||||
public boolean update(final String index, final String type, final String id, final String field, final Object value) {
|
||||
try {
|
||||
return client.prepareUpdate(index, type, id).setDoc(field, value).execute().actionGet().isCreated();
|
||||
} catch (final ElasticsearchException e) {
|
||||
|
@ -487,53 +549,53 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
}
|
||||
|
||||
public void refresh(String index) {
|
||||
public void refresh(final String index) {
|
||||
client.admin().indices().prepareRefresh(index).execute(new ActionListener<RefreshResponse>() {
|
||||
@Override
|
||||
public void onResponse(RefreshResponse response) {
|
||||
public void onResponse(final RefreshResponse response) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Refreshed " + index + ".");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable e) {
|
||||
public void onFailure(final Throwable e) {
|
||||
logger.error("Failed to refresh " + index + ".", e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void flush(String index) {
|
||||
public void flush(final String index) {
|
||||
client.admin().indices().prepareFlush(index).execute(new ActionListener<FlushResponse>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(FlushResponse response) {
|
||||
public void onResponse(final FlushResponse response) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Flushed " + index + ".");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable e) {
|
||||
public void onFailure(final Throwable e) {
|
||||
logger.error("Failed to flush " + index + ".", e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void optimize(String index) {
|
||||
public void optimize(final String index) {
|
||||
client.admin().indices().prepareOptimize(index).execute(new ActionListener<OptimizeResponse>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(OptimizeResponse response) {
|
||||
public void onResponse(final OptimizeResponse response) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Optimzed " + index + ".");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable e) {
|
||||
public void onFailure(final Throwable e) {
|
||||
logger.error("Failed to optimze " + index + ".", e);
|
||||
}
|
||||
});
|
||||
|
@ -548,15 +610,14 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
}
|
||||
|
||||
public void addAll(String index, String type, List<Map<String, Object>> docList) {
|
||||
public void addAll(final String index, final String type, final List<Map<String, Object>> docList) {
|
||||
final BulkRequestBuilder bulkRequestBuilder = client.prepareBulk();
|
||||
for (final Map<String, Object> doc : docList) {
|
||||
bulkRequestBuilder.add(client.prepareIndex(index, type).setSource(doc));
|
||||
}
|
||||
final BulkResponse response = bulkRequestBuilder.execute().actionGet();
|
||||
final String failureMessage = response.buildFailureMessage();
|
||||
if (StringUtil.isNotBlank(failureMessage)) {
|
||||
throw new FessEsClientException(failureMessage);
|
||||
if (response.hasFailures()) {
|
||||
throw new FessEsClientException(response.buildFailureMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -570,15 +631,15 @@ public class FessEsClient implements Client {
|
|||
private GeoInfo geoInfo;
|
||||
private FacetInfo facetInfo;
|
||||
|
||||
public static SearchConditionBuilder builder(SearchRequestBuilder searchRequestBuilder) {
|
||||
public static SearchConditionBuilder builder(final SearchRequestBuilder searchRequestBuilder) {
|
||||
return new SearchConditionBuilder(searchRequestBuilder);
|
||||
}
|
||||
|
||||
SearchConditionBuilder(SearchRequestBuilder searchRequestBuilder) {
|
||||
SearchConditionBuilder(final SearchRequestBuilder searchRequestBuilder) {
|
||||
this.searchRequestBuilder = searchRequestBuilder;
|
||||
}
|
||||
|
||||
public SearchConditionBuilder query(String query) {
|
||||
public SearchConditionBuilder query(final String query) {
|
||||
this.query = query;
|
||||
return this;
|
||||
}
|
||||
|
@ -588,27 +649,27 @@ public class FessEsClient implements Client {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SearchConditionBuilder responseFields(String[] responseFields) {
|
||||
public SearchConditionBuilder responseFields(final String[] responseFields) {
|
||||
this.responseFields = responseFields;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchConditionBuilder offset(int offset) {
|
||||
public SearchConditionBuilder offset(final int offset) {
|
||||
this.offset = offset;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchConditionBuilder size(int size) {
|
||||
public SearchConditionBuilder size(final int size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchConditionBuilder geoInfo(GeoInfo geoInfo) {
|
||||
public SearchConditionBuilder geoInfo(final GeoInfo geoInfo) {
|
||||
this.geoInfo = geoInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchConditionBuilder facetInfo(FacetInfo facetInfo) {
|
||||
public SearchConditionBuilder facetInfo(final FacetInfo facetInfo) {
|
||||
this.facetInfo = facetInfo;
|
||||
return this;
|
||||
}
|
||||
|
@ -732,7 +793,7 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean store(String index, String type, Object obj) {
|
||||
public boolean store(final String index, final String type, final Object obj) {
|
||||
final Map<String, Object> source = BeanUtil.copyBeanToNewMap(obj);
|
||||
final String id = (String) source.remove("id");
|
||||
final Long version = (Long) source.remove("version");
|
||||
|
@ -754,30 +815,33 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean delete(String index, String type, String id, long version) {
|
||||
public boolean delete(final String index, final String type, final String id, final long version) {
|
||||
try {
|
||||
final DeleteResponse response =
|
||||
client.prepareDelete(index, type, id).setVersion(version).setRefresh(true).execute().actionGet();
|
||||
final DeleteRequestBuilder builder = client.prepareDelete(index, type, id).setRefresh(true);
|
||||
if (version > 0) {
|
||||
builder.setVersion(version);
|
||||
}
|
||||
final DeleteResponse response = builder.execute().actionGet();
|
||||
return response.isFound();
|
||||
} catch (final ElasticsearchException e) {
|
||||
throw new FessEsClientException("Failed to delete: " + index + "/" + type + "/" + id + "/" + version, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setIndexConfigPath(String indexConfigPath) {
|
||||
public void setIndexConfigPath(final String indexConfigPath) {
|
||||
this.indexConfigPath = indexConfigPath;
|
||||
}
|
||||
|
||||
public interface SearchCondition {
|
||||
boolean build(SearchRequestBuilder searchRequestBuilder);
|
||||
public interface SearchCondition<B> {
|
||||
boolean build(B requestBuilder);
|
||||
}
|
||||
|
||||
public interface SearchResult<T> {
|
||||
T build(SearchRequestBuilder searchRequestBuilder, long execTime, Optional<SearchResponse> searchResponse);
|
||||
public interface SearchResult<T, B, R> {
|
||||
T build(B requestBuilder, long execTime, Optional<R> response);
|
||||
}
|
||||
|
||||
public interface EntityCreator<T> {
|
||||
T build(SearchResponse response, SearchHit hit);
|
||||
public interface EntityCreator<T, R, H> {
|
||||
T build(R response, H hit);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -786,19 +850,19 @@ public class FessEsClient implements Client {
|
|||
|
||||
@Override
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder, Client>> ActionFuture<Response> execute(
|
||||
Action<Request, Response, RequestBuilder, Client> action, Request request) {
|
||||
final Action<Request, Response, RequestBuilder, Client> action, final Request request) {
|
||||
return client.execute(action, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder, Client>> void execute(
|
||||
Action<Request, Response, RequestBuilder, Client> action, Request request, ActionListener<Response> listener) {
|
||||
final Action<Request, Response, RequestBuilder, Client> action, final Request request, final ActionListener<Response> listener) {
|
||||
client.execute(action, request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder, Client>> RequestBuilder prepareExecute(
|
||||
Action<Request, Response, RequestBuilder, Client> action) {
|
||||
final Action<Request, Response, RequestBuilder, Client> action) {
|
||||
return client.prepareExecute(action);
|
||||
}
|
||||
|
||||
|
@ -813,12 +877,12 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<IndexResponse> index(IndexRequest request) {
|
||||
public ActionFuture<IndexResponse> index(final IndexRequest request) {
|
||||
return client.index(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void index(IndexRequest request, ActionListener<IndexResponse> listener) {
|
||||
public void index(final IndexRequest request, final ActionListener<IndexResponse> listener) {
|
||||
client.index(request, listener);
|
||||
}
|
||||
|
||||
|
@ -828,12 +892,12 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<UpdateResponse> update(UpdateRequest request) {
|
||||
public ActionFuture<UpdateResponse> update(final UpdateRequest request) {
|
||||
return client.update(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(UpdateRequest request, ActionListener<UpdateResponse> listener) {
|
||||
public void update(final UpdateRequest request, final ActionListener<UpdateResponse> listener) {
|
||||
client.update(request, listener);
|
||||
}
|
||||
|
||||
|
@ -843,27 +907,27 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public UpdateRequestBuilder prepareUpdate(String index, String type, String id) {
|
||||
public UpdateRequestBuilder prepareUpdate(final String index, final String type, final String id) {
|
||||
return client.prepareUpdate(index, type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexRequestBuilder prepareIndex(String index, String type) {
|
||||
public IndexRequestBuilder prepareIndex(final String index, final String type) {
|
||||
return client.prepareIndex(index, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexRequestBuilder prepareIndex(String index, String type, String id) {
|
||||
public IndexRequestBuilder prepareIndex(final String index, final String type, final String id) {
|
||||
return client.prepareIndex(index, type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<DeleteResponse> delete(DeleteRequest request) {
|
||||
public ActionFuture<DeleteResponse> delete(final DeleteRequest request) {
|
||||
return client.delete(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(DeleteRequest request, ActionListener<DeleteResponse> listener) {
|
||||
public void delete(final DeleteRequest request, final ActionListener<DeleteResponse> listener) {
|
||||
client.delete(request, listener);
|
||||
}
|
||||
|
||||
|
@ -873,17 +937,17 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DeleteRequestBuilder prepareDelete(String index, String type, String id) {
|
||||
public DeleteRequestBuilder prepareDelete(final String index, final String type, final String id) {
|
||||
return client.prepareDelete(index, type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<BulkResponse> bulk(BulkRequest request) {
|
||||
public ActionFuture<BulkResponse> bulk(final BulkRequest request) {
|
||||
return client.bulk(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bulk(BulkRequest request, ActionListener<BulkResponse> listener) {
|
||||
public void bulk(final BulkRequest request, final ActionListener<BulkResponse> listener) {
|
||||
client.bulk(request, listener);
|
||||
}
|
||||
|
||||
|
@ -893,27 +957,27 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<DeleteByQueryResponse> deleteByQuery(DeleteByQueryRequest request) {
|
||||
public ActionFuture<DeleteByQueryResponse> deleteByQuery(final DeleteByQueryRequest request) {
|
||||
return client.deleteByQuery(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByQuery(DeleteByQueryRequest request, ActionListener<DeleteByQueryResponse> listener) {
|
||||
public void deleteByQuery(final DeleteByQueryRequest request, final ActionListener<DeleteByQueryResponse> listener) {
|
||||
client.deleteByQuery(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeleteByQueryRequestBuilder prepareDeleteByQuery(String... indices) {
|
||||
public DeleteByQueryRequestBuilder prepareDeleteByQuery(final String... indices) {
|
||||
return client.prepareDeleteByQuery(indices);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<GetResponse> get(GetRequest request) {
|
||||
public ActionFuture<GetResponse> get(final GetRequest request) {
|
||||
return client.get(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void get(GetRequest request, ActionListener<GetResponse> listener) {
|
||||
public void get(final GetRequest request, final ActionListener<GetResponse> listener) {
|
||||
client.get(request, listener);
|
||||
}
|
||||
|
||||
|
@ -923,7 +987,7 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GetRequestBuilder prepareGet(String index, String type, String id) {
|
||||
public GetRequestBuilder prepareGet(final String index, final String type, final String id) {
|
||||
return client.prepareGet(index, type, id);
|
||||
}
|
||||
|
||||
|
@ -933,17 +997,17 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PutIndexedScriptRequestBuilder preparePutIndexedScript(String scriptLang, String id, String source) {
|
||||
public PutIndexedScriptRequestBuilder preparePutIndexedScript(final String scriptLang, final String id, final String source) {
|
||||
return client.preparePutIndexedScript(scriptLang, id, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteIndexedScript(DeleteIndexedScriptRequest request, ActionListener<DeleteIndexedScriptResponse> listener) {
|
||||
public void deleteIndexedScript(final DeleteIndexedScriptRequest request, final ActionListener<DeleteIndexedScriptResponse> listener) {
|
||||
client.deleteIndexedScript(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<DeleteIndexedScriptResponse> deleteIndexedScript(DeleteIndexedScriptRequest request) {
|
||||
public ActionFuture<DeleteIndexedScriptResponse> deleteIndexedScript(final DeleteIndexedScriptRequest request) {
|
||||
return client.deleteIndexedScript(request);
|
||||
}
|
||||
|
||||
|
@ -953,17 +1017,17 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DeleteIndexedScriptRequestBuilder prepareDeleteIndexedScript(String scriptLang, String id) {
|
||||
public DeleteIndexedScriptRequestBuilder prepareDeleteIndexedScript(final String scriptLang, final String id) {
|
||||
return client.prepareDeleteIndexedScript(scriptLang, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putIndexedScript(PutIndexedScriptRequest request, ActionListener<PutIndexedScriptResponse> listener) {
|
||||
public void putIndexedScript(final PutIndexedScriptRequest request, final ActionListener<PutIndexedScriptResponse> listener) {
|
||||
client.putIndexedScript(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<PutIndexedScriptResponse> putIndexedScript(PutIndexedScriptRequest request) {
|
||||
public ActionFuture<PutIndexedScriptResponse> putIndexedScript(final PutIndexedScriptRequest request) {
|
||||
return client.putIndexedScript(request);
|
||||
}
|
||||
|
||||
|
@ -973,27 +1037,27 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GetIndexedScriptRequestBuilder prepareGetIndexedScript(String scriptLang, String id) {
|
||||
public GetIndexedScriptRequestBuilder prepareGetIndexedScript(final String scriptLang, final String id) {
|
||||
return client.prepareGetIndexedScript(scriptLang, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIndexedScript(GetIndexedScriptRequest request, ActionListener<GetIndexedScriptResponse> listener) {
|
||||
public void getIndexedScript(final GetIndexedScriptRequest request, final ActionListener<GetIndexedScriptResponse> listener) {
|
||||
client.getIndexedScript(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<GetIndexedScriptResponse> getIndexedScript(GetIndexedScriptRequest request) {
|
||||
public ActionFuture<GetIndexedScriptResponse> getIndexedScript(final GetIndexedScriptRequest request) {
|
||||
return client.getIndexedScript(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<MultiGetResponse> multiGet(MultiGetRequest request) {
|
||||
public ActionFuture<MultiGetResponse> multiGet(final MultiGetRequest request) {
|
||||
return client.multiGet(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multiGet(MultiGetRequest request, ActionListener<MultiGetResponse> listener) {
|
||||
public void multiGet(final MultiGetRequest request, final ActionListener<MultiGetResponse> listener) {
|
||||
client.multiGet(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1003,87 +1067,87 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<CountResponse> count(CountRequest request) {
|
||||
public ActionFuture<CountResponse> count(final CountRequest request) {
|
||||
return client.count(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void count(CountRequest request, ActionListener<CountResponse> listener) {
|
||||
public void count(final CountRequest request, final ActionListener<CountResponse> listener) {
|
||||
client.count(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CountRequestBuilder prepareCount(String... indices) {
|
||||
public CountRequestBuilder prepareCount(final String... indices) {
|
||||
return client.prepareCount(indices);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<ExistsResponse> exists(ExistsRequest request) {
|
||||
public ActionFuture<ExistsResponse> exists(final ExistsRequest request) {
|
||||
return client.exists(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exists(ExistsRequest request, ActionListener<ExistsResponse> listener) {
|
||||
public void exists(final ExistsRequest request, final ActionListener<ExistsResponse> listener) {
|
||||
client.exists(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExistsRequestBuilder prepareExists(String... indices) {
|
||||
public ExistsRequestBuilder prepareExists(final String... indices) {
|
||||
return client.prepareExists(indices);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<SuggestResponse> suggest(SuggestRequest request) {
|
||||
public ActionFuture<SuggestResponse> suggest(final SuggestRequest request) {
|
||||
return client.suggest(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void suggest(SuggestRequest request, ActionListener<SuggestResponse> listener) {
|
||||
public void suggest(final SuggestRequest request, final ActionListener<SuggestResponse> listener) {
|
||||
client.suggest(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuggestRequestBuilder prepareSuggest(String... indices) {
|
||||
public SuggestRequestBuilder prepareSuggest(final String... indices) {
|
||||
return client.prepareSuggest(indices);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<SearchResponse> search(SearchRequest request) {
|
||||
public ActionFuture<SearchResponse> search(final SearchRequest request) {
|
||||
return client.search(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void search(SearchRequest request, ActionListener<SearchResponse> listener) {
|
||||
public void search(final SearchRequest request, final ActionListener<SearchResponse> listener) {
|
||||
client.search(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SearchRequestBuilder prepareSearch(String... indices) {
|
||||
public SearchRequestBuilder prepareSearch(final String... indices) {
|
||||
return client.prepareSearch(indices);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<SearchResponse> searchScroll(SearchScrollRequest request) {
|
||||
public ActionFuture<SearchResponse> searchScroll(final SearchScrollRequest request) {
|
||||
return client.searchScroll(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchScroll(SearchScrollRequest request, ActionListener<SearchResponse> listener) {
|
||||
public void searchScroll(final SearchScrollRequest request, final ActionListener<SearchResponse> listener) {
|
||||
client.searchScroll(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SearchScrollRequestBuilder prepareSearchScroll(String scrollId) {
|
||||
public SearchScrollRequestBuilder prepareSearchScroll(final String scrollId) {
|
||||
return client.prepareSearchScroll(scrollId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<MultiSearchResponse> multiSearch(MultiSearchRequest request) {
|
||||
public ActionFuture<MultiSearchResponse> multiSearch(final MultiSearchRequest request) {
|
||||
return client.multiSearch(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multiSearch(MultiSearchRequest request, ActionListener<MultiSearchResponse> listener) {
|
||||
public void multiSearch(final MultiSearchRequest request, final ActionListener<MultiSearchResponse> listener) {
|
||||
client.multiSearch(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1093,27 +1157,27 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<SearchResponse> moreLikeThis(MoreLikeThisRequest request) {
|
||||
public ActionFuture<SearchResponse> moreLikeThis(final MoreLikeThisRequest request) {
|
||||
return client.moreLikeThis(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moreLikeThis(MoreLikeThisRequest request, ActionListener<SearchResponse> listener) {
|
||||
public void moreLikeThis(final MoreLikeThisRequest request, final ActionListener<SearchResponse> listener) {
|
||||
client.moreLikeThis(request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MoreLikeThisRequestBuilder prepareMoreLikeThis(String index, String type, String id) {
|
||||
public MoreLikeThisRequestBuilder prepareMoreLikeThis(final String index, final String type, final String id) {
|
||||
return client.prepareMoreLikeThis(index, type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<TermVectorResponse> termVector(TermVectorRequest request) {
|
||||
public ActionFuture<TermVectorResponse> termVector(final TermVectorRequest request) {
|
||||
return client.termVector(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void termVector(TermVectorRequest request, ActionListener<TermVectorResponse> listener) {
|
||||
public void termVector(final TermVectorRequest request, final ActionListener<TermVectorResponse> listener) {
|
||||
client.termVector(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1123,17 +1187,17 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TermVectorRequestBuilder prepareTermVector(String index, String type, String id) {
|
||||
public TermVectorRequestBuilder prepareTermVector(final String index, final String type, final String id) {
|
||||
return client.prepareTermVector(index, type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<MultiTermVectorsResponse> multiTermVectors(MultiTermVectorsRequest request) {
|
||||
public ActionFuture<MultiTermVectorsResponse> multiTermVectors(final MultiTermVectorsRequest request) {
|
||||
return client.multiTermVectors(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multiTermVectors(MultiTermVectorsRequest request, ActionListener<MultiTermVectorsResponse> listener) {
|
||||
public void multiTermVectors(final MultiTermVectorsRequest request, final ActionListener<MultiTermVectorsResponse> listener) {
|
||||
client.multiTermVectors(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1143,12 +1207,12 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<PercolateResponse> percolate(PercolateRequest request) {
|
||||
public ActionFuture<PercolateResponse> percolate(final PercolateRequest request) {
|
||||
return client.percolate(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void percolate(PercolateRequest request, ActionListener<PercolateResponse> listener) {
|
||||
public void percolate(final PercolateRequest request, final ActionListener<PercolateResponse> listener) {
|
||||
client.percolate(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1158,12 +1222,12 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<MultiPercolateResponse> multiPercolate(MultiPercolateRequest request) {
|
||||
public ActionFuture<MultiPercolateResponse> multiPercolate(final MultiPercolateRequest request) {
|
||||
return client.multiPercolate(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multiPercolate(MultiPercolateRequest request, ActionListener<MultiPercolateResponse> listener) {
|
||||
public void multiPercolate(final MultiPercolateRequest request, final ActionListener<MultiPercolateResponse> listener) {
|
||||
client.multiPercolate(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1173,17 +1237,17 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ExplainRequestBuilder prepareExplain(String index, String type, String id) {
|
||||
public ExplainRequestBuilder prepareExplain(final String index, final String type, final String id) {
|
||||
return client.prepareExplain(index, type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<ExplainResponse> explain(ExplainRequest request) {
|
||||
public ActionFuture<ExplainResponse> explain(final ExplainRequest request) {
|
||||
return client.explain(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explain(ExplainRequest request, ActionListener<ExplainResponse> listener) {
|
||||
public void explain(final ExplainRequest request, final ActionListener<ExplainResponse> listener) {
|
||||
client.explain(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1193,12 +1257,12 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<ClearScrollResponse> clearScroll(ClearScrollRequest request) {
|
||||
public ActionFuture<ClearScrollResponse> clearScroll(final ClearScrollRequest request) {
|
||||
return client.clearScroll(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearScroll(ClearScrollRequest request, ActionListener<ClearScrollResponse> listener) {
|
||||
public void clearScroll(final ClearScrollRequest request, final ActionListener<ClearScrollResponse> listener) {
|
||||
client.clearScroll(request, listener);
|
||||
}
|
||||
|
||||
|
@ -1208,12 +1272,12 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionFuture<FieldStatsResponse> fieldStats(FieldStatsRequest request) {
|
||||
public ActionFuture<FieldStatsResponse> fieldStats(final FieldStatsRequest request) {
|
||||
return client.fieldStats(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fieldStats(FieldStatsRequest request, ActionListener<FieldStatsResponse> listener) {
|
||||
public void fieldStats(final FieldStatsRequest request, final ActionListener<FieldStatsResponse> listener) {
|
||||
client.fieldStats(request, listener);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@ public class FessEsClientException extends FessSystemException {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FessEsClientException(String message, Throwable cause) {
|
||||
public FessEsClientException(final String message, final Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public FessEsClientException(String message) {
|
||||
public FessEsClientException(final String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class UserInfo implements Serializable {
|
|||
return roleSet;
|
||||
}
|
||||
|
||||
public void setRoleSet(Set<String> roleSet) {
|
||||
public void setRoleSet(final Set<String> roleSet) {
|
||||
this.roleSet = roleSet;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class UserInfo implements Serializable {
|
|||
this.username = username;
|
||||
}
|
||||
|
||||
public boolean isUserInRole(String role) {
|
||||
public boolean isUserInRole(final String role) {
|
||||
if (roleSet != null) {
|
||||
return roleSet.contains(role);
|
||||
}
|
||||
|
|
|
@ -227,4 +227,9 @@ public abstract class BsBoostDocumentRuleBhv extends AbstractBehavior<BoostDocum
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsClickLogBhv extends AbstractBehavior<ClickLog, ClickLogC
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,4 +224,9 @@ public abstract class BsCrawlingSessionBhv extends AbstractBehavior<CrawlingSess
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,4 +224,9 @@ public abstract class BsCrawlingSessionInfoBhv extends AbstractBehavior<Crawling
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -230,4 +230,9 @@ public abstract class BsDataConfigBhv extends AbstractBehavior<DataConfig, DataC
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsDataConfigToLabelBhv extends AbstractBehavior<DataConfig
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsDataConfigToRoleBhv extends AbstractBehavior<DataConfigT
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,4 +224,9 @@ public abstract class BsEventLogBhv extends AbstractBehavior<EventLog, EventLogC
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,4 +226,9 @@ public abstract class BsFailureUrlBhv extends AbstractBehavior<FailureUrl, Failu
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsFavoriteLogBhv extends AbstractBehavior<FavoriteLog, Fav
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,4 +231,9 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehavior<FileAuthe
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -237,4 +237,9 @@ public abstract class BsFileConfigBhv extends AbstractBehavior<FileConfig, FileC
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsFileConfigToLabelBhv extends AbstractBehavior<FileConfig
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsFileConfigToRoleBhv extends AbstractBehavior<FileConfigT
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -220,4 +220,9 @@ public abstract class BsGroupBhv extends AbstractBehavior<Group, GroupCB> {
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,4 +227,9 @@ public abstract class BsJobLogBhv extends AbstractBehavior<JobLog, JobLogCB> {
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,4 +227,9 @@ public abstract class BsKeyMatchBhv extends AbstractBehavior<KeyMatch, KeyMatchC
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -221,4 +221,9 @@ public abstract class BsLabelToRoleBhv extends AbstractBehavior<LabelToRole, Lab
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,4 +228,9 @@ public abstract class BsLabelTypeBhv extends AbstractBehavior<LabelType, LabelTy
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,4 +227,9 @@ public abstract class BsOverlappingHostBhv extends AbstractBehavior<OverlappingH
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,4 +227,9 @@ public abstract class BsPathMappingBhv extends AbstractBehavior<PathMapping, Pat
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,4 +226,9 @@ public abstract class BsRequestHeaderBhv extends AbstractBehavior<RequestHeader,
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -220,4 +220,9 @@ public abstract class BsRoleBhv extends AbstractBehavior<Role, RoleCB> {
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,4 +226,9 @@ public abstract class BsRoleTypeBhv extends AbstractBehavior<RoleType, RoleTypeC
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,4 +232,9 @@ public abstract class BsScheduledJobBhv extends AbstractBehavior<ScheduledJob, S
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsSearchFieldLogBhv extends AbstractBehavior<SearchFieldLo
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,4 +231,9 @@ public abstract class BsSearchLogBhv extends AbstractBehavior<SearchLog, SearchL
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,4 +226,9 @@ public abstract class BsSuggestBadWordBhv extends AbstractBehavior<SuggestBadWor
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,4 +229,9 @@ public abstract class BsSuggestElevateWordBhv extends AbstractBehavior<SuggestEl
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,4 +223,9 @@ public abstract class BsUserBhv extends AbstractBehavior<User, UserCB> {
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsUserInfoBhv extends AbstractBehavior<UserInfo, UserInfoC
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,4 +232,9 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehavior<WebAuthent
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,4 +238,9 @@ public abstract class BsWebConfigBhv extends AbstractBehavior<WebConfig, WebConf
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsWebConfigToLabelBhv extends AbstractBehavior<WebConfigTo
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,4 +222,9 @@ public abstract class BsWebConfigToRoleBhv extends AbstractBehavior<WebConfigToR
|
|||
}
|
||||
|
||||
// TODO create, modify, remove
|
||||
|
||||
@Override
|
||||
protected boolean isCompatibleBatchInsertDefaultEveryColumn() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class BoostDocumentRule extends BsBoostDocumentRule {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class BoostDocumentRule extends BsBoostDocumentRule {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class ClickLog extends BsClickLog {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ public class ClickLog extends BsClickLog {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public class CrawlingSession extends BsCrawlingSession {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class CrawlingSession extends BsCrawlingSession {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class CrawlingSessionInfo extends BsCrawlingSessionInfo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class CrawlingSessionInfo extends BsCrawlingSessionInfo {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -367,7 +367,7 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -375,7 +375,7 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class DataConfigToLabel extends BsDataConfigToLabel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class DataConfigToLabel extends BsDataConfigToLabel {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class DataConfigToRole extends BsDataConfigToRole {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class DataConfigToRole extends BsDataConfigToRole {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class FailureUrl extends BsFailureUrl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class FailureUrl extends BsFailureUrl {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class FavoriteLog extends BsFavoriteLog {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class FavoriteLog extends BsFavoriteLog {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public class FileAuthentication extends BsFileAuthentication {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class FileAuthentication extends BsFileAuthentication {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -279,7 +279,7 @@ public class FileConfig extends BsFileConfig implements CrawlingConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ public class FileConfig extends BsFileConfig implements CrawlingConfig {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class FileConfigToLabel extends BsFileConfigToLabel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class FileConfigToLabel extends BsFileConfigToLabel {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class FileConfigToRole extends BsFileConfigToRole {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class FileConfigToRole extends BsFileConfigToRole {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class JobLog extends BsJobLog {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class JobLog extends BsJobLog {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class KeyMatch extends BsKeyMatch {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class KeyMatch extends BsKeyMatch {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class LabelToRole extends BsLabelToRole {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class LabelToRole extends BsLabelToRole {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class LabelType extends BsLabelType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class LabelType extends BsLabelType {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class OverlappingHost extends BsOverlappingHost {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class OverlappingHost extends BsOverlappingHost {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public class PathMapping extends BsPathMapping {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class PathMapping extends BsPathMapping {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ public class RequestHeader extends BsRequestHeader {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class RequestHeader extends BsRequestHeader {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public class RoleType extends BsRoleType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class RoleType extends BsRoleType {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class ScheduledJob extends BsScheduledJob {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class ScheduledJob extends BsScheduledJob {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class SearchFieldLog extends BsSearchFieldLog {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class SearchFieldLog extends BsSearchFieldLog {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class SearchLog extends BsSearchLog {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -40,11 +40,11 @@ public class SearchLog extends BsSearchLog {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
|
||||
public void setClickLogList(List<ClickLog> clickLogList) {
|
||||
public void setClickLogList(final List<ClickLog> clickLogList) {
|
||||
this.clickLogList = clickLogList;
|
||||
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class SearchLog extends BsSearchLog {
|
|||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(OptionalEntity<UserInfo> userInfo) {
|
||||
public void setUserInfo(final OptionalEntity<UserInfo> userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public class SuggestBadWord extends BsSuggestBadWord {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class SuggestBadWord extends BsSuggestBadWord {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class SuggestElevateWord extends BsSuggestElevateWord {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class SuggestElevateWord extends BsSuggestElevateWord {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class UserInfo extends BsUserInfo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class UserInfo extends BsUserInfo {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ public class WebAuthentication extends BsWebAuthentication {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ public class WebAuthentication extends BsWebAuthentication {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -286,7 +286,7 @@ public class WebConfig extends BsWebConfig implements CrawlingConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ public class WebConfig extends BsWebConfig implements CrawlingConfig {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class WebConfigToLabel extends BsWebConfigToLabel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class WebConfigToLabel extends BsWebConfigToLabel {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class WebConfigToRole extends BsWebConfigToRole {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
public void setId(final String id) {
|
||||
asDocMeta().id(id);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class WebConfigToRole extends BsWebConfigToRole {
|
|||
return asDocMeta().version();
|
||||
}
|
||||
|
||||
public void setVersionNo(Long version) {
|
||||
public void setVersionNo(final Long version) {
|
||||
asDocMeta().version(version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,12 +46,12 @@ import org.codelibs.fess.helper.PathMappingHelper;
|
|||
import org.codelibs.fess.helper.WebFsIndexHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.ResourceUtil;
|
||||
import org.codelibs.robot.client.EsClient;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
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;
|
||||
|
@ -172,13 +172,20 @@ public class Crawler implements Serializable {
|
|||
return;
|
||||
}
|
||||
|
||||
final String transportAddresses = System.getProperty(Constants.FESS_ES_TRANSPORT_ADDRESSES);
|
||||
if (StringUtil.isNotBlank(transportAddresses)) {
|
||||
System.setProperty(EsClient.TRANSPORT_ADDRESSES, transportAddresses);
|
||||
}
|
||||
final String clusterName = System.getProperty(Constants.FESS_ES_CLUSTER_NAME);
|
||||
if (StringUtil.isNotBlank(clusterName)) {
|
||||
System.setProperty(EsClient.CLUSTER_NAME, clusterName);
|
||||
}
|
||||
|
||||
int exitCode;
|
||||
try {
|
||||
SingletonLaContainerFactory.setConfigPath("app.xml");
|
||||
SingletonLaContainerFactory.init();
|
||||
|
||||
final LaContainer container = SingletonLaContainerFactory.getContainer();
|
||||
|
||||
final Thread shutdownCallback = new Thread("ShutdownHook") {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
@ -173,7 +173,7 @@ public class AuthFilter implements Filter {
|
|||
protected static class AuthHttpServletRequest extends HttpServletRequestWrapper {
|
||||
protected UserInfo userInfo;
|
||||
|
||||
protected AuthHttpServletRequest(HttpServletRequest request, UserInfo userInfo) {
|
||||
protected AuthHttpServletRequest(final HttpServletRequest request, final UserInfo userInfo) {
|
||||
super(request);
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class AuthFilter implements Filter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isUserInRole(String role) {
|
||||
public boolean isUserInRole(final String role) {
|
||||
return userInfo.isUserInRole(role);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,11 +16,16 @@
|
|||
|
||||
package org.codelibs.fess.helper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.codelibs.fess.client.FessEsClient;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.elasticsearch.action.count.CountResponse;
|
||||
import org.elasticsearch.index.query.FilterBuilders;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -50,252 +55,97 @@ public class IndexingHelper {
|
|||
}
|
||||
|
||||
private void deleteOldDocuments(final FessEsClient fessEsClient, final List<Map<String, Object>> docList) {
|
||||
// TODO move fessEsClient
|
||||
// final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
//
|
||||
// final List<String> docIdList = new ArrayList<String>();
|
||||
// final StringBuilder q = new StringBuilder(1000);
|
||||
// final StringBuilder fq = new StringBuilder(100);
|
||||
// for (final Map<String, Object> inputDoc : docList) {
|
||||
// final Object idValue = inputDoc.get(fieldHelper.idField);
|
||||
// if (idValue == null) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// final Object configIdValue = inputDoc.get(fieldHelper.configIdField);
|
||||
// if (configIdValue == null) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// q.setLength(0);
|
||||
// q.append(fieldHelper.urlField).append(":\"");
|
||||
// q.append(QueryUtil.escapeValue((String)
|
||||
// inputDoc.get(fieldHelper.urlField)));
|
||||
// q.append('"');
|
||||
//
|
||||
// fq.setLength(0);
|
||||
// fq.append(fieldHelper.configIdField).append(':');
|
||||
// fq.append(configIdValue.toString());
|
||||
//
|
||||
// final List<Map<String, Object>> docs =
|
||||
// getSolrDocumentList(fessEsClient, fq.toString(), q.toString(), new
|
||||
// String[] { fieldHelper.idField,
|
||||
// fieldHelper.docIdField });
|
||||
// for (final SolrDocument doc : docs) {
|
||||
// final Object oldIdValue = doc.getFieldValue(fieldHelper.idField);
|
||||
// if (!idValue.equals(oldIdValue) && oldIdValue != null) {
|
||||
// final Object oldDocIdValue =
|
||||
// doc.getFieldValue(fieldHelper.docIdField);
|
||||
// if (oldDocIdValue != null) {
|
||||
// docIdList.add(oldDocIdValue.toString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug(q + " in " + fq + " => " + docs);
|
||||
// }
|
||||
// }
|
||||
// if (!docIdList.isEmpty()) {
|
||||
// deleteDocumentsByDocId(fessEsClient, docIdList);
|
||||
// }
|
||||
}
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
|
||||
public List<Map<String, Object>> getSolrDocumentList(final FessEsClient fessEsClient, final String fq, final String q,
|
||||
final String[] fields) {
|
||||
return getSolrDocumentList(fessEsClient, fq, q, fields, defaultRowSize);
|
||||
}
|
||||
final List<String> docIdList = new ArrayList<>();
|
||||
for (final Map<String, Object> inputDoc : docList) {
|
||||
final Object idValue = inputDoc.get(fieldHelper.idField);
|
||||
if (idValue == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
protected List<Map<String, Object>> getSolrDocumentList(final FessEsClient fessEsClient, final String fq, final String q,
|
||||
final String[] fields, final int row) {
|
||||
// TODO move fessEsClient
|
||||
// final SolrQuery sq = new SolrQuery();
|
||||
// if (fq != null) {
|
||||
// sq.setFilterQueries(fq);
|
||||
// }
|
||||
// sq.setQuery(q);
|
||||
// if (fields != null) {
|
||||
// sq.setFields(fields);
|
||||
// }
|
||||
// sq.setRows(row);
|
||||
// e.
|
||||
// final List<Map<String,Object>> docList =
|
||||
// fessEsClient.query(sq).getResults();
|
||||
// if (docList.getNumFound() <= row) {
|
||||
// return docList;
|
||||
// }
|
||||
// return getSolrDocumentList(fessEsClient, fq, q, fields, (int)
|
||||
// docList.getNumFound());
|
||||
return null;
|
||||
final Object configIdValue = inputDoc.get(fieldHelper.configIdField);
|
||||
if (configIdValue == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final QueryBuilder queryBuilder =
|
||||
QueryBuilders.filteredQuery(QueryBuilders.termQuery(fieldHelper.urlField, inputDoc.get(fieldHelper.urlField)),
|
||||
FilterBuilders.termFilter(fieldHelper.configIdField, configIdValue));
|
||||
|
||||
final List<Map<String, Object>> docs =
|
||||
getDocumentListByQuery(fessEsClient, queryBuilder, new String[] { fieldHelper.idField, fieldHelper.docIdField });
|
||||
for (final Map<String, Object> doc : docs) {
|
||||
final Object oldIdValue = doc.get(fieldHelper.idField);
|
||||
if (!idValue.equals(oldIdValue) && oldIdValue != null) {
|
||||
final Object oldDocIdValue = doc.get(fieldHelper.docIdField);
|
||||
if (oldDocIdValue != null) {
|
||||
docIdList.add(oldDocIdValue.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(queryBuilder.toString() + " => " + docs);
|
||||
}
|
||||
}
|
||||
if (!docIdList.isEmpty()) {
|
||||
fessEsClient.deleteByQuery(fieldHelper.docIndex, fieldHelper.docType,
|
||||
QueryBuilders.idsQuery(fieldHelper.docType).ids(docIdList.stream().toArray(n -> new String[n])));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteDocument(final FessEsClient fessEsClient, final String id) {
|
||||
// TODO move fessEsClient
|
||||
// final long start = System.currentTimeMillis();
|
||||
// final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
// final String query = "{!raw f=" + fieldHelper.idField + "}" + id;
|
||||
// for (int i = 0; i < maxRetryCount; i++) {
|
||||
// boolean done = true;
|
||||
// try {
|
||||
// for (final UpdateResponse response : fessEsClient.deleteByQuery(query)) {
|
||||
// if (response.getStatus() != 0) {
|
||||
// logger.warn("Failed to delete: " + response);
|
||||
// done = false;
|
||||
// }
|
||||
// }
|
||||
// } catch (final Exception e) {
|
||||
// logger.warn("Could not delete a document from Solr." +
|
||||
// " It might be busy. " + "Retrying.. id:" + id + ", cause: "
|
||||
// + e.getMessage());
|
||||
// done = false;
|
||||
// }
|
||||
// if (done) {
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.info("Deleted 1 doc (Solr: " + (System.currentTimeMillis() -
|
||||
// start) + "ms) => id:" + id);
|
||||
// } else {
|
||||
// logger.info("Deleted 1 doc (Solr: " + (System.currentTimeMillis() -
|
||||
// start) + "ms)");
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
// try {
|
||||
// Thread.sleep(requestInterval);
|
||||
// } catch (final InterruptedException e) {}
|
||||
// }
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
fessEsClient.delete(fieldHelper.docIndex, fieldHelper.docType, id, 0);
|
||||
}
|
||||
|
||||
public void deleteDocumentsByDocId(final FessEsClient fessEsClient, final List<String> docIdList) {
|
||||
// TODO move fessEsClient
|
||||
// final long start = System.currentTimeMillis();
|
||||
// final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
// final StringBuilder buf = new StringBuilder(500);
|
||||
// for (final String docId : docIdList) {
|
||||
// if (buf.length() != 0) {
|
||||
// buf.append(" OR ");
|
||||
// }
|
||||
// buf.append(fieldHelper.docIdField).append(':').append(docId);
|
||||
// }
|
||||
// final String query = buf.toString();
|
||||
// for (int i = 0; i < maxRetryCount; i++) {
|
||||
// boolean done = true;
|
||||
// try {
|
||||
// for (final UpdateResponse response : fessEsClient.deleteByQuery(query)) {
|
||||
// if (response.getStatus() != 0) {
|
||||
// logger.warn("Failed to delete: " + response);
|
||||
// done = false;
|
||||
// }
|
||||
// }
|
||||
// } catch (final Exception e) {
|
||||
// logger.warn("Could not delete a document from Solr." +
|
||||
// " It might be busy. " + "Retrying.. id:" + docIdList + ", cause: "
|
||||
// + e.getMessage());
|
||||
// done = false;
|
||||
// }
|
||||
// if (done) {
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.info("Deleted " + docIdList.size() + " docs (Solr: " +
|
||||
// (System.currentTimeMillis() - start) + "ms) => docId:"
|
||||
// + docIdList);
|
||||
// } else {
|
||||
// logger.info("Deleted " + docIdList.size() + " docs (Solr: " +
|
||||
// (System.currentTimeMillis() - start) + "ms)");
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
// try {
|
||||
// Thread.sleep(requestInterval);
|
||||
// } catch (final InterruptedException e) {}
|
||||
// }
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
fessEsClient.deleteByQuery(fieldHelper.docIndex, fieldHelper.docType,
|
||||
QueryBuilders.idsQuery(fieldHelper.docType).ids(docIdList.stream().toArray(n -> new String[n])));
|
||||
}
|
||||
|
||||
public Map<String, Object> getSolrDocument(final FessEsClient fessEsClient, final String id, final String[] fields) {
|
||||
// TODO move fessEsClient
|
||||
// final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
//
|
||||
// final SolrQuery solrQuery = new SolrQuery();
|
||||
// final StringBuilder queryBuf = new StringBuilder(500);
|
||||
// queryBuf.append("{!raw f=").append(fieldHelper.idField).append("}");
|
||||
// queryBuf.append(id);
|
||||
// solrQuery.setQuery(queryBuf.toString());
|
||||
// if (fields != null) {
|
||||
// solrQuery.setFields(fields);
|
||||
// }
|
||||
// final QueryResponse response = fessEsClient.query(solrQuery);
|
||||
// final List<Map<String, Object>> docList = response.getResults();
|
||||
// if (docList.isEmpty()) {
|
||||
// return null;
|
||||
// }
|
||||
// if (docList.size() > 1) {
|
||||
// logger.error("Invalid multiple docs for " + id);
|
||||
// for (final SolrDocument doc : docList) {
|
||||
// final Object idValue = doc.getFieldValue(fieldHelper.idField);
|
||||
// if (idValue != null) {
|
||||
// deleteDocument(fessEsClient, idValue.toString());
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
// return docList.get(0);
|
||||
return null;
|
||||
public Map<String, Object> getDocument(final FessEsClient fessEsClient, final String id, final String[] fields) {
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
return fessEsClient.getDocument(fieldHelper.docIndex, fieldHelper.docType, id, requestBuilder -> {
|
||||
return true;
|
||||
}).orElseGet(() -> null);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getSolrDocumentListByPrefixId(final FessEsClient fessEsClient, final String id, final String[] fields) {
|
||||
// TODO move fessEsClient
|
||||
// final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
// final SolrQuery solrQuery = new SolrQuery();
|
||||
// final StringBuilder queryBuf = new StringBuilder(500);
|
||||
// queryBuf.append("{!prefix f=").append(fieldHelper.idField).append("}");
|
||||
// queryBuf.append(id);
|
||||
// solrQuery.setQuery(queryBuf.toString());
|
||||
// if (fields != null) {
|
||||
// solrQuery.setFields(fields);
|
||||
// }
|
||||
// final QueryResponse response = fessEsClient.query(solrQuery);
|
||||
// final List<Map<String, Object>> docList = response.getResults();
|
||||
// if (docList.isEmpty()) {
|
||||
// return null;
|
||||
// }
|
||||
// if (logger.isDebugEnabled()) {
|
||||
// logger.debug("Found solr documents: " + docList);
|
||||
// }
|
||||
// return docList;
|
||||
return null;
|
||||
public List<Map<String, Object>> getDocumentListByPrefixId(final FessEsClient fessEsClient, final String id, final String[] fields) {
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
final QueryBuilder queryBuilder = QueryBuilders.prefixQuery(fieldHelper.idField, id);
|
||||
return getDocumentListByQuery(fessEsClient, queryBuilder, fields);
|
||||
}
|
||||
|
||||
public void deleteChildSolrDocument(final FessEsClient fessEsClient, final String id) {
|
||||
// TODO move fessEsClient
|
||||
// final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
// final String query = "{!raw f=" + fieldHelper.parentIdField + " v=\""
|
||||
// + id + "\"}";
|
||||
// for (final UpdateResponse response : fessEsClient.deleteByQuery(query)) {
|
||||
// if (response.getStatus() != 0) {
|
||||
// logger.warn("Failed to delete: " + response);
|
||||
// }
|
||||
// }
|
||||
public void deleteChildDocument(final FessEsClient fessEsClient, final String id) {
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
fessEsClient.deleteByQuery(fieldHelper.docIndex, fieldHelper.docType, QueryBuilders.termQuery(fieldHelper.parentIdField, id));
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getChildSolrDocumentList(final FessEsClient fessEsClient, final String id, final String[] fields) {
|
||||
return getChildSolrDocumentList(fessEsClient, id, fields, defaultRowSize);
|
||||
public List<Map<String, Object>> getChildDocumentList(final FessEsClient fessEsClient, final String id, final String[] fields) {
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
final QueryBuilder queryBuilder = QueryBuilders.termQuery(fieldHelper.parentIdField, id);
|
||||
return getDocumentListByQuery(fessEsClient, queryBuilder, fields);
|
||||
}
|
||||
|
||||
protected List<Map<String, Object>> getChildSolrDocumentList(final FessEsClient fessEsClient, final String id, final String[] fields,
|
||||
final int row) {
|
||||
// TODO move fessEsClient
|
||||
// final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
// final SolrQuery solrQuery = new SolrQuery();
|
||||
// solrQuery.setQuery("{!raw f=" + fieldHelper.parentIdField + " v=\"" +
|
||||
// id + "\"}");
|
||||
// if (fields != null) {
|
||||
// solrQuery.setFields(fields);
|
||||
// }
|
||||
// solrQuery.setRows(row);
|
||||
// final List<Map<String,Object>> docList =
|
||||
// fessEsClient.query(solrQuery).getResults();
|
||||
// if (docList.getNumFound() <= row) {
|
||||
// return docList;
|
||||
// }
|
||||
// return getChildSolrDocumentList(fessEsClient, id, fields, (int)
|
||||
// docList.getNumFound());
|
||||
return null;
|
||||
protected List<Map<String, Object>> getDocumentListByQuery(final FessEsClient fessEsClient, final QueryBuilder queryBuilder,
|
||||
final String[] fields) {
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
|
||||
final CountResponse countResponse =
|
||||
fessEsClient.prepareCount(fieldHelper.docIndex).setTypes(fieldHelper.docType).setQuery(queryBuilder).execute().actionGet();
|
||||
final long numFound = countResponse.getCount();
|
||||
// TODO max threshold
|
||||
|
||||
return fessEsClient.getDocumentList(fieldHelper.docIndex, fieldHelper.docType, requestBuilder -> {
|
||||
requestBuilder.setQuery(queryBuilder).setSize((int) numFound);
|
||||
if (fields != null) {
|
||||
requestBuilder.addFields(fields);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
|
@ -86,7 +86,7 @@ public abstract class SearchLogHelper {
|
|||
|
||||
protected abstract void processClickLogQueue(Queue<ClickLog> queue);
|
||||
|
||||
public boolean addfavoriteLog(String userCode, String favoriteUrl) {
|
||||
public boolean addfavoriteLog(final String userCode, final String favoriteUrl) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,8 @@ public class CrawlJob {
|
|||
|
||||
protected long retryIntervalToDeleteTempDir = 5000;
|
||||
|
||||
protected boolean useLocaleElasticsearch = true;
|
||||
|
||||
public CrawlJob jobExecutor(final JobExecutor jobExecutor) {
|
||||
this.jobExecutor = jobExecutor;
|
||||
return this;
|
||||
|
@ -110,9 +112,15 @@ public class CrawlJob {
|
|||
return this;
|
||||
}
|
||||
|
||||
public void retryToDeleteTempDir(final int retryCount, final long retryInterval) {
|
||||
public CrawlJob retryToDeleteTempDir(final int retryCount, final long retryInterval) {
|
||||
retryCountToDeleteTempDir = retryCount;
|
||||
retryIntervalToDeleteTempDir = retryInterval;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CrawlJob useLocaleElasticsearch(final boolean useLocaleElasticsearch) {
|
||||
this.useLocaleElasticsearch = useLocaleElasticsearch;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String execute(final JobExecutor jobExecutor) {
|
||||
|
@ -250,9 +258,15 @@ public class CrawlJob {
|
|||
}
|
||||
crawlerCmdList.add(buf.toString());
|
||||
|
||||
final String transportAddresses = System.getProperty(Constants.FESS_ES_TRANSPORT_ADDRESSES);
|
||||
if (StringUtil.isNotBlank(transportAddresses)) {
|
||||
crawlerCmdList.add("-D" + Constants.FESS_ES_TRANSPORT_ADDRESSES + "=" + transportAddresses);
|
||||
if (useLocaleElasticsearch) {
|
||||
final String transportAddresses = System.getProperty(Constants.FESS_ES_TRANSPORT_ADDRESSES);
|
||||
if (StringUtil.isNotBlank(transportAddresses)) {
|
||||
crawlerCmdList.add("-D" + Constants.FESS_ES_TRANSPORT_ADDRESSES + "=" + transportAddresses);
|
||||
}
|
||||
final String clusterName = System.getProperty(Constants.FESS_ES_CLUSTER_NAME);
|
||||
if (StringUtil.isNotBlank(clusterName)) {
|
||||
crawlerCmdList.add("-D" + Constants.FESS_ES_CLUSTER_NAME + "=" + clusterName);
|
||||
}
|
||||
}
|
||||
|
||||
crawlerCmdList.add("-Dfess.crawler.process=true");
|
||||
|
|
|
@ -52,7 +52,7 @@ public class FessFwAssistantDirector extends CachedFwAssistantDirector {
|
|||
// Assist
|
||||
// ======
|
||||
@Override
|
||||
protected void prepareAssistDirection(FwAssistDirection direction) {
|
||||
protected void prepareAssistDirection(final FwAssistDirection direction) {
|
||||
direction.directConfig(nameList -> nameList.add("fess_config.properties"), "fess_env.properties");
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class FessFwAssistantDirector extends CachedFwAssistantDirector {
|
|||
// Core
|
||||
// ======
|
||||
@Override
|
||||
protected void prepareCoreDirection(FwCoreDirection direction) {
|
||||
protected void prepareCoreDirection(final FwCoreDirection direction) {
|
||||
// this configuration is on fess_env.properties because this is true only when development
|
||||
direction.directDevelopmentHere(fessConfig.isDevelopmentHere());
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class FessFwAssistantDirector extends CachedFwAssistantDirector {
|
|||
// DB
|
||||
// ====
|
||||
@Override
|
||||
protected void prepareDbDirection(FwDbDirection direction) {
|
||||
protected void prepareDbDirection(final FwDbDirection direction) {
|
||||
direction.directClassification(createListedClassificationProvider());
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class FessFwAssistantDirector extends CachedFwAssistantDirector {
|
|||
// Web
|
||||
// =====
|
||||
@Override
|
||||
protected void prepareWebDirection(FwWebDirection direction) {
|
||||
protected void prepareWebDirection(final FwWebDirection direction) {
|
||||
direction.directRequest(createUserLocaleProcessProvider(), createUserTimeZoneProcessProvider());
|
||||
direction.directCookie(createCookieResourceProvider());
|
||||
direction.directAdjustment(createActionAdjustmentProvider());
|
||||
|
|
|
@ -39,12 +39,12 @@ public class FessApiFailureHook implements ApiFailureHook { // #change_it for ha
|
|||
// Business Failure
|
||||
// ================
|
||||
@Override
|
||||
public ApiResponse handleValidationError(ApiFailureResource resource) {
|
||||
public ApiResponse handleValidationError(final ApiFailureResource resource) {
|
||||
return asJson(createFailureBean(resource)).httpStatus(HTTP_BAD_REQUEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse handleApplicationException(ApiFailureResource resource, RuntimeException cause) {
|
||||
public ApiResponse handleApplicationException(final ApiFailureResource resource, final RuntimeException cause) {
|
||||
final int status;
|
||||
if (cause instanceof LoginUnauthorizedException) {
|
||||
status = HTTP_UNAUTHORIZED; // unauthorized
|
||||
|
@ -58,23 +58,23 @@ public class FessApiFailureHook implements ApiFailureHook { // #change_it for ha
|
|||
// System Failure
|
||||
// ==============
|
||||
@Override
|
||||
public OptionalThing<ApiResponse> handleClientException(ApiFailureResource resource, RuntimeException cause) {
|
||||
public OptionalThing<ApiResponse> handleClientException(final ApiFailureResource resource, final RuntimeException cause) {
|
||||
return OptionalThing.empty(); // means empty body (HTTP status will be automatically sent)
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalThing<ApiResponse> handleServerException(ApiFailureResource resource, Throwable cause) {
|
||||
public OptionalThing<ApiResponse> handleServerException(final ApiFailureResource resource, final Throwable cause) {
|
||||
return OptionalThing.empty(); // means empty body (HTTP status will be automatically sent)
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
protected JsonResponse<TooSimpleFailureBean> asJson(TooSimpleFailureBean bean) {
|
||||
protected JsonResponse<TooSimpleFailureBean> asJson(final TooSimpleFailureBean bean) {
|
||||
return new JsonResponse<TooSimpleFailureBean>(bean);
|
||||
}
|
||||
|
||||
protected TooSimpleFailureBean createFailureBean(ApiFailureResource resource) {
|
||||
protected TooSimpleFailureBean createFailureBean(final ApiFailureResource resource) {
|
||||
return new TooSimpleFailureBean(resource.getMessageList());
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ public class FessApiFailureHook implements ApiFailureHook { // #change_it for ha
|
|||
|
||||
public final List<String> messageList;
|
||||
|
||||
public TooSimpleFailureBean(List<String> messageList) {
|
||||
public TooSimpleFailureBean(final List<String> messageList) {
|
||||
this.messageList = messageList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,19 +27,22 @@ public class FessCookieResourceProvider implements CookieResourceProvider {
|
|||
protected final FessConfig harborConfig;
|
||||
protected final InvertibleCryptographer cookieCipher;
|
||||
|
||||
public FessCookieResourceProvider(FessConfig harborConfig, InvertibleCryptographer cookieCipher) {
|
||||
public FessCookieResourceProvider(final FessConfig harborConfig, final InvertibleCryptographer cookieCipher) {
|
||||
this.harborConfig = harborConfig;
|
||||
this.cookieCipher = cookieCipher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String provideDefaultPath() {
|
||||
return harborConfig.getCookieDefaultPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer provideDefaultExpire() {
|
||||
return harborConfig.getCookieDefaultExpireAsInteger();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvertibleCryptographer provideCipher() {
|
||||
return cookieCipher;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ import org.lastaflute.core.direction.FwAssistantDirector;
|
|||
*/
|
||||
public class FessCurtainBeforeHook implements CurtainBeforeHook {
|
||||
|
||||
public void hook(FwAssistantDirector assistantDirector) {
|
||||
@Override
|
||||
public void hook(final FwAssistantDirector assistantDirector) {
|
||||
processDBFluteSystem();
|
||||
}
|
||||
|
||||
|
@ -42,6 +43,7 @@ public class FessCurtainBeforeHook implements CurtainBeforeHook {
|
|||
return new DfFinalTimeZoneProvider() {
|
||||
protected final TimeZone provided = FessUserTimeZoneProcessProvider.centralTimeZone;
|
||||
|
||||
@Override
|
||||
public TimeZone provide() {
|
||||
return provided;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@ public class FessCurtainFinallyHook implements CurtainFinallyHook {
|
|||
|
||||
private static final Logger logger = LoggerFactory.getLogger(FessCurtainFinallyHook.class);
|
||||
|
||||
public void hook(FwAssistantDirector assistantDirector) {
|
||||
@Override
|
||||
public void hook(final FwAssistantDirector assistantDirector) {
|
||||
shutdownCommonsHttpClient();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,16 +28,17 @@ import org.lastaflute.db.dbflute.exception.ProvidedClassificationNotFoundExcepti
|
|||
*/
|
||||
public class FessListedClassificationProvider implements ListedClassificationProvider {
|
||||
|
||||
public ClassificationMeta provide(String classificationName) throws ProvidedClassificationNotFoundException {
|
||||
@Override
|
||||
public ClassificationMeta provide(final String classificationName) throws ProvidedClassificationNotFoundException {
|
||||
final ClassificationMeta onMainSchema = findOnMainSchema(classificationName);
|
||||
if (onMainSchema == null) {
|
||||
String msg = "Not found the classification: " + classificationName;
|
||||
final String msg = "Not found the classification: " + classificationName;
|
||||
throw new ProvidedClassificationNotFoundException(msg);
|
||||
}
|
||||
return onMainSchema;
|
||||
}
|
||||
|
||||
protected ClassificationMeta findOnMainSchema(String classificationName) throws ProvidedClassificationNotFoundException {
|
||||
protected ClassificationMeta findOnMainSchema(final String classificationName) throws ProvidedClassificationNotFoundException {
|
||||
// *no use DBFlute classification
|
||||
return null;
|
||||
//String searchName = classificationName;
|
||||
|
@ -57,7 +58,7 @@ public class FessListedClassificationProvider implements ListedClassificationPro
|
|||
}
|
||||
|
||||
@Override
|
||||
public OptionalThing<String> determineAlias(Locale locale) {
|
||||
public OptionalThing<String> determineAlias(final Locale locale) {
|
||||
return OptionalObject.empty();
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue