***  This class is subject to change   ***

com.sas.portal.portlet
Class NavigationUtil

java.lang.Object
  |
  +--com.sas.portal.portlet.NavigationUtil

public class NavigationUtil
extends Object

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


Method Summary
static String buildBaseURL(PortletContext context, HttpServletRequest request)
          Build base URL given just a PortletContext and an HttpServletRequest.
static String buildBaseURL(PortletContext context, HttpServletRequest request, String portletActionName)
          Build base URL given a PortletContext, an HttpServletRequest, and a specific portletActionName.
static String buildBaseURL(PortletContext context, HttpServletRequest request, String portletActionName, Map parameters)
          Build base URL given a PortletContext, an HttpServletRequest, and a specific portletActionName.
static String buildBaseURL(RemotePortletContext context, HttpServletRequest request)
          Build base URL given just a RemotePortletContext and an HttpServletRequest.
static String buildBaseURL(RemotePortletContext context, HttpServletRequest request, String portletActionName)
          Build base URL given a RemotePortletContext, an HttpServletRequest, and a specific portletActionName.
static String buildBaseURL(RemotePortletContext context, HttpServletRequest request, String portletActionName, Map parameters)
          Build base URL given a RemotePortletContext, an HttpServletRequest, and a specific portletActionName.
static void prepareLocalizedResources(String bundleName, HttpServletRequest request, PortletContext ctx)
          Prepares the localized resources for the portlet by using the bundle name and the locale of the user.
static void prepareLocalizedResources(String bundleName, HttpServletRequest request, PortletContext ctx, Locale locale)
          Prepares the localized resources for the portlet by using the bundle name and the locale provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildBaseURL

public static String buildBaseURL(PortletContext context,
                                  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 String buildBaseURL(RemotePortletContext context,
                                  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 String buildBaseURL(PortletContext context,
                                  HttpServletRequest request,
                                  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:
he String URL for the page

buildBaseURL

public static String buildBaseURL(RemotePortletContext context,
                                  HttpServletRequest request,
                                  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

buildBaseURL

public static String buildBaseURL(PortletContext context,
                                  HttpServletRequest request,
                                  String portletActionName,
                                  Map parameters)
                           throws 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
map - the map of parameters to append to the built URL
Returns:
the String URL for the page
Throws:
IllegalArgumentException -  

buildBaseURL

public static String buildBaseURL(RemotePortletContext context,
                                  HttpServletRequest request,
                                  String portletActionName,
                                  Map parameters)
                           throws 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
map - the map of parameters to append to the built URL
Returns:
the String URL for the page
Throws:
IllegalArgumentException -  

prepareLocalizedResources

public static void prepareLocalizedResources(String bundleName,
                                             HttpServletRequest request,
                                             PortletContext ctx)
                                      throws 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:
IOException - if difficulty reading the file

prepareLocalizedResources

public static void prepareLocalizedResources(String bundleName,
                                             HttpServletRequest request,
                                             PortletContext ctx,
                                             Locale locale)
                                      throws IOException
Prepares the localized resources for the portlet by using the bundle name and the locale provided. 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
locale - the Locale to use
Throws:
IOException - if difficulty reading the file

***  This class is subject to change   ***




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:05:13