com.sas.portal.portlet
Class NavigationUtil

com.sas.portal.portlet.NavigationUtil

public class NavigationUtil

Utility class to build URLs and prepare resources specific to given locales.


Method Summary
static java.lang.String buildBaseURL(PortletContext context, javax.servlet.http.HttpServletRequest request)
          Build base URL given just a PortletContext and an HttpServletRequest.
static java.lang.String buildBaseURL(PortletContext context, javax.servlet.http.HttpServletRequest request, java.lang.String portletActionName)
          Build base URL given a PortletContext, an HttpServletRequest, and a specific portletActionName.
static java.lang.String buildBaseURL(PortletContext context, javax.servlet.http.HttpServletRequest request, java.lang.String portletActionName, java.util.Map parameters)
          Build base URL given a PortletContext, an HttpServletRequest, and a specific portletActionName.
static java.lang.String buildBaseURL(RemotePortletContext context, javax.servlet.http.HttpServletRequest request)
          Build base URL given just a RemotePortletContext and an HttpServletRequest.
static java.lang.String buildBaseURL(RemotePortletContext context, javax.servlet.http.HttpServletRequest request, java.lang.String portletActionName)
          Build base URL given a RemotePortletContext, an HttpServletRequest, and a specific portletActionName.
static java.lang.String buildBaseURL(RemotePortletContext context, javax.servlet.http.HttpServletRequest request, java.lang.String portletActionName, java.util.Map parameters)
          Build base URL given a RemotePortletContext, an HttpServletRequest, and a specific portletActionName.
static void prepareLocalizedResources(java.lang.String bundleName, javax.servlet.http.HttpServletRequest request, PortletContext ctx)
          Prepares the localized resources for the portlet by using the bundle name and the locale of the user.
 

Method Detail

buildBaseURL

public static java.lang.String buildBaseURL(PortletContext context,
                                            javax.servlet.http.HttpServletRequest request)
Build base URL given just a PortletContext and an HttpServletRequest. This will assume no specific portletActionName, and no parameters to use.

Parameters:
context - PortletContext to use
request - HttpServletRequest to use
Returns:
the String URL for the page

buildBaseURL

public static java.lang.String buildBaseURL(RemotePortletContext context,
                                            javax.servlet.http.HttpServletRequest request)
Build base URL given just a RemotePortletContext and an HttpServletRequest. This will assume no specific portletActionName, and no parameters to use.

Parameters:
context - PortletContext to use
request - HttpServletRequest to use
Returns:
the String URL for the page

buildBaseURL

public static java.lang.String buildBaseURL(PortletContext context,
                                            javax.servlet.http.HttpServletRequest request,
                                            java.lang.String portletActionName)
Build base URL given a PortletContext, an HttpServletRequest, and a specific portletActionName. This assumes there are no parameters to use.

Parameters:
context - PortletContext to use
request - HttpServletRequest to use
portletActionName - name of the portlet action
Returns:
the String URL for the page

buildBaseURL

public static java.lang.String buildBaseURL(RemotePortletContext context,
                                            javax.servlet.http.HttpServletRequest request,
                                            java.lang.String portletActionName)
Build base URL given a RemotePortletContext, an HttpServletRequest, and a specific portletActionName. This assumes there are no parameters to use.

Parameters:
context - PortletContext to use
request - HttpServletRequest to use
portletActionName - name of the portlet action
Returns:
the String URL for the page Used by com.sas.svcs.alerts.portlet.actions in Products/BIServices/Applications/SharedPortlets

buildBaseURL

public static java.lang.String buildBaseURL(PortletContext context,
                                            javax.servlet.http.HttpServletRequest request,
                                            java.lang.String portletActionName,
                                            java.util.Map parameters)
                                     throws java.lang.IllegalArgumentException
Build base URL given a PortletContext, an HttpServletRequest, and a specific portletActionName. This will build the URL, and then append onto the end the values from the parameters map. The format will be the key=value, with & between subsequent values. An illegalArgumentException will be thrown if any of the keys are duplicate on the generated URL that is being built

Parameters:
context - PortletContext to use
request - HttpServletRequest to use
portletActionName - name of the portlet action
parameters - the map of parameters to append to the built URL
Returns:
the String URL for the page
Throws:
java.lang.IllegalArgumentException

buildBaseURL

public static java.lang.String buildBaseURL(RemotePortletContext context,
                                            javax.servlet.http.HttpServletRequest request,
                                            java.lang.String portletActionName,
                                            java.util.Map parameters)
                                     throws java.lang.IllegalArgumentException
Build base URL given a RemotePortletContext, an HttpServletRequest, and a specific portletActionName. This will build the URL, and then append onto the end the values from the parameters map. The format will be the key=value, with & between subsequent values. An illegalArgumentException will be thrown if any of the keys are duplicate on the generated URL that is being built

Parameters:
context - RemotePortletContext to use
request - HttpServletRequest to use
portletActionName - name of the portlet action
parameters - the map of parameters to append to the built URL
Returns:
the String URL for the page
Throws:
java.lang.IllegalArgumentException - Used by com.sas.svcs.alerts.portlet.actions in Products/BIServices/Applications/SharedPortlets

prepareLocalizedResources

public static void prepareLocalizedResources(java.lang.String bundleName,
                                             javax.servlet.http.HttpServletRequest request,
                                             PortletContext ctx)
                                      throws java.io.IOException
Prepares the localized resources for the portlet by using the bundle name and the locale of the user. Bundle name should be a fully qualified package name and refer to a properties file. An example is com.foo.portlets.Resources.

Parameters:
bundleName - the package and name of a properties file
request - the HttpServletRequest
ctx - the PortletContext
Throws:
java.io.IOException - if difficulty reading the file



Copyright © 2009 SAS Institute Inc. All Rights Reserved.