Skip to content

Commit

Permalink
Set enable/disable deduplication in hopefully the right place this time.
Browse files Browse the repository at this point in the history
  • Loading branch information
csrster committed Nov 24, 2016
1 parent 1b893ff commit 047fe3a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public boolean canAccept(Job job, DomainConfiguration cfg, DomainConfiguration p
protected void editJobOrderXml(Job job) {
HeritrixTemplate doc = job.getOrderXMLdoc();
doc.enableOrDisableDeduplication(DEDUPLICATION_ENABLED);
if (DEDUPLICATION_ENABLED) {
/* if (DEDUPLICATION_ENABLED) {
// Check that the Deduplicator element is present in the
// OrderXMl and enabled. If missing or disabled log a warning
Expand All @@ -220,7 +220,7 @@ protected void editJobOrderXml(Job job) {
doc.removeDeduplicatorIfPresent();
job.setOrderXMLDoc(doc);
log.info("Removed DeDuplicator element because Deduplication is disabled");
}
}*/
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,9 @@ public void removeDeduplicatorIfPresent() {
}

@Override public void enableOrDisableDeduplication(boolean enabled) {
template = template.replace(DEDUPLICATION_ENABLED_PLACEHOLDER, Boolean.toString(enabled).toLowerCase());
final String replacement = Boolean.toString(enabled).toLowerCase();
log.debug("Replacing deduplication enabled placeholder {} with {}.", DEDUPLICATION_ENABLED_PLACEHOLDER, replacement);
this.template = template.replace(DEDUPLICATION_ENABLED_PLACEHOLDER, replacement);
}

//<property name="metadataItems">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ public Job(Long harvestID, DomainConfiguration cfg, HeritrixTemplate orderXMLdoc

setAttributes(cfg.getAttributesAndTypes());

orderXMLdoc.enableOrDisableDeduplication(Settings.getBoolean(HarvesterSettings.DEDUPLICATION_ENABLED));

status = JobStatus.NEW;
}

Expand Down

0 comments on commit 047fe3a

Please sign in to comment.