com.plumtree.portalpages.common.uiparts
Class NavigationCommonHelpers

java.lang.Object
  extended by com.plumtree.portalpages.common.uiparts.NavigationCommonHelpers

public class NavigationCommonHelpers
extends java.lang.Object

Common static navigation helper functions.

Author:
robertz

Field Summary
static int DEFAULT_MENU_TEXT_MAX_LENGTH
          Default truncation width
static java.lang.String JSCRIPT_FUNC_BUILD_URL_FROM_TEMPL
          Javascript function name constant
static java.lang.String JSCRIPT_VAR_DDTABS_ARRAY
          Javascript variable name constant
static java.lang.String JSCRIPT_VAR_MANDTAB_ARRAY
          Javascript variable name constant
static java.lang.String URLTEMPLATE_REDIRECT_JSFUNCNAME
          Url template redirect function.
 
Constructor Summary
NavigationCommonHelpers()
           
 
Method Summary
static HTMLElementCollection CreateDropDownEndMarkers()
          Adds the end of banner markers for ISC dropdown menus.
static void CreateHorizontalSpacerCell(HTMLTableRow myTableRow)
          Adds a spacer cell with a cell width of 4to the specified HTMLTableRow
static HTMLScript CreateMandatoryTabsArray(ICPListEntryIterator cpList, AActivitySpace parent)
          Creates a HTMLScript block with an array of the mandatory tabs to display The javascript array is a two dimensional array - element[i][0]: Name of the mandatory community element[i][1]: Original name of the mandatory community (before truncation), use for tooltip element[i][2]: URL to the mandatory community
static void CreateVerticalSpacerCell(HTMLTableRow myTableRow)
          Adds a spacer cell to the specified HTMLTableRow
static java.lang.String EscapeSingleQuotes(java.lang.String strIn)
          Prepares a string for use in Javascript code, escapes single quotes (').
static HTMLScript GenerateJSHTMLHelperFunctions(AActivitySpace parent)
          Creates writeStartTable, writeEndOfTable, writeSpacerTable and writeSpacerCell, dynamic HTML generating Javascript helper functions used in .js files to to position dropdown menu tabs and mandatory communities tabs.
static java.lang.String GetCommunityImageSource(AActivitySpace aspace)
          Helper function that returns a string with the image source of the formatted image for Communities
static java.lang.String GetCommunityImageURLString(AActivitySpace aspace, java.lang.String commName)
          Helper function that returns a string with the HTML of the formatted image for Communities
static java.lang.String GetMyPageImageSource(AActivitySpace aspace)
          Helper function that returns a string with the HTML of the formatted image for Mypages
static java.lang.String GetMyPageImageURLString(AActivitySpace aspace, java.lang.String mpName)
          Helper function that returns a string with the HTML of the formatted image for Mypages
static int GetNavSettingsValueAsInt(java.lang.String strKey, AActivitySpace owner)
          Helper function for getting values of settings in NavigationSettings.xml as integers.
static java.lang.String GetNavSettingsValueAsString(java.lang.String strKey, AActivitySpace owner)
          Helper function for getting values of settings in NavigationSettings.xml as Strings.
static HTMLImg GetSpacerImage(java.lang.String sWidth, java.lang.String sHeight)
          Helper function that creates a spacer Image with specified width and height
static java.lang.String writeURLTemplateParseFunction(AActivitySpace space)
          Parses the ID or IDs needed to create the URL for mypages or community pages (or other types) Needs to be in sync with the IDs put used as data value for each cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MENU_TEXT_MAX_LENGTH

public static final int DEFAULT_MENU_TEXT_MAX_LENGTH
Default truncation width

See Also:
Constant Field Values

URLTEMPLATE_REDIRECT_JSFUNCNAME

public static final java.lang.String URLTEMPLATE_REDIRECT_JSFUNCNAME
Url template redirect function. Make the name as short as possible to send down less data

See Also:
Constant Field Values

JSCRIPT_VAR_MANDTAB_ARRAY

public static final java.lang.String JSCRIPT_VAR_MANDTAB_ARRAY
Javascript variable name constant

See Also:
Constant Field Values

JSCRIPT_VAR_DDTABS_ARRAY

public static final java.lang.String JSCRIPT_VAR_DDTABS_ARRAY
Javascript variable name constant

See Also:
Constant Field Values

JSCRIPT_FUNC_BUILD_URL_FROM_TEMPL

public static final java.lang.String JSCRIPT_FUNC_BUILD_URL_FROM_TEMPL
Javascript function name constant

See Also:
Constant Field Values
Constructor Detail

NavigationCommonHelpers

public NavigationCommonHelpers()
Method Detail

GetNavSettingsValueAsInt

public static int GetNavSettingsValueAsInt(java.lang.String strKey,
                                           AActivitySpace owner)
Helper function for getting values of settings in NavigationSettings.xml as integers.

Parameters:
strKey - Name of the navigation setting.
owner - Current Activityspace
Returns:
int The requested Navigation setting value as integer. -1 if the key doesn't exist or not an integer.

GetNavSettingsValueAsString

public static java.lang.String GetNavSettingsValueAsString(java.lang.String strKey,
                                                           AActivitySpace owner)
Helper function for getting values of settings in NavigationSettings.xml as Strings.

Parameters:
strKey - Name of the navigation setting
owner - Current Activityspace
Returns:
String The requested Navigation setting value as a String. null if the value doesn't exist.

CreateDropDownEndMarkers

public static HTMLElementCollection CreateDropDownEndMarkers()
Adds the end of banner markers for ISC dropdown menus. Should be added to below banner view when using ISC menus in the above banner view.

Returns:
HTMLElementCollection HTMLElementCollection to add the dropdown markers to

CreateHorizontalSpacerCell

public static void CreateHorizontalSpacerCell(HTMLTableRow myTableRow)
Adds a spacer cell with a cell width of 4to the specified HTMLTableRow

Parameters:
myTableRow - HTMLTableRow to add the spacer cell to

CreateMandatoryTabsArray

public static HTMLScript CreateMandatoryTabsArray(ICPListEntryIterator cpList,
                                                  AActivitySpace parent)
Creates a HTMLScript block with an array of the mandatory tabs to display The javascript array is a two dimensional array - element[i][0]: Name of the mandatory community element[i][1]: Original name of the mandatory community (before truncation), use for tooltip element[i][2]: URL to the mandatory community

Parameters:
cpList - List of mandatory tabs
parent - Current activityspace
Returns:
HTMLScript The HTMLScript with the javascript variable

GenerateJSHTMLHelperFunctions

public static HTMLScript GenerateJSHTMLHelperFunctions(AActivitySpace parent)
Creates writeStartTable, writeEndOfTable, writeSpacerTable and writeSpacerCell, dynamic HTML generating Javascript helper functions used in .js files to to position dropdown menu tabs and mandatory communities tabs.

Parameters:
parent - Current Activityspace
Returns:
HTMLScript HTMLScript block with the javascript helper functions

CreateVerticalSpacerCell

public static final void CreateVerticalSpacerCell(HTMLTableRow myTableRow)
Adds a spacer cell to the specified HTMLTableRow

Parameters:
myTableRow - The HTMLTableRow to add the spacer cell to

EscapeSingleQuotes

public static final java.lang.String EscapeSingleQuotes(java.lang.String strIn)
Prepares a string for use in Javascript code, escapes single quotes (').

Parameters:
strIn - The stirng to escape
Returns:
String with escaped single quotes

GetSpacerImage

public static HTMLImg GetSpacerImage(java.lang.String sWidth,
                                     java.lang.String sHeight)
Helper function that creates a spacer Image with specified width and height

Parameters:
sWidth - Spacer image width
sHeight - Spacer image height
Returns:
HTMLImg HTMLImg construct

GetCommunityImageURLString

public static java.lang.String GetCommunityImageURLString(AActivitySpace aspace,
                                                          java.lang.String commName)
Helper function that returns a string with the HTML of the formatted image for Communities

Parameters:
aspace - Current Activityspace
mpName - Alt text for the image
Returns:
String The image as an HTML String

GetCommunityImageSource

public static java.lang.String GetCommunityImageSource(AActivitySpace aspace)
Helper function that returns a string with the image source of the formatted image for Communities

Parameters:
aspace - Current Activityspace
Returns:
String The image as an image source String

GetMyPageImageURLString

public static java.lang.String GetMyPageImageURLString(AActivitySpace aspace,
                                                       java.lang.String mpName)
Helper function that returns a string with the HTML of the formatted image for Mypages

Parameters:
aspace - Current Activityspace
mpName - Alt text for the image
Returns:
String The image as an HTML String

GetMyPageImageSource

public static java.lang.String GetMyPageImageSource(AActivitySpace aspace)
Helper function that returns a string with the HTML of the formatted image for Mypages

Parameters:
aspace - Current Activityspace
mpName - Alt text for the image
Returns:
String The image as an HTML String

writeURLTemplateParseFunction

public static java.lang.String writeURLTemplateParseFunction(AActivitySpace space)
Parses the ID or IDs needed to create the URL for mypages or community pages (or other types) Needs to be in sync with the IDs put used as data value for each cell. M = MyPages C = Communities , E = Editor, F = Freeform URL (no template) etc

Returns:
String with the javascript functions



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.