public class

TemplateInfo

extends AbstractConfigurationElement
java.lang.Object
   ↳ com.microstrategy.utils.config.AbstractConfigurationElement
     ↳ com.microstrategy.web.app.TemplateInfo

Class Overview

This class holds the information required by a Page Template to render. This is information is only required by the jsps and not at runtime.

Summary

[Expand]
Inherited Constants
From class com.microstrategy.utils.config.AbstractConfigurationElement
Public Constructors
TemplateInfo(Node root)
Creates a TemplateInfo with the information in the xml node.
TemplateInfo(Node root, TemplateInfo defaultTemplate)
Creates a TemplateInfo with the information in the xml node.
TemplateInfo()
Empty constructor of a TemplateInfo initialize private fields with default values.
Public Methods
void addSection(String sectionName, String fileName)
Adds a page section file name.
void addShortcutList(String name, ShortcutList shortcutList)
Adds a ShortcutList
void deleteSection(String sectionName)
Deletes a page section file name
void deleteShortcutList(String name)
Deletes a ShortcutList
boolean getAllowCancel()
TemplateInfo getDefaultTemplate()
Returns the default template of the application
String getErrorDesc()
String getErrorTitleId()
String getFileName()
boolean getIframe()
Object getKey()
Default implementation for getKey().
String getPageName()
String getSection(String sectionName)
Returns the file name of the section associated with the given section name.
SectionInfoList getSectionInfoList()
Returns the available sections for this template.
ShortcutList getShortcutList(String name)
Returns the ShorcutList associated with the given name.
ShortcutListSet getShortcutListSet()
Returns the set of ShortcutLists for this template.
boolean getShowWait()
int getStatus()
Return the status of this Template.
WebGuiComponentList getWebGuiComponentList()
Returns the available Web Components for this template.
String getXmlMergeId()
void setAllowCancel(boolean newValue)
void setErrorDesc(String errorDesc)
Sets the descriptor Desc of the title of the error section if an error happens on this page.
void setErrorTitleId(String errorTitleId)
Sets the descriptor Id of the title of the error section if an error happens on this page.
void setFileName(String fileName)
Sets the fileName of this template
void setIframe(boolean newValue)
Sets if the template uses the iframe functionality
void setShowWait(boolean newValue)
void setStatus(int status)
Sets that status of this Template.
void setWebGuiComponentList(WebGuiComponentList webGuiComponentList)
void setXmlMergeId(String xmlMergeId)
Sets the xmlMergeId of this template
Protected Methods
String getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.
void initDefaultAttributes()
This method can be overridden to set default values for attributes.
void initPrototype(String protoName)
Extends initPrototype to provide support for a default template.
boolean isKeyAttribute(String name)
Returns true is the name is that of the key attribute.
void setKey(Element element)
Default implementation for setKey().
void setPrototype(AbstractConfigurationElement prototype)
Sets the prototype object for this instance.
[Expand]
Inherited Methods
From class com.microstrategy.utils.config.AbstractConfigurationElement
From class java.lang.Object
From interface com.microstrategy.utils.config.ConfigurationElement
From interface com.microstrategy.utils.config.ConfigurationFile

Public Constructors

public TemplateInfo (Node root)

Creates a TemplateInfo with the information in the xml node.

Parameters
root An XML Node with the information for this TemplateInfo.

public TemplateInfo (Node root, TemplateInfo defaultTemplate)

Creates a TemplateInfo with the information in the xml node.

Parameters
root An XML Node with the information for this TemplateInfo.
defaultTemplate a TemplateInfo used as default.

public TemplateInfo ()

Empty constructor of a TemplateInfo initialize private fields with default values.

Public Methods

public void addSection (String sectionName, String fileName)

Adds a page section file name.

Parameters
sectionName the section's name.
fileName file name associated with the given section.

public void addShortcutList (String name, ShortcutList shortcutList)

Adds a ShortcutList

Parameters
name the ShorcutList's name.
shortcutList the ShortcutList.

public void deleteSection (String sectionName)

Deletes a page section file name

Parameters
sectionName the section's name.

public void deleteShortcutList (String name)

Deletes a ShortcutList

Parameters
name the ShorcutList's name.

public boolean getAllowCancel ()

Returns
  • the value of the property indicating if the cancel button on the wait box should be displayed or not

public TemplateInfo getDefaultTemplate ()

Returns the default template of the application

Returns
  • the default template of the application

public String getErrorDesc ()

Returns
  • the desc of the description to use as title for the error page.

public String getErrorTitleId ()

Returns
  • the id of the description to use as title for the error page.

public String getFileName ()

Returns
  • the file name to use with this template.

public boolean getIframe ()

Returns
  • true if the template uses the iframe functionality.

public Object getKey ()

Default implementation for getKey(). It assumes a single attribute can be used to uniquely identify this element among its siblings; the attribute to use is specified by the getKeyAttribute() method.

Returns
  • If getKeyAttribute() is empty returns null, otherwise it returns the value of the given attribute.

public String getPageName ()

Returns
  • the page name from the to use in place of this template.

public String getSection (String sectionName)

Returns the file name of the section associated with the given section name.

Parameters
sectionName the section's name.
Returns
  • file name associated with the given section.

public SectionInfoList getSectionInfoList ()

Returns the available sections for this template.

Returns
  • the template's SectionList

public ShortcutList getShortcutList (String name)

Returns the ShorcutList associated with the given name.

Parameters
name the ShorcutList's name.
Returns
  • the ShorcutList associated with the given name.

public ShortcutListSet getShortcutListSet ()

Returns the set of ShortcutLists for this template.

Returns
  • the template's ShortcutListSet

public boolean getShowWait ()

Returns
  • the value of the property indicating if the wait should be displayed or not

public int getStatus ()

Return the status of this Template. The status indicates to use this template only if the page is in the same status. An status of 0 indicates to use this template with any status.

Returns
  • the status associated.

public WebGuiComponentList getWebGuiComponentList ()

Returns the available Web Components for this template.

Returns
  • the template's WebGuiComponentList

public String getXmlMergeId ()

Returns
  • the XmlMerge id to use with this template.

public void setAllowCancel (boolean newValue)

Parameters
newValue boolean value indicating if the cancel button on the wait box should be displayed or not

public void setErrorDesc (String errorDesc)

Sets the descriptor Desc of the title of the error section if an error happens on this page.

Parameters
errorDesc the new descriptor Desc.

public void setErrorTitleId (String errorTitleId)

Sets the descriptor Id of the title of the error section if an error happens on this page.

Parameters
errorTitleId the new descriptor Id.

public void setFileName (String fileName)

Sets the fileName of this template

Parameters
fileName the new file to use.

public void setIframe (boolean newValue)

Sets if the template uses the iframe functionality

Parameters
newValue iframe usage.

public void setShowWait (boolean newValue)

Parameters
newValue boolean value indicating if the wait should be displayed or not

public void setStatus (int status)

Sets that status of this Template. If a Template has an associated status, it should only be used when the pageComponent is in this status.

Parameters
status value indicating the current status

public void setWebGuiComponentList (WebGuiComponentList webGuiComponentList)

public void setXmlMergeId (String xmlMergeId)

Sets the xmlMergeId of this template

Parameters
xmlMergeId the new file to use.

Protected Methods

protected String getKeyAttribute ()

This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.

protected void initDefaultAttributes ()

This method can be overridden to set default values for attributes. Simply extend this method and call setAttribute(String, Object)

protected void initPrototype (String protoName)

Extends initPrototype to provide support for a default template. When a new TemplateInfo is created, if it doesn't have a prototype yet, it should will use the default template from the default list as prototype.
This functionality has been added to provide backwards compatibility, but this behavior is intended to be removed in the future. The correct behavior is that each template should have its definition complete, and not rely on the definition of the default template. Make sure the definition in the pageConfig reflects this.

Parameters
protoName Prototype name, typically the name of a sibling node in the xml.

protected boolean isKeyAttribute (String name)

Returns true is the name is that of the key attribute.

protected void setKey (Element element)

Default implementation for setKey(). It assumes a single attribute can be used to uniquely identify this element among its siblings and adds this attribute to the given element; the attribute to use is specified by the getKeyAttribute() method.

protected void setPrototype (AbstractConfigurationElement prototype)

Sets the prototype object for this instance. The attributes and elements of the prototype are copied into this instance.