001/**
002 * Copyright 2005-2018 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 */
016// begin Kuali Foundation modification
017package org.kuali.rice.kns.web.struts.form.pojo;
018
019// deleted some imports
020// end Kuali Foundation modification
021
022
023import org.apache.commons.beanutils.BeanUtilsBean;
024import org.apache.commons.beanutils.ConvertUtilsBean;
025import org.apache.commons.beanutils.PropertyUtilsBean;
026import org.apache.struts.action.ActionServlet;
027import org.apache.struts.action.PlugIn;
028import org.apache.struts.config.ModuleConfig;
029import org.kuali.rice.kns.web.struts.config.KualiControllerConfig;
030
031import javax.servlet.ServletException;
032import java.util.logging.Logger;
033
034/**
035 * begin Kuali Foundation modification
036 * This class is the POJO Plugin implementation of the PlugIn interface.
037 *
038 * @deprecated KNS Struts deprecated, use KRAD and the Spring MVC framework.
039 * end Kuali Foundation modification
040 * 
041 * @author Kuali Rice Team (rice.collab@kuali.org)
042 */
043// Kuali Foundation modification: class originally named SL plugin
044@Deprecated
045public class PojoPlugin implements PlugIn {
046    static final Logger logger = Logger.getLogger(PojoPlugin.class.getName());
047
048    public static void initBeanUtils() {
049        // begin Kuali Foundation modification
050        ConvertUtilsBean convUtils = new ConvertUtilsBean();
051        PropertyUtilsBean propUtils = new PojoPropertyUtilsBean();
052        BeanUtilsBean pojoBeanUtils = new BeanUtilsBean(convUtils, propUtils);
053
054        BeanUtilsBean.setInstance(pojoBeanUtils);
055        logger.fine("Initialized BeanUtilsBean with " + pojoBeanUtils);
056        // end Kuali Foundation modification
057    }
058
059    public PojoPlugin() {
060    }
061
062    public void init(ActionServlet servlet, ModuleConfig config) throws ServletException {
063        initBeanUtils();
064        // override the Struts ControllerConfig with our own wrapper that knows how to
065        // dynamically find max file upload size according to Rice run-time settings
066        config.setControllerConfig(new KualiControllerConfig(config.getControllerConfig()));
067    }
068
069    public void destroy() {
070    }
071}