Portal Guide
CHAPTER 28
This chapter provides reference information for the portal replacement strings. It includes the following sections:
exteNd Director allows you to use replacement strings to include runtime, context-based information in a portal application. Replacement strings are keywords that reference things that can change dynamically at runtime, such as a user's current theme or the currently rendered portlet ID. When these keywords are detected at runtime, they are replaced based on information from the current HTTP request and/or the current portal context.
All portal replacement strings are defined as constants in the EboPortalUrlHelper class in the com.sssw.portal.util package.
Replacement strings can be used in several places in a portal application:
In a PID page or JSP page, you can use replacement strings to construct URLs, URIs, and query strings for the following HTML elements:
exteNd Director provides a portlet called PortalUrlHelper to give an easy way to use replacement strings on a portal page. exteNd Director also provides a custom tag called PortalUrlHelper that performs the same function.
For details on using the PortalUrlHelper custom tag, see PortalUrlHelper.
You can use replacement strings in the descriptors for the following portal resources:
Resource type |
Elements searched for replacement strings |
---|---|
Portal layouts |
|
Portal themes |
|
Portal options |
|
Portlets |
Replacement strings can also be used in the following context-param values in the web.xml file for an application:
There are several categories of replacement string keywords:
Category |
Keywords |
---|---|
URLs |
|
Paths |
|
IDs |
|
Other |
Description
Extra path information following the path to the controller servlet that tells the servlet to serve a component's undecorated content.
The $COMP_PATH$ keyword is equivalent to the PortalPathCompKey context parameter, defined as comp in the web.xml file for the portal WAR.
Example
$PORTAL_URL$/$COMP_PATH$/HelloWorldComponent
This example is parsed and converted to:
http://host/context/main/comp/HelloWorldComponent
Description
Portlet Registration ID or Component ID of the user's currently selected portlet or component.
Example
The following example is based on a link on a page that references the URL http://
host/
context/main/MyPage/finance
and a current component called HelloWorld:
?ss_action=remove&ss_comp=$COMPONENT_ID$&ss_instance=$COMPONENT_INSTANCE_ID$
This example is parsed and converted to:
http://host/context/main/MyPage/finance?ss_action=remove&ss_comp=HelloWorld&ss_instance=123456
Description
Instance ID of the user's currently selected component.
Example
The following example is based on a link on a page that references the URL http://
host/
context/main/MyPage/finance
and a current component called HelloWorld:
?ss_action=remove&ss_comp=$COMPONENT_ID$&ss_instance=$COMPONENT_INSTANCE_ID$
This example is parsed and converted to:
http://host/context/main/MyPage/finance?ss_action=remove&ss_comp=HelloWorld&ss_instance=123456
Description
Extra path information following the path to the controller servlet that tells the servlet to serve a single decorated component.
The $COMPONENT_PATH$ keyword is equivalent to the PortalPathComponentKey context parameter, defined as component in the web.xml file for the portal WAR.
Example
$PORTAL_URL$/$COMPONENT_PATH$/HelloWorldComponent
This example is parsed and converted to:
http://host/context/main/component/HelloWorldComponent
Description
Used for compatibility with exteNd Director 3.0. $CONTEXT_URL$ should be used in its place going forward.
The $context$ keyword is equivalent to:
$SCHEME$://$HOST_PORT$/$CONTEXT_PATH$
Or:
$CONTEXT_URL$
Example
$context$/jsp/PropertySheet.jsp
This example is parsed and converted to:
http://host/context/jsp/PropertySheet.jsp
Description
Path to the context on HttpServletRequest.
The $CONTEXT_PATH$ keyword is equivalent to the value returned from HttpServletRequest.getContextPath() excluding the preceding slash.
Example
http://host/$CONTEXT_PATH$/
If HttpServletRequest.getContextPath() returns the value Portal, this example is parsed and converted to:
http://host/Portal/
Description
URL reference to the servlet context.
The $CONTEXT_URL$ keyword is equivalent to:
$SCHEME$://$HOST_PORT$/$CONTEXT_PATH$
Example
$CONTEXT_URL$/jsp/PropertySheet.jsp
This example is parsed and converted to:
http://host/context/jsp/PropertySheet.jsp
Description
Complete encoded URL reference, including extra path information and query parameters.
The $ENCODE_REQUEST_URL$ keyword is equivalent to the URL-encoded value returned from HttpServletRequest.getRequestURL().
Example
http://host/catalog?callingpage=$ENCODED_REQUEST_URL$
This example is parsed and converted to:
http://host/catalog/callingpage=http%3A%2F%2Flocalhost%2FPortal%2Fmain%2FMyPortal%2FMyProfile
Description
The host for the HttpServletRequest. Use this keyword when you want to specify a port other than the port on the current request.
The $HOST$ keyword is equivalent to the value returned from HttpServletRequest.getServerName() for the current request.
Example
$SCHEME$://$HOST$
If the host is myhost, this example is parsed and converted to:
http://myhost
Description
Host and port for the HttpServletRequest.
The $HOST_PORT$ keyword is equivalent to the value returned from HttpServletRequest.getServerName() and HttpServletRequest.getServerPort() for the current request.
If the current port is the default for the scheme specified, then the port is left out.
Example
$SCHEME$://$HOSTP_PORT$
If the string returned from HttpServletRequest.getServerName() is myhost and the string returned from HttpServletRequest.getServerPort() is 9090 for the current request, the example parsed and converted to:
http://myhost:9090
Description
Extra path information following the path to the controller servlet that tells the servlet to serve a PID page.
The $PAGE_PATH$ keyword is equivalent to the PortalPathPagesKey context parameter, defined as pages in the web.xml file for the portal WAR.
Example
$PORTAL_URL$/$PAGE_PATH$/helloWorldPID.html
This example is parsed and converted to:
http://host/context/portal/pages/helloWorldPID.html
Description
Absolute path to the portal on the base servlet. It includes the PortalPathEntryPointKeythe main entry point for all portal requests and the key on which the Portal Aggregator listens. This key is defined in web.xml as portal.
The $PORTAL_URL$ keyword is equivalent to:
$CONTEXT_URL$/portal
Example
$PORTAL_URL$/pages/DirectorHome.html
This example is parsed and converted to:
http://host/context/portal/pages/DirectorHome.html
Description
Path to the portlet on the current request.
The $PORTLET_PATH$ keyword is the portlet path information on the base servlet. It includes the PortalPathPortletKey which instructs the portal to serve a single non-decorated portlet. This key is defined in web.xml as portlet.
$PORTLET_PATH$ is equivalent to:
$PORTAL_URL$/portlet
Example
$PORTLET_PATH$/Header
This example is parsed and converted to:
http://host/context/portal/portlet/Header
Description
Absolute URI path to the current request
The $REQUEST_URI$ keyword is equivalent to the value returned form req.getRequestURI() on the current request.
Example
For the request http:/localhost/MyPortal/portal/pg/up_MyPage
, $REQUEST_URI$ is parsed and converted to:
/MyPortal/portal/pg/up_MyPage
Description
Absolute URL path to the current request (without the query parameters).
The $REQUEST_URL$ keyword is equivalent to the value returned from req.getRequestURL() on the current request.
Example
For the request http:/localhost/MyPortal/portal/pg/up_MyPage
, $REQUEST_URL$ is parsed and converted to:
http:/localhost/MyPortal/portal/pg/up_MyPage
Description
URL reference to the resource path.
The $RESOURCE_URL$ keyword is equivalent to the PortalResourcePath context parameter, defined as $CONTEXT_URL$/resource in the web.xml file for the portal WAR.
Example
$RESOURCE_URL$/portal-theme/Titanium/images/preview.gif
This example is parsed and converted to:
http://host/context/resource/portal-theme/Titanium/images/preview.gif
Description
The scheme for the HttpServletRequest.
The $SCHEME$ keyword is equivalent to the value returned from HttpServletRequest.getScheme() for the current request.
Example
$SCHEME$://$HOST$
If HttpServletRequest.getScheme() returns http and the host is myhost, this example is parsed and converted to:
http://myhost
Description
Path to the servlet on HttpServletRequest.
The $SERVLET_PATH$ keyword is equivalent to the value returned from HttpServletRequest.getServletPath(), excluding the preceding slash:
Example
$CONTEXT_URL$/$SERVLET_PATH$
If HttpServletRequest.getServletPath() returns /custom.jsp, this example is parsed and converted to:
http://host/context/custom.jsp
Description
URL reference to the current servlet path.
The $SERVLET_URL$ keyword is equivalent to:
$SCHEME$://$HOST_PORT$/$CONTEXT_PATH$/$SERVLET_PATH$
Example
$SERVLET_URL$
This example may be parsed and converted to:
http://host/ExpressPortal/portal/main
Description
Theme ID of the user's currently selected theme. If no user is logged in or the user does not have a selected theme, the portal's default theme will be used.
The $THEME_ID$ keyword is equivalent to the PortalDefaultTheme context parameter, defined in the web.xml file for the portal WAR.
Example
$PORTAL_URL$/resource/portal-theme/$THEMEID$/images/edit.gif
If the current theme is Titanium, this example is parsed and converted to:
http://host/context/main/resource/portal-theme/Titanium/edit.gif
Description
Absolute path to the current user's theme resources in the resource set.
The $THEME_PATH$ keyword is equivalent to:
$RESOURCE_URL$/portal-theme
Example
$THEME_PATH$/Titanium/images/preview.gif
This example is parsed and converted to:
http://host/context/resource/portal-theme/Titanium/images/preview.gif
Description
URL reference to a theme.
The $THEME_URL$ keyword is equivalent to:
$SCHEME$://$HOST_PORT$/$CONTEXT_PATH$/$RESOURCE_PATH$/portal-theme/$THEME_ID$
The $THEME_URL$ keyword is also equivalent to:
$RESOURCE_URL$/portal-theme/$THEME_ID$
Example
$THEME_URL$/images/edit.gif
Would be parsed and converted to:
http://host/context/resource/portal-theme/theme-ID/images/edit.gif
Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...