|
SilverStream eXtend Director 4.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sssw.portal.util.EboPortalUrlHelper
Provides methods that help retrieve and parse portal URLs.
| Field Summary | |
static String |
COMP_PATH_SUBST
Portal substitution string $COMP_PATH$ |
static String |
COMPONENT_ID_SUBST
Portal substitution string $COMPONENT_ID$ |
static String |
COMPONENT_INSTANCE_ID_SUBST
Portal substitution string $COMPONENT_INSTANCE_ID$ |
static String |
COMPONENT_PATH_SUBST
Portal substitution string $COMPONENT_PATH$ |
static String |
CONTEXT_PATH_SUBST
Portal substitution string $CONTEXT_PATH$ |
static String |
CONTEXT_SUBST
Portal substitution string $context$ |
static String |
CONTEXT_URL_SUBST
Portal substitution string $CONTEXT_URL$ |
static String |
ENCODED_REQUEST_URL_SUBST
Portal substitution string $ENCODED_REQUEST_URL$ |
static String |
HOST_PORT_SUBST
Portal substitution string $HOSTP_PORT$ |
static String |
HOST_SUBST
Portal substitution string $HOST$ |
static String |
MYPORTAL_PATH_SUBST
Portal substitution string $MYPORTAL_PATH$ |
static String |
PAGE_PATH_SUBST
Portal substitution string $PAGE_PATH$ |
static String |
PORTAL_SERVLET_PATH_SUBST
Portal substitution string $PORTAL_SERVLET_PATH$ |
static String |
PORTAL_SERVLET_URL_SUBST
Portal substitution string $PORTAL_SERVLET_URL$ |
static String |
PORTAL_USERPAGE_NAME_SUBST
Portal substitution string $PORTAL_SERVLET_PATH$ |
static String |
REQUEST_URL_SUBST
Portal substitution string $REQUEST_URL$ |
static String |
RESOURCE_URL_SUBST
Portal substitution string $RESOURCE_URL$ |
static String |
SCHEME_SUBST
Portal substitution string $SCHEME$ |
static String |
SERVLET_PATH_SUBST
Portal substitution string $SERVLET_PATH$ |
static String |
SERVLET_URL_SUBST
Portal substitution string $SERVLET_URL$ |
static String |
THEME_ID_SUBST
Portal substitution string $THEME_ID$ |
static String |
THEME_URL_SUBST
Portal substitution string $THEME_URL$ |
| Constructor Summary | |
EboPortalUrlHelper()
|
|
| Method Summary | |
static String |
getContextURL(EbiPortalContext context)
Build a fully qualified URL up through the context |
static String |
getPortalUrl(EbiPortalContext context,
String uri)
Build a full URL based on a URI that may include portal substitution strings. |
static String |
getPortalUrl(EbiPortalContext context,
String uri,
String baseUri)
Build a full URL based on a URI that may include portal substitution strings. |
static String |
getServletURL(EbiPortalContext context)
Constructs the full URL of the current servlet request through the servlet path. |
static String |
replaceAllKeywordStrings(EbiPortalContext context,
String source)
Replaces all keyword strings. |
static String |
replaceAllKeywordStrings(EbiPortalContext context,
String source,
boolean replaceEntityRefs)
Replaces all keyword strings. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final String CONTEXT_SUBST
Example: $context$/jsp/PropertySheet.jsp would be parsed and converted
to http://host/context/jsp/PropertySheet.jsp.
Note: This is equivalent to $CONTEXT_URL$. This string is used for compatibility with 3.0; $CONTEXT_URL$ should be used in its place going forward.
EboPortalUrlHelper.CONTEXT_URL_SUBSTpublic static final String CONTEXT_URL_SUBST
An URL string beginning with the scheme up through the current web application context.
Example: $CONTEXT_URL$/jsp/PropertySheet.jsp would be parsed and converted
to http://host/context/jsp/PropertySheet.jsp.
public static final String THEME_URL_SUBST
An URL string beginning with the scheme up through the user's current theme.
Example: $THEME_URL$/edit.gif would be parsed and converted
to http://host/context/resource/portal-theme/CurrentTheme
where resource is the portal's resource servlet and CurrentTheme is
the current user's theme.
public static final String SERVLET_URL_SUBST
An URL string beginning with the scheme up through current servlet path.
Example: $SERVLET_URL$
would be parsed and converted
to http://host/context/servletPath.
public static final String PORTAL_SERVLET_URL_SUBST
An URL string beginning with the scheme up through the portal's controller servlet path specified by the web.xml context-param entry PortalControllerServletPath.
Example: $PORTAL_SERVLET_URL$
would be parsed and converted
to http://host/context/main.
where main is the default servlet path of the portal controller servlet.
public static final String RESOURCE_URL_SUBST
A string representing the fully qualified URL to the resource servlet.
Example: $RESOURCE_URL$/portal-general/images/Hello.gif
would be parsed and converted
to http://host/ResourceSet/resource/portal-general/images/Hello.gif
where ResourceSet is the context of the resource set servlet and resource is the
resource path.
public static final String REQUEST_URL_SUBST
An URL string beginning with the scheme up through the current servlet path and including the current request's extra path info and query information.
Example: $REQUEST_URL$?mode=new
to http://host/context/edit.jsp?mode=new
where http://host/context/edit.jsp is the value returned from the method getRequestURL()
off of the current request.
public static final String ENCODED_REQUEST_URL_SUBST
An URL encoded URL string beginning with the scheme up through the current servlet path and including the current request's extra path info and query information.
Example: http://host/catalog?callingpage=$ENCODED_REQUEST_URL$
to http://host/catalog/callingpage=http%3A%2F%2Flocalhost%2FPortal%2Fmain%2FMyPortal%2FMyProfile
where http://host/context/edit.jsp is the value returned from HttpServletRequest.getRequestURL().
public static final String CONTEXT_PATH_SUBST
Example: http://host/$CONTEXT_PATH$/main
to http://host/Portal/main where Portal is the value returned
from HttpServletRequest.getContextPath() excluding the preceding slash.
public static final String SERVLET_PATH_SUBST
Example: $CONTEXT_URL$/$SERVLET_PATH$
to http://host/context/custom.jsp.
The servlet path is the value returned from HttpServletRequest.getServletPath() excluding the preceding slash.
public static final String PORTAL_SERVLET_PATH_SUBST
Example: $CONTEXT_URL$/$PORTAL_SERVLET_PATH$/comp/HelloWorld would be parsed and converted
to http://host/context/main/comp/HelloWorld.
The portal servlet path is the main path to the portal controller servlet, specified by the context param PortalControllerServletPath.
public static final String PORTAL_USERPAGE_NAME_SUBST
The name of the Portal User Page (e.g. MyFinance).
Example: $PORTAL_USERPAGE_NAME$ would be parsed and converted
to MyFinance (or whatever the current User Page is).
The portal user page name is the name given to a page created by a user.
public static final String MYPORTAL_PATH_SUBST
Example: $CONTEXT_URL$/$PORTAL_SERVLET_PATH$/$MYPORTAL_PATH$
to http://host/context/main/myportal
where myportal is the extra path information off of the controller servlet that tells the servlet
to serve the user's personalized pages specified by the web.xml context param PortalPathMyPortalKey.
public static final String PAGE_PATH_SUBST
Example:
to http://host/context/main/page/helloWorldPID.html
where page is the extra path information off of the controller servlet that tells the servlet
to serve the PID pages specified by the web.xml context param PortalPathPagesKey.
public static final String COMPONENT_PATH_SUBST
Example: $CONTEXT_URL$/$PORTAL_SERVLET_PATH$/$COMPONENT_PATH$/HelloWorldComponent
to http://host/context/main/component/HelloWorldComponent
where component is the extra path information off of the controller servlet that tells the servlet
to serve a single decorated component specified by the web.xml context param PortalPathComponentKey.
public static final String COMP_PATH_SUBST
Example: $CONTEXT_URL$/$PORTAL_SERVLET_PATH$/$COMPONENT_PATH$/HelloWorldComponent
to http://host/context/main/comp/HelloWorldComponent
where comp is the extra path information off of the controller servlet that tells the servlet
to serve a single non-decorated component specified by the web.xml context param PortalPathCompKey.
public static final String THEME_ID_SUBST
The theme ID of the user's currently selecetd 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 default theme is specified by the web.xml context param PortalDefaultTheme.
Example: $CONTEXT_URL$/$PORTAL_SERVLET_PATH$/$RESOURCE_PATH$/portal-theme/$THEMEID$/edit.gif
to http://host/context/main/resource/portal-theme/metallic/edit.gif
where metallic is the user's current theme ID.
public static final String COMPONENT_ID_SUBST
The currently executing componentID retrieved from EbiPortalContext.getComponentID().
Example: ?ss_action=remove&ss_comp=$COMPONENT_ID$&ss_instance=$COMPONENT_INSTANCE_ID$
to http://host/context/main/MyPage/finance?ss_action=remove&ss_comp=HelloWorld&ss_instance=123145
where the current request URL is http://host/context/main/MyPage/finance
and HelloWorld is the current component.
public static final String COMPONENT_INSTANCE_ID_SUBST
The currently executing component instance retrieved from
EbiPortalContext.getComponentInstanceName().
Example: ?ss_action=remove&ss_comp=$COMPONENT_ID$&ss_instance=$COMPONENT_INSTANCE_ID$
to http://host/context/main/MyPage/finance?ss_action=remove&ss_comp=HelloWorld&ss_instance=123456
where the page in which the link is placed is http://host/context/main/MyPage/finance
and 123456 is the current component instance ID.
This replacement string might be used in a component or option descriptor.
public static final String SCHEME_SUBST
Example: $SCHEME$://host
to http://host
where http is the string returned from HttpServeltRequest.getScheme() off of the current request.
public static final String HOST_SUBST
Example: $SCHEME$://$HOST$
to http://myhost
where myhost is the string returned from HttpServeltRequest.getServerName() for the current request.
public static final String HOST_PORT_SUBST
Example: $SCHEME$://$HOST_PORT$
to http://myhost:9090
where myhost is the string returned from HttpServeltRequest.getServerName() and
9090 is the string returned from a call to HttpServletRequest.getServerPort() for the current request.
If the current port is a default for the scheme specified, then the port will be left out.
| Constructor Detail |
public EboPortalUrlHelper()
| Method Detail |
public static String getPortalUrl(EbiPortalContext context,
String uri)
Examples:
?action=test resolves to the current request's URL with this value appended
/test.html resolves to http://host/test.html where host is the current machine host
http://host/test.html -- since this is already a valid HTTP URL, no resolution is performed, so the result is http://host/test.html
context - The HttpServletRequest from which the context path should be assembled.uri - The path we'll use to create a full URL path.
public static String getPortalUrl(EbiPortalContext context,
String uri,
String baseUri)
Examples:
action=test resolves to the base URI with this value appended
/test.html resolves to http://host/test.html where host is the current machine host
http://host/test.html -- since this is already a valid HTTP URL, no resolution is performed, so the result is http://host/test.html
context - The HttpServletRequest from which the context path should be assembled.uri - The path we'll use to create a full URL path.baseUri - The path which will be used as the base URI if the URI does not start with "/" or "http://"
for relative references.public static String getContextURL(EbiPortalContext context)
Example: for current request URL = http://host/mycontext/servlet?action=delete
returns http://host/mycontext.
context - The current portal context.public static String getServletURL(EbiPortalContext context)
Example: for current request URL = http://host/mycontext/servlet?action=delete
return http://host/mycontext/servlet.
public static String replaceAllKeywordStrings(EbiPortalContext context,
String source)
Replaces all substitution strings with the runtime replacement.
For example: source = $CONTEXT_URL$
will render the result http://host/context
where host is the current host (req.getServlerName()) from the request and context is the current context
from the request (req.getServletContext()).
context - The portal context.source - The original string.
public static String replaceAllKeywordStrings(EbiPortalContext context,
String source,
boolean replaceEntityRefs)
Replaces all substitution strings with the runtime replacement.
For example: source = $CONTEXT_URL$
will render the result http://host/context
where host is the current host (req.getServlerName()) from the request and context is the current context
from the request (req.getServletContext()).
All &'s are replaced with the & entity reference so that the returned value can be added to a well-formed XML document for parsing.
context - The portal context.source - The original string.replaceEntityRefs - If true, replaces entity references so that the returned string can be used in well-formed XML -- &, <, ', " are replaced with &, <, ', and ".
|
SilverStream eXtend Director 4.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||