public class

WebElementHelper

extends Object
java.lang.Object
   ↳ com.microstrategy.web.objects.WebElementHelper

Class Overview

Helper class for extracting information from element IDs. Conversion between different types of element IDs.

Summary

Constants
int DETAIL_TERSE_DEFAULT
int DETAIL_TERSE_DISPLAY_NAME
int DETAIL_TERSE_SOURCE_UNIT_ID
int PRESENTATION_OLD_LONG "BB:8D679D4B11D3E4981000E787EC6DE8A4:1:2:0:2:1:3:1:Northeast" is an example of the old long element ID.
int PRESENTATION_OLD_SHORT "8D679D4B11D3E4981000E787EC6DE8A4:1" is an example of the old short element ID.
int PRESENTATION_TERSE_DEFAULT This is not explicitly supported.
int PRESENTATION_TERSE_LONG This will become the standard presentation of the element ID.
char SEPARATOR_TERSE_FIELD
Public Constructors
WebElementHelper()
Public Methods
static WebElement addToElementsCollection(WebElements collection, String originalID)
Utility method to add an element to the element collection
static WebElement addToElementsCollection(WebElements collection, String originalID, String displayFormIndices)
Utility method to add an element to the element collection
static String decodeHTML(String oldStr)
static int determinePresentation(String elementID)
Tries to determine presentation type.
static String getElementID(WebElement e, int detail)
Returns a terse element ID composed according to detail fields DETAIL_TERSE_DEFAULT, DETAIL_TERSE_SOURCE_UNIT_ID, and DETAIL_TERSE_DISPLAY_NAME.
static String getElementIDForSortID(WebElement e)
static String getElementSourceID(String elementID)
static int getElementType(String elementID)
Determines the EnumDSSXMLElementType from the element ID.
static int getFormIndex(String originalID, String displayName)
static String getNodeKey(String panelElementID)
Extracts the node key of a panel element ID in a report services document.
static int getTemplateUnitType(WebElement e)
Determines the EnumDSSXMLTemplateUnitType of the WebElement.
static int getTemplateUnitType(String elementID)
Determines the EnumDSSXMLTemplateUnitType from the element ID.
static boolean isNullElemID(String elementID)
Check if it is a null element by the given element id.
static String reduceElementID(String originalID)
static String reduceElementID(String originalID, boolean removeAttribute)
static String removeAttributeId(String originalID)
static String toShortElementID(String originalID)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int DETAIL_TERSE_DEFAULT

Constant Value: 1 (0x00000001)

public static final int DETAIL_TERSE_DISPLAY_NAME

Constant Value: 4 (0x00000004)

public static final int DETAIL_TERSE_SOURCE_UNIT_ID

Constant Value: 2 (0x00000002)

public static final int PRESENTATION_OLD_LONG

"BB:8D679D4B11D3E4981000E787EC6DE8A4:1:2:0:2:1:3:1:Northeast" is an example of the old long element ID. Code should not be written to rely on disseminating the contents of this element ID. This presentation will be replaced by PRESENTATION_TERSE_LONG.

Constant Value: 1 (0x00000001)

public static final int PRESENTATION_OLD_SHORT

"8D679D4B11D3E4981000E787EC6DE8A4:1" is an example of the old short element ID.

Constant Value: 5 (0x00000005)

public static final int PRESENTATION_TERSE_DEFAULT

This is not explicitly supported. While we read terse default element IDs such as "h1" from the Intelligence Server, in order to submit an attribute element ID, we also require at least the source attribute DSS ID as well, such as "h1;8D679D4B11D3E4981000E787EC6DE8A4".

Constant Value: 6 (0x00000006)

public static final int PRESENTATION_TERSE_LONG

This will become the standard presentation of the element ID. "h1;8D679D4B11D3E4981000E787EC6DE8A4;Northeast" is an example. It consists of ";;display name". The long form contains at least the terse default and source DSS ID, with the display name optional. If display name is optional, there should not be a trailing semi-colon.

Constant Value: 2 (0x00000002)

public static final char SEPARATOR_TERSE_FIELD

Constant Value: 59 (0x0000003b)

Public Constructors

public WebElementHelper ()

Public Methods

public static WebElement addToElementsCollection (WebElements collection, String originalID)

Utility method to add an element to the element collection

Parameters
collection - WebElements the collection to add the element to.
originalID - The element id.
Returns
  • WebElement that was added.

public static WebElement addToElementsCollection (WebElements collection, String originalID, String displayFormIndices)

Utility method to add an element to the element collection

Parameters
collection - WebElements the collection to add the element to.
originalID - The element id.
displayFormIndices - comma separated list of attribute form indices that are part of the display name
Returns
  • WebElement that was added.

public static String decodeHTML (String oldStr)

public static int determinePresentation (String elementID)

Tries to determine presentation type. If unknown, 0 is returned.

public static String getElementID (WebElement e, int detail)

Returns a terse element ID composed according to detail fields DETAIL_TERSE_DEFAULT, DETAIL_TERSE_SOURCE_UNIT_ID, and DETAIL_TERSE_DISPLAY_NAME. DETAIL_TERSE_SOURCE_UNIT_ID implies inclusion of DETAIL_TERSE_DEFAULT, and DETAIL_TERSE_DISPLAY_NAME implies inclusion of DETAIL_TERSE_SOURCE_UNIT_ID. Fields are delimited by SEPARATOR_TERSE_FIELD - separator is omitted if there is no subsequent field. Most element IDs will require at least DETAIL_TERSE_SOURCE_UNIT_ID to be consumed by the Intelligence Server.

public static String getElementIDForSortID (WebElement e)

public static String getElementSourceID (String elementID)

Returns
  • the element source ID from the element ID string
Throws
MSTRUncheckedException thrown if element source ID cannot be determined
NullPointerException thrown if element ID is null

public static int getElementType (String elementID)

Determines the EnumDSSXMLElementType from the element ID. Only works for long versions. Returns 0 if unable to determine type.

public static int getFormIndex (String originalID, String displayName)

public static String getNodeKey (String panelElementID)

Extracts the node key of a panel element ID in a report services document.

public static int getTemplateUnitType (WebElement e)

Determines the EnumDSSXMLTemplateUnitType of the WebElement. Returns 0 if unable to determine type.

public static int getTemplateUnitType (String elementID)

Determines the EnumDSSXMLTemplateUnitType from the element ID. Returns 0 if unable to determine type.

public static boolean isNullElemID (String elementID)

Check if it is a null element by the given element id. It can handle both long id format and terse id format.

Returns
  • boolean

public static String reduceElementID (String originalID)

public static String reduceElementID (String originalID, boolean removeAttribute)

public static String removeAttributeId (String originalID)

public static String toShortElementID (String originalID)