Package org.jasig.portal.portlets.iframe

Source Code of org.jasig.portal.portlets.iframe.IFramePortletController

/**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.jasig.portal.portlets.iframe;

import java.util.HashMap;
import java.util.Map;

import javax.portlet.PortletPreferences;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.springframework.web.portlet.ModelAndView;
import org.springframework.web.portlet.mvc.AbstractController;

/**
* This portlet renders content identified by a URL within an inline browser
* frame. See
* <a href="http://www.htmlhelp.com/reference/html40/special/iframe.html">
* http://www.htmlhelp.com/reference/html40/special/iframe.html</a> for more
* information on inline frames.
*
* @author Susan Bramhall
* @author Jen Bourey, jbourey@unicon.net
* @version $Revision: 19776 $
*/
public class IFramePortletController extends AbstractController {

  @Override
  protected ModelAndView handleRenderRequestInternal(RenderRequest request,
      RenderResponse response) throws Exception {
   
    Map<String,Object> model = new HashMap<String,Object>();
   
    // get the IFrame target URL and the configured height of the IFrame
    // window from the portlet preferences
    PortletPreferences preferences = request.getPreferences();
    model.put("url", preferences.getValue("url", null));
    model.put("height", preferences.getValue("height", null));
   
    return new ModelAndView("/jsp/IFrame/iframePortlet", model);
  }

}
TOP

Related Classes of org.jasig.portal.portlets.iframe.IFramePortletController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.