aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common/src/main/java
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-11-25 14:39:55 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-11-25 14:39:55 +0100
commit93168e6b76bd0716e976c36e8e91b7c46f092e84 (patch)
tree30a1146217a5f1811c70bc286205282c0d3e22f0 /pdf-as-common/src/main/java
parent7b402478784fe7237ade7c32d07f034fd7083bb7 (diff)
downloadpdf-as-4-93168e6b76bd0716e976c36e8e91b7c46f092e84.tar.gz
pdf-as-4-93168e6b76bd0716e976c36e8e91b7c46f092e84.tar.bz2
pdf-as-4-93168e6b76bd0716e976c36e8e91b7c46f092e84.zip
Fixed configuration profile building
Diffstat (limited to 'pdf-as-common/src/main/java')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java31
1 files changed, 26 insertions, 5 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java
index 71894793..56631a7e 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java
@@ -28,6 +28,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -146,6 +147,9 @@ public class Settings implements ISettings, IProfileConstants {
}
}
+ logger.debug("Settings: {}",
+ properties.size());
+
// Resolve Parent Structures ...
while (!profiles.isEmpty()) {
List<String> removes = new ArrayList<String>();
@@ -166,15 +170,29 @@ public class Settings implements ISettings, IProfileConstants {
String parentBase = "sig_obj." + parent.getName();
String childBase = "sig_obj."
+ entry.getValue().getName();
+
Iterator<String> parentKeyIt = this.getKeys(
- parentBase).iterator();
+ parentBase+".").iterator();
while (parentKeyIt.hasNext()) {
String key = parentKeyIt.next();
String keyToCopy = key.substring(parentBase
.length());
- if(!this.hasValue(childBase+keyToCopy)) {
- properties.setProperty(childBase+keyToCopy,
- this.getValue(parentBase+keyToCopy));
+ //logger.debug("Profile: {} => {}",
+ // key, childBase+keyToCopy);
+ String sourceKey = parentBase+keyToCopy;
+ String targetKey = childBase+keyToCopy;
+
+ int idx = targetKey.indexOf("NOTE");
+ if(idx > 0) {
+ if(targetKey.indexOf("NOTE", idx+1) > 0) {
+ logger.debug("Profile: {} => {}",
+ parentBase, childBase);
+ }
+ }
+
+ if(!this.hasValue(targetKey)) {
+ properties.setProperty(targetKey,
+ this.getValue(sourceKey));
//logger.debug("Replaced: {} with Value from {}",
// childBase+keyToCopy, parentBase+keyToCopy);
} else {
@@ -189,7 +207,6 @@ public class Settings implements ISettings, IProfileConstants {
}
}
}
-
// Remove all Profiles from Remove List
@@ -209,6 +226,10 @@ public class Settings implements ISettings, IProfileConstants {
profiles.remove(removeIt.next());
}
}
+
+ logger.debug("Settings: {}",
+ properties.size());
+
}
public void loadSettings(File workDirectory) throws PdfAsSettingsException {