Shinsuke Sugaya 8 роки тому
батько
коміт
816f30ca3c
30 змінених файлів з 3388 додано та 0 видалено
  1. 29 0
      src/main/config/es/fess_config.json
  2. 138 0
      src/main/java/org/codelibs/fess/app/pager/ApiTokenPager.java
  3. 84 0
      src/main/java/org/codelibs/fess/app/service/ApiTokenService.java
  4. 252 0
      src/main/java/org/codelibs/fess/app/web/admin/apitoken/AdminApitokenAction.java
  5. 50 0
      src/main/java/org/codelibs/fess/app/web/admin/apitoken/CreateForm.java
  6. 43 0
      src/main/java/org/codelibs/fess/app/web/admin/apitoken/EditForm.java
  7. 26 0
      src/main/java/org/codelibs/fess/app/web/admin/apitoken/SearchForm.java
  8. 258 0
      src/main/java/org/codelibs/fess/es/config/bsbhv/BsApiTokenBhv.java
  9. 181 0
      src/main/java/org/codelibs/fess/es/config/bsentity/BsApiToken.java
  10. 248 0
      src/main/java/org/codelibs/fess/es/config/bsentity/dbmeta/ApiTokenDbm.java
  11. 24 0
      src/main/java/org/codelibs/fess/es/config/cbean/ApiTokenCB.java
  12. 174 0
      src/main/java/org/codelibs/fess/es/config/cbean/bs/BsApiTokenCB.java
  13. 24 0
      src/main/java/org/codelibs/fess/es/config/cbean/cq/ApiTokenCQ.java
  14. 1341 0
      src/main/java/org/codelibs/fess/es/config/cbean/cq/bs/BsApiTokenCQ.java
  15. 25 0
      src/main/java/org/codelibs/fess/es/config/exbhv/ApiTokenBhv.java
  16. 49 0
      src/main/java/org/codelibs/fess/es/config/exentity/ApiToken.java
  17. 14 0
      src/main/java/org/codelibs/fess/helper/SystemHelper.java
  18. 9 0
      src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java
  19. 21 0
      src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java
  20. 40 0
      src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java
  21. 1 0
      src/main/resources/esflute_config.xml
  22. 2 0
      src/main/resources/fess_config.properties
  23. 34 0
      src/main/resources/fess_indices/.fess_config/api_token.json
  24. 7 0
      src/main/resources/fess_label.properties
  25. 7 0
      src/main/resources/fess_label_en.properties
  26. 7 0
      src/main/resources/fess_label_ja.properties
  27. 86 0
      src/main/webapp/WEB-INF/view/admin/apitoken/admin_apitoken.jsp
  28. 136 0
      src/main/webapp/WEB-INF/view/admin/apitoken/admin_apitoken_details.jsp
  29. 72 0
      src/main/webapp/WEB-INF/view/admin/apitoken/admin_apitoken_edit.jsp
  30. 6 0
      src/main/webapp/WEB-INF/view/common/admin/sidebar.jsp

+ 29 - 0
src/main/config/es/fess_config.json

@@ -1,6 +1,35 @@
 {
   ".fess_config" : {
     "mappings" : {
+      "api_token": {
+        "_all": {
+          "enabled": false
+        },
+        "properties": {
+          "name": {
+            "type": "string",
+            "index": "not_analyzed"
+          },
+          "token": {
+            "type": "string",
+            "index": "not_analyzed"
+          },
+          "createdBy": {
+            "type": "string",
+            "index": "not_analyzed"
+          },
+          "createdTime": {
+            "type": "long"
+          },
+          "updatedBy": {
+            "type": "string",
+            "index": "not_analyzed"
+          },
+          "updatedTime": {
+            "type": "long"
+          }
+        }
+      },
       "web_config_to_label" : {
         "_all" : {
           "enabled" : false

+ 138 - 0
src/main/java/org/codelibs/fess/app/pager/ApiTokenPager.java

@@ -0,0 +1,138 @@
+/*
+ * Copyright 2012-2016 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.Constants;
+
+public class ApiTokenPager implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1;
+
+    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 String name;
+
+    public String createdBy;
+
+    public String createdTime;
+
+    public String versionNo;
+
+    public void clear() {
+        allRecordCount = 0;
+        allPageCount = 0;
+        existPrePage = false;
+        existNextPage = false;
+        pageSize = getDefaultPageSize();
+        currentPageNumber = getDefaultCurrentPageNumber();
+
+        id = null;
+        name = null;
+        createdBy = null;
+        createdTime = null;
+        versionNo = null;
+
+    }
+
+    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;
+    }
+
+    protected int getDefaultCurrentPageNumber() {
+        return Constants.DEFAULT_ADMIN_PAGE_NUMBER;
+    }
+
+    protected int getDefaultPageSize() {
+        return Constants.DEFAULT_ADMIN_PAGE_SIZE;
+    }
+
+}

+ 84 - 0
src/main/java/org/codelibs/fess/app/service/ApiTokenService.java

@@ -0,0 +1,84 @@
+/*
+ * Copyright 2012-2016 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.List;
+
+import javax.annotation.Resource;
+
+import org.codelibs.core.beans.util.BeanUtil;
+import org.codelibs.fess.Constants;
+import org.codelibs.fess.app.pager.ApiTokenPager;
+import org.codelibs.fess.es.config.cbean.ApiTokenCB;
+import org.codelibs.fess.es.config.exbhv.ApiTokenBhv;
+import org.codelibs.fess.es.config.exentity.ApiToken;
+import org.codelibs.fess.mylasta.direction.FessConfig;
+import org.dbflute.cbean.result.PagingResultBean;
+import org.dbflute.optional.OptionalEntity;
+
+public class ApiTokenService {
+
+    @Resource
+    protected ApiTokenBhv apiTokenBhv;
+
+    @Resource
+    protected FessConfig fessConfig;
+
+    public List<ApiToken> getApiTokenList(final ApiTokenPager apiTokenPager) {
+
+        final PagingResultBean<ApiToken> apiTokenList = apiTokenBhv.selectPage(cb -> {
+            cb.paging(apiTokenPager.getPageSize(), apiTokenPager.getCurrentPageNumber());
+            setupListCondition(cb, apiTokenPager);
+        });
+
+        // update pager
+        BeanUtil.copyBeanToBean(apiTokenList, apiTokenPager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
+        apiTokenPager.setPageNumberList(apiTokenList.pageRange(op -> op.rangeSize(5)).createPageNumberList());
+
+        return apiTokenList;
+    }
+
+    public OptionalEntity<ApiToken> getApiToken(final String id) {
+        return apiTokenBhv.selectByPK(id);
+    }
+
+    public void store(final ApiToken apiToken) {
+
+        apiTokenBhv.insertOrUpdate(apiToken, op -> op.setRefresh(true));
+
+    }
+
+    public void delete(final ApiToken apiToken) {
+
+        apiTokenBhv.delete(apiToken, op -> op.setRefresh(true));
+
+    }
+
+    protected void setupListCondition(final ApiTokenCB cb, final ApiTokenPager apiTokenPager) {
+        if (apiTokenPager.id != null) {
+            cb.query().docMeta().setId_Equal(apiTokenPager.id);
+        }
+        // TODO Long, Integer, String supported only.
+
+        // setup condition
+        cb.query().addOrderBy_Name_Asc();
+        cb.query().addOrderBy_CreatedTime_Asc();
+
+        // search
+
+    }
+
+}

+ 252 - 0
src/main/java/org/codelibs/fess/app/web/admin/apitoken/AdminApitokenAction.java

@@ -0,0 +1,252 @@
+/*
+ * Copyright 2012-2016 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.apitoken;
+
+import javax.annotation.Resource;
+
+import org.codelibs.fess.Constants;
+import org.codelibs.fess.app.pager.ApiTokenPager;
+import org.codelibs.fess.app.service.ApiTokenService;
+import org.codelibs.fess.app.web.CrudMode;
+import org.codelibs.fess.app.web.base.FessAdminAction;
+import org.codelibs.fess.es.config.exentity.ApiToken;
+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.HtmlResponse;
+import org.lastaflute.web.response.render.RenderData;
+import org.lastaflute.web.ruts.process.ActionRuntime;
+
+/**
+ * @author shinsuke
+ */
+public class AdminApitokenAction extends FessAdminAction {
+
+    // ===================================================================================
+    //                                                                           Attribute
+    //                                                                           =========
+    @Resource
+    private ApiTokenService apiTokenService;
+    @Resource
+    private ApiTokenPager apiTokenPager;
+
+    // ===================================================================================
+    //                                                                               Hook
+    //                                                                              ======
+    @Override
+    protected void setupHtmlData(final ActionRuntime runtime) {
+        super.setupHtmlData(runtime);
+        runtime.registerData("helpLink", systemHelper.getHelpLink(fessConfig.getOnlineHelpNameApitoken()));
+    }
+
+    // ===================================================================================
+    //                                                                      Search Execute
+    //                                                                      ==============
+    @Execute
+    public HtmlResponse index() {
+        return asListHtml();
+    }
+
+    @Execute
+    public HtmlResponse list(final OptionalThing<Integer> pageNumber, final SearchForm form) {
+        pageNumber.ifPresent(num -> {
+            apiTokenPager.setCurrentPageNumber(pageNumber.get());
+        }).orElse(() -> {
+            apiTokenPager.setCurrentPageNumber(0);
+        });
+        return asHtml(path_AdminApitoken_AdminApitokenJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    @Execute
+    public HtmlResponse search(final SearchForm form) {
+        copyBeanToBean(form, apiTokenPager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE));
+        return asHtml(path_AdminApitoken_AdminApitokenJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    @Execute
+    public HtmlResponse reset(final SearchForm form) {
+        apiTokenPager.clear();
+        return asHtml(path_AdminApitoken_AdminApitokenJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    protected void searchPaging(final RenderData data, final SearchForm form) {
+        RenderDataUtil.register(data, "apiTokenItems", apiTokenService.getApiTokenList(apiTokenPager)); // page navi
+
+        // restore from pager
+        copyBeanToBean(apiTokenPager, form, op -> op.include("id"));
+    }
+
+    // ===================================================================================
+    //                                                                        Edit Execute
+    //                                                                        ============
+    // -----------------------------------------------------
+    //                                            Entry Page
+    //                                            ----------
+    @Execute
+    public HtmlResponse createnew() {
+        saveToken();
+        return asEditHtml().useForm(CreateForm.class, op -> {
+            op.setup(form -> {
+                form.initialize();
+                form.crudMode = CrudMode.CREATE;
+            });
+        });
+    }
+
+    // -----------------------------------------------------
+    //                                               Details
+    //                                               -------
+    @Execute
+    public HtmlResponse details(final int crudMode, final String id) {
+        verifyCrudMode(crudMode, CrudMode.DETAILS);
+        saveToken();
+        return asDetailsHtml().useForm(EditForm.class, op -> {
+            op.setup(form -> {
+                apiTokenService.getApiToken(id).ifPresent(entity -> {
+                    copyBeanToBean(entity, form, copyOp -> {
+                        copyOp.excludeNull();
+                    });
+                    form.crudMode = crudMode;
+                }).orElse(() -> {
+                    throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
+                });
+            });
+        });
+    }
+
+    // -----------------------------------------------------
+    //                                         Actually Crud
+    //                                         -------------
+    @Execute
+    public HtmlResponse create(final CreateForm form) {
+        verifyCrudMode(form.crudMode, CrudMode.CREATE);
+        validate(form, messages -> {}, () -> asEditHtml());
+        verifyToken(() -> asEditHtml());
+        getApiToken(form).ifPresent(
+                entity -> {
+                    entity.setToken(systemHelper.generateApiToken());
+                    try {
+                        apiTokenService.store(entity);
+                        saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
+                    } catch (final Exception e) {
+                        throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)),
+                                () -> asEditHtml());
+                    }
+                }).orElse(() -> {
+            throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), () -> asEditHtml());
+        });
+        return redirect(getClass());
+    }
+
+    @Execute
+    public HtmlResponse delete(final EditForm form) {
+        verifyCrudMode(form.crudMode, CrudMode.DETAILS);
+        validate(form, messages -> {}, () -> asDetailsHtml());
+        verifyToken(() -> asDetailsHtml());
+        final String id = form.id;
+        apiTokenService
+                .getApiToken(id)
+                .ifPresent(
+                        entity -> {
+                            try {
+                                apiTokenService.delete(entity);
+                                saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
+                            } catch (final Exception e) {
+                                throwValidationError(
+                                        messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e)),
+                                        () -> asEditHtml());
+                            }
+                        }).orElse(() -> {
+                    throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asDetailsHtml());
+                });
+        return redirect(getClass());
+    }
+
+    // ===================================================================================
+    //                                                                        Assist Logic
+    //                                                                        ============
+
+    private OptionalEntity<ApiToken> getEntity(final CreateForm form, final String username, final long currentTime) {
+        switch (form.crudMode) {
+        case CrudMode.CREATE:
+            return OptionalEntity.of(new ApiToken()).map(entity -> {
+                entity.setCreatedBy(username);
+                entity.setCreatedTime(currentTime);
+                return entity;
+            });
+        case CrudMode.EDIT:
+            if (form instanceof EditForm) {
+                return apiTokenService.getApiToken(((EditForm) form).id);
+            }
+            break;
+        default:
+            break;
+        }
+        return OptionalEntity.empty();
+    }
+
+    protected OptionalEntity<ApiToken> getApiToken(final CreateForm form) {
+        final String username = systemHelper.getUsername();
+        final long currentTime = systemHelper.getCurrentTimeAsLong();
+        return getEntity(form, username, currentTime).map(entity -> {
+            entity.setUpdatedBy(username);
+            entity.setUpdatedTime(currentTime);
+            copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
+            return entity;
+        });
+    }
+
+    // ===================================================================================
+    //                                                                        Small Helper
+    //                                                                        ============
+    protected void verifyCrudMode(final int crudMode, final int expectedMode) {
+        if (crudMode != expectedMode) {
+            throwValidationError(messages -> {
+                messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(crudMode));
+            }, () -> asListHtml());
+        }
+    }
+
+    // ===================================================================================
+    //                                                                              JSP
+    //                                                                           =========
+
+    private HtmlResponse asListHtml() {
+        return asHtml(path_AdminApitoken_AdminApitokenJsp).renderWith(data -> {
+            RenderDataUtil.register(data, "apiTokenItems", apiTokenService.getApiTokenList(apiTokenPager));
+        }).useForm(SearchForm.class, setup -> {
+            setup.setup(form -> {
+                copyBeanToBean(apiTokenPager, form, op -> op.include("id"));
+            });
+        });
+    }
+
+    private HtmlResponse asEditHtml() {
+        return asHtml(path_AdminApitoken_AdminApitokenEditJsp);
+    }
+
+    private HtmlResponse asDetailsHtml() {
+        return asHtml(path_AdminApitoken_AdminApitokenDetailsJsp);
+    }
+
+}

+ 50 - 0
src/main/java/org/codelibs/fess/app/web/admin/apitoken/CreateForm.java

@@ -0,0 +1,50 @@
+/*
+ * Copyright 2012-2016 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.apitoken;
+
+import javax.validation.constraints.Size;
+
+import org.codelibs.fess.app.web.CrudMode;
+import org.codelibs.fess.util.ComponentUtil;
+import org.lastaflute.web.validation.Required;
+import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
+
+public class CreateForm {
+
+    @ValidateTypeFailure
+    public Integer crudMode;
+
+    @Required
+    @Size(max = 10000)
+    public String name;
+
+    @Size(max = 10000)
+    public String token;
+
+    @Required
+    @Size(max = 1000)
+    public String createdBy;
+
+    @Required
+    @ValidateTypeFailure
+    public Long createdTime;
+
+    public void initialize() {
+        crudMode = CrudMode.CREATE;
+        createdBy = ComponentUtil.getSystemHelper().getUsername();
+        createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
+    }
+}

+ 43 - 0
src/main/java/org/codelibs/fess/app/web/admin/apitoken/EditForm.java

@@ -0,0 +1,43 @@
+/*
+ * Copyright 2012-2016 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.apitoken;
+
+import javax.validation.constraints.Size;
+
+import org.lastaflute.web.validation.Required;
+import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
+
+/**
+ * @author shinsuke
+ * @author jflute
+ */
+public class EditForm extends CreateForm {
+
+    @Required
+    @Size(max = 1000)
+    public String id;
+
+    @Size(max = 1000)
+    public String updatedBy;
+
+    @ValidateTypeFailure
+    public Long updatedTime;
+
+    @Required
+    @ValidateTypeFailure
+    public Integer versionNo;
+
+}

+ 26 - 0
src/main/java/org/codelibs/fess/app/web/admin/apitoken/SearchForm.java

@@ -0,0 +1,26 @@
+/*
+ * Copyright 2012-2016 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.apitoken;
+
+/**
+ * @author codelibs
+ * @author jflute
+ */
+public class SearchForm {
+
+    public String id;
+
+}

+ 258 - 0
src/main/java/org/codelibs/fess/es/config/bsbhv/BsApiTokenBhv.java

@@ -0,0 +1,258 @@
+/*
+ * Copyright 2012-2016 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.es.config.bsbhv;
+
+import java.util.List;
+import java.util.Map;
+
+import org.codelibs.fess.es.config.allcommon.EsAbstractBehavior;
+import org.codelibs.fess.es.config.allcommon.EsAbstractEntity.RequestOptionCall;
+import org.codelibs.fess.es.config.bsentity.dbmeta.ApiTokenDbm;
+import org.codelibs.fess.es.config.cbean.ApiTokenCB;
+import org.codelibs.fess.es.config.exentity.ApiToken;
+import org.dbflute.Entity;
+import org.dbflute.bhv.readable.CBCall;
+import org.dbflute.bhv.readable.EntityRowHandler;
+import org.dbflute.cbean.ConditionBean;
+import org.dbflute.cbean.result.ListResultBean;
+import org.dbflute.cbean.result.PagingResultBean;
+import org.dbflute.exception.IllegalBehaviorStateException;
+import org.dbflute.optional.OptionalEntity;
+import org.dbflute.util.DfTypeUtil;
+import org.elasticsearch.action.bulk.BulkRequestBuilder;
+import org.elasticsearch.action.delete.DeleteRequestBuilder;
+import org.elasticsearch.action.index.IndexRequestBuilder;
+
+/**
+ * @author ESFlute (using FreeGen)
+ */
+public abstract class BsApiTokenBhv extends EsAbstractBehavior<ApiToken, ApiTokenCB> {
+
+    // ===================================================================================
+    //                                                                    Control Override
+    //                                                                    ================
+    @Override
+    public String asTableDbName() {
+        return asEsIndexType();
+    }
+
+    @Override
+    protected String asEsIndex() {
+        return ".fess_config";
+    }
+
+    @Override
+    public String asEsIndexType() {
+        return "api_token";
+    }
+
+    @Override
+    public String asEsSearchType() {
+        return "api_token";
+    }
+
+    @Override
+    public ApiTokenDbm asDBMeta() {
+        return ApiTokenDbm.getInstance();
+    }
+
+    @Override
+    protected <RESULT extends ApiToken> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
+        try {
+            final RESULT result = entityType.newInstance();
+            result.setName(DfTypeUtil.toString(source.get("name")));
+            result.setToken(DfTypeUtil.toString(source.get("token")));
+            result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
+            result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
+            result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
+            result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
+            return result;
+        } catch (InstantiationException | IllegalAccessException e) {
+            final String msg = "Cannot create a new instance: " + entityType.getName();
+            throw new IllegalBehaviorStateException(msg, e);
+        }
+    }
+
+    // ===================================================================================
+    //                                                                              Select
+    //                                                                              ======
+    public int selectCount(CBCall<ApiTokenCB> cbLambda) {
+        return facadeSelectCount(createCB(cbLambda));
+    }
+
+    public OptionalEntity<ApiToken> selectEntity(CBCall<ApiTokenCB> cbLambda) {
+        return facadeSelectEntity(createCB(cbLambda));
+    }
+
+    protected OptionalEntity<ApiToken> facadeSelectEntity(ApiTokenCB cb) {
+        return doSelectOptionalEntity(cb, typeOfSelectedEntity());
+    }
+
+    protected <ENTITY extends ApiToken> OptionalEntity<ENTITY> doSelectOptionalEntity(ApiTokenCB cb, Class<? extends ENTITY> tp) {
+        return createOptionalEntity(doSelectEntity(cb, tp), cb);
+    }
+
+    @Override
+    public ApiTokenCB newConditionBean() {
+        return new ApiTokenCB();
+    }
+
+    @Override
+    protected Entity doReadEntity(ConditionBean cb) {
+        return facadeSelectEntity(downcast(cb)).orElse(null);
+    }
+
+    public ApiToken selectEntityWithDeletedCheck(CBCall<ApiTokenCB> cbLambda) {
+        return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
+    }
+
+    public OptionalEntity<ApiToken> selectByPK(String id) {
+        return facadeSelectByPK(id);
+    }
+
+    protected OptionalEntity<ApiToken> facadeSelectByPK(String id) {
+        return doSelectOptionalByPK(id, typeOfSelectedEntity());
+    }
+
+    protected <ENTITY extends ApiToken> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
+        return doSelectEntity(xprepareCBAsPK(id), tp);
+    }
+
+    protected ApiTokenCB xprepareCBAsPK(String id) {
+        assertObjectNotNull("id", id);
+        return newConditionBean().acceptPK(id);
+    }
+
+    protected <ENTITY extends ApiToken> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
+        return createOptionalEntity(doSelectByPK(id, tp), id);
+    }
+
+    @Override
+    protected Class<? extends ApiToken> typeOfSelectedEntity() {
+        return ApiToken.class;
+    }
+
+    @Override
+    protected Class<ApiToken> typeOfHandlingEntity() {
+        return ApiToken.class;
+    }
+
+    @Override
+    protected Class<ApiTokenCB> typeOfHandlingConditionBean() {
+        return ApiTokenCB.class;
+    }
+
+    public ListResultBean<ApiToken> selectList(CBCall<ApiTokenCB> cbLambda) {
+        return facadeSelectList(createCB(cbLambda));
+    }
+
+    public PagingResultBean<ApiToken> selectPage(CBCall<ApiTokenCB> cbLambda) {
+        // #pending same?
+        return (PagingResultBean<ApiToken>) facadeSelectList(createCB(cbLambda));
+    }
+
+    public void selectCursor(CBCall<ApiTokenCB> cbLambda, EntityRowHandler<ApiToken> entityLambda) {
+        facadeSelectCursor(createCB(cbLambda), entityLambda);
+    }
+
+    public void selectBulk(CBCall<ApiTokenCB> cbLambda, EntityRowHandler<List<ApiToken>> entityLambda) {
+        delegateSelectBulk(createCB(cbLambda), entityLambda, typeOfSelectedEntity());
+    }
+
+    // ===================================================================================
+    //                                                                              Update
+    //                                                                              ======
+    public void insert(ApiToken entity) {
+        doInsert(entity, null);
+    }
+
+    public void insert(ApiToken entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
+        entity.asDocMeta().indexOption(opLambda);
+        doInsert(entity, null);
+    }
+
+    public void update(ApiToken entity) {
+        doUpdate(entity, null);
+    }
+
+    public void update(ApiToken entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
+        entity.asDocMeta().indexOption(opLambda);
+        doUpdate(entity, null);
+    }
+
+    public void insertOrUpdate(ApiToken entity) {
+        doInsertOrUpdate(entity, null, null);
+    }
+
+    public void insertOrUpdate(ApiToken entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
+        entity.asDocMeta().indexOption(opLambda);
+        doInsertOrUpdate(entity, null, null);
+    }
+
+    public void delete(ApiToken entity) {
+        doDelete(entity, null);
+    }
+
+    public void delete(ApiToken entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
+        entity.asDocMeta().deleteOption(opLambda);
+        doDelete(entity, null);
+    }
+
+    public int queryDelete(CBCall<ApiTokenCB> cbLambda) {
+        return doQueryDelete(createCB(cbLambda), null);
+    }
+
+    public int[] batchInsert(List<ApiToken> list) {
+        return batchInsert(list, null, null);
+    }
+
+    public int[] batchInsert(List<ApiToken> list, RequestOptionCall<BulkRequestBuilder> call) {
+        return batchInsert(list, call, null);
+    }
+
+    public int[] batchInsert(List<ApiToken> list, RequestOptionCall<BulkRequestBuilder> call,
+            RequestOptionCall<IndexRequestBuilder> entityCall) {
+        return doBatchInsert(new BulkList<>(list, call, entityCall), null);
+    }
+
+    public int[] batchUpdate(List<ApiToken> list) {
+        return batchUpdate(list, null, null);
+    }
+
+    public int[] batchUpdate(List<ApiToken> list, RequestOptionCall<BulkRequestBuilder> call) {
+        return batchUpdate(list, call, null);
+    }
+
+    public int[] batchUpdate(List<ApiToken> list, RequestOptionCall<BulkRequestBuilder> call,
+            RequestOptionCall<IndexRequestBuilder> entityCall) {
+        return doBatchUpdate(new BulkList<>(list, call, entityCall), null);
+    }
+
+    public int[] batchDelete(List<ApiToken> list) {
+        return batchDelete(list, null, null);
+    }
+
+    public int[] batchDelete(List<ApiToken> list, RequestOptionCall<BulkRequestBuilder> call) {
+        return batchDelete(list, call, null);
+    }
+
+    public int[] batchDelete(List<ApiToken> list, RequestOptionCall<BulkRequestBuilder> call,
+            RequestOptionCall<IndexRequestBuilder> entityCall) {
+        return doBatchDelete(new BulkList<>(list, call, entityCall), null);
+    }
+
+    // #pending create, modify, remove
+}

+ 181 - 0
src/main/java/org/codelibs/fess/es/config/bsentity/BsApiToken.java

@@ -0,0 +1,181 @@
+/*
+ * Copyright 2012-2016 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.es.config.bsentity;
+
+import java.time.LocalDateTime;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.codelibs.fess.es.config.allcommon.EsAbstractEntity;
+import org.codelibs.fess.es.config.bsentity.dbmeta.ApiTokenDbm;
+
+/**
+ * ${table.comment}
+ * @author ESFlute (using FreeGen)
+ */
+public class BsApiToken extends EsAbstractEntity {
+
+    // ===================================================================================
+    //                                                                          Definition
+    //                                                                          ==========
+    private static final long serialVersionUID = 1L;
+    protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
+
+    // ===================================================================================
+    //                                                                           Attribute
+    //                                                                           =========
+    /** name */
+    protected String name;
+
+    /** token */
+    protected String token;
+
+    /** createdBy */
+    protected String createdBy;
+
+    /** createdTime */
+    protected Long createdTime;
+
+    /** updatedBy */
+    protected String updatedBy;
+
+    /** updatedTime */
+    protected Long updatedTime;
+
+    // [Referrers] *comment only
+
+    // ===================================================================================
+    //                                                                             DB Meta
+    //                                                                             =======
+    @Override
+    public ApiTokenDbm asDBMeta() {
+        return ApiTokenDbm.getInstance();
+    }
+
+    @Override
+    public String asTableDbName() {
+        return "api_token";
+    }
+
+    // ===================================================================================
+    //                                                                              Source
+    //                                                                              ======
+    @Override
+    public Map<String, Object> toSource() {
+        Map<String, Object> sourceMap = new HashMap<>();
+        if (name != null) {
+            sourceMap.put("name", name);
+        }
+        if (token != null) {
+            sourceMap.put("token", token);
+        }
+        if (createdBy != null) {
+            sourceMap.put("createdBy", createdBy);
+        }
+        if (createdTime != null) {
+            sourceMap.put("createdTime", createdTime);
+        }
+        if (updatedBy != null) {
+            sourceMap.put("updatedBy", updatedBy);
+        }
+        if (updatedTime != null) {
+            sourceMap.put("updatedTime", updatedTime);
+        }
+        return sourceMap;
+    }
+
+    // ===================================================================================
+    //                                                                      Basic Override
+    //                                                                      ==============
+    @Override
+    protected String doBuildColumnString(String dm) {
+        StringBuilder sb = new StringBuilder();
+        sb.append(dm).append(name);
+        sb.append(dm).append(token);
+        sb.append(dm).append(createdBy);
+        sb.append(dm).append(createdTime);
+        sb.append(dm).append(updatedBy);
+        sb.append(dm).append(updatedTime);
+        if (sb.length() > dm.length()) {
+            sb.delete(0, dm.length());
+        }
+        sb.insert(0, "{").append("}");
+        return sb.toString();
+    }
+
+    // ===================================================================================
+    //                                                                            Accessor
+    //                                                                            ========
+    public String getName() {
+        checkSpecifiedProperty("name");
+        return convertEmptyToNull(name);
+    }
+
+    public void setName(String value) {
+        registerModifiedProperty("name");
+        this.name = value;
+    }
+
+    public String getToken() {
+        checkSpecifiedProperty("token");
+        return convertEmptyToNull(token);
+    }
+
+    public void setToken(String value) {
+        registerModifiedProperty("token");
+        this.token = value;
+    }
+
+    public String getCreatedBy() {
+        checkSpecifiedProperty("createdBy");
+        return convertEmptyToNull(createdBy);
+    }
+
+    public void setCreatedBy(String value) {
+        registerModifiedProperty("createdBy");
+        this.createdBy = value;
+    }
+
+    public Long getCreatedTime() {
+        checkSpecifiedProperty("createdTime");
+        return createdTime;
+    }
+
+    public void setCreatedTime(Long value) {
+        registerModifiedProperty("createdTime");
+        this.createdTime = value;
+    }
+
+    public String getUpdatedBy() {
+        checkSpecifiedProperty("updatedBy");
+        return convertEmptyToNull(updatedBy);
+    }
+
+    public void setUpdatedBy(String value) {
+        registerModifiedProperty("updatedBy");
+        this.updatedBy = value;
+    }
+
+    public Long getUpdatedTime() {
+        checkSpecifiedProperty("updatedTime");
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Long value) {
+        registerModifiedProperty("updatedTime");
+        this.updatedTime = value;
+    }
+}

+ 248 - 0
src/main/java/org/codelibs/fess/es/config/bsentity/dbmeta/ApiTokenDbm.java

@@ -0,0 +1,248 @@
+/*
+ * Copyright 2012-2016 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.es.config.bsentity.dbmeta;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Map;
+
+import org.codelibs.fess.es.config.exentity.ApiToken;
+import org.dbflute.Entity;
+import org.dbflute.dbmeta.AbstractDBMeta;
+import org.dbflute.dbmeta.info.ColumnInfo;
+import org.dbflute.dbmeta.info.UniqueInfo;
+import org.dbflute.dbmeta.name.TableSqlName;
+import org.dbflute.dbmeta.property.PropertyGateway;
+import org.dbflute.dbway.DBDef;
+import org.dbflute.util.DfTypeUtil;
+
+/**
+ * @author ESFlute (using FreeGen)
+ */
+public class ApiTokenDbm extends AbstractDBMeta {
+
+    protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
+
+    // ===================================================================================
+    //                                                                           Singleton
+    //                                                                           =========
+    private static final ApiTokenDbm _instance = new ApiTokenDbm();
+
+    private ApiTokenDbm() {
+    }
+
+    public static ApiTokenDbm getInstance() {
+        return _instance;
+    }
+
+    // ===================================================================================
+    //                                                                       Current DBDef
+    //                                                                       =============
+    @Override
+    public String getProjectName() {
+        return null;
+    }
+
+    @Override
+    public String getProjectPrefix() {
+        return null;
+    }
+
+    @Override
+    public String getGenerationGapBasePrefix() {
+        return null;
+    }
+
+    @Override
+    public DBDef getCurrentDBDef() {
+        return null;
+    }
+
+    // ===================================================================================
+    //                                                                    Property Gateway
+    //                                                                    ================
+    // -----------------------------------------------------
+    //                                       Column Property
+    //                                       ---------------
+    protected final Map<String, PropertyGateway> _epgMap = newHashMap();
+    {
+        setupEpg(_epgMap, et -> ((ApiToken) et).getName(), (et, vl) -> ((ApiToken) et).setName(DfTypeUtil.toString(vl)), "name");
+        setupEpg(_epgMap, et -> ((ApiToken) et).getToken(), (et, vl) -> ((ApiToken) et).setToken(DfTypeUtil.toString(vl)), "token");
+        setupEpg(_epgMap, et -> ((ApiToken) et).getCreatedBy(), (et, vl) -> ((ApiToken) et).setCreatedBy(DfTypeUtil.toString(vl)),
+                "createdBy");
+        setupEpg(_epgMap, et -> ((ApiToken) et).getCreatedTime(), (et, vl) -> ((ApiToken) et).setCreatedTime(DfTypeUtil.toLong(vl)),
+                "createdTime");
+        setupEpg(_epgMap, et -> ((ApiToken) et).getUpdatedBy(), (et, vl) -> ((ApiToken) et).setUpdatedBy(DfTypeUtil.toString(vl)),
+                "updatedBy");
+        setupEpg(_epgMap, et -> ((ApiToken) et).getUpdatedTime(), (et, vl) -> ((ApiToken) et).setUpdatedTime(DfTypeUtil.toLong(vl)),
+                "updatedTime");
+    }
+
+    @Override
+    public PropertyGateway findPropertyGateway(final String prop) {
+        return doFindEpg(_epgMap, prop);
+    }
+
+    // ===================================================================================
+    //                                                                          Table Info
+    //                                                                          ==========
+    protected final String _tableDbName = "api_token";
+    protected final String _tableDispName = "api_token";
+    protected final String _tablePropertyName = "ApiToken";
+
+    public String getTableDbName() {
+        return _tableDbName;
+    }
+
+    @Override
+    public String getTableDispName() {
+        return _tableDispName;
+    }
+
+    @Override
+    public String getTablePropertyName() {
+        return _tablePropertyName;
+    }
+
+    @Override
+    public TableSqlName getTableSqlName() {
+        return null;
+    }
+
+    // ===================================================================================
+    //                                                                         Column Info
+    //                                                                         ===========
+    protected final ColumnInfo _columnName = cci("name", "name", null, null, String.class, "name", null, false, false, false, "String", 0,
+            0, null, false, null, null, null, null, null, false);
+    protected final ColumnInfo _columnToken = cci("token", "token", null, null, String.class, "token", null, false, false, false, "String",
+            0, 0, null, false, null, null, null, null, null, false);
+    protected final ColumnInfo _columnCreatedBy = cci("createdBy", "createdBy", null, null, String.class, "createdBy", null, false, false,
+            false, "String", 0, 0, null, false, null, null, null, null, null, false);
+    protected final ColumnInfo _columnCreatedTime = cci("createdTime", "createdTime", null, null, Long.class, "createdTime", null, false,
+            false, false, "Long", 0, 0, null, false, null, null, null, null, null, false);
+    protected final ColumnInfo _columnUpdatedBy = cci("updatedBy", "updatedBy", null, null, String.class, "updatedBy", null, false, false,
+            false, "String", 0, 0, null, false, null, null, null, null, null, false);
+    protected final ColumnInfo _columnUpdatedTime = cci("updatedTime", "updatedTime", null, null, Long.class, "updatedTime", null, false,
+            false, false, "Long", 0, 0, null, false, null, null, null, null, null, false);
+
+    public ColumnInfo columnName() {
+        return _columnName;
+    }
+
+    public ColumnInfo columnToken() {
+        return _columnToken;
+    }
+
+    public ColumnInfo columnCreatedBy() {
+        return _columnCreatedBy;
+    }
+
+    public ColumnInfo columnCreatedTime() {
+        return _columnCreatedTime;
+    }
+
+    public ColumnInfo columnUpdatedBy() {
+        return _columnUpdatedBy;
+    }
+
+    public ColumnInfo columnUpdatedTime() {
+        return _columnUpdatedTime;
+    }
+
+    protected List<ColumnInfo> ccil() {
+        List<ColumnInfo> ls = newArrayList();
+        ls.add(columnName());
+        ls.add(columnToken());
+        ls.add(columnCreatedBy());
+        ls.add(columnCreatedTime());
+        ls.add(columnUpdatedBy());
+        ls.add(columnUpdatedTime());
+        return ls;
+    }
+
+    // ===================================================================================
+    //                                                                         Unique Info
+    //                                                                         ===========
+    @Override
+    public boolean hasPrimaryKey() {
+        return false;
+    }
+
+    @Override
+    public boolean hasCompoundPrimaryKey() {
+        return false;
+    }
+
+    @Override
+    protected UniqueInfo cpui() {
+        return null;
+    }
+
+    // ===================================================================================
+    //                                                                           Type Name
+    //                                                                           =========
+    @Override
+    public String getEntityTypeName() {
+        return "org.codelibs.fess.es.config.exentity.ApiToken";
+    }
+
+    @Override
+    public String getConditionBeanTypeName() {
+        return "org.codelibs.fess.es.config.cbean.ApiTokenCB";
+    }
+
+    @Override
+    public String getBehaviorTypeName() {
+        return "org.codelibs.fess.es.config.exbhv.ApiTokenBhv";
+    }
+
+    // ===================================================================================
+    //                                                                         Object Type
+    //                                                                         ===========
+    @Override
+    public Class<? extends Entity> getEntityType() {
+        return ApiToken.class;
+    }
+
+    // ===================================================================================
+    //                                                                     Object Instance
+    //                                                                     ===============
+    @Override
+    public Entity newEntity() {
+        return new ApiToken();
+    }
+
+    // ===================================================================================
+    //                                                                   Map Communication
+    //                                                                   =================
+    @Override
+    public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
+    }
+
+    @Override
+    public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
+    }
+
+    @Override
+    public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
+        return null;
+    }
+
+    @Override
+    public Map<String, Object> extractAllColumnMap(Entity entity) {
+        return null;
+    }
+}

+ 24 - 0
src/main/java/org/codelibs/fess/es/config/cbean/ApiTokenCB.java

@@ -0,0 +1,24 @@
+/*
+ * Copyright 2012-2016 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.es.config.cbean;
+
+import org.codelibs.fess.es.config.cbean.bs.BsApiTokenCB;
+
+/**
+ * @author ESFlute (using FreeGen)
+ */
+public class ApiTokenCB extends BsApiTokenCB {
+}

+ 174 - 0
src/main/java/org/codelibs/fess/es/config/cbean/bs/BsApiTokenCB.java

@@ -0,0 +1,174 @@
+/*
+ * Copyright 2012-2016 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.es.config.cbean.bs;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.codelibs.fess.es.config.allcommon.EsAbstractConditionBean;
+import org.codelibs.fess.es.config.bsentity.dbmeta.ApiTokenDbm;
+import org.codelibs.fess.es.config.cbean.ApiTokenCB;
+import org.codelibs.fess.es.config.cbean.cq.ApiTokenCQ;
+import org.codelibs.fess.es.config.cbean.cq.bs.BsApiTokenCQ;
+import org.dbflute.cbean.ConditionQuery;
+import org.elasticsearch.action.search.SearchRequestBuilder;
+import org.elasticsearch.index.query.QueryBuilder;
+
+/**
+ * @author ESFlute (using FreeGen)
+ */
+public class BsApiTokenCB extends EsAbstractConditionBean {
+
+    // ===================================================================================
+    //                                                                           Attribute
+    //                                                                           =========
+    protected BsApiTokenCQ _conditionQuery;
+    protected HpSpecification _specification;
+
+    // ===================================================================================
+    //                                                                             Control
+    //                                                                             =======
+    @Override
+    public ApiTokenDbm asDBMeta() {
+        return ApiTokenDbm.getInstance();
+    }
+
+    @Override
+    public String asTableDbName() {
+        return "api_token";
+    }
+
+    @Override
+    public boolean hasSpecifiedColumn() {
+        return _specification != null;
+    }
+
+    @Override
+    public ConditionQuery localCQ() {
+        return doGetConditionQuery();
+    }
+
+    // ===================================================================================
+    //                                                                         Primary Key
+    //                                                                         ===========
+    public ApiTokenCB acceptPK(String id) {
+        assertObjectNotNull("id", id);
+        BsApiTokenCB cb = this;
+        cb.query().docMeta().setId_Equal(id);
+        return (ApiTokenCB) this;
+    }
+
+    @Override
+    public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) {
+        acceptPK((String) primaryKeyMap.get("_id"));
+    }
+
+    // ===================================================================================
+    //                                                                               Build
+    //                                                                               =====
+
+    @Override
+    public SearchRequestBuilder build(SearchRequestBuilder builder) {
+        if (_conditionQuery != null) {
+            QueryBuilder queryBuilder = _conditionQuery.getQuery();
+            if (queryBuilder != null) {
+                builder.setQuery(queryBuilder);
+            }
+            _conditionQuery.getFieldSortBuilderList().forEach(sort -> {
+                builder.addSort(sort);
+            });
+        }
+
+        if (_specification != null) {
+            builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
+        }
+
+        return builder;
+    }
+
+    // ===================================================================================
+    //                                                                               Query
+    //                                                                               =====
+    public BsApiTokenCQ query() {
+        assertQueryPurpose();
+        return doGetConditionQuery();
+    }
+
+    protected BsApiTokenCQ doGetConditionQuery() {
+        if (_conditionQuery == null) {
+            _conditionQuery = createLocalCQ();
+        }
+        return _conditionQuery;
+    }
+
+    protected BsApiTokenCQ createLocalCQ() {
+        return new ApiTokenCQ();
+    }
+
+    // ===================================================================================
+    //                                                                             Specify
+    //                                                                             =======
+    public HpSpecification specify() {
+        assertSpecifyPurpose();
+        if (_specification == null) {
+            _specification = new HpSpecification();
+        }
+        return _specification;
+    }
+
+    protected void assertQueryPurpose() {
+    }
+
+    protected void assertSpecifyPurpose() {
+    }
+
+    public static class HpSpecification {
+        private List<String> columnList = new ArrayList<>();
+
+        private void doColumn(String name) {
+            columnList.add(name);
+        }
+
+        public void columnId() {
+            doColumn("_id");
+        }
+
+        public void columnName() {
+            doColumn("name");
+        }
+
+        public void columnToken() {
+            doColumn("token");
+        }
+
+        public void columnCreatedBy() {
+            doColumn("createdBy");
+        }
+
+        public void columnCreatedTime() {
+            doColumn("createdTime");
+        }
+
+        public void columnUpdatedBy() {
+            doColumn("updatedBy");
+        }
+
+        public void columnUpdatedTime() {
+            doColumn("updatedTime");
+        }
+    }
+}

+ 24 - 0
src/main/java/org/codelibs/fess/es/config/cbean/cq/ApiTokenCQ.java

@@ -0,0 +1,24 @@
+/*
+ * Copyright 2012-2016 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.es.config.cbean.cq;
+
+import org.codelibs.fess.es.config.cbean.cq.bs.BsApiTokenCQ;
+
+/**
+ * @author ESFlute (using FreeGen)
+ */
+public class ApiTokenCQ extends BsApiTokenCQ {
+}

+ 1341 - 0
src/main/java/org/codelibs/fess/es/config/cbean/cq/bs/BsApiTokenCQ.java

@@ -0,0 +1,1341 @@
+/*
+ * Copyright 2012-2016 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.es.config.cbean.cq.bs;
+
+import java.time.LocalDateTime;
+import java.util.Collection;
+
+import org.codelibs.fess.es.config.allcommon.EsAbstractConditionQuery;
+import org.codelibs.fess.es.config.cbean.cq.ApiTokenCQ;
+import org.dbflute.cbean.ckey.ConditionKey;
+import org.elasticsearch.index.query.BoolQueryBuilder;
+import org.elasticsearch.index.query.CommonTermsQueryBuilder;
+import org.elasticsearch.index.query.ExistsQueryBuilder;
+import org.elasticsearch.index.query.FuzzyQueryBuilder;
+import org.elasticsearch.index.query.IdsQueryBuilder;
+import org.elasticsearch.index.query.MatchQueryBuilder;
+import org.elasticsearch.index.query.PrefixQueryBuilder;
+import org.elasticsearch.index.query.RangeQueryBuilder;
+import org.elasticsearch.index.query.RegexpQueryBuilder;
+import org.elasticsearch.index.query.TermQueryBuilder;
+import org.elasticsearch.index.query.TermsQueryBuilder;
+import org.elasticsearch.index.query.WildcardQueryBuilder;
+
+/**
+ * @author ESFlute (using FreeGen)
+ */
+public abstract class BsApiTokenCQ extends EsAbstractConditionQuery {
+
+    protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
+
+    // ===================================================================================
+    //                                                                       Name Override
+    //                                                                       =============
+    @Override
+    public String asTableDbName() {
+        return "api_token";
+    }
+
+    @Override
+    public String xgetAliasName() {
+        return "api_token";
+    }
+
+    // ===================================================================================
+    //                                                                       Query Control
+    //                                                                       =============
+    public void filtered(FilteredCall<ApiTokenCQ, ApiTokenCQ> filteredLambda) {
+        filtered(filteredLambda, null);
+    }
+
+    public void filtered(FilteredCall<ApiTokenCQ, ApiTokenCQ> filteredLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        bool((must, should, mustNot, filter) -> {
+            filteredLambda.callback(must, filter);
+        }, opLambda);
+    }
+
+    public void not(OperatorCall<ApiTokenCQ> notLambda) {
+        not(notLambda, null);
+    }
+
+    public void not(final OperatorCall<ApiTokenCQ> notLambda, final ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        bool((must, should, mustNot, filter) -> notLambda.callback(mustNot), opLambda);
+    }
+
+    public void bool(BoolCall<ApiTokenCQ> boolLambda) {
+        bool(boolLambda, null);
+    }
+
+    public void bool(BoolCall<ApiTokenCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        ApiTokenCQ mustQuery = new ApiTokenCQ();
+        ApiTokenCQ shouldQuery = new ApiTokenCQ();
+        ApiTokenCQ mustNotQuery = new ApiTokenCQ();
+        ApiTokenCQ filterQuery = new ApiTokenCQ();
+        boolLambda.callback(mustQuery, shouldQuery, mustNotQuery, filterQuery);
+        if (mustQuery.hasQueries() || shouldQuery.hasQueries() || mustNotQuery.hasQueries() || filterQuery.hasQueries()) {
+            BoolQueryBuilder builder =
+                    regBoolCQ(mustQuery.getQueryBuilderList(), shouldQuery.getQueryBuilderList(), mustNotQuery.getQueryBuilderList(),
+                            filterQuery.getQueryBuilderList());
+            if (opLambda != null) {
+                opLambda.callback(builder);
+            }
+        }
+    }
+
+    // ===================================================================================
+    //                                                                           Query Set
+    //                                                                           =========
+    public void setId_Equal(String id) {
+        setId_Term(id, null);
+    }
+
+    public void setId_Equal(String id, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        setId_Term(id, opLambda);
+    }
+
+    public void setId_Term(String id) {
+        setId_Term(id, null);
+    }
+
+    public void setId_Term(String id, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        TermQueryBuilder builder = regTermQ("_id", id);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setId_NotEqual(String id) {
+        setId_NotTerm(id, null);
+    }
+
+    public void setId_NotTerm(String id) {
+        setId_NotTerm(id, null);
+    }
+
+    public void setId_NotEqual(String id, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        setId_NotTerm(id, opLambda);
+    }
+
+    public void setId_NotTerm(String id, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        not(not -> not.setId_Term(id), opLambda);
+    }
+
+    public void setId_Terms(Collection<String> idList) {
+        setId_Terms(idList, null);
+    }
+
+    public void setId_Terms(Collection<String> idList, ConditionOptionCall<IdsQueryBuilder> opLambda) {
+        IdsQueryBuilder builder = regIdsQ(idList);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setId_InScope(Collection<String> idList) {
+        setId_Terms(idList, null);
+    }
+
+    public void setId_InScope(Collection<String> idList, ConditionOptionCall<IdsQueryBuilder> opLambda) {
+        setId_Terms(idList, opLambda);
+    }
+
+    public BsApiTokenCQ addOrderBy_Id_Asc() {
+        regOBA("_id");
+        return this;
+    }
+
+    public BsApiTokenCQ addOrderBy_Id_Desc() {
+        regOBD("_id");
+        return this;
+    }
+
+    public void setName_Equal(String name) {
+        setName_Term(name, null);
+    }
+
+    public void setName_Equal(String name, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        setName_Term(name, opLambda);
+    }
+
+    public void setName_Term(String name) {
+        setName_Term(name, null);
+    }
+
+    public void setName_Term(String name, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        TermQueryBuilder builder = regTermQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_NotEqual(String name) {
+        setName_NotTerm(name, null);
+    }
+
+    public void setName_NotTerm(String name) {
+        setName_NotTerm(name, null);
+    }
+
+    public void setName_NotEqual(String name, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        setName_NotTerm(name, opLambda);
+    }
+
+    public void setName_NotTerm(String name, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        not(not -> not.setName_Term(name), opLambda);
+    }
+
+    public void setName_Terms(Collection<String> nameList) {
+        setName_Terms(nameList, null);
+    }
+
+    public void setName_Terms(Collection<String> nameList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        TermsQueryBuilder builder = regTermsQ("name", nameList);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_InScope(Collection<String> nameList) {
+        setName_Terms(nameList, null);
+    }
+
+    public void setName_InScope(Collection<String> nameList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        setName_Terms(nameList, opLambda);
+    }
+
+    public void setName_Match(String name) {
+        setName_Match(name, null);
+    }
+
+    public void setName_Match(String name, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_MatchPhrase(String name) {
+        setName_MatchPhrase(name, null);
+    }
+
+    public void setName_MatchPhrase(String name, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhraseQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_MatchPhrasePrefix(String name) {
+        setName_MatchPhrasePrefix(name, null);
+    }
+
+    public void setName_MatchPhrasePrefix(String name, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhrasePrefixQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_Fuzzy(String name) {
+        setName_Fuzzy(name, null);
+    }
+
+    public void setName_Fuzzy(String name, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
+        FuzzyQueryBuilder builder = regFuzzyQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_Prefix(String name) {
+        setName_Prefix(name, null);
+    }
+
+    public void setName_Prefix(String name, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
+        PrefixQueryBuilder builder = regPrefixQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_Wildcard(String name) {
+        setName_Wildcard(name, null);
+    }
+
+    public void setName_Wildcard(String name, ConditionOptionCall<WildcardQueryBuilder> opLambda) {
+        WildcardQueryBuilder builder = regWildcardQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_Regexp(String name) {
+        setName_Regexp(name, null);
+    }
+
+    public void setName_Regexp(String name, ConditionOptionCall<RegexpQueryBuilder> opLambda) {
+        RegexpQueryBuilder builder = regRegexpQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_GreaterThan(String name) {
+        setName_GreaterThan(name, null);
+    }
+
+    public void setName_GreaterThan(String name, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("name", ConditionKey.CK_GREATER_THAN, name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_LessThan(String name) {
+        setName_LessThan(name, null);
+    }
+
+    public void setName_LessThan(String name, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("name", ConditionKey.CK_LESS_THAN, name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_GreaterEqual(String name) {
+        setName_GreaterEqual(name, null);
+    }
+
+    public void setName_GreaterEqual(String name, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("name", ConditionKey.CK_GREATER_EQUAL, name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_LessEqual(String name) {
+        setName_LessEqual(name, null);
+    }
+
+    public void setName_LessEqual(String name, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("name", ConditionKey.CK_LESS_EQUAL, name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_Exists() {
+        setName_Exists(null);
+    }
+
+    public void setName_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
+        ExistsQueryBuilder builder = regExistsQ("name");
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setName_CommonTerms(String name) {
+        setName_CommonTerms(name, null);
+    }
+
+    public void setName_CommonTerms(String name, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
+        CommonTermsQueryBuilder builder = regCommonTermsQ("name", name);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public BsApiTokenCQ addOrderBy_Name_Asc() {
+        regOBA("name");
+        return this;
+    }
+
+    public BsApiTokenCQ addOrderBy_Name_Desc() {
+        regOBD("name");
+        return this;
+    }
+
+    public void setToken_Equal(String token) {
+        setToken_Term(token, null);
+    }
+
+    public void setToken_Equal(String token, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        setToken_Term(token, opLambda);
+    }
+
+    public void setToken_Term(String token) {
+        setToken_Term(token, null);
+    }
+
+    public void setToken_Term(String token, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        TermQueryBuilder builder = regTermQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_NotEqual(String token) {
+        setToken_NotTerm(token, null);
+    }
+
+    public void setToken_NotTerm(String token) {
+        setToken_NotTerm(token, null);
+    }
+
+    public void setToken_NotEqual(String token, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        setToken_NotTerm(token, opLambda);
+    }
+
+    public void setToken_NotTerm(String token, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        not(not -> not.setToken_Term(token), opLambda);
+    }
+
+    public void setToken_Terms(Collection<String> tokenList) {
+        setToken_Terms(tokenList, null);
+    }
+
+    public void setToken_Terms(Collection<String> tokenList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        TermsQueryBuilder builder = regTermsQ("token", tokenList);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_InScope(Collection<String> tokenList) {
+        setToken_Terms(tokenList, null);
+    }
+
+    public void setToken_InScope(Collection<String> tokenList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        setToken_Terms(tokenList, opLambda);
+    }
+
+    public void setToken_Match(String token) {
+        setToken_Match(token, null);
+    }
+
+    public void setToken_Match(String token, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_MatchPhrase(String token) {
+        setToken_MatchPhrase(token, null);
+    }
+
+    public void setToken_MatchPhrase(String token, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhraseQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_MatchPhrasePrefix(String token) {
+        setToken_MatchPhrasePrefix(token, null);
+    }
+
+    public void setToken_MatchPhrasePrefix(String token, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhrasePrefixQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_Fuzzy(String token) {
+        setToken_Fuzzy(token, null);
+    }
+
+    public void setToken_Fuzzy(String token, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
+        FuzzyQueryBuilder builder = regFuzzyQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_Prefix(String token) {
+        setToken_Prefix(token, null);
+    }
+
+    public void setToken_Prefix(String token, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
+        PrefixQueryBuilder builder = regPrefixQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_Wildcard(String token) {
+        setToken_Wildcard(token, null);
+    }
+
+    public void setToken_Wildcard(String token, ConditionOptionCall<WildcardQueryBuilder> opLambda) {
+        WildcardQueryBuilder builder = regWildcardQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_Regexp(String token) {
+        setToken_Regexp(token, null);
+    }
+
+    public void setToken_Regexp(String token, ConditionOptionCall<RegexpQueryBuilder> opLambda) {
+        RegexpQueryBuilder builder = regRegexpQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_GreaterThan(String token) {
+        setToken_GreaterThan(token, null);
+    }
+
+    public void setToken_GreaterThan(String token, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("token", ConditionKey.CK_GREATER_THAN, token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_LessThan(String token) {
+        setToken_LessThan(token, null);
+    }
+
+    public void setToken_LessThan(String token, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("token", ConditionKey.CK_LESS_THAN, token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_GreaterEqual(String token) {
+        setToken_GreaterEqual(token, null);
+    }
+
+    public void setToken_GreaterEqual(String token, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("token", ConditionKey.CK_GREATER_EQUAL, token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_LessEqual(String token) {
+        setToken_LessEqual(token, null);
+    }
+
+    public void setToken_LessEqual(String token, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("token", ConditionKey.CK_LESS_EQUAL, token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_Exists() {
+        setToken_Exists(null);
+    }
+
+    public void setToken_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
+        ExistsQueryBuilder builder = regExistsQ("token");
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setToken_CommonTerms(String token) {
+        setToken_CommonTerms(token, null);
+    }
+
+    public void setToken_CommonTerms(String token, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
+        CommonTermsQueryBuilder builder = regCommonTermsQ("token", token);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public BsApiTokenCQ addOrderBy_Token_Asc() {
+        regOBA("token");
+        return this;
+    }
+
+    public BsApiTokenCQ addOrderBy_Token_Desc() {
+        regOBD("token");
+        return this;
+    }
+
+    public void setCreatedBy_Equal(String createdBy) {
+        setCreatedBy_Term(createdBy, null);
+    }
+
+    public void setCreatedBy_Equal(String createdBy, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        setCreatedBy_Term(createdBy, opLambda);
+    }
+
+    public void setCreatedBy_Term(String createdBy) {
+        setCreatedBy_Term(createdBy, null);
+    }
+
+    public void setCreatedBy_Term(String createdBy, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        TermQueryBuilder builder = regTermQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_NotEqual(String createdBy) {
+        setCreatedBy_NotTerm(createdBy, null);
+    }
+
+    public void setCreatedBy_NotTerm(String createdBy) {
+        setCreatedBy_NotTerm(createdBy, null);
+    }
+
+    public void setCreatedBy_NotEqual(String createdBy, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        setCreatedBy_NotTerm(createdBy, opLambda);
+    }
+
+    public void setCreatedBy_NotTerm(String createdBy, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        not(not -> not.setCreatedBy_Term(createdBy), opLambda);
+    }
+
+    public void setCreatedBy_Terms(Collection<String> createdByList) {
+        setCreatedBy_Terms(createdByList, null);
+    }
+
+    public void setCreatedBy_Terms(Collection<String> createdByList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        TermsQueryBuilder builder = regTermsQ("createdBy", createdByList);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_InScope(Collection<String> createdByList) {
+        setCreatedBy_Terms(createdByList, null);
+    }
+
+    public void setCreatedBy_InScope(Collection<String> createdByList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        setCreatedBy_Terms(createdByList, opLambda);
+    }
+
+    public void setCreatedBy_Match(String createdBy) {
+        setCreatedBy_Match(createdBy, null);
+    }
+
+    public void setCreatedBy_Match(String createdBy, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_MatchPhrase(String createdBy) {
+        setCreatedBy_MatchPhrase(createdBy, null);
+    }
+
+    public void setCreatedBy_MatchPhrase(String createdBy, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhraseQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_MatchPhrasePrefix(String createdBy) {
+        setCreatedBy_MatchPhrasePrefix(createdBy, null);
+    }
+
+    public void setCreatedBy_MatchPhrasePrefix(String createdBy, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhrasePrefixQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_Fuzzy(String createdBy) {
+        setCreatedBy_Fuzzy(createdBy, null);
+    }
+
+    public void setCreatedBy_Fuzzy(String createdBy, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
+        FuzzyQueryBuilder builder = regFuzzyQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_Prefix(String createdBy) {
+        setCreatedBy_Prefix(createdBy, null);
+    }
+
+    public void setCreatedBy_Prefix(String createdBy, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
+        PrefixQueryBuilder builder = regPrefixQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_Wildcard(String createdBy) {
+        setCreatedBy_Wildcard(createdBy, null);
+    }
+
+    public void setCreatedBy_Wildcard(String createdBy, ConditionOptionCall<WildcardQueryBuilder> opLambda) {
+        WildcardQueryBuilder builder = regWildcardQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_Regexp(String createdBy) {
+        setCreatedBy_Regexp(createdBy, null);
+    }
+
+    public void setCreatedBy_Regexp(String createdBy, ConditionOptionCall<RegexpQueryBuilder> opLambda) {
+        RegexpQueryBuilder builder = regRegexpQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_GreaterThan(String createdBy) {
+        setCreatedBy_GreaterThan(createdBy, null);
+    }
+
+    public void setCreatedBy_GreaterThan(String createdBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdBy", ConditionKey.CK_GREATER_THAN, createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_LessThan(String createdBy) {
+        setCreatedBy_LessThan(createdBy, null);
+    }
+
+    public void setCreatedBy_LessThan(String createdBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdBy", ConditionKey.CK_LESS_THAN, createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_GreaterEqual(String createdBy) {
+        setCreatedBy_GreaterEqual(createdBy, null);
+    }
+
+    public void setCreatedBy_GreaterEqual(String createdBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdBy", ConditionKey.CK_GREATER_EQUAL, createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_LessEqual(String createdBy) {
+        setCreatedBy_LessEqual(createdBy, null);
+    }
+
+    public void setCreatedBy_LessEqual(String createdBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdBy", ConditionKey.CK_LESS_EQUAL, createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_Exists() {
+        setCreatedBy_Exists(null);
+    }
+
+    public void setCreatedBy_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
+        ExistsQueryBuilder builder = regExistsQ("createdBy");
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedBy_CommonTerms(String createdBy) {
+        setCreatedBy_CommonTerms(createdBy, null);
+    }
+
+    public void setCreatedBy_CommonTerms(String createdBy, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
+        CommonTermsQueryBuilder builder = regCommonTermsQ("createdBy", createdBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public BsApiTokenCQ addOrderBy_CreatedBy_Asc() {
+        regOBA("createdBy");
+        return this;
+    }
+
+    public BsApiTokenCQ addOrderBy_CreatedBy_Desc() {
+        regOBD("createdBy");
+        return this;
+    }
+
+    public void setCreatedTime_Equal(Long createdTime) {
+        setCreatedTime_Term(createdTime, null);
+    }
+
+    public void setCreatedTime_Equal(Long createdTime, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        setCreatedTime_Term(createdTime, opLambda);
+    }
+
+    public void setCreatedTime_Term(Long createdTime) {
+        setCreatedTime_Term(createdTime, null);
+    }
+
+    public void setCreatedTime_Term(Long createdTime, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        TermQueryBuilder builder = regTermQ("createdTime", createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_NotEqual(Long createdTime) {
+        setCreatedTime_NotTerm(createdTime, null);
+    }
+
+    public void setCreatedTime_NotTerm(Long createdTime) {
+        setCreatedTime_NotTerm(createdTime, null);
+    }
+
+    public void setCreatedTime_NotEqual(Long createdTime, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        setCreatedTime_NotTerm(createdTime, opLambda);
+    }
+
+    public void setCreatedTime_NotTerm(Long createdTime, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        not(not -> not.setCreatedTime_Term(createdTime), opLambda);
+    }
+
+    public void setCreatedTime_Terms(Collection<Long> createdTimeList) {
+        setCreatedTime_Terms(createdTimeList, null);
+    }
+
+    public void setCreatedTime_Terms(Collection<Long> createdTimeList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        TermsQueryBuilder builder = regTermsQ("createdTime", createdTimeList);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_InScope(Collection<Long> createdTimeList) {
+        setCreatedTime_Terms(createdTimeList, null);
+    }
+
+    public void setCreatedTime_InScope(Collection<Long> createdTimeList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        setCreatedTime_Terms(createdTimeList, opLambda);
+    }
+
+    public void setCreatedTime_Match(Long createdTime) {
+        setCreatedTime_Match(createdTime, null);
+    }
+
+    public void setCreatedTime_Match(Long createdTime, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchQ("createdTime", createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_MatchPhrase(Long createdTime) {
+        setCreatedTime_MatchPhrase(createdTime, null);
+    }
+
+    public void setCreatedTime_MatchPhrase(Long createdTime, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhraseQ("createdTime", createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_MatchPhrasePrefix(Long createdTime) {
+        setCreatedTime_MatchPhrasePrefix(createdTime, null);
+    }
+
+    public void setCreatedTime_MatchPhrasePrefix(Long createdTime, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhrasePrefixQ("createdTime", createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_Fuzzy(Long createdTime) {
+        setCreatedTime_Fuzzy(createdTime, null);
+    }
+
+    public void setCreatedTime_Fuzzy(Long createdTime, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
+        FuzzyQueryBuilder builder = regFuzzyQ("createdTime", createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_GreaterThan(Long createdTime) {
+        setCreatedTime_GreaterThan(createdTime, null);
+    }
+
+    public void setCreatedTime_GreaterThan(Long createdTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdTime", ConditionKey.CK_GREATER_THAN, createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_LessThan(Long createdTime) {
+        setCreatedTime_LessThan(createdTime, null);
+    }
+
+    public void setCreatedTime_LessThan(Long createdTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdTime", ConditionKey.CK_LESS_THAN, createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_GreaterEqual(Long createdTime) {
+        setCreatedTime_GreaterEqual(createdTime, null);
+    }
+
+    public void setCreatedTime_GreaterEqual(Long createdTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdTime", ConditionKey.CK_GREATER_EQUAL, createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_LessEqual(Long createdTime) {
+        setCreatedTime_LessEqual(createdTime, null);
+    }
+
+    public void setCreatedTime_LessEqual(Long createdTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("createdTime", ConditionKey.CK_LESS_EQUAL, createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_Exists() {
+        setCreatedTime_Exists(null);
+    }
+
+    public void setCreatedTime_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
+        ExistsQueryBuilder builder = regExistsQ("createdTime");
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setCreatedTime_CommonTerms(Long createdTime) {
+        setCreatedTime_CommonTerms(createdTime, null);
+    }
+
+    public void setCreatedTime_CommonTerms(Long createdTime, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
+        CommonTermsQueryBuilder builder = regCommonTermsQ("createdTime", createdTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public BsApiTokenCQ addOrderBy_CreatedTime_Asc() {
+        regOBA("createdTime");
+        return this;
+    }
+
+    public BsApiTokenCQ addOrderBy_CreatedTime_Desc() {
+        regOBD("createdTime");
+        return this;
+    }
+
+    public void setUpdatedBy_Equal(String updatedBy) {
+        setUpdatedBy_Term(updatedBy, null);
+    }
+
+    public void setUpdatedBy_Equal(String updatedBy, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        setUpdatedBy_Term(updatedBy, opLambda);
+    }
+
+    public void setUpdatedBy_Term(String updatedBy) {
+        setUpdatedBy_Term(updatedBy, null);
+    }
+
+    public void setUpdatedBy_Term(String updatedBy, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        TermQueryBuilder builder = regTermQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_NotEqual(String updatedBy) {
+        setUpdatedBy_NotTerm(updatedBy, null);
+    }
+
+    public void setUpdatedBy_NotTerm(String updatedBy) {
+        setUpdatedBy_NotTerm(updatedBy, null);
+    }
+
+    public void setUpdatedBy_NotEqual(String updatedBy, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        setUpdatedBy_NotTerm(updatedBy, opLambda);
+    }
+
+    public void setUpdatedBy_NotTerm(String updatedBy, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        not(not -> not.setUpdatedBy_Term(updatedBy), opLambda);
+    }
+
+    public void setUpdatedBy_Terms(Collection<String> updatedByList) {
+        setUpdatedBy_Terms(updatedByList, null);
+    }
+
+    public void setUpdatedBy_Terms(Collection<String> updatedByList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        TermsQueryBuilder builder = regTermsQ("updatedBy", updatedByList);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_InScope(Collection<String> updatedByList) {
+        setUpdatedBy_Terms(updatedByList, null);
+    }
+
+    public void setUpdatedBy_InScope(Collection<String> updatedByList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        setUpdatedBy_Terms(updatedByList, opLambda);
+    }
+
+    public void setUpdatedBy_Match(String updatedBy) {
+        setUpdatedBy_Match(updatedBy, null);
+    }
+
+    public void setUpdatedBy_Match(String updatedBy, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_MatchPhrase(String updatedBy) {
+        setUpdatedBy_MatchPhrase(updatedBy, null);
+    }
+
+    public void setUpdatedBy_MatchPhrase(String updatedBy, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhraseQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_MatchPhrasePrefix(String updatedBy) {
+        setUpdatedBy_MatchPhrasePrefix(updatedBy, null);
+    }
+
+    public void setUpdatedBy_MatchPhrasePrefix(String updatedBy, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhrasePrefixQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_Fuzzy(String updatedBy) {
+        setUpdatedBy_Fuzzy(updatedBy, null);
+    }
+
+    public void setUpdatedBy_Fuzzy(String updatedBy, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
+        FuzzyQueryBuilder builder = regFuzzyQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_Prefix(String updatedBy) {
+        setUpdatedBy_Prefix(updatedBy, null);
+    }
+
+    public void setUpdatedBy_Prefix(String updatedBy, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
+        PrefixQueryBuilder builder = regPrefixQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_Wildcard(String updatedBy) {
+        setUpdatedBy_Wildcard(updatedBy, null);
+    }
+
+    public void setUpdatedBy_Wildcard(String updatedBy, ConditionOptionCall<WildcardQueryBuilder> opLambda) {
+        WildcardQueryBuilder builder = regWildcardQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_Regexp(String updatedBy) {
+        setUpdatedBy_Regexp(updatedBy, null);
+    }
+
+    public void setUpdatedBy_Regexp(String updatedBy, ConditionOptionCall<RegexpQueryBuilder> opLambda) {
+        RegexpQueryBuilder builder = regRegexpQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_GreaterThan(String updatedBy) {
+        setUpdatedBy_GreaterThan(updatedBy, null);
+    }
+
+    public void setUpdatedBy_GreaterThan(String updatedBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedBy", ConditionKey.CK_GREATER_THAN, updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_LessThan(String updatedBy) {
+        setUpdatedBy_LessThan(updatedBy, null);
+    }
+
+    public void setUpdatedBy_LessThan(String updatedBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedBy", ConditionKey.CK_LESS_THAN, updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_GreaterEqual(String updatedBy) {
+        setUpdatedBy_GreaterEqual(updatedBy, null);
+    }
+
+    public void setUpdatedBy_GreaterEqual(String updatedBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedBy", ConditionKey.CK_GREATER_EQUAL, updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_LessEqual(String updatedBy) {
+        setUpdatedBy_LessEqual(updatedBy, null);
+    }
+
+    public void setUpdatedBy_LessEqual(String updatedBy, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedBy", ConditionKey.CK_LESS_EQUAL, updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_Exists() {
+        setUpdatedBy_Exists(null);
+    }
+
+    public void setUpdatedBy_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
+        ExistsQueryBuilder builder = regExistsQ("updatedBy");
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedBy_CommonTerms(String updatedBy) {
+        setUpdatedBy_CommonTerms(updatedBy, null);
+    }
+
+    public void setUpdatedBy_CommonTerms(String updatedBy, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
+        CommonTermsQueryBuilder builder = regCommonTermsQ("updatedBy", updatedBy);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public BsApiTokenCQ addOrderBy_UpdatedBy_Asc() {
+        regOBA("updatedBy");
+        return this;
+    }
+
+    public BsApiTokenCQ addOrderBy_UpdatedBy_Desc() {
+        regOBD("updatedBy");
+        return this;
+    }
+
+    public void setUpdatedTime_Equal(Long updatedTime) {
+        setUpdatedTime_Term(updatedTime, null);
+    }
+
+    public void setUpdatedTime_Equal(Long updatedTime, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        setUpdatedTime_Term(updatedTime, opLambda);
+    }
+
+    public void setUpdatedTime_Term(Long updatedTime) {
+        setUpdatedTime_Term(updatedTime, null);
+    }
+
+    public void setUpdatedTime_Term(Long updatedTime, ConditionOptionCall<TermQueryBuilder> opLambda) {
+        TermQueryBuilder builder = regTermQ("updatedTime", updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_NotEqual(Long updatedTime) {
+        setUpdatedTime_NotTerm(updatedTime, null);
+    }
+
+    public void setUpdatedTime_NotTerm(Long updatedTime) {
+        setUpdatedTime_NotTerm(updatedTime, null);
+    }
+
+    public void setUpdatedTime_NotEqual(Long updatedTime, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        setUpdatedTime_NotTerm(updatedTime, opLambda);
+    }
+
+    public void setUpdatedTime_NotTerm(Long updatedTime, ConditionOptionCall<BoolQueryBuilder> opLambda) {
+        not(not -> not.setUpdatedTime_Term(updatedTime), opLambda);
+    }
+
+    public void setUpdatedTime_Terms(Collection<Long> updatedTimeList) {
+        setUpdatedTime_Terms(updatedTimeList, null);
+    }
+
+    public void setUpdatedTime_Terms(Collection<Long> updatedTimeList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        TermsQueryBuilder builder = regTermsQ("updatedTime", updatedTimeList);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_InScope(Collection<Long> updatedTimeList) {
+        setUpdatedTime_Terms(updatedTimeList, null);
+    }
+
+    public void setUpdatedTime_InScope(Collection<Long> updatedTimeList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
+        setUpdatedTime_Terms(updatedTimeList, opLambda);
+    }
+
+    public void setUpdatedTime_Match(Long updatedTime) {
+        setUpdatedTime_Match(updatedTime, null);
+    }
+
+    public void setUpdatedTime_Match(Long updatedTime, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchQ("updatedTime", updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_MatchPhrase(Long updatedTime) {
+        setUpdatedTime_MatchPhrase(updatedTime, null);
+    }
+
+    public void setUpdatedTime_MatchPhrase(Long updatedTime, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhraseQ("updatedTime", updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_MatchPhrasePrefix(Long updatedTime) {
+        setUpdatedTime_MatchPhrasePrefix(updatedTime, null);
+    }
+
+    public void setUpdatedTime_MatchPhrasePrefix(Long updatedTime, ConditionOptionCall<MatchQueryBuilder> opLambda) {
+        MatchQueryBuilder builder = regMatchPhrasePrefixQ("updatedTime", updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_Fuzzy(Long updatedTime) {
+        setUpdatedTime_Fuzzy(updatedTime, null);
+    }
+
+    public void setUpdatedTime_Fuzzy(Long updatedTime, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
+        FuzzyQueryBuilder builder = regFuzzyQ("updatedTime", updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_GreaterThan(Long updatedTime) {
+        setUpdatedTime_GreaterThan(updatedTime, null);
+    }
+
+    public void setUpdatedTime_GreaterThan(Long updatedTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedTime", ConditionKey.CK_GREATER_THAN, updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_LessThan(Long updatedTime) {
+        setUpdatedTime_LessThan(updatedTime, null);
+    }
+
+    public void setUpdatedTime_LessThan(Long updatedTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedTime", ConditionKey.CK_LESS_THAN, updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_GreaterEqual(Long updatedTime) {
+        setUpdatedTime_GreaterEqual(updatedTime, null);
+    }
+
+    public void setUpdatedTime_GreaterEqual(Long updatedTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedTime", ConditionKey.CK_GREATER_EQUAL, updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_LessEqual(Long updatedTime) {
+        setUpdatedTime_LessEqual(updatedTime, null);
+    }
+
+    public void setUpdatedTime_LessEqual(Long updatedTime, ConditionOptionCall<RangeQueryBuilder> opLambda) {
+        RangeQueryBuilder builder = regRangeQ("updatedTime", ConditionKey.CK_LESS_EQUAL, updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_Exists() {
+        setUpdatedTime_Exists(null);
+    }
+
+    public void setUpdatedTime_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
+        ExistsQueryBuilder builder = regExistsQ("updatedTime");
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public void setUpdatedTime_CommonTerms(Long updatedTime) {
+        setUpdatedTime_CommonTerms(updatedTime, null);
+    }
+
+    public void setUpdatedTime_CommonTerms(Long updatedTime, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
+        CommonTermsQueryBuilder builder = regCommonTermsQ("updatedTime", updatedTime);
+        if (opLambda != null) {
+            opLambda.callback(builder);
+        }
+    }
+
+    public BsApiTokenCQ addOrderBy_UpdatedTime_Asc() {
+        regOBA("updatedTime");
+        return this;
+    }
+
+    public BsApiTokenCQ addOrderBy_UpdatedTime_Desc() {
+        regOBD("updatedTime");
+        return this;
+    }
+
+}

+ 25 - 0
src/main/java/org/codelibs/fess/es/config/exbhv/ApiTokenBhv.java

@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012-2016 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.es.config.exbhv;
+
+import org.codelibs.fess.es.config.bsbhv.BsApiTokenBhv;
+
+/**
+ * @author FreeGen
+ */
+public class ApiTokenBhv extends BsApiTokenBhv {
+
+}

+ 49 - 0
src/main/java/org/codelibs/fess/es/config/exentity/ApiToken.java

@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012-2016 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.es.config.exentity;
+
+import org.codelibs.fess.es.config.bsentity.BsApiToken;
+
+/**
+ * @author ESFlute (using FreeGen)
+ */
+public class ApiToken extends BsApiToken {
+
+    private static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return asDocMeta().id();
+    }
+
+    public void setId(final String id) {
+        asDocMeta().id(id);
+    }
+
+    public Long getVersionNo() {
+        return asDocMeta().version();
+    }
+
+    public void setVersionNo(final Long version) {
+        asDocMeta().version(version);
+    }
+
+    @Override
+    public String toString() {
+        return "ApiToken [name=" + name + ", token=" + token + ", createdBy=" + createdBy + ", createdTime=" + createdTime + ", updatedBy="
+                + updatedBy + ", updatedTime=" + updatedTime + ", docMeta=" + docMeta + "]";
+    }
+
+}

+ 14 - 0
src/main/java/org/codelibs/fess/helper/SystemHelper.java

@@ -20,6 +20,7 @@ import java.io.UnsupportedEncodingException;
 import java.net.InetAddress;
 import java.net.URLEncoder;
 import java.net.UnknownHostException;
+import java.security.SecureRandom;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
@@ -27,6 +28,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Random;
 import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
@@ -36,6 +38,7 @@ import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 
 import org.apache.commons.lang3.LocaleUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.codelibs.core.lang.StringUtil;
 import org.codelibs.fess.Constants;
@@ -70,6 +73,8 @@ public class SystemHelper {
 
     protected List<Runnable> shutdownHookList = new ArrayList<>();
 
+    protected Random random = new SecureRandom();
+
     @PostConstruct
     public void init() {
         final FessConfig fessConfig = ComponentUtil.getFessConfig();
@@ -298,4 +303,13 @@ public class SystemHelper {
         ComponentUtil.getJobManager().reboot();
     }
 
+    public String generateApiToken() {
+        return RandomStringUtils.random(ComponentUtil.getFessConfig().getApiTokenLengthAsInteger().intValue(), 0, 0, true, true, null,
+                random);
+    }
+
+    public void setRandom(Random random) {
+        this.random = random;
+    }
+
 }

+ 9 - 0
src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java

@@ -23,6 +23,15 @@ import org.lastaflute.web.response.next.HtmlNext;
  */
 public interface FessHtmlPath {
 
+    /** The path of the HTML: /admin/apitoken/admin_apitoken.jsp */
+    HtmlNext path_AdminApitoken_AdminApitokenJsp = new HtmlNext("/admin/apitoken/admin_apitoken.jsp");
+
+    /** The path of the HTML: /admin/apitoken/admin_apitoken_details.jsp */
+    HtmlNext path_AdminApitoken_AdminApitokenDetailsJsp = new HtmlNext("/admin/apitoken/admin_apitoken_details.jsp");
+
+    /** The path of the HTML: /admin/apitoken/admin_apitoken_edit.jsp */
+    HtmlNext path_AdminApitoken_AdminApitokenEditJsp = new HtmlNext("/admin/apitoken/admin_apitoken_edit.jsp");
+
     /** The path of the HTML: /admin/backup/admin_backup.jsp */
     HtmlNext path_AdminBackup_AdminBackupJsp = new HtmlNext("/admin/backup/admin_backup.jsp");
 

+ 21 - 0
src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java

@@ -560,6 +560,9 @@ public class FessLabels extends UserMessages {
     /** The key of the message: Back Up */
     public static final String LABELS_menu_backup = "{labels.menu_backup}";
 
+    /** The key of the message: API Token */
+    public static final String LABELS_menu_api_token = "{labels.menu_api_token}";
+
     /** The key of the message: Search... */
     public static final String LABELS_SIDEBAR_placeholder_search = "{labels.sidebar.placeholder_search}";
 
@@ -2079,6 +2082,24 @@ public class FessLabels extends UserMessages {
     /** The key of the message: Sort Order */
     public static final String LABELS_boost_document_rule_sort_order = "{labels.boost_document_rule_sort_order}";
 
+    /** The key of the message: API Token */
+    public static final String LABELS_api_token_configuration = "{labels.api_token_configuration}";
+
+    /** The key of the message: API Token */
+    public static final String LABELS_api_token_title_details = "{labels.api_token_title_details}";
+
+    /** The key of the message: Name */
+    public static final String LABELS_api_token_list_name = "{labels.api_token_list_name}";
+
+    /** The key of the message: Name */
+    public static final String LABELS_api_token_name = "{labels.api_token_name}";
+
+    /** The key of the message: Token */
+    public static final String LABELS_api_token_token = "{labels.api_token_token}";
+
+    /** The key of the message: Created */
+    public static final String LABELS_api_token_updated_time = "{labels.api_token_updated_time}";
+
     /** The key of the message: Additional Word */
     public static final String LABELS_elevate_word_configuration = "{labels.elevate_word_configuration}";
 

+ 40 - 0
src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java

@@ -116,6 +116,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
     /** The key of the configuration. e.g. ar,bg,ca,da,de,el,en,es,eu,fa,fi,fr,ga,gl,hi,hu,hy,id,it,ja,lv,ko,nl,no,pt,ro,ru,sv,th,tr,zh_CN,zh_TW,zh */
     String SUPPORTED_LANGUAGES = "supported.languages";
 
+    /** The key of the configuration. e.g. 60 */
+    String API_TOKEN_LENGTH = "api.token.length";
+
     /** The key of the configuration. e.g. 50 */
     String CRAWLER_DOCUMENT_MAX_SITE_LENGTH = "crawler.document.max.site.length";
 
@@ -772,6 +775,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
     /** The key of the configuration. e.g. esreq */
     String ONLINE_HELP_NAME_ESREQ = "online.help.name.esreq";
 
+    /** The key of the configuration. e.g. apitoken */
+    String ONLINE_HELP_NAME_APITOKEN = "online.help.name.apitoken";
+
     /** The key of the configuration. e.g. ja */
     String ONLINE_HELP_SUPPORTED_LANGS = "online.help.supported.langs";
 
@@ -1275,6 +1281,21 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
      */
     String getSupportedLanguages();
 
+    /**
+     * Get the value for the key 'api.token.length'. <br>
+     * The value is, e.g. 60 <br>
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     */
+    String getApiTokenLength();
+
+    /**
+     * Get the value for the key 'api.token.length' as {@link Integer}. <br>
+     * The value is, e.g. 60 <br>
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     * @throws NumberFormatException When the property is not integer.
+     */
+    Integer getApiTokenLengthAsInteger();
+
     /**
      * Get the value for the key 'crawler.document.max.site.length'. <br>
      * The value is, e.g. 50 <br>
@@ -3446,6 +3467,13 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
      */
     String getOnlineHelpNameEsreq();
 
+    /**
+     * Get the value for the key 'online.help.name.apitoken'. <br>
+     * The value is, e.g. apitoken <br>
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     */
+    String getOnlineHelpNameApitoken();
+
     /**
      * Get the value for the key 'online.help.supported.langs'. <br>
      * The value is, e.g. ja <br>
@@ -4404,6 +4432,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             return get(FessConfig.SUPPORTED_LANGUAGES);
         }
 
+        public String getApiTokenLength() {
+            return get(FessConfig.API_TOKEN_LENGTH);
+        }
+
+        public Integer getApiTokenLengthAsInteger() {
+            return getAsInteger(FessConfig.API_TOKEN_LENGTH);
+        }
+
         public String getCrawlerDocumentMaxSiteLength() {
             return get(FessConfig.CRAWLER_DOCUMENT_MAX_SITE_LENGTH);
         }
@@ -5552,6 +5588,10 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             return get(FessConfig.ONLINE_HELP_NAME_ESREQ);
         }
 
+        public String getOnlineHelpNameApitoken() {
+            return get(FessConfig.ONLINE_HELP_NAME_APITOKEN);
+        }
+
         public String getOnlineHelpSupportedLangs() {
             return get(FessConfig.ONLINE_HELP_SUPPORTED_LANGS);
         }

+ 1 - 0
src/main/resources/esflute_config.xml

@@ -8,6 +8,7 @@
 	<component name="behaviorCommandInvoker" class="org.dbflute.bhv.core.BehaviorCommandInvoker"/>
 
     <!-- The components of Behavior. -->
+    <component name="apiTokenBhv" class="org.codelibs.fess.es.config.exbhv.ApiTokenBhv"/>
     <component name="boostDocumentRuleBhv" class="org.codelibs.fess.es.config.exbhv.BoostDocumentRuleBhv"/>
     <component name="crawlingInfoBhv" class="org.codelibs.fess.es.config.exbhv.CrawlingInfoBhv"/>
     <component name="crawlingInfoParamBhv" class="org.codelibs.fess.es.config.exbhv.CrawlingInfoParamBhv"/>

+ 2 - 0
src/main/resources/fess_config.properties

@@ -71,6 +71,7 @@ supported.uploaded.css.extentions=css
 supported.uploaded.media.extentions=jpg,jpeg,gif,png,swf
 supported.uploaded.files=license.properties
 supported.languages=ar,bg,ca,da,de,el,en,es,eu,fa,fi,fr,ga,gl,hi,hu,hy,id,it,ja,lv,ko,nl,no,pt,ro,ru,sv,th,tr,zh_CN,zh_TW,zh
+api.token.length=60
 
 # ========================================================================================
 #                                                                                   Index
@@ -402,6 +403,7 @@ online.help.name.crawlinginfo=crawlinginfo
 online.help.name.backup=backup
 online.help.name.upgrade=upgrade
 online.help.name.esreq=esreq
+online.help.name.apitoken=apitoken
 
 online.help.supported.langs=ja
 

+ 34 - 0
src/main/resources/fess_indices/.fess_config/api_token.json

@@ -0,0 +1,34 @@
+{
+  "api_token": {
+    "_source": {
+      "enabled": true
+    },
+    "_all": {
+      "enabled": false
+    },
+    "properties": {
+      "name": {
+        "type": "string",
+        "index": "not_analyzed"
+      },
+      "token": {
+        "type": "string",
+        "index": "not_analyzed"
+      },
+      "createdBy": {
+        "type": "string",
+        "index": "not_analyzed"
+      },
+      "createdTime": {
+        "type": "long"
+      },
+      "updatedBy": {
+        "type": "string",
+        "index": "not_analyzed"
+      },
+      "updatedTime": {
+        "type": "long"
+      }
+    }
+  }
+}

+ 7 - 0
src/main/resources/fess_label.properties

@@ -177,6 +177,7 @@ labels.menu_jobLog=Job Log
 labels.menu_failure_url=Failure URL
 labels.menu_search_list=Search
 labels.menu_backup=Back Up
+labels.menu_api_token=API Token
 labels.sidebar.placeholder_search=Search...
 labels.sidebar.menu=MENU
 labels.footer.copyright=Copyright(C) 2009-2016 <a href="https://github.com/codelibs">CodeLibs Project</a>. <span class="br-phone"></span>All Rights Reserved.
@@ -683,6 +684,12 @@ labels.boost_document_rule_list_url_expr=Condition
 labels.boost_document_rule_url_expr=Condition
 labels.boost_document_rule_boost_expr=Boost Expr
 labels.boost_document_rule_sort_order=Sort Order
+labels.api_token_configuration=API Token
+labels.api_token_title_details=API Token
+labels.api_token_list_name=Name
+labels.api_token_name=Name
+labels.api_token_token=Token
+labels.api_token_updated_time=Created
 labels.elevate_word_configuration=Additional Word
 labels.elevate_word_title_details=Additional Word
 labels.elevate_word_link_list=List

+ 7 - 0
src/main/resources/fess_label_en.properties

@@ -177,6 +177,7 @@ labels.menu_jobLog=Job Log
 labels.menu_failure_url=Failure URL
 labels.menu_search_list=Search
 labels.menu_backup=Back Up
+labels.menu_api_token=API Token
 labels.sidebar.placeholder_search=Search...
 labels.sidebar.menu=MENU
 labels.footer.copyright=Copyright(C) 2009-2016 <a href="https://github.com/codelibs">CodeLibs Project</a>. <span class="br-phone"></span>All Rights Reserved.
@@ -683,6 +684,12 @@ labels.boost_document_rule_list_url_expr=Condition
 labels.boost_document_rule_url_expr=Condition
 labels.boost_document_rule_boost_expr=Boost Expr
 labels.boost_document_rule_sort_order=Sort Order
+labels.api_token_configuration=API Token
+labels.api_token_title_details=API Token
+labels.api_token_list_name=Name
+labels.api_token_name=Name
+labels.api_token_token=Token
+labels.api_token_updated_time=Created
 labels.elevate_word_configuration=Additional Word
 labels.elevate_word_title_details=Additional Word
 labels.elevate_word_link_list=List

+ 7 - 0
src/main/resources/fess_label_ja.properties

@@ -173,6 +173,7 @@ labels.menu_jobLog=\u30b8\u30e7\u30d6\u30ed\u30b0
 labels.menu_failure_url=\u969c\u5bb3URL
 labels.menu_search_list=\u691c\u7d22
 labels.menu_backup=\u30d0\u30c3\u30af\u30a2\u30c3\u30d7
+labels.menu_api_token=API\u30c8\u30fc\u30af\u30f3
 labels.sidebar.placeholder_search=\u691c\u7d22...
 labels.sidebar.menu=\u30e1\u30cb\u30e5\u30fc
 labels.footer.copyright=Copyright(C) 2009-2016 <a href="https://github.com/codelibs">CodeLibs Project</a>. <span class="br-phone"></span>All Rights Reserved.
@@ -681,6 +682,12 @@ labels.boost_document_rule_list_url_expr=\u72b6\u614b
 labels.boost_document_rule_url_expr=\u72b6\u614b
 labels.boost_document_rule_boost_expr=\u30d6\u30fc\u30b9\u30c8\u5024\u5f0f
 labels.boost_document_rule_sort_order=\u30bd\u30fc\u30c8\u9806
+labels.api_token_configuration=API\u30c8\u30fc\u30af\u30f3
+labels.api_token_title_details=API\u30c8\u30fc\u30af\u30f3
+labels.api_token_list_name=\u540d\u524d
+labels.api_token_name=\u540d\u524d
+labels.api_token_token=\u30c8\u30fc\u30af\u30f3
+labels.api_token_updated_time=\u4f5c\u6210\u65e5
 labels.elevate_word_configuration=\u8ffd\u52a0\u306e\u5358\u8a9e
 labels.elevate_word_title_details=\u8ffd\u52a0\u306e\u5358\u8a9e
 labels.elevate_word_link_list=\u4e00\u89a7

+ 86 - 0
src/main/webapp/WEB-INF/view/admin/apitoken/admin_apitoken.jsp

@@ -0,0 +1,86 @@
+<%@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.api_token_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="crawl" />
+			<jsp:param name="menuType" value="apiToken" />
+		</jsp:include>
+		<div class="content-wrapper">
+			<section class="content-header">
+				<h1>
+					<la:message key="labels.api_token_configuration" />
+				</h1>
+				<jsp:include page="/WEB-INF/view/common/admin/crud/breadcrumb.jsp"></jsp:include>
+			</section>
+			<section class="content">
+				<div class="row">
+					<div class="col-md-12">
+						<div class="box box-primary">
+							<div class="box-header with-border">
+								<jsp:include page="/WEB-INF/view/common/admin/crud/header.jsp"></jsp:include>
+							</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="${apiTokenPager.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="${apiTokenPager.allRecordCount > 0}">
+									<div class="row">
+										<div class="col-sm-12">
+											<table class="table table-bordered table-striped">
+												<thead>
+													<tr>
+														<th><la:message
+																key="labels.api_token_list_name" /></th>
+													</tr>
+												</thead>
+												<tbody>
+													<c:forEach var="data" varStatus="s"
+														items="${apiTokenItems}">
+														<tr
+															data-href="${contextPath}/admin/apitoken/details/4/${f:u(data.id)}">
+															<td>${f:h(data.name)}</td>
+														</tr>
+													</c:forEach>
+												</tbody>
+											</table>
+										</div>
+									</div>
+									<c:set var="pager" value="${apiTokenPager}"
+										scope="request" />
+									<c:import url="/WEB-INF/view/common/admin/crud/pagination.jsp" />
+								</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>

+ 136 - 0
src/main/webapp/WEB-INF/view/admin/apitoken/admin_apitoken_details.jsp

@@ -0,0 +1,136 @@
+<%@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.api_token_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="crawl" />
+			<jsp:param name="menuType" value="apiToken" />
+		</jsp:include>
+		<div class="content-wrapper">
+			<section class="content-header">
+				<h1>
+					<la:message key="labels.api_token_title_details" />
+				</h1>
+				<jsp:include page="/WEB-INF/view/common/admin/crud/breadcrumb.jsp"></jsp:include>
+			</section>
+			<section class="content">
+				<la:form action="/admin/apitoken/">
+					<la:hidden property="crudMode" />
+					<c:if test="${crudMode==2 || crudMode==3 || crudMode==4}">
+						<la:hidden property="id" />
+						<la:hidden property="versionNo" />
+					</c:if>
+					<la:hidden property="createdBy" />
+					<la:hidden property="createdTime" />
+					<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">
+									<jsp:include page="/WEB-INF/view/common/admin/crud/header.jsp"></jsp:include>
+								</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 class="col-xs-2"><la:message
+														key="labels.api_token_name" /></th>
+												<td>${f:h(name)}<la:hidden property="name" /></td>
+											</tr>
+											<tr>
+												<th><la:message
+														key="labels.api_token_token" /></th>
+												<td>${f:h(token)}</td>
+											</tr>
+											<tr>
+												<th><la:message
+														key="labels.api_token_updated_time" /></th>
+												<td>${fe:date(updatedTime)}</td>
+											</tr>
+										</tbody>
+									</table>
+								</div>
+								<!-- /.box-body -->
+								<div class="box-footer">
+									<button type="submit" class="btn btn-default" name="list" value="back">
+										<i class="fa fa-arrow-circle-left"></i>
+										<la:message key="labels.crud_button_back" />
+									</button>
+									<%--
+									<button type="submit" class="btn btn-warning" name="edit"
+										value="<la:message key="labels.crud_button_edit" />">
+										<i class="fa fa-pencil"></i>
+										<la:message key="labels.crud_button_edit" />
+									</button>
+									 --%>
+									<button type="button" class="btn btn-danger" name="delete"
+										data-toggle="modal" data-target="#confirmToDelete"
+										value="<la:message key="labels.crud_button_delete" />">
+										<i class="fa fa-trash"></i>
+										<la:message key="labels.crud_button_delete" />
+									</button>
+									<div class="modal modal-danger fade" id="confirmToDelete" tabindex="-1"
+										role="dialog">
+										<div class="modal-dialog">
+											<div class="modal-content">
+												<div class="modal-header">
+													<button type="button" class="close" data-dismiss="modal"
+														aria-label="Close">
+														<span aria-hidden="true">×</span>
+													</button>
+													<h4 class="modal-title">
+														<la:message key="labels.crud_title_delete" />
+													</h4>
+												</div>
+												<div class="modal-body">
+													<p>
+														<la:message key="labels.crud_delete_confirmation" />
+													</p>
+												</div>
+												<div class="modal-footer">
+													<button type="button" class="btn btn-outline pull-left"
+														data-dismiss="modal">
+														<la:message key="labels.crud_button_cancel" />
+													</button>
+													<button type="submit" class="btn btn-outline btn-danger"
+														name="delete"
+														value="<la:message key="labels.crud_button_delete" />">
+														<i class="fa fa-trash"></i>
+														<la:message key="labels.crud_button_delete" />
+													</button>
+												</div>
+											</div>
+										</div>
+									</div>
+								</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>

+ 72 - 0
src/main/webapp/WEB-INF/view/admin/apitoken/admin_apitoken_edit.jsp

@@ -0,0 +1,72 @@
+<%@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.api_token_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="crawl" />
+			<jsp:param name="menuType" value="apiToken" />
+		</jsp:include>
+		<div class="content-wrapper">
+			<section class="content-header">
+				<h1>
+					<la:message key="labels.api_token_title_details" />
+				</h1>
+				<jsp:include page="/WEB-INF/view/common/admin/crud/breadcrumb.jsp"></jsp:include>
+			</section>
+			<section class="content">
+				<la:form action="/admin/apitoken/" styleClass="form-horizontal">
+					<la:hidden property="crudMode" />
+					<c:if test="${crudMode==2}">
+						<la:hidden property="id" />
+						<la:hidden property="versionNo" />
+					</c:if>
+					<la:hidden property="createdBy" />
+					<la:hidden property="createdTime" />
+					<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">
+									<jsp:include page="/WEB-INF/view/common/admin/crud/header.jsp"></jsp:include>
+								</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="name" class="col-sm-3 control-label"><la:message
+												key="labels.api_token_name" /></label>
+										<div class="col-sm-9">
+											<la:errors property="name" />
+											<la:text property="name" 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>

+ 6 - 0
src/main/webapp/WEB-INF/view/common/admin/sidebar.jsp

@@ -70,6 +70,12 @@
 							<span><la:message key="labels.menu_dict" /></span>
 						</la:link></li>
 
+					<li <c:if test="${param.menuType=='apiToken'}">class="active"</c:if>><la:link
+							href="/admin/apitoken/">
+							<i class='fa fa-circle-o'></i>
+							<span><la:message key="labels.menu_api_token" /></span>
+						</la:link></li>
+
 				</ul></li>
 			<li
 				class="treeview <c:if test="${param.menuCategoryType=='crawl'}">active</c:if>"><a