diff options
author | wprinz <wprinz@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2008-05-30 09:57:51 +0000 |
---|---|---|
committer | wprinz <wprinz@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2008-05-30 09:57:51 +0000 |
commit | ee8b49fc0b85730d90e34a1fe81e4dbef49b36f7 (patch) | |
tree | 4d6f3f99ea301bb7df31c87d3976fb7807a4dbca /src | |
parent | 401225a15dd17795325d94fcfd151eac131edc8f (diff) | |
download | pdf-as-3-ee8b49fc0b85730d90e34a1fe81e4dbef49b36f7.tar.gz pdf-as-3-ee8b49fc0b85730d90e34a1fe81e4dbef49b36f7.tar.bz2 pdf-as-3-ee8b49fc0b85730d90e34a1fe81e4dbef49b36f7.zip |
CR Unsichtbare Felder
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@265 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureTypeDefinition.java | 81 |
1 files changed, 74 insertions, 7 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureTypeDefinition.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureTypeDefinition.java index c8d8818..30ec211 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureTypeDefinition.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureTypeDefinition.java @@ -74,6 +74,22 @@ public class SignatureTypeDefinition implements Serializable * The settings reader reference
*/
private SettingsReader settings_ = null;
+
+ /**
+ * List of (visible) field definitions.
+ */
+ protected List field_definitions_ = null;
+
+ /**
+ * List of invisible field definitions.
+ *
+ * <p>
+ * If empty, all definitions are visible.
+ * </p>
+ */
+ protected List invisible_field_definitions = null;
+
+
/**
* The constructor of the signature type definition. It reads the configured
@@ -94,6 +110,48 @@ public class SignatureTypeDefinition implements Serializable readSigTable(SignatureTypes.MAIN_TABLE);
loadTypeDefinition();
readFieldDefinitions();
+ readInvisibleFieldDefinitions();
+ }
+
+ protected void readInvisibleFieldDefinitions()
+ {
+ this.invisible_field_definitions = new ArrayList();
+ for (int i = 0; i < SignatureTypes.REQUIRED_SIG_KEYS.length; i++)
+ {
+ String requiredKey = SignatureTypes.REQUIRED_SIG_KEYS[i];
+ if (!this.sortedKeys_.contains(requiredKey))
+ {
+ SignatureFieldDefinition sfd = readFieldDefinition(requiredKey);
+ this.invisible_field_definitions.add(sfd);
+ }
+ }
+ }
+
+ /**
+ * Returns the List of invisible field definitions, if any.
+ *
+ * <p>
+ * Invisible field definitions are the field definitions of required fields that are not explicitely specified in the signature profile.
+ * </p>
+ * <p>
+ * Note that the concept of invisible fields can only be used by binary signatures.
+ * </p>
+ *
+ * @return Returns the List of invisible field definitions, if any.
+ */
+ public List getInvisibleFieldDefinitions()
+ {
+ return this.invisible_field_definitions;
+ }
+
+ /**
+ * Tells, if the signature type is text-extractable, which means that all required fields are visible.
+ *
+ * @return Returns true, if the signature type is text-extractable.
+ */
+ public boolean isTextExtractable()
+ {
+ return this.invisible_field_definitions.isEmpty();
}
/**
@@ -367,7 +425,7 @@ public class SignatureTypeDefinition implements Serializable protected String getSettingsKeyBase()
{
- return SignatureTypes.SIG_OBJ + type_;
+ return getSettingsKeyBase(type_);
}
/**
@@ -385,11 +443,7 @@ public class SignatureTypeDefinition implements Serializable sfd.caption = this.settings_.getValueFromKey(getSettingsKeyBase() + ".key." + field_name);
sfd.value = this.settings_.getValueFromKey(getSettingsKeyBase() + type_ + ".value." + field_name);
sfd.placeholder_length = -1;
- String phlen_str = this.settings_.getValueFromKey(getSettingsKeyBase() + ".phlength." + field_name);
- if (phlen_str == null)
- {
- phlen_str = this.settings_.getValueFromKey("defaults.phlength." + field_name);
- }
+ String phlen_str = readPhLenStringFromSettings(this.settings_, this.type_, field_name);
if (phlen_str != null)
{
sfd.placeholder_length = Integer.parseInt(phlen_str);
@@ -398,7 +452,20 @@ public class SignatureTypeDefinition implements Serializable return sfd;
}
- List field_definitions_ = null;
+ protected static String getSettingsKeyBase (String type)
+ {
+ return SignatureTypes.SIG_OBJ + type;
+ }
+
+ public static String readPhLenStringFromSettings(SettingsReader settings, String profile, String field_name)
+ {
+ String phlen_str = settings.getValueFromKey(getSettingsKeyBase(profile) + ".phlength." + field_name);
+ if (phlen_str == null)
+ {
+ phlen_str = settings.getValueFromKey("defaults.phlength." + field_name);
+ }
+ return phlen_str;
+ }
protected void readFieldDefinitions()
{
|