View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krms.builder;
17  
18  import org.apache.log4j.Logger;
19  import org.kuali.rice.krms.dto.PropositionEditor;
20  
21  import java.util.HashMap;
22  import java.util.List;
23  import java.util.Map;
24  
25  /**
26   * @author Kuali Student Team
27   */
28  public class SimpleTextComponentBuilder implements ComponentBuilder<PropositionEditor>{
29  
30      private final static Logger LOG = Logger.getLogger(SimpleTextComponentBuilder.class);
31  
32      private static final String TEXT_KEY = "kuali.term.parameter.type.free.text";
33  
34      @Override
35      public List<String> getComponentIds() {
36          return null;  //To change body of implemented methods use File | Settings | File Templates.
37      }
38  
39      @Override
40      public void resolveTermParameters(PropositionEditor propositionEditor, Map<String, String> termParameters) {
41          String text = termParameters.get(TEXT_KEY);
42          propositionEditor.setTermParameter(text);
43      }
44  
45      @Override
46      public Map<String, String> buildTermParameters(PropositionEditor propositionEditor) {
47          Map<String, String> termParameters = new HashMap<String, String>();
48          termParameters.put(TEXT_KEY, propositionEditor.getTermParameter());
49  
50          LOG.info(termParameters);
51  
52          return termParameters;
53      }
54  
55      @Override
56      public void onSubmit(PropositionEditor propositionEditor) {
57          //To change body of implemented methods use File | Settings | File Templates.
58      }
59  
60      @Override
61      public void validate(PropositionEditor propositionEditor) {
62          //To change body of implemented methods use File | Settings | File Templates.
63      }
64  }