com.plumtree.portaluiinfrastructure.friendlyurl
Class FriendlyURL

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.friendlyurl.FriendlyURL

public class FriendlyURL
extends java.lang.Object

This class represents a friendly Url and provides an interface to generate friendly Url string based on the provided information.

Author:
rozhang

Field Summary
protected  int m_childId
          Additional id specifier, used for example for Urls to community pages which also needs the community name.
protected  java.lang.String m_childName
          Additional name specifier, used for example for Urls to community pages which also needs the community name.
protected  int m_classId
          Type of destination page the url links too
protected  int m_objectId
          Id of the object to generate friendly name to (either one of name or id must be provided)
protected  java.lang.String m_objectName
          objectName Name of the object to generate friendly name to (either one of name or id must be provided)
protected  java.lang.String m_queryParams
          String of query parameters that need to be attached at the end of the friendly URL
protected  boolean m_useIdIfAvailable
          Whether to generate the object id in the URL if the name is also available
 
Constructor Summary
FriendlyURL(int classId, int objectId)
          Constructor with object id as argument
FriendlyURL(int classId, java.lang.String objectName)
          Constructor with object name as argument
FriendlyURL(int classId, java.lang.String objectName, int objectId)
           
FriendlyURL(int classId, java.lang.String objectName, int objectId, java.lang.String queryParams)
           
 
Method Summary
static java.lang.String DeNormalizeObjectName(java.lang.String objectName)
          Reverses any character replacement performed in FriendlyURL#NormalizeObjectName, except for character casing.
 int GetChildId()
           
 java.lang.String GetChildName()
           
 int GetClassId()
           
 java.lang.String GetClassIdAsString()
           
 java.lang.String GetFriendlyURL(AActivitySpace space)
          Constructs the Friendly URL and returns it as a string.
 java.lang.String GetFullFriendlyURL(AActivitySpace space)
          Constructs the Friendly URL and returns it as a string.
 int GetObjectId()
           
 java.lang.String GetOjectName()
           
 boolean GetUseIdIfAvailable()
           
static java.lang.String NormalizeObjectName(java.lang.String objectName)
          Convert PTObject name into a format that is suitable for friendly Urls.
 void SetChildId(int id)
           
 void SetChildName(java.lang.String name)
           
 void SetClassId(int id)
           
 void SetObjectId(int id)
           
 void SetObjectName(java.lang.String name)
           
 void SetUseIdIfAvailable(boolean useidIfAvailable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_classId

protected int m_classId
Type of destination page the url links too


m_objectName

protected java.lang.String m_objectName
objectName Name of the object to generate friendly name to (either one of name or id must be provided)


m_objectId

protected int m_objectId
Id of the object to generate friendly name to (either one of name or id must be provided)


m_queryParams

protected java.lang.String m_queryParams
String of query parameters that need to be attached at the end of the friendly URL


m_childName

protected java.lang.String m_childName
Additional name specifier, used for example for Urls to community pages which also needs the community name. Optional and not used by most class types


m_childId

protected int m_childId
Additional id specifier, used for example for Urls to community pages which also needs the community name. Optional and not used by most class types


m_useIdIfAvailable

protected boolean m_useIdIfAvailable
Whether to generate the object id in the URL if the name is also available

Constructor Detail

FriendlyURL

public FriendlyURL(int classId,
                   java.lang.String objectName)
Constructor with object name as argument

Parameters:
classId -

FriendlyURL

public FriendlyURL(int classId,
                   java.lang.String objectName,
                   int objectId)

FriendlyURL

public FriendlyURL(int classId,
                   int objectId)
Constructor with object id as argument

Parameters:
classId -

FriendlyURL

public FriendlyURL(int classId,
                   java.lang.String objectName,
                   int objectId,
                   java.lang.String queryParams)
Method Detail

GetFriendlyURL

public java.lang.String GetFriendlyURL(AActivitySpace space)
Constructs the Friendly URL and returns it as a string. Only the friendly url part is returned, no the application base url part or server.pt/ Note that any application base url used with friendly url cannot have a trailing question mark.

Parameters:
space - Current ActivitySpace
Returns:
For example /community/engineeringcommunity/page2

GetFullFriendlyURL

public java.lang.String GetFullFriendlyURL(AActivitySpace space)
Constructs the Friendly URL and returns it as a string. The application base url (without trailing question mark) is included.

Parameters:
space - Current ActivitySpace
Returns:
For example http://portalserver:8080/portal/server.pt/community/engineeringcommunity/page2

NormalizeObjectName

public static java.lang.String NormalizeObjectName(java.lang.String objectName)
Convert PTObject name into a format that is suitable for friendly Urls. Use FriendlyURL#DeNormalizeObjectName to convert the value back. The casing of the object name is not preserved through the conversion NOTE: This method is duplicated on ObjectIdFromNameCache class in the server. Make sure to update both methods.


DeNormalizeObjectName

public static java.lang.String DeNormalizeObjectName(java.lang.String objectName)
Reverses any character replacement performed in FriendlyURL#NormalizeObjectName, except for character casing. All characters will be lower case. NOTE: This method is duplicated on ObjectIdFromNameCache class in the server. Make sure to update both methods.


GetChildName

public java.lang.String GetChildName()

SetChildName

public void SetChildName(java.lang.String name)

GetClassId

public int GetClassId()

GetClassIdAsString

public java.lang.String GetClassIdAsString()

SetClassId

public void SetClassId(int id)

GetObjectId

public int GetObjectId()

SetObjectId

public void SetObjectId(int id)

GetOjectName

public java.lang.String GetOjectName()

SetObjectName

public void SetObjectName(java.lang.String name)

GetUseIdIfAvailable

public boolean GetUseIdIfAvailable()

SetUseIdIfAvailable

public void SetUseIdIfAvailable(boolean useidIfAvailable)

GetChildId

public int GetChildId()

SetChildId

public void SetChildId(int id)



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