Class PageByTransform
- java.lang.Object
-
- com.microstrategy.web.transform.AbstractTransform
-
- com.microstrategy.web.transform.AbstractLayoutTransform
-
- com.microstrategy.web.app.transforms.AbstractAppTransform
-
- com.microstrategy.web.app.transforms.PageByTransform
-
- All Implemented Interfaces:
AppTransform
,LayoutTransform
,Transform
public class PageByTransform extends AbstractAppTransform implements LayoutTransform
The Page-by Transform generates the HTML for both, the page-by axis of a report and the group-by section of a document.
This class transforms a
PageByBean
. This bean is the one that encapsulates the differences at theWebApi
level between reports and documents.This transform can be used in either design or view mode. Design mode renders the list of units and allows end users to add/remove/pivot/sort them using drag and drop, context menus or simply buttons. In view mode, the transform also renders a dropdown list with the page-by elements from which end-users can filter the displayed data.
The default output of the PageByTransform is divided into two methods
renderTitle(com.microstrategy.web.beans.MarkupOutput)
andrenderBody(com.microstrategy.web.beans.MarkupOutput)
. The first includes the title of the dialog, a summary section with the current selections and close and help buttons. The body just renders the list of page-by units with their corresponding elements (if in view mode).This Transform implements
LayoutTransform
, therefore the output generated can be controlled and modified using an external configuration xml file.- Since:
- MicroStrategy Web 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PageByTransform.Context
ExtendsAbstractAppTransform.Context
by providing a link to the currentWebObjectInfo
.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_removeOptionString
protected FormalParameter
advancedDrillingContextMenuDisplay
It is used in the transform to specify whether to show the advanced drilling options in the editor or context menu.protected FormalParameter
groupContextMenuDrillPathsByType
It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted.FormalParameter
helpTopic
Indicates the help topic for the help page of the editor.FormalParameter
helpType
Indicates the type of help topic this editor uses.protected FormalParameter
isAutoSubmitEnabled
This is the flag used in the transform to specify whether to enable auto-submit functionality.protected FormalParameter
isContextMenuEnabled
Deprecated.To customize context-menus use the xml-definition specified byAbstractAppTransform.contextMenus
protected FormalParameter
isDragAndDropEnabled
This is the flag used in the transform to specify whether to enable drag and drop functionality.protected FormalParameter
isEditable
This flag indicates the page by attributes can be arranged or removed from the panel.
Allowed Values: TRUE/FALSE.protected FormalParameter
isSummaryWhenClosedEnabled
This flag indicates the Transform to render the summary section, even if the even is closed.protected FormalParameter
showDrillAdvanced
It is used in the transform to specify whether to allow advanced drilling.protected FormalParameter
showDrillDownOnly
It is used in the transform to specify whether to allow drilling to the child only.protected FormalParameter
showDrillMetric
It is used in the transform to specify whether to allow drilling on metrics.protected FormalParameter
showDrillPathSetNamesSubMenuAtTopLevel
It is used in the transform to specify whether to show the set names submenu for drilling at the top level (or at a lower depth).protected FormalParameter
showDrillRMC
It is used in the transform to specify whether to show Right Mouse Click menu for drill.protected FormalParameter
showDrillRMCMetric
It is used in the transform to specify whether to show Right Mouse Click menu for drill for metrics.protected FormalParameter
sortSetNamesAndDrillPaths
It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted.-
Fields inherited from class com.microstrategy.web.app.transforms.AbstractAppTransform
_bean, _componentBlock, _cssPrefix, _imgBlank, _imgWait, _selfOutput, _subOutput, appliesTo, CLASS_INPUT, CLASS_MESSAGE, contextMenus, cssFile, cssPrefix, debugErrorFlags, debugFlags, dragMode, extraInput, extraUrl, FP_APPLIES_TO, FP_CONTEXT_MENUS, FP_CSS_ERROR_MESSAGE, FP_CSS_ERROR_TITLE, FP_CSS_FILE, FP_CSS_PREFIX, FP_DEBUG_ERROR_FLAGS, FP_DEBUG_FLAGS, FP_DRAG_MODE, FP_EXTRA_INPUT, FP_EXTRA_URL, FP_HEIGHT, FP_IFRAME_ENABLED, FP_IMG_WAIT, FP_INITIAL_INDENT, FP_ORIENTATION, FP_ORIENTATIONS_ALLOWED, FP_PARTIAL_IFRAME_UPDATE, FP_PROCESSING_BUTTONS_FLAGS, FP_PROCESSING_INFO_FLAGS, FP_RESIZE_LEVEL, FP_SCRIPT_CLASS, FP_TYPE, FP_USE_DHTML, FP_WIDTH, globalCssErrorMessage, globalCssErrorTitle, height, iframeEnabled, imgWait, indent, initialIndent, isDHTML, orientation, orientationsAllowed, partialIframeUpdate, PROCESSING_BUTTONS_ALL, PROCESSING_BUTTONS_CANCEL, PROCESSING_BUTTONS_HISTORY_LIST, PROCESSING_BUTTONS_REFRESH, PROCESSING_BUTTONS_VIEW_DETAILS, PROCESSING_INFO_ALL, PROCESSING_INFO_DESCRIPTION, PROCESSING_INFO_LAST_UPDATE, PROCESSING_INFO_NAME, PROCESSING_INFO_NONE, PROCESSING_INFO_STATUS, processingButtonsFlags, processingInfoFlags, RESIZE_ALL, RESIZE_HORIZONTAL, RESIZE_NONE, RESIZE_VERTICAL, resizeLevel, scriptClass, scriptEndTagEncoder, type, useDHTML, width
-
-
Constructor Summary
Constructors Constructor Description PageByTransform()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
canClose()
Indicates the Transform whether it can be closed.java.util.Map
getAttributesBody()
Returns a map (name/value pairs) with attributes and their corresponding values used with the<div>
tag enclosing the body.java.util.Map
getAttributesTitle()
Returns a map (name/value pairs) with attributes and their corresponding values used with the<div>
tag enclosing the title.java.util.Map
getAttributesUnit(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their corresponding values used with the<div>
tag enclosing a single page-by unit.protected WebEvent
getChangeSelectedElementEvent()
Returns the event used by the Transform to change the currently selected element.protected WebEvent
getCloseEvent()
Returns the event used to close the Transform.protected java.util.Map
getContextMenuAttributes(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their corresponding values necessary for context-menus used with the <div> tag enclosing a single page-by unit.protected WebEvent
getDeletetEvent(PageByUnit unit)
Returns the event used by the Trasnform to delete a pageby unit from the working-set definition.java.lang.String
getDescription()
Returns a textual description of the transform.protected java.util.Map
getDragAndDropAttributes(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their corresponding values necessary for drand and drop used with the <div> tag enclosing a single page-by unit.protected Editor
getEditor()
Returns an initializedEditor
instance, this instance is used by the Transform as a helper object to render the help and close buttons.java.lang.String
getEditorTitle()
Returns the title for the editor.protected WebEvent
getGenericEvent()
In HTML mode, all actions (sort, pivot, change element) need to be summited in the same <FORM> tag, therefore the event submitted needs to support all of these and execution the correct action based on an argument.protected WebEvent
getHelpEvent()
Deprecated.protected WebEvent
getMainEvent()
This will return the event that the main form should use.PageByBean
getPageByBean()
Returns thePageByBean
being transformed.protected WebEvent
getPivotEvent(PageByUnit unit, java.lang.String action)
Returns the event used by the Trasnform to pivot a pageby unit.protected WebEvent
getRemoveEvent(PageByUnit unit)
Returns the event used by the Trasnform to remove a pageby unit.protected java.lang.String
getRemoveTooltip()
Gets the tooltip for the remove image.protected java.lang.String
getScriptClass()
This method overwrites the default implementation by determining which script class to use based on properties of the target report, not by what was defined as value of the formal parameterprotected WebEvent
getSortEvent(PageByUnit unit)
Returns the event used by the Trasnform to sort a pageby unit.java.lang.Class
getSupportedBeanType()
Overrides AbstractAppTransform#getSupportedBeanType.boolean
hasFakedUnits()
void
initializeCss()
Initialize the css classes to be used by this transform.void
initializeImages()
Initialize the images to be used by this transform.void
initializeTransform(Transformable data)
This method initialize the private and protected fields of the transform, such as width and height.protected boolean
isAutoSubmitEnabled()
Method that indicates if auto-submit is enabled for this transform.protected boolean
isContextMenuEnabled()
Deprecated.boolean
isContextMenusEnabled()
Indicates whether context-menus are enabled for this Transform.boolean
isDesignMode()
Indicates to the transform that it should render its content for design mode (in this case, some functionality might be disabled or different).protected boolean
isDragAndDropEnabled()
Method that indicates if drag and drop is enabled for this transform.boolean
isListEmpty()
Returnstrue
is the page-by units list is empty.protected boolean
isOpen()
ExtendsisOpen
by returningtrue
even if thePageByBean
is closed whenever all the following conditions are met:isSummaryWhenClosedEnabled
FormalParameter is true.protected boolean
isTargetReport()
Indicates if the target bean should be treated as aReportBean
.protected boolean
isTargetRW()
Indicates if the target bean should be treated as aRWBean
(document).protected TransformContext
newContext()
Creates a new instance of a TransformContext.void
renderAlias(MarkupOutput out, PageByUnit unit)
Renders the unit alias.void
renderBody(MarkupOutput out)
Renders the editor's body.void
renderCloseButton(MarkupOutput out)
If the dialog can be closed (that is, thecanClose
method returns true) it will render the close button.protected void
renderDeleteImage(MarkupOutput out, PageByUnit unit)
Renders the image to delete a unit.void
renderEditorTitle(MarkupOutput out)
Renders the title for the editor, just converts the editor title to upper case and appends ":"void
renderElementList(MarkupOutput out, PageByElementList list)
Renders a single element list (that is, the dropdown that allows the end-user to select the current element).void
renderElements(MarkupOutput out, PageByUnit unit)
Renders the elements for the given unit.void
renderEmptyList(MarkupOutput out)
This method is used to render the body when the list of units is empty.void
renderFakedUnits(MarkupOutput out, PageByUnitReportFaked unit)
This method generates the fake page-by units for the attributes that are not on the template.void
renderHelpButton(MarkupOutput out)
Renders a button with the link to the help section with the corresponding help topic.protected void
renderJavascript(MarkupOutput out)
Method that will render all output necessary for client-side manipulations using javascriptvoid
renderList(MarkupOutput out)
Renders all pageby units (by calling for each one renderUnit).void
renderPivotButtons(MarkupOutput out, PageByUnit unit)
Renders pivot buttons (if available) for the given unit.protected void
renderPivotImage(MarkupOutput out, PageByUnit unit, java.lang.String cmdvl, java.lang.String css, java.lang.String alt)
Renders the image to pivot a unit.protected void
renderPivotImage(MarkupOutput out, PageByUnit unit, java.lang.String cmdvl, java.lang.String css, java.lang.String src, java.lang.String alt)
Renders the image to pivot a unit.protected void
renderRemoveImage(MarkupOutput out, PageByUnit unit)
Renders the image to remove a unit from the page-by section.void
renderSelectedElement(MarkupOutput out, PageByElementList list)
Renders a single selected element labelvoid
renderSelectedElementLabel(MarkupOutput out, PageByUnit unit)
Renders the selected element label for the given unit.void
renderSortButtons(MarkupOutput out, PageByUnit unit)
Renders sort buttons (if available) for the given unit.protected void
renderSortImage(MarkupOutput out, PageByUnit unit, java.lang.String css, java.lang.String title)
Renders the image to sort a unit.protected void
renderSortImage(MarkupOutput out, PageByUnit unit, java.lang.String css, java.lang.String src, java.lang.String title)
Renders the image to sort a unit.void
renderSubmitButton(MarkupOutput out)
Renders the submit button for the element list.void
renderSummary(MarkupOutput out)
Renders the summary of the current selections.void
renderTitle(MarkupOutput out)
Renders the dialog's title.void
renderUnit(MarkupOutput out, PageByUnit unit)
Renders a single unit.protected boolean
shouldDisplay()
Determines whether the transform should render itself or not.protected boolean
showFakedUnits()
protected boolean
showRemoveFromReport()
Deprecated.This method is not used by Transform anymore and will be removed from future versions of the product.void
transformForRequestSuccessful(MarkupOutput out)
Main entry point for this transform.-
Methods inherited from class com.microstrategy.web.app.transforms.AbstractAppTransform
addContactInfo, addDynamicScriptClass, addDynamicScriptFile, addFormalParameter, checkLevel, checkProcessingButtonsFlag, checkProcessingInfoFlag, checkStatus, displayError, displayError, displayError, emptyCell, excludeStaticTags, generateAnchor, generateAnchorForExport, generateHiddenInputsForEvent, generateIFrameTag, getAppContext, getArgumentName, getAttributesShellDiv, getBeanPath, getBoneId, getCancelEvent, getClientSideHelper, getContainerServices, getContext, getContextMenu, getContextMenuManager, getContextMenuManagerName, getContextMenusDefinition, getCssPrefix, getDateFormat, getDebugOut, getDescriptor, getDescriptor, getDescriptor, getDescriptor, getDisplayMode, getDisplayName, getErrorMessage, getErrorMessage, getErrorTitle, getErrorTitle, getEventManager, getFirstDayOfWeek, getFloatValue, getHelpPath, getID, getIntValue, getJSNameSpace, getLayoutContext, getLocale, getLocale, getPreferenceValue, getProjectID, getRefreshEvent, getRequestKeys, getResourcesFolder, getStringValue, getStyleRequestContext, getStyleShellDiv, getTagsFactory, getTimeFormat, getUnitsLabel, getWebBeanErrorInfo, hasSubBlock, initHeightAndWidthFromPreferences, initializeWebComponent, is508, isBlockMode, isDhtml, isDialog, isDormant, isFeatureAvailable, isIFrameDisplayMode, isIFrameEnabled, isIFrameRequest, isJobExpired, isModal, isPortlet, isTrue, localIsIFrameDisplayMode, newHiddenInputBuilder, newNamespaceEncoder, newURIBuilder, redirectToDisplayError, redirectToDisplayError, renderBean, renderBean, renderBean, renderBean, renderCancelButton, renderContextMenus, renderCssLink, renderDescriptor, renderDescriptor, renderErrorButton, renderHiddenInputFromRequest, renderImage, renderLayout, renderProcessingButton, renderProcessingButton, renderProcessingButton, renderProcessingButtonForGet, renderProcessingButtonForGet, renderProcessingButtons, renderProcessingInfo, renderProcessingInfoData, renderProcessingInfoImage, renderProcessingInfoSubtitle, renderProcessingInfoTitle, renderProcessingObjectName, renderRefreshButton, renderRegisterBone, renderSelf, renderShell, renderSubBlock, renderUserHelpAnchor, setBoneProperties, setDisplayMode, setHasSubBlock, setHeight, setIFrameDisplayMode, setIsDormant, setRenderSubBlock, setShellAttributeOnClosedComponent, setWidth, transform, transformForRequestCanceled, transformForRequestInError, transformForRequestNotInited, transformForRequestProcessing, transformForRequestWaitingForUserInput
-
Methods inherited from class com.microstrategy.web.transform.AbstractLayoutTransform
getLayoutDefinition, setLayoutDefinition, transformUsingLayout
-
Methods inherited from class com.microstrategy.web.transform.AbstractTransform
addFormalParam, canTransform, getEvents, getFormalParams, getPreview, isPreviewAvailable, isResolved, removeFormalParam, setAnnotation, setDeprecated, supports, supports
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.transform.LayoutTransform
getLayoutDefinition, setLayoutDefinition
-
Methods inherited from interface com.microstrategy.web.transform.Transform
canTransform, getFormalParams, getID, getPreview, isPreviewAvailable, isResolved, supports, supports, transform
-
-
-
-
Field Detail
-
_removeOptionString
protected java.lang.String _removeOptionString
-
isDragAndDropEnabled
protected FormalParameter isDragAndDropEnabled
This is the flag used in the transform to specify whether to enable drag and drop functionality.
Noticed, though, that even if this parameter is true, this functionality might be disabled if the user doesn't have enough privileges or if it's not DHTML mode.
Allowed Values: TRUE/FALSE.
-
isContextMenuEnabled
@Deprecated protected FormalParameter isContextMenuEnabled
Deprecated.To customize context-menus use the xml-definition specified byAbstractAppTransform.contextMenus
This is the flag used in the transform to specify whether to enable context menu functionality.
Noticed, though, that even if this parameter is true, this functionality might be disabled if the user doesn't have enough privileges or if it's not DHTML mode.
Allowed Values: TRUE/FALSE.
-
isAutoSubmitEnabled
protected FormalParameter isAutoSubmitEnabled
This is the flag used in the transform to specify whether to enable auto-submit functionality.
With this functionality, the page-by element selection is automatically submitted using javascript as soon as the element is selected by the end user.
Noticed, though, that even if this parameter is true, this functionality might be disabled if the user doesn't have enough privileges, if it's not DHTML mode, or based on the WebFeatureAutoPageBy Feature.
Allowed Values: TRUE/FALSE.
-
isSummaryWhenClosedEnabled
protected FormalParameter isSummaryWhenClosedEnabled
This flag indicates the Transform to render the summary section, even if the even is closed.
When this happens, the Transform isOpen returns true even if the underlying PageByBean is closed, and invokes the renderSummary method.
Allowed Values: TRUE/FALSE.
-
isEditable
protected FormalParameter isEditable
This flag indicates the page by attributes can be arranged or removed from the panel.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 8.0.2
-
showDrillPathSetNamesSubMenuAtTopLevel
protected FormalParameter showDrillPathSetNamesSubMenuAtTopLevel
It is used in the transform to specify whether to show the set names submenu for drilling at the top level (or at a lower depth).
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
advancedDrillingContextMenuDisplay
protected FormalParameter advancedDrillingContextMenuDisplay
It is used in the transform to specify whether to show the advanced drilling options in the editor or context menu.
Allowed Values: PreferencesDrillTransform.ADVANCED_DRILLING_RMC_DISPLAY_DEFAULT = "1"
ADVANCED_DRILLING_RMC_DISPLAY_SUBMENU = "2"- Since:
- MicroStrategy Web 9.0.0
-
sortSetNamesAndDrillPaths
protected FormalParameter sortSetNamesAndDrillPaths
It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
groupContextMenuDrillPathsByType
protected FormalParameter groupContextMenuDrillPathsByType
It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
showDrillRMC
protected FormalParameter showDrillRMC
It is used in the transform to specify whether to show Right Mouse Click menu for drill.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
showDrillAdvanced
protected FormalParameter showDrillAdvanced
It is used in the transform to specify whether to allow advanced drilling.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
showDrillDownOnly
protected FormalParameter showDrillDownOnly
It is used in the transform to specify whether to allow drilling to the child only.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
showDrillMetric
protected FormalParameter showDrillMetric
It is used in the transform to specify whether to allow drilling on metrics.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
showDrillRMCMetric
protected FormalParameter showDrillRMCMetric
It is used in the transform to specify whether to show Right Mouse Click menu for drill for metrics.
Allowed Values: TRUE/FALSE.- Since:
- MicroStrategy Web 9.0.0
-
helpType
public FormalParameter helpType
Indicates the type of help topic this editor uses.- Since:
- MicroStrategy Web 9.0.0
-
helpTopic
public FormalParameter helpTopic
Indicates the help topic for the help page of the editor.- Since:
- MicroStrategy Web 9.0.0
-
-
Method Detail
-
initializeTransform
public void initializeTransform(Transformable data)
Description copied from class:AbstractAppTransform
This method initialize the private and protected fields of the transform, such as width and height. It also invokes the
This method is automatically called from theinitializeWebComponent
,initializeImages
andinitializeCss
methods.transform
method. Transforms which would like to invoke other methods in this instance directly (for example, to invoke some render methods), need first to call this method to guarantee that the Transform is ready to generate output.- Specified by:
initializeTransform
in interfaceAppTransform
- Overrides:
initializeTransform
in classAbstractAppTransform
- Parameters:
data
- the bean to transform.
-
shouldDisplay
protected boolean shouldDisplay()
Description copied from class:AbstractAppTransform
Determines whether the transform should render itself or not. Returns the result of !AbstractAppTransform.isIFrameRequest()
or the result of theWebComponent.hasChanged()
method.- Overrides:
shouldDisplay
in classAbstractAppTransform
- Returns:
- boolean
-
initializeImages
public void initializeImages()
Description copied from class:AbstractAppTransform
Initialize the images to be used by this transform.- Overrides:
initializeImages
in classAbstractAppTransform
- Since:
- MicroStrategy Web 8.1.1
-
initializeCss
public void initializeCss()
Description copied from class:AbstractAppTransform
Initialize the css classes to be used by this transform.- Overrides:
initializeCss
in classAbstractAppTransform
-
isOpen
protected boolean isOpen()
ExtendsisOpen
by returningtrue
even if thePageByBean
is closed whenever all the following conditions are met:isSummaryWhenClosedEnabled
FormalParameter is true.- it's is view mode
- The list is not empty
- Overrides:
isOpen
in classAbstractAppTransform
- Returns:
true
if the dialog should be open.
-
isListEmpty
public boolean isListEmpty()
Returnstrue
is the page-by units list is empty.- Returns:
true
if the page-by units list is empty.
-
renderTitle
public void renderTitle(MarkupOutput out)
Renders the dialog's title. This includes:- The editor's title.
- The help button.
- The close button.
- A summary with the current selections.
Example code for this method:Tag div = getTagsFactory().newDivTag(); Tag spanTitle = div.addChild("span"); Tag spanButtons = div.addChild("span"); Tag spanSummary = div.addChild("span"); div.setCssClass("titleBar"); div.setAttributes(getAttributesTitle()); spanTitle.setCssClass("title"); spanButtons.setCssClass("buttons"); spanSummary.setCssClass("summary"); renderEditorTitle(spanTitle.getContent()); renderHelpButton(spanButtons.getContent()); renderCloseButton(spanButtons.getContent()); renderSummary(spanSummary.getContent()); div.render(out);
- Parameters:
out
- where the output gets rendered.
-
renderBody
public void renderBody(MarkupOutput out)
Renders the editor's body. This method will call
Example code for this method:renderEmptyList(com.microstrategy.web.beans.MarkupOutput)
orrenderList(com.microstrategy.web.beans.MarkupOutput)
accordingly.Tag div = getTagsFactory().newDivTag(); div.setCssClass(_cssBody); div.setStyle("position: relative;"); div.setAttributes(getAttributesBody()); if (isListEmpty()) { renderEmptyList(div.getContent()); } else { renderList(div.getContent()); } div.render(out);
- Parameters:
out
- where the output gets rendered.
-
isDesignMode
public boolean isDesignMode()
Indicates to the transform that it should render its content for design mode (in this case, some functionality might be disabled or different).- Returns:
true
if the bean is in design mode.
-
getAttributesTitle
public java.util.Map getAttributesTitle()
Returns a map (name/value pairs) with attributes and their corresponding values used with the<div>
tag enclosing the title. These attributes are used for javascript and formatting.- Returns:
- Map with the attributes for the title div.
-
getAttributesBody
public java.util.Map getAttributesBody()
Returns a map (name/value pairs) with attributes and their corresponding values used with the<div>
tag enclosing the body. These attributes are used for javascript and formatting.- Returns:
- Map with the attributes for the title div.
-
getEditorTitle
public java.lang.String getEditorTitle()
Returns the title for the editor. For documents it returns "Grouping", for reports it retursn "Page-by"- Returns:
- String with the title for the dialog.
-
renderSummary
public void renderSummary(MarkupOutput out)
Renders the summary of the current selections.
If there are no units it just appends "none". If there are units but it's design mode, since no selections are available it returns an empty list.- Parameters:
out
- where the output gets rendered.
-
renderEditorTitle
public void renderEditorTitle(MarkupOutput out)
Renders the title for the editor, just converts the editor title to upper case and appends ":"- Parameters:
out
- where the output gets rendered.
-
renderCloseButton
public void renderCloseButton(MarkupOutput out)
If the dialog can be closed (that is, thecanClose
method returns true) it will render the close button.- Parameters:
out
- where the output gets rendered.
-
renderHelpButton
public void renderHelpButton(MarkupOutput out)
Renders a button with the link to the help section with the corresponding help topic.- Parameters:
out
- where the output gets rendered.
-
getEditor
protected Editor getEditor()
Returns an initializedEditor
instance, this instance is used by the Transform as a helper object to render the help and close buttons.
-
renderEmptyList
public void renderEmptyList(MarkupOutput out)
This method is used to render the body when the list of units is empty. It just adds the message "none" to the output.- Parameters:
out
- where the output gets rendered.
-
renderList
public void renderList(MarkupOutput out)
Renders all pageby units (by calling for each one renderUnit).- Parameters:
out
- where the output gets rendered.
-
renderUnit
public void renderUnit(MarkupOutput out, PageByUnit unit)
Renders a single unit. For each unit this method will:- render its sort buttons
- render its alias
- render its element list
- render its pivot buttons
Example code for this method:Tag span = getTagsFactory().newSpanTag(); span.setCssClass("gby"); span.setAttributes(getAttributesUnit(unit)); renderSortButtons(span.getContent(), unit); renderAlias(span.getContent(), unit); renderElements(span.getContent(), unit); renderPivotButtons(span.getContent(), unit); span.render(out);
- Parameters:
out
- where the output gets rendered.unit
- PageByUnit being rendered.
-
renderSortButtons
public void renderSortButtons(MarkupOutput out, PageByUnit unit)
Renders sort buttons (if available) for the given unit.- Parameters:
out
- where the output gets rendered.unit
- PageByUnit being rendered.
-
renderAlias
public void renderAlias(MarkupOutput out, PageByUnit unit)
Renders the unit alias.- Parameters:
out
- where the output gets rendered.unit
- PageByUnit being rendered.
-
renderPivotButtons
public void renderPivotButtons(MarkupOutput out, PageByUnit unit)
Renders pivot buttons (if available) for the given unit.- Parameters:
out
- where the output gets rendered.unit
- PageByUnit being rendered.
-
renderPivotImage
protected void renderPivotImage(MarkupOutput out, PageByUnit unit, java.lang.String cmdvl, java.lang.String css, java.lang.String alt)
Renders the image to pivot a unit. In HTML mode it adds the link for the pivot event. This method is used to render any of the posible pivot actions on a unit.
-
renderPivotImage
protected void renderPivotImage(MarkupOutput out, PageByUnit unit, java.lang.String cmdvl, java.lang.String css, java.lang.String src, java.lang.String alt)
Renders the image to pivot a unit. In HTML mode it adds the link for the pivot event. This method is used to render any of the posible pivot actions on a unit. Src will only be used in cases of accessibility support.- Since:
- MicroStrategy Web 8.1.1
-
renderRemoveImage
protected void renderRemoveImage(MarkupOutput out, PageByUnit unit)
Renders the image to remove a unit from the page-by section. In HTML mode it adds the link for the remove event.
-
renderDeleteImage
protected void renderDeleteImage(MarkupOutput out, PageByUnit unit)
Renders the image to delete a unit. Deleting actually removes the unit from the working set and may trigger new SQL execution. By default this si only called if removing the unit from the page-by section is not available.- Since:
- MicroStrategy Web 8.0.1
-
renderSortImage
protected void renderSortImage(MarkupOutput out, PageByUnit unit, java.lang.String css, java.lang.String title)
Renders the image to sort a unit. In HTML mode it adds the link for the sort event.
-
renderSortImage
protected void renderSortImage(MarkupOutput out, PageByUnit unit, java.lang.String css, java.lang.String src, java.lang.String title)
Renders the image to sort a unit. In HTML mode it adds the link for the sort event. Src will only be used in cases of accessibility support.- Since:
- MicroStrategy Web 8.1.1
-
getRemoveTooltip
protected java.lang.String getRemoveTooltip()
Gets the tooltip for the remove image. This depends on privileges and the target type- Returns:
- String By default: Remove. Could also return "Remove from Report" or "Remove from template"
-
renderElements
public void renderElements(MarkupOutput out, PageByUnit unit)
Renders the elements for the given unit. This is the dropdown that allows the users to select the element that will filter the data currently displayed.
Normally, a PageByUnit has a single
PageByElementList
, therefore it is rendered with a single dropdown, but in some cases (for example, when thePageByUnit
corresponds to a dimension) it might have more than one. This method will callrenderElementList(com.microstrategy.web.beans.MarkupOutput, com.microstrategy.web.app.beans.PageByElementList)
for every necessary drop down.- Parameters:
out
- where the output gets rendered.unit
- PageByUnit being rendered.
-
renderSelectedElementLabel
public void renderSelectedElementLabel(MarkupOutput out, PageByUnit unit)
Renders the selected element label for the given unit.
- Parameters:
out
- where the output gets rendered.unit
- PageByUnit being rendered.
-
renderElementList
public void renderElementList(MarkupOutput out, PageByElementList list)
Renders a single element list (that is, the dropdown that allows the end-user to select the current element).
By default the list is rendered inside a drop-down box. However if the user doesn't have the
DssXmlPrivilegesWebSwitchPageByElements
privilege, it will not render a drop-down but just a label with the current selection.- Parameters:
out
- where the output gets rendered.list
- PageByElementList to render.
-
renderSelectedElement
public void renderSelectedElement(MarkupOutput out, PageByElementList list)
Renders a single selected element label
- Parameters:
out
- where the output gets rendered.list
- PageByElementList to render.
-
renderSubmitButton
public void renderSubmitButton(MarkupOutput out)
Renders the submit button for the element list. Notice however nothing will be rendered if the list is empty, or if the autosubmit is enabled.- Parameters:
out
- where the output gets rendered.
-
getSortEvent
protected WebEvent getSortEvent(PageByUnit unit)
Returns the event used by the Trasnform to sort a pageby unit.- Parameters:
unit
- PageByUnit to sort- Returns:
- WebEvent that will sort the unit
-
getPivotEvent
protected WebEvent getPivotEvent(PageByUnit unit, java.lang.String action)
Returns the event used by the Trasnform to pivot a pageby unit. Theaction
argument decides the type of pivot (left, right, to columns, etc).- Parameters:
unit
- PageByUnit to pivot- Returns:
- WebEvent that will pivot the unit
-
getRemoveEvent
protected WebEvent getRemoveEvent(PageByUnit unit)
Returns the event used by the Trasnform to remove a pageby unit. Notice that this event only removes the unit from the page-by section, but the unit is still available for manipulations in the working set definition.- Parameters:
unit
- PageByUnit to pivot- Returns:
- WebEvent that will remove the unit from the page-by
-
getDeletetEvent
protected WebEvent getDeletetEvent(PageByUnit unit)
Returns the event used by the Trasnform to delete a pageby unit from the working-set definition. When you simply remove an object from the page-by, the object can still be used in other parts of the report/document definition. When you deleted from the working-set, though, the report definition changes, the unit is not available anymore and the report/document gets re-executed with the new definition.
- Parameters:
unit
- PageByUnit to pivot- Returns:
- WebEvent that will remove the unit from the page-by
- Since:
- MicroStrategy Web 8.0.1
-
showRemoveFromReport
@Deprecated protected boolean showRemoveFromReport()
Deprecated.This method is not used by Transform anymore and will be removed from future versions of the product.Indicates whether this unit can be removed from the report.
Any time you remove the last template unit from a REPORT (not just grid), you'll get the 'template unit is empty' error when executing it. If you're already in view mode (e.g. the report has been executed), when removing this unit the user will get the error, therefore we want to prevent it, therefore we will not allow users to remove if its the las unit in the template.
-
getMainEvent
protected WebEvent getMainEvent()
This will return the event that the main form should use. In DHTML it returns the changeSelectedElement event. In HTML mode is returns the generic event.- Returns:
- WebEvent
-
getChangeSelectedElementEvent
protected WebEvent getChangeSelectedElementEvent()
Returns the event used by the Transform to change the currently selected element.- Returns:
- By default
EnumPageByBeanEvents.WebEventPageBySelectElement
.
-
getGenericEvent
protected WebEvent getGenericEvent()
In HTML mode, all actions (sort, pivot, change element) need to be summited in the same <FORM> tag, therefore the event submitted needs to support all of these and execution the correct action based on an argument. This is the event used by the Transform for this case.- Returns:
- By default
EnumPageByBeanEvents.WebEventPageByGeneric
.
-
getCloseEvent
protected WebEvent getCloseEvent()
Returns the event used to close the Transform.- Returns:
- By default,
EnumPageByBeanEvents.WebEventShowBean
.
-
getHelpEvent
@Deprecated protected WebEvent getHelpEvent()
Deprecated.Returns the event used to open the online help in the corresponding section.- Returns:
- By default
EnumServletEvents.WebEventOpenHelp
.
-
getAttributesUnit
public java.util.Map getAttributesUnit(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their corresponding values used with the<div>
tag enclosing a single page-by unit. These attributes are used for javascript and formatting and include information for drand and drop and context menus.- Returns:
- Map with the attributes for a single page-by unit.
-
getDragAndDropAttributes
protected java.util.Map getDragAndDropAttributes(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their corresponding values necessary for drand and drop used with the <div> tag enclosing a single page-by unit.- Returns:
- Map with the attributes for drag and drop of a page-by unit.
-
getContextMenuAttributes
protected java.util.Map getContextMenuAttributes(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their corresponding values necessary for context-menus used with the <div> tag enclosing a single page-by unit.
This method also builds these menus.- Returns:
- Map with the attributes for context menus of a page-by unit.
-
isDragAndDropEnabled
protected boolean isDragAndDropEnabled()
Method that indicates if drag and drop is enabled for this transform.- Returns:
true
if available.
-
isContextMenuEnabled
@Deprecated protected boolean isContextMenuEnabled()
Deprecated.Method that indicates if context-menus are enabled for this transform.- Returns:
true
if available.
-
isContextMenusEnabled
public boolean isContextMenusEnabled()
Description copied from class:AbstractAppTransform
Indicates whether context-menus are enabled for this Transform. By default context-menus are enabled only if theAbstractAppTransform.contextMenus
formal parameter has been set.- Overrides:
isContextMenusEnabled
in classAbstractAppTransform
- Returns:
true
if context-menus are enabled in this Transform.- Since:
- MicroStrategy Web 8.0.1
-
isAutoSubmitEnabled
protected boolean isAutoSubmitEnabled()
Method that indicates if auto-submit is enabled for this transform.- Returns:
true
if available.
-
canClose
protected boolean canClose()
Indicates the Transform whether it can be closed. Mainly used to decide whether to show the close button or not. There is the case where this needs to be open, even if the bean is closed (e.g. when we're showing the summary but not the dropdowns), in this case the bean is already closed so we don't want to show the button. The other case is in design mode for reports, here by design the dialog cannot be closed.- Returns:
- boolean true if the dialog can be closed.
-
getScriptClass
protected java.lang.String getScriptClass()
This method overwrites the default implementation by determining which script class to use based on properties of the target report, not by what was defined as value of the formal parameter- Overrides:
getScriptClass
in classAbstractAppTransform
- Returns:
- String with the script class property to use for the JavaScript representation of this element.
-
renderJavascript
protected void renderJavascript(MarkupOutput out)
Method that will render all output necessary for client-side manipulations using javascript- Parameters:
out
- where the output is generated.
-
renderFakedUnits
public void renderFakedUnits(MarkupOutput out, PageByUnitReportFaked unit)
This method generates the fake page-by units for the attributes that are not on the template.
-
showFakedUnits
protected boolean showFakedUnits()
-
hasFakedUnits
public boolean hasFakedUnits()
-
getPageByBean
public PageByBean getPageByBean()
Returns thePageByBean
being transformed.- Returns:
PageByBean
being Transformed.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:Transform
Returns a textual description of the transform.- Specified by:
getDescription
in interfaceTransform
- Returns:
- The textual description of the transform.
-
transformForRequestSuccessful
public void transformForRequestSuccessful(MarkupOutput out)
Main entry point for this transform. This is the method responsible of generating the HTML output.
If a layout-xml is associated throught the style catalog this method will delegate execution to theLayoutParser
by callingAbstractAppTransform.renderLayout(com.microstrategy.web.beans.MarkupOutput)
otherwise it will callrenderTitle(com.microstrategy.web.beans.MarkupOutput)
andrenderBody(com.microstrategy.web.beans.MarkupOutput)
. Then it callsrenderJavascript(com.microstrategy.web.beans.MarkupOutput)
.- Specified by:
transformForRequestSuccessful
in classAbstractAppTransform
- Parameters:
out
- where the output is generated.- See Also:
AbstractAppTransform.checkStatus(com.microstrategy.web.beans.MarkupOutput)
-
getSupportedBeanType
public java.lang.Class getSupportedBeanType()
Overrides AbstractAppTransform#getSupportedBeanType. Returns:PageByBean.class
- Specified by:
getSupportedBeanType
in interfaceTransform
- Overrides:
getSupportedBeanType
in classAbstractAppTransform
- Returns:
- a root class/interface supported by this transform.
-
isTargetReport
protected boolean isTargetReport()
Indicates if the target bean should be treated as aReportBean
.- Returns:
- true if the targetbean of the
PageByBean
is aReportBean
.
-
isTargetRW
protected boolean isTargetRW()
Indicates if the target bean should be treated as aRWBean
(document).- Returns:
- true if the targetbean of the
PageByBean
is aRWBean
.
-
newContext
protected TransformContext newContext()
Description copied from class:AbstractAppTransform
Creates a new instance of a TransformContext. It's used by the getContext method the first time is invoked. Transforms who require to include extra information in the context should create their own TransformContext implementation (possibly a subclass of AppTransformContext) and returns a new instance in this method.- Overrides:
newContext
in classAbstractAppTransform
- Since:
- MicroStrategy Web 8.0.1
-
-