Class PromptObjectBrowsingXHTMLTransform

  • All Implemented Interfaces:
    EnumPromptsBeanEvents, LayoutTransform, Transform

    public class PromptObjectBrowsingXHTMLTransform
    extends PromptCartXHTMLTransform
    Renders prompt content in a "shopping cart" style with a browseable folder path.
    It extends PromptCartTransform by adding a folder path above the prompt question and by allowing end-user to navigate to available subfolders. Also, it will only display objects that are defined in prompt definition; this means that if only templates are to be displayed then any instance will be displayed if found under given subfolder.

    This transforms makes use of Tag instances to render HTML output. See reference to TagsFactory. The output of this Transform generates well-formed XHTML, supports layout-xml, and it's designed to use external css files for all formatting.
    Since:
    MicroStrategy Web 8.0.0
    • Field Detail

      • cssItemName

        public FormalParameter cssItemName
        Formal parameter of the prefix to append to all css class names.
    • Constructor Detail

      • PromptObjectBrowsingXHTMLTransform

        public PromptObjectBrowsingXHTMLTransform()
        Default no-args constructor, initialize all the formal parameters.
    • Method Detail

      • initializePromptContent

        public void initializePromptContent()
                                     throws WebObjectsException
        Initializes prompt content information.
        Extends initializePromptContent() by calling processIncrementalFetch and processSelectedItems. It also initialize the Cart object associated.
        Overrides:
        initializePromptContent in class PromptCartXHTMLTransform
        Throws:
        WebObjectsException - if something goes wrong when processing Available items.
      • initializeCss

        public void initializeCss()
        Initialize the css information to be used by this transform.
        It invokes parent method so all shared CSS are also initialized.
        Overrides:
        initializeCss in class PromptCartXHTMLTransform
      • updateIncrementalFetchCartProperties

        protected void updateIncrementalFetchCartProperties()
        Updates incremental fetch properties in Cart object.
        Mostly, the total of units is calculated after processing available units, hence, we need to reflect this in Cart incremental fetch properties only if Incremental fetch is enabled (isIncrementalFetchAvailable() is invoked). Incremental Fetch object is obtained from Prompt's cart infrastructure. This function updates its Block Count, Block Begin and Total count properties.
        Overrides:
        updateIncrementalFetchCartProperties in class PromptCartXHTMLTransform
      • canTransform

        public boolean canTransform​(Transformable data)
        Indicates whether or not this component can be transformed.
        Extends canTransform() by returning true only if the prompt is of type EnumWebPromptType.WebPromptTypeObjects
        Specified by:
        canTransform in interface Transform
        Overrides:
        canTransform in class PromptCartXHTMLTransform
        Parameters:
        data - object (PromptObject) to transform
        Returns:
        true if the data is a PromptObject of a Expression WebPrompt.
      • isThereAnyFolderToRender

        public boolean isThereAnyFolderToRender()
        Determines whether there's a root folder as default point for browsing.
        This is determined only if there are folder objects in available units.
        Returns:
        boolean true if there's a starting point for browsing.
      • getAvailableItems

        protected java.util.Enumeration getAvailableItems()
        Returns an enumeration of all available items.
        It gets all available display units and creates an Enumeration instance which is returned.
        Overrides:
        getAvailableItems in class PromptCartXHTMLTransform
        Returns:
        Enumeration of available elements.
      • writeAncestors

        protected void writeAncestors​(MarkupOutput out,
                                      SimpleList ancestors,
                                      int currentAncestor)
        Recursevily renders folder anscestors names.
        Parameters:
        out - MarkupOutput where to write the output of the method.
        ancestors - SimpleList list of folder ancestors
        currentAncestor - int current ancestor being rendered.
      • renderPromptContent

        public void renderPromptContent​(MarkupOutput out)
        Renders the prompt question layout content.
        This is accomplished by calling the renderCart() method. If there are no folders to render then it will simply call the parent's renderPromptContent method.
        Overrides:
        renderPromptContent in class PromptCartXHTMLTransform
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
      • renderParentPromptContent

        public void renderParentPromptContent​(MarkupOutput out)
        Renders prompt content defined in parent class.
        It delegates responsability of rendering prompt's content to parent method renderCart().
        Parameters:
        out - MarkupOutput where to write output.
      • renderCart

        public void renderCart​(MarkupOutput out)
        Renders a shopping cart output.
        This is accomplished by calling different methods that will render the individual sections of the prompt layout. The output is organized with a series of DIV HTML tags created.
        The methods used for the cart output are listed below, where out is a MarkupOutput instance where the HTML generated by these calls is saved.
        Overrides:
        renderCart in class PromptCartXHTMLTransform
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
      • isUpAndDownAvailable

        public boolean isUpAndDownAvailable()
        Indicates whether or not Cart instance has up/down arrows enabled.
        Returns:
        boolean true if enabled.
      • isSearchAvailable

        public boolean isSearchAvailable()
        Indicates whether or not Cart instance has 'search' area enabled or displayed.
        Overrides:
        isSearchAvailable in class PromptCartXHTMLTransform
        Returns:
        boolean true if enabled.
      • renderFoldersPath

        public void renderFoldersPath​(MarkupOutput out)
        Renders folders formatted path text.
        The output is organized with a series of DIV HTML tags created.
        The methods used for the cart output are listed below, where out is a MarkupOutput instance where the HTML generated by these calls is saved.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
      • renderBackParentButton

        public void renderBackParentButton​(MarkupOutput out)
        Renders 'Back' button.
        THis button will enable end-user to navigate the different folders available to the parent one.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
      • renderSubFolderPullDown

        public void renderSubFolderPullDown​(MarkupOutput out)
        Renders subfolders pull down menu.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
      • renderLabel

        public void renderLabel​(MarkupOutput out,
                                java.lang.String labelName)
        Renders an HTML label.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
        labelName - string of label to be displayed.