com.bowstreet.builders.webapp.methods
Class ContentHelper

java.lang.Object
  extended by com.bowstreet.builders.webapp.methods.ContentHelper

public class ContentHelper
extends java.lang.Object

Methods used to work with servable content.


Constructor Summary
ContentHelper()
           
 
Method Summary
static boolean contentExists(java.lang.String content)
          Check to make sure that the specified content exists on the server
static void convertToAbsoluteURLs(IXml content, java.lang.String url, java.lang.String appContext)
          Convert relative URL references in HTML to absolute ones.
static java.lang.String generateContentURL(java.lang.String url)
          Regen-time: generate code which will build a content URL.
static java.lang.String getContentURL(WebAppAccess webAppAccess, java.lang.Object urlObj)
          Execution-time code to make a content URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentHelper

public ContentHelper()
Method Detail

contentExists

public static boolean contentExists(java.lang.String content)
Check to make sure that the specified content exists on the server

Parameters:
content - the content to be verified
Returns:
true if the content exists or is an indirect reference false if the content cannot be found

convertToAbsoluteURLs

public static void convertToAbsoluteURLs(IXml content,
                                         java.lang.String url,
                                         java.lang.String appContext)
Convert relative URL references in HTML to absolute ones.

Parameters:
content - the HTML content as IXml, which is converted in place
url - from where this was retrieved
appContext - the application context, if content was imported locally

generateContentURL

public static java.lang.String generateContentURL(java.lang.String url)
Regen-time: generate code which will build a content URL.

Parameters:
url - the content URL
Returns:
a JSP expression which, when executed, will generate the correct URL
See Also:
getContentURL(com.bowstreet.webapp.WebAppAccess, java.lang.Object)

getContentURL

public static java.lang.String getContentURL(WebAppAccess webAppAccess,
                                             java.lang.Object urlObj)
Execution-time code to make a content URL.

Parameters:
webAppAccess - runtime access for current model
urlObj - the content URL - can be relative or absolute, and can be wrapped as the text of an IXml element
Returns:
a String representation of the URL, made relative to current app context if necessary
See Also:
generateContentURL(java.lang.String)


Copyright © 2009 IBM. All Rights Reserved.