001/**
002 * Copyright 2005-2015 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 edu.sampleu.demo.kitchensink;
017
018import org.apache.commons.lang.RandomStringUtils;
019import org.kuali.rice.krad.util.GlobalVariables;
020import org.kuali.rice.krad.web.controller.UifControllerBase;
021import org.kuali.rice.krad.web.form.UifFormBase;
022import org.springframework.stereotype.Controller;
023import org.springframework.validation.BindingResult;
024import org.springframework.web.bind.annotation.ModelAttribute;
025import org.springframework.web.bind.annotation.RequestMapping;
026import org.springframework.web.servlet.ModelAndView;
027
028import javax.servlet.http.HttpServletRequest;
029import javax.servlet.http.HttpServletResponse;
030
031/**
032 * a controller for the configuration test view
033 *
034 * @author Kuali Rice Team (rice.collab@kuali.org)
035 */
036@Controller
037@RequestMapping(value = "/configuration-test-view-uif-controller")
038public class ConfigurationTestViewUifController extends UifControllerBase {
039
040    @Override
041    protected UifFormBase createInitialForm() {
042        return new UifComponentsTestForm();
043    }
044
045    /**
046     * places a message containing apostrophes into the message map for display as a growl
047     */
048    @Override
049    @RequestMapping(params = "methodToCall=start")
050    public ModelAndView start(UifFormBase form) {
051        String randomYear = RandomStringUtils.randomNumeric(2);
052        GlobalVariables.getMessageMap().putInfo("growl.testing.apostrophe", "sampleapp.growl.testmsg", "'" + randomYear);
053
054        return super.start(form);
055    }
056}