|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.portaluiinfrastructure.statichelpers.GatewayHelpers
public class GatewayHelpers
This class provides a set of static helpers for constucting valid gateway URLs. Gateway URLs follow a well-defined format to communicate information about the request to the gateway control. This section describes the format of the gateway URLs. For simplicity portal url is assumed to be http://machinename/portal/server.pt
The gateway URLs are identified by a special substring "gateway/PTARGS_" that should follow
the portal URL. So, a general gateway URL looks like:
http://machinename/portal/server.pt/gateway/PTARGS_1_2_3_4_5_6/http://remotemachine/url_to_gateway/somefile.html
where 1,2,3,4,5,6 are numeric arguments described below.
Field Summary | |
---|---|
static int |
ADMINPLUGPAGE
|
static int |
ADMINPREFS
|
static int |
ADMINPREFS_POPUP
|
static java.lang.String |
CLOSEPOPUPANDREFRESHJAVASCRIPT
|
static java.lang.String |
CLOSEPOPUPJAVASCRIPT
|
static int |
COMMUNITYPREFS
|
static int |
COMMUNITYPREFS_POPUP
|
static java.lang.String |
DEFAULT_FRIENDLYGATEWAYURL_KEYWORD
|
static java.lang.String |
DEV_SUFFIX_PDA
|
static java.lang.String |
DEV_SUFFIX_WML
|
static int |
GADGETPREFS
|
static int |
GADGETPREFS_POPUP
|
static java.lang.String |
GATEWAY_ARG_DELIMITER
|
static java.lang.String |
GATEWAY_FRIENDLYURL_KEYWORD
this variable is set in the static intializer for this class |
static java.lang.String |
GATEWAY_HOSTED_MODE_HEADER
|
static java.lang.String |
GATEWAY_SPACE_NAME
|
static java.lang.String |
GATEWAY_URL_PREFIX
|
static java.lang.String |
GWARG_COMMUNITY_PREFIX
|
static java.lang.String |
GWARG_PAGE_PREFIX
|
static java.lang.String |
GWARG_PORTLET_PREFIX
|
static java.lang.String |
GWARG_PREFTYPE_PREFIX
|
static java.lang.String |
GWARG_USER_PREFIX
|
static java.lang.String |
GWARG_WEBSRV_PREFIX
|
static int |
HELP
|
static int |
HELP_POPUP
|
static java.lang.String |
LAST_VISITED_HOSTED_PAGE
|
static int |
NOFLAGS
|
static int |
POPUPFLAG
|
static int |
POPUPREFRESHFLAG
|
static java.lang.String |
PORTLET_SAVED_ON_SESSION
|
static int |
PORTLETCONTENT
|
static java.lang.String |
PT_CLIENT_SIDE_HEADER_VALUE
|
static java.lang.String |
PT_PORTLET_REFRESH_HEADER_VALUE
|
static java.lang.String |
PT_REFERER_HEADER
|
static java.lang.String |
PT_REQUEST_TYPE_HEADER
|
static int |
REDIRECTGUEST
|
static int |
REFRESHFLAG
|
static int |
RETURNFLAG
|
static java.lang.String |
SPECIAL_HEADER_NAME
|
static java.lang.String |
UI_508
|
static java.lang.String |
UI_LOW
|
static java.lang.String |
UI_PDA
|
static java.lang.String |
UI_STD
|
static java.lang.String |
UI_WML
|
static java.lang.String |
URL_SEPARATOR
|
static int |
USERPLUGPAGE
|
Constructor Summary | |
---|---|
GatewayHelpers()
|
Method Summary | |
---|---|
static java.lang.String |
ConstructAdminPrefsLink(AActivitySpace asOwner)
This function returns absolute URL to the admin prefs page and treats it as popup. |
static java.lang.String |
ConstructAdminPrefsLink(AActivitySpace asOwner,
boolean bPopup)
This function returns absolute URL to the admin prefs page. |
static java.lang.String |
ConstructCommunityPrefsLink(AActivitySpace asOwner,
int iPortletID,
int iCommunityID,
boolean bPopup)
This function returns absolute URL to the community prefs page. |
static java.lang.String |
ConstructCommunityPrefsLink(AActivitySpace asOwner,
int iPortletID,
int iCommunityID,
int iPageID,
boolean bPopup)
This function returns absolute URL to the community prefs page. |
static java.lang.String |
ConstructFriendlyGatewayURL(java.lang.String appBaseUrl,
int objId,
int commId,
int pageId,
int prefType,
int classId,
int userId,
java.lang.String gatewayPath)
This method generates a gateway URL pointing to a resource specified by strURLToGateway parameter. |
static java.lang.String |
ConstructGatewayURL(java.lang.String curReqUrl,
int objId,
int commId,
int pageId,
int prefType,
int classId,
int userId,
java.lang.String gatewayPath)
This method generates a gateway URL pointing to a resource specified by strURLToGateway parameter. |
static java.lang.String |
ConstructGatewayURL(java.lang.String strCurrentRequestURL,
int iPortletID,
int iCommunityID,
int iPageID,
int iPrefType,
int iClassID,
java.lang.String strURLToGateway)
This method generates a gateway URL pointing to a resource specified by strURLToGateway parameter. |
static java.lang.String |
ConstructHelpLink(AActivitySpace asOwner,
int iPortletID,
int iCommunityID,
int iPageID,
boolean bPopup)
This function returns absolute URL to the help page. |
static java.lang.String |
ConstructPartialFriendlyGatewayURLKeyword(java.lang.String appBaseUrl,
int prefType,
int userId)
Used by AppDataObject to creates a partial gateway url with just the preference type and user id to send to the server, which will complete out the second half of the gateway url. |
static java.lang.String |
ConstructPartialGatewayURL(java.lang.String appBaseUrl,
int prefType,
int userId)
Used by AppDataObject to creates a partial gateway url with just the preference type and user id to send to the server, which will complete out the second half of the gateway url. |
static java.lang.String |
ConstructPortletPrefsLink(AActivitySpace asOwner,
int iPortletID,
boolean bPopup)
This function returns absolute URL to the gadget prefs page. |
static java.lang.String |
ConstructPortletPrefsLink(AActivitySpace asOwner,
int iPortletID,
int iPageID,
boolean bPopup)
This function returns absolute URL to the gadget prefs page. |
static java.lang.String |
ConstructPortletUserCommunityPrefsLink(AActivitySpace asOwner,
int iPortletID,
int iCommunityID,
boolean bPopup)
This function returns absolute URL to the community user prefs page. |
static java.lang.String |
ConstructPrefPageLink(AActivitySpace asOwner,
int iPortletID,
int iCommunityID,
int iPageID,
int iPrefType)
This method constructs gateway URL that points to a specific associated resource (preference page, help page). |
static java.lang.String |
ConstructPrefPageLink(AActivitySpace asOwner,
int iPortletID,
int iCommunityID,
int iPageID,
int iPrefType,
int iClassID)
This method constructs gateway URL that points to a specific associated resource (preference page, help page). |
static java.lang.String |
ConstructRegularGatewayURL(java.lang.String strAppBaseURL,
int objId,
int commId,
int pageId,
int prefType,
int classId,
int userId,
java.lang.String gatewayPath)
This method generates a gateway URL pointing to a resource specified by strURLToGateway parameter. |
static java.lang.String |
ConstructReturnURI(AActivitySpace asOwner,
int iPageID,
int iCommunityID,
boolean bPopup,
boolean bRefreshPopup)
procedure: ConstructReturnURI purpose: |
static java.lang.String |
ConstructTemplateAdminPrefsLink(AActivitySpace asOwner,
boolean bPopup)
This function returns absolute URL to the admin prefs page. |
static java.lang.String |
ConvertToRegularGatewayURL(java.lang.String friendlyUrl,
java.lang.String keyword)
Converts a friendly gateway url to regular. |
static java.lang.String |
CreateGatewayFriendlyURL(java.lang.String strURL)
Helper function to encode |
static java.lang.String |
GetFriendlyGatewayURLKeyword()
|
static int |
GetId(java.lang.String stringId)
Return 0 if the excpected id is not numeric |
static java.lang.String |
GetUIMode(IXPRequest xpRequest,
AActivitySpace asOwner)
This method is used to determine the current UI mode of the portal. |
static boolean |
IsFriendlyGatewayURL(java.lang.String url,
java.lang.String keyword)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SPECIAL_HEADER_NAME
public static final java.lang.String GATEWAY_URL_PREFIX
public static java.lang.String GATEWAY_FRIENDLYURL_KEYWORD
public static final java.lang.String GATEWAY_ARG_DELIMITER
public static final java.lang.String PORTLET_SAVED_ON_SESSION
public static final java.lang.String LAST_VISITED_HOSTED_PAGE
public static final java.lang.String GATEWAY_HOSTED_MODE_HEADER
public static final java.lang.String GATEWAY_SPACE_NAME
public static final int NOFLAGS
public static final int POPUPFLAG
public static final int RETURNFLAG
public static final int REDIRECTGUEST
public static final int REFRESHFLAG
public static final int POPUPREFRESHFLAG
public static final int ADMINPREFS_POPUP
public static final int ADMINPREFS
public static final int GADGETPREFS
public static final int GADGETPREFS_POPUP
public static final int COMMUNITYPREFS
public static final int COMMUNITYPREFS_POPUP
public static final int HELP
public static final int HELP_POPUP
public static final int USERPLUGPAGE
public static final int ADMINPLUGPAGE
public static final int PORTLETCONTENT
public static final java.lang.String PT_REQUEST_TYPE_HEADER
public static final java.lang.String PT_CLIENT_SIDE_HEADER_VALUE
public static final java.lang.String PT_PORTLET_REFRESH_HEADER_VALUE
public static final java.lang.String PT_REFERER_HEADER
public static final java.lang.String CLOSEPOPUPJAVASCRIPT
public static final java.lang.String CLOSEPOPUPANDREFRESHJAVASCRIPT
public static final java.lang.String UI_STD
public static final java.lang.String UI_508
public static final java.lang.String UI_LOW
public static final java.lang.String UI_WML
public static final java.lang.String UI_PDA
public static final java.lang.String DEV_SUFFIX_PDA
public static final java.lang.String DEV_SUFFIX_WML
public static final java.lang.String DEFAULT_FRIENDLYGATEWAYURL_KEYWORD
public static final java.lang.String URL_SEPARATOR
public static final java.lang.String GWARG_PORTLET_PREFIX
public static final java.lang.String GWARG_WEBSRV_PREFIX
public static final java.lang.String GWARG_COMMUNITY_PREFIX
public static final java.lang.String GWARG_PAGE_PREFIX
public static final java.lang.String GWARG_PREFTYPE_PREFIX
public static final java.lang.String GWARG_USER_PREFIX
Constructor Detail |
---|
public GatewayHelpers()
Method Detail |
---|
public static java.lang.String GetUIMode(IXPRequest xpRequest, AActivitySpace asOwner)
xpRequest
- - current request objectasOwner
- - current activity space
public static java.lang.String ConstructAdminPrefsLink(AActivitySpace asOwner, boolean bPopup)
bPopup
- - boolean flag to indicate if the admin page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructTemplateAdminPrefsLink(AActivitySpace asOwner, boolean bPopup)
bPopup
- - boolean flag to indicate if the admin page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructAdminPrefsLink(AActivitySpace asOwner)
public static java.lang.String ConstructCommunityPrefsLink(AActivitySpace asOwner, int iPortletID, int iCommunityID, boolean bPopup)
iPortletID
- - ID of the portlet for which the gadget community preferences are setiCommunityID
- - ID of the community for which the gadget community preferences are setbPopup
- - boolean flag to indicate if the pref page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructCommunityPrefsLink(AActivitySpace asOwner, int iPortletID, int iCommunityID, int iPageID, boolean bPopup)
iPortletID
- - ID of the portlet for which the gadget community preferences are setiCommunityID
- - ID of the community for which the gadget community preferences are setiPageID
- - ID of the community page which the gadget community preferences are setbPopup
- - boolean flag to indicate if the pref page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructPortletPrefsLink(AActivitySpace asOwner, int iPortletID, boolean bPopup)
iPortletID
- - ID of the portlet for which the gadget preferences are setbPopup
- - boolean flag to indicate if the pref page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructPortletPrefsLink(AActivitySpace asOwner, int iPortletID, int iPageID, boolean bPopup)
iPortletID
- - ID of the portlet for which the gadget preferences are setiPageID
- - ID of the community page which the gadget preferences are setbPopup
- - boolean flag to indicate if the pref page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructPortletUserCommunityPrefsLink(AActivitySpace asOwner, int iPortletID, int iCommunityID, boolean bPopup)
iPortletID
- - ID of the portlet for which the gadget community user preferences are setiCommunityID
- - ID of the community for which the gadget community user preferences are setiPageID
- - ID of the community page which the gadget community user preferences are setbPopup
- - boolean flag to indicate if the prefs page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructHelpLink(AActivitySpace asOwner, int iPortletID, int iCommunityID, int iPageID, boolean bPopup)
iPortletID
- - ID of the portlet for which the help should be displayediCommunityID
- - ID of the community for which the help should be displayediPageID
- - ID of the community page which the help should be displayedbPopup
- - boolean flag to indicate if the help page will be displayed
in a separate popup window or not. All this flag does is tells
gateway to set Return-URI action to "close window".public static java.lang.String ConstructPrefPageLink(AActivitySpace asOwner, int iPortletID, int iCommunityID, int iPageID, int iPrefType)
asOwner
- - current activity space objectiPortletID
- - portlet idiCommunityID
- - community ID (0 if not applicable)iPageID
- - page ID (0 if not applicable)iPrefType
- - preference type
public static java.lang.String ConstructPrefPageLink(AActivitySpace asOwner, int iPortletID, int iCommunityID, int iPageID, int iPrefType, int iClassID)
asOwner
- - current activity space objectiPortletID
- - portlet or web service idiCommunityID
- - community ID (0 if not applicable)iPageID
- - page ID (0 if not applicable)iPrefType
- - preference typeiClassID
- - class id that describles iPortletID parameter.
public static java.lang.String ConstructGatewayURL(java.lang.String strCurrentRequestURL, int iPortletID, int iCommunityID, int iPageID, int iPrefType, int iClassID, java.lang.String strURLToGateway)
strCurrentRequestURL
- - the URL of the current request
(normally, the result of AActivitySpace.GetCurrentRequestURL())iPortletID
- - numeric ID of the portlet object or webservice objectiCommunityID
- - community ID (0 if not applicable)iPageID
- - page ID (0 if not applicable)iPrefType
- - preference type. For normal portlet click-throughs it should be 0.iClassID
- - class ID. This arguments tells whether second argument of this method is
portlet ID or webservice ID.strURLToGateway
- - absolute URL to the resource that should be gatewayed (i.e. http://www.google.com)
public static java.lang.String ConstructGatewayURL(java.lang.String curReqUrl, int objId, int commId, int pageId, int prefType, int classId, int userId, java.lang.String gatewayPath)
curReqUrl
- - the URL of the current request (normally, the result of AActivitySpace.GetCurrentRequestURL())objId
- - numeric ID of the portlet object or webservice objectcommId
- - community ID (0 if not applicable)pageId
- - page ID (0 if not applicable)prefType
- - preference type. For normal portlet click-throughs it should be 0.classId
- - This arguments tells whether second argument of this method is portlet ID or webservice ID.userId
- - user id, or 0 not to use onegatewayPath
- - absolute URL to the resource that should be gatewayed (i.e. http://www.google.com)
public static java.lang.String ConstructRegularGatewayURL(java.lang.String strAppBaseURL, int objId, int commId, int pageId, int prefType, int classId, int userId, java.lang.String gatewayPath)
curReqUrl
- - the URL of the current request (normally, the result of AActivitySpace.GetCurrentRequestURL())objId
- - numeric ID of the portlet object or webservice objectcommId
- - community ID (0 if not applicable)pageId
- - page ID (0 if not applicable)prefType
- - preference type. For normal portlet click-throughs it should be 0.classId
- - This arguments tells whether second argument of this method is portlet ID or webservice ID.userId
- - user id, or 0 not to use onegatewayPath
- - absolute URL to the resource that should be gatewayed (i.e. http://www.google.com)
public static java.lang.String GetFriendlyGatewayURLKeyword()
public static java.lang.String ConstructFriendlyGatewayURL(java.lang.String appBaseUrl, int objId, int commId, int pageId, int prefType, int classId, int userId, java.lang.String gatewayPath)
appBaseUrl-
- objId
- - numeric ID of the portlet object or webservice objectcommId
- - community ID (0 if not applicable)pageId
- - page ID (0 if not applicable)prefType
- - preference type. For normal portlet click-throughs it should be 0.classId
- - This arguments tells whether second argument of this method is portlet ID or webservice ID.userId
- - user id, or 0 not to use onegatewayPath
- - absolute URL to the resource that should be gatewayed (i.e. http://www.google.com)
public static java.lang.String ConstructPartialGatewayURL(java.lang.String appBaseUrl, int prefType, int userId)
public static java.lang.String ConstructPartialFriendlyGatewayURLKeyword(java.lang.String appBaseUrl, int prefType, int userId)
appBaseUrl
- prefType
- userId
-
public static java.lang.String ConstructReturnURI(AActivitySpace asOwner, int iPageID, int iCommunityID, boolean bPopup, boolean bRefreshPopup)
asOwner
- iPageID
- iCommunityID
- bPopup
- bRefreshPopup
-
public static java.lang.String CreateGatewayFriendlyURL(java.lang.String strURL)
strURL
-
public static java.lang.String ConvertToRegularGatewayURL(java.lang.String friendlyUrl, java.lang.String keyword)
public static boolean IsFriendlyGatewayURL(java.lang.String url, java.lang.String keyword)
url
- keyword
-
public static int GetId(java.lang.String stringId)
stringId
-
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |