blob: f5a9e7556b531390f1de91242112878d5d52151d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
package com.netscape.cms.servlet.profile;
import java.util.Enumeration;
import java.util.Locale;
import com.netscape.certsrv.base.IArgBlock;
import com.netscape.certsrv.profile.EProfileException;
import com.netscape.certsrv.profile.IProfileInput;
import com.netscape.certsrv.profile.ProfileInput;
import com.netscape.certsrv.request.IRequest;
public class ProfileInputFactory {
public static ProfileInput create(IProfileInput input, IRequest request, Locale locale) throws EProfileException {
ProfileInput ret = new ProfileInput();
ret.setInputId(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) {
ret.setInputAttr(name, value);
}
}
return ret;
}
public static ProfileInput create(IProfileInput input, IArgBlock params, Locale locale) throws EProfileException {
ProfileInput ret = new ProfileInput();
ret.setInputId(input.getName(locale));
Enumeration<String> names = input.getValueNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
String value = params.getValueAsString(name, null);
if (value != null) {
ret.setInputAttr(name, value);
}
}
return ret;
}
}
|