Skip to content

Commit

Permalink
allow just one file to be exported for generics
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenHankiewicz committed Aug 12, 2024
1 parent 5062750 commit 25c3ed6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class GenericExporter {

// keep a list of all image files as they need to be renamed
private Map<String, String> fileMap;
private int fileCounter;
private VariableReplacer vr;

@Getter
Expand Down Expand Up @@ -80,7 +79,6 @@ public boolean startExport() {
vr = new VariableReplacer(dd, prefs, process, null);
problems = new ArrayList<>();
fileMap = new HashMap<String, String>();
fileCounter = 0;
log.debug("Export directory for AdmBsmeExportPlugin: " + targetFolder);
DocStruct topStruct = dd.getLogicalDocStruct();

Expand All @@ -97,7 +95,7 @@ public boolean startExport() {
String rightsDetails = vr.replace(config.getString("/rightsDetails"));
String source = vr.replace(config.getString("/source"));
String mediaType = vr.replace(config.getString("/mediaType"));
// String mediaGroup = vr.replace(config.getString("/mediaGroup"));
// String mediaGroup = vr.replace(config.getString("/mediaGroup"));
String sourceOrganisation = vr.replace(config.getString("/sourceOrganisation"));
String eventDate = vr.replace(config.getString("/eventDate"));
String eventName = vr.replace(config.getString("/eventName"));
Expand All @@ -106,7 +104,7 @@ public boolean startExport() {
String personsInImage = vr.replace(config.getString("/personsInImage"));
String locations = vr.replace(config.getString("/locations"));
String description = vr.replace(config.getString("/description"));
// String editorInChief = vr.replace(config.getString("/editorInChief"));
// String editorInChief = vr.replace(config.getString("/editorInChief"));
String format = vr.replace(config.getString("/format"));
String backprint = vr.replace(config.getString("/backprint"));

Expand Down Expand Up @@ -160,8 +158,7 @@ public boolean startExport() {
// get the new file name for the image and reuse if created previously
String exportFileName = fileMap.get(realFileNameWithoutExtension);
if (exportFileName == null) {
String counter = String.format("%04d", ++fileCounter);
exportFileName = identifier + "-" + counter;
exportFileName = identifier;
fileMap.put(realFileNameWithoutExtension, exportFileName);
}

Expand Down Expand Up @@ -226,6 +223,7 @@ public boolean startExport() {
if (StorageProvider.getInstance().isFileExists(txtFile.toPath())) {
files.addContent(new Element("text").setText(exportFileName + ".txt").setAttribute("Format", "text/plain"));
}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class SlideExporter {

// keep a list of all image files as they need to be renamed
private Map<String, String> fileMap;
private int fileCounter;
private VariableReplacer vr;

@Getter
Expand Down Expand Up @@ -79,7 +78,6 @@ public boolean startExport() {
vr = new VariableReplacer(dd, prefs, process, null);
problems = new ArrayList<>();
fileMap = new HashMap<String, String>();
fileCounter = 0;
log.debug("Export directory for AdmBsmeExportPlugin: " + targetFolder);
DocStruct topStruct = dd.getLogicalDocStruct();

Expand All @@ -96,7 +94,7 @@ public boolean startExport() {
String rightsDetails = vr.replace(config.getString("/rightsDetails"));
String source = vr.replace(config.getString("/source"));
String mediaType = vr.replace(config.getString("/mediaType"));
String mediaGroup = vr.replace(config.getString("/mediaGroup"));
//String mediaGroup = vr.replace(config.getString("/mediaGroup"));
String sourceOrganisation = vr.replace(config.getString("/sourceOrganisation"));
String eventDate = vr.replace(config.getString("/eventDate"));
String eventName = vr.replace(config.getString("/eventName"));
Expand All @@ -106,7 +104,7 @@ public boolean startExport() {
String personsInImage = vr.replace(config.getString("/personsInImage"));
String locations = vr.replace(config.getString("/locations"));
String description = vr.replace(config.getString("/description"));
String editorInChief = vr.replace(config.getString("/editorInChief"));
//String editorInChief = vr.replace(config.getString("/editorInChief"));
String format = vr.replace(config.getString("/format"));

info.addContent(new Element("Rights_to_Use").setText(rightsToUse));
Expand Down

0 comments on commit 25c3ed6

Please sign in to comment.