org.apache.jetspeed.headerresource
Class HeaderResourceLib

java.lang.Object
  extended by org.apache.jetspeed.headerresource.HeaderResourceLib

public class HeaderResourceLib
extends Object

HeaderResourceLib static utility methods

Version:
$Id: HeaderResourceLib.java 188569 2006-10-21 13:35:18Z smilek $
Author:
Steve Milek

Field Summary
protected static String EOL
           
private static String MAILTO_URL_SCHEME
           
private static int MAILTO_URL_SCHEME_LEN
           
 
Constructor Summary
HeaderResourceLib()
           
 
Method Summary
static String getHeaderType(Integer headerTypeId)
           
static int getHeaderTypeId(String headerType)
           
static String getPortalBaseUrl(RequestContext requestContext)
          Portal base url ( e.g.
static String getPortalBaseUrl(RequestContext requestContext, BasePortalURL baseUrlAccessOverride)
          Portal base url ( e.g.
static String getPortalBaseUrl(RequestContext requestContext, BasePortalURL baseUrlAccessOverride, boolean fullUrl)
          Portal base url ( e.g.
static String getPortalResourceUrl(String relativePath, String portalBaseUrl)
          Portal base url with relativePath argument appended ( e.g.
static String getPortalResourceUrl(String relativePath, String portalBaseUrl, boolean encode, RequestContext requestContext)
          Portal base url with relativePath argument appended ( e.g.
static String getPortalUrl(String portalBaseUrl, RequestContext requestContext)
          Portal base servlet url ( e.g.
static String getPortalUrl(String portalBaseUrl, RequestContext requestContext, String servletPath)
          Portal base servlet url ( e.g.
static String getPortalUrl(String relativePath, String portalUrl)
          Portal base servlet url with relativePath argument appended ( e.g.
static String getPortalUrl(String relativePath, String portalUrl, boolean encode, RequestContext requestContext)
          Portal base servlet url with relativePath argument appended ( e.g.
static String makeJavascriptStatement(String statement, String indent, boolean addEOL)
           
static String makeJSONBoolean(Object source)
           
static String makeJSONInteger(Object source, boolean quote)
           
static StringBuffer makeJSONObject(Map[] objectMaps, boolean whenEmptyReturnNewObject)
           
static StringBuffer makeJSONObject(Map objectMap, boolean whenEmptyReturnNewObject)
           
static StringBuffer makeJSONObject(StringBuffer jsonBuffer, Map[] objectMaps, boolean whenEmptyReturnNewObject)
           
static StringBuffer makeJSONObject(StringBuffer jsonBuffer, Map objectMap, boolean whenEmptyReturnNewObject)
           
static String makeJSONStringArray(Collection stringList)
           
static String makeJSONStringArray(Collection stringList, List compiledUniqueValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOL

protected static final String EOL
See Also:
Constant Field Values

MAILTO_URL_SCHEME

private static final String MAILTO_URL_SCHEME
See Also:
Constant Field Values

MAILTO_URL_SCHEME_LEN

private static final int MAILTO_URL_SCHEME_LEN
Constructor Detail

HeaderResourceLib

public HeaderResourceLib()
Method Detail

getHeaderTypeId

public static int getHeaderTypeId(String headerType)

getHeaderType

public static String getHeaderType(Integer headerTypeId)

getPortalBaseUrl

public static String getPortalBaseUrl(RequestContext requestContext)
Portal base url ( e.g. http://localhost:8080/jetspeed )

Returns:
portal base url

getPortalBaseUrl

public static String getPortalBaseUrl(RequestContext requestContext,
                                      BasePortalURL baseUrlAccessOverride)
Portal base url ( e.g. http://localhost:8080/jetspeed ) The optional BasePortalURL argument is provided to allow the common BasePortalURL usage by various jetspeed components to be properly supported in this url generation

Returns:
portal base url

getPortalBaseUrl

public static String getPortalBaseUrl(RequestContext requestContext,
                                      BasePortalURL baseUrlAccessOverride,
                                      boolean fullUrl)
Portal base url ( e.g. http://localhost:8080/jetspeed ) The optional BasePortalURL argument is provided to allow the common BasePortalURL usage by various jetspeed components to be properly supported in this url generation When the fullUrl parameter is true, the scheme, servername and port will be provided in the baseUrl, regardless if global property portalurl.relative.only is set to true in jetspeed.properties. This is needed for HeaderResourceImpl.jetspeedGenerateBasetag() for rendering a valid base tag (for which IE requires an absolute url to work).
Note: if portalurl.relative.only is set to true to support a Proxy based front end, better remove de (default) "header.basetag" rendering setting from assembly/headtag.xml, otherwise the desktop still won't work properly behind the Proxy.

Returns:
portal base url

getPortalUrl

public static String getPortalUrl(String portalBaseUrl,
                                  RequestContext requestContext)
Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ ) Expects portalBaseUrl argument to be defined (ie. it does not call getPortalBaseUrl)

Returns:
portal base servlet url

getPortalUrl

public static String getPortalUrl(String portalBaseUrl,
                                  RequestContext requestContext,
                                  String servletPath)
Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ ) Expects portalBaseUrl argument to be defined (ie. it does not call getPortalBaseUrl) Also expects servletPath argument to be defined

Returns:
portal base servlet url

getPortalUrl

public static String getPortalUrl(String relativePath,
                                  String portalUrl)
Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml ) Expects portalUrl argument to be defined (ie. it does not call getPortalUrl)

Returns:
portal base servlet url with relativePath argument appended

getPortalUrl

public static String getPortalUrl(String relativePath,
                                  String portalUrl,
                                  boolean encode,
                                  RequestContext requestContext)
Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml ) Expects portalUrl argument to be defined (ie. it does not call getPortalUrl) RequestContext argument is needed only when encode argument is true (it's needed to call HttpServletResponse.encodeURL()) Method signature/behavior is a bit strange because this is a static method trying to accomodate callers that lazy cache portalUrl string

Returns:
portal base servlet url with relativePath argument appended

getPortalResourceUrl

public static String getPortalResourceUrl(String relativePath,
                                          String portalBaseUrl)
Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ ) Expects portalBaseUrl argument to be defined (ie. it does not call getPortalBaseUrl)

Returns:
portal base url with relativePath argument appended

getPortalResourceUrl

public static String getPortalResourceUrl(String relativePath,
                                          String portalBaseUrl,
                                          boolean encode,
                                          RequestContext requestContext)
Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ ) Expects portalBaseUrl argument to be defined (ie. it does not call getPortalBaseUrl) RequestContext argument is needed only when encode argument is true (it's needed to call HttpServletResponse.encodeURL()) Method signature/behavior is a bit strange because this is a static method trying to accomodate callers that lazy cache portalBaseUrl string

Returns:
portal base url with relativePath argument appended

makeJSONObject

public static StringBuffer makeJSONObject(Map objectMap,
                                          boolean whenEmptyReturnNewObject)

makeJSONObject

public static StringBuffer makeJSONObject(Map[] objectMaps,
                                          boolean whenEmptyReturnNewObject)

makeJSONObject

public static StringBuffer makeJSONObject(StringBuffer jsonBuffer,
                                          Map objectMap,
                                          boolean whenEmptyReturnNewObject)

makeJSONObject

public static StringBuffer makeJSONObject(StringBuffer jsonBuffer,
                                          Map[] objectMaps,
                                          boolean whenEmptyReturnNewObject)

makeJavascriptStatement

public static String makeJavascriptStatement(String statement,
                                             String indent,
                                             boolean addEOL)

makeJSONStringArray

public static String makeJSONStringArray(Collection stringList)

makeJSONStringArray

public static String makeJSONStringArray(Collection stringList,
                                         List compiledUniqueValues)

makeJSONInteger

public static String makeJSONInteger(Object source,
                                     boolean quote)

makeJSONBoolean

public static String makeJSONBoolean(Object source)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.