1 5 package org.exoplatform.portlets.iframe.component; 6 7 import javax.faces.context.FacesContext; 8 import javax.faces.context.ExternalContext; 9 import javax.portlet.PortletRequest ; 10 import javax.portlet.PortletPreferences ; 11 12 import org.apache.commons.logging.Log; 13 import org.exoplatform.faces.core.component.UIExoComponentBase; 14 20 public class UIIframe extends UIExoComponentBase { 21 public static final String COMPONENT_TYPE = "UIIframe"; 22 public static final String VIEW_ID = "rss"; 23 24 private String frameSource_ ; 25 private String frameWidth_ ; 26 private String frameHeight_ ; 27 28 public UIIframe() throws Exception { 29 FacesContext context = FacesContext.getCurrentInstance() ; 30 PortletRequest request = (PortletRequest) context.getExternalContext().getRequest(); 31 PortletPreferences prefs = request.getPreferences() ; 32 frameSource_ = prefs.getValue("iframe-src" , "/web/iframe-info.html") ; 33 frameWidth_ = prefs.getValue("iframe-width", "*") ; 34 frameHeight_ = prefs.getValue("iframe-height", "*") ; 35 setId(VIEW_ID) ; 36 } 37 38 public String getFrameSource() { return frameSource_ ; } 39 public String getFrameWidth() { return frameWidth_ ; } 40 public String getFrameHeight() { return frameHeight_ ; } 41 42 public String getComponentType() { return COMPONENT_TYPE; } 43 public String getRendererType() { return "IframeRenderer"; } 44 45 public void decode(FacesContext context) { 46 } 47 } 48 | Popular Tags |