You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by bu...@apache.org on 2003/06/23 21:20:20 UTC

DO NOT REPLY [Bug 21024] New: - IFrame patch for parameter passing

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21024

IFrame patch for parameter passing

           Summary: IFrame patch for parameter passing
           Product: Jetspeed
           Version: 1.4b5-dev / CVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Portlets
        AssignedTo: jetspeed-dev@jakarta.apache.org
        ReportedBy: dan@dan.gotdns.org


This is the patch to the IFramePortlet which allows parameters to be passed to
the source url so things like single signon can work.  You can fill in the
parameters with what the page expects (username,password, etc...) and either
hardcode a value (Submit=true) or give it a variable which will be filled in
with the content of the current user's session.  Currently supported variables
include:

$username -> (runData.getUser().getUserName())
$password -> (runData.getUser().getPassword())
$clearpassword -> ((String)runData.getUser().getTemp("sessionPassword"))
$email -> (runData.getUser().getEmail())
$firstname -> (runData.getUser().getFirstName())
$lastname -> (runData.getUser().getLastName())
$name -> (runData.getUser().getName())

------------------------------------------------------------------------



Index: IFramePortlet.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/IFramePortlet.java,v
retrieving revision 1.5
diff -u -r1.5 IFramePortlet.java
--- IFramePortlet.java	11 Jun 2003 21:47:47 -0000	1.5
+++ IFramePortlet.java	23 Jun 2003 18:39:00 -0000
@@ -110,520 +110,860 @@
  *         <LI> <code>align</code> - top | bottom | middle | left |
<i>right</i> - How to align the IFRAME in relation to surrounding content.</LI>
  *         <LI> <code>marginwidth</code> - size of the top and bottom margin
inside the iframe. </LI>
  *         <LI> <code>marginheight</code> - size of the left and right margin
inside the iframe.</LI>
+ *         <LI> Parameter 1 - The first parameter to be passed to the IFrame
(or nothing).</LI>
+ *         <LI> Parameter 2 - The second parameter to be passed to the IFrame
(or nothing).</LI>
+ *         <LI> Parameter 3 - The third parameter to be passed to the IFrame
(or nothing).</LI>
+ *         <LI> Parameter 4 - The fourth parameter to be passed to the IFrame
(or nothing).</LI>
+ *         <LI> Parameter 5 - The fifth parameter to be passed to the IFrame
(or nothing).</LI>
+ *         <LI> Parameter 6 - The sixth parameter to be passed to the IFrame
(or nothing).</LI>
+ *         <LI> Value 1 - The first value or special variable to be passed to
the IFrame.</LI>
+ *         <LI> Value 2 - The second value or special variable to be passed to
the IFrame.</LI>
+ *         <LI> Value 3 - The third value or special variable to be passed to
the IFrame.</LI>
+ *         <LI> Value 4 - The fourth value or special variable to be passed to
the IFrame.</LI>
+ *         <LI> Value 5 - The fifth value or special variable to be passed to
the IFrame.</LI>
+ *         <LI> Value 6 - The sixth value or special variable to be passed to
the IFrame.</LI> 
  *     </UL>
  * 
- * @created February 23, 2002
+ *     <P>The following special variables are acceptedL </P>
+ *     <UL>
+ * 	   <LI> $username - the username of the user who logged in.</P>
+ *  	   <LI> $password - the jetspeed password of the user who logged in (may
be encrypted).</P>
+ *     	   <LI> $clearpassword - the cleartext password of the user who logged
in.</P>
+ * 	   <LI> $firstname - the first name (if available) of the user who logged
in.</P>
+ * 	   <LI> $lastname - the last name (if available) of the user who logged in.</P>
+ * 	   <LI> $name - the name (if available) of the user who logged in.</P>
+ * 	   <LI> $email - the email address (if available) of the user who logged
in.</P>
+ *     </UL>
+ * 
+ * @created June 18, 2003
  * @author <a href="mailto:wbarnhil@twcny.rr.com">Bill Barnhill</a>
  * @author <a href="mailto:morciuch@apache.org">Mark Orciuch</a>
+ * @author <a href="mailto:delder@novacoast.com">Dan Elder</a>
  * @version $Id: IFramePortlet.java,v 1.5 2003/06/11 21:47:47 morciuch Exp $
  * @see AbstractPortlet
  */
 
 public class IFramePortlet extends AbstractInstancePortlet
 {
-    static final String DEFAULT_NOTSUPP_MSG =
-            "[Your user agent does not support inline frames or is currently" 
-            + " configured not to display frames]";
-
-    static final String NO_SOURCE_MSG = "Please customize source for this IFrame";
-
-    static final String DEFAULT_SOURCE = "http://127.0.0.1";
-    static final String DEFAULT_WIDTH = null;
-    static final String DEFAULT_HEIGHT = null;
-    static final String DEFAULT_SCROLLING = "auto";
-    static final String DEFAULT_FRAMEBORDER = "1";
-
-    static final String PARAM_SOURCE = "source";
-    static final String PARAM_WIDTH = "width";
-    static final String PARAM_HEIGHT = "height";
-    static final String PARAM_SCROLLING = "scrolling";
-    static final String PARAM_FRAMEBORDER = "frameborder";
-    static final String PARAM_NAME = "name";
-    static final String PARAM_STYLE = "style";    
-    static final String PARAM_MARGINWIDTH = "marginwidth";
-    static final String PARAM_MARGINHEIGHT = "marginheight";
-    static final String PARAM_REFRESH = "refresh";
-    static final String PARAM_ALIGN = "align";
-    static final String WEBAPPROOT = "${" + TurbineConstants.WEBAPP_ROOT + "}";
-
-    private String iSource = DEFAULT_SOURCE;
-    private String iWidth = DEFAULT_WIDTH;
-    private String iHeight = DEFAULT_HEIGHT;
-    private String iScrolling = DEFAULT_SCROLLING;
-    private String iFrameBorder = DEFAULT_FRAMEBORDER;
-    private String iMarginWidth = null;
-    private String iMarginHeight = null;
-    private String iStyle = null;
-    private String iName = null;
-    private String iRefresh = null;
-    private String iAlign = null;
-
-    /**
-     *  Sets the source attribute of the IFramePortlet object
-     *
-     * @param  source  The new source value
-     * @since
-     */
-    public void setSource(String source)
-    {
-        if (source != null)
-        {
-            // Handle replacement variables
-            Hashtable parms = new Hashtable();
-            if (source.indexOf("${") >= 0) 
-            {
-                // Add all portlet parms
-                parms.putAll(this.getPortletConfig().getInitParameters());
-
-                // Add web app root variable replacement
-                try 
-                {
-                    ServerData sd = new ServerData(TurbineServlet.getServerName(),
-                                               
Integer.parseInt(TurbineServlet.getServerPort()),
-                                                TurbineServlet.getServerScheme(),
-                                                TurbineServlet.getContextPath(),
-                                                TurbineServlet.getContextPath());
-                    DynamicURI uri = new DynamicURI(sd);                
-                    parms.put(TurbineConstants.WEBAPP_ROOT, uri.toString() + "/");
-                } 
-                catch (Exception e) 
-                {
-                    Log.error(e);
-                }
-                // Add portlet name variable replacement
-                parms.put("portlet", this.getName());
-            }
-
-            this.iSource =
org.apache.jetspeed.util.StringUtils.replaceVars(source, parms);
-        }
-
-    }
-
-    /**
-     *  Sets the scrolling attribute of the IFramePortlet object
-     *
-     * @param  scrolling  The new scrolling value
-     * @since
-     */
-    public void setScrolling(String scrolling)
-    {
-        iScrolling = scrolling;
-    }
-
-
-    /**
-     *  Sets the width attribute of the IFramePortlet object
-     *
-     * @param  width  The new width value
-     * @since
-     */
-    public void setWidth(String width)
-    {
-        iWidth = width;
-    }
-
-
-    /**
-     *  Sets the height attribute of the IFramePortlet object
-     *
-     * @param  height  The new height value
-     * @since
-     */
-    public void setHeight(String height)
-    {
-        iHeight = height;
-    }
-
-
-    /**
-     *  Sets the frameBorder attribute of the IFramePortlet object
-     *
-     * @param  frameBorder  The new frameBorder value
-     * @since
-     */
-    public void setFrameBorder(String frameBorder)
-    {
-        iFrameBorder = frameBorder;
-    }
-
-    /**
-     *  Sets the width attribute of the IFramePortlet object
-     * 
-     * @param width  The new width value
-     */
-    public void setMarginWidth(String width) 
-    {
-
-        iMarginWidth = width;
-    }
-
-    /**
-     *  Sets the marginheight attribute of the IFramePortlet object
-     * 
-     * @param height The new height value
-     */
-    public void setMarginHeight(String height) 
-    {
-
-        iMarginHeight = height;
-    }
-
-    /**
-     *  Sets the marginheight attribute of the IFramePortlet object
-     * 
-     * @param height The new height value
-     */
-    public void setAlign(String value) 
-    {
-
-        iAlign = value;
-    }
-
-    /**
-     *  Sets the refresh meta tag
-     * 
-     * @param value in seconds
-     */
-    public void setRefresh(String value) 
-    {
-
-        iRefresh = value;
-    }
-
-
-    /**
-     * Sets the style of iframe. Some useful style effects:
-     * <UL>
-     * <LI>border:5px dashed purple
-     * <LI>border:5px dotted red
-     * <LI>border:5px double red
-     * <LI>border:5px inset red
-     * </UL>
-     * 
-     * @param value
-     */
-    public void setStyle(String value) 
-    {
-
-        iStyle = value;
-    }
-
-    /**
-     * Sets the name of iframe. This is useful when referencing
-     * the iframe as a target from another link.
-     * 
-     * @param value
-     */
-    public void setFrameName(String value) 
-    {
-
-        iName = value;
-    }
-
-    /**
-     *  This methods outputs the content of the portlet for a given request.
-     *
-     * @param  runData  the RunData object for the request
-     * @return          the content to be displayed to the user-agent
-     */
-    public ConcreteElement getContent(RunData runData)
-    {
-
-        // Reinitialize if user customized the portlet (this will be useful
-        // when portlet preferences include user name and password for
authentication or
-        // when other exposed iframe attributes are changed)
-        if
(org.apache.jetspeed.util.PortletSessionState.getPortletConfigChanged(this,
runData))
-        {
-            try {
-                this.init();
-            }
-            catch (PortletException pe)
-            {
-                Log.error(pe);
-            }
-        }
-
-        StringBuffer text = new StringBuffer();
-
-        if (getSource() == null || getSource().trim().length() == 0)
-        {
-            text.append(NO_SOURCE_MSG);
-            return (new StringElement(text.toString()));
-        }
-
-        text.append("<IFRAME ");
-
-        text.append("src = \"" + getSource() + "\" ");
-        if (getWidth() != null)
-        {
-            text.append("width = \"" + getWidth() + "\" ");
-        }
-
-        if (getHeight() != null)
-        {
-            text.append("height = \"" + getHeight() + "\" ");
-        }
-
-        if (getFrameName() != null) 
-        {
-            text.append("name = \"" + getFrameName() + "\" ");
-        }
-
-        if (getStyle() != null) 
-        {
-            text.append("style = \"" + getStyle() + "\" ");
-        }
-
-        if (getMarginWidth() != null) 
-        {
-            text.append("marginwidth = \"" + getMarginWidth() + "\" ");
-        }
-
-        if (getMarginHeight() != null) 
-        {
-            text.append("marginheight = \"" + getMarginHeight() + "\" ");
-        }
-
-        if (getAlign() != null) 
-        {
-            text.append("align = \"" + getAlign() + "\" ");
-        }
-
-        text.append("scrolling = \"" + getScrolling() + "\" ");
-        text.append("frameborder = \"" + getFrameBorder() + "\" ");
-        text.append(">");
-
-        text.append("</IFRAME>");
-        return (new StringElement(text.toString()));
-    }
-
-
-    /**
-     *  Gets the source attribute of the IFramePortlet object
-     *
-     * @return    The source value
-     */
-    public String getSource()
-    {
-        return iSource;
-    }
-
-
-    /**
-     *  Gets the scrolling attribute of the IFramePortlet object
-     *
-     * @return    The scrolling value
-     */
-    public String getScrolling()
-    {
-        return iScrolling;
-    }
-
-
-    /**
-     *  Gets the width attribute of the IFramePortlet object
-     *
-     * @return    The width value
-     */
-    public String getWidth()
-    {
-        return iWidth;
-    }
-
-
-    /**
-     *  Gets the height attribute of the IFramePortlet object
-     *
-     * @return    The height value
-     */
-    public String getHeight()
-    {
-        return iHeight;
-    }
-
-
-    /**
-     *  Gets whether to display a border around the IFRAME. "1" == yes.
-     *
-     * @return    The frameBorder value
-     */
-    public String getFrameBorder()
-    {
-        String trueValues = "1,yes,true";
-        if (iFrameBorder != null && trueValues.indexOf(iFrameBorder) >= 0)
-        {
-            return "1";
-        }
-        return "0";
-    }
-
-
-    /**
-     *  Gets the message displayed when IFRAME is not supported
-     *  This includes when Frames are turned off.
-     *
-     * @todo        This should be localized
-     * @return    The notSupportedMsg value
-     */
-    public String getNotSupportedMsg()
-    {
-        return DEFAULT_NOTSUPP_MSG;
-    }
-
-    /**
-     *  Gets the aling attribute of the IFramePortlet object
-     * 
-     * @return The marginheight value
-     */
-    public String getAlign() 
-    {
-
-        return iAlign;
-    }
-
-    /**
-     *  Gets iframe style
-     * 
-     * @return The style value
-     */
-    public String getStyle() 
-    {
-
-        return iStyle;
-    }
-
-    /**
-     *  Gets iframe name
-     * 
-     * @return The name value
-     */
-    public String getFrameName() 
-    {
-
-        return iName;
-    }
-
-    /**
-     *  Gets iframe refresh
-     * 
-     * @return The refresh value
-     */
-    public String getRefresh() 
-    {
-
-        return iRefresh;
-    }
-
-    /**
-     *  Gets the marginheight attribute of the IFramePortlet object
-     * 
-     * @return The marginheight value
-     */
-    public String getMarginHeight() 
-    {
-
-        return iMarginHeight;
-    }
-
-    /**
-     *  Gets the marginwidth attribute of the IFramePortlet object
-     * 
-     * @return The marginwidth value
-     */
-    public String getMarginWidth() 
-    {
-
-        return iMarginWidth;
-    }
-
-    /**
-     *  Initialize this portlet by setting inst. vars from InitParamaters.
-     *
-     * @throws  PortletException  Initialization failed
-     */
-    public void init() throws PortletException
-    {
-        // first make sure we propagate init
-        super.init();
-
-        try
-        {
-            PortletConfig config = this.getPortletConfig();
-            String param = null;
-
-            param = config.getInitParameter(PARAM_SOURCE);
-            if (param != null)
-            {
-                setSource(param);
-            }
-
-            param = config.getInitParameter(PARAM_WIDTH);
-            if (param != null)
-            {
-                setWidth(param);
-            }
-
-            param = config.getInitParameter(PARAM_HEIGHT);
-            if (param != null)
-            {
-                setHeight(param);
-            }
-
-            param = config.getInitParameter(PARAM_SCROLLING);
-            if (param != null)
-            {
-                setScrolling(param);
-            }
-
-            param = config.getInitParameter(PARAM_FRAMEBORDER);
-            if (param != null)
-            {
-                setFrameBorder(param);
-            }
-
-            param = config.getInitParameter(PARAM_STYLE);
-            if (param != null) 
-            {
-                setStyle(param);
-            }
-
-            param = config.getInitParameter(PARAM_NAME);
-            if (param != null) 
-            {
-                setFrameName(param);
-            }
-
-            param = config.getInitParameter(PARAM_REFRESH);
-            if (param != null) 
-            {
-                setRefresh(param);
-            }
-
-            param = config.getInitParameter(PARAM_MARGINWIDTH);
-            if (param != null) 
-            {
-                setMarginWidth(param);
-            }
-
-            param = config.getInitParameter(PARAM_MARGINHEIGHT);
-            if (param != null) 
-            {
-                setMarginHeight(param);
-            }
-
-            param = config.getInitParameter(PARAM_ALIGN);
-            if (param != null) 
-            {
-                setAlign(param);
-            }
-
-        }
-        catch (Exception e)
-        {
-            Log.error("Exception in init()", e);
-            throw new PortletException(e.getMessage());
-        }
-    }
-}
 
+	static final String DEFAULT_NOTSUPP_MSG =
+		"[Your user agent does not support inline frames or is currently" + "
configured not to display frames]";
 
+	static final String NO_SOURCE_MSG = "Please customize source for this IFrame";
+
+	static final String DEFAULT_SOURCE = "http://127.0.0.1";
+	static final String DEFAULT_WIDTH = null;
+	static final String DEFAULT_HEIGHT = null;
+	static final String DEFAULT_SCROLLING = "auto";
+	static final String DEFAULT_FRAMEBORDER = "1";
+
+	static final String PARAM_SOURCE = "source";
+	static final String PARAM_WIDTH = "width";
+	static final String PARAM_HEIGHT = "height";
+	static final String PARAM_SCROLLING = "scrolling";
+	static final String PARAM_FRAMEBORDER = "frameborder";
+	static final String PARAM_NAME = "name";
+	static final String PARAM_STYLE = "style";
+	static final String PARAM_MARGINWIDTH = "marginwidth";
+	static final String PARAM_MARGINHEIGHT = "marginheight";
+	static final String PARAM_REFRESH = "refresh";
+	static final String PARAM_ALIGN = "align";
+	static final String WEBAPPROOT = "${" + TurbineConstants.WEBAPP_ROOT + "}";
+
+	private final String PARAMETER_1 = "parameter1";
+	private final String PARAMETER_2 = "parameter2";
+	private final String PARAMETER_3 = "parameter3";
+	private final String PARAMETER_4 = "parameter4";
+	private final String PARAMETER_5 = "parameter5";
+	private final String PARAMETER_6 = "parameter6";
+
+	private final String VALUE_1 = "value1";
+	private final String VALUE_2 = "value2";
+	private final String VALUE_3 = "value3";
+	private final String VALUE_4 = "value4";
+	private final String VALUE_5 = "value5";
+	private final String VALUE_6 = "value6";
+
+	private String iSource = DEFAULT_SOURCE;
+	private String iWidth = DEFAULT_WIDTH;
+	private String iHeight = DEFAULT_HEIGHT;
+	private String iScrolling = DEFAULT_SCROLLING;
+	private String iFrameBorder = DEFAULT_FRAMEBORDER;
+	private String iMarginWidth = null;
+	private String iMarginHeight = null;
+	private String iStyle = null;
+	private String iName = null;
+	private String iRefresh = null;
+	private String iAlign = null;
+
+	private String param1 = "";
+	private String value1 = "";
+	private String param2 = "";
+	private String value2 = "";
+	private String param3 = "";
+	private String value3 = "";
+	private String param4 = "";
+	private String value4 = "";
+	private String param5 = "";
+	private String value5 = "";
+	private String param6 = "";
+	private String value6 = "";
+
+	/**
+	 *  Sets the source attribute of the IFramePortlet object
+	 *
+	 * @param  source  The new source value
+	 * @since
+	 */
+	public void setSource(String source)
+	{
+		if (source != null)
+		{
+			// Handle replacement variables
+			Hashtable parms = new Hashtable();
+			if (source.indexOf("${") >= 0)
+			{
+				// Add all portlet parms
+				parms.putAll(this.getPortletConfig().getInitParameters());
+
+				// Add web app root variable replacement
+				try
+				{
+					ServerData sd =
+						new ServerData(
+							TurbineServlet.getServerName(),
+							Integer.parseInt(TurbineServlet.getServerPort()),
+							TurbineServlet.getServerScheme(),
+							TurbineServlet.getContextPath(),
+							TurbineServlet.getContextPath());
+					DynamicURI uri = new DynamicURI(sd);
+					parms.put(TurbineConstants.WEBAPP_ROOT, uri.toString() + "/");
+				} catch (Exception e)
+				{
+					Log.error(e);
+				}
+				// Add portlet name variable replacement
+				parms.put("portlet", this.getName());
+			}
+
+			this.iSource = org.apache.jetspeed.util.StringUtils.replaceVars(source, parms);
+		}
+
+	}
+
+	/**
+	 *  This methods outputs the content of the portlet for a given request.
+	 *
+	 * @param  runData  the RunData object for the request
+	 * @return          the content to be displayed to the user-agent
+	 */
+	public ConcreteElement getContent(RunData runData)
+	{
+
+		// Reinitialize if user customized the portlet (this will be useful
+		// when portlet preferences include user name and password for authentication or
+		// when other exposed iframe attributes are changed)
+		if
(org.apache.jetspeed.util.PortletSessionState.getPortletConfigChanged(this,
runData))
+		{
+			try
+			{
+				this.init();
+			} catch (PortletException pe)
+			{
+				Log.error(pe);
+			}
+		}
+
+		StringBuffer text = new StringBuffer();
+
+		if (getSource() == null || getSource().trim().length() == 0)
+		{
+			text.append(NO_SOURCE_MSG);
+			return (new StringElement(text.toString()));
+		}
+
+		text.append("<IFRAME ");
+
+		text.append("src = \"" + getSource());
+
+		// Build URL with optional paramaters and values
+		if (this.getParam1().length() > 0)
+		{
+			text.append("?" + this.getParam1() + "=" + this.getValue(this.getValue1(),
runData));
+
+			if (this.getParam2().length() > 0)
+			{
+				text.append("&" + this.getParam2() + "=" + this.getValue(this.getValue2(),
runData));
+
+				if (this.getParam3().length() > 0)
+				{
+					text.append("&" + this.getParam3() + "=" + this.getValue(this.getValue3(),
runData));
+
+					if (this.getParam4().length() > 0)
+					{
+						text.append("&" + this.getParam4() + "=" +
this.getValue(this.getValue4(), runData));
+
+						if (this.getParam5().length() > 0)
+						{
+							text.append("&" + this.getParam5() + "=" +
this.getValue(this.getValue5(), runData));
+
+							if (this.getParam6().length() > 0)
+							{
+								text.append("&" + this.getParam6() + "=" +
this.getValue(this.getValue6(), runData));
+							}
+						}
+					}
+				}
+			}
+
+		}
+
+		text.append("\" ");
+		if (getWidth() != null)
+		{
+			text.append("width = \"" + getWidth() + "\" ");
+		}
+
+		if (getHeight() != null)
+		{
+			text.append("height = \"" + getHeight() + "\" ");
+		}
+
+		if (getFrameName() != null)
+		{
+			text.append("name = \"" + getFrameName() + "\" ");
+		}
+
+		if (getStyle() != null)
+		{
+			text.append("style = \"" + getStyle() + "\" ");
+		}
+
+		if (getMarginWidth() != null)
+		{
+			text.append("marginwidth = \"" + getMarginWidth() + "\" ");
+		}
+
+		if (getMarginHeight() != null)
+		{
+			text.append("marginheight = \"" + getMarginHeight() + "\" ");
+		}
+
+		if (getAlign() != null)
+		{
+			text.append("align = \"" + getAlign() + "\" ");
+		}
+
+		text.append("scrolling = \"" + getScrolling() + "\" ");
+		text.append("frameborder = \"" + getFrameBorder() + "\" ");
+		text.append(">");
+
+		text.append("</IFRAME>");
+		return (new StringElement(text.toString()));
+	}
+
+	/**
+	 *  Initialize this portlet by setting inst. vars from InitParamaters.
+	 *
+	 * @throws  PortletException  Initialization failed
+	 */
+	public void init() throws PortletException
+	{
+		// first make sure we propagate init
+		super.init();
+
+		try
+		{
+			PortletConfig config = this.getPortletConfig();
+			String param = null;
+
+			param = config.getInitParameter(PARAM_SOURCE);
+			if (param != null)
+				setSource(param);
+
+			param = config.getInitParameter(PARAM_WIDTH);
+			if (param != null)
+				setWidth(param);
+
+			param = config.getInitParameter(PARAM_HEIGHT);
+			if (param != null)
+				setHeight(param);
+
+			param = config.getInitParameter(PARAM_SCROLLING);
+			if (param != null)
+				setScrolling(param);
+
+			param = config.getInitParameter(PARAM_FRAMEBORDER);
+			if (param != null)
+				setFrameBorder(param);
+
+			param = config.getInitParameter(PARAM_STYLE);
+			if (param != null)
+				setStyle(param);
+
+			param = config.getInitParameter(PARAM_NAME);
+			if (param != null)
+				setFrameName(param);
+
+			param = config.getInitParameter(PARAM_REFRESH);
+			if (param != null)
+				setRefresh(param);
+
+			param = config.getInitParameter(PARAM_MARGINWIDTH);
+			if (param != null)
+				setMarginWidth(param);
+
+			param = config.getInitParameter(PARAM_MARGINHEIGHT);
+			if (param != null)
+				setMarginHeight(param);
+
+			param = config.getInitParameter(PARAM_ALIGN);
+			if (param != null)
+				setAlign(param);
+
+			param = config.getInitParameter(PARAMETER_1);
+			if (param != null)
+				setParam1(param);
+
+			param = config.getInitParameter(VALUE_1);
+			if (param != null)
+				setValue1(param);
+
+			param = config.getInitParameter(PARAMETER_2);
+			if (param != null)
+				setParam2(param);
+
+			param = config.getInitParameter(VALUE_2);
+			if (param != null)
+				setValue2(param);
+
+			param = config.getInitParameter(PARAMETER_3);
+			if (param != null)
+				setParam3(param);
+
+			param = config.getInitParameter(VALUE_3);
+			if (param != null)
+				setValue3(param);
+
+			param = config.getInitParameter(PARAMETER_4);
+			if (param != null)
+				setParam4(param);
+
+			param = config.getInitParameter(VALUE_4);
+			if (param != null)
+				setValue4(param);
+
+			param = config.getInitParameter(PARAMETER_5);
+			if (param != null)
+				setParam5(param);
+
+			param = config.getInitParameter(VALUE_5);
+			if (param != null)
+				setValue5(param);
+				
+			param = config.getInitParameter(PARAMETER_6);
+			if (param != null)
+				setParam6(param);
+
+			param = config.getInitParameter(VALUE_6);
+			if (param != null)
+				setValue6(param);
+
+		} catch (Exception e)
+		{
+			Log.error("Exception in init()", e);
+			throw new PortletException(e.getMessage());
+		}
+	}
+
+	/**
+	 * If the paramater is known (username,password), return it's value
+	 * 
+	 * @params s    The Parameter to check
+	 * @return      The value of the parameter if it is known, nothing otherwise
+	 */
+	private String getValue(String s, RunData runData)
+	{
+		if (s.equalsIgnoreCase("$username"))
+			return runData.getUser().getUserName();
+		else if (s.equalsIgnoreCase("$password"))
+			return runData.getUser().getPassword();
+		else if (s.equalsIgnoreCase("$clearpassword"))
+			return (String)runData.getUser().getTemp("sessionPassword");
+		else if (s.equalsIgnoreCase("$email"))
+			return runData.getUser().getEmail();
+		else if (s.equalsIgnoreCase("$firstname"))
+			return runData.getUser().getFirstName();
+		else if (s.equalsIgnoreCase("$lastname"))
+			return runData.getUser().getLastName();
+		else if (s.equalsIgnoreCase("$name"))
+			return runData.getUser().getName();
+
+		return s;
+	}
+
+	/**
+	 *  Gets the source attribute of the IFramePortlet object
+	 *
+	 * @return    The source value
+	 */
+	public String getSource()
+	{
+		return iSource;
+	}
+
+	/**
+	 *  Gets the scrolling attribute of the IFramePortlet object
+	 *
+	 * @return    The scrolling value
+	 */
+	public String getScrolling()
+	{
+		return iScrolling;
+	}
+
+	/**
+	 *  Gets the width attribute of the IFramePortlet object
+	 *
+	 * @return    The width value
+	 */
+	public String getWidth()
+	{
+		return iWidth;
+	}
+
+	/**
+	 *  Gets the height attribute of the IFramePortlet object
+	 *
+	 * @return    The height value
+	 */
+	public String getHeight()
+	{
+		return iHeight;
+	}
+
+	/**
+	 *  Gets whether to display a border around the IFRAME. "1" == yes.
+	 *
+	 * @return    The frameBorder value
+	 */
+	public String getFrameBorder()
+	{
+		String trueValues = "1,yes,true";
+		if (iFrameBorder != null && trueValues.indexOf(iFrameBorder) >= 0)
+		{
+			return "1";
+		}
+		return "0";
+	}
+
+	/**
+	 *  Gets the message displayed when IFRAME is not supported
+	 *  This includes when Frames are turned off.
+	 *
+	 * @todo        This should be localized
+	 * @return    The notSupportedMsg value
+	 */
+	public String getNotSupportedMsg()
+	{
+		return DEFAULT_NOTSUPP_MSG;
+	}
+
+	/**
+	 *  Gets the aling attribute of the IFramePortlet object
+	 * 
+	 * @return The marginheight value
+	 */
+	public String getAlign()
+	{
+
+		return iAlign;
+	}
+
+	/**
+	 *  Gets iframe style
+	 * 
+	 * @return The style value
+	 */
+	public String getStyle()
+	{
+
+		return iStyle;
+	}
+
+	/**
+	 *  Gets iframe name
+	 * 
+	 * @return The name value
+	 */
+	public String getFrameName()
+	{
+
+		return iName;
+	}
+
+	/**
+	 *  Gets iframe refresh
+	 * 
+	 * @return The refresh value
+	 */
+	public String getRefresh()
+	{
+
+		return iRefresh;
+	}
+
+	/**
+	 *  Gets the marginheight attribute of the IFramePortlet object
+	 * 
+	 * @return The marginheight value
+	 */
+	public String getMarginHeight()
+	{
+		return iMarginHeight;
+	}
+
+	/**
+	 *  Gets the marginwidth attribute of the IFramePortlet object
+	 * 
+	 * @return The marginwidth value
+	 */
+	public String getMarginWidth()
+	{
+
+		return iMarginWidth;
+	}
+
+	/**
+	 *  Sets the scrolling attribute of the IFramePortlet object
+	 *
+	 * @param  scrolling  The new scrolling value
+	 * @since
+	 */
+	public void setScrolling(String scrolling)
+	{
+		iScrolling = scrolling;
+	}
+
+	/**
+	 *  Sets the width attribute of the IFramePortlet object
+	 *
+	 * @param  width  The new width value
+	 * @since
+	 */
+	public void setWidth(String width)
+	{
+		iWidth = width;
+	}
+
+	/**
+	 *  Sets the height attribute of the IFramePortlet object
+	 *
+	 * @param  height  The new height value
+	 * @since
+	 */
+	public void setHeight(String height)
+	{
+		iHeight = height;
+	}
+
+	/**
+	 *  Sets the frameBorder attribute of the IFramePortlet object
+	 *
+	 * @param  frameBorder  The new frameBorder value
+	 * @since
+	 */
+	public void setFrameBorder(String frameBorder)
+	{
+		iFrameBorder = frameBorder;
+	}
+
+	/**
+	 *  Sets the width attribute of the IFramePortlet object
+	 * 
+	 * @param width  The new width value
+	 */
+	public void setMarginWidth(String width)
+	{
+
+		iMarginWidth = width;
+	}
+
+	/**
+	 *  Sets the marginheight attribute of the IFramePortlet object
+	 * 
+	 * @param height The new height value
+	 */
+	public void setMarginHeight(String height)
+	{
+
+		iMarginHeight = height;
+	}
+
+	/**
+	 *  Sets the marginheight attribute of the IFramePortlet object
+	 * 
+	 * @param height The new height value
+	 */
+	public void setAlign(String value)
+	{
+
+		iAlign = value;
+	}
+
+	/**
+	 *  Sets the refresh meta tag
+	 * 
+	 * @param value in seconds
+	 */
+	public void setRefresh(String value)
+	{
+
+		iRefresh = value;
+	}
+
+	/**
+	 * Sets the style of iframe. Some useful style effects:
+	 * <UL>
+	 * <LI>border:5px dashed purple
+	 * <LI>border:5px dotted red
+	 * <LI>border:5px double red
+	 * <LI>border:5px inset red
+	 * </UL>
+	 * 
+	 * @param value
+	 */
+	public void setStyle(String value)
+	{
+
+		iStyle = value;
+	}
+
+	/**
+	 * Sets the name of iframe. This is useful when referencing
+	 * the iframe as a target from another link.
+	 * 
+	 * @param value
+	 */
+	public void setFrameName(String value)
+	{
+
+		iName = value;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getParam1()
+	{
+		return param1;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getParam2()
+	{
+		return param2;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getParam3()
+	{
+		return param3;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getParam4()
+	{
+		return param4;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getParam5()
+	{
+		return param5;
+	}
+	
+	/**
+         *
+	 * @return
+	 */
+	public String getParam6()
+	{
+		return param6;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getValue1()
+	{
+		return value1;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getValue2()
+	{
+		return value2;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getValue3()
+	{
+		return value3;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getValue4()
+	{
+		return value4;
+	}
+
+	/**
+         *
+	 * @return
+	 */
+	public String getValue5()
+	{
+		return value5;
+	}
+	
+	/**
+         *
+	 * @return
+	 */
+	public String getValue6()
+	{
+		return value6;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setParam1(String string)
+	{
+		param1 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setParam2(String string)
+	{
+		param2 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setParam3(String string)
+	{
+		param3 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setParam4(String string)
+	{
+		param4 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setParam5(String string)
+	{
+		param5 = string;
+	}
+	
+	/**
+         *
+	 * @param string
+	 */
+	public void setParam6(String string)
+	{
+		param6 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setValue1(String string)
+	{
+		value1 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setValue2(String string)
+	{
+		value2 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setValue3(String string)
+	{
+		value3 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setValue4(String string)
+	{
+		value4 = string;
+	}
+
+	/**
+         *
+	 * @param string
+	 */
+	public void setValue5(String string)
+	{
+		value5 = string;
+	}
+	
+	/**
+         *
+	 * @param string
+	 */
+	public void setValue6(String string)
+	{
+		value6 = string;
+	}
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org