Package com.microstrategy.web.tags
Class LayoutContext
- java.lang.Object
-
- com.microstrategy.web.tags.LayoutContext
-
public class LayoutContext extends java.lang.Object
TheLayoutContext
class holds the information required by the layout rendering methods to generate dynamic contents.- Since:
- MicroStrategy Web 8.0.0
-
-
Constructor Summary
Constructors Constructor Description LayoutContext(Transform trans, Transformable data)
Constructs a LayoutContext object with the specified transform and transformable objects.LayoutContext(Transform trans, Transformable data, boolean excludeStaticTags)
Constructs a LayoutContext object with the specified transform and transformable objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addList(java.lang.String key, java.util.List list)
Caches aList
of values with the specifiedkey
.void
addObjectInfo(java.lang.String key, BaseObjectInfo o)
Caches an object for further reference with the specifiedkey
.boolean
excludeStaticTags()
Returns a boolean value indicating whether to exclude the static contents while rendering the layout source.Block
getBlock()
Get the top block on the Block stack.BlockContext
getBlockContext()
Returns the BlockContext associated with this layout.int
getBlockSize()
BlockTarget
getBlockTarget()
Block
getLastPoppedBlock()
Returns the last block that was popped off of the Block stack.java.util.List
getList(java.lang.String key)
Returns the cached list of values through the specified key.BaseObjectInfo
getObjectInfo(java.lang.String key)
Returns the cached base object through the specified key.Block
getRootBlock(int index)
Returns the ith root Block.Block
getRootBlock(java.lang.String rootBlockName)
Returns the root Block with a specified name.Transform
getTransform()
Returns theTransform
object.Transformable
getTransformable()
Returns theTransformable
object.Block
popBlock()
Pops the top block off of the Block stack.BlockTarget
popBlockTarget()
void
pushBlock(Block block)
Pushes a Block instance into the current Block stack.void
pushBlockTarget(BlockTarget pathTarget)
void
removeList(java.lang.String key)
Removes the cached list through the specified key.void
removeObjectInfo(java.lang.String key)
Removes the cached base object through the specified key.void
setBlockContext(BlockContext blockContext)
Sets the BlockContext associated with this layout.
-
-
-
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 constructorLayoutContext(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 parameterexcludeStaticTags
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 specifiedkey
.- 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 aList
of values with the specifiedkey
.- 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 theTransform
object.- Returns:
- the Transform object.
-
getTransformable
public Transformable getTransformable()
Returns theTransformable
object.- Returns:
- the Transformable 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 viagetRootBlock(int)
.- Parameters:
block
- TheBlock
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
- TheBlockContext
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
-
-