use of org.codelibs.fess.app.web.api.ApiResult.ApiResponse in project fess by codelibs.
the class ApiAdminCrawlinginfoAction method delete$all.
// DELETE /api/admin/crawlinginfo/all
@Execute
public JsonResponse<ApiResult> delete$all() {
try {
crawlingInfoService.deleteOldSessions(processHelper.getRunningSessionIdSet());
saveInfo(messages -> messages.addSuccessCrawlingInfoDeleteAll(GLOBAL));
} catch (final Exception e) {
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e)));
}
return asJson(new ApiResponse().status(Status.OK).result());
}
use of org.codelibs.fess.app.web.api.ApiResult.ApiResponse in project fess by codelibs.
the class ApiAdminGeneralAction method post$index.
// POST /api/admin/general
@Execute
public JsonResponse<ApiResult> post$index(final EditBody body) {
validateApi(body, messages -> {
});
final EditBody newBody = new EditBody();
AdminGeneralAction.updateForm(fessConfig, newBody);
BeanUtil.copyBeanToBean(body, newBody, CopyOptions::excludeNull);
AdminGeneralAction.updateConfig(fessConfig, newBody);
return asJson(new ApiResponse().status(Status.OK).result());
}
use of org.codelibs.fess.app.web.api.ApiResult.ApiResponse in project fess by codelibs.
the class ApiAdminSearchlistAction method delete$doc.
// DELETE /api/admin/searchlist/doc/{doc_id}
@Execute
public JsonResponse<ApiResult> delete$doc(final String id) {
try {
final QueryBuilder query = QueryBuilders.termQuery(fessConfig.getIndexFieldDocId(), id);
searchEngineClient.deleteByQuery(fessConfig.getIndexDocumentUpdateIndex(), query);
saveInfo(messages -> messages.addSuccessDeleteDocFromIndex(GLOBAL));
} catch (final Exception e) {
throwValidationErrorApi(messages -> messages.addErrorsFailedToDeleteDocInAdmin(GLOBAL));
}
return asJson(new ApiResponse().status(Status.OK).result());
}
use of org.codelibs.fess.app.web.api.ApiResult.ApiResponse in project fess by codelibs.
the class ApiAdminFailureurlAction method delete$all.
// DELETE /api/admin/failureurl/all
@Execute
public JsonResponse<ApiResult> 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());
}
Aggregations