fix #494 : refactoring for role based search
This commit is contained in:
parent
fcf9e9e5b5
commit
62ddc78457
80 changed files with 1367 additions and 1515 deletions
|
@ -240,6 +240,10 @@
|
|||
"numOfThread" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"permissions" : {
|
||||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
},
|
||||
"sortOrder" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
|
@ -459,6 +463,10 @@
|
|||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
},
|
||||
"permissions" : {
|
||||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
},
|
||||
"sortOrder" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
|
@ -758,6 +766,10 @@
|
|||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
},
|
||||
"permissions" : {
|
||||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
},
|
||||
"sortOrder" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
|
@ -880,6 +892,10 @@
|
|||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
},
|
||||
"permissions" : {
|
||||
"type" : "string",
|
||||
"index" : "not_analyzed"
|
||||
},
|
||||
"sortOrder" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
|
@ -900,6 +916,36 @@
|
|||
"settings" : {
|
||||
"index" : {
|
||||
"refresh_interval" : "1s",
|
||||
"dbflute" : {
|
||||
"data_config" : {
|
||||
"properties" : {
|
||||
"permissions" : {
|
||||
"array" : "true"
|
||||
}
|
||||
}
|
||||
},
|
||||
"file_config" : {
|
||||
"properties" : {
|
||||
"permissions" : {
|
||||
"array" : "true"
|
||||
}
|
||||
}
|
||||
},
|
||||
"label_type" : {
|
||||
"properties" : {
|
||||
"permissions" : {
|
||||
"array" : "true"
|
||||
}
|
||||
}
|
||||
},
|
||||
"web_config" : {
|
||||
"properties" : {
|
||||
"permissions" : {
|
||||
"array" : "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"number_of_shards" : "2",
|
||||
"number_of_replicas" : "0"
|
||||
}
|
||||
|
|
|
@ -27,10 +27,8 @@ import org.codelibs.fess.app.pager.DataConfigPager;
|
|||
import org.codelibs.fess.es.config.cbean.DataConfigCB;
|
||||
import org.codelibs.fess.es.config.exbhv.DataConfigBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.DataConfigToLabelBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.DataConfigToRoleBhv;
|
||||
import org.codelibs.fess.es.config.exentity.DataConfig;
|
||||
import org.codelibs.fess.es.config.exentity.DataConfigToLabel;
|
||||
import org.codelibs.fess.es.config.exentity.DataConfigToRole;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
|
@ -39,9 +37,6 @@ public class DataConfigService implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Resource
|
||||
protected DataConfigToRoleBhv dataConfigToRoleBhv;
|
||||
|
||||
@Resource
|
||||
protected DataConfigToLabelBhv dataConfigToLabelBhv;
|
||||
|
||||
|
@ -80,10 +75,6 @@ public class DataConfigService implements Serializable {
|
|||
cb.query().setDataConfigId_Equal(dataConfigId);
|
||||
});
|
||||
|
||||
dataConfigToRoleBhv.queryDelete(cb -> {
|
||||
cb.query().setDataConfigId_Equal(dataConfigId);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public List<DataConfig> getAllDataConfigList() {
|
||||
|
@ -115,18 +106,6 @@ public class DataConfigService implements Serializable {
|
|||
public OptionalEntity<DataConfig> getDataConfig(final String id) {
|
||||
return dataConfigBhv.selectByPK(id).map(entity -> {
|
||||
|
||||
final List<DataConfigToRole> fctrtmList = dataConfigToRoleBhv.selectList(fctrtmCb -> {
|
||||
fctrtmCb.query().setDataConfigId_Equal(entity.getId());
|
||||
fctrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
if (!fctrtmList.isEmpty()) {
|
||||
final List<String> roleTypeIds = new ArrayList<String>(fctrtmList.size());
|
||||
for (final DataConfigToRole mapping : fctrtmList) {
|
||||
roleTypeIds.add(mapping.getRoleTypeId());
|
||||
}
|
||||
entity.setRoleTypeIds(roleTypeIds.toArray(new String[roleTypeIds.size()]));
|
||||
}
|
||||
|
||||
final List<DataConfigToLabel> fctltmList = dataConfigToLabelBhv.selectList(fctltmCb -> {
|
||||
fctltmCb.query().setDataConfigId_Equal(entity.getId());
|
||||
fctltmCb.fetchFirst(fessConfig.getPageLabeltypeMaxFetchSizeAsInteger());
|
||||
|
@ -146,7 +125,6 @@ public class DataConfigService implements Serializable {
|
|||
public void store(final DataConfig dataConfig) {
|
||||
final boolean isNew = dataConfig.getId() == null;
|
||||
final String[] labelTypeIds = dataConfig.getLabelTypeIds();
|
||||
final String[] roleTypeIds = dataConfig.getRoleTypeIds();
|
||||
|
||||
dataConfigBhv.insertOrUpdate(dataConfig, op -> {
|
||||
op.setRefresh(true);
|
||||
|
@ -166,18 +144,6 @@ public class DataConfigService implements Serializable {
|
|||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
if (roleTypeIds != null) {
|
||||
final List<DataConfigToRole> fctrtmList = new ArrayList<DataConfigToRole>();
|
||||
for (final String roleTypeId : roleTypeIds) {
|
||||
final DataConfigToRole mapping = new DataConfigToRole();
|
||||
mapping.setDataConfigId(dataConfigId);
|
||||
mapping.setRoleTypeId(roleTypeId);
|
||||
fctrtmList.add(mapping);
|
||||
}
|
||||
dataConfigToRoleBhv.batchInsert(fctrtmList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Update
|
||||
if (labelTypeIds != null) {
|
||||
|
@ -212,38 +178,6 @@ public class DataConfigService implements Serializable {
|
|||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
if (roleTypeIds != null) {
|
||||
final List<DataConfigToRole> fctrtmList = dataConfigToRoleBhv.selectList(fctrtmCb -> {
|
||||
fctrtmCb.query().setDataConfigId_Equal(dataConfigId);
|
||||
fctrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
final List<DataConfigToRole> newList = new ArrayList<DataConfigToRole>();
|
||||
final List<DataConfigToRole> matchedList = new ArrayList<DataConfigToRole>();
|
||||
for (final String id : roleTypeIds) {
|
||||
boolean exist = false;
|
||||
for (final DataConfigToRole mapping : fctrtmList) {
|
||||
if (mapping.getRoleTypeId().equals(id)) {
|
||||
exist = true;
|
||||
matchedList.add(mapping);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exist) {
|
||||
// new
|
||||
final DataConfigToRole mapping = new DataConfigToRole();
|
||||
mapping.setDataConfigId(dataConfigId);
|
||||
mapping.setRoleTypeId(id);
|
||||
newList.add(mapping);
|
||||
}
|
||||
}
|
||||
fctrtmList.removeAll(matchedList);
|
||||
dataConfigToRoleBhv.batchInsert(newList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
dataConfigToRoleBhv.batchDelete(fctrtmList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,8 @@ import org.codelibs.fess.es.config.cbean.FileConfigCB;
|
|||
import org.codelibs.fess.es.config.exbhv.FileAuthenticationBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.FileConfigBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.FileConfigToLabelBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.FileConfigToRoleBhv;
|
||||
import org.codelibs.fess.es.config.exentity.FileConfig;
|
||||
import org.codelibs.fess.es.config.exentity.FileConfigToLabel;
|
||||
import org.codelibs.fess.es.config.exentity.FileConfigToRole;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
|
@ -40,9 +38,6 @@ public class FileConfigService implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Resource
|
||||
protected FileConfigToRoleBhv fileConfigToRoleBhv;
|
||||
|
||||
@Resource
|
||||
protected FileConfigToLabelBhv fileConfigToLabelBhv;
|
||||
|
||||
|
@ -83,10 +78,6 @@ public class FileConfigService implements Serializable {
|
|||
cb.query().setFileConfigId_Equal(fileConfigId);
|
||||
});
|
||||
|
||||
fileConfigToRoleBhv.queryDelete(cb -> {
|
||||
cb.query().setFileConfigId_Equal(fileConfigId);
|
||||
});
|
||||
|
||||
fileAuthenticationBhv.queryDelete(cb -> {
|
||||
cb.query().setFileConfigId_Equal(fileConfigId);
|
||||
});
|
||||
|
@ -121,18 +112,6 @@ public class FileConfigService implements Serializable {
|
|||
public OptionalEntity<FileConfig> getFileConfig(final String id) {
|
||||
return fileConfigBhv.selectByPK(id).map(entity -> {
|
||||
|
||||
final List<FileConfigToRole> fctrtmList = fileConfigToRoleBhv.selectList(fctrtmCb -> {
|
||||
fctrtmCb.query().setFileConfigId_Equal(entity.getId());
|
||||
fctrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
if (!fctrtmList.isEmpty()) {
|
||||
final List<String> roleTypeIds = new ArrayList<String>(fctrtmList.size());
|
||||
for (final FileConfigToRole mapping : fctrtmList) {
|
||||
roleTypeIds.add(mapping.getRoleTypeId());
|
||||
}
|
||||
entity.setRoleTypeIds(roleTypeIds.toArray(new String[roleTypeIds.size()]));
|
||||
}
|
||||
|
||||
final List<FileConfigToLabel> fctltmList = fileConfigToLabelBhv.selectList(fctltmCb -> {
|
||||
fctltmCb.query().setFileConfigId_Equal(entity.getId());
|
||||
fctltmCb.fetchFirst(fessConfig.getPageLabeltypeMaxFetchSizeAsInteger());
|
||||
|
@ -151,7 +130,6 @@ public class FileConfigService implements Serializable {
|
|||
public void store(final FileConfig fileConfig) {
|
||||
final boolean isNew = fileConfig.getId() == null;
|
||||
final String[] labelTypeIds = fileConfig.getLabelTypeIds();
|
||||
final String[] roleTypeIds = fileConfig.getRoleTypeIds();
|
||||
|
||||
fileConfigBhv.insertOrUpdate(fileConfig, op -> {
|
||||
op.setRefresh(true);
|
||||
|
@ -171,18 +149,6 @@ public class FileConfigService implements Serializable {
|
|||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
if (roleTypeIds != null) {
|
||||
final List<FileConfigToRole> fctrtmList = new ArrayList<FileConfigToRole>();
|
||||
for (final String roleTypeId : roleTypeIds) {
|
||||
final FileConfigToRole mapping = new FileConfigToRole();
|
||||
mapping.setFileConfigId(fileConfigId);
|
||||
mapping.setRoleTypeId(roleTypeId);
|
||||
fctrtmList.add(mapping);
|
||||
}
|
||||
fileConfigToRoleBhv.batchInsert(fctrtmList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Update
|
||||
if (labelTypeIds != null) {
|
||||
|
@ -217,38 +183,6 @@ public class FileConfigService implements Serializable {
|
|||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
if (roleTypeIds != null) {
|
||||
final List<FileConfigToRole> fctrtmList = fileConfigToRoleBhv.selectList(fctrtmCb -> {
|
||||
fctrtmCb.query().setFileConfigId_Equal(fileConfigId);
|
||||
fctrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
final List<FileConfigToRole> newList = new ArrayList<FileConfigToRole>();
|
||||
final List<FileConfigToRole> matchedList = new ArrayList<FileConfigToRole>();
|
||||
for (final String id : roleTypeIds) {
|
||||
boolean exist = false;
|
||||
for (final FileConfigToRole mapping : fctrtmList) {
|
||||
if (mapping.getRoleTypeId().equals(id)) {
|
||||
exist = true;
|
||||
matchedList.add(mapping);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exist) {
|
||||
// new
|
||||
final FileConfigToRole mapping = new FileConfigToRole();
|
||||
mapping.setFileConfigId(fileConfigId);
|
||||
mapping.setRoleTypeId(id);
|
||||
newList.add(mapping);
|
||||
}
|
||||
}
|
||||
fctrtmList.removeAll(matchedList);
|
||||
fileConfigToRoleBhv.batchInsert(newList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
fileConfigToRoleBhv.batchDelete(fctrtmList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
package org.codelibs.fess.app.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -25,14 +24,11 @@ import org.codelibs.core.beans.util.BeanUtil;
|
|||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.LabelTypePager;
|
||||
import org.codelibs.fess.es.config.cbean.LabelTypeCB;
|
||||
import org.codelibs.fess.es.config.exbhv.LabelToRoleBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.LabelTypeBhv;
|
||||
import org.codelibs.fess.es.config.exentity.LabelToRole;
|
||||
import org.codelibs.fess.es.config.exentity.LabelType;
|
||||
import org.codelibs.fess.helper.LabelTypeHelper;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.cbean.result.ListResultBean;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
|
||||
|
@ -40,9 +36,6 @@ public class LabelTypeService implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Resource
|
||||
protected LabelToRoleBhv labelToRoleBhv;
|
||||
|
||||
@Resource
|
||||
protected LabelTypeBhv labelTypeBhv;
|
||||
|
||||
|
@ -70,10 +63,6 @@ public class LabelTypeService implements Serializable {
|
|||
labelTypeBhv.delete(labelType, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
|
||||
labelToRoleBhv.queryDelete(cb -> {
|
||||
cb.query().setLabelTypeId_Equal(labelType.getId());
|
||||
});
|
||||
}
|
||||
|
||||
protected void setupListCondition(final LabelTypeCB cb, final LabelTypePager labelTypePager) {
|
||||
|
@ -97,95 +86,19 @@ public class LabelTypeService implements Serializable {
|
|||
});
|
||||
}
|
||||
|
||||
public List<LabelType> getLabelTypeListWithRoles() {
|
||||
final ListResultBean<LabelType> labelTypeList = labelTypeBhv.selectList(cb -> {
|
||||
cb.query().addOrderBy_SortOrder_Asc();
|
||||
cb.query().addOrderBy_Name_Asc();
|
||||
cb.paging(fessConfig.getPageLabeltypeMaxFetchSizeAsInteger().intValue(), 1);
|
||||
});
|
||||
|
||||
return labelTypeList;
|
||||
}
|
||||
|
||||
public void store(final LabelType labelType) {
|
||||
final boolean isNew = labelType.getId() == null;
|
||||
final String[] roleTypeIds = labelType.getRoleTypeIds();
|
||||
|
||||
labelTypeBhv.insertOrUpdate(labelType, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
final String labelTypeId = labelType.getId();
|
||||
if (isNew) {
|
||||
// Insert
|
||||
if (roleTypeIds != null) {
|
||||
final List<LabelToRole> lttrtmList = new ArrayList<LabelToRole>();
|
||||
for (final String id : roleTypeIds) {
|
||||
final LabelToRole mapping = new LabelToRole();
|
||||
mapping.setLabelTypeId(labelTypeId);
|
||||
mapping.setRoleTypeId(id);
|
||||
lttrtmList.add(mapping);
|
||||
}
|
||||
labelToRoleBhv.batchInsert(lttrtmList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Update
|
||||
if (roleTypeIds != null) {
|
||||
final List<LabelToRole> list = labelToRoleBhv.selectList(lttrtmCb -> {
|
||||
lttrtmCb.query().setLabelTypeId_Equal(labelTypeId);
|
||||
lttrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
final List<LabelToRole> newList = new ArrayList<LabelToRole>();
|
||||
final List<LabelToRole> matchedList = new ArrayList<LabelToRole>();
|
||||
for (final String roleTypeId : roleTypeIds) {
|
||||
boolean exist = false;
|
||||
for (final LabelToRole mapping : list) {
|
||||
if (mapping.getRoleTypeId().equals(roleTypeId)) {
|
||||
exist = true;
|
||||
matchedList.add(mapping);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exist) {
|
||||
// new
|
||||
final LabelToRole mapping = new LabelToRole();
|
||||
mapping.setLabelTypeId(labelTypeId);
|
||||
mapping.setRoleTypeId(roleTypeId);
|
||||
newList.add(mapping);
|
||||
}
|
||||
}
|
||||
list.removeAll(matchedList);
|
||||
labelToRoleBhv.batchInsert(newList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
labelToRoleBhv.batchDelete(list, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
final LabelTypeHelper labelTypeHelper = ComponentUtil.getLabelTypeHelper();
|
||||
if (labelTypeHelper != null) {
|
||||
labelTypeHelper.refresh(getLabelTypeListWithRoles());
|
||||
labelTypeHelper.refresh(getLabelTypeList());
|
||||
}
|
||||
}
|
||||
|
||||
public OptionalEntity<LabelType> getLabelType(final String id) {
|
||||
return labelTypeBhv.selectByPK(id).map(entity -> {
|
||||
final List<LabelToRole> wctrtmList = labelToRoleBhv.selectList(wctrtmCb -> {
|
||||
wctrtmCb.query().setLabelTypeId_Equal(entity.getId());
|
||||
wctrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
if (!wctrtmList.isEmpty()) {
|
||||
final List<String> roleTypeIds = new ArrayList<String>(wctrtmList.size());
|
||||
for (final LabelToRole mapping : wctrtmList) {
|
||||
roleTypeIds.add(mapping.getRoleTypeId());
|
||||
}
|
||||
entity.setRoleTypeIds(roleTypeIds.toArray(new String[roleTypeIds.size()]));
|
||||
}
|
||||
return entity;
|
||||
});
|
||||
return labelTypeBhv.selectByPK(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,10 +29,8 @@ import org.codelibs.fess.es.config.exbhv.RequestHeaderBhv;
|
|||
import org.codelibs.fess.es.config.exbhv.WebAuthenticationBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.WebConfigBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.WebConfigToLabelBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.WebConfigToRoleBhv;
|
||||
import org.codelibs.fess.es.config.exentity.WebConfig;
|
||||
import org.codelibs.fess.es.config.exentity.WebConfigToLabel;
|
||||
import org.codelibs.fess.es.config.exentity.WebConfigToRole;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
|
@ -44,9 +42,6 @@ public class WebConfigService implements Serializable {
|
|||
@Resource
|
||||
protected WebConfigToLabelBhv webConfigToLabelBhv;
|
||||
|
||||
@Resource
|
||||
protected WebConfigToRoleBhv webConfigToRoleBhv;
|
||||
|
||||
@Resource
|
||||
protected WebConfigBhv webConfigBhv;
|
||||
|
||||
|
@ -87,10 +82,6 @@ public class WebConfigService implements Serializable {
|
|||
cb.query().setWebConfigId_Equal(webConfigId);
|
||||
});
|
||||
|
||||
webConfigToRoleBhv.queryDelete(cb -> {
|
||||
cb.query().setWebConfigId_Equal(webConfigId);
|
||||
});
|
||||
|
||||
webAuthenticationBhv.queryDelete(cb -> {
|
||||
cb.query().setWebConfigId_Equal(webConfigId);
|
||||
});
|
||||
|
@ -130,18 +121,6 @@ public class WebConfigService implements Serializable {
|
|||
public OptionalEntity<WebConfig> getWebConfig(final String id) {
|
||||
return webConfigBhv.selectByPK(id).map(entity -> {
|
||||
|
||||
final List<WebConfigToRole> wctrtmList = webConfigToRoleBhv.selectList(wctrtmCb -> {
|
||||
wctrtmCb.query().setWebConfigId_Equal(entity.getId());
|
||||
wctrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
if (!wctrtmList.isEmpty()) {
|
||||
final List<String> roleTypeIds = new ArrayList<String>(wctrtmList.size());
|
||||
for (final WebConfigToRole mapping : wctrtmList) {
|
||||
roleTypeIds.add(mapping.getRoleTypeId());
|
||||
}
|
||||
entity.setRoleTypeIds(roleTypeIds.toArray(new String[roleTypeIds.size()]));
|
||||
}
|
||||
|
||||
final List<WebConfigToLabel> wctltmList = webConfigToLabelBhv.selectList(wctltmCb -> {
|
||||
wctltmCb.query().setWebConfigId_Equal(entity.getId());
|
||||
wctltmCb.fetchFirst(fessConfig.getPageLabeltypeMaxFetchSizeAsInteger());
|
||||
|
@ -160,7 +139,6 @@ public class WebConfigService implements Serializable {
|
|||
public void store(final WebConfig webConfig) {
|
||||
final boolean isNew = webConfig.getId() == null;
|
||||
final String[] labelTypeIds = webConfig.getLabelTypeIds();
|
||||
final String[] roleTypeIds = webConfig.getRoleTypeIds();
|
||||
|
||||
webConfigBhv.insertOrUpdate(webConfig, op -> {
|
||||
op.setRefresh(true);
|
||||
|
@ -180,18 +158,6 @@ public class WebConfigService implements Serializable {
|
|||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
if (roleTypeIds != null) {
|
||||
final List<WebConfigToRole> wctrtmList = new ArrayList<WebConfigToRole>();
|
||||
for (final String id : roleTypeIds) {
|
||||
final WebConfigToRole mapping = new WebConfigToRole();
|
||||
mapping.setWebConfigId(webConfigId);
|
||||
mapping.setRoleTypeId(id);
|
||||
wctrtmList.add(mapping);
|
||||
}
|
||||
webConfigToRoleBhv.batchInsert(wctrtmList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Update
|
||||
if (labelTypeIds != null) {
|
||||
|
@ -226,38 +192,6 @@ public class WebConfigService implements Serializable {
|
|||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
if (roleTypeIds != null) {
|
||||
final List<WebConfigToRole> list = webConfigToRoleBhv.selectList(wctrtmCb -> {
|
||||
wctrtmCb.query().setWebConfigId_Equal(webConfigId);
|
||||
wctrtmCb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
final List<WebConfigToRole> newList = new ArrayList<WebConfigToRole>();
|
||||
final List<WebConfigToRole> matchedList = new ArrayList<WebConfigToRole>();
|
||||
for (final String id : roleTypeIds) {
|
||||
boolean exist = false;
|
||||
for (final WebConfigToRole mapping : list) {
|
||||
if (mapping.getRoleTypeId().equals(id)) {
|
||||
exist = true;
|
||||
matchedList.add(mapping);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exist) {
|
||||
// new
|
||||
final WebConfigToRole mapping = new WebConfigToRole();
|
||||
mapping.setWebConfigId(webConfigId);
|
||||
mapping.setRoleTypeId(id);
|
||||
newList.add(mapping);
|
||||
}
|
||||
}
|
||||
list.removeAll(matchedList);
|
||||
webConfigToRoleBhv.batchInsert(newList, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
webConfigToRoleBhv.batchDelete(list, op -> {
|
||||
op.setRefresh(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,9 +19,12 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.DataConfigPager;
|
||||
import org.codelibs.fess.app.service.DataConfigService;
|
||||
|
@ -31,7 +34,9 @@ import org.codelibs.fess.app.web.CrudMode;
|
|||
import org.codelibs.fess.app.web.base.FessAdminAction;
|
||||
import org.codelibs.fess.ds.DataStoreFactory;
|
||||
import org.codelibs.fess.es.config.exentity.DataConfig;
|
||||
import org.codelibs.fess.util.PermissionUtil;
|
||||
import org.codelibs.fess.util.RenderDataUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.web.Execute;
|
||||
|
@ -132,11 +137,20 @@ public class AdminDataconfigAction extends FessAdminAction {
|
|||
public HtmlResponse edit(final EditForm form) {
|
||||
validate(form, messages -> {}, () -> asListHtml());
|
||||
final String id = form.id;
|
||||
dataConfigService.getDataConfig(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, op -> {});
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
dataConfigService
|
||||
.getDataConfig(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().collect(Collectors.joining("\n"));
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
saveToken();
|
||||
if (form.crudMode.intValue() == CrudMode.EDIT) {
|
||||
// back
|
||||
|
@ -155,18 +169,30 @@ public class AdminDataconfigAction extends FessAdminAction {
|
|||
public HtmlResponse details(final int crudMode, final String id) {
|
||||
verifyCrudMode(crudMode, CrudMode.DETAILS);
|
||||
saveToken();
|
||||
return asDetailsHtml().useForm(EditForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
dataConfigService.getDataConfig(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
return asDetailsHtml().useForm(
|
||||
EditForm.class,
|
||||
op -> {
|
||||
op.setup(form -> {
|
||||
dataConfigService
|
||||
.getDataConfig(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct()
|
||||
.collect(Collectors.joining("\n"));
|
||||
form.crudMode = crudMode;
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id),
|
||||
() -> asListHtml());
|
||||
});
|
||||
});
|
||||
form.crudMode = crudMode;
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
|
@ -261,12 +287,19 @@ public class AdminDataconfigAction extends FessAdminAction {
|
|||
protected OptionalEntity<DataConfig> getDataConfig(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;
|
||||
});
|
||||
return getEntity(form, username, currentTime).map(
|
||||
entity -> {
|
||||
entity.setUpdatedBy(username);
|
||||
entity.setUpdatedTime(currentTime);
|
||||
copyBeanToBean(
|
||||
form,
|
||||
entity,
|
||||
op -> op.exclude(Stream.concat(Stream.of(Constants.COMMON_CONVERSION_RULE), Stream.of("permissions")).toArray(
|
||||
n -> new String[n])));
|
||||
entity.setPermissions(StreamUtil.of(form.permissions.split("\n")).map(s -> PermissionUtil.encode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().toArray(n -> new String[n]));
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
||||
protected void registerRolesAndLabels(final RenderData data) {
|
||||
|
|
|
@ -21,10 +21,8 @@ import javax.validation.constraints.Max;
|
|||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
|
@ -36,8 +34,6 @@ public class CreateForm implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String[] roleTypeIds;
|
||||
|
||||
public String[] labelTypeIds;
|
||||
|
||||
@ValidateTypeFailure
|
||||
|
@ -65,6 +61,9 @@ public class CreateForm implements Serializable {
|
|||
@Size(max = 5)
|
||||
public String available;
|
||||
|
||||
@Size(max = 4000)
|
||||
public String permissions;
|
||||
|
||||
@Required
|
||||
@Min(value = 0)
|
||||
@Max(value = 2147483647)
|
||||
|
@ -85,9 +84,6 @@ public class CreateForm implements Serializable {
|
|||
sortOrder = 0;
|
||||
createdBy = ComponentUtil.getSystemHelper().getUsername();
|
||||
createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
|
||||
final String roles = ComponentUtil.getFessConfig().getSearchDefaultRoles();
|
||||
if (StringUtil.isNotBlank(roles)) {
|
||||
roleTypeIds = StreamUtil.of(roles.split(",")).map(role -> role.trim()).toArray(n -> new String[n]);
|
||||
}
|
||||
permissions = ComponentUtil.getFessConfig().getSearchDefaultDisplayPermission();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,12 @@
|
|||
*/
|
||||
package org.codelibs.fess.app.web.admin.fileconfig;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.FileConfigPager;
|
||||
import org.codelibs.fess.app.service.FileConfigService;
|
||||
|
@ -25,7 +29,9 @@ import org.codelibs.fess.app.service.RoleTypeService;
|
|||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.app.web.base.FessAdminAction;
|
||||
import org.codelibs.fess.es.config.exentity.FileConfig;
|
||||
import org.codelibs.fess.util.PermissionUtil;
|
||||
import org.codelibs.fess.util.RenderDataUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.web.Execute;
|
||||
|
@ -126,11 +132,20 @@ public class AdminFileconfigAction extends FessAdminAction {
|
|||
public HtmlResponse edit(final EditForm form) {
|
||||
validate(form, messages -> {}, () -> asListHtml());
|
||||
final String id = form.id;
|
||||
fileConfigService.getFileConfig(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, op -> {});
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
fileConfigService
|
||||
.getFileConfig(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().collect(Collectors.joining("\n"));
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
saveToken();
|
||||
if (form.crudMode.intValue() == CrudMode.EDIT) {
|
||||
// back
|
||||
|
@ -149,18 +164,30 @@ public class AdminFileconfigAction extends FessAdminAction {
|
|||
public HtmlResponse details(final int crudMode, final String id) {
|
||||
verifyCrudMode(crudMode, CrudMode.DETAILS);
|
||||
saveToken();
|
||||
return asHtml(path_AdminFileconfig_AdminFileconfigDetailsJsp).useForm(EditForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
fileConfigService.getFileConfig(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
return asHtml(path_AdminFileconfig_AdminFileconfigDetailsJsp).useForm(
|
||||
EditForm.class,
|
||||
op -> {
|
||||
op.setup(form -> {
|
||||
fileConfigService
|
||||
.getFileConfig(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct()
|
||||
.collect(Collectors.joining("\n"));
|
||||
form.crudMode = crudMode;
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id),
|
||||
() -> asListHtml());
|
||||
});
|
||||
});
|
||||
form.crudMode = crudMode;
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
});
|
||||
}).renderWith(data -> {
|
||||
}).renderWith(data -> {
|
||||
registerRolesAndLabels(data);
|
||||
});
|
||||
}
|
||||
|
@ -257,12 +284,19 @@ public class AdminFileconfigAction extends FessAdminAction {
|
|||
protected OptionalEntity<FileConfig> getFileConfig(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;
|
||||
});
|
||||
return getEntity(form, username, currentTime).map(
|
||||
entity -> {
|
||||
entity.setUpdatedBy(username);
|
||||
entity.setUpdatedTime(currentTime);
|
||||
copyBeanToBean(
|
||||
form,
|
||||
entity,
|
||||
op -> op.exclude(Stream.concat(Stream.of(Constants.COMMON_CONVERSION_RULE), Stream.of("permissions")).toArray(
|
||||
n -> new String[n])));
|
||||
entity.setPermissions(StreamUtil.of(form.permissions.split("\n")).map(s -> PermissionUtil.encode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().toArray(n -> new String[n]));
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
||||
protected void registerRolesAndLabels(final RenderData data) {
|
||||
|
|
|
@ -21,11 +21,9 @@ import javax.validation.constraints.Max;
|
|||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.codelibs.fess.validation.UriType;
|
||||
import org.codelibs.fess.validation.UriTypeValidator.ProtocolType;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
@ -39,8 +37,6 @@ public class CreateForm implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String[] roleTypeIds;
|
||||
|
||||
public String[] labelTypeIds;
|
||||
|
||||
@ValidateTypeFailure
|
||||
|
@ -100,6 +96,9 @@ public class CreateForm implements Serializable {
|
|||
@Size(max = 5)
|
||||
public String available;
|
||||
|
||||
@Size(max = 4000)
|
||||
public String permissions;
|
||||
|
||||
@Required
|
||||
@Min(value = 0)
|
||||
@Max(value = 2147483647)
|
||||
|
@ -122,9 +121,6 @@ public class CreateForm implements Serializable {
|
|||
sortOrder = 0;
|
||||
createdBy = ComponentUtil.getSystemHelper().getUsername();
|
||||
createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
|
||||
final String roles = ComponentUtil.getFessConfig().getSearchDefaultRoles();
|
||||
if (StringUtil.isNotBlank(roles)) {
|
||||
roleTypeIds = StreamUtil.of(roles.split(",")).map(role -> role.trim()).toArray(n -> new String[n]);
|
||||
}
|
||||
permissions = ComponentUtil.getFessConfig().getSearchDefaultDisplayPermission();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,12 @@
|
|||
*/
|
||||
package org.codelibs.fess.app.web.admin.labeltype;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.LabelTypePager;
|
||||
import org.codelibs.fess.app.service.LabelTypeService;
|
||||
|
@ -24,7 +28,9 @@ import org.codelibs.fess.app.service.RoleTypeService;
|
|||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.app.web.base.FessAdminAction;
|
||||
import org.codelibs.fess.es.config.exentity.LabelType;
|
||||
import org.codelibs.fess.util.PermissionUtil;
|
||||
import org.codelibs.fess.util.RenderDataUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.web.Execute;
|
||||
|
@ -124,11 +130,20 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
public HtmlResponse edit(final EditForm form) {
|
||||
validate(form, messages -> {}, () -> asListHtml());
|
||||
final String id = form.id;
|
||||
labelTypeService.getLabelType(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, op -> {});
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
labelTypeService
|
||||
.getLabelType(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().collect(Collectors.joining("\n"));
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
saveToken();
|
||||
if (form.crudMode.intValue() == CrudMode.EDIT) {
|
||||
// back
|
||||
|
@ -147,18 +162,30 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
public HtmlResponse details(final int crudMode, final String id) {
|
||||
verifyCrudMode(crudMode, CrudMode.DETAILS);
|
||||
saveToken();
|
||||
return asHtml(path_AdminLabeltype_AdminLabeltypeDetailsJsp).useForm(EditForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
labelTypeService.getLabelType(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
return asHtml(path_AdminLabeltype_AdminLabeltypeDetailsJsp).useForm(
|
||||
EditForm.class,
|
||||
op -> {
|
||||
op.setup(form -> {
|
||||
labelTypeService
|
||||
.getLabelType(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct()
|
||||
.collect(Collectors.joining("\n"));
|
||||
form.crudMode = crudMode;
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id),
|
||||
() -> asListHtml());
|
||||
});
|
||||
});
|
||||
form.crudMode = crudMode;
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
});
|
||||
}).renderWith(data -> {
|
||||
}).renderWith(data -> {
|
||||
registerRoleTypeItems(data);
|
||||
});
|
||||
}
|
||||
|
@ -256,12 +283,19 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
protected OptionalEntity<LabelType> getLabelType(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;
|
||||
});
|
||||
return getEntity(form, username, currentTime).map(
|
||||
entity -> {
|
||||
entity.setUpdatedBy(username);
|
||||
entity.setUpdatedTime(currentTime);
|
||||
copyBeanToBean(
|
||||
form,
|
||||
entity,
|
||||
op -> op.exclude(Stream.concat(Stream.of(Constants.COMMON_CONVERSION_RULE), Stream.of("permissions")).toArray(
|
||||
n -> new String[n])));
|
||||
entity.setPermissions(StreamUtil.of(form.permissions.split("\n")).map(s -> PermissionUtil.encode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().toArray(n -> new String[n]));
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
||||
protected void registerRoleTypeItems(final RenderData data) {
|
||||
|
|
|
@ -22,10 +22,8 @@ import javax.validation.constraints.Min;
|
|||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
|
@ -38,8 +36,6 @@ public class CreateForm implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String[] roleTypeIds;
|
||||
|
||||
@ValidateTypeFailure
|
||||
public Integer crudMode;
|
||||
|
||||
|
@ -58,6 +54,9 @@ public class CreateForm implements Serializable {
|
|||
@Size(max = 4000)
|
||||
public String excludedPaths;
|
||||
|
||||
@Size(max = 4000)
|
||||
public String permissions;
|
||||
|
||||
@Min(value = 0)
|
||||
@Max(value = 2147483647)
|
||||
@ValidateTypeFailure
|
||||
|
@ -76,9 +75,6 @@ public class CreateForm implements Serializable {
|
|||
sortOrder = 0;
|
||||
createdBy = ComponentUtil.getSystemHelper().getUsername();
|
||||
createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
|
||||
final String roles = ComponentUtil.getFessConfig().getSearchDefaultRoles();
|
||||
if (StringUtil.isNotBlank(roles)) {
|
||||
roleTypeIds = StreamUtil.of(roles.split(",")).map(role -> role.trim()).toArray(n -> new String[n]);
|
||||
}
|
||||
permissions = ComponentUtil.getFessConfig().getSearchDefaultDisplayPermission();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,293 +0,0 @@
|
|||
/*
|
||||
* 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.roletype;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.RoleTypePager;
|
||||
import org.codelibs.fess.app.service.RoleTypeService;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.app.web.base.FessAdminAction;
|
||||
import org.codelibs.fess.es.config.exentity.RoleType;
|
||||
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 codelibs
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class AdminRoletypeAction extends FessAdminAction {
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
private RoleTypeService roleTypeService;
|
||||
@Resource
|
||||
private RoleTypePager roleTypePager;
|
||||
|
||||
// ===================================================================================
|
||||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink(fessConfig.getOnlineHelpNameRoletype()));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index(final SearchForm form) {
|
||||
return asListHtml();
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(final OptionalThing<Integer> pageNumber, final SearchForm form) {
|
||||
pageNumber.ifPresent(num -> {
|
||||
roleTypePager.setCurrentPageNumber(pageNumber.get());
|
||||
}).orElse(() -> {
|
||||
roleTypePager.setCurrentPageNumber(0);
|
||||
});
|
||||
return asHtml(path_AdminRoletype_AdminRoletypeJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(final SearchForm form) {
|
||||
copyBeanToBean(form, roleTypePager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminRoletype_AdminRoletypeJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(final SearchForm form) {
|
||||
roleTypePager.clear();
|
||||
return asHtml(path_AdminRoletype_AdminRoletypeJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(final RenderData data, final SearchForm form) {
|
||||
RenderDataUtil.register(data, "roleTypeItems", roleTypeService.getRoleTypeList(roleTypePager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
copyBeanToBean(roleTypePager, form, op -> op.include("id"));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Edit Execute
|
||||
// ============
|
||||
// -----------------------------------------------------
|
||||
// Entry Page
|
||||
// ----------
|
||||
@Execute
|
||||
public HtmlResponse createnew(final OptionalThing<String> value) {
|
||||
saveToken();
|
||||
return asHtml(path_AdminRoletype_AdminRoletypeEditJsp).useForm(CreateForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
form.initialize();
|
||||
form.crudMode = CrudMode.CREATE;
|
||||
value.ifPresent(v -> {
|
||||
form.value = v;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse edit(final EditForm form) {
|
||||
validate(form, messages -> {}, () -> asListHtml());
|
||||
final String id = form.id;
|
||||
roleTypeService.getRoleType(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, op -> {});
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
saveToken();
|
||||
if (form.crudMode.intValue() == CrudMode.EDIT) {
|
||||
// back
|
||||
form.crudMode = CrudMode.DETAILS;
|
||||
return asDetailsHtml();
|
||||
} else {
|
||||
form.crudMode = CrudMode.EDIT;
|
||||
return asEditHtml();
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Details
|
||||
// -------
|
||||
@Execute
|
||||
public HtmlResponse details(final int crudMode, final String id) {
|
||||
verifyCrudMode(crudMode, CrudMode.DETAILS);
|
||||
saveToken();
|
||||
return asHtml(path_AdminRoletype_AdminRoletypeDetailsJsp).useForm(EditForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
roleTypeService.getRoleType(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());
|
||||
getRoleType(form).ifPresent(
|
||||
entity -> {
|
||||
try {
|
||||
roleTypeService.store(entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
|
||||
} catch (Exception e) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)),
|
||||
() -> asEditHtml());
|
||||
}
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), () -> asEditHtml());
|
||||
});
|
||||
return redirect(getClass());
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse update(final EditForm form) {
|
||||
verifyCrudMode(form.crudMode, CrudMode.EDIT);
|
||||
validate(form, messages -> {}, () -> asEditHtml());
|
||||
verifyToken(() -> asEditHtml());
|
||||
getRoleType(form).ifPresent(
|
||||
entity -> {
|
||||
try {
|
||||
roleTypeService.store(entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
|
||||
} catch (Exception e) {
|
||||
throwValidationError(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e)),
|
||||
() -> asEditHtml());
|
||||
}
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), () -> 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;
|
||||
roleTypeService
|
||||
.getRoleType(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
try {
|
||||
roleTypeService.delete(entity);
|
||||
saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
|
||||
} catch (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<RoleType> getEntity(final CreateForm form, final String username, final long currentTime) {
|
||||
switch (form.crudMode) {
|
||||
case CrudMode.CREATE:
|
||||
return OptionalEntity.of(new RoleType()).map(entity -> {
|
||||
entity.setCreatedBy(username);
|
||||
entity.setCreatedTime(currentTime);
|
||||
return entity;
|
||||
});
|
||||
case CrudMode.EDIT:
|
||||
if (form instanceof EditForm) {
|
||||
return roleTypeService.getRoleType(((EditForm) form).id);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return OptionalEntity.empty();
|
||||
}
|
||||
|
||||
protected OptionalEntity<RoleType> getRoleType(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_AdminRoletype_AdminRoletypeJsp).renderWith(data -> {
|
||||
RenderDataUtil.register(data, "roleTypeItems", roleTypeService.getRoleTypeList(roleTypePager)); // page navi
|
||||
}).useForm(SearchForm.class, setup -> {
|
||||
setup.setup(form -> {
|
||||
copyBeanToBean(roleTypePager, form, op -> op.include("id"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private HtmlResponse asEditHtml() {
|
||||
return asHtml(path_AdminRoletype_AdminRoletypeEditJsp);
|
||||
}
|
||||
|
||||
private HtmlResponse asDetailsHtml() {
|
||||
return asHtml(path_AdminRoletype_AdminRoletypeDetailsJsp);
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* 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.roletype;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.Pattern;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author codelibs
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class CreateForm implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ValidateTypeFailure
|
||||
public Integer crudMode;
|
||||
|
||||
@Required
|
||||
@Size(max = 100)
|
||||
public String name;
|
||||
|
||||
@Required
|
||||
@Size(max = 20)
|
||||
@Pattern(regexp = "^[a-zA-Z0-9_-| ]+$")
|
||||
public String value;
|
||||
|
||||
@Required
|
||||
@Min(value = 0)
|
||||
@Max(value = 2147483647)
|
||||
@ValidateTypeFailure
|
||||
public Integer sortOrder;
|
||||
|
||||
@Required
|
||||
@Size(max = 1000)
|
||||
public String createdBy;
|
||||
|
||||
@Required
|
||||
@ValidateTypeFailure
|
||||
public Long createdTime;
|
||||
|
||||
public void initialize() {
|
||||
crudMode = CrudMode.CREATE;
|
||||
sortOrder = 0;
|
||||
createdBy = ComponentUtil.getSystemHelper().getUsername();
|
||||
createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* 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.roletype;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
/**
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class EditForm extends CreateForm {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Required
|
||||
@Size(max = 1000)
|
||||
public String id;
|
||||
|
||||
@Size(max = 1000)
|
||||
public String updatedBy;
|
||||
|
||||
@ValidateTypeFailure
|
||||
public Long updatedTime;
|
||||
|
||||
@Required
|
||||
@ValidateTypeFailure
|
||||
public Integer versionNo;
|
||||
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* 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.roletype;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author codelibs
|
||||
* @author Keiichi Watanabe
|
||||
*/
|
||||
public class SearchForm implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String id;
|
||||
|
||||
}
|
|
@ -15,8 +15,12 @@
|
|||
*/
|
||||
package org.codelibs.fess.app.web.admin.webconfig;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.WebConfigPager;
|
||||
import org.codelibs.fess.app.service.LabelTypeService;
|
||||
|
@ -26,7 +30,9 @@ import org.codelibs.fess.app.service.WebConfigService;
|
|||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.app.web.base.FessAdminAction;
|
||||
import org.codelibs.fess.es.config.exentity.WebConfig;
|
||||
import org.codelibs.fess.util.PermissionUtil;
|
||||
import org.codelibs.fess.util.RenderDataUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.lastaflute.web.Execute;
|
||||
|
@ -128,11 +134,20 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
public HtmlResponse edit(final EditForm form) {
|
||||
validate(form, messages -> {}, () -> asListHtml());
|
||||
final String id = form.id;
|
||||
webConfigService.getWebConfig(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, op -> {});
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
webConfigService
|
||||
.getWebConfig(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().collect(Collectors.joining("\n"));
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
saveToken();
|
||||
if (form.crudMode.intValue() == CrudMode.EDIT) {
|
||||
// back
|
||||
|
@ -151,18 +166,30 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
public HtmlResponse details(final int crudMode, final String id) {
|
||||
verifyCrudMode(crudMode, CrudMode.DETAILS);
|
||||
saveToken();
|
||||
return asDetailsHtml().useForm(EditForm.class, op -> {
|
||||
op.setup(form -> {
|
||||
webConfigService.getWebConfig(id).ifPresent(entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
return asDetailsHtml().useForm(
|
||||
EditForm.class,
|
||||
op -> {
|
||||
op.setup(form -> {
|
||||
webConfigService
|
||||
.getWebConfig(id)
|
||||
.ifPresent(
|
||||
entity -> {
|
||||
copyBeanToBean(entity, form, copyOp -> {
|
||||
copyOp.excludeNull();
|
||||
copyOp.exclude("permissions");
|
||||
});
|
||||
form.permissions =
|
||||
StreamUtil.of(entity.getPermissions()).map(s -> PermissionUtil.decode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct()
|
||||
.collect(Collectors.joining("\n"));
|
||||
form.crudMode = crudMode;
|
||||
})
|
||||
.orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id),
|
||||
() -> asListHtml());
|
||||
});
|
||||
});
|
||||
form.crudMode = crudMode;
|
||||
}).orElse(() -> {
|
||||
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
|
@ -257,12 +284,19 @@ public class AdminWebconfigAction extends FessAdminAction {
|
|||
protected OptionalEntity<WebConfig> getWebConfig(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;
|
||||
});
|
||||
return getEntity(form, username, currentTime).map(
|
||||
entity -> {
|
||||
entity.setUpdatedBy(username);
|
||||
entity.setUpdatedTime(currentTime);
|
||||
copyBeanToBean(
|
||||
form,
|
||||
entity,
|
||||
op -> op.exclude(Stream.concat(Stream.of(Constants.COMMON_CONVERSION_RULE), Stream.of("permissions")).toArray(
|
||||
n -> new String[n])));
|
||||
entity.setPermissions(StreamUtil.of(form.permissions.split("\n")).map(s -> PermissionUtil.encode(s))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().toArray(n -> new String[n]));
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
||||
protected void registerRolesAndLabels(final RenderData data) {
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.codelibs.core.lang.StringUtil;
|
|||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.web.CrudMode;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.codelibs.fess.validation.UriType;
|
||||
import org.codelibs.fess.validation.UriTypeValidator.ProtocolType;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
|
@ -40,8 +39,6 @@ public class CreateForm implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String[] roleTypeIds;
|
||||
|
||||
public String[] labelTypeIds;
|
||||
|
||||
@ValidateTypeFailure
|
||||
|
@ -105,6 +102,9 @@ public class CreateForm implements Serializable {
|
|||
@Size(max = 5)
|
||||
public String available;
|
||||
|
||||
@Size(max = 4000)
|
||||
public String permissions;
|
||||
|
||||
@Required
|
||||
@Min(value = 0)
|
||||
@Max(value = 2147483647)
|
||||
|
@ -130,9 +130,6 @@ public class CreateForm implements Serializable {
|
|||
sortOrder = 0;
|
||||
createdBy = ComponentUtil.getSystemHelper().getUsername();
|
||||
createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
|
||||
final String roles = ComponentUtil.getFessConfig().getSearchDefaultRoles();
|
||||
if (StringUtil.isNotBlank(roles)) {
|
||||
roleTypeIds = StreamUtil.of(roles.split(",")).map(role -> role.trim()).toArray(n -> new String[n]);
|
||||
}
|
||||
permissions = ComponentUtil.getFessConfig().getSearchDefaultDisplayPermission();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import org.codelibs.fess.es.config.exentity.ScheduledJob;
|
|||
import org.codelibs.fess.es.config.exentity.WebConfig;
|
||||
import org.codelibs.fess.helper.ProcessHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.lastaflute.job.JobManager;
|
||||
import org.lastaflute.job.key.LaJobUnique;
|
||||
import org.lastaflute.web.Execute;
|
||||
|
@ -174,10 +173,7 @@ public class AdminWizardAction extends FessAdminAction {
|
|||
wConfig.setUpdatedTime(now);
|
||||
wConfig.setUrls(configPath);
|
||||
wConfig.setUserAgent(getDefaultString("default.config.web.userAgent", ComponentUtil.getUserAgentName()));
|
||||
final String roles = ComponentUtil.getFessConfig().getSearchDefaultRoles();
|
||||
if (StringUtil.isNotBlank(roles)) {
|
||||
wConfig.setRoleTypeIds(StreamUtil.of(roles.split(",")).map(role -> role.trim()).toArray(n -> new String[n]));
|
||||
}
|
||||
wConfig.setPermissions(ComponentUtil.getFessConfig().getSearchDefaultPermissionsAsArray());
|
||||
|
||||
webConfigService.store(wConfig);
|
||||
|
||||
|
@ -205,10 +201,7 @@ public class AdminWizardAction extends FessAdminAction {
|
|||
fConfig.setUpdatedBy(username);
|
||||
fConfig.setUpdatedTime(now);
|
||||
fConfig.setPaths(configPath);
|
||||
final String roles = ComponentUtil.getFessConfig().getSearchDefaultRoles();
|
||||
if (StringUtil.isNotBlank(roles)) {
|
||||
fConfig.setRoleTypeIds(StreamUtil.of(roles.split(",")).map(role -> role.trim()).toArray(n -> new String[n]));
|
||||
}
|
||||
fConfig.setPermissions(ComponentUtil.getFessConfig().getSearchDefaultPermissionsAsArray());
|
||||
|
||||
fileConfigService.store(fConfig);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ import org.codelibs.fess.helper.SambaHelper;
|
|||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.DocumentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -73,10 +74,7 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
final Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
dataMap.put(fessConfig.getIndexFieldUrl(), url);
|
||||
final List<String> roleTypeList = new ArrayList<String>();
|
||||
final String[] roleTypeValues = crawlingConfig.getRoleTypeValues();
|
||||
for (final String roleType : roleTypeValues) {
|
||||
roleTypeList.add(roleType);
|
||||
}
|
||||
StreamUtil.of(crawlingConfig.getPermissions()).forEach(p -> roleTypeList.add(p));
|
||||
if (url.startsWith("smb://")) {
|
||||
if (url.endsWith("/")) {
|
||||
// directory
|
||||
|
|
|
@ -59,6 +59,7 @@ import org.codelibs.fess.helper.SambaHelper;
|
|||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -294,9 +295,7 @@ public abstract class AbstractFessFileTransformer extends AbstractTransformer im
|
|||
putResultDataBody(dataMap, fessConfig.getIndexFieldLabel(), labelTypeSet);
|
||||
// role: roleType
|
||||
final List<String> roleTypeList = getRoleTypes(responseData);
|
||||
for (final String roleType : crawlingConfig.getRoleTypeValues()) {
|
||||
roleTypeList.add(roleType);
|
||||
}
|
||||
StreamUtil.of(crawlingConfig.getPermissions()).forEach(p -> roleTypeList.add(p));
|
||||
putResultDataBody(dataMap, fessConfig.getIndexFieldRole(), roleTypeList);
|
||||
// TODO date
|
||||
// lang
|
||||
|
|
|
@ -59,6 +59,7 @@ import org.codelibs.fess.helper.PathMappingHelper;
|
|||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.cyberneko.html.parsers.DOMParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -286,9 +287,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
putResultDataBody(dataMap, fessConfig.getIndexFieldLabel(), labelTypeSet);
|
||||
// role: roleType
|
||||
final List<String> roleTypeList = new ArrayList<String>();
|
||||
for (final String roleType : crawlingConfig.getRoleTypeValues()) {
|
||||
roleTypeList.add(roleType);
|
||||
}
|
||||
StreamUtil.of(crawlingConfig.getPermissions()).forEach(p -> roleTypeList.add(p));
|
||||
putResultDataBody(dataMap, fessConfig.getIndexFieldRole(), roleTypeList);
|
||||
// id
|
||||
putResultDataBody(dataMap, fessConfig.getIndexFieldId(), crawlingInfoHelper.generateId(dataMap));
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.codelibs.fess.helper.SystemHelper;
|
|||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.GroovyUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -85,9 +86,7 @@ public abstract class AbstractDataStoreImpl implements DataStore {
|
|||
defaultDataMap.put(fessConfig.getIndexFieldLabel(), labelTypeList);
|
||||
// role: roleType
|
||||
final List<String> roleTypeList = new ArrayList<String>();
|
||||
for (final String roleType : config.getRoleTypeValues()) {
|
||||
roleTypeList.add(roleType);
|
||||
}
|
||||
StreamUtil.of(config.getPermissions()).forEach(p -> roleTypeList.add(p));
|
||||
defaultDataMap.put(fessConfig.getIndexFieldRole(), roleTypeList);
|
||||
// mimetype
|
||||
defaultDataMap.put(fessConfig.getIndexFieldMimetype(), mimeType);
|
||||
|
|
|
@ -25,4 +25,5 @@ public interface FessUser extends Serializable {
|
|||
|
||||
String[] getGroupNames();
|
||||
|
||||
String[] getPermissions();
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ public abstract class BsDataConfigBhv extends EsAbstractBehavior<DataConfig, Dat
|
|||
result.setHandlerParameter(DfTypeUtil.toString(source.get("handlerParameter")));
|
||||
result.setHandlerScript(DfTypeUtil.toString(source.get("handlerScript")));
|
||||
result.setName(DfTypeUtil.toString(source.get("name")));
|
||||
result.setPermissions(toStringArray(source.get("permissions")));
|
||||
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
|
||||
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
|
||||
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
|
||||
|
|
|
@ -90,6 +90,7 @@ public abstract class BsFileConfigBhv extends EsAbstractBehavior<FileConfig, Fil
|
|||
result.setName(DfTypeUtil.toString(source.get("name")));
|
||||
result.setNumOfThread(DfTypeUtil.toInteger(source.get("numOfThread")));
|
||||
result.setPaths(DfTypeUtil.toString(source.get("paths")));
|
||||
result.setPermissions(toStringArray(source.get("permissions")));
|
||||
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
|
||||
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
|
||||
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
|
||||
|
|
|
@ -79,6 +79,7 @@ public abstract class BsLabelTypeBhv extends EsAbstractBehavior<LabelType, Label
|
|||
result.setExcludedPaths(DfTypeUtil.toString(source.get("excludedPaths")));
|
||||
result.setIncludedPaths(DfTypeUtil.toString(source.get("includedPaths")));
|
||||
result.setName(DfTypeUtil.toString(source.get("name")));
|
||||
result.setPermissions(toStringArray(source.get("permissions")));
|
||||
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
|
||||
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
|
||||
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
|
||||
|
|
|
@ -89,6 +89,7 @@ public abstract class BsWebConfigBhv extends EsAbstractBehavior<WebConfig, WebCo
|
|||
result.setMaxAccessCount(DfTypeUtil.toLong(source.get("maxAccessCount")));
|
||||
result.setName(DfTypeUtil.toString(source.get("name")));
|
||||
result.setNumOfThread(DfTypeUtil.toInteger(source.get("numOfThread")));
|
||||
result.setPermissions(toStringArray(source.get("permissions")));
|
||||
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
|
||||
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
|
||||
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
|
||||
|
|
|
@ -61,6 +61,9 @@ public class BsDataConfig extends EsAbstractEntity {
|
|||
/** name */
|
||||
protected String name;
|
||||
|
||||
/** permissions */
|
||||
protected String[] permissions;
|
||||
|
||||
/** sortOrder */
|
||||
protected Integer sortOrder;
|
||||
|
||||
|
@ -115,6 +118,9 @@ public class BsDataConfig extends EsAbstractEntity {
|
|||
if (name != null) {
|
||||
sourceMap.put("name", name);
|
||||
}
|
||||
if (permissions != null) {
|
||||
sourceMap.put("permissions", permissions);
|
||||
}
|
||||
if (sortOrder != null) {
|
||||
sourceMap.put("sortOrder", sortOrder);
|
||||
}
|
||||
|
@ -141,6 +147,7 @@ public class BsDataConfig extends EsAbstractEntity {
|
|||
sb.append(dm).append(handlerParameter);
|
||||
sb.append(dm).append(handlerScript);
|
||||
sb.append(dm).append(name);
|
||||
sb.append(dm).append(permissions);
|
||||
sb.append(dm).append(sortOrder);
|
||||
sb.append(dm).append(updatedBy);
|
||||
sb.append(dm).append(updatedTime);
|
||||
|
@ -234,6 +241,16 @@ public class BsDataConfig extends EsAbstractEntity {
|
|||
this.name = value;
|
||||
}
|
||||
|
||||
public String[] getPermissions() {
|
||||
checkSpecifiedProperty("permissions");
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(String[] value) {
|
||||
registerModifiedProperty("permissions");
|
||||
this.permissions = value;
|
||||
}
|
||||
|
||||
public Integer getSortOrder() {
|
||||
checkSpecifiedProperty("sortOrder");
|
||||
return sortOrder;
|
||||
|
|
|
@ -85,6 +85,9 @@ public class BsFileConfig extends EsAbstractEntity {
|
|||
/** paths */
|
||||
protected String paths;
|
||||
|
||||
/** permissions */
|
||||
protected String[] permissions;
|
||||
|
||||
/** sortOrder */
|
||||
protected Integer sortOrder;
|
||||
|
||||
|
@ -163,6 +166,9 @@ public class BsFileConfig extends EsAbstractEntity {
|
|||
if (paths != null) {
|
||||
sourceMap.put("paths", paths);
|
||||
}
|
||||
if (permissions != null) {
|
||||
sourceMap.put("permissions", permissions);
|
||||
}
|
||||
if (sortOrder != null) {
|
||||
sourceMap.put("sortOrder", sortOrder);
|
||||
}
|
||||
|
@ -197,6 +203,7 @@ public class BsFileConfig extends EsAbstractEntity {
|
|||
sb.append(dm).append(name);
|
||||
sb.append(dm).append(numOfThread);
|
||||
sb.append(dm).append(paths);
|
||||
sb.append(dm).append(permissions);
|
||||
sb.append(dm).append(sortOrder);
|
||||
sb.append(dm).append(updatedBy);
|
||||
sb.append(dm).append(updatedTime);
|
||||
|
@ -370,6 +377,16 @@ public class BsFileConfig extends EsAbstractEntity {
|
|||
this.paths = value;
|
||||
}
|
||||
|
||||
public String[] getPermissions() {
|
||||
checkSpecifiedProperty("permissions");
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(String[] value) {
|
||||
registerModifiedProperty("permissions");
|
||||
this.permissions = value;
|
||||
}
|
||||
|
||||
public Integer getSortOrder() {
|
||||
checkSpecifiedProperty("sortOrder");
|
||||
return sortOrder;
|
||||
|
|
|
@ -52,6 +52,9 @@ public class BsLabelType extends EsAbstractEntity {
|
|||
/** name */
|
||||
protected String name;
|
||||
|
||||
/** permissions */
|
||||
protected String[] permissions;
|
||||
|
||||
/** sortOrder */
|
||||
protected Integer sortOrder;
|
||||
|
||||
|
@ -100,6 +103,9 @@ public class BsLabelType extends EsAbstractEntity {
|
|||
if (name != null) {
|
||||
sourceMap.put("name", name);
|
||||
}
|
||||
if (permissions != null) {
|
||||
sourceMap.put("permissions", permissions);
|
||||
}
|
||||
if (sortOrder != null) {
|
||||
sourceMap.put("sortOrder", sortOrder);
|
||||
}
|
||||
|
@ -126,6 +132,7 @@ public class BsLabelType extends EsAbstractEntity {
|
|||
sb.append(dm).append(excludedPaths);
|
||||
sb.append(dm).append(includedPaths);
|
||||
sb.append(dm).append(name);
|
||||
sb.append(dm).append(permissions);
|
||||
sb.append(dm).append(sortOrder);
|
||||
sb.append(dm).append(updatedBy);
|
||||
sb.append(dm).append(updatedTime);
|
||||
|
@ -190,6 +197,16 @@ public class BsLabelType extends EsAbstractEntity {
|
|||
this.name = value;
|
||||
}
|
||||
|
||||
public String[] getPermissions() {
|
||||
checkSpecifiedProperty("permissions");
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(String[] value) {
|
||||
registerModifiedProperty("permissions");
|
||||
this.permissions = value;
|
||||
}
|
||||
|
||||
public Integer getSortOrder() {
|
||||
checkSpecifiedProperty("sortOrder");
|
||||
return sortOrder;
|
||||
|
|
|
@ -82,6 +82,9 @@ public class BsWebConfig extends EsAbstractEntity {
|
|||
/** numOfThread */
|
||||
protected Integer numOfThread;
|
||||
|
||||
/** permissions */
|
||||
protected String[] permissions;
|
||||
|
||||
/** sortOrder */
|
||||
protected Integer sortOrder;
|
||||
|
||||
|
@ -163,6 +166,9 @@ public class BsWebConfig extends EsAbstractEntity {
|
|||
if (numOfThread != null) {
|
||||
sourceMap.put("numOfThread", numOfThread);
|
||||
}
|
||||
if (permissions != null) {
|
||||
sourceMap.put("permissions", permissions);
|
||||
}
|
||||
if (sortOrder != null) {
|
||||
sourceMap.put("sortOrder", sortOrder);
|
||||
}
|
||||
|
@ -202,6 +208,7 @@ public class BsWebConfig extends EsAbstractEntity {
|
|||
sb.append(dm).append(maxAccessCount);
|
||||
sb.append(dm).append(name);
|
||||
sb.append(dm).append(numOfThread);
|
||||
sb.append(dm).append(permissions);
|
||||
sb.append(dm).append(sortOrder);
|
||||
sb.append(dm).append(updatedBy);
|
||||
sb.append(dm).append(updatedTime);
|
||||
|
@ -367,6 +374,16 @@ public class BsWebConfig extends EsAbstractEntity {
|
|||
this.numOfThread = value;
|
||||
}
|
||||
|
||||
public String[] getPermissions() {
|
||||
checkSpecifiedProperty("permissions");
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(String[] value) {
|
||||
registerModifiedProperty("permissions");
|
||||
this.permissions = value;
|
||||
}
|
||||
|
||||
public Integer getSortOrder() {
|
||||
checkSpecifiedProperty("sortOrder");
|
||||
return sortOrder;
|
||||
|
|
|
@ -93,6 +93,8 @@ public class DataConfigDbm extends AbstractDBMeta {
|
|||
setupEpg(_epgMap, et -> ((DataConfig) et).getHandlerScript(),
|
||||
(et, vl) -> ((DataConfig) et).setHandlerScript(DfTypeUtil.toString(vl)), "handlerScript");
|
||||
setupEpg(_epgMap, et -> ((DataConfig) et).getName(), (et, vl) -> ((DataConfig) et).setName(DfTypeUtil.toString(vl)), "name");
|
||||
setupEpg(_epgMap, et -> ((DataConfig) et).getPermissions(), (et, vl) -> ((DataConfig) et).setPermissions((String[]) vl),
|
||||
"permissions");
|
||||
setupEpg(_epgMap, et -> ((DataConfig) et).getSortOrder(), (et, vl) -> ((DataConfig) et).setSortOrder(DfTypeUtil.toInteger(vl)),
|
||||
"sortOrder");
|
||||
setupEpg(_epgMap, et -> ((DataConfig) et).getUpdatedBy(), (et, vl) -> ((DataConfig) et).setUpdatedBy(DfTypeUtil.toString(vl)),
|
||||
|
@ -151,6 +153,8 @@ public class DataConfigDbm extends AbstractDBMeta {
|
|||
null, false, false, false, "String", 0, 0, null, false, null, null, null, null, null, false);
|
||||
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 _columnPermissions = cci("permissions", "permissions", null, null, String[].class, "permissions", null,
|
||||
false, false, false, "String", 0, 0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnSortOrder = cci("sortOrder", "sortOrder", null, null, Integer.class, "sortOrder", null, false, false,
|
||||
false, "Integer", 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,
|
||||
|
@ -190,6 +194,10 @@ public class DataConfigDbm extends AbstractDBMeta {
|
|||
return _columnName;
|
||||
}
|
||||
|
||||
public ColumnInfo columnPermissions() {
|
||||
return _columnPermissions;
|
||||
}
|
||||
|
||||
public ColumnInfo columnSortOrder() {
|
||||
return _columnSortOrder;
|
||||
}
|
||||
|
@ -212,6 +220,7 @@ public class DataConfigDbm extends AbstractDBMeta {
|
|||
ls.add(columnHandlerParameter());
|
||||
ls.add(columnHandlerScript());
|
||||
ls.add(columnName());
|
||||
ls.add(columnPermissions());
|
||||
ls.add(columnSortOrder());
|
||||
ls.add(columnUpdatedBy());
|
||||
ls.add(columnUpdatedTime());
|
||||
|
|
|
@ -107,6 +107,8 @@ public class FileConfigDbm extends AbstractDBMeta {
|
|||
setupEpg(_epgMap, et -> ((FileConfig) et).getNumOfThread(), (et, vl) -> ((FileConfig) et).setNumOfThread(DfTypeUtil.toInteger(vl)),
|
||||
"numOfThread");
|
||||
setupEpg(_epgMap, et -> ((FileConfig) et).getPaths(), (et, vl) -> ((FileConfig) et).setPaths(DfTypeUtil.toString(vl)), "paths");
|
||||
setupEpg(_epgMap, et -> ((FileConfig) et).getPermissions(), (et, vl) -> ((FileConfig) et).setPermissions((String[]) vl),
|
||||
"permissions");
|
||||
setupEpg(_epgMap, et -> ((FileConfig) et).getSortOrder(), (et, vl) -> ((FileConfig) et).setSortOrder(DfTypeUtil.toInteger(vl)),
|
||||
"sortOrder");
|
||||
setupEpg(_epgMap, et -> ((FileConfig) et).getUpdatedBy(), (et, vl) -> ((FileConfig) et).setUpdatedBy(DfTypeUtil.toString(vl)),
|
||||
|
@ -181,6 +183,8 @@ public class FileConfigDbm extends AbstractDBMeta {
|
|||
false, false, false, "Integer", 0, 0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnPaths = cci("paths", "paths", null, null, String.class, "paths", null, false, false, false, "String",
|
||||
0, 0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnPermissions = cci("permissions", "permissions", null, null, String[].class, "permissions", null,
|
||||
false, false, false, "String", 0, 0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnSortOrder = cci("sortOrder", "sortOrder", null, null, Integer.class, "sortOrder", null, false, false,
|
||||
false, "Integer", 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,
|
||||
|
@ -252,6 +256,10 @@ public class FileConfigDbm extends AbstractDBMeta {
|
|||
return _columnPaths;
|
||||
}
|
||||
|
||||
public ColumnInfo columnPermissions() {
|
||||
return _columnPermissions;
|
||||
}
|
||||
|
||||
public ColumnInfo columnSortOrder() {
|
||||
return _columnSortOrder;
|
||||
}
|
||||
|
@ -282,6 +290,7 @@ public class FileConfigDbm extends AbstractDBMeta {
|
|||
ls.add(columnName());
|
||||
ls.add(columnNumOfThread());
|
||||
ls.add(columnPaths());
|
||||
ls.add(columnPermissions());
|
||||
ls.add(columnSortOrder());
|
||||
ls.add(columnUpdatedBy());
|
||||
ls.add(columnUpdatedTime());
|
||||
|
|
|
@ -88,6 +88,8 @@ public class LabelTypeDbm extends AbstractDBMeta {
|
|||
setupEpg(_epgMap, et -> ((LabelType) et).getIncludedPaths(),
|
||||
(et, vl) -> ((LabelType) et).setIncludedPaths(DfTypeUtil.toString(vl)), "includedPaths");
|
||||
setupEpg(_epgMap, et -> ((LabelType) et).getName(), (et, vl) -> ((LabelType) et).setName(DfTypeUtil.toString(vl)), "name");
|
||||
setupEpg(_epgMap, et -> ((LabelType) et).getPermissions(), (et, vl) -> ((LabelType) et).setPermissions((String[]) vl),
|
||||
"permissions");
|
||||
setupEpg(_epgMap, et -> ((LabelType) et).getSortOrder(), (et, vl) -> ((LabelType) et).setSortOrder(DfTypeUtil.toInteger(vl)),
|
||||
"sortOrder");
|
||||
setupEpg(_epgMap, et -> ((LabelType) et).getUpdatedBy(), (et, vl) -> ((LabelType) et).setUpdatedBy(DfTypeUtil.toString(vl)),
|
||||
|
@ -141,6 +143,8 @@ public class LabelTypeDbm extends AbstractDBMeta {
|
|||
null, false, false, false, "String", 0, 0, null, false, null, null, null, null, null, false);
|
||||
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 _columnPermissions = cci("permissions", "permissions", null, null, String[].class, "permissions", null,
|
||||
false, false, false, "String", 0, 0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnSortOrder = cci("sortOrder", "sortOrder", null, null, Integer.class, "sortOrder", null, false, false,
|
||||
false, "Integer", 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,
|
||||
|
@ -170,6 +174,10 @@ public class LabelTypeDbm extends AbstractDBMeta {
|
|||
return _columnName;
|
||||
}
|
||||
|
||||
public ColumnInfo columnPermissions() {
|
||||
return _columnPermissions;
|
||||
}
|
||||
|
||||
public ColumnInfo columnSortOrder() {
|
||||
return _columnSortOrder;
|
||||
}
|
||||
|
@ -193,6 +201,7 @@ public class LabelTypeDbm extends AbstractDBMeta {
|
|||
ls.add(columnExcludedPaths());
|
||||
ls.add(columnIncludedPaths());
|
||||
ls.add(columnName());
|
||||
ls.add(columnPermissions());
|
||||
ls.add(columnSortOrder());
|
||||
ls.add(columnUpdatedBy());
|
||||
ls.add(columnUpdatedTime());
|
||||
|
|
|
@ -106,6 +106,8 @@ public class WebConfigDbm extends AbstractDBMeta {
|
|||
setupEpg(_epgMap, et -> ((WebConfig) et).getName(), (et, vl) -> ((WebConfig) et).setName(DfTypeUtil.toString(vl)), "name");
|
||||
setupEpg(_epgMap, et -> ((WebConfig) et).getNumOfThread(), (et, vl) -> ((WebConfig) et).setNumOfThread(DfTypeUtil.toInteger(vl)),
|
||||
"numOfThread");
|
||||
setupEpg(_epgMap, et -> ((WebConfig) et).getPermissions(), (et, vl) -> ((WebConfig) et).setPermissions((String[]) vl),
|
||||
"permissions");
|
||||
setupEpg(_epgMap, et -> ((WebConfig) et).getSortOrder(), (et, vl) -> ((WebConfig) et).setSortOrder(DfTypeUtil.toInteger(vl)),
|
||||
"sortOrder");
|
||||
setupEpg(_epgMap, et -> ((WebConfig) et).getUpdatedBy(), (et, vl) -> ((WebConfig) et).setUpdatedBy(DfTypeUtil.toString(vl)),
|
||||
|
@ -181,6 +183,8 @@ public class WebConfigDbm extends AbstractDBMeta {
|
|||
0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnNumOfThread = cci("numOfThread", "numOfThread", null, null, Integer.class, "numOfThread", null,
|
||||
false, false, false, "Integer", 0, 0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnPermissions = cci("permissions", "permissions", null, null, String[].class, "permissions", null,
|
||||
false, false, false, "String", 0, 0, null, false, null, null, null, null, null, false);
|
||||
protected final ColumnInfo _columnSortOrder = cci("sortOrder", "sortOrder", null, null, Integer.class, "sortOrder", null, false, false,
|
||||
false, "Integer", 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,
|
||||
|
@ -252,6 +256,10 @@ public class WebConfigDbm extends AbstractDBMeta {
|
|||
return _columnNumOfThread;
|
||||
}
|
||||
|
||||
public ColumnInfo columnPermissions() {
|
||||
return _columnPermissions;
|
||||
}
|
||||
|
||||
public ColumnInfo columnSortOrder() {
|
||||
return _columnSortOrder;
|
||||
}
|
||||
|
@ -289,6 +297,7 @@ public class WebConfigDbm extends AbstractDBMeta {
|
|||
ls.add(columnMaxAccessCount());
|
||||
ls.add(columnName());
|
||||
ls.add(columnNumOfThread());
|
||||
ls.add(columnPermissions());
|
||||
ls.add(columnSortOrder());
|
||||
ls.add(columnUpdatedBy());
|
||||
ls.add(columnUpdatedTime());
|
||||
|
|
|
@ -190,6 +190,10 @@ public class BsDataConfigCB extends EsAbstractConditionBean {
|
|||
doColumn("name");
|
||||
}
|
||||
|
||||
public void columnPermissions() {
|
||||
doColumn("permissions");
|
||||
}
|
||||
|
||||
public void columnSortOrder() {
|
||||
doColumn("sortOrder");
|
||||
}
|
||||
|
|
|
@ -222,6 +222,10 @@ public class BsFileConfigCB extends EsAbstractConditionBean {
|
|||
doColumn("paths");
|
||||
}
|
||||
|
||||
public void columnPermissions() {
|
||||
doColumn("permissions");
|
||||
}
|
||||
|
||||
public void columnSortOrder() {
|
||||
doColumn("sortOrder");
|
||||
}
|
||||
|
|
|
@ -178,6 +178,10 @@ public class BsLabelTypeCB extends EsAbstractConditionBean {
|
|||
doColumn("name");
|
||||
}
|
||||
|
||||
public void columnPermissions() {
|
||||
doColumn("permissions");
|
||||
}
|
||||
|
||||
public void columnSortOrder() {
|
||||
doColumn("sortOrder");
|
||||
}
|
||||
|
|
|
@ -218,6 +218,10 @@ public class BsWebConfigCB extends EsAbstractConditionBean {
|
|||
doColumn("numOfThread");
|
||||
}
|
||||
|
||||
public void columnPermissions() {
|
||||
doColumn("permissions");
|
||||
}
|
||||
|
||||
public void columnSortOrder() {
|
||||
doColumn("sortOrder");
|
||||
}
|
||||
|
|
|
@ -1470,6 +1470,172 @@ public abstract class BsDataConfigCQ extends EsAbstractConditionQuery {
|
|||
return this;
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
setPermissions_Term(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
TermQueryBuilder builder = regTermQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
setPermissions_NotTerm(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
NotQueryBuilder builder = QueryBuilders.notQuery(regTermQ("permissions", permissions));
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
TermsQueryBuilder builder = regTermsQ("permissions", permissionsList);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
setPermissions_Terms(permissionsList, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions) {
|
||||
setPermissions_Match(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions) {
|
||||
setPermissions_MatchPhrase(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhraseQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions) {
|
||||
setPermissions_MatchPhrasePrefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhrasePrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions) {
|
||||
setPermissions_Fuzzy(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
|
||||
FuzzyQueryBuilder builder = regFuzzyQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions) {
|
||||
setPermissions_Prefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
|
||||
PrefixQueryBuilder builder = regPrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions) {
|
||||
setPermissions_GreaterThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions) {
|
||||
setPermissions_LessThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions) {
|
||||
setPermissions_GreaterEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions) {
|
||||
setPermissions_LessEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public BsDataConfigCQ addOrderBy_Permissions_Asc() {
|
||||
regOBA("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public BsDataConfigCQ addOrderBy_Permissions_Desc() {
|
||||
regOBD("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSortOrder_Equal(Integer sortOrder) {
|
||||
setSortOrder_Term(sortOrder, null);
|
||||
}
|
||||
|
|
|
@ -2743,6 +2743,172 @@ public abstract class BsFileConfigCQ extends EsAbstractConditionQuery {
|
|||
return this;
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
setPermissions_Term(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
TermQueryBuilder builder = regTermQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
setPermissions_NotTerm(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
NotQueryBuilder builder = QueryBuilders.notQuery(regTermQ("permissions", permissions));
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
TermsQueryBuilder builder = regTermsQ("permissions", permissionsList);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
setPermissions_Terms(permissionsList, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions) {
|
||||
setPermissions_Match(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions) {
|
||||
setPermissions_MatchPhrase(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhraseQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions) {
|
||||
setPermissions_MatchPhrasePrefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhrasePrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions) {
|
||||
setPermissions_Fuzzy(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
|
||||
FuzzyQueryBuilder builder = regFuzzyQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions) {
|
||||
setPermissions_Prefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
|
||||
PrefixQueryBuilder builder = regPrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions) {
|
||||
setPermissions_GreaterThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions) {
|
||||
setPermissions_LessThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions) {
|
||||
setPermissions_GreaterEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions) {
|
||||
setPermissions_LessEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public BsFileConfigCQ addOrderBy_Permissions_Asc() {
|
||||
regOBA("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public BsFileConfigCQ addOrderBy_Permissions_Desc() {
|
||||
regOBD("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSortOrder_Equal(Integer sortOrder) {
|
||||
setSortOrder_Term(sortOrder, null);
|
||||
}
|
||||
|
|
|
@ -994,6 +994,172 @@ public abstract class BsLabelTypeCQ extends EsAbstractConditionQuery {
|
|||
return this;
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
setPermissions_Term(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
TermQueryBuilder builder = regTermQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
setPermissions_NotTerm(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
NotQueryBuilder builder = QueryBuilders.notQuery(regTermQ("permissions", permissions));
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
TermsQueryBuilder builder = regTermsQ("permissions", permissionsList);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
setPermissions_Terms(permissionsList, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions) {
|
||||
setPermissions_Match(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions) {
|
||||
setPermissions_MatchPhrase(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhraseQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions) {
|
||||
setPermissions_MatchPhrasePrefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhrasePrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions) {
|
||||
setPermissions_Fuzzy(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
|
||||
FuzzyQueryBuilder builder = regFuzzyQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions) {
|
||||
setPermissions_Prefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
|
||||
PrefixQueryBuilder builder = regPrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions) {
|
||||
setPermissions_GreaterThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions) {
|
||||
setPermissions_LessThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions) {
|
||||
setPermissions_GreaterEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions) {
|
||||
setPermissions_LessEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public BsLabelTypeCQ addOrderBy_Permissions_Asc() {
|
||||
regOBA("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public BsLabelTypeCQ addOrderBy_Permissions_Desc() {
|
||||
regOBD("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSortOrder_Equal(Integer sortOrder) {
|
||||
setSortOrder_Term(sortOrder, null);
|
||||
}
|
||||
|
|
|
@ -2577,6 +2577,172 @@ public abstract class BsWebConfigCQ extends EsAbstractConditionQuery {
|
|||
return this;
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Equal(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
setPermissions_Term(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions) {
|
||||
setPermissions_Term(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Term(String permissions, ConditionOptionCall<TermQueryBuilder> opLambda) {
|
||||
TermQueryBuilder builder = regTermQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotEqual(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
setPermissions_NotTerm(permissions, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions) {
|
||||
setPermissions_NotTerm(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_NotTerm(String permissions, ConditionOptionCall<NotQueryBuilder> opLambda) {
|
||||
NotQueryBuilder builder = QueryBuilders.notQuery(regTermQ("permissions", permissions));
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Terms(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
TermsQueryBuilder builder = regTermsQ("permissions", permissionsList);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList) {
|
||||
setPermissions_Terms(permissionsList, null);
|
||||
}
|
||||
|
||||
public void setPermissions_InScope(Collection<String> permissionsList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
|
||||
setPermissions_Terms(permissionsList, opLambda);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions) {
|
||||
setPermissions_Match(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Match(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions) {
|
||||
setPermissions_MatchPhrase(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrase(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhraseQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions) {
|
||||
setPermissions_MatchPhrasePrefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_MatchPhrasePrefix(String permissions, ConditionOptionCall<MatchQueryBuilder> opLambda) {
|
||||
MatchQueryBuilder builder = regMatchPhrasePrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions) {
|
||||
setPermissions_Fuzzy(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Fuzzy(String permissions, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
|
||||
FuzzyQueryBuilder builder = regFuzzyQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions) {
|
||||
setPermissions_Prefix(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_Prefix(String permissions, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
|
||||
PrefixQueryBuilder builder = regPrefixQ("permissions", permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions) {
|
||||
setPermissions_GreaterThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions) {
|
||||
setPermissions_LessThan(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessThan(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_THAN, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions) {
|
||||
setPermissions_GreaterEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_GreaterEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_GREATER_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions) {
|
||||
setPermissions_LessEqual(permissions, null);
|
||||
}
|
||||
|
||||
public void setPermissions_LessEqual(String permissions, ConditionOptionCall<RangeQueryBuilder> opLambda) {
|
||||
RangeQueryBuilder builder = regRangeQ("permissions", ConditionKey.CK_LESS_EQUAL, permissions);
|
||||
if (opLambda != null) {
|
||||
opLambda.callback(builder);
|
||||
}
|
||||
}
|
||||
|
||||
public BsWebConfigCQ addOrderBy_Permissions_Asc() {
|
||||
regOBA("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public BsWebConfigCQ addOrderBy_Permissions_Desc() {
|
||||
regOBD("permissions");
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSortOrder_Equal(Integer sortOrder) {
|
||||
setSortOrder_Term(sortOrder, null);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public interface CrawlingConfig {
|
|||
|
||||
String getName();
|
||||
|
||||
String[] getRoleTypeValues();
|
||||
String[] getPermissions();
|
||||
|
||||
String[] getLabelTypeValues();
|
||||
|
||||
|
|
|
@ -42,9 +42,7 @@ import org.codelibs.fess.crawler.client.smb.SmbAuthentication;
|
|||
import org.codelibs.fess.crawler.client.smb.SmbClient;
|
||||
import org.codelibs.fess.es.config.bsentity.BsDataConfig;
|
||||
import org.codelibs.fess.es.config.exbhv.DataConfigToLabelBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.DataConfigToRoleBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.LabelTypeBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.RoleTypeBhv;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.ParameterUtil;
|
||||
|
@ -73,8 +71,6 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
|
|||
|
||||
private String[] labelTypeIds;
|
||||
|
||||
private String[] roleTypeIds;
|
||||
|
||||
protected Pattern[] includedDocPathPatterns;
|
||||
|
||||
protected Pattern[] excludedDocPathPatterns;
|
||||
|
@ -85,8 +81,6 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
|
|||
|
||||
private volatile List<LabelType> labelTypeList;
|
||||
|
||||
private volatile List<RoleType> roleTypeList;
|
||||
|
||||
public DataConfig() {
|
||||
super();
|
||||
setBoost(1.0f);
|
||||
|
@ -140,54 +134,6 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
|
|||
return labelValueList.toArray(new String[labelValueList.size()]);
|
||||
}
|
||||
|
||||
public String[] getRoleTypeIds() {
|
||||
if (roleTypeIds == null) {
|
||||
return StringUtil.EMPTY_STRINGS;
|
||||
}
|
||||
return roleTypeIds;
|
||||
}
|
||||
|
||||
public void setRoleTypeIds(final String[] roleTypeIds) {
|
||||
this.roleTypeIds = roleTypeIds;
|
||||
}
|
||||
|
||||
public List<RoleType> getRoleTypeList() {
|
||||
if (roleTypeList == null) {
|
||||
synchronized (this) {
|
||||
if (roleTypeList == null) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
final DataConfigToRoleBhv dataConfigToRoleBhv = ComponentUtil.getComponent(DataConfigToRoleBhv.class);
|
||||
final ListResultBean<DataConfigToRole> mappingList = dataConfigToRoleBhv.selectList(cb -> {
|
||||
cb.query().setDataConfigId_Equal(getId());
|
||||
cb.specify().columnRoleTypeId();
|
||||
cb.paging(fessConfig.getPageRoletypeMaxFetchSizeAsInteger().intValue(), 1);
|
||||
});
|
||||
final List<String> roleIdList = new ArrayList<>();
|
||||
for (final DataConfigToRole mapping : mappingList) {
|
||||
roleIdList.add(mapping.getRoleTypeId());
|
||||
}
|
||||
final RoleTypeBhv roleTypeBhv = ComponentUtil.getComponent(RoleTypeBhv.class);
|
||||
roleTypeList = roleIdList.isEmpty() ? Collections.emptyList() : roleTypeBhv.selectList(cb -> {
|
||||
cb.query().setId_InScope(roleIdList);
|
||||
cb.query().addOrderBy_SortOrder_Asc();
|
||||
cb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return roleTypeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getRoleTypeValues() {
|
||||
final List<RoleType> list = getRoleTypeList();
|
||||
final List<String> roleValueList = new ArrayList<>(list.size());
|
||||
for (final RoleType roleType : list) {
|
||||
roleValueList.add(roleType.getValue());
|
||||
}
|
||||
return roleValueList.toArray(new String[roleValueList.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDocumentBoost() {
|
||||
return Float.valueOf(getBoost().floatValue()).toString();
|
||||
|
@ -420,12 +366,10 @@ public class DataConfig extends BsDataConfig implements CrawlingConfig {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DataConfig [labelTypeIds=" + Arrays.toString(labelTypeIds) + ", roleTypeIds=" + Arrays.toString(roleTypeIds)
|
||||
+ ", includedDocPathPatterns=" + Arrays.toString(includedDocPathPatterns) + ", excludedDocPathPatterns="
|
||||
+ Arrays.toString(excludedDocPathPatterns) + ", handlerParameterMap=" + handlerParameterMap + ", handlerScriptMap="
|
||||
+ handlerScriptMap + ", labelTypeList=" + labelTypeList + ", roleTypeList=" + roleTypeList + ", available=" + available
|
||||
+ ", boost=" + boost + ", createdBy=" + createdBy + ", createdTime=" + createdTime + ", handlerName=" + handlerName
|
||||
+ ", handlerParameter=" + handlerParameter + ", handlerScript=" + handlerScript + ", name=" + name + ", sortOrder="
|
||||
+ sortOrder + ", updatedBy=" + updatedBy + ", updatedTime=" + updatedTime + ", docMeta=" + docMeta + "]";
|
||||
return "DataConfig [available=" + available + ", boost=" + boost + ", createdBy=" + createdBy + ", createdTime=" + createdTime
|
||||
+ ", handlerName=" + handlerName + ", handlerParameter=" + handlerParameter + ", handlerScript=" + handlerScript
|
||||
+ ", name=" + name + ", permissions=" + Arrays.toString(permissions) + ", sortOrder=" + sortOrder + ", updatedBy="
|
||||
+ updatedBy + ", updatedTime=" + updatedTime + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,9 +31,7 @@ import org.codelibs.fess.crawler.client.smb.SmbAuthentication;
|
|||
import org.codelibs.fess.crawler.client.smb.SmbClient;
|
||||
import org.codelibs.fess.es.config.bsentity.BsFileConfig;
|
||||
import org.codelibs.fess.es.config.exbhv.FileConfigToLabelBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.FileConfigToRoleBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.LabelTypeBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.RoleTypeBhv;
|
||||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
|
@ -49,8 +47,6 @@ public class FileConfig extends BsFileConfig implements CrawlingConfig {
|
|||
|
||||
private String[] labelTypeIds;
|
||||
|
||||
private String[] roleTypeIds;
|
||||
|
||||
protected volatile Pattern[] includedDocPathPatterns;
|
||||
|
||||
protected volatile Pattern[] excludedDocPathPatterns;
|
||||
|
@ -59,8 +55,6 @@ public class FileConfig extends BsFileConfig implements CrawlingConfig {
|
|||
|
||||
private volatile List<LabelType> labelTypeList;
|
||||
|
||||
private volatile List<RoleType> roleTypeList;
|
||||
|
||||
public FileConfig() {
|
||||
super();
|
||||
setBoost(1.0f);
|
||||
|
@ -114,54 +108,6 @@ public class FileConfig extends BsFileConfig implements CrawlingConfig {
|
|||
return labelValueList.toArray(new String[labelValueList.size()]);
|
||||
}
|
||||
|
||||
public String[] getRoleTypeIds() {
|
||||
if (roleTypeIds == null) {
|
||||
return StringUtil.EMPTY_STRINGS;
|
||||
}
|
||||
return roleTypeIds;
|
||||
}
|
||||
|
||||
public void setRoleTypeIds(final String[] roleTypeIds) {
|
||||
this.roleTypeIds = roleTypeIds;
|
||||
}
|
||||
|
||||
public List<RoleType> getRoleTypeList() {
|
||||
if (roleTypeList == null) {
|
||||
synchronized (this) {
|
||||
if (roleTypeList == null) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
final FileConfigToRoleBhv fileConfigToRoleBhv = ComponentUtil.getComponent(FileConfigToRoleBhv.class);
|
||||
final ListResultBean<FileConfigToRole> mappingList = fileConfigToRoleBhv.selectList(cb -> {
|
||||
cb.query().setFileConfigId_Equal(getId());
|
||||
cb.specify().columnRoleTypeId();
|
||||
cb.paging(fessConfig.getPageRoletypeMaxFetchSizeAsInteger().intValue(), 1);
|
||||
});
|
||||
final List<String> roleIdList = new ArrayList<>();
|
||||
for (final FileConfigToRole mapping : mappingList) {
|
||||
roleIdList.add(mapping.getRoleTypeId());
|
||||
}
|
||||
final RoleTypeBhv roleTypeBhv = ComponentUtil.getComponent(RoleTypeBhv.class);
|
||||
roleTypeList = roleIdList.isEmpty() ? Collections.emptyList() : roleTypeBhv.selectList(cb -> {
|
||||
cb.query().setId_InScope(roleIdList);
|
||||
cb.query().addOrderBy_SortOrder_Asc();
|
||||
cb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return roleTypeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getRoleTypeValues() {
|
||||
final List<RoleType> list = getRoleTypeList();
|
||||
final List<String> roleValueList = new ArrayList<>(list.size());
|
||||
for (final RoleType roleType : list) {
|
||||
roleValueList.add(roleType.getValue());
|
||||
}
|
||||
return roleValueList.toArray(new String[roleValueList.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDocumentBoost() {
|
||||
return Float.valueOf(getBoost().floatValue()).toString();
|
||||
|
@ -314,14 +260,12 @@ public class FileConfig extends BsFileConfig implements CrawlingConfig {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FileConfig [labelTypeIds=" + Arrays.toString(labelTypeIds) + ", roleTypeIds=" + Arrays.toString(roleTypeIds)
|
||||
+ ", includedDocPathPatterns=" + Arrays.toString(includedDocPathPatterns) + ", excludedDocPathPatterns="
|
||||
+ Arrays.toString(excludedDocPathPatterns) + ", configParameterMap=" + configParameterMap + ", labelTypeList="
|
||||
+ labelTypeList + ", roleTypeList=" + roleTypeList + ", available=" + available + ", boost=" + boost + ", configParameter="
|
||||
+ configParameter + ", createdBy=" + createdBy + ", createdTime=" + createdTime + ", depth=" + depth
|
||||
+ ", excludedDocPaths=" + excludedDocPaths + ", excludedPaths=" + excludedPaths + ", includedDocPaths=" + includedDocPaths
|
||||
+ ", includedPaths=" + includedPaths + ", intervalTime=" + intervalTime + ", timeToLive=" + timeToLive
|
||||
+ ", maxAccessCount=" + maxAccessCount + ", name=" + name + ", numOfThread=" + numOfThread + ", paths=" + paths
|
||||
+ ", sortOrder=" + sortOrder + ", updatedBy=" + updatedBy + ", updatedTime=" + updatedTime + ", docMeta=" + docMeta + "]";
|
||||
return "FileConfig [available=" + available + ", boost=" + boost + ", configParameter=" + configParameter + ", createdBy="
|
||||
+ createdBy + ", createdTime=" + createdTime + ", depth=" + depth + ", excludedDocPaths=" + excludedDocPaths
|
||||
+ ", excludedPaths=" + excludedPaths + ", includedDocPaths=" + includedDocPaths + ", includedPaths=" + includedPaths
|
||||
+ ", intervalTime=" + intervalTime + ", timeToLive=" + timeToLive + ", maxAccessCount=" + maxAccessCount + ", name=" + name
|
||||
+ ", numOfThread=" + numOfThread + ", paths=" + paths + ", permissions=" + Arrays.toString(permissions) + ", sortOrder="
|
||||
+ sortOrder + ", updatedBy=" + updatedBy + ", updatedTime=" + updatedTime + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,9 +32,7 @@ import org.codelibs.fess.crawler.client.http.Authentication;
|
|||
import org.codelibs.fess.crawler.client.http.HcHttpClient;
|
||||
import org.codelibs.fess.es.config.bsentity.BsWebConfig;
|
||||
import org.codelibs.fess.es.config.exbhv.LabelTypeBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.RoleTypeBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.WebConfigToLabelBhv;
|
||||
import org.codelibs.fess.es.config.exbhv.WebConfigToRoleBhv;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.ParameterUtil;
|
||||
|
@ -49,8 +47,6 @@ public class WebConfig extends BsWebConfig implements CrawlingConfig {
|
|||
|
||||
private String[] labelTypeIds;
|
||||
|
||||
private String[] roleTypeIds;
|
||||
|
||||
protected volatile Pattern[] includedDocUrlPatterns;
|
||||
|
||||
protected volatile Pattern[] excludedDocUrlPatterns;
|
||||
|
@ -59,8 +55,6 @@ public class WebConfig extends BsWebConfig implements CrawlingConfig {
|
|||
|
||||
private volatile List<LabelType> labelTypeList;
|
||||
|
||||
private volatile List<RoleType> roleTypeList;
|
||||
|
||||
public WebConfig() {
|
||||
super();
|
||||
setBoost(1.0f);
|
||||
|
@ -117,57 +111,6 @@ public class WebConfig extends BsWebConfig implements CrawlingConfig {
|
|||
return labelValueList.toArray(new String[labelValueList.size()]);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.codelibs.fess.db.exentity.CrawlingConfig#getRoleTypeIds()
|
||||
*/
|
||||
public String[] getRoleTypeIds() {
|
||||
if (roleTypeIds == null) {
|
||||
return StringUtil.EMPTY_STRINGS;
|
||||
}
|
||||
return roleTypeIds;
|
||||
}
|
||||
|
||||
public void setRoleTypeIds(final String[] roleTypeIds) {
|
||||
this.roleTypeIds = roleTypeIds;
|
||||
}
|
||||
|
||||
public List<RoleType> getRoleTypeList() {
|
||||
if (roleTypeList == null) {
|
||||
synchronized (this) {
|
||||
if (roleTypeList == null) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
final WebConfigToRoleBhv webConfigToRoleBhv = ComponentUtil.getComponent(WebConfigToRoleBhv.class);
|
||||
final ListResultBean<WebConfigToRole> mappingList = webConfigToRoleBhv.selectList(cb -> {
|
||||
cb.query().setWebConfigId_Equal(getId());
|
||||
cb.specify().columnRoleTypeId();
|
||||
cb.paging(fessConfig.getPageRoletypeMaxFetchSizeAsInteger().intValue(), 1);
|
||||
});
|
||||
final List<String> roleIdList = new ArrayList<>();
|
||||
for (final WebConfigToRole mapping : mappingList) {
|
||||
roleIdList.add(mapping.getRoleTypeId());
|
||||
}
|
||||
final RoleTypeBhv roleTypeBhv = ComponentUtil.getComponent(RoleTypeBhv.class);
|
||||
roleTypeList = roleIdList.isEmpty() ? Collections.emptyList() : roleTypeBhv.selectList(cb -> {
|
||||
cb.query().setId_InScope(roleIdList);
|
||||
cb.query().addOrderBy_SortOrder_Asc();
|
||||
cb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return roleTypeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getRoleTypeValues() {
|
||||
final List<RoleType> list = getRoleTypeList();
|
||||
final List<String> roleValueList = new ArrayList<>(list.size());
|
||||
for (final RoleType roleType : list) {
|
||||
roleValueList.add(roleType.getValue());
|
||||
}
|
||||
return roleValueList.toArray(new String[roleValueList.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDocumentBoost() {
|
||||
return Float.valueOf(getBoost().floatValue()).toString();
|
||||
|
@ -323,14 +266,12 @@ public class WebConfig extends BsWebConfig implements CrawlingConfig {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WebConfig [labelTypeIds=" + Arrays.toString(labelTypeIds) + ", roleTypeIds=" + Arrays.toString(roleTypeIds)
|
||||
+ ", includedDocUrlPatterns=" + Arrays.toString(includedDocUrlPatterns) + ", excludedDocUrlPatterns="
|
||||
+ Arrays.toString(excludedDocUrlPatterns) + ", configParameterMap=" + configParameterMap + ", labelTypeList="
|
||||
+ labelTypeList + ", roleTypeList=" + roleTypeList + ", available=" + available + ", boost=" + boost + ", configParameter="
|
||||
+ configParameter + ", createdBy=" + createdBy + ", createdTime=" + createdTime + ", depth=" + depth + ", excludedDocUrls="
|
||||
+ excludedDocUrls + ", excludedUrls=" + excludedUrls + ", includedDocUrls=" + includedDocUrls + ", includedUrls="
|
||||
+ includedUrls + ", intervalTime=" + intervalTime + ", timeToLive=" + timeToLive + ", maxAccessCount=" + maxAccessCount
|
||||
+ ", name=" + name + ", numOfThread=" + numOfThread + ", sortOrder=" + sortOrder + ", updatedBy=" + updatedBy
|
||||
+ ", updatedTime=" + updatedTime + ", urls=" + urls + ", userAgent=" + userAgent + ", docMeta=" + docMeta + "]";
|
||||
return "WebConfig [available=" + available + ", boost=" + boost + ", configParameter=" + configParameter + ", createdBy="
|
||||
+ createdBy + ", createdTime=" + createdTime + ", depth=" + depth + ", excludedDocUrls=" + excludedDocUrls
|
||||
+ ", excludedUrls=" + excludedUrls + ", includedDocUrls=" + includedDocUrls + ", includedUrls=" + includedUrls
|
||||
+ ", intervalTime=" + intervalTime + ", timeToLive=" + timeToLive + ", maxAccessCount=" + maxAccessCount + ", name=" + name
|
||||
+ ", numOfThread=" + numOfThread + ", permissions=" + Arrays.toString(permissions) + ", sortOrder=" + sortOrder
|
||||
+ ", updatedBy=" + updatedBy + ", updatedTime=" + updatedTime + ", urls=" + urls + ", userAgent=" + userAgent + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,10 +17,13 @@ package org.codelibs.fess.es.user.exentity;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.entity.FessUser;
|
||||
import org.codelibs.fess.es.user.bsentity.BsUser;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
|
||||
/**
|
||||
|
@ -50,14 +53,20 @@ public class User extends BsUser implements FessUser {
|
|||
|
||||
@Override
|
||||
public String[] getRoleNames() {
|
||||
return StreamUtil.of(getRoles()).map(role -> new String(Base64.getDecoder().decode(role), Constants.CHARSET_UTF_8))
|
||||
.toArray(n -> new String[n]);
|
||||
return getRoleStream().toArray(n -> new String[n]);
|
||||
}
|
||||
|
||||
protected Stream<String> getRoleStream() {
|
||||
return StreamUtil.of(getRoles()).map(role -> new String(Base64.getDecoder().decode(role), Constants.CHARSET_UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getGroupNames() {
|
||||
return StreamUtil.of(getGroups()).map(group -> new String(Base64.getDecoder().decode(group), Constants.CHARSET_UTF_8))
|
||||
.toArray(n -> new String[n]);
|
||||
return getGroupStream().toArray(n -> new String[n]);
|
||||
}
|
||||
|
||||
private Stream<String> getGroupStream() {
|
||||
return StreamUtil.of(getGroups()).map(group -> new String(Base64.getDecoder().decode(group), Constants.CHARSET_UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -74,4 +83,13 @@ public class User extends BsUser implements FessUser {
|
|||
return originalPassword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getPermissions() {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
return Stream.concat(
|
||||
Stream.of(fessConfig.getRoleSearchUserPrefix() + getName()),
|
||||
Stream.concat(getRoleStream().map(s -> fessConfig.getRoleSearchRolePrefix() + s),
|
||||
getGroupStream().map(s -> fessConfig.getRoleSearchGroupPrefix() + s))).toArray(n -> new String[n]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class LabelTypeHelper implements Serializable {
|
|||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
final List<LabelType> labelTypeList = getLabelTypeService().getLabelTypeListWithRoles();
|
||||
final List<LabelType> labelTypeList = getLabelTypeService().getLabelTypeList();
|
||||
buildLabelTypeItems(labelTypeList);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,9 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
import org.codelibs.core.crypto.CachedCipher;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.mylasta.action.FessUserBean;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.lastaflute.web.servlet.request.RequestManager;
|
||||
|
@ -73,10 +75,9 @@ public class RoleQueryHelper {
|
|||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
StreamUtil.of(ComponentUtil.getFessConfig().getSearchDefaultRoles().split(",")).filter(name -> StringUtil.isNotBlank(name))
|
||||
.forEach(name -> {
|
||||
defaultRoleList.add(name);
|
||||
});
|
||||
StreamUtil.of(ComponentUtil.getFessConfig().getSearchDefaultPermissionsAsArray()).forEach(name -> {
|
||||
defaultRoleList.add(name);
|
||||
});
|
||||
}
|
||||
|
||||
public Set<String> build() {
|
||||
|
@ -103,9 +104,11 @@ public class RoleQueryHelper {
|
|||
roleList.addAll(buildByCookieNameMapping(request));
|
||||
}
|
||||
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
final RequestManager requestManager = ComponentUtil.getRequestManager();
|
||||
requestManager.findUserBean(FessUserBean.class).ifPresent(
|
||||
fessUserBean -> StreamUtil.of(fessUserBean.getRoles()).forEach(roleList::add));
|
||||
requestManager.findUserBean(FessUserBean.class)
|
||||
.ifPresent(fessUserBean -> StreamUtil.of(fessUserBean.getPermissions()).forEach(roleList::add))
|
||||
.orElse(() -> roleList.add(fessConfig.getRoleSearchUserPrefix() + Constants.GUEST_USER));
|
||||
|
||||
if (defaultRoleList != null) {
|
||||
roleList.addAll(defaultRoleList);
|
||||
|
|
|
@ -274,15 +274,15 @@ public class SystemHelper implements Serializable {
|
|||
}
|
||||
|
||||
public String getSearchRoleByUser(final String name) {
|
||||
return createSearchRole(ComponentUtil.getFessConfig().getLdapRoleSearchUserPrefix(), name);
|
||||
return createSearchRole(ComponentUtil.getFessConfig().getRoleSearchUserPrefix(), name);
|
||||
}
|
||||
|
||||
public String getSearchRoleByGroup(final String name) {
|
||||
return createSearchRole(ComponentUtil.getFessConfig().getLdapRoleSearchGroupPrefix(), name);
|
||||
return createSearchRole(ComponentUtil.getFessConfig().getRoleSearchGroupPrefix(), name);
|
||||
}
|
||||
|
||||
public String getSearchRoleByRole(final String name) {
|
||||
return createSearchRole(ComponentUtil.getFessConfig().getLdapRoleSearchRolePrefix(), name);
|
||||
return createSearchRole(ComponentUtil.getFessConfig().getRoleSearchRolePrefix(), name);
|
||||
}
|
||||
|
||||
protected String createSearchRole(final String type, final String name) {
|
||||
|
|
|
@ -16,12 +16,15 @@
|
|||
package org.codelibs.fess.ldap;
|
||||
|
||||
import java.util.Hashtable;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.naming.Context;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.entity.FessUser;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
|
||||
public class LdapUser implements FessUser {
|
||||
|
||||
|
@ -31,7 +34,7 @@ public class LdapUser implements FessUser {
|
|||
|
||||
protected String name;
|
||||
|
||||
protected String[] roles = null;
|
||||
protected String[] permissions = null;
|
||||
|
||||
public LdapUser(final Hashtable<String, String> env, final String name) {
|
||||
this.env = env;
|
||||
|
@ -44,23 +47,35 @@ public class LdapUser implements FessUser {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String[] getRoleNames() {
|
||||
if (roles == null) {
|
||||
public String[] getPermissions() {
|
||||
if (permissions == null) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
final String baseDn = ComponentUtil.getFessConfig().getLdapBaseDn();
|
||||
final String accountFilter = ComponentUtil.getFessConfig().getLdapAccountFilter();
|
||||
if (StringUtil.isNotBlank(baseDn) && StringUtil.isNotBlank(accountFilter)) {
|
||||
roles = ComponentUtil.getLdapManager().getRoles(this, baseDn, accountFilter);
|
||||
permissions =
|
||||
Stream.concat(Stream.of(fessConfig.getRoleSearchUserPrefix() + getName()),
|
||||
StreamUtil.of(ComponentUtil.getLdapManager().getRoles(this, baseDn, accountFilter))).toArray(
|
||||
n -> new String[n]);
|
||||
} else {
|
||||
roles = StringUtil.EMPTY_STRINGS;
|
||||
permissions = StringUtil.EMPTY_STRINGS;
|
||||
}
|
||||
}
|
||||
return roles;
|
||||
return permissions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getRoleNames() {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
return StreamUtil.of(getPermissions()).filter(s -> s.startsWith(fessConfig.getRoleSearchRolePrefix())).map(s -> s.substring(1))
|
||||
.toArray(n -> new String[n]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getGroupNames() {
|
||||
// TODO
|
||||
return StringUtil.EMPTY_STRINGS;
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
return StreamUtil.of(getPermissions()).filter(s -> s.startsWith(fessConfig.getRoleSearchGroupPrefix())).map(s -> s.substring(1))
|
||||
.toArray(n -> new String[n]);
|
||||
}
|
||||
|
||||
public Hashtable<String, String> getEnvironment() {
|
||||
|
|
|
@ -224,15 +224,6 @@ public interface FessHtmlPath {
|
|||
/** The path of the HTML: /admin/role/admin_role_edit.jsp */
|
||||
HtmlNext path_AdminRole_AdminRoleEditJsp = new HtmlNext("/admin/role/admin_role_edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/roletype/admin_roletype.jsp */
|
||||
HtmlNext path_AdminRoletype_AdminRoletypeJsp = new HtmlNext("/admin/roletype/admin_roletype.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/roletype/admin_roletype_details.jsp */
|
||||
HtmlNext path_AdminRoletype_AdminRoletypeDetailsJsp = new HtmlNext("/admin/roletype/admin_roletype_details.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/roletype/admin_roletype_edit.jsp */
|
||||
HtmlNext path_AdminRoletype_AdminRoletypeEditJsp = new HtmlNext("/admin/roletype/admin_roletype_edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/scheduler/admin_scheduler.jsp */
|
||||
HtmlNext path_AdminScheduler_AdminSchedulerJsp = new HtmlNext("/admin/scheduler/admin_scheduler.jsp");
|
||||
|
||||
|
|
|
@ -512,9 +512,6 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Duplicate Host */
|
||||
public static final String LABELS_menu_duplicate_host = "{labels.menu_duplicate_host}";
|
||||
|
||||
/** The key of the message: Role */
|
||||
public static final String LABELS_menu_role_type = "{labels.menu_role_type}";
|
||||
|
||||
/** The key of the message: User */
|
||||
public static final String LABELS_menu_user = "{labels.menu_user}";
|
||||
|
||||
|
@ -1941,9 +1938,6 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Role */
|
||||
public static final String LABELS_role_title_details = "{labels.role_title_details}";
|
||||
|
||||
/** The key of the message: Create new crawler role */
|
||||
public static final String LABELS_role_button_create_crawler_role = "{labels.role_button_create_crawler_role}";
|
||||
|
||||
/** The key of the message: group */
|
||||
public static final String LABELS_group_configuration = "{labels.group_configuration}";
|
||||
|
||||
|
|
|
@ -54,6 +54,10 @@ public class FessUserBean extends TypicalUserBean<String> { // #change_it also L
|
|||
// ===================================================================================
|
||||
// Accessor
|
||||
// ========
|
||||
public String[] getPermissions() {
|
||||
return user.getPermissions();
|
||||
}
|
||||
|
||||
public String[] getRoles() {
|
||||
return user.getRoleNames();
|
||||
}
|
||||
|
|
|
@ -451,8 +451,17 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
/** The key of the configuration. e.g. admin */
|
||||
String AUTHENTICATION_ADMIN_ROLES = "authentication.admin.roles";
|
||||
|
||||
/** The key of the configuration. e.g. guest */
|
||||
String SEARCH_DEFAULT_ROLES = "search.default.roles";
|
||||
/** The key of the configuration. e.g. {role}guest */
|
||||
String ROLE_SEARCH_DEFAULT_PERMISSIONS = "role.search.default.permissions";
|
||||
|
||||
/** The key of the configuration. e.g. 1 */
|
||||
String ROLE_SEARCH_USER_PREFIX = "role.search.user.prefix";
|
||||
|
||||
/** The key of the configuration. e.g. 2 */
|
||||
String ROLE_SEARCH_GROUP_PREFIX = "role.search.group.prefix";
|
||||
|
||||
/** The key of the configuration. e.g. R */
|
||||
String ROLE_SEARCH_ROLE_PREFIX = "role.search.role.prefix";
|
||||
|
||||
/** The key of the configuration. e.g. / */
|
||||
String COOKIE_DEFAULT_PATH = "cookie.default.path";
|
||||
|
@ -583,9 +592,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
/** The key of the configuration. e.g. reqheader */
|
||||
String ONLINE_HELP_NAME_REQHEADER = "online.help.name.reqheader";
|
||||
|
||||
/** The key of the configuration. e.g. roletype */
|
||||
String ONLINE_HELP_NAME_ROLETYPE = "online.help.name.roletype";
|
||||
|
||||
/** The key of the configuration. e.g. synonym */
|
||||
String ONLINE_HELP_NAME_DICT_SYNONYM = "online.help.name.dict.synonym";
|
||||
|
||||
|
@ -784,15 +790,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
/** The key of the configuration. e.g. true */
|
||||
String LDAP_ROLE_SEARCH_ROLE_ENABLED = "ldap.role.search.role.enabled";
|
||||
|
||||
/** The key of the configuration. e.g. 1 */
|
||||
String LDAP_ROLE_SEARCH_USER_PREFIX = "ldap.role.search.user.prefix";
|
||||
|
||||
/** The key of the configuration. e.g. 2 */
|
||||
String LDAP_ROLE_SEARCH_GROUP_PREFIX = "ldap.role.search.group.prefix";
|
||||
|
||||
/** The key of the configuration. e.g. R */
|
||||
String LDAP_ROLE_SEARCH_ROLE_PREFIX = "ldap.role.search.role.prefix";
|
||||
|
||||
/** The key of the configuration. e.g. sn */
|
||||
String LDAP_ATTR_SURNAME = "ldap.attr.surname";
|
||||
|
||||
|
@ -2125,11 +2122,48 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
String getAuthenticationAdminRoles();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'search.default.roles'. <br>
|
||||
* The value is, e.g. guest <br>
|
||||
* Get the value for the key 'role.search.default.permissions'. <br>
|
||||
* The value is, e.g. {role}guest <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getSearchDefaultRoles();
|
||||
String getRoleSearchDefaultPermissions();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'role.search.user.prefix'. <br>
|
||||
* The value is, e.g. 1 <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getRoleSearchUserPrefix();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'role.search.user.prefix' as {@link Integer}. <br>
|
||||
* The value is, e.g. 1 <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 getRoleSearchUserPrefixAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'role.search.group.prefix'. <br>
|
||||
* The value is, e.g. 2 <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getRoleSearchGroupPrefix();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'role.search.group.prefix' as {@link Integer}. <br>
|
||||
* The value is, e.g. 2 <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 getRoleSearchGroupPrefixAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'role.search.role.prefix'. <br>
|
||||
* The value is, e.g. R <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getRoleSearchRolePrefix();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.default.path'. <br>
|
||||
|
@ -2715,13 +2749,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
*/
|
||||
String getOnlineHelpNameReqheader();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.name.roletype'. <br>
|
||||
* The value is, e.g. roletype <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getOnlineHelpNameRoletype();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.name.dict.synonym'. <br>
|
||||
* The value is, e.g. synonym <br>
|
||||
|
@ -3320,43 +3347,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
*/
|
||||
boolean isLdapRoleSearchRoleEnabled();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'ldap.role.search.user.prefix'. <br>
|
||||
* The value is, e.g. 1 <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getLdapRoleSearchUserPrefix();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'ldap.role.search.user.prefix' as {@link Integer}. <br>
|
||||
* The value is, e.g. 1 <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 getLdapRoleSearchUserPrefixAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'ldap.role.search.group.prefix'. <br>
|
||||
* The value is, e.g. 2 <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getLdapRoleSearchGroupPrefix();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'ldap.role.search.group.prefix' as {@link Integer}. <br>
|
||||
* The value is, e.g. 2 <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 getLdapRoleSearchGroupPrefixAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'ldap.role.search.role.prefix'. <br>
|
||||
* The value is, e.g. R <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getLdapRoleSearchRolePrefix();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'ldap.attr.surname'. <br>
|
||||
* The value is, e.g. sn <br>
|
||||
|
@ -4234,8 +4224,28 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
return get(FessConfig.AUTHENTICATION_ADMIN_ROLES);
|
||||
}
|
||||
|
||||
public String getSearchDefaultRoles() {
|
||||
return get(FessConfig.SEARCH_DEFAULT_ROLES);
|
||||
public String getRoleSearchDefaultPermissions() {
|
||||
return get(FessConfig.ROLE_SEARCH_DEFAULT_PERMISSIONS);
|
||||
}
|
||||
|
||||
public String getRoleSearchUserPrefix() {
|
||||
return get(FessConfig.ROLE_SEARCH_USER_PREFIX);
|
||||
}
|
||||
|
||||
public Integer getRoleSearchUserPrefixAsInteger() {
|
||||
return getAsInteger(FessConfig.ROLE_SEARCH_USER_PREFIX);
|
||||
}
|
||||
|
||||
public String getRoleSearchGroupPrefix() {
|
||||
return get(FessConfig.ROLE_SEARCH_GROUP_PREFIX);
|
||||
}
|
||||
|
||||
public Integer getRoleSearchGroupPrefixAsInteger() {
|
||||
return getAsInteger(FessConfig.ROLE_SEARCH_GROUP_PREFIX);
|
||||
}
|
||||
|
||||
public String getRoleSearchRolePrefix() {
|
||||
return get(FessConfig.ROLE_SEARCH_ROLE_PREFIX);
|
||||
}
|
||||
|
||||
public String getCookieDefaultPath() {
|
||||
|
@ -4542,10 +4552,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
return get(FessConfig.ONLINE_HELP_NAME_REQHEADER);
|
||||
}
|
||||
|
||||
public String getOnlineHelpNameRoletype() {
|
||||
return get(FessConfig.ONLINE_HELP_NAME_ROLETYPE);
|
||||
}
|
||||
|
||||
public String getOnlineHelpNameDictSynonym() {
|
||||
return get(FessConfig.ONLINE_HELP_NAME_DICT_SYNONYM);
|
||||
}
|
||||
|
@ -4878,26 +4884,6 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
return is(FessConfig.LDAP_ROLE_SEARCH_ROLE_ENABLED);
|
||||
}
|
||||
|
||||
public String getLdapRoleSearchUserPrefix() {
|
||||
return get(FessConfig.LDAP_ROLE_SEARCH_USER_PREFIX);
|
||||
}
|
||||
|
||||
public Integer getLdapRoleSearchUserPrefixAsInteger() {
|
||||
return getAsInteger(FessConfig.LDAP_ROLE_SEARCH_USER_PREFIX);
|
||||
}
|
||||
|
||||
public String getLdapRoleSearchGroupPrefix() {
|
||||
return get(FessConfig.LDAP_ROLE_SEARCH_GROUP_PREFIX);
|
||||
}
|
||||
|
||||
public Integer getLdapRoleSearchGroupPrefixAsInteger() {
|
||||
return getAsInteger(FessConfig.LDAP_ROLE_SEARCH_GROUP_PREFIX);
|
||||
}
|
||||
|
||||
public String getLdapRoleSearchRolePrefix() {
|
||||
return get(FessConfig.LDAP_ROLE_SEARCH_ROLE_PREFIX);
|
||||
}
|
||||
|
||||
public String getLdapAttrSurname() {
|
||||
return get(FessConfig.LDAP_ATTR_SURNAME);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.codelibs.core.misc.Tuple3;
|
|||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.mylasta.action.FessUserBean;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.PermissionUtil;
|
||||
import org.codelibs.fess.util.StreamUtil;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
import org.elasticsearch.action.search.SearchRequestBuilder;
|
||||
|
@ -876,4 +877,16 @@ public interface FessProp {
|
|||
}).ifPresent(p -> searchRequestBuilder.setPreference(p)));
|
||||
}
|
||||
|
||||
String getRoleSearchDefaultPermissions();
|
||||
|
||||
public default String[] getSearchDefaultPermissionsAsArray() {
|
||||
return StreamUtil.of(getRoleSearchDefaultPermissions().split(",")).map(p -> PermissionUtil.encode(p))
|
||||
.filter(s -> StringUtil.isNotBlank(s)).distinct().toArray(n -> new String[n]);
|
||||
}
|
||||
|
||||
public default String getSearchDefaultDisplayPermission() {
|
||||
return StreamUtil.of(getRoleSearchDefaultPermissions().split(",")).filter(s -> StringUtil.isNotBlank(s)).distinct()
|
||||
.collect(Collectors.joining("\n"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
68
src/main/java/org/codelibs/fess/util/PermissionUtil.java
Normal file
68
src/main/java/org/codelibs/fess/util/PermissionUtil.java
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* 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.util;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
|
||||
public class PermissionUtil {
|
||||
private static final String ROLE_PREFIX = "{role}";
|
||||
|
||||
private static final String GROUP_PREFIX = "{group}";
|
||||
|
||||
private static final String USER_PREFIX = "{user}";
|
||||
|
||||
private PermissionUtil() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
public static String encode(final String value) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final SystemHelper systemHelper = ComponentUtil.getSystemHelper();
|
||||
final String permission = value.trim();
|
||||
final String lower = permission.toLowerCase(Locale.ROOT);
|
||||
if (lower.startsWith(USER_PREFIX) && permission.length() > USER_PREFIX.length()) {
|
||||
return systemHelper.getSearchRoleByUser(permission.substring(USER_PREFIX.length()));
|
||||
} else if (lower.startsWith(GROUP_PREFIX) && permission.length() > GROUP_PREFIX.length()) {
|
||||
return systemHelper.getSearchRoleByGroup(permission.substring(GROUP_PREFIX.length()));
|
||||
} else if (lower.startsWith(ROLE_PREFIX) && permission.length() > ROLE_PREFIX.length()) {
|
||||
return systemHelper.getSearchRoleByRole(permission.substring(ROLE_PREFIX.length()));
|
||||
}
|
||||
return permission;
|
||||
}
|
||||
|
||||
public static String decode(String value) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
if (value.startsWith(fessConfig.getRoleSearchUserPrefix()) && value.length() > 1) {
|
||||
return USER_PREFIX + value.substring(1);
|
||||
} else if (value.startsWith(fessConfig.getRoleSearchGroupPrefix()) && value.length() > 1) {
|
||||
return GROUP_PREFIX + value.substring(1);
|
||||
} else if (value.startsWith(fessConfig.getRoleSearchRolePrefix()) && value.length() > 1) {
|
||||
return ROLE_PREFIX + value.substring(1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -254,7 +254,11 @@ index.backup.targets=.fess_config,.fess_user
|
|||
authentication.admin.users=admin
|
||||
authentication.admin.roles=admin
|
||||
|
||||
search.default.roles=guest
|
||||
role.search.default.permissions={role}guest
|
||||
|
||||
role.search.user.prefix=1
|
||||
role.search.group.prefix=2
|
||||
role.search.role.prefix=R
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Cookie
|
||||
|
@ -335,7 +339,6 @@ online.help.base.link=http://fess.codelibs.org/{lang}/{version}/admin/
|
|||
online.help.name.failureurl=failureurl
|
||||
online.help.name.elevateword=elevateword
|
||||
online.help.name.reqheader=reqheader
|
||||
online.help.name.roletype=roletype
|
||||
online.help.name.dict.synonym=synonym
|
||||
online.help.name.dict=dict
|
||||
online.help.name.dict.kuromoji=kuromoji
|
||||
|
@ -420,9 +423,6 @@ ldap.memberof.attribute=memberOf
|
|||
ldap.role.search.user.enabled=true
|
||||
ldap.role.search.group.enabled=true
|
||||
ldap.role.search.role.enabled=true
|
||||
ldap.role.search.user.prefix=1
|
||||
ldap.role.search.group.prefix=2
|
||||
ldap.role.search.role.prefix=R
|
||||
|
||||
ldap.attr.surname=sn
|
||||
ldap.attr.givenName=givenName
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"permissions": {
|
||||
"type": "string",
|
||||
"index": "not_analyzed"
|
||||
},
|
||||
"sortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
|
|
|
@ -56,6 +56,10 @@
|
|||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"permissions": {
|
||||
"type": "string",
|
||||
"index": "not_analyzed"
|
||||
},
|
||||
"sortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
"type": "string",
|
||||
"index": "not_analyzed"
|
||||
},
|
||||
"permissions": {
|
||||
"type": "string",
|
||||
"index": "not_analyzed"
|
||||
},
|
||||
"sortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
{"index":{"_index":".fess_config","_type":"role_type","_id":"guest"}}
|
||||
{"updatedTime":0,"updatedBy":"admin","createdBy":"admin","name":"Guest","createdTime":0,"value":"guest"}
|
|
@ -60,6 +60,10 @@
|
|||
"available": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"permissions": {
|
||||
"type": "string",
|
||||
"index": "not_analyzed"
|
||||
},
|
||||
"sortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
|
|
|
@ -161,7 +161,6 @@ labels.menu_web_authentication=Web Authentication
|
|||
labels.menu_file_authentication=File Authentication
|
||||
labels.menu_request_header=Request Header
|
||||
labels.menu_duplicate_host=Duplicate Host
|
||||
labels.menu_role_type=Role
|
||||
labels.menu_user=User
|
||||
labels.menu_role=Role
|
||||
labels.menu_group=Group
|
||||
|
@ -637,7 +636,6 @@ labels.role_configuration=Role
|
|||
labels.role_list_name=Name
|
||||
labels.role_name=Name
|
||||
labels.role_title_details=Role
|
||||
labels.role_button_create_crawler_role=Create new crawler role
|
||||
labels.group_configuration=group
|
||||
labels.group_list_name=Name
|
||||
labels.group_name=Name
|
||||
|
|
|
@ -161,7 +161,6 @@ labels.menu_web_authentication=Web Authentication
|
|||
labels.menu_file_authentication=File Authentication
|
||||
labels.menu_request_header=Request Header
|
||||
labels.menu_duplicate_host=Duplicate Host
|
||||
labels.menu_role_type=Role
|
||||
labels.menu_user=User
|
||||
labels.menu_role=Role
|
||||
labels.menu_group=Group
|
||||
|
@ -637,7 +636,6 @@ labels.role_configuration=Role
|
|||
labels.role_list_name=Name
|
||||
labels.role_name=Name
|
||||
labels.role_title_details=Role
|
||||
labels.role_button_create_crawler_role=Create new crawler role
|
||||
labels.group_configuration=group
|
||||
labels.group_list_name=Name
|
||||
labels.group_name=Name
|
||||
|
|
|
@ -157,7 +157,6 @@ labels.menu_web_authentication=\u30a6\u30a7\u30d6\u8a8d\u8a3c
|
|||
labels.menu_file_authentication=\u30d5\u30a1\u30a4\u30eb\u8a8d\u8a3c
|
||||
labels.menu_request_header=\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u30fc
|
||||
labels.menu_duplicate_host=\u91cd\u8907\u30db\u30b9\u30c8
|
||||
labels.menu_role_type=\u30ed\u30fc\u30eb
|
||||
labels.menu_user=\u30e6\u30fc\u30b6\u30fc
|
||||
labels.menu_role=\u30ed\u30fc\u30eb
|
||||
labels.menu_group=\u30b0\u30eb\u30fc\u30d7
|
||||
|
@ -633,7 +632,6 @@ labels.role_configuration=\u30ed\u30fc\u30eb
|
|||
labels.role_list_name=\u540d\u524d
|
||||
labels.role_name=\u540d\u524d
|
||||
labels.role_title_details=\u30ed\u30fc\u30eb
|
||||
labels.role_button_create_crawler_role=\u65b0\u3057\u3044\u30af\u30ed\u30fc\u30e9\u7528\u30ed\u30fc\u30eb\u306e\u4f5c\u6210
|
||||
labels.group_configuration=\u30b0\u30eb\u30fc\u30d7
|
||||
labels.group_list_name=\u540d\u524d
|
||||
labels.group_name=\u540d\u524d
|
||||
|
|
|
@ -84,14 +84,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.role_type" /></th>
|
||||
<td><c:forEach var="rt" varStatus="s"
|
||||
items="${roleTypeItems}">
|
||||
<c:forEach var="rtid" varStatus="s" items="${roleTypeIds}">
|
||||
<c:if test="${rtid==rt.id}">
|
||||
${f:h(rt.name)}<br />
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach></td>
|
||||
<td>${f:br(f:h(permissions))}<la:hidden
|
||||
property="permissions" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.label_type" /></th>
|
||||
|
|
|
@ -94,20 +94,16 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roleTypeIds" class="col-sm-3 control-label"><la:message
|
||||
<label for="permissions" class="col-sm-3 control-label"><la:message
|
||||
key="labels.role_type" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="roleTypeIds" />
|
||||
<la:select property="roleTypeIds" multiple="true"
|
||||
styleClass="form-control">
|
||||
<c:forEach var="rt" varStatus="s" items="${roleTypeItems}">
|
||||
<la:option value="${f:u(rt.id)}">${f:h(rt.name)}</la:option>
|
||||
</c:forEach>
|
||||
</la:select>
|
||||
<la:errors property="permissions" />
|
||||
<la:textarea property="permissions" styleClass="form-control"
|
||||
rows="5" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roleTypeIds" class="col-sm-3 control-label"><la:message
|
||||
<label for="labelTypeIds" class="col-sm-3 control-label"><la:message
|
||||
key="labels.label_type" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="labelTypeIds" />
|
||||
|
|
|
@ -114,14 +114,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.role_type" /></th>
|
||||
<td><c:forEach var="rt" varStatus="s"
|
||||
items="${roleTypeItems}">
|
||||
<c:forEach var="rtid" varStatus="s" items="${roleTypeIds}">
|
||||
<c:if test="${rtid==rt.id}">
|
||||
${f:h(rt.name)}<br />
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach></td>
|
||||
<td>${f:br(f:h(permissions))}<la:hidden
|
||||
property="permissions" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.label_type" /></th>
|
||||
|
|
|
@ -157,20 +157,16 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roleTypeIds" class="col-sm-3 control-label"><la:message
|
||||
<label for="permissions" class="col-sm-3 control-label"><la:message
|
||||
key="labels.role_type" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="roleTypeIds" />
|
||||
<la:select property="roleTypeIds" multiple="true"
|
||||
styleClass="form-control">
|
||||
<c:forEach var="rt" varStatus="s" items="${roleTypeItems}">
|
||||
<la:option value="${f:u(rt.id)}">${f:h(rt.name)}</la:option>
|
||||
</c:forEach>
|
||||
</la:select>
|
||||
<la:errors property="permissions" />
|
||||
<la:textarea property="permissions" styleClass="form-control"
|
||||
rows="5" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roleTypeIds" class="col-sm-3 control-label"><la:message
|
||||
<label for="labelTypeIds" class="col-sm-3 control-label"><la:message
|
||||
key="labels.label_type" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="labelTypeIds" />
|
||||
|
|
|
@ -70,14 +70,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.role_type" /></th>
|
||||
<td><c:forEach var="rt" varStatus="s"
|
||||
items="${roleTypeItems}">
|
||||
<c:forEach var="rtid" varStatus="s" items="${roleTypeIds}">
|
||||
<c:if test="${rtid==rt.id}">
|
||||
${f:h(rt.name)}<br />
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach></td>
|
||||
<td>${f:br(f:h(permissions))}<la:hidden
|
||||
property="permissions" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.sortOrder" /></th>
|
||||
|
|
|
@ -79,16 +79,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roleTypeIds" class="col-sm-3 control-label"><la:message
|
||||
<label for="permissions" class="col-sm-3 control-label"><la:message
|
||||
key="labels.role_type" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="roleTypeIds" />
|
||||
<la:select property="roleTypeIds" multiple="true"
|
||||
styleClass="form-control">
|
||||
<c:forEach var="rt" varStatus="s" items="${roleTypeItems}">
|
||||
<la:option value="${f:u(rt.id)}">${f:h(rt.name)}</la:option>
|
||||
</c:forEach>
|
||||
</la:select>
|
||||
<la:errors property="permissions" />
|
||||
<la:textarea property="permissions" styleClass="form-control"
|
||||
rows="5" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -99,10 +99,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<la:link styleClass="btn btn-success" href="/admin/roletype/createnew/${f:u(name)}">
|
||||
<i class="fa fa-plus-circle"></i>
|
||||
<la:message key="labels.role_button_create_crawler_role" />
|
||||
</la:link>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.roletype_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="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="roleType" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.roletype_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="${roleTypePager.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="${roleTypePager.allRecordCount > 0}">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><la:message key="labels.roletype_name" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="data" varStatus="s"
|
||||
items="${roleTypeItems}">
|
||||
<tr
|
||||
data-href="${contextPath}/admin/roletype/details/4/${f:u(data.id)}">
|
||||
<td>${f:h(data.name)}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="pager" value="${roleTypePager}" 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>
|
|
@ -1,81 +0,0 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.roletype_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="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="roletype" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.roletype_title_details" />
|
||||
</h1>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/breadcrumb.jsp"></jsp:include>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/roletype/">
|
||||
<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" />
|
||||
<la:hidden property="sortOrder" />
|
||||
<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-3"><la:message
|
||||
key="labels.roletype_name" /></th>
|
||||
<td>${f:h(name)}<la:hidden property="name" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.roletype_value" /></th>
|
||||
<td>${f:h(value)}<la:hidden property="value" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/buttons.jsp"></jsp:include>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
|
@ -1,82 +0,0 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.roletype_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="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="roleType" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.roletype_title_details" />
|
||||
</h1>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/breadcrumb.jsp"></jsp:include>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/roletype/" 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" />
|
||||
<la:hidden property="sortOrder" />
|
||||
<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.roletype_name" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="name" />
|
||||
<la:text property="name" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="value" class="col-sm-3 control-label"><la:message
|
||||
key="labels.roletype_value" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="value" />
|
||||
<la:text property="value" styleClass="form-control" />
|
||||
</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>
|
||||
</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>
|
|
@ -118,14 +118,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.role_type" /></th>
|
||||
<td><c:forEach var="rt" varStatus="s"
|
||||
items="${roleTypeItems}">
|
||||
<c:forEach var="rtid" varStatus="s" items="${roleTypeIds}">
|
||||
<c:if test="${rtid==rt.id}">
|
||||
${f:h(rt.name)}<br />
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach></td>
|
||||
<td>${f:br(f:h(permissions))}<la:hidden
|
||||
property="permissions" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.label_type" /></th>
|
||||
|
|
|
@ -165,16 +165,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roleTypeIds" class="col-sm-3 control-label"><la:message
|
||||
<label for="permissions" class="col-sm-3 control-label"><la:message
|
||||
key="labels.role_type" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="roleTypeIds" />
|
||||
<la:select property="roleTypeIds" multiple="true"
|
||||
styleClass="form-control">
|
||||
<c:forEach var="rt" varStatus="s" items="${roleTypeItems}">
|
||||
<la:option value="${f:u(rt.id)}">${f:h(rt.name)}</la:option>
|
||||
</c:forEach>
|
||||
</la:select>
|
||||
<la:errors property="permissions" />
|
||||
<la:textarea property="permissions" styleClass="form-control"
|
||||
rows="5" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -155,13 +155,6 @@
|
|||
<span><la:message key="labels.menu_duplicate_host" /></span>
|
||||
</la:link></li>
|
||||
|
||||
<li
|
||||
<c:if test="${param.menuType=='roleType'}">class="active"</c:if>><la:link
|
||||
href="/admin/roletype/">
|
||||
<i class='fa fa-circle-o'></i>
|
||||
<span><la:message key="labels.menu_role_type" /></span>
|
||||
</la:link></li>
|
||||
|
||||
</ul></li>
|
||||
<li
|
||||
class="treeview <c:if test="${param.menuCategoryType=='user'}">active</c:if>"><a
|
||||
|
|
Loading…
Add table
Reference in a new issue