fix #55
This commit is contained in:
parent
7846a64b23
commit
9c5fc38279
2 changed files with 33 additions and 7 deletions
|
@ -100,10 +100,22 @@ public class WebFsIndexHelper implements Serializable {
|
|||
|
||||
public void crawl(final String sessionId, final List<Long> webConfigIdList,
|
||||
final List<Long> fileConfigIdList, final SolrGroup solrGroup) {
|
||||
final List<WebCrawlingConfig> webConfigList = webCrawlingConfigService
|
||||
.getWebCrawlingConfigListByIds(webConfigIdList);
|
||||
final List<FileCrawlingConfig> fileConfigList = fileCrawlingConfigService
|
||||
.getFileCrawlingConfigListByIds(fileConfigIdList);
|
||||
final boolean runAll = webConfigIdList == null
|
||||
&& fileConfigIdList == null;
|
||||
final List<WebCrawlingConfig> webConfigList;
|
||||
if (runAll || webConfigIdList != null) {
|
||||
webConfigList = webCrawlingConfigService
|
||||
.getWebCrawlingConfigListByIds(webConfigIdList);
|
||||
} else {
|
||||
webConfigList = Collections.emptyList();
|
||||
}
|
||||
final List<FileCrawlingConfig> fileConfigList;
|
||||
if (runAll || fileConfigIdList != null) {
|
||||
fileConfigList = fileCrawlingConfigService
|
||||
.getFileCrawlingConfigListByIds(fileConfigIdList);
|
||||
} else {
|
||||
fileConfigList = Collections.emptyList();
|
||||
}
|
||||
|
||||
if (webConfigList.isEmpty() && fileConfigList.isEmpty()) {
|
||||
// nothing
|
||||
|
|
|
@ -52,11 +52,17 @@ public class CrawlJob {
|
|||
final String[] fileConfigIds, final String[] dataConfigIds,
|
||||
final String operation) {
|
||||
final StringBuilder resultBuf = new StringBuilder();
|
||||
final boolean runAll = webConfigIds == null && fileConfigIds == null
|
||||
&& dataConfigIds == null;
|
||||
|
||||
resultBuf.append("Session Id: ").append(sessionId).append("\n");
|
||||
resultBuf.append("Web Config Id:");
|
||||
if (webConfigIds == null) {
|
||||
resultBuf.append(" ALL\n");
|
||||
if (runAll) {
|
||||
resultBuf.append(" ALL\n");
|
||||
} else {
|
||||
resultBuf.append(" NONE\n");
|
||||
}
|
||||
} else {
|
||||
for (final String id : webConfigIds) {
|
||||
resultBuf.append(' ').append(id);
|
||||
|
@ -65,7 +71,11 @@ public class CrawlJob {
|
|||
}
|
||||
resultBuf.append("File Config Id:");
|
||||
if (fileConfigIds == null) {
|
||||
resultBuf.append(" ALL\n");
|
||||
if (runAll) {
|
||||
resultBuf.append(" ALL\n");
|
||||
} else {
|
||||
resultBuf.append(" NONE\n");
|
||||
}
|
||||
} else {
|
||||
for (final String id : fileConfigIds) {
|
||||
resultBuf.append(' ').append(id);
|
||||
|
@ -74,7 +84,11 @@ public class CrawlJob {
|
|||
}
|
||||
resultBuf.append("Data Config Id:");
|
||||
if (dataConfigIds == null) {
|
||||
resultBuf.append(" ALL\n");
|
||||
if (runAll) {
|
||||
resultBuf.append(" ALL\n");
|
||||
} else {
|
||||
resultBuf.append(" NONE\n");
|
||||
}
|
||||
} else {
|
||||
for (final String id : dataConfigIds) {
|
||||
resultBuf.append(' ').append(id);
|
||||
|
|
Loading…
Add table
Reference in a new issue