public class

PathTransform

extends AbstractAppTransform
implements LayoutTransform
java.lang.Object
   ↳ com.microstrategy.web.transform.AbstractTransform
     ↳ com.microstrategy.web.transform.AbstractLayoutTransform
       ↳ com.microstrategy.web.app.transforms.AbstractAppTransform
         ↳ com.microstrategy.web.app.transforms.PathTransform
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

This class is used to render the path section of a page.
It renders the Back/Forward buttons as well as links and information about the object being displayed in the current page.

This class implements LayoutTransform which enables building the layout through an external xml configuration file.

Summary

Constants
String FP_CHARS_FOR_DIVIDER Constant specifying the name of the formal parameter for defining the dividing characters in between objects in the path.
String FP_CHARS_FOR_HIDDEN_FOLDERS Constant specifying the name of the formal parameter for defining the characters to use instead of the names of folders that are hidden for the user.
String FP_IS_SELF_CONTAINED Constant specifying the name of the formal parameter for defining if the object is self contained or not.
String FP_OPEN_DESKTOP_EVENT
String FP_OPEN_FOLDER_IMAGE Constant specifying the name of the formal parameter for defining the image to render before the current object is displayed.
String FP_SHOW_LINK Constant specifying the name of the formal parameter for defining the showLink.
[Expand]
Inherited Constants
From class com.microstrategy.web.app.transforms.AbstractAppTransform
Fields
protected WebEvent _event
protected String _hiddenFolderCharacters
protected String _objectName
protected PathBean _pathBean
protected boolean _showLink
protected String cssItemNameCache
protected String cssUnselectedItemNameCache
public FormalParameter dividerCharacters Indicates the character(s) to be used for separating each one of the different elements when displaying the path.
public FormalParameter hiddenFolderCharacters Indicates the character(s) to be used as placeholders when displaying a hidden folder inside the path.
public FormalParameter isSelfContained Indicates if the target bean of the current object being transformed should be used when generating the events that will be used for creating the links for accessing other folders.
public FormalParameter openDesktopEvent
public FormalParameter openFolderImage Indicates the image to use before displaying the current object on the path (if requested on the levelFlag formal parameter).
public FormalParameter showLink Indicates whether the object path contains a hyperlink to that object
Default value is boolean TRUE which indicates the hyperlinks will be generated for each object path.
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractAppTransform
Public Constructors
PathTransform()
Default constructor, initialize formal parameters.
Public Methods
WebFolder getAncestorFolder()
Return the WebFolder or the ancestor of the current object.
SimpleList getAncestors()
Retrieves the ObjectBean's parent FolderBean.
String getDescription()
Return description for this Transform
boolean getHasAncestors()
Whether the current object has ancestors
List getObjectPathFolderAncestors(int rootIndex)
Returns all the ancestors of the current object
List getObjectPathFolderAncestors(int rootIndex, boolean order, boolean excludeParent)
Returns all the ancestors of the current object
FolderBean getParentFolderBean()
Retrieves the ObjectBean's parent FolderBean.
String getStyleShellDiv()
Overwrites the parent method by changin the default style's display to be "inline".
Class getSupportedBeanType()
Returns the supported bean type.
void initializeCss()
Initialize the css class used by this transform.
void initializeImages()
Initialize images, basically it prefix them with the global folderName
void initializeTransform(Transformable data)
Transform the Folder Bean and append the output to MarkupOutput
boolean isSpecialFolder()
Checks if the current object is a special folder
void renderAncestor(MarkupOutput out, WebFolder folder)
Renders the WebFolder object name w/o the hyperlink to that folder
void renderAncestors(MarkupOutput out, int rootIndex)
Renders the folder ancestors as path
void renderBackButton(MarkupOutput out)
Renders a Back button link, it uses the openHistoryPage event for this.
void renderCreateFolderButton(MarkupOutput out)
Renders the button to create a folder
void renderCurrentItem(MarkupOutput out)
Renders the curent item
void renderFolder(MarkupOutput out, WebFolder folder, SimpleList ancestors, int currentAncestor, boolean showLink)
Render a specific folder.
void renderFolder(MarkupOutput out, WebFolder folder, SimpleList ancestors, int currentAncestor, boolean showLink, boolean showDivider)
Render a specific folder.
void renderForwardButton(MarkupOutput out)
Renders a Forward button link, it uses the openHistoryPage event for this.
void renderHomeButton(MarkupOutput out)
Renders a button link to Home, it uses the openDesktopEvent for this.
void renderLinkForDesktop(MarkupOutput out)
Renders the link the Desktop (start) page.
void renderLinkForHome(MarkupOutput out)
Renders the link to Home, it uses the openHomeEvent for this.
void renderNewLine(MarkupOutput out)
Renders a new list before the item's name.
void renderObjectName(MarkupOutput out)
Renders the current objects name (i.e.
void renderOpenFolderImage(MarkupOutput out)
Renders the open folder image.
void renderParent(MarkupOutput out)
Renders the parent folder
void renderParentFolderDelimiter(MarkupOutput out)
Renders the delimiter between the folder names The divider character is set through Formal Parameter
void renderParentUpButton(MarkupOutput out)
Renders a button link to the parent folders.
void renderTitle(MarkupOutput out)
Renders the title, uses descriptor 51: You are here:
void setHasAncestors(boolean value)
Sets whether the current object has ancestors
void transformForRequestInError(MarkupOutput out)
Overwrites by ignoring the state and rendering as the status was succesful.
void transformForRequestProcessing(MarkupOutput out)
Overwrites by ignoring the state and rendering as the status was succesful.
void transformForRequestSuccessful(MarkupOutput out)
Transform when the status is "Successful".
void transformForRequestWaitingForUserInput(MarkupOutput out)
Overwrites by ignoring the state and rendering as the status was succesful.
Protected Methods
boolean canRenderHomeButtton()
boolean canRenderParentUpButton()
AnchorTag generateAnchor(WebEvent event)
Overwrites the parent method by setting the right event element value according to the formal parameters available on the transform
WebEvent getBackButtonEvent()
Returns the open history page event used for the back button.
WebEvent getBrowseFolderEvent(WebFolder folder)
Returns the browser folder event.
OMDCreateFolderBean getCreateFolderBean()
WebEvent getForwardButtonEvent()
Returns the open history page event used for the forward button.
String getImageSrc(String imgId)
Get the image source to display as part of the object path content.
ObjectBean getObjectBean()
Get the objectBean target of this transform
Map<String, Object> getObjectNameAndEvent(boolean useObjectName, boolean showLink)
WebObjectsFactory getObjectsFactory()
WebEvent getOpenCreateFolderEvent()
WebEvent getOpenDesktopEvent()
Returns the open desktop event.
WebEvent getOpenHistoryPage(String relativePageNumber)
WebEvent getOpenHomeEvent()
Returns the open home event.
Map<String, Object> getParentEventAndDesc()
Get the WebEvent and descption of parent folder.
ServletWebComponent getServletWebComponent()
String getSpecialFolderName(WebFolder folder)
Check for special folders, if found one, return the descriptor.
int getSysFolderID()
Returns the system folder ID (NamedFolder) that is in the hierarchy of the object bean
boolean isAncestorNamedFolder(int folderName)
boolean isFolderRoot(WebFolder folder)
boolean isNewObject()
boolean isTemplateFolder(WebFolder parentFolder)
Check whether the parent folder of current object is one of the templates folders.
void renderSimpleButton(MarkupOutput out, WebEvent event, String descriptor, String id, String src)
void renderSimpleButton(MarkupOutput out, WebEvent event, String descriptor, String id)
void renderSimpleLink(MarkupOutput out, WebEvent event, String descriptor, String css, boolean showLink, boolean showDivider)
Renders a link based on the event.
void renderSimpleLink(MarkupOutput out, WebEvent event, String descriptor, String css, boolean showLink)
Renders a link based on the event.
void setBoneProperties(JsonGenerator boneProps)
Sets the necessary properties to the bone assigned to this transform (based on the scriptClass formal parameter)
Usually called by renderRegisterBone(MarkupOutput)
Can be overwritten to add or modify bone properties.
boolean shouldDisableBackButton()
boolean useParentAncestors()
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.AbstractAppTransform
From class com.microstrategy.web.transform.AbstractLayoutTransform
From class com.microstrategy.web.transform.AbstractTransform
From class java.lang.Object
From interface com.microstrategy.web.app.transforms.AppTransform
From interface com.microstrategy.web.transform.LayoutTransform
From interface com.microstrategy.web.transform.Transform

Constants

public static final String FP_CHARS_FOR_DIVIDER

Constant specifying the name of the formal parameter for defining the dividing characters in between objects in the path. Value is dividerCharacters.

Constant Value: "dividerCharacters"

public static final String FP_CHARS_FOR_HIDDEN_FOLDERS

Constant specifying the name of the formal parameter for defining the characters to use instead of the names of folders that are hidden for the user. Value is hiddenFolderCharacters.

Constant Value: "hiddenFolderCharacters"

public static final String FP_IS_SELF_CONTAINED

Constant specifying the name of the formal parameter for defining if the object is self contained or not. Value is isSelfContained.

Constant Value: "isSelfContained"

public static final String FP_OPEN_DESKTOP_EVENT

Constant Value: "openDesktopEvent"

public static final String FP_OPEN_FOLDER_IMAGE

Constant specifying the name of the formal parameter for defining the image to render before the current object is displayed. Value is openFolderImage.

Constant Value: "openFolderImage"

public static final String FP_SHOW_LINK

Constant specifying the name of the formal parameter for defining the showLink. Value is showLink .

Constant Value: "showLink"

Fields

protected WebEvent _event

protected String _hiddenFolderCharacters

protected String _objectName

protected PathBean _pathBean

protected boolean _showLink

protected String cssItemNameCache

protected String cssUnselectedItemNameCache

public FormalParameter dividerCharacters

Indicates the character(s) to be used for separating each one of the different elements when displaying the path.
These characters will be displayed after each element except the last one, for indicating a hierarchy between the folders shown.
Usage: Default value is &gt;. The value to assign to this formal parameter has to be HTML compatible for it to be displayed correctly on the final HTML page.

public FormalParameter hiddenFolderCharacters

Indicates the character(s) to be used as placeholders when displaying a hidden folder inside the path.
These characters will be displayed instead of the hidden folder name without link associated with it since the user does not have enough privileges for accessing it. If there are two or more hidden folders one after the other, these characters will be displayed only once. Usage: Default value is [ ...]. The value to assign to this formal parameter has to be HTML compatible for it to be displayed correctly on the final HTML page.

public FormalParameter isSelfContained

Indicates if the target bean of the current object being transformed should be used when generating the events that will be used for creating the links for accessing other folders.
Default value is boolean TRUE which indicates this object will be the source for the links to render.

public FormalParameter openDesktopEvent

public FormalParameter openFolderImage

Indicates the image to use before displaying the current object on the path (if requested on the levelFlag formal parameter).
The value to indicate should be a valid image file name, with any necessary path information not included already on the resourcesFolderImage application configuration parameter.

public FormalParameter showLink

Indicates whether the object path contains a hyperlink to that object
Default value is boolean TRUE which indicates the hyperlinks will be generated for each object path.

Public Constructors

public PathTransform ()

Default constructor, initialize formal parameters.

Public Methods

public WebFolder getAncestorFolder ()

Return the WebFolder or the ancestor of the current object.
For instance: the folder that contains the current report.

Returns
  • the WebFolder or the ancestor of the current object.

public SimpleList getAncestors ()

Retrieves the ObjectBean's parent FolderBean. This is the Bean from where we need to get the ancestors from.

Returns
  • the parent's folder bean

public String getDescription ()

Return description for this Transform

Returns
  • description for the transform

public boolean getHasAncestors ()

Whether the current object has ancestors

Returns
  • whether the current object has ancestors

public List getObjectPathFolderAncestors (int rootIndex)

Returns all the ancestors of the current object

Parameters
rootIndex , indicates the starting index of the ancestor
Returns
  • a list of ancestors, the order is top down, the first ancestor (index 0) is the the highest ancestor (i.e, server, project)

public List getObjectPathFolderAncestors (int rootIndex, boolean order, boolean excludeParent)

Returns all the ancestors of the current object

Parameters
rootIndex , indicates the starting index of the ancestor
Returns
  • a list of ancestors, in the order specified

public FolderBean getParentFolderBean ()

Retrieves the ObjectBean's parent FolderBean. This is the Bean from where we need to get the ancestors from.

Returns
  • the parent's folder bean

public String getStyleShellDiv ()

Overwrites the parent method by changin the default style's display to be "inline".

public Class getSupportedBeanType ()

Returns the supported bean type. This abstract Transform supports all WebComponents so every sub-class should override this method to return the class of the Bean the Transform is expecting, for example:

 public class CustomReportClass extends AbstractAppTransform {

    public Class getSupportedBeanType() {
        //This Transform is expected to work only with a ReportBean,
        //therefore this method needs to return this class:
        return ReportBean.class;
    }

 }
 

Returns
  • a root class/interface supported by this transform.

public void initializeCss ()

Initialize the css class used by this transform.

public void initializeImages ()

Initialize images, basically it prefix them with the global folderName

public void initializeTransform (Transformable data)

Transform the Folder Bean and append the output to MarkupOutput

Parameters
data the folder bean to transform

public boolean isSpecialFolder ()

Checks if the current object is a special folder

Returns
  • boolean indicating whether it is a sepcial folder.

public void renderAncestor (MarkupOutput out, WebFolder folder)

Renders the WebFolder object name w/o the hyperlink to that folder

Parameters
out the transform's output
folder , the folder to be rendered

public void renderAncestors (MarkupOutput out, int rootIndex)

Renders the folder ancestors as path

Parameters
out the transform's output
rootIndex , indicates the starting index of the ancestors For example, desktop link is the highest ancestor with index of 0; by specifying rootIndex=1, the desktop link won't be rendered

public void renderBackButton (MarkupOutput out)

Renders a Back button link, it uses the openHistoryPage event for this.

Parameters
out the transform's output

public void renderCreateFolderButton (MarkupOutput out)

Renders the button to create a folder

Parameters
out the transform's output

public void renderCurrentItem (MarkupOutput out)

Renders the curent item

Parameters
out the transform's output

public void renderFolder (MarkupOutput out, WebFolder folder, SimpleList ancestors, int currentAncestor, boolean showLink)

Render a specific folder. This is a recursive function that calls itself to render the parent.
It calls recursively until it finds the root folder. If the LEVEL_DESKTOP_LINK level is set, instead of stopping in the root folder, it stops in its first child.

Parameters
out the transform's output
folder the current folder
ancestors the list of ancestors
currentAncestor the index of this folder in the list of ancestors
showLink whether to render a link for the folder.

public void renderFolder (MarkupOutput out, WebFolder folder, SimpleList ancestors, int currentAncestor, boolean showLink, boolean showDivider)

Render a specific folder. This is a recursive function that calls itself to render the parent.
It calls recursively until it finds the root folder. If the LEVEL_DESKTOP_LINK level is set, instead of stopping in the root folder, it stops in its first child.

Parameters
out the transform's output
folder the current folder
ancestors the list of ancestors
currentAncestor the index of this folder in the list of ancestors
showLink whether to render a link for the folder.

public void renderForwardButton (MarkupOutput out)

Renders a Forward button link, it uses the openHistoryPage event for this.

Parameters
out the transform's output

public void renderHomeButton (MarkupOutput out)

Renders a button link to Home, it uses the openDesktopEvent for this.

Parameters
out the transform's output

public void renderLinkForDesktop (MarkupOutput out)

Renders the link the Desktop (start) page.

Parameters
out the transform's output

public void renderLinkForHome (MarkupOutput out)

Renders the link to Home, it uses the openHomeEvent for this.

Parameters
out the transform's output

public void renderNewLine (MarkupOutput out)

Renders a new list before the item's name. This might be controlled through a formal parameter

Parameters
out the transform's output

public void renderObjectName (MarkupOutput out)

Renders the current objects name (i.e. report name)

Parameters
out the transform's output

public void renderOpenFolderImage (MarkupOutput out)

Renders the open folder image.

Parameters
out the transform's output

public void renderParent (MarkupOutput out)

Renders the parent folder

Parameters
out the transform's output

public void renderParentFolderDelimiter (MarkupOutput out)

Renders the delimiter between the folder names The divider character is set through Formal Parameter

Parameters
out the transform's output

public void renderParentUpButton (MarkupOutput out)

Renders a button link to the parent folders.

Parameters
out the transform's output

public void renderTitle (MarkupOutput out)

Renders the title, uses descriptor 51: You are here:

Parameters
out the transform's output

public void setHasAncestors (boolean value)

Sets whether the current object has ancestors

public void transformForRequestInError (MarkupOutput out)

Overwrites by ignoring the state and rendering as the status was succesful. ObjectBeans, even when their processing, should already have their path info.

Parameters
out MarkupOutput instance that will be the output by this transform

public void transformForRequestProcessing (MarkupOutput out)

Overwrites by ignoring the state and rendering as the status was succesful. ObjectBeans, even when their processing, should already have their path info.

Parameters
out MarkupOutput instance that will be the output by this transform

public void transformForRequestSuccessful (MarkupOutput out)

Transform when the status is "Successful". If a Layout is specified, it delegates execution to the layout-pareser, otherwise, otherwise it calls renderContent.

Parameters
out a MarkupOutput instance with the HTML output by this transform

public void transformForRequestWaitingForUserInput (MarkupOutput out)

Overwrites by ignoring the state and rendering as the status was succesful. ObjectBeans, even when their processing, should already have their path info.

Parameters
out MarkupOutput instance that will be the output by this transform

Protected Methods

protected boolean canRenderHomeButtton ()

protected boolean canRenderParentUpButton ()

protected AnchorTag generateAnchor (WebEvent event)

Overwrites the parent method by setting the right event element value according to the formal parameters available on the transform

Parameters
event WebEvent instance from where the anchor will be constructed
Returns
  • AnchorTag initialized instance with the information as provided by the arguments.

protected WebEvent getBackButtonEvent ()

Returns the open history page event used for the back button.

Returns

protected WebEvent getBrowseFolderEvent (WebFolder folder)

Returns the browser folder event.

Parameters
folder the folder to browse
Returns
  • The EnumFolderBeanEvents.FOLDER_EVENT_BROWSE event.

protected OMDCreateFolderBean getCreateFolderBean ()

protected WebEvent getForwardButtonEvent ()

Returns the open history page event used for the forward button.

Returns

protected String getImageSrc (String imgId)

Get the image source to display as part of the object path content. This method is called only when the user has turned on Accessibility mode under Preferences.

Parameters
imgId String indicating the ID of the image from where the source should be calculated. For example, values like tbHome or tbReturn are expected
Returns
  • String with the source to use for the image to display.

protected ObjectBean getObjectBean ()

Get the objectBean target of this transform

Returns

protected Map<String, Object> getObjectNameAndEvent (boolean useObjectName, boolean showLink)

protected WebObjectsFactory getObjectsFactory ()

protected WebEvent getOpenCreateFolderEvent ()

protected WebEvent getOpenDesktopEvent ()

Returns the open desktop event.

Returns
  • The EnumServletEvents.WebEventOpenDefaultDesktop event.

protected WebEvent getOpenHistoryPage (String relativePageNumber)

protected WebEvent getOpenHomeEvent ()

Returns the open home event.

Returns
  • The EnumServletEvents.WebEventOpenHome event.

protected Map<String, Object> getParentEventAndDesc ()

Get the WebEvent and descption of parent folder.

Returns
  • a map contains upEvent and desc

protected ServletWebComponent getServletWebComponent ()

protected String getSpecialFolderName (WebFolder folder)

Check for special folders, if found one, return the descriptor. It also checks if the Shared Reports folder, using preferences, has been specified as other folder.

Parameters
folder the folder to check
Returns
  • a String with the descriptor to use if it's a special folder, null otherwise.

protected int getSysFolderID ()

Returns the system folder ID (NamedFolder) that is in the hierarchy of the object bean

Returns
  • String EnumDSSXMLFolderNames value.

protected boolean isAncestorNamedFolder (int folderName)

Throws
UnsupportedOperationException
WebObjectsException

protected boolean isFolderRoot (WebFolder folder)

protected boolean isNewObject ()

protected boolean isTemplateFolder (WebFolder parentFolder)

Check whether the parent folder of current object is one of the templates folders.

protected void renderSimpleButton (MarkupOutput out, WebEvent event, String descriptor, String id, String src)

protected void renderSimpleButton (MarkupOutput out, WebEvent event, String descriptor, String id)

protected void renderSimpleLink (MarkupOutput out, WebEvent event, String descriptor, String css, boolean showLink, boolean showDivider)

Renders a link based on the event.

Parameters
out the transform's output
event the event associated with the link
descriptor the content of the link
css the class to use
showLink whether to render to link or not (if false, the descriptor will be simply rendered within a SPAN tag).

protected void renderSimpleLink (MarkupOutput out, WebEvent event, String descriptor, String css, boolean showLink)

Renders a link based on the event.

Parameters
out the transform's output
event the event associated witht he link
descriptor the content of the link
css the class to use
showLink whether to render to link or not (if false, the descriptor will be simply rendered within a SPAN tag).

protected void setBoneProperties (JsonGenerator boneProps)

Sets the necessary properties to the bone assigned to this transform (based on the scriptClass formal parameter)
Usually called by renderRegisterBone(MarkupOutput)
Can be overwritten to add or modify bone properties.

Parameters
boneProps the JsonGenerator object that contains the collection of bone properties.

protected boolean shouldDisableBackButton ()

protected boolean useParentAncestors ()