diff --git a/src/main/java/org/codelibs/fess/app/web/admin/fileauth/AdminFileauthAction.java b/src/main/java/org/codelibs/fess/app/web/admin/fileauth/AdminFileauthAction.java index 049da72bd..270424156 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/fileauth/AdminFileauthAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/fileauth/AdminFileauthAction.java @@ -31,6 +31,7 @@ import org.codelibs.fess.app.web.CrudMode; import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.FileAuthentication; import org.codelibs.fess.es.config.exentity.FileConfig; +import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; import org.codelibs.fess.util.RenderDataUtil; import org.dbflute.optional.OptionalEntity; @@ -241,7 +242,7 @@ public class AdminFileauthAction extends FessAdminAction { //=================================================================================== // Assist Logic // ============ - private OptionalEntity getEntity(final CreateForm form, final String username, final long currentTime) { + static public OptionalEntity getEntity(final CreateForm form, final String username, final long currentTime) { switch (form.crudMode) { case CrudMode.CREATE: return OptionalEntity.of(new FileAuthentication()).map(entity -> { @@ -251,7 +252,7 @@ public class AdminFileauthAction extends FessAdminAction { }); case CrudMode.EDIT: if (form instanceof EditForm) { - return fileAuthenticationService.getFileAuthentication(((EditForm) form).id); + return ComponentUtil.getComponent(FileAuthenticationService.class).getFileAuthentication(((EditForm) form).id); } break; default: @@ -260,7 +261,8 @@ public class AdminFileauthAction extends FessAdminAction { return OptionalEntity.empty(); } - protected OptionalEntity getFileAuthentication(final CreateForm form) { + static public OptionalEntity getFileAuthentication(final CreateForm form) { + final SystemHelper systemHelper = ComponentUtil.getSystemHelper(); final String username = systemHelper.getUsername(); final long currentTime = systemHelper.getCurrentTimeAsLong(); return getEntity(form, username, currentTime).map(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/reqheader/AdminReqheaderAction.java b/src/main/java/org/codelibs/fess/app/web/admin/reqheader/AdminReqheaderAction.java index 934bb27c0..b7a067148 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/reqheader/AdminReqheaderAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/reqheader/AdminReqheaderAction.java @@ -30,6 +30,8 @@ import org.codelibs.fess.app.web.CrudMode; import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.RequestHeader; import org.codelibs.fess.es.config.exentity.WebConfig; +import org.codelibs.fess.helper.SystemHelper; +import org.codelibs.fess.util.ComponentUtil; import org.codelibs.fess.util.RenderDataUtil; import org.dbflute.optional.OptionalEntity; import org.dbflute.optional.OptionalThing; @@ -154,7 +156,7 @@ public class AdminReqheaderAction extends FessAdminAction { public HtmlResponse details(final int crudMode, final String id) { verifyCrudMode(crudMode, CrudMode.DETAILS); saveToken(); - return asHtml(path_AdminReqheader_AdminReqheaderDetailsJsp).useForm(EditForm.class, op -> { + return asDetailsHtml().useForm(EditForm.class, op -> { op.setup(form -> { requestHeaderService.getRequestHeader(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -238,7 +240,7 @@ public class AdminReqheaderAction extends FessAdminAction { // =================================================================================== // Assist Logic // ============ - private OptionalEntity getEntity(final CreateForm form, final String username, final long currentTime) { + static public OptionalEntity getEntity(final CreateForm form, final String username, final long currentTime) { switch (form.crudMode) { case CrudMode.CREATE: return OptionalEntity.of(new RequestHeader()).map(entity -> { @@ -248,7 +250,7 @@ public class AdminReqheaderAction extends FessAdminAction { }); case CrudMode.EDIT: if (form instanceof EditForm) { - return requestHeaderService.getRequestHeader(((EditForm) form).id); + return ComponentUtil.getComponent(RequestHeaderService.class).getRequestHeader(((EditForm) form).id); } break; default: @@ -257,7 +259,8 @@ public class AdminReqheaderAction extends FessAdminAction { return OptionalEntity.empty(); } - protected OptionalEntity getRequestHeader(final CreateForm form) { + static public OptionalEntity getRequestHeader(final CreateForm form) { + final SystemHelper systemHelper = ComponentUtil.getSystemHelper(); final String username = systemHelper.getUsername(); final long currentTime = systemHelper.getCurrentTimeAsLong(); return getEntity(form, username, currentTime).map(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/webauth/AdminWebauthAction.java b/src/main/java/org/codelibs/fess/app/web/admin/webauth/AdminWebauthAction.java index 585303c40..4ffa528d1 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/webauth/AdminWebauthAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/webauth/AdminWebauthAction.java @@ -31,6 +31,7 @@ import org.codelibs.fess.app.web.CrudMode; import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.WebAuthentication; import org.codelibs.fess.es.config.exentity.WebConfig; +import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; import org.codelibs.fess.util.RenderDataUtil; import org.dbflute.optional.OptionalEntity; @@ -242,7 +243,7 @@ public class AdminWebauthAction extends FessAdminAction { //=================================================================================== // Assist Logic // ============ - private OptionalEntity getEntity(final CreateForm form, final String username, final long currentTime) { + public static OptionalEntity getEntity(final CreateForm form, final String username, final long currentTime) { switch (form.crudMode) { case CrudMode.CREATE: return OptionalEntity.of(new WebAuthentication()).map(entity -> { @@ -252,7 +253,7 @@ public class AdminWebauthAction extends FessAdminAction { }); case CrudMode.EDIT: if (form instanceof EditForm) { - return webAuthenticationService.getWebAuthentication(((EditForm) form).id); + return ComponentUtil.getComponent(WebAuthenticationService.class).getWebAuthentication(((EditForm) form).id); } break; default: @@ -261,7 +262,8 @@ public class AdminWebauthAction extends FessAdminAction { return OptionalEntity.empty(); } - protected OptionalEntity getWebAuthentication(final CreateForm form) { + public static OptionalEntity getWebAuthentication(final CreateForm form) { + final SystemHelper systemHelper = ComponentUtil.getSystemHelper(); final String username = systemHelper.getUsername(); final long currentTime = systemHelper.getCurrentTimeAsLong(); return getEntity(form, username, currentTime).map(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/ApiAdminCrawlinginfoAction.java b/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/ApiAdminCrawlinginfoAction.java new file mode 100644 index 000000000..59b366092 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/ApiAdminCrawlinginfoAction.java @@ -0,0 +1,114 @@ +/* + * Copyright 2012-2017 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.crawlinginfo; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.codelibs.fess.Constants; +import org.codelibs.fess.app.pager.CrawlingInfoPager; +import org.codelibs.fess.app.service.CrawlingInfoService; +import org.codelibs.fess.app.web.api.ApiResult; +import org.codelibs.fess.app.web.api.ApiResult.ApiLogResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiResponse; +import org.codelibs.fess.app.web.api.ApiResult.Status; +import org.codelibs.fess.app.web.api.admin.FessApiAdminAction; +import org.codelibs.fess.es.config.exentity.CrawlingInfo; +import org.codelibs.fess.helper.ProcessHelper; +import org.lastaflute.web.Execute; +import org.lastaflute.web.response.JsonResponse; + +/** + * @author Keiichi Watanabe + */ +public class ApiAdminCrawlinginfoAction extends FessApiAdminAction { + + // =================================================================================== + // Attribute + // ========= + @Resource + private CrawlingInfoService crawlingInfoService; + @Resource + private CrawlingInfoPager crawlingInfoPager; + @Resource + protected ProcessHelper processHelper; + + // =================================================================================== + // Search Execute + // ============== + + // GET /api/admin/crawlinginfo/logs + // POST /api/admin/crawlinginfo/logs + @Execute + public JsonResponse logs(final SearchBody body) { + validateApi(body, messages -> {}); + final CrawlingInfoPager pager = new CrawlingInfoPager(); + copyBeanToBean(body, pager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE)); + final List list = crawlingInfoService.getCrawlingInfoList(pager); + return asJson(new ApiResult.ApiLogsResponse() + .logs(list.stream().map(entity -> createEditBody(entity)).collect(Collectors.toList())) + .total(pager.getAllRecordCount()).status(ApiResult.Status.OK).result()); + } + + // GET /api/admin/crawlinginfo/log/{id} + @Execute + public JsonResponse get$log(final String id) { + return asJson(new ApiLogResponse() + .log(crawlingInfoService.getCrawlingInfo(id).map(entity -> createEditBody(entity)).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + return null; + })).status(Status.OK).result()); + } + + // DELETE /api/admin/crawlinginfo/log/{id} + @Execute + public JsonResponse delete$log(final String id) { + crawlingInfoService.getCrawlingInfo(id).ifPresent(entity -> { + try { + crawlingInfoService.delete(entity); + saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL)); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e))); + } + }).orElse(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + }); + return asJson(new ApiResponse().status(Status.OK).result()); + } + + // DELETE /api/admin/crawlinginfo/all + @Execute + public JsonResponse delete$all() { + try { + crawlingInfoService.deleteOldSessions(processHelper.getRunningSessionIdSet()); + crawlingInfoPager.clear(); + saveInfo(messages -> messages.addSuccessCrawlingInfoDeleteAll(GLOBAL)); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return asJson(new ApiResponse().status(Status.OK).result()); + } + + protected EditBody createEditBody(final CrawlingInfo entity) { + final EditBody body = new EditBody(); + copyBeanToBean(entity, body, copyOp -> { + copyOp.excludeNull(); + }); + return body; + } +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/EditBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/EditBody.java new file mode 100644 index 000000000..d431e3190 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/EditBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.crawlinginfo; + +import org.codelibs.fess.app.web.admin.crawlinginfo.EditForm; + +public class EditBody extends EditForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/SearchBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/SearchBody.java new file mode 100644 index 000000000..be809209a --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/crawlinginfo/SearchBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.crawlinginfo; + +import org.codelibs.fess.app.web.admin.crawlinginfo.SearchForm; + +public class SearchBody extends SearchForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/ApiAdminFailureurlAction.java b/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/ApiAdminFailureurlAction.java new file mode 100644 index 000000000..a30b6a74a --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/ApiAdminFailureurlAction.java @@ -0,0 +1,114 @@ +/* + * Copyright 2012-2017 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.failureurl; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.codelibs.fess.Constants; +import org.codelibs.fess.app.pager.FailureUrlPager; +import org.codelibs.fess.app.service.FailureUrlService; +import org.codelibs.fess.app.web.api.ApiResult; +import org.codelibs.fess.app.web.api.ApiResult.ApiLogResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiResponse; +import org.codelibs.fess.app.web.api.ApiResult.Status; +import org.codelibs.fess.app.web.api.admin.FessApiAdminAction; +import org.codelibs.fess.es.config.exentity.FailureUrl; +import org.codelibs.fess.helper.ProcessHelper; +import org.lastaflute.web.Execute; +import org.lastaflute.web.response.JsonResponse; + +/** + * @author Keiichi Watanabe + */ +public class ApiAdminFailureurlAction extends FessApiAdminAction { + + // =================================================================================== + // Attribute + // ========= + @Resource + private FailureUrlService failureUrlService; + @Resource + private FailureUrlPager failureUrlPager; + @Resource + protected ProcessHelper processHelper; + + // =================================================================================== + // Search Execute + // ============== + + // GET /api/admin/failureurl/logs + // POST /api/admin/failureurl/logs + @Execute + public JsonResponse logs(final SearchBody body) { + validateApi(body, messages -> {}); + final FailureUrlPager pager = new FailureUrlPager(); + copyBeanToBean(body, pager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE)); + final List list = failureUrlService.getFailureUrlList(pager); + return asJson(new ApiResult.ApiLogsResponse() + .logs(list.stream().map(entity -> createEditBody(entity)).collect(Collectors.toList())) + .total(pager.getAllRecordCount()).status(ApiResult.Status.OK).result()); + } + + // GET /api/admin/failureurl/log/{id} + @Execute + public JsonResponse get$log(final String id) { + return asJson(new ApiLogResponse() + .log(failureUrlService.getFailureUrl(id).map(entity -> createEditBody(entity)).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + return null; + })).status(Status.OK).result()); + } + + // DELETE /api/admin/failureurl/log/{id} + @Execute + public JsonResponse delete$log(final String id) { + failureUrlService.getFailureUrl(id).ifPresent(entity -> { + try { + failureUrlService.delete(entity); + saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL)); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e))); + } + }).orElse(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + }); + return asJson(new ApiResponse().status(Status.OK).result()); + } + + // DELETE /api/admin/failureurl/all + @Execute + public JsonResponse delete$all() { + try { + failureUrlService.deleteAll(failureUrlPager); + failureUrlPager.clear(); + saveInfo(messages -> messages.addSuccessFailureUrlDeleteAll(GLOBAL)); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return asJson(new ApiResponse().status(Status.OK).result()); + } + + protected EditBody createEditBody(final FailureUrl entity) { + final EditBody body = new EditBody(); + copyBeanToBean(entity, body, copyOp -> { + copyOp.excludeNull(); + }); + return body; + } +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/EditBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/EditBody.java new file mode 100644 index 000000000..dda542537 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/EditBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.failureurl; + +import org.codelibs.fess.app.web.admin.failureurl.EditForm; + +public class EditBody extends EditForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/SearchBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/SearchBody.java new file mode 100644 index 000000000..4875a6ddb --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/failureurl/SearchBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.failureurl; + +import org.codelibs.fess.app.web.admin.failureurl.SearchForm; + +public class SearchBody extends SearchForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/ApiAdminFileauthAction.java b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/ApiAdminFileauthAction.java new file mode 100644 index 000000000..02b520e77 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/ApiAdminFileauthAction.java @@ -0,0 +1,151 @@ +/* + * Copyright 2012-2017 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.fileauth; + +import static org.codelibs.fess.app.web.admin.fileauth.AdminFileauthAction.getFileAuthentication; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.codelibs.fess.Constants; +import org.codelibs.fess.app.pager.FileAuthPager; +import org.codelibs.fess.app.service.FileAuthenticationService; +import org.codelibs.fess.app.service.FileConfigService; +import org.codelibs.fess.app.web.CrudMode; +import org.codelibs.fess.app.web.api.ApiResult; +import org.codelibs.fess.app.web.api.ApiResult.ApiConfigResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiErrorResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiUpdateResponse; +import org.codelibs.fess.app.web.api.ApiResult.Status; +import org.codelibs.fess.app.web.api.admin.FessApiAdminAction; +import org.codelibs.fess.es.config.exentity.FileAuthentication; +import org.lastaflute.web.Execute; +import org.lastaflute.web.response.JsonResponse; + +/** + * @author Keiichi Watanabe + */ +public class ApiAdminFileauthAction extends FessApiAdminAction { + + // =================================================================================== + // Attribute + // ========= + @Resource + private FileAuthenticationService fileAuthService; + @Resource + private FileConfigService fileConfigService; + + // =================================================================================== + // Search Execute + // ============== + + // GET /api/admin/fileauth/settings + // POST /api/admin/fileauth/settings + @Execute + public JsonResponse settings(final SearchBody body) { + validateApi(body, messages -> {}); + final FileAuthPager pager = new FileAuthPager(); + copyBeanToBean(body, pager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE)); + final List list = fileAuthService.getFileAuthenticationList(pager); + return asJson(new ApiResult.ApiConfigsResponse() + .settings(list.stream().map(entity -> createEditBody(entity)).collect(Collectors.toList())) + .total(pager.getAllRecordCount()).status(ApiResult.Status.OK).result()); + } + + // GET /api/admin/fileauth/setting/{id} + @Execute + public JsonResponse get$setting(final String id) { + return asJson(new ApiConfigResponse() + .setting(fileAuthService.getFileAuthentication(id).map(entity -> createEditBody(entity)).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + return null; + })).status(Status.OK).result()); + } + + // PUT /api/admin/fileauth/setting + @Execute + public JsonResponse put$setting(final CreateBody body) { + validateApi(body, messages -> {}); + if (!isValidFileConfigId(body.fileConfigId)) { + return asJson(new ApiErrorResponse().message("invalid fileConfigId").status(Status.BAD_REQUEST).result()); + } + + body.crudMode = CrudMode.CREATE; + final FileAuthentication fileAuth = getFileAuthentication(body).map(entity -> { + try { + fileAuthService.store(entity); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return entity; + }).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL)); + return null; + }); + + return asJson(new ApiUpdateResponse().id(fileAuth.getId()).created(true).status(Status.OK).result()); + } + + // POST /api/admin/fileauth/setting + @Execute + public JsonResponse post$setting(final EditBody body) { + validateApi(body, messages -> {}); + body.crudMode = CrudMode.EDIT; + final FileAuthentication fileAuth = getFileAuthentication(body).map(entity -> { + try { + fileAuthService.store(entity); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return entity; + }).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, body.id)); + return null; + }); + return asJson(new ApiUpdateResponse().id(fileAuth.getId()).created(false).status(Status.OK).result()); + } + + // DELETE /api/admin/fileauth/setting/{id} + @Execute + public JsonResponse delete$setting(final String id) { + fileAuthService.getFileAuthentication(id).ifPresent(entity -> { + try { + fileAuthService.delete(entity); + saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL)); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e))); + } + }).orElse(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + }); + return asJson(new ApiResponse().status(Status.OK).result()); + } + + protected EditBody createEditBody(final FileAuthentication entity) { + final EditBody body = new EditBody(); + copyBeanToBean(entity, body, copyOp -> { + copyOp.excludeNull(); + }); + return body; + } + + protected Boolean isValidFileConfigId(String fileconfigId) { + return fileConfigService.getFileConfig(fileconfigId).isPresent(); + } +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/CreateBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/CreateBody.java new file mode 100644 index 000000000..be32a4539 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/CreateBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.fileauth; + +import org.codelibs.fess.app.web.admin.fileauth.CreateForm; + +public class CreateBody extends CreateForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/EditBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/EditBody.java new file mode 100644 index 000000000..30c4a883c --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/EditBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.fileauth; + +import org.codelibs.fess.app.web.admin.fileauth.EditForm; + +public class EditBody extends EditForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/SearchBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/SearchBody.java new file mode 100644 index 000000000..35ebcba3d --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/fileauth/SearchBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.fileauth; + +import org.codelibs.fess.app.web.admin.fileauth.SearchForm; + +public class SearchBody extends SearchForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/ApiAdminReqheaderAction.java b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/ApiAdminReqheaderAction.java new file mode 100644 index 000000000..da8fe1303 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/ApiAdminReqheaderAction.java @@ -0,0 +1,151 @@ +/* + * Copyright 2012-2017 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.reqheader; + +import static org.codelibs.fess.app.web.admin.reqheader.AdminReqheaderAction.getRequestHeader; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.codelibs.fess.Constants; +import org.codelibs.fess.app.pager.ReqHeaderPager; +import org.codelibs.fess.app.service.RequestHeaderService; +import org.codelibs.fess.app.service.WebConfigService; +import org.codelibs.fess.app.web.CrudMode; +import org.codelibs.fess.app.web.api.ApiResult; +import org.codelibs.fess.app.web.api.ApiResult.ApiConfigResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiErrorResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiUpdateResponse; +import org.codelibs.fess.app.web.api.ApiResult.Status; +import org.codelibs.fess.app.web.api.admin.FessApiAdminAction; +import org.codelibs.fess.es.config.exentity.RequestHeader; +import org.lastaflute.web.Execute; +import org.lastaflute.web.response.JsonResponse; + +/** + * @author Keiichi Watanabe + */ +public class ApiAdminReqheaderAction extends FessApiAdminAction { + + // =================================================================================== + // Attribute + // ========= + @Resource + private RequestHeaderService reqHeaderService; + @Resource + private WebConfigService webConfigService; + + // =================================================================================== + // Search Execute + // ============== + + // GET /api/admin/reqheader/settings + // POST /api/admin/reqheader/settings + @Execute + public JsonResponse settings(final SearchBody body) { + validateApi(body, messages -> {}); + final ReqHeaderPager pager = new ReqHeaderPager(); + copyBeanToBean(body, pager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE)); + final List list = reqHeaderService.getRequestHeaderList(pager); + return asJson(new ApiResult.ApiConfigsResponse() + .settings(list.stream().map(entity -> createEditBody(entity)).collect(Collectors.toList())) + .total(pager.getAllRecordCount()).status(ApiResult.Status.OK).result()); + } + + // GET /api/admin/reqheader/setting/{id} + @Execute + public JsonResponse get$setting(final String id) { + return asJson(new ApiConfigResponse() + .setting(reqHeaderService.getRequestHeader(id).map(entity -> createEditBody(entity)).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + return null; + })).status(Status.OK).result()); + } + + // PUT /api/admin/reqheader/setting + @Execute + public JsonResponse put$setting(final CreateBody body) { + validateApi(body, messages -> {}); + if (!isValidWebConfigId(body.webConfigId)) { + return asJson(new ApiErrorResponse().message("invalid webConfigId").status(Status.BAD_REQUEST).result()); + } + + body.crudMode = CrudMode.CREATE; + final RequestHeader reqHeader = getRequestHeader(body).map(entity -> { + try { + reqHeaderService.store(entity); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return entity; + }).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL)); + return null; + }); + + return asJson(new ApiUpdateResponse().id(reqHeader.getId()).created(true).status(Status.OK).result()); + } + + // POST /api/admin/reqheader/setting + @Execute + public JsonResponse post$setting(final EditBody body) { + validateApi(body, messages -> {}); + body.crudMode = CrudMode.EDIT; + final RequestHeader reqHeader = getRequestHeader(body).map(entity -> { + try { + reqHeaderService.store(entity); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return entity; + }).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, body.id)); + return null; + }); + return asJson(new ApiUpdateResponse().id(reqHeader.getId()).created(false).status(Status.OK).result()); + } + + // DELETE /api/admin/reqheader/setting/{id} + @Execute + public JsonResponse delete$setting(final String id) { + reqHeaderService.getRequestHeader(id).ifPresent(entity -> { + try { + reqHeaderService.delete(entity); + saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL)); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e))); + } + }).orElse(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + }); + return asJson(new ApiResponse().status(Status.OK).result()); + } + + protected EditBody createEditBody(final RequestHeader entity) { + final EditBody body = new EditBody(); + copyBeanToBean(entity, body, copyOp -> { + copyOp.excludeNull(); + }); + return body; + } + + protected Boolean isValidWebConfigId(String webconfigId) { + return webConfigService.getWebConfig(webconfigId).isPresent(); + } +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/CreateBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/CreateBody.java new file mode 100644 index 000000000..2be200d4c --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/CreateBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.reqheader; + +import org.codelibs.fess.app.web.admin.reqheader.CreateForm; + +public class CreateBody extends CreateForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/EditBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/EditBody.java new file mode 100644 index 000000000..6f0fb9725 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/EditBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.reqheader; + +import org.codelibs.fess.app.web.admin.reqheader.EditForm; + +public class EditBody extends EditForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/SearchBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/SearchBody.java new file mode 100644 index 000000000..491ddaf46 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/reqheader/SearchBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.reqheader; + +import org.codelibs.fess.app.web.admin.reqheader.SearchForm; + +public class SearchBody extends SearchForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/ApiAdminWebauthAction.java b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/ApiAdminWebauthAction.java new file mode 100644 index 000000000..39d8e0c12 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/ApiAdminWebauthAction.java @@ -0,0 +1,151 @@ +/* + * Copyright 2012-2017 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.webauth; + +import static org.codelibs.fess.app.web.admin.webauth.AdminWebauthAction.getWebAuthentication; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.codelibs.fess.Constants; +import org.codelibs.fess.app.pager.WebAuthPager; +import org.codelibs.fess.app.service.WebAuthenticationService; +import org.codelibs.fess.app.service.WebConfigService; +import org.codelibs.fess.app.web.CrudMode; +import org.codelibs.fess.app.web.api.ApiResult; +import org.codelibs.fess.app.web.api.ApiResult.ApiConfigResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiErrorResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiResponse; +import org.codelibs.fess.app.web.api.ApiResult.ApiUpdateResponse; +import org.codelibs.fess.app.web.api.ApiResult.Status; +import org.codelibs.fess.app.web.api.admin.FessApiAdminAction; +import org.codelibs.fess.es.config.exentity.WebAuthentication; +import org.lastaflute.web.Execute; +import org.lastaflute.web.response.JsonResponse; + +/** + * @author Keiichi Watanabe + */ +public class ApiAdminWebauthAction extends FessApiAdminAction { + + // =================================================================================== + // Attribute + // ========= + @Resource + private WebAuthenticationService webAuthService; + @Resource + private WebConfigService webConfigService; + + // =================================================================================== + // Search Execute + // ============== + + // GET /api/admin/webauth/settings + // POST /api/admin/webauth/settings + @Execute + public JsonResponse settings(final SearchBody body) { + validateApi(body, messages -> {}); + final WebAuthPager pager = new WebAuthPager(); + copyBeanToBean(body, pager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE)); + final List list = webAuthService.getWebAuthenticationList(pager); + return asJson(new ApiResult.ApiConfigsResponse() + .settings(list.stream().map(entity -> createEditBody(entity)).collect(Collectors.toList())) + .total(pager.getAllRecordCount()).status(ApiResult.Status.OK).result()); + } + + // GET /api/admin/webauth/setting/{id} + @Execute + public JsonResponse get$setting(final String id) { + return asJson(new ApiConfigResponse() + .setting(webAuthService.getWebAuthentication(id).map(entity -> createEditBody(entity)).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + return null; + })).status(Status.OK).result()); + } + + // PUT /api/admin/webauth/setting + @Execute + public JsonResponse put$setting(final CreateBody body) { + validateApi(body, messages -> {}); + if (!isValidWebConfigId(body.webConfigId)) { + return asJson(new ApiErrorResponse().message("invalid webConfigId").status(Status.BAD_REQUEST).result()); + } + + body.crudMode = CrudMode.CREATE; + final WebAuthentication webAuth = getWebAuthentication(body).map(entity -> { + try { + webAuthService.store(entity); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return entity; + }).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL)); + return null; + }); + + return asJson(new ApiUpdateResponse().id(webAuth.getId()).created(true).status(Status.OK).result()); + } + + // POST /api/admin/webauth/setting + @Execute + public JsonResponse post$setting(final EditBody body) { + validateApi(body, messages -> {}); + body.crudMode = CrudMode.EDIT; + final WebAuthentication webAuth = getWebAuthentication(body).map(entity -> { + try { + webAuthService.store(entity); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e))); + } + return entity; + }).orElseGet(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, body.id)); + return null; + }); + return asJson(new ApiUpdateResponse().id(webAuth.getId()).created(false).status(Status.OK).result()); + } + + // DELETE /api/admin/webauth/setting/{id} + @Execute + public JsonResponse delete$setting(final String id) { + webAuthService.getWebAuthentication(id).ifPresent(entity -> { + try { + webAuthService.delete(entity); + saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL)); + } catch (final Exception e) { + throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e))); + } + }).orElse(() -> { + throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id)); + }); + return asJson(new ApiResponse().status(Status.OK).result()); + } + + protected EditBody createEditBody(final WebAuthentication entity) { + final EditBody body = new EditBody(); + copyBeanToBean(entity, body, copyOp -> { + copyOp.excludeNull(); + }); + return body; + } + + protected Boolean isValidWebConfigId(String webconfigId) { + return webConfigService.getWebConfig(webconfigId).isPresent(); + } +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/CreateBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/CreateBody.java new file mode 100644 index 000000000..a76200d40 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/CreateBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.webauth; + +import org.codelibs.fess.app.web.admin.webauth.CreateForm; + +public class CreateBody extends CreateForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/EditBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/EditBody.java new file mode 100644 index 000000000..65520663d --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/EditBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.webauth; + +import org.codelibs.fess.app.web.admin.webauth.EditForm; + +public class EditBody extends EditForm { + +} diff --git a/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/SearchBody.java b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/SearchBody.java new file mode 100644 index 000000000..60f138fc1 --- /dev/null +++ b/src/main/java/org/codelibs/fess/app/web/api/admin/webauth/SearchBody.java @@ -0,0 +1,22 @@ +/* + * Copyright 2012-2017 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.webauth; + +import org.codelibs.fess.app.web.admin.webauth.SearchForm; + +public class SearchBody extends SearchForm { + +}