|
Portal Guide |
This chapter provides reference information for the portal replacement strings. It includes the following sections:
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 component 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:
Director provides a portal component called PortalUrlHelper to give an easy way to use replacement strings on a portal page. Director also provides a custom tag called PortalUrlHelper that performs the same function.
For details on using the PortalUrlHelper component, see the chapter on installed components in the Samples. 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 |
|
|
Portal components |
Same as for portal options |
Replacement strings can also be used in the following context-param values in the web.xml file for a custom Web 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 in the web.xml file for the portal WAR.
Example
$PORTAL_SERVLET_URL$/$COMP_PATH$/HelloWorldComponent
Would be parsed and converted to:
http://host/context/main/comp/HelloWorldComponent
Description
Component ID of the user's currently selected component.
Example
If a link were placed in a page that had the URL http://host/context/main/MyPage/finance and the current component were called HelloWorld, the following example:
?ss_action=remove&ss_comp=$COMPONENT_ID$&ss_instance=$COMPONENT_INSTANCE_ID$
Would be 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
If a link were placed in a page that had the URL http://host/context/main/MyPage/finance and the current component were called HelloWorld, the following example:
?ss_action=remove&ss_comp=$COMPONENT_ID$&ss_instance=$COMPONENT_INSTANCE_ID$
Would be 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 in the web.xml file for the portal WAR.
Example
$PORTAL_SERVLET_URL$/$COMPONENT_PATH$/HelloWorldComponent
Would be parsed and converted to:
http://host/context/main/component/HelloWorldComponent
Description
Used for compatibility with Director 3.0. $CONTEXT_URL$ should be used in its place going forward.
The $context$ keyword is equivalent to:
$SCHEME$://$HOST_PORT$/$CONTEXT_PATH$
$CONTEXT_URL$
Example
$context$/jsp/PropertySheet.jsp
Would be 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$/main
Would be parsed and converted to:
http://host/Portal/main
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
Would be parsed and converted to:
http://host/context/jsp/PropertySheet.jsp
Description
Complete encoded URL reference.
The $ENCODE_REQUEST_URL$ keyword is equivalent to the URL-encoded value returned from HttpServletRequest.getRequestURL().
Example
http://host/catalog?callingpage=$ENCODED_REQUEST_URL$
Would be 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$
Would be 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
If myhost were the string returned from HttpServletRequest.getServerName() and 9090 is the string returned from HttpServletRequest.getServerPort() for the current request, the following example:
$SCHEME$://$HOSTP_PORT$
Would be parsed and converted to:
http://myhost:9090
Description
Extra path information following the path to the controller servlet that tells the servlet to serve the user's personalized pages.
The $MYPORTAL_PATH$ keyword is equivalent to the PortalPathMyPortalKey context parameter in the web.xml file for the portal WAR.
Example
$PORTAL_SERVLET_URL$/$MYPORTAL_PATH$
Would be parsed and converted to:
http://host/context/myportal/main
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 in the web.xml file for the portal WAR.
Example
$PORTAL_SERVLET_URL$/$PAGE_PATH$/helloWorldPID.html
Would be parsed and converted to:
http://host/context/main/page/helloWorldPID.html
Description
Main path to the portal controller servlet.
The $PORTAL_SERVLET_PATH$ keyword is equivalent to the PortalControllerServletPath context parameter in the web.xml file for the portal WAR.
Example
$CONTEXT_URL$/$PORTAL_SERVLET_PATH$/comp/HelloWorld
Would be parsed and converted to:
http://host/context/main/comp/HelloWorld
Description
URL reference to the portal controller servlet.
The $PORTAL_SERVLET_URL$ keyword is equivalent to:
$SCHEME$://$HOST_PORT$/$CONTEXT_PATH$/$PORTAL_SERVLET_PATH$
Example
$PORTAL_SERVLET_URL$/$COMPONENT_PATH$
Would be parsed and converted to:
http://host/DirectorDB/EAR/Portal/main/component
NOTE: The DirectorDB portion of the URL applies only if you're using an exteNd application server and you've deployed your archive to the same database created for Director application data. If you're using another application server or if you've deployed the archive to the SilverMaster database, the URL would not include the name of the Director database. The EAR portion of the URL would not be included for a Director WAR.
Description
Name of the current Portal User Page.
The $PORTAL_USERPAGE_NAME$ keyword is the name given to the current personal page by the user.
Example
$PORTAL_USERPAGE_NAME$
Might be parsed and converted to:
MyFinance
Description
Complete URL reference to the request (without the query parameters).
The $REQUEST_URL$ keyword is equivalent to the value returned from req.getRequestURL() on the current request.
Example
$REQUEST_URL$?mode=new
Would be parsed and converted to:
http://host/context/edit.jsp?mode=new
Description
URL reference to the resource path.
The $RESOURCE_URL$ keyword is equivalent to:
$SCHEME$://$HOST_PORT$/$CONTEXT_PATH$/$RESOURCE_PATH$
Example
$RESOURCE_URL$/portal-general/images/Hello.gif
Would be parsed and converted to:
http://host/context/resource/portal-general/images/Hello.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$
Would be 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$
Might be 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$
Would be parsed and converted to:
http://host/DirectorDB/EAR/Portal/main
NOTE: The DirectorDB portion of the URL applies only if you're using an exteNd application server and you've deployed your archive to the same database created for Director application data. If you're using another application server or if you've deployed the archive to the SilverMaster database, the URL would not include the name of the Director database. The EAR portion of the URL would not be included for a Director WAR.
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.
Example
If the current theme were called metallic, the following example:
$PORTAL_SERVLET_URL$/resource/portal-theme/$THEMEID$/edit.gif
Would be parsed and converted to:
http://host/context/main/resource/portal-theme/metallic/edit.gif
Description
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$/edit.gif
Would be parsed and converted to:
http://host/context/main/resource/portal-theme/theme-ID/edit.gif
|
Portal Guide |
Copyright © 2000, 2001, 2002, 2003 SilverStream Software, LLC, a wholly owned subsidiary of Novell, Inc. All rights reserved.