Skip to content

Commit

Permalink
changed export configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rsehr committed Aug 23, 2024
1 parent b581e49 commit 8ffb22f
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ public class ArchiveManagementAdministrationPlugin implements IArchiveManagement
*/
public ArchiveManagementAdministrationPlugin() {
try {

ArchiveManagementManager.createTables();
vocabularyAPI = VocabularyAPIManager.getInstance();
} catch (APIException e) {
Expand Down Expand Up @@ -373,8 +374,8 @@ public ArchiveManagementAdministrationPlugin() {
}
}
}

}
readExportConfiguration();

} catch (ConfigurationException e2) {
log.error(e2);
Expand All @@ -394,7 +395,6 @@ public String checkDBConnection() {

@Override
public List<String> getPossibleDatabases() {
readConfiguration();
List<IRecordGroup> allRecordGroups = getRecordGroups();

List<String> databases = new ArrayList<>();
Expand Down Expand Up @@ -769,6 +769,17 @@ private void addFieldToNode(IEadEntry entry, IMetadataField toAdd) {
}
}

public void readExportConfiguration() {
exportConfiguration = new HashMap<>();
List<HierarchicalConfiguration> subconfig = xmlConfig.configurationsAt("/export/file");

for (HierarchicalConfiguration hc : subconfig) {
String filename = hc.getString("@name");
List<String> exportFolders = Arrays.asList(hc.getStringArray("/folder"));
exportConfiguration.put(filename, exportFolders);
}
}

/**
* read in all parameters from the configuration file
*
Expand All @@ -790,15 +801,7 @@ public void readConfiguration() {
}
}

exportConfiguration = new HashMap<>();

List<HierarchicalConfiguration> subconfig = xmlConfig.configurationsAt("/export/file");

for (HierarchicalConfiguration hc : subconfig) {
String filename = hc.getString("@name");
List<String> exportFolders = Arrays.asList(hc.getStringArray("/folder"));
exportConfiguration.put(filename, exportFolders);
}
readExportConfiguration();

nameSpaceRead = Namespace.getNamespace("ead", config.getString("/eadNamespaceRead", "urn:isbn:1-931666-22-9"));
nameSpaceWrite = Namespace.getNamespace("ead", config.getString("/eadNamespaceWrite", "urn:isbn:1-931666-22-9"));
Expand Down Expand Up @@ -3102,7 +3105,6 @@ public void eadExport() {
}

public void eadExportFrommOverview() {
readConfiguration();
recordGroup = ArchiveManagementManager.getRecordGroupByTitle(databaseName);
eadExport();
databaseName = null;
Expand Down

0 comments on commit 8ffb22f

Please sign in to comment.