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 String
Attribute for storing the action ID.static final String
Optional attribute for configuring the label of the confirmation button in the confirmation dialog.static final String
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.static final String
Optional attribute for configuring the text of the confirmation dialog.static final String
Optional attribute for configuring the title of the confirmation dialog.static final String
Common ID used for the "Advanced"CompositeParameter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
executeAction
(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 String
getDetailsHtml
(RichPageWidgetContext widgetContext) abstract String
getIcon
(RichPageWidgetContext widgetContext) abstract String
getLabel
(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.testRunsboolean
isInline()
Return true, when this widget is "inline" meaning that it can be inserted inside the text paragraphvoid
This method allows widget developer to change configurations of some parameters based on values of some other parameters.abstract String
renderHtml
(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 -
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.
-