Class LayoutContext


  • public class LayoutContext
    extends java.lang.Object
    The LayoutContext class holds the information required by the layout rendering methods to generate dynamic contents.
    Since:
    MicroStrategy Web 8.0.0
    • Constructor Detail

      • LayoutContext

        public LayoutContext​(Transform trans,
                             Transformable data)
        Constructs a LayoutContext object with the specified transform and transformable objects. It is equivalent to call the overloaded constructor LayoutContext(trans, data, false).
        Parameters:
        trans - a Transform instance.
        data - a Transformable instance.
      • LayoutContext

        public LayoutContext​(Transform trans,
                             Transformable data,
                             boolean excludeStaticTags)
        Constructs a LayoutContext object with the specified transform and transformable objects. If the parameter excludeStaticTags is true, the rendering method should discard any static contents defined in the layout but only generate dynamic contents.
        Parameters:
        trans - a Transform instance.
        data - a Transformable instance.
        excludeStaticTags - true to exclude static contents defined in the layout XHTML source.
    • Method Detail

      • addObjectInfo

        public void addObjectInfo​(java.lang.String key,
                                  BaseObjectInfo o)
        Caches an object for further reference with the specified key.
        Parameters:
        key - the key to retrieve the cached list of values.
        o - the object to be cached.
        Since:
        MicroStrategy Web 9.0.0
      • addList

        public void addList​(java.lang.String key,
                            java.util.List list)
        Caches a List of values with the specified key.
        Parameters:
        key - the key to retrieve the cached list of values.
        list - a list of values.
      • getObjectInfo

        public BaseObjectInfo getObjectInfo​(java.lang.String key)
        Returns the cached base object through the specified key. Null is returned if there is no such an object with the named key.
        Parameters:
        key - the key used to retrieve the object
        Returns:
        a Object with the specified key as the id.
        Since:
        MicroStrategy Web 9.0.0
      • getList

        public java.util.List getList​(java.lang.String key)
        Returns the cached list of values through the specified key. Null is returned if there is no such a list with the named key.
        Parameters:
        key - the key used to retrieve the cached values
        Returns:
        a List of values cached.
      • removeList

        public void removeList​(java.lang.String key)
        Removes the cached list through the specified key.
        Parameters:
        key - the key used to look up for the cached list.
      • removeObjectInfo

        public void removeObjectInfo​(java.lang.String key)
        Removes the cached base object through the specified key.
        Parameters:
        key - the key used to look up for the cached object.
        Since:
        MicroStrategy Web 9.0.0
      • excludeStaticTags

        public boolean excludeStaticTags()
        Returns a boolean value indicating whether to exclude the static contents while rendering the layout source.
        Returns:
        true to exclude the static contents.
      • getTransform

        public Transform getTransform()
        Returns the Transform object.
        Returns:
        the Transform object.
      • getBlock

        public Block getBlock()
        Get the top block on the Block stack. This block is not removed from the stack--only returned.
        Returns:
        The current top of the Block stack.
        Since:
        MicroStrategy Web 8.1.0
      • pushBlock

        public void pushBlock​(Block block)
        Pushes a Block instance into the current Block stack. If it is the first block added, it is considered a "root" Block (and can be later retrieved via getRootBlock(int).
        Parameters:
        block - The Block to add to the current Block stack.
        Since:
        MicroStrategy Web 8.1.0
      • popBlock

        public Block popBlock()
        Pops the top block off of the Block stack.
        Returns:
        The top Block which was popped off of the stack.
        Since:
        MicroStrategy Web 8.1.0
      • getLastPoppedBlock

        public Block getLastPoppedBlock()
        Returns the last block that was popped off of the Block stack.
        Returns:
        The last Block that was popped off of the Block stack.
        Since:
        MicroStrategy Web 8.1.0
        See Also:
        popBlock()
      • getRootBlock

        public Block getRootBlock​(int index)
                           throws java.lang.IndexOutOfBoundsException
        Returns the ith root Block.
        Parameters:
        index - The index of the "root" Block to return.
        Returns:
        The ith "root" Block.
        Throws:
        java.lang.IndexOutOfBoundsException
        Since:
        MicroStrategy Web 9.0.0
      • getRootBlock

        public Block getRootBlock​(java.lang.String rootBlockName)
        Returns the root Block with a specified name.
        Parameters:
        rootBlockName - The name of the root Block to return.
        Returns:
        The Block whose name is matched.
        Since:
        MicroStrategy Web 9.0.0
      • getBlockContext

        public BlockContext getBlockContext()
        Returns the BlockContext associated with this layout.
        Returns:
        The BlockContext associated with this layout.
        Since:
        MicroStrategy Web 9.0.0
      • setBlockContext

        public void setBlockContext​(BlockContext blockContext)
        Sets the BlockContext associated with this layout.
        Parameters:
        blockContext - The BlockContext object associated with this layout.
        Since:
        MicroStrategy Web 9.0.0
      • pushBlockTarget

        public void pushBlockTarget​(BlockTarget pathTarget)
        Since:
        MicroStrategy Web 9.0.0
      • getBlockTarget

        public BlockTarget getBlockTarget()
        Since:
        MicroStrategy Web 9.0.0
      • popBlockTarget

        public BlockTarget popBlockTarget()
        Since:
        MicroStrategy Web 9.0.0
      • getBlockSize

        public int getBlockSize()
        Since:
        MicroStrategy Web 9.0.0