Package com.microstrategy.web.objects
Interface WebTemplate
-
- All Superinterfaces:
KeyedObject,WebDisplayUnit,WebFeatures,WebObjectInfo,WebPromptSite
public interface WebTemplate extends WebObjectInfo
WebTemplate represents a template, which is a first class object. The WebTemplate object and its subordinate objects can be used to manipulate the template units of a template. Note that a template obtained fromWebReportInstancecannot be calledWebObjectInfo.populate(), unlike all otherWebObjectInfo-derived objects. Also, to get access to the template units or properties in a template fromWebReportInstance, report needs to be executed first, before callingWebViewInstance.getTemplate().- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description WebTemplateUnitadd(WebObjectInfo objectInfo, int toAxis, int toPosition)This method will take the given object, and add aWebTemplateUnitpointing to the given object at the given axis and position within the template.WebTemplateUnitadd(WebObjectInfo objectInfo, int toAxis, int toPosition, boolean copyFormatting)WebTemplateUnitadd(WebTemplateUnit templateUnit, int toAxis, int toPosition)Moves the given template unit, which should exist on the current template, from it's current position to the given position on the template.WebTemplateUnitaddMetrics(int toAxis, int toPosition)This method will add or move theWebTemplateMetricscollection to the given axis and position within the template.voidaddMetricToDelta(java.lang.String unitId, int unitType, int unitPosition, java.lang.String displayName)Add metrics to delta.voidclearCurrentElements()Clears the current element.voidclearTemplate()Clear the current templatebooleancontains(WebObjectInfo object)Returns true if the given object is on the template, false otherwise.WebTemplateUnitfindTemplateUnit(int key)Searches the template for theWebTemplateUnitobject with the given key.WebAxisgetAxis(int index)Returns theWebAxisobject with the given index.WebAxisgetColumns()Returns theWebAxisobject which refers to the column axis of the template.java.util.Iterator<WebTemplateMetric>getDisabledMetrics()Get the collection iterator of the disable metricsWebTemplateFormatContainergetFormatContainer()Returns the Format Container on this template, which contains the 4WebFormatobjects.WebAxisgetPages()Returns theWebAxisobject which refers to the page axis of the template.WebAxisgetRows()Returns theWebAxisobject which refers to the row axis of the template.WebTemplateSubtotalsgetSubtotals()Returns theWebTemplateSubtotalsobject, which represents a collection of subtotals that are available for a given report.WebTemplateMetricSubtotalsgetSubtotals(WebMetric metric)Deprecated.Subtotals are no longer defined at the template metric level.SimpleListgetTemplateAttributes()Returns a read-onlySimpleListofWebTemplateAttributeobjects, which correspond to every attribute on this template.WebTemplateAttributesgetTemplateAttributesCollection()Returns a read-only {WebTemplateAttributes collection} ofWebTemplateAttributeobjects, which correspond to every attribute on this template.WebTemplateMetricsgetTemplateMetrics()If theWebTemplateMetricscollection exists on the template, then it will be returned as-is.WebTemplateUnitgetTemplateUnit(int axis, int position)Returns theWebTemplateUnitat the given axis and position on the template.WebTemplateUnitgetTemplateUnit(WebObjectInfo objectInfo)Returns theWebTemplateUnitcorresponding to the given object on the template.SimpleListgetUnits()Returns a read-onlySimpleListofWebTemplateUnitobjects, which correspond to every template unit on this template.booleanhasAttributes()Returns true if the template contains an attributes collectionbooleanhasMetrics()Returns true if the template contains a metrics collection, in other words, an axis which contains aWebTemplateUnitwhich refers to aWebTemplateMetricsobject.booleanhasSubtotals()Return whether there is any subtotal definition exist for this report.booleanisShowBanding()Return the setting of whether showing banding.booleanisShowSubtotals()Return the setting of whether showing subtotals.voidpivotMetricsToDelta(int axisName, int position)Add metrics to delta.voidremove(WebObjectInfo objectInfo)Finds the givenWebObjectInfoobject, and if it is found, removes it from the template.voidremove(WebObjectInfo objectInfo, boolean isDisableOnly)Finds the givenWebObjectInfoobject, and if it is found, removes it from the template.voidremove(WebTemplateUnit templateUnit)Searches for the givenWebTemplateUnitobject within the template, and removes it.voidremove(WebTemplateUnit templateUnit, boolean isDisableOnly)Searches for the givenWebTemplateUnitobject within the template, and removes it.voidremoveMetrics()Finds the metrics collection on the template and if it is found, removes it from the template.voidremoveMetrics(boolean isDisableOnly)Finds the metrics collection on the template and if it is found, removes it from the template.voidshowBanding(boolean show)Sets the setting to show or hide banding.voidshowSubtotals(boolean show)Sets the setting to show or hide subtotals.-
Methods inherited from interface com.microstrategy.utils.KeyedObject
_getObKey
-
Methods inherited from interface com.microstrategy.web.objects.WebDisplayUnit
addDetails, applyVisitor, canHighlight, getChildUnits, getDisplayName, getDisplayUnitType, hasDetails, highlightUnit, highlightUnit, isHighlighted, isObjectInfo, isSelected, setDisplayName, setSelected
-
Methods inherited from interface com.microstrategy.web.objects.WebFeatures
isFeatureAvailable, isFeatureAvailable
-
Methods inherited from interface com.microstrategy.web.objects.WebObjectInfo
buildShortObjectAttributes, buildShortXML, getAbbreviation, getAccessGranted, getAncestors, getCardStatus, getCertifiedInfo, getComments, getContainerDid, getContainerType, getCreationTime, getCreationTimeStamp, getDataSources, getDefaultLanguage, getDescription, getExtendedType, getFactory, getFlags, getIconPath, getID, getModificationTime, getModificationTimeStamp, getName, getNonSchedulable, getOtherNameTransCount, getOwner, getParent, getPreSaveAsFlags, getProjectId, getProjectName, getPropertyFlags, getPropertySetFilter, getPropertySets, getRecommendationInfo, getSecurity, getState, getSubType, getTemplateInfo, getType, getVersionID, getViewMediaSettings, getVisualizationViewMode, getXML, getXML, hasOwner, isAncestorNamedFolder, isDirty, isEmbedded, isHidden, isNew, isPopulated, populate, populate, setAbbreviation, setComments, setDataSources, setDefaultLanguage, setDescription, setExtendedType, setFlags, setHidden, setIconPath, setName, setNonSchedulable, setPreSaveAsFlags, setPropertyFlags
-
Methods inherited from interface com.microstrategy.web.objects.WebPromptSite
getPromptInstances
-
-
-
-
Method Detail
-
getRows
WebAxis getRows()
Returns theWebAxisobject which refers to the row axis of the template.- Returns:
- The row axis of the template.
-
getColumns
WebAxis getColumns()
Returns theWebAxisobject which refers to the column axis of the template.- Returns:
- The column axis of the template.
-
getPages
WebAxis getPages()
Returns theWebAxisobject which refers to the page axis of the template.- Returns:
- The page axis of the template.
-
getAxis
WebAxis getAxis(int index) throws java.lang.IllegalArgumentException
Returns theWebAxisobject with the given index. This index is one-based, and comes fromEnumDSSXMLAxisName.- Parameters:
index- The index of the axis to return.- Returns:
- The
WebAxisobject which corresponds to the given index. - Throws:
java.lang.IllegalArgumentException- Thrown if no axis by the given index exists.
-
hasMetrics
boolean hasMetrics()
Returns true if the template contains a metrics collection, in other words, an axis which contains aWebTemplateUnitwhich refers to aWebTemplateMetricsobject.- Returns:
- True if the metrics collection exists, false if it does not.
-
hasAttributes
boolean hasAttributes()
Returns true if the template contains an attributes collection- Returns:
- True if the attributes collection exists, false if it does not.
-
getTemplateMetrics
WebTemplateMetrics getTemplateMetrics()
If theWebTemplateMetricscollection exists on the template, then it will be returned as-is. If it does not exist, then it will be created at the end of the column axis, and the newWebTemplateMetricscollection will be returned.- Returns:
- A
WebTemplateMetricscollection.
-
add
WebTemplateUnit add(WebObjectInfo objectInfo, int toAxis, int toPosition) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
This method will take the given object, and add aWebTemplateUnitpointing to the given object at the given axis and position within the template. If the object already exists in another template unit already on the template, then it will be moved(pivoted) to the given position.- Parameters:
objectInfo- AWebObjectInfoobject, representing the object to be placed on the template.toAxis- The axis index (values fromEnumDSSXMLAxisName) of theWebAxis, which the object should be placed upon.toPosition- The position within the given axis to place the given object.- Returns:
- The
WebTemplateUnitobject added to(or moved on, if it already exists) the template. - Throws:
java.lang.UnsupportedOperationException- Signals that the template is marked read-only.java.lang.IllegalArgumentException- Signals that the axis or position cannot be found, or theWebObjectInfoobject is of a type which cannot be added to a template.
-
add
WebTemplateUnit add(WebObjectInfo objectInfo, int toAxis, int toPosition, boolean copyFormatting) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
- Throws:
java.lang.UnsupportedOperationExceptionjava.lang.IllegalArgumentException
-
addMetrics
WebTemplateUnit addMetrics(int toAxis, int toPosition) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
This method will add or move theWebTemplateMetricscollection to the given axis and position within the template. If there is no metrics collection on the template, then it will be created anew in the given position. If the metrics collection already exists in another template unit already on the template, then it will be moved(pivoted) to the given position.- Parameters:
toAxis- The axis index (values fromEnumDSSXMLAxisName) of theWebAxis, which the metrics collection should reside upon.toPosition- The position within the given axis to place the metrics collection.- Returns:
- The
WebTemplateUnitobject containing the metrics collection. - Throws:
java.lang.UnsupportedOperationException- Signals that the template is marked read-only.java.lang.IllegalArgumentException- Signals that the axis or position cannot be found on the template.
-
remove
void remove(WebObjectInfo objectInfo, boolean isDisableOnly) throws java.lang.UnsupportedOperationException
Finds the givenWebObjectInfoobject, and if it is found, removes it from the template.- Parameters:
objectInfo- The object to remove from the template.isDisableOnly- Indicate if it is a 'disable from grid' or 'remove from grid' for RWD- Throws:
java.lang.UnsupportedOperationException- Signals that the template is marked read-only.
-
remove
void remove(WebObjectInfo objectInfo) throws java.lang.UnsupportedOperationException
Finds the givenWebObjectInfoobject, and if it is found, removes it from the template.- Parameters:
objectInfo- The object to remove from the template.- Throws:
java.lang.UnsupportedOperationException- Signals that the template is marked read-only.
-
removeMetrics
void removeMetrics() throws java.lang.UnsupportedOperationExceptionFinds the metrics collection on the template and if it is found, removes it from the template.- Throws:
java.lang.UnsupportedOperationException- Signals that the template is marked read-only or that the metrics collection was not found.
-
removeMetrics
void removeMetrics(boolean isDisableOnly) throws java.lang.UnsupportedOperationExceptionFinds the metrics collection on the template and if it is found, removes it from the template.- Parameters:
isDisableOnly- Indicate if it is a 'disable from grid' or 'remove from grid' for RWD- Throws:
java.lang.UnsupportedOperationException- Signals that the template is marked read-only or that the metrics collection was not found.
-
getTemplateUnit
WebTemplateUnit getTemplateUnit(int axis, int position) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Returns theWebTemplateUnitat the given axis and position on the template.- Parameters:
axis- The index (values fromEnumDSSXMLAxisName) of the axis of the template unit.position- The position of the unit on the given axis.- Returns:
- The
WebTemplateUnitobject at the given place on the template. - Throws:
java.lang.UnsupportedOperationException- Thrown if the template is read-only.java.lang.IllegalArgumentException- Thrown if no item exists at the given axis and position on the template.
-
getTemplateUnit
WebTemplateUnit getTemplateUnit(WebObjectInfo objectInfo) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Returns theWebTemplateUnitcorresponding to the given object on the template.- Parameters:
objectInfo- The object to search for on the template.- Returns:
- The
WebTemplateUnitobject corresponding to the given object on the template. - Throws:
java.lang.UnsupportedOperationException- Thrown if the template is read-only.java.lang.IllegalArgumentException- Thrown if no item exists at the given axis and position on the template.
-
add
WebTemplateUnit add(WebTemplateUnit templateUnit, int toAxis, int toPosition) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Moves the given template unit, which should exist on the current template, from it's current position to the given position on the template.- Parameters:
templateUnit- TheWebTemplateUnitobject to search for on the template.toAxis- The axis index (values fromEnumDSSXMLAxisName) of the axis to move the unit to.toPosition- The position within the given axis to move the unit to.- Returns:
- The {link WebTemplateUnit} which has been moved.
- Throws:
java.lang.UnsupportedOperationException- Thrown if the collection is read-only.java.lang.IllegalArgumentException- Thrown if the template unit does not exist on the template, or if the given axis and position do not exist on the template.
-
remove
void remove(WebTemplateUnit templateUnit) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Searches for the givenWebTemplateUnitobject within the template, and removes it.- Parameters:
templateUnit- TheWebTemplateUnitobject to remove from the template.- Throws:
java.lang.UnsupportedOperationException- Thrown if the template is marked read-only.java.lang.IllegalArgumentException- Thrown if the template unit does not exist on the template.
-
remove
void remove(WebTemplateUnit templateUnit, boolean isDisableOnly) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Searches for the givenWebTemplateUnitobject within the template, and removes it.- Parameters:
templateUnit- TheWebTemplateUnitobject to remove from the template.isDisableOnly- Indicate if it is a 'disable from grid' or 'remove from grid' for RWD- Throws:
java.lang.UnsupportedOperationException- Thrown if the template is marked read-only.java.lang.IllegalArgumentException- Thrown if the template unit does not exist on the template.
-
findTemplateUnit
WebTemplateUnit findTemplateUnit(int key) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Searches the template for theWebTemplateUnitobject with the given key.- Parameters:
key- The key of the object to search for.- Returns:
- The
WebTemplateUnitobject corresponding to the given key. - Throws:
java.lang.UnsupportedOperationException- Thrown if the template is marked as read-only.java.lang.IllegalArgumentException- Thrown if the key cannot be found on the template.
-
getSubtotals
@Deprecated WebTemplateMetricSubtotals getSubtotals(WebMetric metric) throws java.lang.IllegalArgumentException
Deprecated.Subtotals are no longer defined at the template metric level. They are defined at the template level Please usegetSubtotals()instead.Returns theWebTemplateMetricSubtotalsobject corresponding to the given metric.- Parameters:
metric- AWebMetricobject corresponding to a metric on the template.- Returns:
- A
WebTemplateMetricSubtotalsobject describing the subtotals set on the metric. - Throws:
java.lang.IllegalArgumentException- Thrown if the given metric is not found on the template.
-
getSubtotals
WebTemplateSubtotals getSubtotals()
Returns theWebTemplateSubtotalsobject, which represents a collection of subtotals that are available for a given report.- Returns:
WebTemplateSubtotalsobject describing the subtotals available for the template- Since:
- MicroStrategy Web 9.0.0
-
getTemplateAttributes
SimpleList getTemplateAttributes()
Returns a read-onlySimpleListofWebTemplateAttributeobjects, which correspond to every attribute on this template.- Returns:
- A
SimpleListcontaining all attributes on the template.
-
getTemplateAttributesCollection
WebTemplateAttributes getTemplateAttributesCollection()
Returns a read-only {WebTemplateAttributes collection} ofWebTemplateAttributeobjects, which correspond to every attribute on this template.- Returns:
- A
WebTemplateAttributescontaining all attributes on the template.
-
contains
boolean contains(WebObjectInfo object)
Returns true if the given object is on the template, false otherwise.- Parameters:
object- The object to find on the template.- Returns:
- Whether the given object is on the template.
-
getUnits
SimpleList getUnits()
Returns a read-onlySimpleListofWebTemplateUnitobjects, which correspond to every template unit on this template.- Returns:
- A
SimpleListcontaining all template unit on this template.
-
isShowSubtotals
boolean isShowSubtotals()
Return the setting of whether showing subtotals.- Returns:
- boolean true for showing subtotals, false for hiding subtotals.
-
showSubtotals
void showSubtotals(boolean show)
Sets the setting to show or hide subtotals.- Parameters:
show- Set this parameter to true to show the subtotals, set this parameter to false to hide the subtotals.
-
isShowBanding
boolean isShowBanding()
Return the setting of whether showing banding.- Returns:
- A boolean - true for showing banding, false for hiding banding.
-
hasSubtotals
boolean hasSubtotals()
Return whether there is any subtotal definition exist for this report. In other words, this returns whether there are any active subtotals for the report.- Returns:
- boolean Return
trueif there is any subtotal defined for any metric. otherwisefalsereturned. - Since:
- MicroStrategy Web 8.0.0
-
showBanding
void showBanding(boolean show)
Sets the setting to show or hide banding.- Parameters:
show- Set this parameter to true to show the banding, set this paramter to false to hide the banding.
-
clearCurrentElements
void clearCurrentElements()
Clears the current element.
-
getFormatContainer
WebTemplateFormatContainer getFormatContainer()
Returns the Format Container on this template, which contains the 4WebFormatobjects.- Returns:
- WebFormatContainer This object is the container for the 4
WebFormatobjects. - Since:
- MicroStrategy Web 8.0.0
-
getDisabledMetrics
java.util.Iterator<WebTemplateMetric> getDisabledMetrics()
Get the collection iterator of the disable metrics- Returns:
- A
WebTemplateMetricsIterator.
-
clearTemplate
void clearTemplate()
Clear the current template
-
addMetricToDelta
void addMetricToDelta(java.lang.String unitId, int unitType, int unitPosition, java.lang.String displayName)Add metrics to delta. It only adds new template manipulation to delta. webTemplate members will not be changed.- Parameters:
unitId- unit IDunitType- unit typeunitPosition- unit positiondisplayName- alias
-
pivotMetricsToDelta
void pivotMetricsToDelta(int axisName, int position)Add metrics to delta. It only adds new template manipulation to delta. webTemplate members will not be changed.- Parameters:
axisName- axis nameposition- unit position
-
-