fix #1787 add stemmer override page
This commit is contained in:
parent
1a6966ad62
commit
62045e2808
36 changed files with 2861 additions and 304 deletions
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.pager;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
|
||||
public class StemmerOverridePager implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int allRecordCount;
|
||||
|
||||
private int allPageCount;
|
||||
|
||||
private boolean existPrePage;
|
||||
|
||||
private boolean existNextPage;
|
||||
|
||||
private List<Integer> pageNumberList;
|
||||
|
||||
private int pageSize;
|
||||
|
||||
private int currentPageNumber;
|
||||
|
||||
public String id;
|
||||
|
||||
public void clear() {
|
||||
allRecordCount = 0;
|
||||
allPageCount = 0;
|
||||
existPrePage = false;
|
||||
existNextPage = false;
|
||||
pageSize = getDefaultPageSize();
|
||||
currentPageNumber = getDefaultCurrentPageNumber();
|
||||
|
||||
id = null;
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return ComponentUtil.getFessConfig().getPagingPageSizeAsInteger();
|
||||
}
|
||||
|
||||
protected int getDefaultCurrentPageNumber() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int getAllRecordCount() {
|
||||
return allRecordCount;
|
||||
}
|
||||
|
||||
public void setAllRecordCount(final int allRecordCount) {
|
||||
this.allRecordCount = allRecordCount;
|
||||
}
|
||||
|
||||
public int getAllPageCount() {
|
||||
return allPageCount;
|
||||
}
|
||||
|
||||
public void setAllPageCount(final int allPageCount) {
|
||||
this.allPageCount = allPageCount;
|
||||
}
|
||||
|
||||
public boolean isExistPrePage() {
|
||||
return existPrePage;
|
||||
}
|
||||
|
||||
public void setExistPrePage(final boolean existPrePage) {
|
||||
this.existPrePage = existPrePage;
|
||||
}
|
||||
|
||||
public boolean isExistNextPage() {
|
||||
return existNextPage;
|
||||
}
|
||||
|
||||
public void setExistNextPage(final boolean existNextPage) {
|
||||
this.existNextPage = existNextPage;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
if (pageSize <= 0) {
|
||||
pageSize = getDefaultPageSize();
|
||||
}
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(final int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getCurrentPageNumber() {
|
||||
if (currentPageNumber <= 0) {
|
||||
currentPageNumber = getDefaultCurrentPageNumber();
|
||||
}
|
||||
return currentPageNumber;
|
||||
}
|
||||
|
||||
public void setCurrentPageNumber(final int currentPageNumber) {
|
||||
this.currentPageNumber = currentPageNumber;
|
||||
}
|
||||
|
||||
public List<Integer> getPageNumberList() {
|
||||
return pageNumberList;
|
||||
}
|
||||
|
||||
public void setPageNumberList(final List<Integer> pageNumberList) {
|
||||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.beans.util.BeanUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.StemmerOverridePager;
|
||||
import org.codelibs.fess.dict.DictionaryFile.PagingList;
|
||||
import org.codelibs.fess.dict.DictionaryManager;
|
||||
import org.codelibs.fess.dict.stemmeroverride.StemmerOverrideFile;
|
||||
import org.codelibs.fess.dict.stemmeroverride.StemmerOverrideItem;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
|
||||
public class StemmerOverrideService {
|
||||
@Resource
|
||||
protected DictionaryManager dictionaryManager;
|
||||
|
||||
@Resource
|
||||
protected FessConfig fessConfig;
|
||||
|
||||
public List<StemmerOverrideItem> getStemmerOverrideList(final String dictId, final StemmerOverridePager stemmerOvberridePager) {
|
||||
return getStemmerOverrideFile(dictId).map(
|
||||
file -> {
|
||||
final int pageSize = stemmerOvberridePager.getPageSize();
|
||||
final PagingList<StemmerOverrideItem> stemmerOvberrideList =
|
||||
file.selectList((stemmerOvberridePager.getCurrentPageNumber() - 1) * pageSize, pageSize);
|
||||
|
||||
// update pager
|
||||
BeanUtil.copyBeanToBean(stemmerOvberrideList, stemmerOvberridePager,
|
||||
option -> option.include(Constants.PAGER_CONVERSION_RULE));
|
||||
stemmerOvberrideList.setPageRangeSize(fessConfig.getPagingPageRangeSizeAsInteger());
|
||||
stemmerOvberridePager.setPageNumberList(stemmerOvberrideList.createPageNumberList());
|
||||
|
||||
return (List<StemmerOverrideItem>) stemmerOvberrideList;
|
||||
}).orElse(Collections.emptyList());
|
||||
}
|
||||
|
||||
public OptionalEntity<StemmerOverrideFile> getStemmerOverrideFile(final String dictId) {
|
||||
return dictionaryManager.getDictionaryFile(dictId).filter(file -> file instanceof StemmerOverrideFile)
|
||||
.map(file -> OptionalEntity.of((StemmerOverrideFile) file)).orElse(OptionalEntity.empty());
|
||||
}
|
||||
|
||||
public OptionalEntity<StemmerOverrideItem> getStemmerOverrideItem(final String dictId, final long id) {
|
||||
return getStemmerOverrideFile(dictId).map(file -> file.get(id).get());
|
||||
}
|
||||
|
||||
public void store(final String dictId, final StemmerOverrideItem stemmerOvberrideItem) {
|
||||
getStemmerOverrideFile(dictId).ifPresent(file -> {
|
||||
if (stemmerOvberrideItem.getId() == 0) {
|
||||
file.insert(stemmerOvberrideItem);
|
||||
} else {
|
||||
file.update(stemmerOvberrideItem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(final String dictId, final StemmerOverrideItem stemmerOvberrideItem) {
|
||||
getStemmerOverrideFile(dictId).ifPresent(file -> {
|
||||
file.delete(stemmerOvberrideItem);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,419 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.admin.dict.stemmeroverride;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.beans.util.BeanUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.StemmerOverridePager;
|
||||
import org.codelibs.fess.app.service.StemmerOverrideService;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.app.web.admin.dict.AdminDictAction;
|
||||
import org.codelibs.fess.app.web.base.FessAdminAction;
|
||||
import org.codelibs.fess.app.web.base.FessBaseAction;
|
||||
import org.codelibs.fess.dict.stemmeroverride.StemmerOverrideItem;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.RenderDataUtil;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.web.Execute;
|
||||
import org.lastaflute.web.response.ActionResponse;
|
||||
import org.lastaflute.web.response.HtmlResponse;
|
||||
import org.lastaflute.web.response.render.RenderData;
|
||||
import org.lastaflute.web.ruts.process.ActionRuntime;
|
||||
import org.lastaflute.web.validation.VaErrorHook;
|
||||
import org.lastaflute.web.validation.exception.ValidationErrorException;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
*/
|
||||
public class AdminDictStemmeroverrideAction extends FessAdminAction {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
private StemmerOverrideService stemmerOverrideService;
|
||||
@Resource
|
||||
private StemmerOverridePager stemmerOverridePager;
|
||||
|
||||
// ===================================================================================
|
||||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink(fessConfig.getOnlineHelpNameDictStemmeroverride()));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
stemmerOverridePager.clear();
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(final OptionalThing<Integer> pageNumber, final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
pageNumber.ifPresent(num -> {
|
||||
stemmerOverridePager.setCurrentPageNumber(pageNumber.get());
|
||||
}).orElse(() -> {
|
||||
stemmerOverridePager.setCurrentPageNumber(0);
|
||||
});
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
copyBeanToBean(form, stemmerOverridePager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
stemmerOverridePager.clear();
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(final RenderData data, final SearchForm form) {
|
||||
// page navi
|
||||
RenderDataUtil.register(data, "stemmerOverrideItemItems",
|
||||
stemmerOverrideService.getStemmerOverrideList(form.dictId, stemmerOverridePager));
|
||||
|
||||
// restore from pager
|
||||
BeanUtil.copyBeanToBean(stemmerOverridePager, form, op -> {
|
||||
op.exclude(Constants.PAGER_CONVERSION_RULE);
|
||||
});
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Edit Execute
|
||||
// ============
|
||||
// -----------------------------------------------------
|
||||
// Entry Page
|
||||
// ----------
|
||||
@Execute
|
||||
public HtmlResponse createnew(final String dictId) {
|
||||
saveToken();
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideEditJsp).useForm(CreateForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
form.initialize();
|
||||
form.crudMode = CrudMode.CREATE;
|
||||
form.dictId = dictId;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse edit(final EditForm form) {
|
||||
validate(form, messages -> {}, () -> asListHtml(form.dictId));
|
||||
stemmerOverrideService
|
||||
.getStemmerOverrideItem(form.dictId, form.id)
|
||||
.ifPresent(entity -> {
|
||||
form.input = entity.getInput();
|
||||
form.output = entity.getOutput();
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()),
|
||||
() -> asListHtml(form.dictId));
|
||||
});
|
||||
saveToken();
|
||||
if (form.crudMode.intValue() == CrudMode.EDIT) {
|
||||
// back
|
||||
form.crudMode = CrudMode.DETAILS;
|
||||
return asDetailsHtml();
|
||||
} else {
|
||||
form.crudMode = CrudMode.EDIT;
|
||||
return asEditHtml();
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Details
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse details(final String dictId, final int crudMode, final long id) {
|
||||
verifyCrudMode(crudMode, CrudMode.DETAILS, dictId);
|
||||
saveToken();
|
||||
return asDetailsHtml().useForm(
|
||||
EditForm.class,
|
||||
op -> {
|
||||
op.setup(form -> {
|
||||
stemmerOverrideService
|
||||
.getStemmerOverrideItem(dictId, id)
|
||||
.ifPresent(entity -> {
|
||||
form.input = entity.getInput();
|
||||
form.output = entity.getOutput();
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(
|
||||
messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, dictId + ":" + id),
|
||||
() -> asListHtml(dictId));
|
||||
});
|
||||
form.id = id;
|
||||
form.crudMode = crudMode;
|
||||
form.dictId = dictId;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Download
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse downloadpage(final String dictId) {
|
||||
saveToken();
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideDownloadJsp).useForm(DownloadForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
form.dictId = dictId;
|
||||
});
|
||||
}).renderWith(data -> {
|
||||
stemmerOverrideService.getStemmerOverrideFile(dictId).ifPresent(file -> {
|
||||
RenderDataUtil.register(data, "path", file.getPath());
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToDownloadStemmeroverrideFile(GLOBAL), () -> asDictIndexHtml());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public ActionResponse download(final DownloadForm form) {
|
||||
validate(form, messages -> {}, () -> downloadpage(form.dictId));
|
||||
verifyTokenKeep(() -> downloadpage(form.dictId));
|
||||
return stemmerOverrideService
|
||||
.getStemmerOverrideFile(form.dictId)
|
||||
.map(file -> {
|
||||
return asStream(new File(file.getPath()).getName()).contentTypeOctetStream().stream(out -> {
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
out.write(inputStream);
|
||||
}
|
||||
});
|
||||
})
|
||||
.orElseGet(
|
||||
() -> {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToDownloadStemmeroverrideFile(GLOBAL),
|
||||
() -> downloadpage(form.dictId));
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Upload
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse uploadpage(final String dictId) {
|
||||
saveToken();
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideUploadJsp).useForm(UploadForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
form.dictId = dictId;
|
||||
});
|
||||
}).renderWith(data -> {
|
||||
stemmerOverrideService.getStemmerOverrideFile(dictId).ifPresent(file -> {
|
||||
RenderDataUtil.register(data, "path", file.getPath());
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToDownloadStemmeroverrideFile(GLOBAL), () -> asDictIndexHtml());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse upload(final UploadForm form) {
|
||||
validate(form, messages -> {}, () -> uploadpage(form.dictId));
|
||||
verifyToken(() -> uploadpage(form.dictId));
|
||||
return stemmerOverrideService.getStemmerOverrideFile(form.dictId).map(file -> {
|
||||
try (InputStream inputStream = form.stemmerOverrideFile.getInputStream()) {
|
||||
file.update(inputStream);
|
||||
} catch (final IOException e) {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToUploadStemmeroverrideFile(GLOBAL), () -> {
|
||||
return redirectWith(getClass(), moreUrl("uploadpage/" + form.dictId));
|
||||
});
|
||||
}
|
||||
saveInfo(messages -> messages.addSuccessUploadStemmeroverrideFile(GLOBAL));
|
||||
return redirectWith(getClass(), moreUrl("uploadpage/" + form.dictId));
|
||||
}).orElseGet(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToUploadStemmeroverrideFile(GLOBAL), () -> uploadpage(form.dictId));
|
||||
return null;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Actually Crud
|
||||
// -------------
|
||||
@Execute
|
||||
public HtmlResponse create(final CreateForm form) {
|
||||
verifyCrudMode(form.crudMode, CrudMode.CREATE, form.dictId);
|
||||
validate(form, messages -> {}, () -> asEditHtml());
|
||||
verifyToken(() -> asEditHtml());
|
||||
createStemmerOverrideItem(form, () -> asEditHtml()).ifPresent(
|
||||
entity -> {
|
||||
try {
|
||||
stemmerOverrideService.store(form.dictId, entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
} catch (final Exception e) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)),
|
||||
() -> asEditHtml());
|
||||
}
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), () -> asEditHtml());
|
||||
});
|
||||
return redirectWith(getClass(), moreUrl("list/1").params("dictId", form.dictId));
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse update(final EditForm form) {
|
||||
verifyCrudMode(form.crudMode, CrudMode.EDIT, form.dictId);
|
||||
validate(form, messages -> {}, () -> asEditHtml());
|
||||
verifyToken(() -> asEditHtml());
|
||||
createStemmerOverrideItem(form, () -> asEditHtml()).ifPresent(
|
||||
entity -> {
|
||||
try {
|
||||
stemmerOverrideService.store(form.dictId, entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
} catch (final Exception e) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e)),
|
||||
() -> asEditHtml());
|
||||
}
|
||||
}).orElse(() -> {
|
||||
saveToken();
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()), () -> asEditHtml());
|
||||
});
|
||||
return redirectWith(getClass(), moreUrl("list/1").params("dictId", form.dictId));
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse delete(final EditForm form) {
|
||||
verifyCrudMode(form.crudMode, CrudMode.DETAILS, form.dictId);
|
||||
validate(form, messages -> {}, () -> asDetailsHtml());
|
||||
verifyToken(() -> asDetailsHtml());
|
||||
stemmerOverrideService
|
||||
.getStemmerOverrideItem(form.dictId, form.id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
try {
|
||||
stemmerOverrideService.delete(form.dictId, entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
} catch (final Exception e) {
|
||||
throwValidationError(
|
||||
messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e)),
|
||||
() -> asEditHtml());
|
||||
}
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()),
|
||||
() -> asDetailsHtml());
|
||||
});
|
||||
return redirectWith(getClass(), moreUrl("list/1").params("dictId", form.dictId));
|
||||
}
|
||||
|
||||
//===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
|
||||
private static OptionalEntity<StemmerOverrideItem> getEntity(final CreateForm form) {
|
||||
switch (form.crudMode) {
|
||||
case CrudMode.CREATE:
|
||||
final StemmerOverrideItem entity = new StemmerOverrideItem(0, StringUtil.EMPTY, StringUtil.EMPTY);
|
||||
return OptionalEntity.of(entity);
|
||||
case CrudMode.EDIT:
|
||||
if (form instanceof EditForm) {
|
||||
return ComponentUtil.getComponent(StemmerOverrideService.class).getStemmerOverrideItem(form.dictId, ((EditForm) form).id);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return OptionalEntity.empty();
|
||||
}
|
||||
|
||||
protected OptionalEntity<StemmerOverrideItem> createStemmerOverrideItem(final CreateForm form, final VaErrorHook hook) {
|
||||
try {
|
||||
return createStemmerOverrideItem(this, form, hook);
|
||||
} catch (final ValidationErrorException e) {
|
||||
saveToken();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public static OptionalEntity<StemmerOverrideItem> createStemmerOverrideItem(final FessBaseAction action, final CreateForm form,
|
||||
final VaErrorHook hook) {
|
||||
return getEntity(form).map(entity -> {
|
||||
entity.setNewInput(form.input);
|
||||
entity.setNewOutput(form.output);
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(final int crudMode, final int expectedMode, final String dictId) {
|
||||
if (crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(crudMode));
|
||||
}, () -> asListHtml(dictId));
|
||||
}
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// JSP
|
||||
// =========
|
||||
|
||||
protected HtmlResponse asDictIndexHtml() {
|
||||
return redirect(AdminDictAction.class);
|
||||
}
|
||||
|
||||
private HtmlResponse asListHtml(final String dictId) {
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideJsp).renderWith(
|
||||
data -> {
|
||||
RenderDataUtil.register(data, "stemmerOverrideItemItems",
|
||||
stemmerOverrideService.getStemmerOverrideList(dictId, stemmerOverridePager));
|
||||
}).useForm(SearchForm.class, setup -> {
|
||||
setup.setup(form -> {
|
||||
copyBeanToBean(stemmerOverridePager, form, op -> op.include("id"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private HtmlResponse asEditHtml() {
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideEditJsp);
|
||||
}
|
||||
|
||||
private HtmlResponse asDetailsHtml() {
|
||||
return asHtml(path_AdminDictStemmeroverride_AdminDictStemmeroverrideDetailsJsp);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.admin.dict.stemmeroverride;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class CreateForm {
|
||||
|
||||
@Required
|
||||
public String dictId;
|
||||
|
||||
@ValidateTypeFailure
|
||||
public Integer crudMode;
|
||||
|
||||
@Required
|
||||
@Size(max = 1000)
|
||||
public String input;
|
||||
|
||||
@Required
|
||||
@Size(max = 1000)
|
||||
public String output;
|
||||
|
||||
public void initialize() {
|
||||
crudMode = CrudMode.CREATE;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.admin.dict.stemmeroverride;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
||||
public class DownloadForm {
|
||||
@Required
|
||||
public String dictId;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.admin.dict.stemmeroverride;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class EditForm extends CreateForm {
|
||||
|
||||
@Required
|
||||
@ValidateTypeFailure
|
||||
public Long id;
|
||||
|
||||
public String getDisplayId() {
|
||||
return dictId + ":" + id;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.admin.dict.stemmeroverride;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class SearchForm {
|
||||
|
||||
@Required
|
||||
public String dictId;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.admin.dict.stemmeroverride;
|
||||
|
||||
import org.lastaflute.web.ruts.multipart.MultipartFormFile;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class UploadForm {
|
||||
|
||||
@Required
|
||||
public String dictId;
|
||||
|
||||
@Required
|
||||
public MultipartFormFile stemmerOverrideFile;
|
||||
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.api.admin.dict.stemmeroverride;
|
||||
|
||||
import static org.codelibs.fess.app.web.admin.dict.stemmeroverride.AdminDictStemmeroverrideAction.createStemmerOverrideItem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.app.pager.StemmerOverridePager;
|
||||
import org.codelibs.fess.app.service.StemmerOverrideService;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.app.web.admin.dict.stemmeroverride.UploadForm;
|
||||
import org.codelibs.fess.app.web.api.ApiResult;
|
||||
import org.codelibs.fess.app.web.api.admin.FessApiAdminAction;
|
||||
import org.codelibs.fess.dict.stemmeroverride.StemmerOverrideFile;
|
||||
import org.codelibs.fess.dict.stemmeroverride.StemmerOverrideItem;
|
||||
import org.lastaflute.web.Execute;
|
||||
import org.lastaflute.web.response.JsonResponse;
|
||||
import org.lastaflute.web.response.StreamResponse;
|
||||
|
||||
public class ApiAdminDictStemmeroverrideAction extends FessApiAdminAction {
|
||||
|
||||
@Resource
|
||||
private StemmerOverrideService stemmerOverrideService;
|
||||
|
||||
// GET /api/admin/dict/stemmerOverride/settings/{dictId}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> get$settings(final String dictId, final SearchBody body) {
|
||||
body.dictId = dictId;
|
||||
validateApi(body, messages -> {});
|
||||
final StemmerOverridePager pager = copyBeanToNewBean(body, StemmerOverridePager.class);
|
||||
return asJson(new ApiResult.ApiConfigsResponse<EditBody>()
|
||||
.settings(
|
||||
stemmerOverrideService.getStemmerOverrideList(body.dictId, pager).stream()
|
||||
.map(protwordsItem -> createEditBody(protwordsItem, dictId)).collect(Collectors.toList()))
|
||||
.status(ApiResult.Status.OK).result());
|
||||
}
|
||||
|
||||
// GET /api/admin/dict/stemmerOverride/setting/{dictId}/{id}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> get$setting(final String dictId, final long id) {
|
||||
return asJson(new ApiResult.ApiConfigResponse()
|
||||
.setting(
|
||||
stemmerOverrideService
|
||||
.getStemmerOverrideItem(dictId, id)
|
||||
.map(entity -> createEditBody(entity, dictId))
|
||||
.orElseGet(
|
||||
() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL,
|
||||
String.valueOf(id)));
|
||||
return null;
|
||||
})).status(ApiResult.Status.OK).result());
|
||||
}
|
||||
|
||||
// PUT /api/admin/dict/stemmerOverride/setting/{dictId}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> put$setting(final String dictId, final CreateBody body) {
|
||||
body.dictId = dictId;
|
||||
validateApi(body, messages -> {});
|
||||
body.crudMode = CrudMode.CREATE;
|
||||
final StemmerOverrideItem entity = createStemmerOverrideItem(this, body, () -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL));
|
||||
return null;
|
||||
}).orElseGet(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL));
|
||||
return null;
|
||||
});
|
||||
stemmerOverrideService.store(body.dictId, entity);
|
||||
return asJson(new ApiResult.ApiUpdateResponse().id(String.valueOf(entity.getId())).created(true).status(ApiResult.Status.OK)
|
||||
.result());
|
||||
}
|
||||
|
||||
// POST /api/admin/dict/stemmerOverride/setting/{dictId}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> post$setting(final String dictId, final EditBody body) {
|
||||
body.dictId = dictId;
|
||||
validateApi(body, messages -> {});
|
||||
body.crudMode = CrudMode.EDIT;
|
||||
final StemmerOverrideItem entity = createStemmerOverrideItem(this, body, () -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, String.valueOf(body.id)));
|
||||
return null;
|
||||
}).orElseGet(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, String.valueOf(body.id)));
|
||||
return null;
|
||||
});
|
||||
stemmerOverrideService.store(body.dictId, entity);
|
||||
return asJson(new ApiResult.ApiUpdateResponse().id(String.valueOf(entity.getId())).created(false).status(ApiResult.Status.OK)
|
||||
.result());
|
||||
}
|
||||
|
||||
// DELETE /api/admin/dict/stemmerOverride/setting/{dictId}/{id}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> delete$setting(final String dictId, final long id) {
|
||||
stemmerOverrideService.getStemmerOverrideItem(dictId, id).ifPresent(entity -> {
|
||||
stemmerOverrideService.delete(dictId, entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
}).orElse(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, String.valueOf(id)));
|
||||
});
|
||||
return asJson(new ApiResult.ApiUpdateResponse().id(String.valueOf(id)).created(false).status(ApiResult.Status.OK).result());
|
||||
}
|
||||
|
||||
// POST /api/admin/dict/stemmerOverride/upload/{dictId}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> post$upload(final String dictId, final UploadForm form) {
|
||||
form.dictId = dictId;
|
||||
validateApi(form, messages -> {});
|
||||
final StemmerOverrideFile file = stemmerOverrideService.getStemmerOverrideFile(form.dictId).orElseGet(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsFailedToUploadProtwordsFile(GLOBAL));
|
||||
return null;
|
||||
});
|
||||
try (InputStream inputStream = form.stemmerOverrideFile.getInputStream()) {
|
||||
file.update(inputStream);
|
||||
} catch (final IOException e) {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsFailedToUploadProtwordsFile(GLOBAL));
|
||||
}
|
||||
return asJson(new ApiResult.ApiResponse().status(ApiResult.Status.OK).result());
|
||||
}
|
||||
|
||||
// GET /api/admin/dict/stemmerOverride/download/{dictId}
|
||||
@Execute
|
||||
public StreamResponse get$download(final String dictId, final DownloadBody body) {
|
||||
body.dictId = dictId;
|
||||
validateApi(body, messages -> {});
|
||||
return stemmerOverrideService.getStemmerOverrideFile(body.dictId).map(file -> {
|
||||
return asStream(new File(file.getPath()).getName()).contentTypeOctetStream().stream(out -> {
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
out.write(inputStream);
|
||||
}
|
||||
});
|
||||
}).orElseGet(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsFailedToDownloadProtwordsFile(GLOBAL));
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
protected EditBody createEditBody(final StemmerOverrideItem entity, final String dictId) {
|
||||
final EditBody body = new EditBody();
|
||||
body.id = entity.getId();
|
||||
body.dictId = dictId;
|
||||
body.input = entity.getInput();
|
||||
body.output = entity.getOutput();
|
||||
return body;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.api.admin.dict.stemmeroverride;
|
||||
|
||||
import org.codelibs.fess.app.web.admin.dict.stemmeroverride.CreateForm;
|
||||
|
||||
public class CreateBody extends CreateForm {
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.api.admin.dict.stemmeroverride;
|
||||
|
||||
import org.codelibs.fess.app.web.admin.dict.stemmeroverride.DownloadForm;
|
||||
|
||||
public class DownloadBody extends DownloadForm {
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.api.admin.dict.stemmeroverride;
|
||||
|
||||
import org.codelibs.fess.app.web.admin.dict.stemmeroverride.EditForm;
|
||||
|
||||
public class EditBody extends EditForm {
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.app.web.api.admin.dict.stemmeroverride;
|
||||
|
||||
import org.codelibs.fess.app.web.api.admin.dict.BaseSearchDictBody;
|
||||
|
||||
public class SearchBody extends BaseSearchDictBody {
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.dict.stemmeroverride;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.codelibs.fess.dict.DictionaryCreator;
|
||||
import org.codelibs.fess.dict.DictionaryFile;
|
||||
import org.codelibs.fess.dict.DictionaryItem;
|
||||
|
||||
public class StemmerOverrideCreator extends DictionaryCreator {
|
||||
|
||||
public StemmerOverrideCreator() {
|
||||
super("stemmer_override.*\\.txt");
|
||||
}
|
||||
|
||||
public StemmerOverrideCreator(final String pattern) {
|
||||
super(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DictionaryFile<? extends DictionaryItem> newDictionaryFile(final String id, final String path, final Date timestamp) {
|
||||
return new StemmerOverrideFile(id, path, timestamp).manager(dictionaryManager);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,304 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.dict.stemmeroverride;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.codelibs.core.io.CloseableUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.dict.DictionaryException;
|
||||
import org.codelibs.fess.dict.DictionaryFile;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class StemmerOverrideFile extends DictionaryFile<StemmerOverrideItem> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(StemmerOverrideFile.class);
|
||||
|
||||
private static final String STEMMER_OVERRIDE = "stemmeroverride";
|
||||
|
||||
List<StemmerOverrideItem> stemmerOverrideItemList;
|
||||
|
||||
public StemmerOverrideFile(final String id, final String path, final Date timestamp) {
|
||||
super(id, path, timestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return STEMMER_OVERRIDE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized OptionalEntity<StemmerOverrideItem> get(final long id) {
|
||||
if (stemmerOverrideItemList == null) {
|
||||
reload(null, null);
|
||||
}
|
||||
|
||||
for (final StemmerOverrideItem stemmerOverrideItem : stemmerOverrideItemList) {
|
||||
if (id == stemmerOverrideItem.getId()) {
|
||||
return OptionalEntity.of(stemmerOverrideItem);
|
||||
}
|
||||
}
|
||||
return OptionalEntity.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized PagingList<StemmerOverrideItem> selectList(final int offset, final int size) {
|
||||
if (stemmerOverrideItemList == null) {
|
||||
reload(null, null);
|
||||
}
|
||||
|
||||
if (offset >= stemmerOverrideItemList.size() || offset < 0) {
|
||||
return new PagingList<>(Collections.<StemmerOverrideItem> emptyList(), offset, size, stemmerOverrideItemList.size());
|
||||
}
|
||||
|
||||
int toIndex = offset + size;
|
||||
if (toIndex > stemmerOverrideItemList.size()) {
|
||||
toIndex = stemmerOverrideItemList.size();
|
||||
}
|
||||
|
||||
return new PagingList<>(stemmerOverrideItemList.subList(offset, toIndex), offset, size, stemmerOverrideItemList.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void insert(final StemmerOverrideItem item) {
|
||||
try (StemmerOverrideUpdater updater = new StemmerOverrideUpdater(item)) {
|
||||
reload(updater, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void update(final StemmerOverrideItem item) {
|
||||
try (StemmerOverrideUpdater updater = new StemmerOverrideUpdater(item)) {
|
||||
reload(updater, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void delete(final StemmerOverrideItem item) {
|
||||
final StemmerOverrideItem stemmerOverrideItem = item;
|
||||
stemmerOverrideItem.setNewInput(StringUtil.EMPTY);
|
||||
stemmerOverrideItem.setNewOutput(StringUtil.EMPTY);
|
||||
try (StemmerOverrideUpdater updater = new StemmerOverrideUpdater(item)) {
|
||||
reload(updater, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected void reload(final StemmerOverrideUpdater updater, final InputStream in) {
|
||||
final Pattern parsePattern = Pattern.compile("(.*)\\s*=>\\s*(.*)\\s*$");
|
||||
final List<StemmerOverrideItem> itemList = new ArrayList<>();
|
||||
try (BufferedReader reader =
|
||||
new BufferedReader(new InputStreamReader(in != null ? in : dictionaryManager.getContentInputStream(this), Constants.UTF_8))) {
|
||||
long id = 0;
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// Remove comments
|
||||
final String replacedLine = line.replaceAll("#.*$", StringUtil.EMPTY).trim();
|
||||
|
||||
// Skip empty lines or comment lines
|
||||
if (replacedLine.length() == 0) {
|
||||
if (updater != null) {
|
||||
updater.write(line);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
final Matcher m = parsePattern.matcher(replacedLine);
|
||||
|
||||
if (!m.find()) {
|
||||
logger.warn("Failed to parse " + line + " in " + path);
|
||||
if (updater != null) {
|
||||
updater.write("# " + line);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
String input = m.group(1).trim();
|
||||
String output = m.group(2).trim();
|
||||
|
||||
if (input == null || output == null) {
|
||||
logger.warn("Failed to parse " + line + " in " + path);
|
||||
if (updater != null) {
|
||||
updater.write("# " + line);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
id++;
|
||||
final StemmerOverrideItem item = new StemmerOverrideItem(id, input, output);
|
||||
|
||||
if (updater != null) {
|
||||
final StemmerOverrideItem newItem = updater.write(item);
|
||||
if (newItem != null) {
|
||||
itemList.add(newItem);
|
||||
} else {
|
||||
id--;
|
||||
}
|
||||
} else {
|
||||
itemList.add(item);
|
||||
}
|
||||
}
|
||||
if (updater != null) {
|
||||
final StemmerOverrideItem item = updater.commit();
|
||||
if (item != null) {
|
||||
itemList.add(item);
|
||||
}
|
||||
}
|
||||
stemmerOverrideItemList = itemList;
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to parse " + path, e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getSimpleName() {
|
||||
return new File(path).getName();
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return new BufferedInputStream(dictionaryManager.getContentInputStream(this));
|
||||
}
|
||||
|
||||
public synchronized void update(final InputStream in) throws IOException {
|
||||
try (StemmerOverrideUpdater updater = new StemmerOverrideUpdater(null)) {
|
||||
reload(updater, in);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StemmerOverrideFile [path=" + path + ", stemmerOverrideItemList=" + stemmerOverrideItemList + ", id=" + id + "]";
|
||||
}
|
||||
|
||||
protected class StemmerOverrideUpdater implements Closeable {
|
||||
|
||||
protected boolean isCommit = false;
|
||||
|
||||
protected File newFile;
|
||||
|
||||
protected Writer writer;
|
||||
|
||||
protected StemmerOverrideItem item;
|
||||
|
||||
protected StemmerOverrideUpdater(final StemmerOverrideItem newItem) {
|
||||
try {
|
||||
newFile = File.createTempFile(STEMMER_OVERRIDE, ".txt");
|
||||
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(newFile), Constants.UTF_8));
|
||||
} catch (final IOException e) {
|
||||
if (newFile != null) {
|
||||
newFile.delete();
|
||||
}
|
||||
throw new DictionaryException("Failed to write a userDict file.", e);
|
||||
}
|
||||
item = newItem;
|
||||
}
|
||||
|
||||
public StemmerOverrideItem write(final StemmerOverrideItem oldItem) {
|
||||
try {
|
||||
if (item != null && item.getId() == oldItem.getId() && item.isUpdated()) {
|
||||
if (item.equals(oldItem)) {
|
||||
try {
|
||||
if (!item.isDeleted()) {
|
||||
// update
|
||||
writer.write(item.toLineString());
|
||||
writer.write(Constants.LINE_SEPARATOR);
|
||||
return new StemmerOverrideItem(item.getId(), item.getNewInput(), item.getNewOutput());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} finally {
|
||||
item.setNewInput(null);
|
||||
item.setNewOutput(null);
|
||||
}
|
||||
} else {
|
||||
throw new DictionaryException("StemmerOverride file was updated: old=" + oldItem + " : new=" + item);
|
||||
}
|
||||
} else {
|
||||
writer.write(oldItem.toLineString());
|
||||
writer.write(Constants.LINE_SEPARATOR);
|
||||
return oldItem;
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to write: " + oldItem + " -> " + item, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void write(final String line) {
|
||||
try {
|
||||
writer.write(line);
|
||||
writer.write(Constants.LINE_SEPARATOR);
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to write: " + line, e);
|
||||
}
|
||||
}
|
||||
|
||||
public StemmerOverrideItem commit() {
|
||||
isCommit = true;
|
||||
if (item != null && item.isUpdated()) {
|
||||
try {
|
||||
writer.write(item.toLineString());
|
||||
writer.write(Constants.LINE_SEPARATOR);
|
||||
return item;
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to write: " + item, e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
try {
|
||||
writer.flush();
|
||||
} catch (final IOException e) {
|
||||
// ignore
|
||||
}
|
||||
CloseableUtil.closeQuietly(writer);
|
||||
|
||||
if (isCommit) {
|
||||
try {
|
||||
dictionaryManager.store(StemmerOverrideFile.this, newFile);
|
||||
} finally {
|
||||
newFile.delete();
|
||||
}
|
||||
} else {
|
||||
newFile.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.dict.stemmeroverride;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.dict.DictionaryItem;
|
||||
|
||||
public class StemmerOverrideItem extends DictionaryItem {
|
||||
private final String input;
|
||||
|
||||
private final String output;
|
||||
|
||||
private String newInput;
|
||||
|
||||
private String newOutput;
|
||||
|
||||
public StemmerOverrideItem(final long id, final String input, final String output) {
|
||||
this.id = id;
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
|
||||
if (id == 0) {
|
||||
// create
|
||||
newInput = input;
|
||||
newOutput = output;
|
||||
}
|
||||
}
|
||||
|
||||
public String getNewInput() {
|
||||
return newInput;
|
||||
}
|
||||
|
||||
public void setNewInput(final String newInput) {
|
||||
this.newInput = newInput;
|
||||
}
|
||||
|
||||
public String getNewOutput() {
|
||||
return newOutput;
|
||||
}
|
||||
|
||||
public void setNewOutput(final String newOutputs) {
|
||||
this.newOutput = newOutputs;
|
||||
}
|
||||
|
||||
public String getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
public String getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
public boolean isUpdated() {
|
||||
return newInput != null && newOutput != null;
|
||||
}
|
||||
|
||||
public boolean isDeleted() {
|
||||
return isUpdated() && StringUtil.isBlank(newInput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((input == null) ? 0 : input.hashCode());
|
||||
result = prime * result + ((output == null) ? 0 : output.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
StemmerOverrideItem other = (StemmerOverrideItem) obj;
|
||||
if (input == null) {
|
||||
if (other.input != null)
|
||||
return false;
|
||||
} else if (!input.equals(other.input))
|
||||
return false;
|
||||
if (output == null) {
|
||||
if (other.output != null)
|
||||
return false;
|
||||
} else if (!output.equals(other.output))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StemmerOverrideItem [input=" + input + ", output=" + output + ", newInput=" + newInput + ", newOutput=" + newOutput + "]";
|
||||
}
|
||||
|
||||
public String toLineString() {
|
||||
if (isUpdated()) {
|
||||
return newInput + "=>" + newOutput;
|
||||
} else {
|
||||
return input + "=>" + output;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -123,7 +123,8 @@ public interface FessHtmlPath {
|
|||
HtmlNext path_AdminDictProtwords_AdminDictProtwordsDetailsJsp = new HtmlNext("/admin/dict/protwords/admin_dict_protwords_details.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/protwords/admin_dict_protwords_download.jsp */
|
||||
HtmlNext path_AdminDictProtwords_AdminDictProtwordsDownloadJsp = new HtmlNext("/admin/dict/protwords/admin_dict_protwords_download.jsp");
|
||||
HtmlNext path_AdminDictProtwords_AdminDictProtwordsDownloadJsp =
|
||||
new HtmlNext("/admin/dict/protwords/admin_dict_protwords_download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/protwords/admin_dict_protwords_edit.jsp */
|
||||
HtmlNext path_AdminDictProtwords_AdminDictProtwordsEditJsp = new HtmlNext("/admin/dict/protwords/admin_dict_protwords_edit.jsp");
|
||||
|
@ -131,6 +132,26 @@ public interface FessHtmlPath {
|
|||
/** The path of the HTML: /admin/dict/protwords/admin_dict_protwords_upload.jsp */
|
||||
HtmlNext path_AdminDictProtwords_AdminDictProtwordsUploadJsp = new HtmlNext("/admin/dict/protwords/admin_dict_protwords_upload.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stemmeroverride/admin_dict_stemmeroverride.jsp */
|
||||
HtmlNext path_AdminDictStemmeroverride_AdminDictStemmeroverrideJsp = new HtmlNext(
|
||||
"/admin/dict/stemmeroverride/admin_dict_stemmeroverride.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stemmeroverride/admin_dict_stemmeroverride_details.jsp */
|
||||
HtmlNext path_AdminDictStemmeroverride_AdminDictStemmeroverrideDetailsJsp = new HtmlNext(
|
||||
"/admin/dict/stemmeroverride/admin_dict_stemmeroverride_details.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stemmeroverride/admin_dict_stemmeroverride_download.jsp */
|
||||
HtmlNext path_AdminDictStemmeroverride_AdminDictStemmeroverrideDownloadJsp = new HtmlNext(
|
||||
"/admin/dict/stemmeroverride/admin_dict_stemmeroverride_download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stemmeroverride/admin_dict_stemmeroverride_edit.jsp */
|
||||
HtmlNext path_AdminDictStemmeroverride_AdminDictStemmeroverrideEditJsp = new HtmlNext(
|
||||
"/admin/dict/stemmeroverride/admin_dict_stemmeroverride_edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stemmeroverride/admin_dict_stemmeroverride_upload.jsp */
|
||||
HtmlNext path_AdminDictStemmeroverride_AdminDictStemmeroverrideUploadJsp = new HtmlNext(
|
||||
"/admin/dict/stemmeroverride/admin_dict_stemmeroverride_upload.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stopwords/admin_dict_stopwords.jsp */
|
||||
HtmlNext path_AdminDictStopwords_AdminDictStopwordsJsp = new HtmlNext("/admin/dict/stopwords/admin_dict_stopwords.jsp");
|
||||
|
||||
|
@ -138,7 +159,8 @@ public interface FessHtmlPath {
|
|||
HtmlNext path_AdminDictStopwords_AdminDictStopwordsDetailsJsp = new HtmlNext("/admin/dict/stopwords/admin_dict_stopwords_details.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stopwords/admin_dict_stopwords_download.jsp */
|
||||
HtmlNext path_AdminDictStopwords_AdminDictStopwordsDownloadJsp = new HtmlNext("/admin/dict/stopwords/admin_dict_stopwords_download.jsp");
|
||||
HtmlNext path_AdminDictStopwords_AdminDictStopwordsDownloadJsp =
|
||||
new HtmlNext("/admin/dict/stopwords/admin_dict_stopwords_download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/stopwords/admin_dict_stopwords_edit.jsp */
|
||||
HtmlNext path_AdminDictStopwords_AdminDictStopwordsEditJsp = new HtmlNext("/admin/dict/stopwords/admin_dict_stopwords_edit.jsp");
|
||||
|
@ -270,7 +292,8 @@ public interface FessHtmlPath {
|
|||
HtmlNext path_AdminRelatedcontent_AdminRelatedcontentJsp = new HtmlNext("/admin/relatedcontent/admin_relatedcontent.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/relatedcontent/admin_relatedcontent_details.jsp */
|
||||
HtmlNext path_AdminRelatedcontent_AdminRelatedcontentDetailsJsp = new HtmlNext("/admin/relatedcontent/admin_relatedcontent_details.jsp");
|
||||
HtmlNext path_AdminRelatedcontent_AdminRelatedcontentDetailsJsp =
|
||||
new HtmlNext("/admin/relatedcontent/admin_relatedcontent_details.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/relatedcontent/admin_relatedcontent_edit.jsp */
|
||||
HtmlNext path_AdminRelatedcontent_AdminRelatedcontentEditJsp = new HtmlNext("/admin/relatedcontent/admin_relatedcontent_edit.jsp");
|
||||
|
|
|
@ -362,15 +362,24 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Synonym File */
|
||||
public static final String LABELS_SYNONYM_FILE = "{labels.synonymFile}";
|
||||
|
||||
/** The key of the message: Stopwords File */
|
||||
public static final String LABELS_STOPWORDS_FILE = "{labels.stopwordsFile}";
|
||||
|
||||
/** The key of the message: Stemmer Override File */
|
||||
public static final String LABELS_STEMMER_OVERRIDE_FILE = "{labels.stemmerOverrideFile}";
|
||||
|
||||
/** The key of the message: Mapping File */
|
||||
public static final String LABELS_MAPPING_FILE = "{labels.mappingFile}";
|
||||
|
||||
/** The key of the message: Protwords File */
|
||||
public static final String LABELS_PROTWORDS_FILE = "{labels.protwordsFile}";
|
||||
|
||||
/** The key of the message: Additional Word File */
|
||||
public static final String LABELS_ELEVATE_WORD_FILE = "{labels.elevateWordFile}";
|
||||
|
||||
/** The key of the message: Bad Word File */
|
||||
public static final String LABELS_BAD_WORD_FILE = "{labels.badWordFile}";
|
||||
|
||||
/** The key of the message: Mapping File */
|
||||
public static final String LABELS_MAPPING_FILE = "{labels.mappingFile}";
|
||||
|
||||
/** The key of the message: Boost Expr */
|
||||
public static final String LABELS_BOOST_EXPR = "{labels.boostExpr}";
|
||||
|
||||
|
@ -1686,7 +1695,8 @@ public class FessLabels extends UserMessages {
|
|||
public static final String LABELS_system_info_bug_report_title = "{labels.system_info_bug_report_title}";
|
||||
|
||||
/** The key of the message: system.properties does not exist. Default values are applied. */
|
||||
public static final String LABELS_system_info_system_properties_does_not_exist = "{labels.system_info_system_properties_does_not_exist}";
|
||||
public static final String LABELS_system_info_system_properties_does_not_exist =
|
||||
"{labels.system_info_system_properties_does_not_exist}";
|
||||
|
||||
/** The key of the message: File Authentication */
|
||||
public static final String LABELS_file_auth_configuration = "{labels.file_auth_configuration}";
|
||||
|
@ -1901,6 +1911,48 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Synonym File */
|
||||
public static final String LABELS_dict_synonym_file = "{labels.dict_synonym_file}";
|
||||
|
||||
/** The key of the message: Stemmer Override List */
|
||||
public static final String LABELS_dict_stemmeroverride_configuration = "{labels.dict_stemmeroverride_configuration}";
|
||||
|
||||
/** The key of the message: Stemmer Override List */
|
||||
public static final String LABELS_dict_stemmeroverride_title = "{labels.dict_stemmeroverride_title}";
|
||||
|
||||
/** The key of the message: List */
|
||||
public static final String LABELS_dict_stemmeroverride_list_link = "{labels.dict_stemmeroverride_list_link}";
|
||||
|
||||
/** The key of the message: Create New */
|
||||
public static final String LABELS_dict_stemmeroverride_link_create = "{labels.dict_stemmeroverride_link_create}";
|
||||
|
||||
/** The key of the message: Edit */
|
||||
public static final String LABELS_dict_stemmeroverride_link_edit = "{labels.dict_stemmeroverride_link_edit}";
|
||||
|
||||
/** The key of the message: Delete */
|
||||
public static final String LABELS_dict_stemmeroverride_link_delete = "{labels.dict_stemmeroverride_link_delete}";
|
||||
|
||||
/** The key of the message: Details */
|
||||
public static final String LABELS_dict_stemmeroverride_link_details = "{labels.dict_stemmeroverride_link_details}";
|
||||
|
||||
/** The key of the message: Download */
|
||||
public static final String LABELS_dict_stemmeroverride_link_download = "{labels.dict_stemmeroverride_link_download}";
|
||||
|
||||
/** The key of the message: Upload */
|
||||
public static final String LABELS_dict_stemmeroverride_link_upload = "{labels.dict_stemmeroverride_link_upload}";
|
||||
|
||||
/** The key of the message: Source */
|
||||
public static final String LABELS_dict_stemmeroverride_source = "{labels.dict_stemmeroverride_source}";
|
||||
|
||||
/** The key of the message: Target */
|
||||
public static final String LABELS_dict_stemmeroverride_target = "{labels.dict_stemmeroverride_target}";
|
||||
|
||||
/** The key of the message: Download */
|
||||
public static final String LABELS_dict_stemmeroverride_button_download = "{labels.dict_stemmeroverride_button_download}";
|
||||
|
||||
/** The key of the message: Upload */
|
||||
public static final String LABELS_dict_stemmeroverride_button_upload = "{labels.dict_stemmeroverride_button_upload}";
|
||||
|
||||
/** The key of the message: Stemmer Override File */
|
||||
public static final String LABELS_dict_stemmeroverride_file = "{labels.dict_stemmeroverride_file}";
|
||||
|
||||
/** The key of the message: Mapping List */
|
||||
public static final String LABELS_dict_mapping_configuration = "{labels.dict_mapping_configuration}";
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
*/
|
||||
package org.codelibs.fess.mylasta.action;
|
||||
|
||||
import org.codelibs.fess.mylasta.action.FessLabels;
|
||||
import org.lastaflute.core.message.UserMessage;
|
||||
|
||||
/**
|
||||
|
@ -252,6 +251,12 @@ public class FessMessages extends FessLabels {
|
|||
/** The key of the message: Failed to upload the Synonym file. */
|
||||
public static final String ERRORS_failed_to_upload_synonym_file = "{errors.failed_to_upload_synonym_file}";
|
||||
|
||||
/** The key of the message: Failed to download the Stemmer Override file. */
|
||||
public static final String ERRORS_failed_to_download_stemmeroverride_file = "{errors.failed_to_download_stemmeroverride_file}";
|
||||
|
||||
/** The key of the message: Failed to upload the Stemmer Override file. */
|
||||
public static final String ERRORS_failed_to_upload_stemmeroverride_file = "{errors.failed_to_upload_stemmeroverride_file}";
|
||||
|
||||
/** The key of the message: Failed to download the Kuromoji file. */
|
||||
public static final String ERRORS_failed_to_download_kuromoji_file = "{errors.failed_to_download_kuromoji_file}";
|
||||
|
||||
|
@ -426,6 +431,9 @@ public class FessMessages extends FessLabels {
|
|||
/** The key of the message: Uploaded Synonym file. */
|
||||
public static final String SUCCESS_upload_synonym_file = "{success.upload_synonym_file}";
|
||||
|
||||
/** The key of the message: Uploaded Stemmer Override file. */
|
||||
public static final String SUCCESS_upload_stemmeroverride_file = "{success.upload_stemmeroverride_file}";
|
||||
|
||||
/** The key of the message: Uploaded Kuromoji file. */
|
||||
public static final String SUCCESS_upload_kuromoji_file = "{success.upload_kuromoji_file}";
|
||||
|
||||
|
@ -1554,6 +1562,34 @@ public class FessMessages extends FessLabels {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.failed_to_download_stemmeroverride_file' with parameters.
|
||||
* <pre>
|
||||
* message: Failed to download the Stemmer Override file.
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @return this. (NotNull)
|
||||
*/
|
||||
public FessMessages addErrorsFailedToDownloadStemmeroverrideFile(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new UserMessage(ERRORS_failed_to_download_stemmeroverride_file));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.failed_to_upload_stemmeroverride_file' with parameters.
|
||||
* <pre>
|
||||
* message: Failed to upload the Stemmer Override file.
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @return this. (NotNull)
|
||||
*/
|
||||
public FessMessages addErrorsFailedToUploadStemmeroverrideFile(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new UserMessage(ERRORS_failed_to_upload_stemmeroverride_file));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.failed_to_download_kuromoji_file' with parameters.
|
||||
* <pre>
|
||||
|
@ -2395,6 +2431,20 @@ public class FessMessages extends FessLabels {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'success.upload_stemmeroverride_file' with parameters.
|
||||
* <pre>
|
||||
* message: Uploaded Stemmer Override file.
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @return this. (NotNull)
|
||||
*/
|
||||
public FessMessages addSuccessUploadStemmeroverrideFile(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new UserMessage(SUCCESS_upload_stemmeroverride_file));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'success.upload_kuromoji_file' with parameters.
|
||||
* <pre>
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.mylasta.direction;
|
||||
|
||||
import org.codelibs.fess.mylasta.direction.FessEnv;
|
||||
import org.lastaflute.core.direction.exception.ConfigPropertyNotFoundException;
|
||||
|
||||
/**
|
||||
|
@ -36,92 +50,92 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
String APP_DIGEST_ALGORISM = "app.digest.algorism";
|
||||
|
||||
/** The key of the configuration. e.g. -Djava.awt.headless=true
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx512m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
*/
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx512m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
*/
|
||||
String JVM_CRAWLER_OPTIONS = "jvm.crawler.options";
|
||||
|
||||
/** The key of the configuration. e.g. -Djava.awt.headless=true
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx256m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
*/
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx256m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
*/
|
||||
String JVM_SUGGEST_OPTIONS = "jvm.suggest.options";
|
||||
|
||||
/** The key of the configuration. e.g. -Djava.awt.headless=true
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx128m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
*/
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx128m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
*/
|
||||
String JVM_THUMBNAIL_OPTIONS = "jvm.thumbnail.options";
|
||||
|
||||
/** The key of the configuration. e.g. default_crawler */
|
||||
|
@ -257,8 +271,8 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
String CRAWLER_METADATA_CONTENT_EXCLUDES = "crawler.metadata.content.excludes";
|
||||
|
||||
/** The key of the configuration. e.g. title=title:string
|
||||
Title=title:string
|
||||
*/
|
||||
Title=title:string
|
||||
*/
|
||||
String CRAWLER_METADATA_NAME_MAPPING = "crawler.metadata.name.mapping";
|
||||
|
||||
/** The key of the configuration. e.g. //BODY */
|
||||
|
@ -670,65 +684,65 @@ Title=title:string
|
|||
String QUERY_GSA_DEFAULT_PREFERENCE = "query.gsa.default.preference";
|
||||
|
||||
/** The key of the configuration. e.g. ar=ar
|
||||
bg=bg
|
||||
bn=bn
|
||||
ca=ca
|
||||
ckb-iq=ckb-iq
|
||||
ckb_IQ=ckb-iq
|
||||
cs=cs
|
||||
da=da
|
||||
de=de
|
||||
el=el
|
||||
en=en
|
||||
en-ie=en-ie
|
||||
en_IE=en-ie
|
||||
es=es
|
||||
et=et
|
||||
eu=eu
|
||||
fa=fa
|
||||
fi=fi
|
||||
fr=fr
|
||||
gl=gl
|
||||
gu=gu
|
||||
he=he
|
||||
hi=hi
|
||||
hr=hr
|
||||
hu=hu
|
||||
hy=hy
|
||||
id=id
|
||||
it=it
|
||||
ja=ja
|
||||
ko=ko
|
||||
lt=lt
|
||||
lv=lv
|
||||
mk=mk
|
||||
ml=ml
|
||||
nl=nl
|
||||
no=no
|
||||
pa=pa
|
||||
pl=pl
|
||||
pt=pt
|
||||
pt-br=pt-br
|
||||
pt_BR=pt-br
|
||||
ro=ro
|
||||
ru=ru
|
||||
si=si
|
||||
sq=sq
|
||||
sv=sv
|
||||
ta=ta
|
||||
te=te
|
||||
th=th
|
||||
tl=tl
|
||||
tr=tr
|
||||
uk=uk
|
||||
ur=ur
|
||||
vi=vi
|
||||
zh-cn=zh-cn
|
||||
zh_CN=zh-cn
|
||||
zh-tw=zh-tw
|
||||
zh_TW=zh-tw
|
||||
zh=zh
|
||||
*/
|
||||
bg=bg
|
||||
bn=bn
|
||||
ca=ca
|
||||
ckb-iq=ckb-iq
|
||||
ckb_IQ=ckb-iq
|
||||
cs=cs
|
||||
da=da
|
||||
de=de
|
||||
el=el
|
||||
en=en
|
||||
en-ie=en-ie
|
||||
en_IE=en-ie
|
||||
es=es
|
||||
et=et
|
||||
eu=eu
|
||||
fa=fa
|
||||
fi=fi
|
||||
fr=fr
|
||||
gl=gl
|
||||
gu=gu
|
||||
he=he
|
||||
hi=hi
|
||||
hr=hr
|
||||
hu=hu
|
||||
hy=hy
|
||||
id=id
|
||||
it=it
|
||||
ja=ja
|
||||
ko=ko
|
||||
lt=lt
|
||||
lv=lv
|
||||
mk=mk
|
||||
ml=ml
|
||||
nl=nl
|
||||
no=no
|
||||
pa=pa
|
||||
pl=pl
|
||||
pt=pt
|
||||
pt-br=pt-br
|
||||
pt_BR=pt-br
|
||||
ro=ro
|
||||
ru=ru
|
||||
si=si
|
||||
sq=sq
|
||||
sv=sv
|
||||
ta=ta
|
||||
te=te
|
||||
th=th
|
||||
tl=tl
|
||||
tr=tr
|
||||
uk=uk
|
||||
ur=ur
|
||||
vi=vi
|
||||
zh-cn=zh-cn
|
||||
zh_CN=zh-cn
|
||||
zh-tw=zh-tw
|
||||
zh_TW=zh-tw
|
||||
zh=zh
|
||||
*/
|
||||
String QUERY_LANGUAGE_MAPPING = "query.language.mapping";
|
||||
|
||||
/** The key of the configuration. e.g. 0.2 */
|
||||
|
@ -1034,6 +1048,9 @@ zh=zh
|
|||
/** The key of the configuration. e.g. stopwords */
|
||||
String ONLINE_HELP_NAME_DICT_STOPWORDS = "online.help.name.dict.stopwords";
|
||||
|
||||
/** The key of the configuration. e.g. stemmeroverride */
|
||||
String ONLINE_HELP_NAME_DICT_STEMMEROVERRIDE = "online.help.name.dict.stemmeroverride";
|
||||
|
||||
/** The key of the configuration. e.g. mapping */
|
||||
String ONLINE_HELP_NAME_DICT_MAPPING = "online.help.name.dict.mapping";
|
||||
|
||||
|
@ -1516,35 +1533,35 @@ zh=zh
|
|||
/**
|
||||
* Get the value for the key 'jvm.crawler.options'. <br>
|
||||
* The value is, e.g. -Djava.awt.headless=true
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx512m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
<br>
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx512m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
<br>
|
||||
* comment: JVM options
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
|
@ -1553,28 +1570,28 @@ zh=zh
|
|||
/**
|
||||
* Get the value for the key 'jvm.suggest.options'. <br>
|
||||
* The value is, e.g. -Djava.awt.headless=true
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx256m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
<br>
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx256m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
<br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getJvmSuggestOptions();
|
||||
|
@ -1582,35 +1599,35 @@ zh=zh
|
|||
/**
|
||||
* Get the value for the key 'jvm.thumbnail.options'. <br>
|
||||
* The value is, e.g. -Djava.awt.headless=true
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx128m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
<br>
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djna.nosys=true
|
||||
-Djdk.io.permissionsUseCanonicalPath=true
|
||||
-server
|
||||
-Xmx128m
|
||||
-XX:MaxMetaspaceSize=128m
|
||||
-XX:CompressedClassSpaceSize=32m
|
||||
-XX:-UseGCOverheadLimit
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:CMSInitiatingOccupancyFraction=75
|
||||
-XX:+UseCMSInitiatingOccupancyOnly
|
||||
-XX:+UseTLAB
|
||||
-XX:+DisableExplicitGC
|
||||
-XX:+HeapDumpOnOutOfMemoryError
|
||||
-XX:-OmitStackTraceInFastThrow
|
||||
-Djcifs.smb.client.responseTimeout=30000
|
||||
-Djcifs.smb.client.soTimeout=35000
|
||||
-Djcifs.smb.client.connTimeout=60000
|
||||
-Djcifs.smb.client.sessionTimeout=60000
|
||||
-Dgroovy.use.classvalue=true
|
||||
-Dio.netty.noUnsafe=true
|
||||
-Dio.netty.noKeySetOptimization=true
|
||||
-Dio.netty.recycler.maxCapacityPerThread=0
|
||||
-Dlog4j.shutdownHookEnabled=false
|
||||
-Dlog4j2.disable.jmx=true
|
||||
-Dlog4j.skipJansi=true
|
||||
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
|
||||
-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true
|
||||
<br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getJvmThumbnailOptions();
|
||||
|
@ -2104,8 +2121,8 @@ zh=zh
|
|||
/**
|
||||
* Get the value for the key 'crawler.metadata.name.mapping'. <br>
|
||||
* The value is, e.g. title=title:string
|
||||
Title=title:string
|
||||
<br>
|
||||
Title=title:string
|
||||
<br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getCrawlerMetadataNameMapping();
|
||||
|
@ -3526,65 +3543,65 @@ Title=title:string
|
|||
/**
|
||||
* Get the value for the key 'query.language.mapping'. <br>
|
||||
* The value is, e.g. ar=ar
|
||||
bg=bg
|
||||
bn=bn
|
||||
ca=ca
|
||||
ckb-iq=ckb-iq
|
||||
ckb_IQ=ckb-iq
|
||||
cs=cs
|
||||
da=da
|
||||
de=de
|
||||
el=el
|
||||
en=en
|
||||
en-ie=en-ie
|
||||
en_IE=en-ie
|
||||
es=es
|
||||
et=et
|
||||
eu=eu
|
||||
fa=fa
|
||||
fi=fi
|
||||
fr=fr
|
||||
gl=gl
|
||||
gu=gu
|
||||
he=he
|
||||
hi=hi
|
||||
hr=hr
|
||||
hu=hu
|
||||
hy=hy
|
||||
id=id
|
||||
it=it
|
||||
ja=ja
|
||||
ko=ko
|
||||
lt=lt
|
||||
lv=lv
|
||||
mk=mk
|
||||
ml=ml
|
||||
nl=nl
|
||||
no=no
|
||||
pa=pa
|
||||
pl=pl
|
||||
pt=pt
|
||||
pt-br=pt-br
|
||||
pt_BR=pt-br
|
||||
ro=ro
|
||||
ru=ru
|
||||
si=si
|
||||
sq=sq
|
||||
sv=sv
|
||||
ta=ta
|
||||
te=te
|
||||
th=th
|
||||
tl=tl
|
||||
tr=tr
|
||||
uk=uk
|
||||
ur=ur
|
||||
vi=vi
|
||||
zh-cn=zh-cn
|
||||
zh_CN=zh-cn
|
||||
zh-tw=zh-tw
|
||||
zh_TW=zh-tw
|
||||
zh=zh
|
||||
<br>
|
||||
bg=bg
|
||||
bn=bn
|
||||
ca=ca
|
||||
ckb-iq=ckb-iq
|
||||
ckb_IQ=ckb-iq
|
||||
cs=cs
|
||||
da=da
|
||||
de=de
|
||||
el=el
|
||||
en=en
|
||||
en-ie=en-ie
|
||||
en_IE=en-ie
|
||||
es=es
|
||||
et=et
|
||||
eu=eu
|
||||
fa=fa
|
||||
fi=fi
|
||||
fr=fr
|
||||
gl=gl
|
||||
gu=gu
|
||||
he=he
|
||||
hi=hi
|
||||
hr=hr
|
||||
hu=hu
|
||||
hy=hy
|
||||
id=id
|
||||
it=it
|
||||
ja=ja
|
||||
ko=ko
|
||||
lt=lt
|
||||
lv=lv
|
||||
mk=mk
|
||||
ml=ml
|
||||
nl=nl
|
||||
no=no
|
||||
pa=pa
|
||||
pl=pl
|
||||
pt=pt
|
||||
pt-br=pt-br
|
||||
pt_BR=pt-br
|
||||
ro=ro
|
||||
ru=ru
|
||||
si=si
|
||||
sq=sq
|
||||
sv=sv
|
||||
ta=ta
|
||||
te=te
|
||||
th=th
|
||||
tl=tl
|
||||
tr=tr
|
||||
uk=uk
|
||||
ur=ur
|
||||
vi=vi
|
||||
zh-cn=zh-cn
|
||||
zh_CN=zh-cn
|
||||
zh-tw=zh-tw
|
||||
zh_TW=zh-tw
|
||||
zh=zh
|
||||
<br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getQueryLanguageMapping();
|
||||
|
@ -4878,6 +4895,13 @@ zh=zh
|
|||
*/
|
||||
String getOnlineHelpNameDictStopwords();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.name.dict.stemmeroverride'. <br>
|
||||
* The value is, e.g. stemmeroverride <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getOnlineHelpNameDictStemmeroverride();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.name.dict.mapping'. <br>
|
||||
* The value is, e.g. mapping <br>
|
||||
|
@ -7815,6 +7839,10 @@ zh=zh
|
|||
return get(FessConfig.ONLINE_HELP_NAME_DICT_STOPWORDS);
|
||||
}
|
||||
|
||||
public String getOnlineHelpNameDictStemmeroverride() {
|
||||
return get(FessConfig.ONLINE_HELP_NAME_DICT_STEMMEROVERRIDE);
|
||||
}
|
||||
|
||||
public String getOnlineHelpNameDictMapping() {
|
||||
return get(FessConfig.ONLINE_HELP_NAME_DICT_MAPPING);
|
||||
}
|
||||
|
@ -8467,14 +8495,22 @@ zh=zh
|
|||
defaultMap.put(FessConfig.APP_CIPHER_ALGORISM, "aes");
|
||||
defaultMap.put(FessConfig.APP_CIPHER_KEY, "___change__me___");
|
||||
defaultMap.put(FessConfig.APP_DIGEST_ALGORISM, "sha256");
|
||||
defaultMap.put(FessConfig.JVM_CRAWLER_OPTIONS, "-Djava.awt.headless=true\n-Dfile.encoding=UTF-8\n-Djna.nosys=true\n-Djdk.io.permissionsUseCanonicalPath=true\n-server\n-Xmx512m\n-XX:MaxMetaspaceSize=128m\n-XX:CompressedClassSpaceSize=32m\n-XX:-UseGCOverheadLimit\n-XX:+UseConcMarkSweepGC\n-XX:CMSInitiatingOccupancyFraction=75\n-XX:+UseCMSInitiatingOccupancyOnly\n-XX:+UseTLAB\n-XX:+DisableExplicitGC\n-XX:+HeapDumpOnOutOfMemoryError\n-XX:-OmitStackTraceInFastThrow\n-Djcifs.smb.client.responseTimeout=30000\n-Djcifs.smb.client.soTimeout=35000\n-Djcifs.smb.client.connTimeout=60000\n-Djcifs.smb.client.sessionTimeout=60000\n-Dgroovy.use.classvalue=true\n-Dio.netty.noUnsafe=true\n-Dio.netty.noKeySetOptimization=true\n-Dio.netty.recycler.maxCapacityPerThread=0\n-Dlog4j.shutdownHookEnabled=false\n-Dlog4j2.disable.jmx=true\n-Dlog4j.skipJansi=true\n-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider\n-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true\n");
|
||||
defaultMap.put(FessConfig.JVM_SUGGEST_OPTIONS, "-Djava.awt.headless=true\n-Dfile.encoding=UTF-8\n-Djna.nosys=true\n-Djdk.io.permissionsUseCanonicalPath=true\n-server\n-Xmx256m\n-XX:MaxMetaspaceSize=128m\n-XX:CompressedClassSpaceSize=32m\n-XX:-UseGCOverheadLimit\n-XX:+UseConcMarkSweepGC\n-XX:CMSInitiatingOccupancyFraction=75\n-XX:+UseCMSInitiatingOccupancyOnly\n-XX:+UseTLAB\n-XX:+DisableExplicitGC\n-XX:+HeapDumpOnOutOfMemoryError\n-Dgroovy.use.classvalue=true\n-Dio.netty.noUnsafe=true\n-Dio.netty.noKeySetOptimization=true\n-Dio.netty.recycler.maxCapacityPerThread=0\n-Dlog4j.shutdownHookEnabled=false\n-Dlog4j2.disable.jmx=true\n-Dlog4j.skipJansi=true\n");
|
||||
defaultMap.put(FessConfig.JVM_THUMBNAIL_OPTIONS, "-Djava.awt.headless=true\n-Dfile.encoding=UTF-8\n-Djna.nosys=true\n-Djdk.io.permissionsUseCanonicalPath=true\n-server\n-Xmx128m\n-XX:MaxMetaspaceSize=128m\n-XX:CompressedClassSpaceSize=32m\n-XX:-UseGCOverheadLimit\n-XX:+UseConcMarkSweepGC\n-XX:CMSInitiatingOccupancyFraction=75\n-XX:+UseCMSInitiatingOccupancyOnly\n-XX:+UseTLAB\n-XX:+DisableExplicitGC\n-XX:+HeapDumpOnOutOfMemoryError\n-XX:-OmitStackTraceInFastThrow\n-Djcifs.smb.client.responseTimeout=30000\n-Djcifs.smb.client.soTimeout=35000\n-Djcifs.smb.client.connTimeout=60000\n-Djcifs.smb.client.sessionTimeout=60000\n-Dgroovy.use.classvalue=true\n-Dio.netty.noUnsafe=true\n-Dio.netty.noKeySetOptimization=true\n-Dio.netty.recycler.maxCapacityPerThread=0\n-Dlog4j.shutdownHookEnabled=false\n-Dlog4j2.disable.jmx=true\n-Dlog4j.skipJansi=true\n-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider\n-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true\n");
|
||||
defaultMap
|
||||
.put(FessConfig.JVM_CRAWLER_OPTIONS,
|
||||
"-Djava.awt.headless=true\n-Dfile.encoding=UTF-8\n-Djna.nosys=true\n-Djdk.io.permissionsUseCanonicalPath=true\n-server\n-Xmx512m\n-XX:MaxMetaspaceSize=128m\n-XX:CompressedClassSpaceSize=32m\n-XX:-UseGCOverheadLimit\n-XX:+UseConcMarkSweepGC\n-XX:CMSInitiatingOccupancyFraction=75\n-XX:+UseCMSInitiatingOccupancyOnly\n-XX:+UseTLAB\n-XX:+DisableExplicitGC\n-XX:+HeapDumpOnOutOfMemoryError\n-XX:-OmitStackTraceInFastThrow\n-Djcifs.smb.client.responseTimeout=30000\n-Djcifs.smb.client.soTimeout=35000\n-Djcifs.smb.client.connTimeout=60000\n-Djcifs.smb.client.sessionTimeout=60000\n-Dgroovy.use.classvalue=true\n-Dio.netty.noUnsafe=true\n-Dio.netty.noKeySetOptimization=true\n-Dio.netty.recycler.maxCapacityPerThread=0\n-Dlog4j.shutdownHookEnabled=false\n-Dlog4j2.disable.jmx=true\n-Dlog4j.skipJansi=true\n-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider\n-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true\n");
|
||||
defaultMap
|
||||
.put(FessConfig.JVM_SUGGEST_OPTIONS,
|
||||
"-Djava.awt.headless=true\n-Dfile.encoding=UTF-8\n-Djna.nosys=true\n-Djdk.io.permissionsUseCanonicalPath=true\n-server\n-Xmx256m\n-XX:MaxMetaspaceSize=128m\n-XX:CompressedClassSpaceSize=32m\n-XX:-UseGCOverheadLimit\n-XX:+UseConcMarkSweepGC\n-XX:CMSInitiatingOccupancyFraction=75\n-XX:+UseCMSInitiatingOccupancyOnly\n-XX:+UseTLAB\n-XX:+DisableExplicitGC\n-XX:+HeapDumpOnOutOfMemoryError\n-Dgroovy.use.classvalue=true\n-Dio.netty.noUnsafe=true\n-Dio.netty.noKeySetOptimization=true\n-Dio.netty.recycler.maxCapacityPerThread=0\n-Dlog4j.shutdownHookEnabled=false\n-Dlog4j2.disable.jmx=true\n-Dlog4j.skipJansi=true\n");
|
||||
defaultMap
|
||||
.put(FessConfig.JVM_THUMBNAIL_OPTIONS,
|
||||
"-Djava.awt.headless=true\n-Dfile.encoding=UTF-8\n-Djna.nosys=true\n-Djdk.io.permissionsUseCanonicalPath=true\n-server\n-Xmx128m\n-XX:MaxMetaspaceSize=128m\n-XX:CompressedClassSpaceSize=32m\n-XX:-UseGCOverheadLimit\n-XX:+UseConcMarkSweepGC\n-XX:CMSInitiatingOccupancyFraction=75\n-XX:+UseCMSInitiatingOccupancyOnly\n-XX:+UseTLAB\n-XX:+DisableExplicitGC\n-XX:+HeapDumpOnOutOfMemoryError\n-XX:-OmitStackTraceInFastThrow\n-Djcifs.smb.client.responseTimeout=30000\n-Djcifs.smb.client.soTimeout=35000\n-Djcifs.smb.client.connTimeout=60000\n-Djcifs.smb.client.sessionTimeout=60000\n-Dgroovy.use.classvalue=true\n-Dio.netty.noUnsafe=true\n-Dio.netty.noKeySetOptimization=true\n-Dio.netty.recycler.maxCapacityPerThread=0\n-Dlog4j.shutdownHookEnabled=false\n-Dlog4j2.disable.jmx=true\n-Dlog4j.skipJansi=true\n-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider\n-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true\n");
|
||||
defaultMap.put(FessConfig.JOB_SYSTEM_JOB_IDS, "default_crawler");
|
||||
defaultMap.put(FessConfig.JOB_TEMPLATE_TITLE_WEB, "Web Crawler - {0}");
|
||||
defaultMap.put(FessConfig.JOB_TEMPLATE_TITLE_FILE, "File Crawler - {0}");
|
||||
defaultMap.put(FessConfig.JOB_TEMPLATE_TITLE_DATA, "Data Crawler - {0}");
|
||||
defaultMap.put(FessConfig.JOB_TEMPLATE_SCRIPT, "return container.getComponent(\"crawlJob\").logLevel(\"info\").sessionId(\"{3}\").webConfigIds([{0}] as String[]).fileConfigIds([{1}] as String[]).dataConfigIds([{2}] as String[]).jobExecutor(executor).execute();");
|
||||
defaultMap
|
||||
.put(FessConfig.JOB_TEMPLATE_SCRIPT,
|
||||
"return container.getComponent(\"crawlJob\").logLevel(\"info\").sessionId(\"{3}\").webConfigIds([{0}] as String[]).fileConfigIds([{1}] as String[]).dataConfigIds([{2}] as String[]).jobExecutor(executor).execute();");
|
||||
defaultMap.put(FessConfig.JAVA_COMMAND_PATH, "java");
|
||||
defaultMap.put(FessConfig.PATH_ENCODING, "UTF-8");
|
||||
defaultMap.put(FessConfig.USE_OWN_TMP_DIR, "true");
|
||||
|
@ -8483,7 +8519,9 @@ zh=zh
|
|||
defaultMap.put(FessConfig.SUPPORTED_UPLOADED_CSS_EXTENTIONS, "css");
|
||||
defaultMap.put(FessConfig.SUPPORTED_UPLOADED_MEDIA_EXTENTIONS, "jpg,jpeg,gif,png,swf");
|
||||
defaultMap.put(FessConfig.SUPPORTED_UPLOADED_FILES, "license.properties");
|
||||
defaultMap.put(FessConfig.SUPPORTED_LANGUAGES, "ar,bg,bn,ca,ckb_IQ,cs,da,de,el,en,en_IE,es,et,eu,fa,fi,fr,gl,gu,he,hi,hr,hu,hy,id,it,ja,ko,lt,lv,mk,ml,nl,no,pa,pl,pt,pt_BR,ro,ru,si,sq,sv,ta,te,th,tl,tr,uk,ur,vi,zh_CN,zh_TW,zh");
|
||||
defaultMap
|
||||
.put(FessConfig.SUPPORTED_LANGUAGES,
|
||||
"ar,bg,bn,ca,ckb_IQ,cs,da,de,el,en,en_IE,es,et,eu,fa,fi,fr,gl,gu,he,hi,hr,hu,hy,id,it,ja,ko,lt,lv,mk,ml,nl,no,pa,pl,pt,pt_BR,ro,ru,si,sq,sv,ta,te,th,tl,tr,uk,ur,vi,zh_CN,zh_TW,zh");
|
||||
defaultMap.put(FessConfig.API_ACCESS_TOKEN_LENGTH, "60");
|
||||
defaultMap.put(FessConfig.API_ACCESS_TOKEN_REQUIRED, "false");
|
||||
defaultMap.put(FessConfig.API_ACCESS_TOKEN_REQUEST_PARAMETER, "");
|
||||
|
@ -8503,7 +8541,9 @@ zh=zh
|
|||
defaultMap.put(FessConfig.CRAWLER_DOCUMENT_MAX_ALPHANUM_TERM_SIZE, "20");
|
||||
defaultMap.put(FessConfig.CRAWLER_DOCUMENT_MAX_SYMBOL_TERM_SIZE, "10");
|
||||
defaultMap.put(FessConfig.CRAWLER_DOCUMENT_DUPLICATE_TERM_REMOVED, "false");
|
||||
defaultMap.put(FessConfig.CRAWLER_DOCUMENT_SPACE_CHARS, "u0009u000Au000Bu000Cu000Du001Cu001Du001Eu001Fu0020u00A0u1680u180Eu2000u2001u2002u2003u2004u2005u2006u2007u2008u2009u200Au200Bu200Cu202Fu205Fu3000uFEFFuFFFDu00B6");
|
||||
defaultMap
|
||||
.put(FessConfig.CRAWLER_DOCUMENT_SPACE_CHARS,
|
||||
"u0009u000Au000Bu000Cu000Du001Cu001Du001Eu001Fu0020u00A0u1680u180Eu2000u2001u2002u2003u2004u2005u2006u2007u2008u2009u200Au200Bu200Cu202Fu205Fu3000uFEFFuFFFDu00B6");
|
||||
defaultMap.put(FessConfig.CRAWLER_DOCUMENT_FULLSTOP_CHARS, "u002eu06d4u2e3cu3002");
|
||||
defaultMap.put(FessConfig.CRAWLER_CRAWLING_DATA_ENCODING, "UTF-8");
|
||||
defaultMap.put(FessConfig.CRAWLER_WEB_PROTOCOLS, "http,https");
|
||||
|
@ -8651,7 +8691,9 @@ zh=zh
|
|||
defaultMap.put(FessConfig.QUERY_DEFAULT_LANGUAGES, "");
|
||||
defaultMap.put(FessConfig.QUERY_JSON_DEFAULT_PREFERENCE, "_query");
|
||||
defaultMap.put(FessConfig.QUERY_GSA_DEFAULT_PREFERENCE, "_query");
|
||||
defaultMap.put(FessConfig.QUERY_LANGUAGE_MAPPING, "ar=ar\nbg=bg\nbn=bn\nca=ca\nckb-iq=ckb-iq\nckb_IQ=ckb-iq\ncs=cs\nda=da\nde=de\nel=el\nen=en\nen-ie=en-ie\nen_IE=en-ie\nes=es\net=et\neu=eu\nfa=fa\nfi=fi\nfr=fr\ngl=gl\ngu=gu\nhe=he\nhi=hi\nhr=hr\nhu=hu\nhy=hy\nid=id\nit=it\nja=ja\nko=ko\nlt=lt\nlv=lv\nmk=mk\nml=ml\nnl=nl\nno=no\npa=pa\npl=pl\npt=pt\npt-br=pt-br\npt_BR=pt-br\nro=ro\nru=ru\nsi=si\nsq=sq\nsv=sv\nta=ta\nte=te\nth=th\ntl=tl\ntr=tr\nuk=uk\nur=ur\nvi=vi\nzh-cn=zh-cn\nzh_CN=zh-cn\nzh-tw=zh-tw\nzh_TW=zh-tw\nzh=zh\n");
|
||||
defaultMap
|
||||
.put(FessConfig.QUERY_LANGUAGE_MAPPING,
|
||||
"ar=ar\nbg=bg\nbn=bn\nca=ca\nckb-iq=ckb-iq\nckb_IQ=ckb-iq\ncs=cs\nda=da\nde=de\nel=el\nen=en\nen-ie=en-ie\nen_IE=en-ie\nes=es\net=et\neu=eu\nfa=fa\nfi=fi\nfr=fr\ngl=gl\ngu=gu\nhe=he\nhi=hi\nhr=hr\nhu=hu\nhy=hy\nid=id\nit=it\nja=ja\nko=ko\nlt=lt\nlv=lv\nmk=mk\nml=ml\nnl=nl\nno=no\npa=pa\npl=pl\npt=pt\npt-br=pt-br\npt_BR=pt-br\nro=ro\nru=ru\nsi=si\nsq=sq\nsv=sv\nta=ta\nte=te\nth=th\ntl=tl\ntr=tr\nuk=uk\nur=ur\nvi=vi\nzh-cn=zh-cn\nzh_CN=zh-cn\nzh-tw=zh-tw\nzh_TW=zh-tw\nzh=zh\n");
|
||||
defaultMap.put(FessConfig.QUERY_BOOST_TITLE, "0.2");
|
||||
defaultMap.put(FessConfig.QUERY_BOOST_TITLE_LANG, "1.0");
|
||||
defaultMap.put(FessConfig.QUERY_BOOST_CONTENT, "0.1");
|
||||
|
@ -8663,7 +8705,9 @@ zh=zh
|
|||
defaultMap.put(FessConfig.INDEX_BACKUP_TARGETS, ".fess_basic_config.bulk,.fess_config.bulk,.fess_user.bulk,system.properties");
|
||||
defaultMap.put(FessConfig.INDEX_BACKUP_LOG_TARGETS, "click_log.ndjson,favorite_log.ndjson,search_log.ndjson,user_info.ndjson");
|
||||
defaultMap.put(FessConfig.LOGGING_SEARCH_DOCS_ENABLED, "true");
|
||||
defaultMap.put(FessConfig.LOGGING_SEARCH_DOCS_FIELDS, "filetype,created,click_count,title,doc_id,url,score,site,filename,host,digest,boost,mimetype,favorite_count,_id,lang,last_modified,content_length,timestamp");
|
||||
defaultMap
|
||||
.put(FessConfig.LOGGING_SEARCH_DOCS_FIELDS,
|
||||
"filetype,created,click_count,title,doc_id,url,score,site,filename,host,digest,boost,mimetype,favorite_count,_id,lang,last_modified,content_length,timestamp");
|
||||
defaultMap.put(FessConfig.FORM_ADMIN_MAX_INPUT_SIZE, "4000");
|
||||
defaultMap.put(FessConfig.AUTHENTICATION_ADMIN_USERS, "admin");
|
||||
defaultMap.put(FessConfig.AUTHENTICATION_ADMIN_ROLES, "admin");
|
||||
|
@ -8753,6 +8797,7 @@ zh=zh
|
|||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_KUROMOJI, "kuromoji");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_PROTWORDS, "protwords");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_STOPWORDS, "stopwords");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_STEMMEROVERRIDE, "stemmeroverride");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_MAPPING, "mapping");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_WEBCONFIG, "webconfig");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_SEARCHLIST, "searchlist");
|
||||
|
|
|
@ -547,6 +547,7 @@ online.help.name.dict=dict
|
|||
online.help.name.dict.kuromoji=kuromoji
|
||||
online.help.name.dict.protwords=protwords
|
||||
online.help.name.dict.stopwords=stopwords
|
||||
online.help.name.dict.stemmeroverride=stemmeroverride
|
||||
online.help.name.dict.mapping=mapping
|
||||
online.help.name.webconfig=webconfig
|
||||
online.help.name.searchlist=searchlist
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
<postConstruct name="addCreator">
|
||||
<arg>synonymCreator</arg>
|
||||
</postConstruct>
|
||||
<postConstruct name="addCreator">
|
||||
<arg>stemmerOverrideCreator</arg>
|
||||
</postConstruct>
|
||||
<postConstruct name="addCreator">
|
||||
<arg>protwordsCreator</arg>
|
||||
</postConstruct>
|
||||
|
@ -28,6 +31,9 @@
|
|||
<component name="synonymCreator"
|
||||
class="org.codelibs.fess.dict.synonym.SynonymCreator">
|
||||
</component>
|
||||
<component name="stemmerOverrideCreator"
|
||||
class="org.codelibs.fess.dict.stemmeroverride.StemmerOverrideCreator">
|
||||
</component>
|
||||
<component name="protwordsCreator"
|
||||
class="org.codelibs.fess.dict.protwords.ProtwordsCreator">
|
||||
</component>
|
||||
|
|
|
@ -110,9 +110,13 @@ labels.startTime=Start Time
|
|||
labels.target=Target
|
||||
labels.token=Token
|
||||
labels.synonymFile=Synonym File
|
||||
labels.stopwordsFile=Stopwords File
|
||||
labels.stemmerOverrideFile=Stemmer Override File
|
||||
labels.mappingFile=Mapping File
|
||||
labels.protwordsFile=Protwords File
|
||||
labels.kuromojiFile=Kuromoji File
|
||||
labels.elevateWordFile=Additional Word File
|
||||
labels.badWordFile=Bad Word File
|
||||
labels.mappingFile=Mapping File
|
||||
labels.boostExpr=Boost Expr
|
||||
labels.confirmPassword=Confirm
|
||||
labels.crawler=Crawler
|
||||
|
@ -624,6 +628,20 @@ labels.dict_synonym_target=Target
|
|||
labels.dict_synonym_button_download=Download
|
||||
labels.dict_synonym_button_upload=Upload
|
||||
labels.dict_synonym_file=Synonym File
|
||||
labels.dict_stemmeroverride_configuration=Stemmer Override List
|
||||
labels.dict_stemmeroverride_title=Stemmer Override List
|
||||
labels.dict_stemmeroverride_list_link=List
|
||||
labels.dict_stemmeroverride_link_create=Create New
|
||||
labels.dict_stemmeroverride_link_edit=Edit
|
||||
labels.dict_stemmeroverride_link_delete=Delete
|
||||
labels.dict_stemmeroverride_link_details=Details
|
||||
labels.dict_stemmeroverride_link_download=Download
|
||||
labels.dict_stemmeroverride_link_upload=Upload
|
||||
labels.dict_stemmeroverride_source=Source
|
||||
labels.dict_stemmeroverride_target=Target
|
||||
labels.dict_stemmeroverride_button_download=Download
|
||||
labels.dict_stemmeroverride_button_upload=Upload
|
||||
labels.dict_stemmeroverride_file=Stemmer Override File
|
||||
labels.dict_mapping_configuration=Mapping List
|
||||
labels.dict_mapping_title=Mapping List
|
||||
labels.dict_mapping_list_link=List
|
||||
|
|
|
@ -110,9 +110,13 @@ labels.startTime=Start Time
|
|||
labels.target=Target
|
||||
labels.token=Token
|
||||
labels.synonymFile=Synonym File
|
||||
labels.stopwordsFile=Stopwords File
|
||||
labels.stemmerOverrideFile=Stemmer Override File
|
||||
labels.mappingFile=Mapping File
|
||||
labels.protwordsFile=Protwords File
|
||||
labels.kuromojiFile=Kuromoji File
|
||||
labels.elevateWordFile=Additional Word File
|
||||
labels.badWordFile=Bad Word File
|
||||
labels.mappingFile=Mapping File
|
||||
labels.boostExpr=Boost Expr
|
||||
labels.confirmPassword=Confirm
|
||||
labels.crawler=Crawler
|
||||
|
@ -624,6 +628,20 @@ labels.dict_synonym_target=Target
|
|||
labels.dict_synonym_button_download=Download
|
||||
labels.dict_synonym_button_upload=Upload
|
||||
labels.dict_synonym_file=Synonym File
|
||||
labels.dict_stemmeroverride_configuration=Stemmer Override List
|
||||
labels.dict_stemmeroverride_title=Stemmer Override List
|
||||
labels.dict_stemmeroverride_list_link=List
|
||||
labels.dict_stemmeroverride_link_create=Create New
|
||||
labels.dict_stemmeroverride_link_edit=Edit
|
||||
labels.dict_stemmeroverride_link_delete=Delete
|
||||
labels.dict_stemmeroverride_link_details=Details
|
||||
labels.dict_stemmeroverride_link_download=Download
|
||||
labels.dict_stemmeroverride_link_upload=Upload
|
||||
labels.dict_stemmeroverride_source=Source
|
||||
labels.dict_stemmeroverride_target=Target
|
||||
labels.dict_stemmeroverride_button_download=Download
|
||||
labels.dict_stemmeroverride_button_upload=Upload
|
||||
labels.dict_stemmeroverride_file=Stemmer Override File
|
||||
labels.dict_mapping_configuration=Mapping List
|
||||
labels.dict_mapping_title=Mapping List
|
||||
labels.dict_mapping_list_link=List
|
||||
|
|
|
@ -110,9 +110,13 @@ labels.startTime=開始時間
|
|||
labels.target=対象
|
||||
labels.token=トークン
|
||||
labels.synonymFile=同義語ファイル
|
||||
labels.stopwordsFile=ストップワードファイル
|
||||
labels.stemmerOverrideFile=Stemmer上書きファイル
|
||||
labels.mappingFile=マッピングファイル
|
||||
labels.protwordsFile=Protwordsファイル
|
||||
labels.kuromojiFile=Kuromojiファイル
|
||||
labels.elevateWordFile=追加ワードファイル
|
||||
labels.badWordFile=除外ワードファイル
|
||||
labels.mappingFile=マッピングファイル
|
||||
labels.boostExpr=ブースト値式
|
||||
labels.confirmPassword=確認
|
||||
labels.crawler=クローラ
|
||||
|
@ -616,7 +620,20 @@ labels.dict_synonym_target=変換後
|
|||
labels.dict_synonym_button_download=ダウンロード
|
||||
labels.dict_synonym_button_upload=アップロード
|
||||
labels.dict_synonym_file=同義語ファイル
|
||||
|
||||
labels.dict_stemmeroverride_configuration=Stemmer上書きリスト
|
||||
labels.dict_stemmeroverride_title=Stemmer上書きリスト
|
||||
labels.dict_stemmeroverride_list_link=一覧
|
||||
labels.dict_stemmeroverride_link_create=新規作成
|
||||
labels.dict_stemmeroverride_link_edit=編集
|
||||
labels.dict_stemmeroverride_link_delete=削除
|
||||
labels.dict_stemmeroverride_link_details=詳細
|
||||
labels.dict_stemmeroverride_link_download=ダウンロード
|
||||
labels.dict_stemmeroverride_link_upload=アップロード
|
||||
labels.dict_stemmeroverride_source=変換元
|
||||
labels.dict_stemmeroverride_target=変換後
|
||||
labels.dict_stemmeroverride_button_download=ダウンロード
|
||||
labels.dict_stemmeroverride_button_upload=アップロード
|
||||
labels.dict_stemmeroverride_file=Stemmer上書きファイル
|
||||
labels.dict_mapping_configuration=マッピング辞書
|
||||
labels.dict_mapping_title=マッピング辞書
|
||||
labels.dict_mapping_list_link=一覧
|
||||
|
@ -631,7 +648,6 @@ labels.dict_mapping_target=変換後
|
|||
labels.dict_mapping_button_download=ダウンロード
|
||||
labels.dict_mapping_button_upload=アップロード
|
||||
labels.dict_mapping_file=マッピングファイル
|
||||
|
||||
labels.dict_kuromoji_configuration=Kuromoji単語一覧
|
||||
labels.dict_kuromoji_title=Kuromoji単語一覧
|
||||
labels.dict_kuromoji_list_link=一覧
|
||||
|
|
|
@ -105,6 +105,8 @@ errors.failed_to_start_job=Failed to start job {0}.
|
|||
errors.failed_to_stop_job=Failed to stop job {0}.
|
||||
errors.failed_to_download_synonym_file=Failed to download the Synonym file.
|
||||
errors.failed_to_upload_synonym_file=Failed to upload the Synonym file.
|
||||
errors.failed_to_download_stemmeroverride_file=Failed to download the Stemmer Override file.
|
||||
errors.failed_to_upload_stemmeroverride_file=Failed to upload the Stemmer Override file.
|
||||
errors.failed_to_download_kuromoji_file=Failed to download the Kuromoji file.
|
||||
errors.failed_to_upload_kuromoji_file=Failed to upload the Kuromoji file.
|
||||
errors.failed_to_download_protwords_file=Failed to download the Protwords file.
|
||||
|
@ -167,6 +169,7 @@ success.delete_file=Deleted {0} file.
|
|||
success.job_started=Started job {0}.
|
||||
success.job_stopped=Stopped job {0}.
|
||||
success.upload_synonym_file=Uploaded Synonym file.
|
||||
success.upload_stemmeroverride_file=Uploaded Stemmer Override file.
|
||||
success.upload_kuromoji_file=Uploaded Kuromoji file.
|
||||
success.upload_elevate_word=Uploaded Additional Word file.
|
||||
success.upload_bad_word=Uploaded Bad Word file.
|
||||
|
|
|
@ -101,6 +101,8 @@ errors.failed_to_start_job=Failed to start job {0}.
|
|||
errors.failed_to_stop_job=Failed to stop job {0}.
|
||||
errors.failed_to_download_synonym_file=Failed to download the Synonym file.
|
||||
errors.failed_to_upload_synonym_file=Failed to upload the Synonym file.
|
||||
errors.failed_to_download_stemmeroverride_file=Failed to download the Stemmer Override file.
|
||||
errors.failed_to_upload_stemmeroverride_file=Failed to upload the Stemmer Override file.
|
||||
errors.failed_to_download_kuromoji_file=Failed to download the Kuromoji file.
|
||||
errors.failed_to_upload_kuromoji_file=Failed to upload the Kuromoji file.
|
||||
errors.failed_to_download_elevate_file=Failed to download the Elevate file.
|
||||
|
@ -161,6 +163,7 @@ success.delete_file=Deleted {0} file.
|
|||
success.job_started=Started job {0}.
|
||||
success.job_stopped=Stopped job {0}.
|
||||
success.upload_synonym_file=Uploaded Synonym file.
|
||||
success.upload_stemmeroverride_file=Uploaded Stemmer Override file.
|
||||
success.upload_kuromoji_file=Uploaded Kuromoji file.
|
||||
success.upload_elevate_word=Uploaded Additional Word file.
|
||||
success.upload_bad_word=Uploaded Bad Word file.
|
||||
|
|
|
@ -97,6 +97,8 @@ errors.failed_to_start_job = ジョブ {0} を開始できませんでした。
|
|||
errors.failed_to_stop_job = ジョブ {0} を停止に失敗しました。
|
||||
errors.failed_to_download_synonym_file = 同義語ファイルのダウンロードに失敗しました。
|
||||
errors.failed_to_upload_synonym_file = 同義語ファイルをアップロードに失敗しました。
|
||||
errors.failed_to_download_stemmeroverride_file = Stemmer上書きファイルのダウンロードに失敗しました。
|
||||
errors.failed_to_upload_stemmeroverride_file = Stemmer上書きファイルをアップロードに失敗しました。
|
||||
errors.failed_to_download_kuromoji_file = Kuromojiファイルのダウンロードに失敗しました。
|
||||
errors.failed_to_upload_kuromoji_file = Kuromojiファイルをアップロードに失敗しました。
|
||||
errors.failed_to_download_protwords_file = Protwordsファイルのダウンロードに失敗しました。
|
||||
|
@ -154,6 +156,7 @@ success.delete_file = {0} ファイルを削除しました。
|
|||
success.job_started = ジョブ{0} を開始しました。
|
||||
success.job_stopped = ジョブ{0} を停止しました。
|
||||
success.upload_synonym_file = 同義語ファイルをアップロードしました。
|
||||
success.upload_stemmeroverride_file = Stemmer上書きファイルをアップロードしました。
|
||||
success.upload_kuromoji_file = Kuromojiファイルをアップロードしました。
|
||||
success.upload_elevate_word = 追加ワードファイルをアップロードしました。
|
||||
success.upload_bad_word = 除外ワードファイルをアップロードしました。
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.dict_stemmeroverride_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
|
||||
<jsp:param name="menuCategoryType" value="system" />
|
||||
<jsp:param name="menuType" value="dict" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.dict_stemmeroverride_title" />
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><la:link href="list">
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link></li>
|
||||
<li><la:message key="labels.dict_stemmeroverride_list_link" /></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</h3>
|
||||
<div class="btn-group pull-right">
|
||||
<la:link href="/admin/dict" styleClass="btn btn-default btn-xs">
|
||||
<i class="fa fa-book"></i>
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link>
|
||||
<la:link href="list/1?dictId=${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-th-list"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link>
|
||||
<la:link href="createnew/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-plus"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_create" />
|
||||
</la:link>
|
||||
<la:link href="downloadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-download"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_download" />
|
||||
</la:link>
|
||||
<la:link href="uploadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-upload"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_upload" />
|
||||
</la:link>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<%-- Message --%>
|
||||
<div>
|
||||
<la:info id="msg" message="true">
|
||||
<div class="alert alert-info">${msg}</div>
|
||||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<%-- List --%>
|
||||
<c:if test="${stemmerOverridePager.allRecordCount == 0}">
|
||||
<div class="row top10">
|
||||
<div class="col-sm-12">
|
||||
<i class="fa fa-info-circle text-light-blue"></i>
|
||||
<la:message key="labels.list_could_not_find_crud_table" />
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${stemmerOverridePager.allRecordCount > 0}">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><la:message key="labels.dict_stemmeroverride_source" /></th>
|
||||
<th><la:message key="labels.dict_stemmeroverride_target" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="data" varStatus="s"
|
||||
items="${stemmerOverrideItemItems}">
|
||||
<tr
|
||||
data-href="${contextPath}/admin/dict/stemmeroverride/details/${f:u(dictId)}/4/${f:u(data.id)}">
|
||||
<td>${f:h(data.input)}</td>
|
||||
<td>${f:h(data.output)}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="pager" value="${stemmerOverridePager}" scope="request" />
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<la:message key="labels.pagination_page_guide_msg"
|
||||
arg0="${f:h(pager.currentPageNumber)}"
|
||||
arg1="${f:h(pager.allPageCount)}"
|
||||
arg2="${f:h(pager.allRecordCount)}" />
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<ul class="pagination pagination-sm no-margin pull-right">
|
||||
<c:if test="${pager.existPrePage}">
|
||||
<li class="prev"><la:link
|
||||
href="list/${pager.currentPageNumber - 1}?dictId=${f:u(dictId)}">
|
||||
<la:message key="labels.prev_page" />
|
||||
</la:link></li>
|
||||
</c:if>
|
||||
<c:if test="${!pager.existPrePage}">
|
||||
<li class="prev disabled"><a href="#"><la:message
|
||||
key="labels.prev_page" /></a></li>
|
||||
</c:if>
|
||||
<c:forEach var="p" varStatus="s"
|
||||
items="${pager.pageNumberList}">
|
||||
<li
|
||||
<c:if test="${p == pager.currentPageNumber}">class="active"</c:if>><la:link
|
||||
href="list/${p}?dictId=${f:u(dictId)}">${p}</la:link></li>
|
||||
</c:forEach>
|
||||
<c:if test="${pager.existNextPage}">
|
||||
<li class="next"><la:link
|
||||
href="list/${pager.currentPageNumber + 1}?dictId=${f:u(dictId)}">
|
||||
<la:message key="labels.next_page" />
|
||||
</la:link></li>
|
||||
</c:if>
|
||||
<c:if test="${!pager.existNextPage}">
|
||||
<li class="next disabled"><a href="#"><la:message
|
||||
key="labels.next_page" /></a></li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,127 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.dict_stemmeroverride_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
|
||||
<jsp:param name="menuCategoryType" value="system" />
|
||||
<jsp:param name="menuType" value="dict" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.dict_stemmeroverride_title" />
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><la:link href="list">
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link></li>
|
||||
<li><la:link href="list/0/?dictId=${f:u(dictId)}">
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link></li>
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_stemmeroverride_link_details" /></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/stemmeroverride/">
|
||||
<la:hidden property="crudMode" />
|
||||
<la:hidden property="dictId" />
|
||||
<c:if test="${crudMode==2 || crudMode==3 || crudMode==4}">
|
||||
<la:hidden property="id" />
|
||||
</c:if>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div
|
||||
class="box <c:if test="${crudMode == 1}">box-success</c:if><c:if test="${crudMode == 2}">box-warning</c:if><c:if test="${crudMode == 3}">box-danger</c:if><c:if test="${crudMode == 4}">box-primary</c:if>">
|
||||
<%-- Box Header --%>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<c:if test="${crudMode == 1}">
|
||||
<la:message key="labels.dict_stemmeroverride_link_create" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 2}">
|
||||
<la:message key="labels.dict_stemmeroverride_link_edit" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 3}">
|
||||
<la:message key="labels.dict_stemmeroverride_link_delete" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 4}">
|
||||
<la:message key="labels.dict_stemmeroverride_link_details" />
|
||||
</c:if>
|
||||
</h3>
|
||||
<div class="btn-group pull-right">
|
||||
<la:link href="/admin/dict"
|
||||
styleClass="btn btn-default btn-xs">
|
||||
<i class="fa fa-book"></i>
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../list/1?dictId=${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-th-list"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../createnew/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-plus"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_create" />
|
||||
</la:link>
|
||||
<la:link href="../downloadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-download"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_download" />
|
||||
</la:link>
|
||||
<la:link href="../uploadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-upload"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_upload" />
|
||||
</la:link>
|
||||
</div>
|
||||
</div>
|
||||
<%-- Box Body --%>
|
||||
<div class="box-body">
|
||||
<%-- Message --%>
|
||||
<div>
|
||||
<la:info id="msg" message="true">
|
||||
<div class="alert alert-info">${msg}</div>
|
||||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<%-- Form Fields --%>
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><la:message
|
||||
key="labels.dict_stemmeroverride_source" /></th>
|
||||
<td>${f:br(f:h(input))}<la:hidden property="input" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.dict_stemmeroverride_target" /></th>
|
||||
<td>${f:br(f:h(output))}<la:hidden property="output" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/buttons.jsp"></jsp:include>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,103 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.dict_stemmeroverride_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
|
||||
<jsp:param name="menuCategoryType" value="system" />
|
||||
<jsp:param name="menuType" value="dict" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.dict_stemmeroverride_title" />
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><la:link href="list">
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link></li>
|
||||
<li><la:link href="list/0/?dictId=${f:u(dictId)}">
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link></li>
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_stemmeroverride_link_download" /></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/stemmeroverride/">
|
||||
<la:hidden property="dictId" />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<la:message key="labels.dict_stemmeroverride_link_download" />
|
||||
</h3>
|
||||
<div class="btn-group pull-right">
|
||||
<la:link href="/admin/dict"
|
||||
styleClass="btn btn-default btn-xs">
|
||||
<i class="fa fa-book"></i>
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../list/0/?dictId=${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-th-list"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../createnew/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-plus"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_create" />
|
||||
</la:link>
|
||||
<la:link href="../downloadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-download"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_download" />
|
||||
</la:link>
|
||||
<la:link href="../uploadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-upload"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_upload" />
|
||||
</la:link>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<%-- Message --%>
|
||||
<div>
|
||||
<la:info id="msg" message="true">
|
||||
<div class="alert alert-info">${msg}</div>
|
||||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-12 control-label">${f:h(path)}</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-primary" name="download"
|
||||
value="<la:message key="labels.dict_stemmeroverride_button_download" />">
|
||||
<i class="fa fa-download"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_button_download" />
|
||||
</button>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,127 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.dict_stemmeroverride_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
|
||||
<jsp:param name="menuCategoryType" value="system" />
|
||||
<jsp:param name="menuType" value="dict" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.dict_stemmeroverride_title" />
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><la:link href="list">
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link></li>
|
||||
<li><la:link href="list/0/?dictId=${f:u(dictId)}">
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link></li>
|
||||
<c:if test="${crudMode == 1}">
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_stemmeroverride_link_create" /></li>
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 2}">
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_stemmeroverride_link_edit" /></li>
|
||||
</c:if>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/stemmeroverride/" styleClass="form-horizontal">
|
||||
<la:hidden property="crudMode" />
|
||||
<la:hidden property="dictId" />
|
||||
<c:if test="${crudMode==2}">
|
||||
<la:hidden property="id" />
|
||||
</c:if>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div
|
||||
class="box <c:if test="${crudMode == 1}">box-success</c:if><c:if test="${crudMode == 2}">box-warning</c:if>">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<c:if test="${crudMode == 1}">
|
||||
<la:message key="labels.dict_stemmeroverride_link_create" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 2}">
|
||||
<la:message key="labels.dict_stemmeroverride_link_edit" />
|
||||
</c:if>
|
||||
</h3>
|
||||
<div class="btn-group pull-right">
|
||||
<la:link href="/admin/dict"
|
||||
styleClass="btn btn-default btn-xs">
|
||||
<i class="fa fa-book"></i>
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../list/1?dictId=${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-th-list"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../createnew/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-plus"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_create" />
|
||||
</la:link>
|
||||
<la:link href="../downloadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-download"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_download" />
|
||||
</la:link>
|
||||
<la:link href="../uploadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-upload"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_upload" />
|
||||
</la:link>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<la:info id="msg" message="true">
|
||||
<div class="alert alert-info">${msg}</div>
|
||||
</la:info>
|
||||
<la:errors property="_global" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="term" class="col-sm-3 control-label"><la:message
|
||||
key="labels.dict_stemmeroverride_source" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="input" />
|
||||
<la:text styleId="input" property="input" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="output" class="col-sm-3 control-label"><la:message
|
||||
key="labels.dict_stemmeroverride_target" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="output" />
|
||||
<la:text styleId="output" property="output" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/buttons.jsp"></jsp:include>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,107 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.dict_stemmeroverride_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
|
||||
<jsp:param name="menuCategoryType" value="system" />
|
||||
<jsp:param name="menuType" value="dict" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.dict_stemmeroverride_title" />
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><la:link href="list">
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link></li>
|
||||
<li><la:link href="list/0/?dictId=${f:u(dictId)}">
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link></li>
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_stemmeroverride_link_upload" /></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/stemmeroverride/upload" enctype="multipart/form-data">
|
||||
<la:hidden property="dictId" />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<la:message key="labels.dict_stemmeroverride_link_upload" />
|
||||
</h3>
|
||||
<div class="btn-group pull-right">
|
||||
<la:link href="/admin/dict"
|
||||
styleClass="btn btn-default btn-xs">
|
||||
<i class="fa fa-book"></i>
|
||||
<la:message key="labels.dict_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../list/0/?dictId=${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-th-list"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_list_link" />
|
||||
</la:link>
|
||||
<la:link href="../createnew/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-plus"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_create" />
|
||||
</la:link>
|
||||
<la:link href="../downloadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<i class="fa fa-download"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_download" />
|
||||
</la:link>
|
||||
<la:link href="../uploadpage/${f:u(dictId)}"
|
||||
styleClass="btn btn-success btn-xs">
|
||||
<i class="fa fa-upload"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_link_upload" />
|
||||
</la:link>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<%-- Message --%>
|
||||
<div>
|
||||
<la:info id="msg" message="true">
|
||||
<div class="alert alert-info">${msg}</div>
|
||||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-3 control-label"><la:message
|
||||
key="labels.dict_stemmeroverride_file" /></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="file" name="stemmeroverrideFile" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-success"
|
||||
value="<la:message key="labels.dict_stemmeroverride_button_upload" />">
|
||||
<i class="fa fa-upload"></i>
|
||||
<la:message key="labels.dict_stemmeroverride_button_upload" />
|
||||
</button>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.dict.stemmeroverride;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.codelibs.fess.dict.DictionaryFile.PagingList;
|
||||
import org.codelibs.fess.unit.UnitFessTestCase;
|
||||
|
||||
public class StemmerOverrideFileTest extends UnitFessTestCase {
|
||||
private StemmerOverrideFile stemmerOverrideFile;
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
stemmerOverrideFile = new StemmerOverrideFile("1", "dummy", new Date());
|
||||
List<StemmerOverrideItem> itemList = new ArrayList<>();
|
||||
itemList.add(new StemmerOverrideItem(1, "aaa", "a"));
|
||||
itemList.add(new StemmerOverrideItem(2, "bbb", "b"));
|
||||
itemList.add(new StemmerOverrideItem(3, "ccc", "c"));
|
||||
stemmerOverrideFile.stemmerOverrideItemList = itemList;
|
||||
}
|
||||
|
||||
public void test_selectList() {
|
||||
final PagingList<StemmerOverrideItem> itemList1 = stemmerOverrideFile.selectList(0, 20); // error occurs
|
||||
assertEquals(3, itemList1.size());
|
||||
assertEquals(3, itemList1.getAllRecordCount());
|
||||
assertEquals(1, itemList1.getCurrentPageNumber());
|
||||
assertEquals(20, itemList1.getPageSize());
|
||||
|
||||
final PagingList<StemmerOverrideItem> itemList2 = stemmerOverrideFile.selectList(2, 2);
|
||||
assertEquals(1, itemList2.size());
|
||||
assertEquals(3, itemList2.getAllRecordCount());
|
||||
assertEquals(2, itemList2.getCurrentPageNumber());
|
||||
assertEquals(2, itemList2.getPageSize());
|
||||
|
||||
assertEquals(0, stemmerOverrideFile.selectList(5, 5).size());
|
||||
assertEquals(0, stemmerOverrideFile.selectList(-1, 5).size());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.dict.stemmeroverride;
|
||||
|
||||
import org.codelibs.fess.unit.UnitFessTestCase;
|
||||
|
||||
public class StemmerOverrideItemTest extends UnitFessTestCase {
|
||||
|
||||
public void test_new1() {
|
||||
final StemmerOverrideItem stemmerOverrideItem = new StemmerOverrideItem(1, "aaa", "a");
|
||||
assertEquals(1, stemmerOverrideItem.getId());
|
||||
assertEquals("aaa", stemmerOverrideItem.getInput());
|
||||
assertEquals("a", stemmerOverrideItem.getOutput());
|
||||
assertNull(stemmerOverrideItem.getNewInput());
|
||||
assertNull(stemmerOverrideItem.getNewOutput());
|
||||
assertFalse(stemmerOverrideItem.isUpdated());
|
||||
assertFalse(stemmerOverrideItem.isDeleted());
|
||||
|
||||
stemmerOverrideItem.setNewInput("bbb");
|
||||
stemmerOverrideItem.setNewOutput("b");
|
||||
assertTrue(stemmerOverrideItem.isUpdated());
|
||||
assertFalse(stemmerOverrideItem.isDeleted());
|
||||
|
||||
stemmerOverrideItem.setNewInput("");
|
||||
stemmerOverrideItem.setNewOutput("");
|
||||
assertTrue(stemmerOverrideItem.isUpdated());
|
||||
assertTrue(stemmerOverrideItem.isDeleted());
|
||||
}
|
||||
|
||||
public void test_equals1() {
|
||||
final StemmerOverrideItem stemmerOverrideItem1 = new StemmerOverrideItem(1, "aaa", "a");
|
||||
|
||||
assertTrue(stemmerOverrideItem1.equals(stemmerOverrideItem1));
|
||||
assertTrue(stemmerOverrideItem1.equals(new StemmerOverrideItem(1, "aaa", "a")));
|
||||
assertTrue(stemmerOverrideItem1.equals(new StemmerOverrideItem(2, "aaa", "a")));
|
||||
assertFalse(stemmerOverrideItem1.equals(new StemmerOverrideItem(1, "aaa", "b")));
|
||||
assertFalse(stemmerOverrideItem1.equals(new StemmerOverrideItem(2, "bbb", "a")));
|
||||
assertFalse(stemmerOverrideItem1.equals(new StemmerOverrideItem(2, "aaa", "b")));
|
||||
}
|
||||
|
||||
public void test_toLineString() {
|
||||
assertEquals("aaa=>a", new StemmerOverrideItem(1, "aaa", "a").toLineString());
|
||||
assertEquals("=>", new StemmerOverrideItem(1, "", "").toLineString());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* Copyright 2012-2018 CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
package org.codelibs.fess.it.admin.dict;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Tag("it")
|
||||
public class StemmerOverrideTests extends DictCrudTestBase {
|
||||
|
||||
private static final String NAME_PREFIX = "stemmerOvberrideTest_";
|
||||
private static final String API_PATH = "/api/admin/dict/stemmerovberride";
|
||||
private static final String LIST_ENDPOINT_SUFFIX = "settings";
|
||||
private static final String ITEM_ENDPOINT_SUFFIX = "setting";
|
||||
private static final String DICT_TYPE = "stemmerovberride";
|
||||
|
||||
private static final String KEY_PROPERTY = "input";
|
||||
|
||||
@Override
|
||||
protected String getNamePrefix() {
|
||||
return NAME_PREFIX;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getApiPath() {
|
||||
return API_PATH;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getKeyProperty() {
|
||||
return KEY_PROPERTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getListEndpointSuffix() {
|
||||
return LIST_ENDPOINT_SUFFIX + "/" + dictId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getItemEndpointSuffix() {
|
||||
return ITEM_ENDPOINT_SUFFIX + "/" + dictId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDictType() {
|
||||
return DICT_TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> createTestParam(int id) {
|
||||
final Map<String, Object> requestBody = new HashMap<>();
|
||||
final String keyProp = NAME_PREFIX + id;
|
||||
requestBody.put(KEY_PROPERTY, keyProp);
|
||||
requestBody.put("output", "output");
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> getUpdateMap() {
|
||||
final Map<String, Object> updateMap = new HashMap<>();
|
||||
updateMap.put("output", "new_output");
|
||||
return updateMap;
|
||||
}
|
||||
|
||||
@Test
|
||||
void crudTest() {
|
||||
testCreate();
|
||||
testRead();
|
||||
testUpdate();
|
||||
testDelete();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue