fix #1765 remove seunjeon
This commit is contained in:
parent
50ba9b0b1b
commit
30894b57c8
33 changed files with 0 additions and 2307 deletions
|
@ -1,123 +0,0 @@
|
|||
/*
|
||||
* 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 SeunjeonPager 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;
|
||||
}
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
* 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.SeunjeonPager;
|
||||
import org.codelibs.fess.dict.DictionaryFile.PagingList;
|
||||
import org.codelibs.fess.dict.DictionaryManager;
|
||||
import org.codelibs.fess.dict.seunjeon.SeunjeonFile;
|
||||
import org.codelibs.fess.dict.seunjeon.SeunjeonItem;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
|
||||
public class SeunjeonService {
|
||||
@Resource
|
||||
protected DictionaryManager dictionaryManager;
|
||||
|
||||
@Resource
|
||||
protected FessConfig fessConfig;
|
||||
|
||||
public List<SeunjeonItem> getSeunjeonList(final String dictId, final SeunjeonPager seunjeonPager) {
|
||||
return getSeunjeonFile(dictId).map(file -> {
|
||||
final int pageSize = seunjeonPager.getPageSize();
|
||||
final PagingList<SeunjeonItem> seunjeonList = file.selectList((seunjeonPager.getCurrentPageNumber() - 1) * pageSize, pageSize);
|
||||
|
||||
// update pager
|
||||
BeanUtil.copyBeanToBean(seunjeonList, seunjeonPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
|
||||
seunjeonList.setPageRangeSize(fessConfig.getPagingPageRangeSizeAsInteger());
|
||||
seunjeonPager.setPageNumberList(seunjeonList.createPageNumberList());
|
||||
|
||||
return (List<SeunjeonItem>) seunjeonList;
|
||||
}).orElse(Collections.emptyList());
|
||||
}
|
||||
|
||||
public OptionalEntity<SeunjeonFile> getSeunjeonFile(final String dictId) {
|
||||
return dictionaryManager.getDictionaryFile(dictId).filter(file -> file instanceof SeunjeonFile)
|
||||
.map(file -> OptionalEntity.of((SeunjeonFile) file)).orElse(OptionalEntity.empty());
|
||||
}
|
||||
|
||||
public OptionalEntity<SeunjeonItem> getSeunjeonItem(final String dictId, final long id) {
|
||||
return getSeunjeonFile(dictId).map(file -> file.get(id).get());
|
||||
}
|
||||
|
||||
public void store(final String dictId, final SeunjeonItem seunjeonItem) {
|
||||
getSeunjeonFile(dictId).ifPresent(file -> {
|
||||
if (seunjeonItem.getId() == 0) {
|
||||
file.insert(seunjeonItem);
|
||||
} else {
|
||||
file.update(seunjeonItem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(final String dictId, final SeunjeonItem seunjeonItem) {
|
||||
getSeunjeonFile(dictId).ifPresent(file -> {
|
||||
file.delete(seunjeonItem);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,392 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import static org.codelibs.core.stream.StreamUtil.split;
|
||||
|
||||
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.SeunjeonPager;
|
||||
import org.codelibs.fess.app.service.SeunjeonService;
|
||||
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.dict.seunjeon.SeunjeonItem;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author nocode
|
||||
* @author shinsuke
|
||||
*/
|
||||
public class AdminDictSeunjeonAction extends FessAdminAction {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
private SeunjeonService seunjeonService;
|
||||
@Resource
|
||||
private SeunjeonPager seunjeonPager;
|
||||
|
||||
// ===================================================================================
|
||||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink(fessConfig.getOnlineHelpNameDictSeunjeon()));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(final OptionalThing<Integer> pageNumber, final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
pageNumber.ifPresent(num -> {
|
||||
seunjeonPager.setCurrentPageNumber(pageNumber.get());
|
||||
}).orElse(() -> {
|
||||
seunjeonPager.setCurrentPageNumber(0);
|
||||
});
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
copyBeanToBean(form, seunjeonPager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(final SearchForm form) {
|
||||
validate(form, messages -> {}, () -> asDictIndexHtml());
|
||||
seunjeonPager.clear();
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(final RenderData data, final SearchForm form) {
|
||||
// page navi
|
||||
RenderDataUtil.register(data, "seunjeonItemItems", seunjeonService.getSeunjeonList(form.dictId, seunjeonPager));
|
||||
|
||||
// restore from pager
|
||||
BeanUtil.copyBeanToBean(seunjeonPager, form, op -> {
|
||||
op.exclude(Constants.PAGER_CONVERSION_RULE);
|
||||
});
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Edit Execute
|
||||
// ============
|
||||
// -----------------------------------------------------
|
||||
// Entry Page
|
||||
// ----------
|
||||
@Execute
|
||||
public HtmlResponse createnew(final String dictId) {
|
||||
saveToken();
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonEditJsp).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));
|
||||
seunjeonService
|
||||
.getSeunjeonItem(form.dictId, form.id)
|
||||
.ifPresent(entity -> {
|
||||
form.inputs = entity.getInputsValue();
|
||||
})
|
||||
.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 -> {
|
||||
seunjeonService
|
||||
.getSeunjeonItem(dictId, id)
|
||||
.ifPresent(entity -> {
|
||||
form.inputs = entity.getInputsValue();
|
||||
})
|
||||
.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_AdminDictSeunjeon_AdminDictSeunjeonDownloadJsp).useForm(DownloadForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
form.dictId = dictId;
|
||||
});
|
||||
}).renderWith(data -> {
|
||||
seunjeonService.getSeunjeonFile(dictId).ifPresent(file -> {
|
||||
RenderDataUtil.register(data, "path", file.getPath());
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToDownloadSynonymFile(GLOBAL), () -> asDictIndexHtml());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public ActionResponse download(final DownloadForm form) {
|
||||
validate(form, messages -> {}, () -> downloadpage(form.dictId));
|
||||
verifyTokenKeep(() -> downloadpage(form.dictId));
|
||||
return seunjeonService.getSeunjeonFile(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.addErrorsFailedToDownloadSynonymFile(GLOBAL), () -> downloadpage(form.dictId));
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Upload
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse uploadpage(final String dictId) {
|
||||
saveToken();
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonUploadJsp).useForm(UploadForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
form.dictId = dictId;
|
||||
});
|
||||
}).renderWith(data -> {
|
||||
seunjeonService.getSeunjeonFile(dictId).ifPresent(file -> {
|
||||
RenderDataUtil.register(data, "path", file.getPath());
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToDownloadSynonymFile(GLOBAL), () -> asDictIndexHtml());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse upload(final UploadForm form) {
|
||||
validate(form, messages -> {}, () -> uploadpage(form.dictId));
|
||||
verifyToken(() -> uploadpage(form.dictId));
|
||||
return seunjeonService.getSeunjeonFile(form.dictId).map(file -> {
|
||||
try (InputStream inputStream = form.seunjeonFile.getInputStream()) {
|
||||
file.update(inputStream);
|
||||
} catch (final IOException e) {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToUploadSynonymFile(GLOBAL), () -> {
|
||||
return redirectWith(getClass(), moreUrl("uploadpage/" + form.dictId));
|
||||
});
|
||||
}
|
||||
saveInfo(messages -> messages.addSuccessUploadSynonymFile(GLOBAL));
|
||||
return redirectWith(getClass(), moreUrl("uploadpage/" + form.dictId));
|
||||
}).orElseGet(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsFailedToUploadSynonymFile(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());
|
||||
createSeunjeonItem(form, () -> asEditHtml()).ifPresent(entity -> {
|
||||
seunjeonService.store(form.dictId, entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
}).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());
|
||||
createSeunjeonItem(form, () -> asEditHtml()).ifPresent(entity -> {
|
||||
seunjeonService.store(form.dictId, entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
}).orElse(
|
||||
() -> 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());
|
||||
seunjeonService
|
||||
.getSeunjeonItem(form.dictId, form.id)
|
||||
.ifPresent(entity -> {
|
||||
seunjeonService.delete(form.dictId, entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()),
|
||||
() -> asDetailsHtml());
|
||||
});
|
||||
return redirectWith(getClass(), moreUrl("list/1").params("dictId", form.dictId));
|
||||
}
|
||||
|
||||
//===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
|
||||
private OptionalEntity<SeunjeonItem> getEntity(final CreateForm form) {
|
||||
switch (form.crudMode) {
|
||||
case CrudMode.CREATE:
|
||||
final SeunjeonItem entity = new SeunjeonItem(0, StringUtil.EMPTY_STRINGS);
|
||||
return OptionalEntity.of(entity);
|
||||
case CrudMode.EDIT:
|
||||
if (form instanceof EditForm) {
|
||||
return ComponentUtil.getComponent(SeunjeonService.class).getSeunjeonItem(form.dictId, ((EditForm) form).id);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return OptionalEntity.empty();
|
||||
}
|
||||
|
||||
public OptionalEntity<SeunjeonItem> createSeunjeonItem(final CreateForm form, final VaErrorHook hook) {
|
||||
return getEntity(form).map(entity -> {
|
||||
final String[] newInputs = splitLine(form.inputs);
|
||||
validateSeunjeonString(newInputs, "inputs", hook);
|
||||
entity.setNewInputs(newInputs);
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
private void validateSeunjeonString(final String[] values, final String propertyName, final VaErrorHook hook) {
|
||||
if (values.length == 0) {
|
||||
return;
|
||||
}
|
||||
// TODO validation
|
||||
}
|
||||
|
||||
private String[] splitLine(final String value) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
return StringUtil.EMPTY_STRINGS;
|
||||
}
|
||||
return split(value, ",").get(stream -> stream.filter(StringUtil::isNotBlank).map(s -> s.trim()).toArray(n -> new String[n]));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// JSP
|
||||
// =========
|
||||
|
||||
protected HtmlResponse asDictIndexHtml() {
|
||||
return redirect(AdminDictAction.class);
|
||||
}
|
||||
|
||||
private HtmlResponse asListHtml(final String dictId) {
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonJsp).renderWith(data -> {
|
||||
RenderDataUtil.register(data, "seunjeonItemItems", seunjeonService.getSeunjeonList(dictId, seunjeonPager));
|
||||
}).useForm(SearchForm.class, setup -> {
|
||||
setup.setup(form -> {
|
||||
copyBeanToBean(seunjeonPager, form, op -> op.include("id"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private HtmlResponse asEditHtml() {
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonEditJsp);
|
||||
}
|
||||
|
||||
private HtmlResponse asDetailsHtml() {
|
||||
return asHtml(path_AdminDictSeunjeon_AdminDictSeunjeonDetailsJsp);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
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 nocode
|
||||
*/
|
||||
public class CreateForm {
|
||||
|
||||
@Required
|
||||
public String dictId;
|
||||
|
||||
@ValidateTypeFailure
|
||||
public Integer crudMode;
|
||||
|
||||
@Required
|
||||
@Size(max = 1000)
|
||||
public String inputs;
|
||||
|
||||
public void initialize() {
|
||||
crudMode = CrudMode.CREATE;
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
||||
public class DownloadForm {
|
||||
@Required
|
||||
public String dictId;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
/**
|
||||
* @author nocode
|
||||
*/
|
||||
public class EditForm extends CreateForm {
|
||||
|
||||
@Required
|
||||
@ValidateTypeFailure
|
||||
public Long id;
|
||||
|
||||
public String getDisplayId() {
|
||||
return dictId + ":" + id;
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
||||
/**
|
||||
* @author nocode
|
||||
*/
|
||||
public class SearchForm {
|
||||
|
||||
@Required
|
||||
public String dictId;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.lastaflute.web.ruts.multipart.MultipartFormFile;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
||||
/**
|
||||
* @author nocode
|
||||
*/
|
||||
public class UploadForm {
|
||||
|
||||
@Required
|
||||
public String dictId;
|
||||
|
||||
@Required
|
||||
public MultipartFormFile seunjeonFile;
|
||||
|
||||
}
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
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.SeunjeonPager;
|
||||
import org.codelibs.fess.app.service.SeunjeonService;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.app.web.admin.dict.seunjeon.AdminDictSeunjeonAction;
|
||||
import org.codelibs.fess.app.web.admin.dict.seunjeon.UploadForm;
|
||||
import org.codelibs.fess.app.web.api.ApiResult;
|
||||
import org.codelibs.fess.app.web.api.admin.FessApiAdminAction;
|
||||
import org.codelibs.fess.dict.seunjeon.SeunjeonFile;
|
||||
import org.codelibs.fess.dict.seunjeon.SeunjeonItem;
|
||||
import org.lastaflute.web.Execute;
|
||||
import org.lastaflute.web.response.JsonResponse;
|
||||
import org.lastaflute.web.response.StreamResponse;
|
||||
|
||||
public class ApiAdminDictSeunjeonAction extends FessApiAdminAction {
|
||||
|
||||
@Resource
|
||||
private SeunjeonService seunjeonService;
|
||||
|
||||
// GET /api/admin/dict/seunjeon/settings/{dictId}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> get$settings(final String dictId, final SearchBody body) {
|
||||
body.dictId = dictId;
|
||||
validateApi(body, messages -> {});
|
||||
final SeunjeonPager pager = copyBeanToNewBean(body, SeunjeonPager.class);
|
||||
return asJson(new ApiResult.ApiConfigsResponse<EditBody>()
|
||||
.settings(
|
||||
seunjeonService.getSeunjeonList(body.dictId, pager).stream()
|
||||
.map(protwordsItem -> createEditBody(protwordsItem, dictId)).collect(Collectors.toList()))
|
||||
.status(ApiResult.Status.OK).result());
|
||||
}
|
||||
|
||||
// GET /api/admin/dict/seunjeon/setting/{dictId}/{id}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> get$setting(final String dictId, final long id) {
|
||||
return asJson(new ApiResult.ApiConfigResponse()
|
||||
.setting(seunjeonService.getSeunjeonItem(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/seunjeon/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 SeunjeonItem entity = new AdminDictSeunjeonAction().createSeunjeonItem(body, () -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL));
|
||||
return null;
|
||||
}).orElseGet(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL));
|
||||
return null;
|
||||
});
|
||||
seunjeonService.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/seunjeon/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 SeunjeonItem entity = new AdminDictSeunjeonAction().createSeunjeonItem(body, () -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, String.valueOf(body.id)));
|
||||
return null;
|
||||
}).orElseGet(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, String.valueOf(body.id)));
|
||||
return null;
|
||||
});
|
||||
seunjeonService.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/seunjeon/setting/{dictId}/{id}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> delete$setting(final String dictId, final long id) {
|
||||
seunjeonService.getSeunjeonItem(dictId, id).ifPresent(entity -> {
|
||||
seunjeonService.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/seunjeon/upload/{dictId}
|
||||
@Execute
|
||||
public JsonResponse<ApiResult> post$upload(final String dictId, final UploadForm form) {
|
||||
form.dictId = dictId;
|
||||
validateApi(form, messages -> {});
|
||||
final SeunjeonFile file = seunjeonService.getSeunjeonFile(form.dictId).orElseGet(() -> {
|
||||
throwValidationErrorApi(messages -> messages.addErrorsFailedToUploadProtwordsFile(GLOBAL));
|
||||
return null;
|
||||
});
|
||||
try (InputStream inputStream = form.seunjeonFile.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/seunjeon/download/{dictId}
|
||||
@Execute
|
||||
public StreamResponse get$download(final String dictId, final DownloadBody body) {
|
||||
body.dictId = dictId;
|
||||
validateApi(body, messages -> {});
|
||||
return seunjeonService.getSeunjeonFile(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 SeunjeonItem entity, final String dictId) {
|
||||
final EditBody body = new EditBody();
|
||||
body.id = entity.getId();
|
||||
body.dictId = dictId;
|
||||
body.inputs = entity.getInputsValue();
|
||||
return body;
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.codelibs.fess.app.web.admin.dict.seunjeon.CreateForm;
|
||||
|
||||
public class CreateBody extends CreateForm {
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.codelibs.fess.app.web.admin.dict.seunjeon.DownloadForm;
|
||||
|
||||
public class DownloadBody extends DownloadForm {
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.codelibs.fess.app.web.admin.dict.seunjeon.EditForm;
|
||||
|
||||
public class EditBody extends EditForm {
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import org.codelibs.fess.app.web.api.admin.dict.BaseSearchDictBody;
|
||||
|
||||
public class SearchBody extends BaseSearchDictBody {
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.codelibs.fess.dict.DictionaryCreator;
|
||||
import org.codelibs.fess.dict.DictionaryFile;
|
||||
import org.codelibs.fess.dict.DictionaryItem;
|
||||
|
||||
public class SeunjeonCreator extends DictionaryCreator {
|
||||
|
||||
public SeunjeonCreator() {
|
||||
super("seunjeon.*\\.txt");
|
||||
}
|
||||
|
||||
public SeunjeonCreator(final String pattern) {
|
||||
super(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DictionaryFile<? extends DictionaryItem> newDictionaryFile(final String id, final String path, final Date timestamp) {
|
||||
return new SeunjeonFile(id, path, timestamp).manager(dictionaryManager);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,326 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
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 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;
|
||||
|
||||
public class SeunjeonFile extends DictionaryFile<SeunjeonItem> {
|
||||
private static final String SEUNJEON = "seunjeon";
|
||||
|
||||
List<SeunjeonItem> seunjeonItemList;
|
||||
|
||||
public SeunjeonFile(final String id, final String path, final Date timestamp) {
|
||||
super(id, path, timestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return SEUNJEON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized OptionalEntity<SeunjeonItem> get(final long id) {
|
||||
if (seunjeonItemList == null) {
|
||||
reload(null, null);
|
||||
}
|
||||
|
||||
for (final SeunjeonItem SeunjeonItem : seunjeonItemList) {
|
||||
if (id == SeunjeonItem.getId()) {
|
||||
return OptionalEntity.of(SeunjeonItem);
|
||||
}
|
||||
}
|
||||
return OptionalEntity.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized PagingList<SeunjeonItem> selectList(final int offset, final int size) {
|
||||
if (seunjeonItemList == null) {
|
||||
reload(null, null);
|
||||
}
|
||||
|
||||
if (offset >= seunjeonItemList.size() || offset < 0) {
|
||||
return new PagingList<>(Collections.<SeunjeonItem> emptyList(), offset, size, seunjeonItemList.size());
|
||||
}
|
||||
|
||||
int toIndex = offset + size;
|
||||
if (toIndex > seunjeonItemList.size()) {
|
||||
toIndex = seunjeonItemList.size();
|
||||
}
|
||||
|
||||
return new PagingList<>(seunjeonItemList.subList(offset, toIndex), offset, size, seunjeonItemList.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void insert(final SeunjeonItem item) {
|
||||
try (SynonymUpdater updater = new SynonymUpdater(item)) {
|
||||
reload(updater, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void update(final SeunjeonItem item) {
|
||||
try (SynonymUpdater updater = new SynonymUpdater(item)) {
|
||||
reload(updater, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void delete(final SeunjeonItem item) {
|
||||
final SeunjeonItem SeunjeonItem = item;
|
||||
SeunjeonItem.setNewInputs(StringUtil.EMPTY_STRINGS);
|
||||
try (SynonymUpdater updater = new SynonymUpdater(item)) {
|
||||
reload(updater, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected void reload(final SynonymUpdater updater, final InputStream in) {
|
||||
final List<SeunjeonItem> 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) {
|
||||
if (line.length() == 0 || line.charAt(0) == '#') {
|
||||
if (updater != null) {
|
||||
updater.write(line);
|
||||
}
|
||||
continue; // ignore empty lines and comments
|
||||
}
|
||||
|
||||
final List<String> inputStrings = split(line, ",");
|
||||
final String[] inputs = new String[inputStrings.size()];
|
||||
for (int i = 0; i < inputs.length; i++) {
|
||||
inputs[i] = unescape(inputStrings.get(i)).trim();
|
||||
}
|
||||
|
||||
if (inputs.length > 0) {
|
||||
id++;
|
||||
final SeunjeonItem item = new SeunjeonItem(id, inputs);
|
||||
if (updater != null) {
|
||||
final SeunjeonItem newItem = updater.write(item);
|
||||
if (newItem != null) {
|
||||
itemList.add(newItem);
|
||||
} else {
|
||||
id--;
|
||||
}
|
||||
} else {
|
||||
itemList.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (updater != null) {
|
||||
final SeunjeonItem item = updater.commit();
|
||||
if (item != null) {
|
||||
itemList.add(item);
|
||||
}
|
||||
}
|
||||
seunjeonItemList = itemList;
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to parse " + path, e);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> split(final String s, final String separator) {
|
||||
final List<String> list = new ArrayList<>(2);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int pos = 0;
|
||||
final int end = s.length();
|
||||
while (pos < end) {
|
||||
if (s.startsWith(separator, pos)) {
|
||||
if (sb.length() > 0) {
|
||||
list.add(sb.toString());
|
||||
sb = new StringBuilder();
|
||||
}
|
||||
pos += separator.length();
|
||||
continue;
|
||||
}
|
||||
|
||||
char ch = s.charAt(pos++);
|
||||
if (ch == '\\') {
|
||||
sb.append(ch);
|
||||
if (pos >= end) {
|
||||
break; // ERROR, or let it go?
|
||||
}
|
||||
ch = s.charAt(pos++);
|
||||
}
|
||||
|
||||
sb.append(ch);
|
||||
}
|
||||
|
||||
if (sb.length() > 0) {
|
||||
list.add(sb.toString());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private String unescape(final String s) {
|
||||
if (s.indexOf('\\') >= 0) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
final char ch = s.charAt(i);
|
||||
if (ch == '\\' && i < s.length() - 1) {
|
||||
sb.append(s.charAt(++i));
|
||||
} else {
|
||||
sb.append(ch);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
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 (SynonymUpdater updater = new SynonymUpdater(null)) {
|
||||
reload(updater, in);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SynonymFile [path=" + path + ", seunjeonItemList=" + seunjeonItemList + ", id=" + id + "]";
|
||||
}
|
||||
|
||||
protected class SynonymUpdater implements Closeable {
|
||||
|
||||
protected boolean isCommit = false;
|
||||
|
||||
protected File newFile;
|
||||
|
||||
protected Writer writer;
|
||||
|
||||
protected SeunjeonItem item;
|
||||
|
||||
protected SynonymUpdater(final SeunjeonItem newItem) {
|
||||
try {
|
||||
newFile = File.createTempFile(SEUNJEON, ".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 SeunjeonItem write(final SeunjeonItem 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 SeunjeonItem(item.getId(), item.getNewInputs());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} finally {
|
||||
item.setNewInputs(null);
|
||||
}
|
||||
} else {
|
||||
throw new DictionaryException("Seunjeon 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 SeunjeonItem 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(SeunjeonFile.this, newFile);
|
||||
} finally {
|
||||
newFile.delete();
|
||||
}
|
||||
} else {
|
||||
newFile.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* 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.seunjeon;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.dict.DictionaryItem;
|
||||
|
||||
public class SeunjeonItem extends DictionaryItem {
|
||||
private final String[] inputs;
|
||||
|
||||
private String[] newInputs;
|
||||
|
||||
public SeunjeonItem(final long id, final String[] inputs) {
|
||||
this.id = id;
|
||||
this.inputs = inputs;
|
||||
|
||||
if (id == 0) {
|
||||
// create
|
||||
newInputs = inputs;
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getNewInputs() {
|
||||
return newInputs;
|
||||
}
|
||||
|
||||
public void setNewInputs(final String[] newInputs) {
|
||||
this.newInputs = newInputs;
|
||||
}
|
||||
|
||||
public String[] getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public String getInputsValue() {
|
||||
if (inputs == null) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
return String.join(",", inputs);
|
||||
}
|
||||
|
||||
public boolean isUpdated() {
|
||||
return newInputs != null;
|
||||
}
|
||||
|
||||
public boolean isDeleted() {
|
||||
return isUpdated() && newInputs.length == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + Arrays.hashCode(inputs);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final SeunjeonItem other = (SeunjeonItem) obj;
|
||||
if (!Arrays.equals(inputs, other.inputs)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SynonymItem [id=" + id + ", inputs=" + Arrays.toString(inputs) + ", newInputs=" + Arrays.toString(newInputs) + "]";
|
||||
}
|
||||
|
||||
public String toLineString() {
|
||||
if (isUpdated()) {
|
||||
return StringUtils.join(newInputs, ",");
|
||||
} else {
|
||||
return StringUtils.join(inputs, ",");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -132,21 +132,6 @@ 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/seunjeon/admin_dict_seunjeon.jsp */
|
||||
HtmlNext path_AdminDictSeunjeon_AdminDictSeunjeonJsp = new HtmlNext("/admin/dict/seunjeon/admin_dict_seunjeon.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/seunjeon/admin_dict_seunjeon_details.jsp */
|
||||
HtmlNext path_AdminDictSeunjeon_AdminDictSeunjeonDetailsJsp = new HtmlNext("/admin/dict/seunjeon/admin_dict_seunjeon_details.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/seunjeon/admin_dict_seunjeon_download.jsp */
|
||||
HtmlNext path_AdminDictSeunjeon_AdminDictSeunjeonDownloadJsp = new HtmlNext("/admin/dict/seunjeon/admin_dict_seunjeon_download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/seunjeon/admin_dict_seunjeon_edit.jsp */
|
||||
HtmlNext path_AdminDictSeunjeon_AdminDictSeunjeonEditJsp = new HtmlNext("/admin/dict/seunjeon/admin_dict_seunjeon_edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/seunjeon/admin_dict_seunjeon_upload.jsp */
|
||||
HtmlNext path_AdminDictSeunjeon_AdminDictSeunjeonUploadJsp = new HtmlNext("/admin/dict/seunjeon/admin_dict_seunjeon_upload.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/synonym/admin_dict_synonym.jsp */
|
||||
HtmlNext path_AdminDictSynonym_AdminDictSynonymJsp = new HtmlNext("/admin/dict/synonym/admin_dict_synonym.jsp");
|
||||
|
||||
|
|
|
@ -1944,45 +1944,6 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Mapping File */
|
||||
public static final String LABELS_dict_mapping_file = "{labels.dict_mapping_file}";
|
||||
|
||||
/** The key of the message: Seunjeon List */
|
||||
public static final String LABELS_dict_seunjeon_configuration = "{labels.dict_seunjeon_configuration}";
|
||||
|
||||
/** The key of the message: Seunjeon List */
|
||||
public static final String LABELS_dict_seunjeon_title = "{labels.dict_seunjeon_title}";
|
||||
|
||||
/** The key of the message: List */
|
||||
public static final String LABELS_dict_seunjeon_list_link = "{labels.dict_seunjeon_list_link}";
|
||||
|
||||
/** The key of the message: Create New */
|
||||
public static final String LABELS_dict_seunjeon_link_create = "{labels.dict_seunjeon_link_create}";
|
||||
|
||||
/** The key of the message: Edit */
|
||||
public static final String LABELS_dict_seunjeon_link_edit = "{labels.dict_seunjeon_link_edit}";
|
||||
|
||||
/** The key of the message: Delete */
|
||||
public static final String LABELS_dict_seunjeon_link_delete = "{labels.dict_seunjeon_link_delete}";
|
||||
|
||||
/** The key of the message: Details */
|
||||
public static final String LABELS_dict_seunjeon_link_details = "{labels.dict_seunjeon_link_details}";
|
||||
|
||||
/** The key of the message: Download */
|
||||
public static final String LABELS_dict_seunjeon_link_download = "{labels.dict_seunjeon_link_download}";
|
||||
|
||||
/** The key of the message: Upload */
|
||||
public static final String LABELS_dict_seunjeon_link_upload = "{labels.dict_seunjeon_link_upload}";
|
||||
|
||||
/** The key of the message: Source */
|
||||
public static final String LABELS_dict_seunjeon_source = "{labels.dict_seunjeon_source}";
|
||||
|
||||
/** The key of the message: Download */
|
||||
public static final String LABELS_dict_seunjeon_button_download = "{labels.dict_seunjeon_button_download}";
|
||||
|
||||
/** The key of the message: Upload */
|
||||
public static final String LABELS_dict_seunjeon_button_upload = "{labels.dict_seunjeon_button_upload}";
|
||||
|
||||
/** The key of the message: Seunjeon File */
|
||||
public static final String LABELS_dict_seunjeon_file = "{labels.dict_seunjeon_file}";
|
||||
|
||||
/** The key of the message: Kuromoji List */
|
||||
public static final String LABELS_dict_kuromoji_configuration = "{labels.dict_kuromoji_configuration}";
|
||||
|
||||
|
|
|
@ -1042,9 +1042,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
/** The key of the configuration. e.g. kuromoji */
|
||||
String ONLINE_HELP_NAME_DICT_KUROMOJI = "online.help.name.dict.kuromoji";
|
||||
|
||||
/** The key of the configuration. e.g. seunjeon */
|
||||
String ONLINE_HELP_NAME_DICT_SEUNJEON = "online.help.name.dict.seunjeon";
|
||||
|
||||
/** The key of the configuration. e.g. protwords */
|
||||
String ONLINE_HELP_NAME_DICT_PROTWORDS = "online.help.name.dict.protwords";
|
||||
|
||||
|
@ -4875,13 +4872,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
*/
|
||||
String getOnlineHelpNameDictKuromoji();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.name.dict.seunjeon'. <br>
|
||||
* The value is, e.g. seunjeon <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getOnlineHelpNameDictSeunjeon();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.name.dict.protwords'. <br>
|
||||
* The value is, e.g. protwords <br>
|
||||
|
@ -7803,10 +7793,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
return get(FessConfig.ONLINE_HELP_NAME_DICT_KUROMOJI);
|
||||
}
|
||||
|
||||
public String getOnlineHelpNameDictSeunjeon() {
|
||||
return get(FessConfig.ONLINE_HELP_NAME_DICT_SEUNJEON);
|
||||
}
|
||||
|
||||
public String getOnlineHelpNameDictProtwords() {
|
||||
return get(FessConfig.ONLINE_HELP_NAME_DICT_PROTWORDS);
|
||||
}
|
||||
|
@ -8755,7 +8741,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_SYNONYM, "synonym");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT, "dict");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_KUROMOJI, "kuromoji");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_SEUNJEON, "seunjeon");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_PROTWORDS, "protwords");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_DICT_MAPPING, "mapping");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_WEBCONFIG, "webconfig");
|
||||
|
|
|
@ -545,7 +545,6 @@ online.help.name.reqheader=reqheader
|
|||
online.help.name.dict.synonym=synonym
|
||||
online.help.name.dict=dict
|
||||
online.help.name.dict.kuromoji=kuromoji
|
||||
online.help.name.dict.seunjeon=seunjeon
|
||||
online.help.name.dict.protwords=protwords
|
||||
online.help.name.dict.mapping=mapping
|
||||
online.help.name.webconfig=webconfig
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
<postConstruct name="addCreator">
|
||||
<arg>kuromojiDictCreator</arg>
|
||||
</postConstruct>
|
||||
<postConstruct name="addCreator">
|
||||
<arg>seunjeonDictCreator</arg>
|
||||
</postConstruct>
|
||||
<postConstruct name="addCreator">
|
||||
<arg>synonymCreator</arg>
|
||||
</postConstruct>
|
||||
|
@ -25,9 +22,6 @@
|
|||
<component name="kuromojiDictCreator"
|
||||
class="org.codelibs.fess.dict.kuromoji.KuromojiCreator">
|
||||
</component>
|
||||
<component name="seunjeonDictCreator"
|
||||
class="org.codelibs.fess.dict.seunjeon.SeunjeonCreator">
|
||||
</component>
|
||||
<component name="synonymCreator"
|
||||
class="org.codelibs.fess.dict.synonym.SynonymCreator">
|
||||
</component>
|
||||
|
|
|
@ -638,19 +638,6 @@ labels.dict_mapping_target=Target
|
|||
labels.dict_mapping_button_download=Download
|
||||
labels.dict_mapping_button_upload=Upload
|
||||
labels.dict_mapping_file=Mapping File
|
||||
labels.dict_seunjeon_configuration = Seunjeon List
|
||||
labels.dict_seunjeon_title = Seunjeon List
|
||||
labels.dict_seunjeon_list_link = List
|
||||
labels.dict_seunjeon_link_create = Create New
|
||||
labels.dict_seunjeon_link_edit = Edit
|
||||
labels.dict_seunjeon_link_delete = Delete
|
||||
labels.dict_seunjeon_link_details = Details
|
||||
labels.dict_seunjeon_link_download = Download
|
||||
labels.dict_seunjeon_link_upload = Upload
|
||||
labels.dict_seunjeon_source = Source
|
||||
labels.dict_seunjeon_button_download = Download
|
||||
labels.dict_seunjeon_button_upload = Upload
|
||||
labels.dict_seunjeon_file = Seunjeon File
|
||||
labels.dict_kuromoji_configuration=Kuromoji List
|
||||
labels.dict_kuromoji_title=Kuromoji List
|
||||
labels.dict_kuromoji_list_link=List
|
||||
|
|
|
@ -635,19 +635,6 @@ labels.dict_mapping_target=Target
|
|||
labels.dict_mapping_button_download=Download
|
||||
labels.dict_mapping_button_upload=Upload
|
||||
labels.dict_mapping_file=Mapping File
|
||||
labels.dict_seunjeon_configuration = Seunjeon List
|
||||
labels.dict_seunjeon_title = Seunjeon List
|
||||
labels.dict_seunjeon_list_link = List
|
||||
labels.dict_seunjeon_link_create = Create New
|
||||
labels.dict_seunjeon_link_edit = Edit
|
||||
labels.dict_seunjeon_link_delete = Delete
|
||||
labels.dict_seunjeon_link_details = Details
|
||||
labels.dict_seunjeon_link_download = Download
|
||||
labels.dict_seunjeon_link_upload = Upload
|
||||
labels.dict_seunjeon_source = Source
|
||||
labels.dict_seunjeon_button_download = Download
|
||||
labels.dict_seunjeon_button_upload = Upload
|
||||
labels.dict_seunjeon_file = Seunjeon File
|
||||
labels.dict_kuromoji_configuration=Kuromoji List
|
||||
labels.dict_kuromoji_title=Kuromoji List
|
||||
labels.dict_kuromoji_list_link=List
|
||||
|
|
|
@ -638,19 +638,6 @@ labels.dict_mapping_target=Target
|
|||
labels.dict_mapping_button_download=Download
|
||||
labels.dict_mapping_button_upload=Upload
|
||||
labels.dict_mapping_file=Mapping File
|
||||
labels.dict_seunjeon_configuration = Seunjeon List
|
||||
labels.dict_seunjeon_title = Seunjeon List
|
||||
labels.dict_seunjeon_list_link = List
|
||||
labels.dict_seunjeon_link_create = Create New
|
||||
labels.dict_seunjeon_link_edit = Edit
|
||||
labels.dict_seunjeon_link_delete = Delete
|
||||
labels.dict_seunjeon_link_details = Details
|
||||
labels.dict_seunjeon_link_download = Download
|
||||
labels.dict_seunjeon_link_upload = Upload
|
||||
labels.dict_seunjeon_source = Source
|
||||
labels.dict_seunjeon_button_download = Download
|
||||
labels.dict_seunjeon_button_upload = Upload
|
||||
labels.dict_seunjeon_file = Seunjeon File
|
||||
labels.dict_kuromoji_configuration=Kuromoji List
|
||||
labels.dict_kuromoji_title=Kuromoji List
|
||||
labels.dict_kuromoji_list_link=List
|
||||
|
|
|
@ -632,19 +632,6 @@ labels.dict_mapping_button_download=ダウンロード
|
|||
labels.dict_mapping_button_upload=アップロード
|
||||
labels.dict_mapping_file=マッピングファイル
|
||||
|
||||
labels.dict_seunjeon_configuration = Seunjeon単語一覧
|
||||
labels.dict_seunjeon_title = Seunjeon単語一覧
|
||||
labels.dict_seunjeon_list_link = 一覧
|
||||
labels.dict_seunjeon_link_create = 新規作成
|
||||
labels.dict_seunjeon_link_edit = 編集
|
||||
labels.dict_seunjeon_link_delete = 削除
|
||||
labels.dict_seunjeon_link_details = 詳細
|
||||
labels.dict_seunjeon_link_download = ダウンロード
|
||||
labels.dict_seunjeon_link_upload = アップロード
|
||||
labels.dict_seunjeon_source = 単語情報
|
||||
labels.dict_seunjeon_button_download = ダウンロード
|
||||
labels.dict_seunjeon_button_upload = アップロード
|
||||
labels.dict_seunjeon_file = Seunjeonファイル
|
||||
labels.dict_kuromoji_configuration=Kuromoji単語一覧
|
||||
labels.dict_kuromoji_title=Kuromoji単語一覧
|
||||
labels.dict_kuromoji_list_link=一覧
|
||||
|
|
|
@ -617,19 +617,6 @@ labels.dict_mapping_button_download = 다운로드
|
|||
labels.dict_mapping_button_upload = 업로드
|
||||
labels.dict_mapping_file = 매핑 파일
|
||||
|
||||
labels.dict_seunjeon_configuration = Seunjeon 단어 목록
|
||||
labels.dict_seunjeon_title = Seunjeon 단어 목록
|
||||
labels.dict_seunjeon_list_link = 목록
|
||||
labels.dict_seunjeon_link_create = 새로 만들기
|
||||
labels.dict_seunjeon_link_edit = 편집
|
||||
labels.dict_seunjeon_link_delete = 삭제
|
||||
labels.dict_seunjeon_link_details = 상세
|
||||
labels.dict_seunjeon_link_download = 다운로드
|
||||
labels.dict_seunjeon_link_upload = 업로드
|
||||
labels.dict_seunjeon_source = 단어 정보
|
||||
labels.dict_seunjeon_button_download = 다운로드
|
||||
labels.dict_seunjeon_button_upload = 업로드
|
||||
labels.dict_seunjeon_file = Seunjeon 파일
|
||||
labels.dict_kuromoji_configuration = Kuromoji 단어 목록
|
||||
labels.dict_kuromoji_title = Kuromoji 단어 목록
|
||||
labels.dict_kuromoji_list_link = 목록
|
||||
|
|
|
@ -618,19 +618,6 @@ labels.dict_mapping_target=Target
|
|||
labels.dict_mapping_button_download=Download
|
||||
labels.dict_mapping_button_upload=Upload
|
||||
labels.dict_mapping_file=Mapping File
|
||||
labels.dict_seunjeon_configuration = Seunjeon List
|
||||
labels.dict_seunjeon_title = Seunjeon List
|
||||
labels.dict_seunjeon_list_link = List
|
||||
labels.dict_seunjeon_link_create = Create New
|
||||
labels.dict_seunjeon_link_edit = Изменить
|
||||
labels.dict_seunjeon_link_delete = Удалить
|
||||
labels.dict_seunjeon_link_details = Details
|
||||
labels.dict_seunjeon_link_download = Download
|
||||
labels.dict_seunjeon_link_upload = Upload
|
||||
labels.dict_seunjeon_source = Source
|
||||
labels.dict_seunjeon_button_download = Download
|
||||
labels.dict_seunjeon_button_upload = Upload
|
||||
labels.dict_seunjeon_file = Seunjeon File
|
||||
labels.dict_kuromoji_configuration=Kuromoji List
|
||||
labels.dict_kuromoji_title=Kuromoji List
|
||||
labels.dict_kuromoji_list_link=List
|
||||
|
|
|
@ -1,154 +0,0 @@
|
|||
<%@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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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="${seunjeonPager.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="${seunjeonPager.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_seunjeon_source" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="data" varStatus="s"
|
||||
items="${seunjeonItemItems}">
|
||||
<tr
|
||||
data-href="${contextPath}/admin/dict/seunjeon/details/${f:u(dictId)}/4/${f:u(data.id)}">
|
||||
<td>${f:h(data.inputsValue)}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="pager" value="${seunjeonPager}" 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>
|
|
@ -1,123 +0,0 @@
|
|||
<%@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_seunjeon_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_seunjeon_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_seunjeon_list_link" />
|
||||
</la:link></li>
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_seunjeon_link_details" /></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/seunjeon/">
|
||||
<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_seunjeon_link_create" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 2}">
|
||||
<la:message key="labels.dict_seunjeon_link_edit" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 3}">
|
||||
<la:message key="labels.dict_seunjeon_link_delete" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 4}">
|
||||
<la:message key="labels.dict_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_source" /></th>
|
||||
<td>${f:h(inputs)}<la:hidden property="inputs" /></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>
|
|
@ -1,103 +0,0 @@
|
|||
<%@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_seunjeon_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_seunjeon_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_seunjeon_list_link" />
|
||||
</la:link></li>
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_seunjeon_link_download" /></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/seunjeon/">
|
||||
<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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_button_download" />">
|
||||
<i class="fa fa-download"></i>
|
||||
<la:message key="labels.dict_seunjeon_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>
|
|
@ -1,120 +0,0 @@
|
|||
<%@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_seunjeon_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_seunjeon_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_seunjeon_list_link" />
|
||||
</la:link></li>
|
||||
<c:if test="${crudMode == 1}">
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_seunjeon_link_create" /></li>
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 2}">
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_seunjeon_link_edit" /></li>
|
||||
</c:if>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/seunjeon/" 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_seunjeon_link_create" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 2}">
|
||||
<la:message key="labels.dict_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_source" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="inputs" />
|
||||
<la:text styleId="inputs" property="inputs"
|
||||
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>
|
|
@ -1,107 +0,0 @@
|
|||
<%@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_seunjeon_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_seunjeon_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_seunjeon_list_link" />
|
||||
</la:link></li>
|
||||
<li class="active"><la:message
|
||||
key="labels.dict_seunjeon_link_upload" /></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/dict/seunjeon/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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_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_seunjeon_file" /></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="file" name="seunjeonFile" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-success"
|
||||
value="<la:message key="labels.dict_seunjeon_button_upload" />">
|
||||
<i class="fa fa-upload"></i>
|
||||
<la:message key="labels.dict_seunjeon_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>
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* 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 static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Tag("it")
|
||||
public class SeunjeonTests extends DictCrudTestBase {
|
||||
|
||||
private static final String NAME_PREFIX = "seunjeonTest_";
|
||||
private static final String API_PATH = "/api/admin/dict/seunjeon";
|
||||
private static final String LIST_ENDPOINT_SUFFIX = "settings";
|
||||
private static final String ITEM_ENDPOINT_SUFFIX = "setting";
|
||||
private static final String DICT_TYPE = "seunjeon";
|
||||
|
||||
private static final String KEY_PROPERTY = "inputs";
|
||||
|
||||
@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);
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Object> getUpdateMap() {
|
||||
assertTrue(false); // Unreachable
|
||||
return null;
|
||||
}
|
||||
|
||||
@Test
|
||||
void crudTest() {
|
||||
testCreate();
|
||||
testRead();
|
||||
testDelete();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue