|
Novell exteNd Director 5.2 API |
||||||||
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 which 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$ Example: $context$/jsp/PropertySheet.jsp would be parsed and converted to http://host/context/jsp/PropertySheet.jsp Note: This is equivelent to $CONTEXT_URL$ This string is used for compatibility with 3.0, $CONTEXT_URL$ should be used in its place going forward. |
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
Deprecated. No Replacement |
static String |
PAGE_PATH_SUBST
Portal substitution string $PAGE_PATH$ |
static String |
PORTAL_SERVLET_PATH_SUBST
Deprecated. No Replacement |
static String |
PORTAL_SERVLET_URL_SUBST
Deprecated. No Replacement |
static String |
PORTAL_URL_SUBST
Portal substitution string $PORTAL_URL$ |
static String |
PORTAL_USERPAGE_NAME_SUBST
Deprecated. No Replacement |
static String |
PORTLET_PATH_SUBST
Portal substitution string $PORTLET_PATH$ |
static String |
REQUEST_URI_SUBST
Portal substitution string $REQUEST_URI$ |
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_PATH_SUBST
Portal substitution string $THEME_PATH$ |
static String |
THEME_URL_SUBST
Portal substitution string $THEME_URL$ |
Constructor Summary | |
EboPortalUrlHelper()
|
Method Summary | |
static Document |
addUtilityNode(EbiPortalContext context,
Document doc)
Adds a portal URL utility node to the passed XML document. |
static String |
getContextURL(EbiPortalContext context)
Build a fullly qualified URL up through the context |
static String |
getPortalUrl(EbiPortalContext context,
String uri)
Build a full URL based on a URI which may include portal substitution strings. |
static String |
getPortalUrl(EbiPortalContext context,
String uri,
String baseUri)
Build a full URL based on a URI which may include portal substitution strings. |
static String |
getServletURL(EbiPortalContext context)
Constructs the full url of the current servlet request trhought 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
EboPortalUrlHelper.CONTEXT_URL_SUBST
public static final String PORTAL_URL_SUBST
A URL string beginning with the scheme up through the path to the portal. Example: $PORTAL_URL$/pg/PortalHomePage would be parsed and converted to http://host:8008/context/portal/pg/PortalHomePage
public static final String CONTEXT_URL_SUBST
A 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
A URL string beginning with the scheme up through the users current theme Example: $THEME_URL$/edit.gif would be parsed and converted to http://host/context/resource/portal-theme/CurrentTheme where resource is teh portal's resource servlet and CurrentTheme is the current user's theme.
public static final String THEME_PATH_SUBST
An absolute path string beginning with the context up through the users current theme directory Example: $THEME_PATH$/edit.gif would be parsed and converted to /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
A 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
A URL string beginning with the scheme up through the portals 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" the resource path.
public static final String REQUEST_URL_SUBST
A URL string beginning with the scheme up through the current servlet path and including the current requests 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 REQUEST_URI_SUBST
A absolute path string beginning with the context path through the current servlet path and including the current requests extra path info.
This uri will also be encoded with teh jsession id if the browsers does not support in-memory cookies
Example: $REQUEST_URI$?mode=new to /context/edit.jsp?mode=new
or (for cookieless browsers) to /context/edit.jsp;jsessionid=7812412471244?mode=new
Where /context/edit.jsp is the value returned from the method getRequestURI() 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 requests extra path info but not the 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 preceeding slash.
public static final String SERVLET_PATH_SUBST
Example: $CONTEXT_URL$/$SERVLET_PATH$ to http://host/context/custom.jsp In this case the servlet path is the value returned from HttpServletRequest.getServletPath() excluding the preceeding 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: $CONTEXT_URL$/$PORTAL_SERVLET_PATH$/$PAGE_PATH$/helloWorldPID.html 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 PORTLET_PATH_SUBST
Example: $PORTLET_PATH$/HelloWorldPortlet to http://host/context/portal/portlet/HelloWorldPortlet Where "portlet" is the extra path information off of the controller servlet that tells the portal to serve a single non-decorated portlet specified by the web.xml context param "PortalPathPortletKey"
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/metalic/edit.gif Where "metalic" 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
Assuming the current request URL is http://host/context/main/MyPage/finance
Where "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
Assuming the page in which the link is placed us http://host/context/main/MyPage/finance
Where "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 retruned 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 shceme specified, then the port will be left out
Constructor Detail |
public EboPortalUrlHelper()
Method Detail |
public static String getPortalUrl(EbiPortalContext context, String uri)
Example: "?action=test" resolves to the current requests 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 the result is "http://host/test.html"
context
- - the EbiPortalContext from which the path should be assembleduri
- - the path which we'll use to create a full URL pathpublic static String getPortalUrl(EbiPortalContext context, String uri, String baseUri)
Example: "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 the result is "http://host/test.html"
req
- - the HttpServletRequest from which the context path should be assembleduri
- - the path which we'll use to create a full URL pathbaseUri
- - 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 return http://host/mycontext
context
- - the current portal contextpublic 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)
Replace all substitution strings with the runtime replacement. For example: source = $CONTEXT_URL$ will render a result of 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 contextsource
- - The original stringpublic static String replaceAllKeywordStrings(EbiPortalContext context, String source, boolean replaceEntityRefs)
Replace all substitution strings with the runtime replacement. For example: source = $CONTEXT_URL$ will render a result of 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 contextsource
- - The original stringreplaceEntityRefs
- - if true replaces entity refs so that the returned string can be used in well formed xml
&, <, ', " are replaced with &, <, ', and "public static Document addUtilityNode(EbiPortalContext context, Document doc) throws EboFactoryException
This method will create an
context
- - the portal contextdoc
- - the original XML document
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |