Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add script for addData #4104

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public class CopierData {
*/
private final Process process;

private final Template template;

/**
* Creates a new CopierData bean with an additional destination metadata
* selector.
Expand All @@ -56,7 +54,6 @@ public CopierData(CopierData data, MetadataSelector destination) {
this.fileformat = data.fileformat;
this.process = data.process;
this.destination = destination;
this.template = new Template();
}

/**
Expand All @@ -71,7 +68,6 @@ public CopierData(LegacyMetsModsDigitalDocumentHelper fileformat, Process proces
this.fileformat = fileformat;
this.process = process;
this.destination = null;
this.template = new Template();
}

/**
Expand All @@ -84,7 +80,6 @@ public CopierData(LegacyMetsModsDigitalDocumentHelper fileformat, Process proces
*/
public CopierData(LegacyMetsModsDigitalDocumentHelper fileformat, Template template) {
this.fileformat = fileformat;
this.template = template;
this.destination = null;
this.process = new Process();
}
Expand Down Expand Up @@ -132,8 +127,8 @@ public LegacyPrefsHelper getPreferences() {
*
* @return the process title
*/
public String getProcessTitle() {
return process.getTitle();
public Process getProcess() {
return process;

}

Expand All @@ -145,6 +140,6 @@ public String getProcessTitle() {
*/
@Override
public String toString() {
return "{fileformat: " + fileformat.toString() + ", process: " + getProcessTitle() + '}';
return "{fileformat: " + fileformat.toString() + ", process: " + getProcess().getTitle() + '}';
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.commons.configuration.ConfigurationException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.kitodo.production.services.ServiceManager;

/**
* A data copier is a class that can be parametrised to copy data in processes
Expand Down Expand Up @@ -48,7 +49,7 @@ public DataCopier(String program) throws ConfigurationException {
List<List<String>> commands = parseDataCopyRules(program);
rules = new ArrayList<>(commands.size());
for (List<String> command : commands) {
rules.add(DataCopyrule.createFor(command));
rules.add(new DataCopyrule(command));
}
}

Expand Down Expand Up @@ -100,7 +101,7 @@ public void process(CopierData data) {
try {
rule.apply(data);
} catch (RuntimeException notApplicable) {
logger.info("Rule not applicable for \"{}\", skipped: {}", data.getProcessTitle(), rule);
logger.info("Rule not applicable for \"{}\", skipped: {}", data.getProcess().getTitle(), rule);
}
}
}
Expand Down
Loading