Class PathTransform

    • Field Detail

      • showLink

        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.
      • dividerCharacters

        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 >. The value to assign to this formal parameter has to be HTML compatible for it to be displayed correctly on the final HTML page.
      • hiddenFolderCharacters

        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.
      • _hiddenFolderCharacters

        protected java.lang.String _hiddenFolderCharacters
      • isSelfContained

        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.
      • openFolderImage

        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.
      • FP_SHOW_LINK

        public static final java.lang.String FP_SHOW_LINK
        Constant specifying the name of the formal parameter for defining the showLink. Value is showLink .
        See Also:
        Constant Field Values
      • FP_CHARS_FOR_DIVIDER

        public static final java.lang.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.
        See Also:
        Constant Field Values
      • FP_CHARS_FOR_HIDDEN_FOLDERS

        public static final java.lang.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.
        See Also:
        Constant Field Values
      • FP_OPEN_FOLDER_IMAGE

        public static final java.lang.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.
        See Also:
        Constant Field Values
      • FP_IS_SELF_CONTAINED

        public static final java.lang.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.
        See Also:
        Constant Field Values
      • FP_OPEN_DESKTOP_EVENT

        public static final java.lang.String FP_OPEN_DESKTOP_EVENT
        See Also:
        Constant Field Values
      • cssItemNameCache

        protected java.lang.String cssItemNameCache
      • cssUnselectedItemNameCache

        protected java.lang.String cssUnselectedItemNameCache
      • _showLink

        protected boolean _showLink
      • _objectName

        protected java.lang.String _objectName
      • _pathBean

        protected PathBean _pathBean
    • Constructor Detail

      • PathTransform

        public PathTransform()
        Default constructor, initialize formal parameters.
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Return description for this Transform
        Specified by:
        getDescription in interface Transform
        Returns:
        description for the transform
      • renderTitle

        public void renderTitle​(MarkupOutput out)
        Renders the title, uses descriptor 51: You are here:
        Parameters:
        out - the transform's output
      • renderLinkForHome

        public void renderLinkForHome​(MarkupOutput out)
        Renders the link to Home, it uses the openHomeEvent for this.
        Parameters:
        out - the transform's output
      • renderLinkForDesktop

        public void renderLinkForDesktop​(MarkupOutput out)
        Renders the link the Desktop (start) page.
        Parameters:
        out - the transform's output
      • getAncestorFolder

        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.
      • renderCurrentItem

        public void renderCurrentItem​(MarkupOutput out)
        Renders the curent item
        Parameters:
        out - the transform's output
      • renderObjectName

        public void renderObjectName​(MarkupOutput out)
        Renders the current objects name (i.e. report name)
        Parameters:
        out - the transform's output
      • getObjectNameAndEvent

        protected java.util.Map<java.lang.String,​java.lang.Object> getObjectNameAndEvent​(boolean useObjectName,
                                                                                               boolean showLink)
      • initializeImages

        public void initializeImages()
        Initialize images, basically it prefix them with the global folderName
        Overrides:
        initializeImages in class AbstractAppTransform
      • getParentFolderBean

        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
      • getAncestors

        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
      • isNewObject

        protected boolean isNewObject()
      • isTemplateFolder

        protected boolean isTemplateFolder​(WebFolder parentFolder)
        Check whether the parent folder of current object is one of the templates folders.
        Parameters:
        folderId -
        Returns:
      • getSupportedBeanType

        public java.lang.Class getSupportedBeanType()
        Description copied from class: AbstractAppTransform
        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;
            }
        
         }
         
        Specified by:
        getSupportedBeanType in interface Transform
        Overrides:
        getSupportedBeanType in class AbstractAppTransform
        Returns:
        a root class/interface supported by this transform.
      • getHasAncestors

        public boolean getHasAncestors()
        Whether the current object has ancestors
        Returns:
        whether the current object has ancestors
      • setHasAncestors

        public void setHasAncestors​(boolean value)
        Sets whether the current object has ancestors
        Parameters:
        value -
      • getOpenHomeEvent

        protected WebEvent getOpenHomeEvent()
        Returns the open home event.
        Returns:
        The EnumServletEvents.WebEventOpenHome event.
      • getOpenHistoryPage

        protected WebEvent getOpenHistoryPage​(java.lang.String relativePageNumber)
      • getOpenDesktopEvent

        protected WebEvent getOpenDesktopEvent()
        Returns the open desktop event.
        Returns:
        The EnumServletEvents.WebEventOpenDefaultDesktop event.
      • getBrowseFolderEvent

        protected WebEvent getBrowseFolderEvent​(WebFolder folder)
        Returns the browser folder event.
        Parameters:
        folder - the folder to browse
        Returns:
        The EnumFolderBeanEvents.FOLDER_EVENT_BROWSE event.
      • getSysFolderID

        protected int getSysFolderID()
        Returns the system folder ID (NamedFolder) that is in the hierarchy of the object bean
        Returns:
        String EnumDSSXMLFolderNames value.
      • isAncestorNamedFolder

        protected boolean isAncestorNamedFolder​(int folderName)
                                         throws WebObjectsException,
                                                java.lang.UnsupportedOperationException
        Throws:
        WebObjectsException
        java.lang.UnsupportedOperationException
      • renderFolder

        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.
      • renderFolder

        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.
      • getObjectBean

        protected ObjectBean getObjectBean()
        Get the objectBean target of this transform
        Returns:
        the FolderBean instance used with this transform
      • useParentAncestors

        protected boolean useParentAncestors()
      • renderNewLine

        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
      • renderOpenFolderImage

        public void renderOpenFolderImage​(MarkupOutput out)
        Renders the open folder image.
        Parameters:
        out - the transform's output
      • isFolderRoot

        protected boolean isFolderRoot​(WebFolder folder)
      • getSpecialFolderName

        protected java.lang.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.
      • getImageSrc

        protected java.lang.String getImageSrc​(java.lang.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.
      • renderHomeButton

        public void renderHomeButton​(MarkupOutput out)
        Renders a button link to Home, it uses the openDesktopEvent for this.
        Parameters:
        out - the transform's output
      • shouldDisableBackButton

        protected boolean shouldDisableBackButton()
      • renderBackButton

        public void renderBackButton​(MarkupOutput out)
        Renders a Back button link, it uses the openHistoryPage event for this.
        Parameters:
        out - the transform's output
      • renderForwardButton

        public void renderForwardButton​(MarkupOutput out)
        Renders a Forward button link, it uses the openHistoryPage event for this.
        Parameters:
        out - the transform's output
      • canRenderHomeButtton

        protected boolean canRenderHomeButtton()
      • canRenderParentUpButton

        protected boolean canRenderParentUpButton()
      • renderParentUpButton

        public void renderParentUpButton​(MarkupOutput out)
        Renders a button link to the parent folders.
        Parameters:
        out - the transform's output
      • getParentEventAndDesc

        protected java.util.Map<java.lang.String,​java.lang.Object> getParentEventAndDesc()
        Get the WebEvent and descption of parent folder.
        Returns:
        a map contains upEvent and desc
      • renderCreateFolderButton

        public void renderCreateFolderButton​(MarkupOutput out)
        Renders the button to create a folder
        Parameters:
        out - the transform's output
      • renderAncestors

        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
      • isSpecialFolder

        public boolean isSpecialFolder()
                                throws WebBeanException
        Checks if the current object is a special folder
        Returns:
        boolean indicating whether it is a sepcial folder.
        Throws:
        WebBeanException
      • getObjectPathFolderAncestors

        public java.util.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)
      • getObjectPathFolderAncestors

        public java.util.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
        order - , specifies the order in which the ancestors should be returned. false - highest to lowest true - lowest to highest
        exludeParent - , specifies if Parent Name should be excluded in the ancestors
        Returns:
        a list of ancestors, in the order specified
      • getOpenCreateFolderEvent

        protected WebEvent getOpenCreateFolderEvent()
      • generateAnchor

        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
        Overrides:
        generateAnchor in class AbstractAppTransform
        Parameters:
        event - WebEvent instance from where the anchor will be constructed
        Returns:
        AnchorTag initialized instance with the information as provided by the arguments.
      • renderSimpleButton

        protected void renderSimpleButton​(MarkupOutput out,
                                          WebEvent event,
                                          java.lang.String descriptor,
                                          java.lang.String id)
      • renderSimpleButton

        protected void renderSimpleButton​(MarkupOutput out,
                                          WebEvent event,
                                          java.lang.String descriptor,
                                          java.lang.String id,
                                          java.lang.String src)
      • renderParentFolderDelimiter

        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
      • renderAncestor

        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
      • renderSimpleLink

        protected void renderSimpleLink​(MarkupOutput out,
                                        WebEvent event,
                                        java.lang.String descriptor,
                                        java.lang.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).
      • renderSimpleLink

        protected void renderSimpleLink​(MarkupOutput out,
                                        WebEvent event,
                                        java.lang.String descriptor,
                                        java.lang.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).
      • renderParent

        public void renderParent​(MarkupOutput out)
        Renders the parent folder
        Parameters:
        out - the transform's output