com.plumtree.uiinfrastructure.activityspace
Class ASURL

java.lang.Object
  extended by com.plumtree.uiinfrastructure.activityspace.ASURL
All Implemented Interfaces:
ILink, ILinkElement

public class ASURL
extends java.lang.Object
implements ILinkElement

This class creates an URL that points to MVC components. This adds the session user ID to the query string for usage tracking purposes (PTTracker).

Author:
Don Hayler, MichaelD

Constructor Summary
ASURL(AActivitySpace asOwner)
          Creates a new ASURL 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 strName, java.lang.String strValue)
          This method allows you to add a control argument to the HTML URL.
 void AddControlArgument(java.lang.String strName, java.lang.String[] strValues)
          This method allows you to add a control argument to the HTML URL.
 void AddControlArgument(java.lang.String strName, java.lang.String strValue, AActivitySpace asOwner)
          An addition that replaces long strings with references; only certain parts of the tree know how to unref it The strName will be preceded by "@" to mark it as a reference.
 void AddInnerHTMLElement(HTMLElement element)
          NOTE: If you only pass in an image with an alt tag, and no link label, you need to call the SetLinkTitle method with the alt string.
 void AddInnerHTMLEncodedString(java.lang.String innerStr)
          This adds an HTMLEncoded string.
 void AddInnerHTMLString(java.lang.String innerStr)
          This adds a non-HTMLEncoded string.
static ASURL CreateFromURLContainer(ASURLContainer urlCont)
          Creates an ASURL from an ASURLContainer.
static ASURL CreateFromURLContainerNew(ASURLContainer urlCont)
          Creates an ASURL from an ASURLContainer.
 HTMLElement GetURLAsHTMLElement()
          Create an HTML element from this url
 java.lang.String GetURLAsString()
          return the string that represents this url
 void IsSubSpace()
          Sets the member variable m_bIsSubSpace to true (i.e.
 void SetControl(java.lang.String strControl)
          Set the control to use in this url
 void SetDisplayPage(java.lang.String strPage)
          Set the display page to be used in this url
 void SetImgBaseUrl(java.lang.String strImageBaseURL)
          This method allows you to set the image base url on the resulting HTMLElement.
 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.
 void SetLinkTitle(java.lang.String label)
          Set the title of the html anchor.
 boolean SetLinkToExternalURL(java.lang.String m_externalurl)
          HACK: Sets a full URL.
 void SetNoLinkLabelString(java.lang.String label)
          NOTE: This method is not for setting the display text of an anchor! Use SetLabelString to set the display text.
 void SetSubSpaceKey(java.lang.String sSubSpaceKey)
          This method sets the sub space key.
 void SetUseMainServerURL(boolean bUse, boolean bIsSecure)
          Sets whether or not to use the main server URL.
 void SetXMLEncoding(boolean bXML)
          Sets the URL to use the XML encoded ampersands rather than normal HTML ones (for WML devices)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASURL

public ASURL(AActivitySpace asOwner)
Creates a new ASURL object.

Parameters:
AActivitySpace - the owner activity space
Method Detail

AddControlArgument

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

Specified by:
AddControlArgument in interface ILink
Parameters:
strName - The name of the argument
strValue - The value of the argument
See Also:
This URL encodes the value for you

AddControlArgument

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

Specified by:
AddControlArgument in interface ILink
Parameters:
strName - The name of the argument
strValues - The array of values for the argument
See Also:
This URL encodes the value for you

AddControlArgument

public void AddControlArgument(java.lang.String strName,
                               java.lang.String strValue,
                               AActivitySpace asOwner)
An addition that replaces long strings with references; only certain parts of the tree know how to unref it The strName will be preceded by "@" to mark it as a reference. The "@" should not be used when unreferencing the data. NOTE: Oleg needs to test this, make about 1000 (max is about 2000)

Parameters:
strName - The name of the query string parameter
strValue - the long value to be passed as a reference
asOwner - the parent AActivitySpace

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 - The name of the argument
nValue - The int value of the argument
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 - The name of the argument
booleanValue - The boolean value of the argument
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 - The name of the argument
See Also:
ILink.AddControlArgument(String, String)

AddInnerHTMLElement

public void AddInnerHTMLElement(HTMLElement element)
NOTE: If you only pass in an image with an alt tag, and no link label, you need to call the SetLinkTitle method with the alt string. Netscape 7 does not display alt tags for images inside an anchor so you would need to use the anchor's title tag. Calling AddInnerHTMLString

Specified by:
AddInnerHTMLElement in interface ILinkElement
Parameters:
element - the html element to be added inside the url

AddInnerHTMLString

public void AddInnerHTMLString(java.lang.String innerStr)
This adds a non-HTMLEncoded string. This method should be used for localized strings, as they should be safe.

Specified by:
AddInnerHTMLString in interface ILinkElement
Parameters:
string - the string to be added to the url text

AddInnerHTMLEncodedString

public void AddInnerHTMLEncodedString(java.lang.String innerStr)
This adds an HTMLEncoded string. This method should not be used for localized strings, as should not need to be encoded.

Parameters:
string - the pre-html encoded string to be added to the url text

CreateFromURLContainer

public static ASURL CreateFromURLContainer(ASURLContainer urlCont)
Creates an ASURL from an ASURLContainer. The ASURL is set to SetLinkGetSpaceIfCached, i.e. try to find the activityspace in the cache, create a new AS if it doesn't exist.

Parameters:
ASURLContainer - urlCont

CreateFromURLContainerNew

public static ASURL CreateFromURLContainerNew(ASURLContainer urlCont)
Creates an ASURL from an ASURLContainer. The ASURL is set to SetLinkCreateNewSpace, i.e. always create a new AS.

Parameters:
ASURLContainer - urlCont
Returns:
ASURL

GetURLAsHTMLElement

public HTMLElement GetURLAsHTMLElement()
Create an HTML element from this url

Specified by:
GetURLAsHTMLElement in interface ILinkElement
Returns:
The html element that can display this url

GetURLAsString

public java.lang.String GetURLAsString()
return the string that represents this url

Returns:
the string that represents this url

SetControl

public void SetControl(java.lang.String strControl)
Set the control to use in this url

Specified by:
SetControl in interface ILink
Parameters:
strControl - The name of the control to use in the url
See Also:
ILink.SetControl(String)

SetDisplayPage

public void SetDisplayPage(java.lang.String strPage)
Set the display page to be used in this url

Specified by:
SetDisplayPage in interface ILink
Parameters:
strPage - the display page to show
See Also:
ILink.SetDisplayPage(String)

SetImgBaseUrl

public void SetImgBaseUrl(java.lang.String strImageBaseURL)
This method allows you to set the image base url on the resulting HTMLElement. This should only be used if you are using the element outside of the context of an HTMLPage. NOTE This should probably be removed, since you can just get the URL as an element and set it there.

Parameters:
strImageBaseURL - The image base url

SetNoLinkLabelString

public void SetNoLinkLabelString(java.lang.String label)
NOTE: This method is not for setting the display text of an anchor! Use SetLabelString to set the display text. This is used when the ASURL is used to only output a text label, i.e not a link.


SetLinkTitle

public void SetLinkTitle(java.lang.String label)
Set the title of the html anchor. AddInnerHTMLString and AddInnerHTMLEncodeString will autoamitcally set the title of the anchor to the link label. Use this method to change this or pass in null to remove the title.

Parameters:
label - Text to be used in the title attribute of an html anchor. Null to remove title.

SetUseMainServerURL

public void SetUseMainServerURL(boolean bUse,
                                boolean bIsSecure)
Sets whether or not to use the main server URL.

Parameters:
boolean - true implies use the main server URL

SetXMLEncoding

public void SetXMLEncoding(boolean bXML)
Sets the URL to use the XML encoded ampersands rather than normal HTML ones (for WML devices)

Parameters:
boolean - true implies use XML encoded ampersand

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
AActivitySpace - parent
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)

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. The sub-space key is different from the space ID.

Specified by:
SetSubSpaceKey in interface ILink
Parameters:
String - sSubSpaceKey
See Also:
ILink.SetSubSpaceKey(String)

IsSubSpace

public void IsSubSpace()
Sets the member variable m_bIsSubSpace to true (i.e. this ASURL is creating a link to a sub space). There is one special case with TreeAS when we need to manually tell ASURL that we are going to a sub space. This is when we create a link to a cached tree before the tree has actually been cached (happens in SelectPTObject for example). Otherwise it won't work in security mode 1, see bug 26851. In all other cases, ASURL will be able to determine dynamically if the link is going to a sub space or not.


SetLinkToExternalURL

public boolean SetLinkToExternalURL(java.lang.String m_externalurl)
HACK: Sets a full URL. ASURL shouldn't need this but this method is needed so that we don't have to rip up too much existing code to facilitate friendly URLs

Specified by:
SetLinkToExternalURL in interface ILink
See Also:
ILink.SetLinkToExternalURL(java.lang.String)



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