1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.builder;
17
18 import org.kuali.rice.krms.dto.PropositionEditor;
19 import org.kuali.student.core.krms.dto.KSPropositionEditor;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
22
23 import java.util.HashMap;
24 import java.util.List;
25 import java.util.Map;
26
27
28
29
30 public class SimpleTextComponentBuilder implements ComponentBuilder<PropositionEditor>{
31
32 private static final Logger LOG = LoggerFactory.getLogger(SimpleTextComponentBuilder.class);
33
34 private static final String TEXT_KEY = "kuali.term.parameter.type.free.text";
35
36 @Override
37 public void initialize(PropositionEditor propositionEditor) {
38
39 }
40
41 @Override
42 public List<String> getComponentIds() {
43 return null;
44 }
45
46 @Override
47 public void resolveTermParameters(PropositionEditor propositionEditor, Map<String, String> termParameters) {
48 String text = termParameters.get(TEXT_KEY);
49 propositionEditor.setTermParameter(text);
50 }
51
52 @Override
53 public Map<String, String> buildTermParameters(PropositionEditor propositionEditor) {
54 Map<String, String> termParameters = new HashMap<String, String>();
55 termParameters.put(TEXT_KEY, propositionEditor.getTermParameter());
56
57 LOG.info("{}", termParameters);
58
59 return termParameters;
60 }
61
62 @Override
63 public void onSubmit(PropositionEditor propositionEditor) {
64
65 }
66
67 @Override
68 public void validate(PropositionEditor propositionEditor) {
69
70 }
71 }