Class RichPageWidget
java.lang.Object
com.polarion.alm.shared.api.model.rp.widget.RichPageWidget
Rich Page Widget is a visual component which can be added by the user to the Rich Page
and which shows some data based on user defined parameters - see
getParametersDefinition(ParameterFactory)
Implementations should be state-less and not assume that only one instance is created in runtime.- Since:
- 3.9.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute for storing the action ID.static final StringOptional attribute for configuring the label of the confirmation button in the confirmation dialog.static final StringOptional attribute for configuring the key for remembering the state of the "Don't show this again." The check-box is not shown when the attribute is not defined or the value is empty.static final StringOptional attribute for configuring the text of the confirmation dialog.static final StringOptional attribute for configuring the title of the confirmation dialog.static final StringCommon ID used for the "Advanced"CompositeParameter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteAction(RichPageWidgetActionContext context) This method is executed on server after user clicks (in view mode of the page) on some HTML element inside the widget which has not empty value in attributedata-action-id(ATTRIBUTE_ACTION_ID).getDescriptionHtml(RichPageWidgetContext widgetContext) Override this method to return additional description for current widget.abstract StringgetDetailsHtml(RichPageWidgetContext widgetContext) abstract StringgetIcon(RichPageWidgetContext widgetContext) abstract StringgetLabel(SharedContext context) Plain text label of this widget.abstract ReadOnlyStrictMap<String, RichPageParameter> getParametersDefinition(ParameterFactory factory) Returned map defines the parameters for this widget. The parameter IDs (the keys in the map) must not contain the dot ('.') character. The parameters are cloned before they are used for the concrete widget instance when it is either used of the first time or before the parameters are initialized from persistence The returned parameters can already contain default values.getResourceStream(String path) UseRichPageWidgetContext.resourceUrl(String)to create the relative URL to the servlet which calls this method to serve the (static) resource.getTags(SharedContext context) Returns tags for filtering in the widgets sidebar.
The standard localized tags can be obtained by calling context.localization().getString() with one of the following values (or similar ones which will be added in the future):
richpages.widget.tag.generic
richpages.widget.tag.charts
richpages.widget.tag.planning
richpages.widget.tag.scripting
richpages.widget.tag.workitems
richpages.widget.tag.testRunsbooleanisInline()Return true, when this widget is "inline" meaning that it can be inserted inside the text paragraphbooleanOverride this method to set if the widget is restricted.voidThis method allows widget developer to change configurations of some parameters based on values of some other parameters.abstract StringrenderHtml(RichPageWidgetRenderingContext context) Main method of the widget which renders the widget's HTML which is shown in the page.
-
Field Details
-
PARAMETER_ADVANCED
Common ID used for the "Advanced"CompositeParameter- See Also:
-
ATTRIBUTE_ACTION_ID
Attribute for storing the action ID.- Since:
- 3.9.2
- See Also:
-
ATTRIBUTE_CONFIRM_TITLE
Optional attribute for configuring the title of the confirmation dialog.- Since:
- 3.9.2
- See Also:
-
ATTRIBUTE_CONFIRM_TEXT
Optional attribute for configuring the text of the confirmation dialog.- Since:
- 3.9.2
- See Also:
-
ATTRIBUTE_CONFIRM_BUTTON
Optional attribute for configuring the label of the confirmation button in the confirmation dialog. Default label OK (localized) is used when the attribute is not defined or the value is empty.- Since:
- 3.9.2
- See Also:
-
ATTRIBUTE_CONFIRM_KEY
Optional attribute for configuring the key for remembering the state of the "Don't show this again." The check-box is not shown when the attribute is not defined or the value is empty. The key should start with your company's name space prefix to avoid name conflicts.- Since:
- 3.9.2
- See Also:
-
-
Constructor Details
-
RichPageWidget
public RichPageWidget()
-
-
Method Details
-
isInline
public boolean isInline()Return true, when this widget is "inline" meaning that it can be inserted inside the text paragraph -
isRestricted
public boolean isRestricted()Override this method to set if the widget is restricted. (It can execute js or similar.) The default is false. If true, it will be checked against the 'com.polarion.restrictedWidgets.modify' permission so the usage can be disabled for lower privileged users.- Since:
- 3.25.6
-
getResourceStream
@NotNull @GwtIncompatible public InputStream getResourceStream(@NotNull String path) throws IOException UseRichPageWidgetContext.resourceUrl(String)to create the relative URL to the servlet which calls this method to serve the (static) resource.
Note: Requested resource might be cached by browser, so in that case this method will not be called. In other words the requested resource will not be updated on client side until the cached resource invalidates or will be removed from browser cache.- Throws:
IOException- in case that resource cannot be served.
-