summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cms/servlet/profile/model/ProfileInput.java
diff options
context:
space:
mode:
Diffstat (limited to 'base/common/src/com/netscape/cms/servlet/profile/model/ProfileInput.java')
-rw-r--r--base/common/src/com/netscape/cms/servlet/profile/model/ProfileInput.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/profile/model/ProfileInput.java b/base/common/src/com/netscape/cms/servlet/profile/model/ProfileInput.java
index 47cfdb73..582e1089 100644
--- a/base/common/src/com/netscape/cms/servlet/profile/model/ProfileInput.java
+++ b/base/common/src/com/netscape/cms/servlet/profile/model/ProfileInput.java
@@ -18,8 +18,10 @@
package com.netscape.cms.servlet.profile.model;
import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import javax.xml.bind.annotation.XmlAttribute;
@@ -28,8 +30,28 @@ import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import com.netscape.certsrv.profile.EProfileException;
+import com.netscape.certsrv.profile.IProfileInput;
+import com.netscape.certsrv.request.IRequest;
+
public class ProfileInput {
+ public ProfileInput() {
+ // required for jaxb
+ }
+
+ public ProfileInput(IProfileInput input, IRequest request, Locale locale) throws EProfileException {
+ this.inputId = input.getName(locale);
+ Enumeration<String> names = input.getValueNames();
+ while (names.hasMoreElements()) {
+ String name = names.nextElement();
+ String value = input.getValue(name, locale, request);
+ if (value != null) {
+ InputAttrs.put(name, value);
+ }
+ }
+ }
+
@XmlElement
public String getInputId() {
return inputId;