|
@@ -169,7 +169,6 @@ public abstract class AbstractFessFileTransformer extends AbstractTransformer im
|
|
final CrawlingInfoHelper crawlingInfoHelper = ComponentUtil.getCrawlingInfoHelper();
|
|
final CrawlingInfoHelper crawlingInfoHelper = ComponentUtil.getCrawlingInfoHelper();
|
|
final String sessionId = crawlingInfoHelper.getCanonicalSessionId(responseData.getSessionId());
|
|
final String sessionId = crawlingInfoHelper.getCanonicalSessionId(responseData.getSessionId());
|
|
final PathMappingHelper pathMappingHelper = ComponentUtil.getPathMappingHelper();
|
|
final PathMappingHelper pathMappingHelper = ComponentUtil.getPathMappingHelper();
|
|
- final SambaHelper sambaHelper = ComponentUtil.getSambaHelper();
|
|
|
|
final CrawlingConfigHelper crawlingConfigHelper = ComponentUtil.getCrawlingConfigHelper();
|
|
final CrawlingConfigHelper crawlingConfigHelper = ComponentUtil.getCrawlingConfigHelper();
|
|
final CrawlingConfig crawlingConfig = crawlingConfigHelper.get(responseData.getSessionId());
|
|
final CrawlingConfig crawlingConfig = crawlingConfigHelper.get(responseData.getSessionId());
|
|
final Date documentExpires = crawlingInfoHelper.getDocumentExpires(crawlingConfig);
|
|
final Date documentExpires = crawlingInfoHelper.getDocumentExpires(crawlingConfig);
|
|
@@ -293,25 +292,10 @@ public abstract class AbstractFessFileTransformer extends AbstractTransformer im
|
|
labelTypeSet.addAll(labelTypeHelper.getMatchedLabelValueSet(url));
|
|
labelTypeSet.addAll(labelTypeHelper.getMatchedLabelValueSet(url));
|
|
putResultDataBody(dataMap, fessConfig.getIndexFieldLabel(), labelTypeSet);
|
|
putResultDataBody(dataMap, fessConfig.getIndexFieldLabel(), labelTypeSet);
|
|
// role: roleType
|
|
// role: roleType
|
|
- final List<String> roleTypeList = new ArrayList<String>();
|
|
|
|
|
|
+ final List<String> roleTypeList = getRoleTypes(responseData);
|
|
for (final String roleType : crawlingConfig.getRoleTypeValues()) {
|
|
for (final String roleType : crawlingConfig.getRoleTypeValues()) {
|
|
roleTypeList.add(roleType);
|
|
roleTypeList.add(roleType);
|
|
}
|
|
}
|
|
- if (fessConfig.isSmbRoleFromFile() && responseData.getUrl().startsWith("smb://")) {
|
|
|
|
- final ACE[] aces = (ACE[]) responseData.getMetaDataMap().get(SmbClient.SMB_ACCESS_CONTROL_ENTRIES);
|
|
|
|
- if (aces != null) {
|
|
|
|
- for (final ACE item : aces) {
|
|
|
|
- final SID sid = item.getSID();
|
|
|
|
- final String accountId = sambaHelper.getAccountId(sid);
|
|
|
|
- if (accountId != null) {
|
|
|
|
- roleTypeList.add(accountId);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (getLogger().isDebugEnabled()) {
|
|
|
|
- getLogger().debug("smbUrl:" + responseData.getUrl() + " roleType:" + roleTypeList.toString());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
putResultDataBody(dataMap, fessConfig.getIndexFieldRole(), roleTypeList);
|
|
putResultDataBody(dataMap, fessConfig.getIndexFieldRole(), roleTypeList);
|
|
// TODO date
|
|
// TODO date
|
|
// lang
|
|
// lang
|
|
@@ -453,6 +437,29 @@ public abstract class AbstractFessFileTransformer extends AbstractTransformer im
|
|
return getHost(url);
|
|
return getHost(url);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ protected List<String> getRoleTypes(final ResponseData responseData) {
|
|
|
|
+ final List<String> roleTypeList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ if (fessConfig.isSmbRoleFromFile() && responseData.getUrl().startsWith("smb://")) {
|
|
|
|
+ final SambaHelper sambaHelper = ComponentUtil.getSambaHelper();
|
|
|
|
+ final ACE[] aces = (ACE[]) responseData.getMetaDataMap().get(SmbClient.SMB_ACCESS_CONTROL_ENTRIES);
|
|
|
|
+ if (aces != null) {
|
|
|
|
+ for (final ACE item : aces) {
|
|
|
|
+ final SID sid = item.getSID();
|
|
|
|
+ final String accountId = sambaHelper.getAccountId(sid);
|
|
|
|
+ if (accountId != null) {
|
|
|
|
+ roleTypeList.add(accountId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (getLogger().isDebugEnabled()) {
|
|
|
|
+ getLogger().debug("smbUrl:" + responseData.getUrl() + " roleType:" + roleTypeList.toString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return roleTypeList;
|
|
|
|
+ }
|
|
|
|
+
|
|
protected String getSiteOnFile(final String url, final String encoding) {
|
|
protected String getSiteOnFile(final String url, final String encoding) {
|
|
if (StringUtil.isBlank(url)) {
|
|
if (StringUtil.isBlank(url)) {
|
|
return StringUtil.EMPTY; // empty
|
|
return StringUtil.EMPTY; // empty
|