com.plumtree.uiinfrastructure.activityspace
Class Redirect

java.lang.Object
  extended by com.plumtree.uiinfrastructure.activityspace.Redirect
All Implemented Interfaces:
ILink

public class Redirect
extends java.lang.Object
implements ILink

This object allows IControls to specify an AActivitySpace, IDisplayPage, or IControl to redirect to. Currently, only AActivitySpaces and IDisplayPages are implemented.

Author:
Don Hayler

Constructor Summary
Redirect()
          Creates a new Redirect object.
 
Method Summary
 void AddControlArgument(java.lang.String strName)
          This method allows you to add a control argument to the HTML URL with no value.
 void AddControlArgument(java.lang.String strName, boolean bValue)
          This method allows you to add a control argument to the HTML URL.
 void AddControlArgument(java.lang.String strName, int nValue)
          This method allows you to add a control argument to the HTML URL.
 void AddControlArgument(java.lang.String name, java.lang.String value)
          Optionally set single String arguments for the IControl.
 void AddControlArgument(java.lang.String name, java.lang.String[] values)
          Optionally set String[] arguments for the IControl.
 void AddControlArguments(XPHashtable htArgs)
          Adds a map of String name/String[] values pairs to the redirect (overwriting previous versions)
 boolean GetCachedNoID()
          Returns whether to look in the cache for an instance of this space (not a particular instance).
 java.lang.String GetControl()
          Return the name of the IControl.
 java.lang.String GetControlArgument(java.lang.String strName)
          Return the value of the specified control argument.
 XPHashtable GetControlArguments()
          Return a map of the IControl arguments in String name/String[] values pairs.
 java.lang.String GetDisplayPage()
          Return the name of the IDisplayPage.
 java.lang.String GetExternalURL()
          This method returns the external URL to do a 302 redirect on.
 boolean GetIsErrorRedirect()
          This method returns whether or not this redirect should be handled as an error bounce by the Interpreter.
 boolean GetIsExternalURL()
          This method returns whether this is an internal redirect to an Activity Space (potentially a server redirect or a 302 redirect) or an external 302 redirect to another web site.
 boolean GetIsHTTPRedirect()
          This method returns whether or not this redirect should be handled as a true 302 redirect or an internal server redirect.
 java.lang.String GetParentSpaceID()
          Returns the ID of the parent activity space of this space.
 java.lang.String GetParentSpaceName()
          Returns the name of the parent activity space of this space.
 java.lang.String GetQueryString()
          Returns a query string for the redirect containing all the control arguments.
 java.lang.String GetSpaceID()
          Return the ID of the AActivitySpace.
 java.lang.String GetSpaceName()
          Return the name of the AActivitySpace.
 boolean GetStripParentSpace()
          Gets whether or not to strip the parent space arguments from the URL.
 java.lang.String GetSubSpaceKey()
          Returns the Sub-space key.
 void RemoveControlArgument(java.lang.String name)
          Optionally remove single arguments for the IControl.
 void SetControl(java.lang.String control)
          Optionally set the name of an IControl to redirect to.
 void SetDisplayPage(java.lang.String page)
          Optionally set the name of an IDisplayPage to redirect to.
 void SetIsErrorRedirect(boolean bRedirect)
          This method sets whether or not this redirect should be handled as an error bounce by the Interpreter.
 void SetIsHTTPRedirect(boolean bHTTPRedirect)
          This method sets whether or not this redirect should be handled as a true 302 redirect or an internal server redirect.
 boolean SetLinkCreateNewSpace(java.lang.String strSpace, AActivitySpace parent)
          This method creates a brand new AActivitySpace.
 boolean SetLinkGetCachedSpace(AActivitySpace space)
          This constructor takes a specific space and returns a link to that (including space ID)
 boolean SetLinkGetSpaceIfCached(java.lang.String strSpace, AActivitySpace parent)
          This method gets a named AActivitySpace from the cache if it is there, or creates a new one if it is not in the cache.
 boolean SetLinkToExternalURL(java.lang.String strExternalURL)
          This method sets the Redirect to do a true HTTP 302 redirect to an external URL.
 void SetStripParentSpace(boolean bStrip)
          Sets whether or not to strip the parent space arguments from the URL.
 void SetSubSpaceKey(java.lang.String sSubSpaceKey)
          This method sets the sub space key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Redirect

public Redirect()
Creates a new Redirect object.

Method Detail

AddControlArgument

public void AddControlArgument(java.lang.String name,
                               java.lang.String value)
Optionally set single String arguments for the IControl.

Specified by:
AddControlArgument in interface ILink
Parameters:
name - the name of the argument
value - the value of the argument

AddControlArgument

public void AddControlArgument(java.lang.String name,
                               java.lang.String[] values)
Optionally set String[] arguments for the IControl.

Specified by:
AddControlArgument in interface ILink
Parameters:
name - the name of the argument
values - the value of the argument

AddControlArgument

public void AddControlArgument(java.lang.String strName,
                               int nValue)
This method allows you to add a control argument to the HTML URL.

Specified by:
AddControlArgument in interface ILink
Parameters:
strName -
nValue -
See Also:
ILink.AddControlArgument(String, String)

AddControlArgument

public void AddControlArgument(java.lang.String strName,
                               boolean bValue)
This method allows you to add a control argument to the HTML URL.

Specified by:
AddControlArgument in interface ILink
Parameters:
strName -
booleanValue -
See Also:
ILink.AddControlArgument(String, String)

AddControlArgument

public void AddControlArgument(java.lang.String strName)
This method allows you to add a control argument to the HTML URL with no value.

Specified by:
AddControlArgument in interface ILink
Parameters:
strName -
booleanValue -
See Also:
ILink.AddControlArgument(String, String)

AddControlArguments

public void AddControlArguments(XPHashtable htArgs)
Adds a map of String name/String[] values pairs to the redirect (overwriting previous versions)

Parameters:
XPHashtable - the control arguments in String name/String[] values pairs

GetIsExternalURL

public boolean GetIsExternalURL()
This method returns whether this is an internal redirect to an Activity Space (potentially a server redirect or a 302 redirect) or an external 302 redirect to another web site.

Returns:
boolean true implies external URL.

GetExternalURL

public java.lang.String GetExternalURL()
This method returns the external URL to do a 302 redirect on. This will not return useful information if the redirect does not point to an external URL.

Returns:
String the external URL to do a 302 redirect to.

GetCachedNoID

public boolean GetCachedNoID()
Returns whether to look in the cache for an instance of this space (not a particular instance). This should only be true for common Spaces, like myPage, where a user should only have one instance, unlike Editors, where a user could easily have multiple instances of an Editor open simultaneously.

Returns:
boolean true implies look in the cache for an instance of this space

GetControl

public java.lang.String GetControl()
Return the name of the IControl.


GetControlArgument

public java.lang.String GetControlArgument(java.lang.String strName)
Return the value of the specified control argument.

Parameters:
String - the name of the argument to get

GetControlArguments

public XPHashtable GetControlArguments()
Return a map of the IControl arguments in String name/String[] values pairs.

Returns:
XPHashtable the control arguments in String name/String[] values pairs

GetDisplayPage

public java.lang.String GetDisplayPage()
Return the name of the IDisplayPage.


GetParentSpaceID

public java.lang.String GetParentSpaceID()
Returns the ID of the parent activity space of this space.

Returns:
String the ID of the parent of this space

GetParentSpaceName

public java.lang.String GetParentSpaceName()
Returns the name of the parent activity space of this space.

Returns:
String the name of the parent of this space

GetQueryString

public java.lang.String GetQueryString()
Returns a query string for the redirect containing all the control arguments.

Returns:
String the query string, excluding the question mark

GetIsErrorRedirect

public boolean GetIsErrorRedirect()
This method returns whether or not this redirect should be handled as an error bounce by the Interpreter. If it is, and the user is not logged on, they will be redirected to the login page, and then be redirected back to this redirect after a succesful login. If they are not logged in, they will see an error page and then be redirected back.

Returns:
boolean true implies is an error redirect

GetIsHTTPRedirect

public boolean GetIsHTTPRedirect()
This method returns whether or not this redirect should be handled as a true 302 redirect or an internal server redirect. 302 redirects will cause a roundtrip to the server, and the URL will show up in the browser window. This will allow you to safely refresh the page. Server redirects don't incur a roundtrip to the server, but the new URL will not show up in the browser. This can cause form data to be submitted twice if the user refreshes the page. In general, we should use internal server redirects to save time. However, destructive/constructive actions (saving an object, etc...) should use real 302 redirects.

Returns:
boolean true implies is a 302 redirect, and will cause a roundtrip from the browser to redirect.

GetSpaceID

public java.lang.String GetSpaceID()
Return the ID of the AActivitySpace.


GetSpaceName

public java.lang.String GetSpaceName()
Return the name of the AActivitySpace.


GetSubSpaceKey

public java.lang.String GetSubSpaceKey()
Returns the Sub-space key. If this is null or empty, this is not a sub-space.

Returns:
String the sub-space key

SetSubSpaceKey

public void SetSubSpaceKey(java.lang.String sSubSpaceKey)
This method sets the sub space key. If this is not called, or is empty, the space will not be a sub-space. Otherwise it will be. This is null by default (meaning not a sub-space).

Specified by:
SetSubSpaceKey in interface ILink
Parameters:
String - the sub space key

SetControl

public void SetControl(java.lang.String control)
Optionally set the name of an IControl to redirect to.

Specified by:
SetControl in interface ILink
Parameters:
String - the name of the control to redirect to.

SetDisplayPage

public void SetDisplayPage(java.lang.String page)
Optionally set the name of an IDisplayPage to redirect to.

Specified by:
SetDisplayPage in interface ILink
Parameters:
page - the name of the page to link to

SetIsErrorRedirect

public void SetIsErrorRedirect(boolean bRedirect)
This method sets whether or not this redirect should be handled as an error bounce by the Interpreter. If it is, and the user is not logged on, they will be redirected to the login page, and then be redirected back to this redirect after a succesful login. If they are not logged in, they will see an error page and then be redirected back.

Parameters:
boolean - true implies is an error redirect

SetIsHTTPRedirect

public void SetIsHTTPRedirect(boolean bHTTPRedirect)
This method sets whether or not this redirect should be handled as a true 302 redirect or an internal server redirect. 302 redirects will cause a roundtrip to the server, and the URL will show up in the browser window. This will allow you to safely refresh the page. Server redirects don't incur a roundtrip to the server, but the new URL will not show up in the browser. This can cause form data to be submitted twice if the user refreshes the page. In general, we should use internal server redirects to save time. However, destructive/constructive actions (saving an object, etc...) should use real 302 redirects. The default is internal server redirect.

Parameters:
boolean - true implies is a 302 redirect, and will cause a roundtrip from the browser to redirect.

SetLinkCreateNewSpace

public boolean SetLinkCreateNewSpace(java.lang.String strSpace,
                                     AActivitySpace parent)
This method creates a brand new AActivitySpace.

Specified by:
SetLinkCreateNewSpace in interface ILink
Parameters:
String - strSpace
AActivitySpace - parent
Returns:
boolean true implies success, false implies failure
See Also:
ILink.SetLinkCreateNewSpace(String, AActivitySpace)

SetLinkGetCachedSpace

public boolean SetLinkGetCachedSpace(AActivitySpace space)
This constructor takes a specific space and returns a link to that (including space ID)

Specified by:
SetLinkGetCachedSpace in interface ILink
Parameters:
AActivitySpace - space
Returns:
boolean true implies success, false implies failure
See Also:
ILink.SetLinkGetCachedSpace(AActivitySpace)

SetLinkGetSpaceIfCached

public boolean SetLinkGetSpaceIfCached(java.lang.String strSpace,
                                       AActivitySpace parent)
This method gets a named AActivitySpace from the cache if it is there, or creates a new one if it is not in the cache. This method should be used to get common AActivitySpaces such as MyPage and Community, not minor spaces like Tree and Editors. The SetSpaceGetCached(AActivitySpace) should be used instead of this one when you can.

Specified by:
SetLinkGetSpaceIfCached in interface ILink
Parameters:
String - strSpace
AActivitySpace - parent
Returns:
boolean true implies success, false implies failure
See Also:
ILink.SetLinkGetSpaceIfCached(String, AActivitySpace)

SetLinkToExternalURL

public boolean SetLinkToExternalURL(java.lang.String strExternalURL)
This method sets the Redirect to do a true HTTP 302 redirect to an external URL. This cannot be used to redirect to another Activity Space. That should be done through the normal SetLink* methods. The URL parameter is assumed to be properly URL encoded, and this method will not do any encoding. It is the responsibility of the method caller to properly encode the URL.

Specified by:
SetLinkToExternalURL in interface ILink
Parameters:
String - strExternalURL
Returns:
boolean true implies success, false implies failure

RemoveControlArgument

public void RemoveControlArgument(java.lang.String name)
Optionally remove single arguments for the IControl.


SetStripParentSpace

public void SetStripParentSpace(boolean bStrip)
Sets whether or not to strip the parent space arguments from the URL.


GetStripParentSpace

public boolean GetStripParentSpace()
Gets whether or not to strip the parent space arguments from the URL.

Returns:



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.