001/**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krms.builder;
017
018import org.apache.log4j.Logger;
019import org.kuali.rice.krms.dto.PropositionEditor;
020
021import java.util.HashMap;
022import java.util.List;
023import java.util.Map;
024
025/**
026 * @author Kuali Student Team
027 */
028public class SimpleTextComponentBuilder implements ComponentBuilder<PropositionEditor>{
029
030    private final static Logger LOG = Logger.getLogger(SimpleTextComponentBuilder.class);
031
032    private static final String TEXT_KEY = "kuali.term.parameter.type.free.text";
033
034    @Override
035    public List<String> getComponentIds() {
036        return null;  //To change body of implemented methods use File | Settings | File Templates.
037    }
038
039    @Override
040    public void resolveTermParameters(PropositionEditor propositionEditor, Map<String, String> termParameters) {
041        String text = termParameters.get(TEXT_KEY);
042        propositionEditor.setTermParameter(text);
043    }
044
045    @Override
046    public Map<String, String> buildTermParameters(PropositionEditor propositionEditor) {
047        Map<String, String> termParameters = new HashMap<String, String>();
048        termParameters.put(TEXT_KEY, propositionEditor.getTermParameter());
049
050        LOG.info(termParameters);
051
052        return termParameters;
053    }
054
055    @Override
056    public void onSubmit(PropositionEditor propositionEditor) {
057        //To change body of implemented methods use File | Settings | File Templates.
058    }
059
060    @Override
061    public void validate(PropositionEditor propositionEditor) {
062        //To change body of implemented methods use File | Settings | File Templates.
063    }
064}