Class DashboardController
Object
AbstractPortletDto
DashboardController
- All Implemented Interfaces:
Serializable
,AppPages
,Portlet
,ComplexCalculationResult
public class DashboardController
extends AbstractPortletDto
implements Serializable, ComplexCalculationResult, AppPages
This class is used to generate the definition of a so-called controller dashboard portlet (or wizard).
It consists generally of two types of elements: HTML text snippets, and buttons.
The buttons can trigger UI actions (e.g. opening a page) or backend actions (calling a backend URL). It's also possible to display plain HTML links instead of buttons, with the exact same functionality.
The buttons can trigger UI actions (e.g. opening a page) or backend actions (calling a backend URL). It's also possible to display plain HTML links instead of buttons, with the exact same functionality.
- See Also:
-
Field Summary
Fields inherited from class AbstractPortletDto
dragDropEnabled, layout, resizingEnabled
Fields inherited from interface AppPages
CM_MAIN_PAGE, CM_RECORDS_PAGE, CM_TYPES_PAGE, CONFIG_WIZARDS_PAGE, CUSTOM_FORMS_NEW, CUSTOM_FORMS_PAGE, CUSTOM_FORMS_TYPE_PAGE, DB_DASHBOARDS_PAGE, DP_PAGE, DP_TYPES_PAGE, MD_BOM_PAGE, MD_COMPETITION_PAGE, MD_CUSTOMERS_PAGE, MD_CX_PAGE, MD_DCR_PAGE, MD_PP_PAGE, MD_PRODUCTS_PAGE, MD_PX_PAGE, MD_SELLER_EXTENSIONS_PAGE, MD_SELLERS_PAGE, MD_WIZARD_PAGE, PA_CHART_BARLINE_PAGE, PA_CHART_BOXPLOT_PAGE, PA_CHART_BUBBLE_PAGE, PA_CHART_COMPARISONWF_PAGE, PA_CHART_DATATABLE_PAGE, PA_CHART_DETAILEDTIME_PAGE, PA_CHART_HEATMAP_PAGE, PA_CHART_HISTOGRAM_PAGE, PA_CHART_PAGE, PA_CHART_PIE_PAGE, PA_CHART_SCATTER_PAGE, PA_CHART_TIMESCATTER_PAGE, PA_CHART_TIMESERIES_PAGE, PA_CHART_WATERFALL_PAGE, PA_DATASOURCES_PAGE, PA_ROLLUPS_PAGE, PB_LPG_PAGE, PB_MPL_PAGE, PB_PL_ADD_SKU_PAGE, PB_PL_PAGE, PB_SIMULATION_PAGE, PM_CONTRACTS_PAGE, PM_NEW_CONTRACT, PO_NEW_MODEL, QC_DETAILS_PAGE, QC_NEW_QUOTE, QC_TYPES_PAGE, RM_DETAILS_PAGE, RM_MAIN_PAGE, RM_NEW_REBATE_AGREEMENT, RM_RECORDS_PAGE, RM_TEMPLATES_PAGE, SC_ACCRUAL_RECORDS_PAGE, SC_CALCULATIONS_PAGE, SC_COMPENSATION_RECORDS_PAGE, SC_COMPENSATION_TYPES_PAGE, SC_CONDITION_TYPES_PAGE, SC_NEW_PLAN, SC_PLANS_PAGE, SELLER_EXTENSIONS_PAGE, SELLERS_PAGE, USER_ACTIONS_PAGE, USER_NEW_ACTION_PAGE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBackendCall
(String label, String apiUrl) Performs a backend call in the user's context (i.e.void
addBackendCall
(String label, String apiUrl, String payload) Performs a backend call in the user's context (i.e.void
addBackendCall
(String label, String apiUrl, String payload, String successMessage, String failMessage) Performs a backend call in the user's context (i.e.void
Adds a button to the controller.void
Adds a button to the controller.void
Adds a button to the controller.void
addCollapsibleHTML
(boolean isCollapsed, String sectionLabel, String html) Adds an HTML snippet into the controller as a collapsible section.void
addDownloadButton
(String label, String url) Performs a backend call in the user's context in new window.void
addDownloadButton
(String label, String url, String payload) Performs a backend call in the user's context in new window.void
Adds an HTML snippet into the controller.void
Adds a link (simple <A> tag) to the controller.void
Adds a link (simple <A> tag) to the controller.void
Adds a link (simple <A> tag) to the controller.List
<DashboardController.ControllerItem> getItems()
Methods inherited from class AbstractPortletDto
layout, setLayout, value, withDragDrop, withHeight, withHeight, withLayout, withLayout, withLayout, withResizing, withWidth, withWidth
-
Constructor Details
-
DashboardController
public DashboardController()
-
-
Method Details
-
getResultType
- Specified by:
getResultType
in interfaceComplexCalculationResult
-
getItems
-
addButton
Adds a button to the controller.Example:
def controller = api.newController() controller.addButton("1. STEP: Go to Live Price Grids", controller.PB_LPG_PAGE)
- Parameters:
label
- The label of the buttontargetPage
- The name of the target page. See predefined constants inAppPages
interface.
-
addButton
Adds a button to the controller.Example:
def controller = api.newController() controller.addButton("2. STEP: Go to LPG ABC", controller.PB_LPG_PAGE, "45.PG")
- Parameters:
label
- The label of the buttontargetPage
- The name of the target page. See predefined constants inAppPages
interface.targetPageState
- A extra parameter that is used for deep links. E.g. a typed id to open a specific page
-
addButton
Adds a button to the controller.Example:
def controller = api.newController() controller.addButton("Open Dashboard", controller.DB_DASHBOARDS_PAGE, null, "FirstDash")
- Parameters:
label
- The label of the buttontargetPage
- The name of the target page. See predefined constants inAppPages
interface.targetPageState
- A extra parameter that is used for deep links. E.g. a typed id to open a specific pagecomponentId
- Some UI actions require a parameter in this field (e.g. opening a specific dashboard)
-
addLink
Adds a link (simple <A> tag) to the controller.Note: This is available in Unity UI only. No backporting planned for the Classic UI.
Example:
def controller = api.newController() controller.addLink("1. STEP: Go to Live Price Grids", controller.PB_LPG_PAGE)
- Parameters:
label
- The label of the linktargetPage
- The name of the target page. See predefined constants inAppPages
interface.- Since:
- 7.0 Bijou
-
addLink
Adds a link (simple <A> tag) to the controller.Note: This is available in Unity UI only. No backporting planned for the Classic UI.
Example:
def controller = api.newController() controller.addLink("2. STEP: Go to LPG ABC", controller.PB_LPG_PAGE, "45.PG")
- Parameters:
label
- The label of the linktargetPage
- The name of the target page. See predefined constants inAppPages
interface.targetPageState
- An extra parameter that is used for deep links. E.g. a typed id to open a specific page- Since:
- 7.0 Bijou
-
addLink
Adds a link (simple <A> tag) to the controller.Note: This is available in Unity UI only. No backporting planned for the Classic UI.
Example:
def controller = api.newController() controller.addLink("Open Dashboard", controller.DB_DASHBOARDS_PAGE, null, "FirstDash")
- Parameters:
label
- The label of the linktargetPage
- The name of the target page. See predefined constants inAppPages
interface.targetPageState
- A extra parameter that is used for deep links. E.g. a typed id to open a specific pagecomponentId
- Some UI actions require a parameter in this field (e.g. opening a specific dashboard)- Since:
- 7.0 Bijou
-
addBackendCall
Performs a backend call in the user's context (i.e. from the browser).Example:
def controller = api.newController() controller.addBackendCall("Calculate LPG", "/pricegridmanager.calculate/45")
- Parameters:
label
- The label of the buttonapiUrl
- The URL to call
-
addBackendCall
Performs a backend call in the user's context (i.e. from the browser)- Parameters:
label
- The label of the buttonapiUrl
- The URL to callpayload
- The POST data to send along with the request
-
addBackendCall
public void addBackendCall(String label, String apiUrl, String payload, String successMessage, String failMessage) Performs a backend call in the user's context (i.e. from the browser).Example:
def controller = api.newController() controller.addBackendCall("Calculate LPG", "/pricegridmanager.calculate/45", null, "OK", "Not OK")
- Parameters:
label
- The label of the buttonapiUrl
- The URL to callpayload
- The POST data to send along with the requestsuccessMessage
- A text that should be displayed in case of a successful response from the backendfailMessage
- A text that should be displayed in case of a error response from the backend
-
addHTML
Adds an HTML snippet into the controller.Example:
def controller = api.newController() controller.addHTML("<h2>Welcome to Pricefx</h2>")
- Parameters:
html
- The html snippet.- Since:
- 11.1 - Paper Plane
-
addCollapsibleHTML
Adds an HTML snippet into the controller as a collapsible section.Example:
def controller = api.newController() controller.addHTML(false, "section 1", "<h2>Welcome to Pricefx</h2>")
- Parameters:
isCollapsed
- boolean flag indicating initial state collapsed if isCollapsible == truesectionLabel
- label of the collapsible sectionhtml
- The html snippet- Since:
- 11.1 - Paper Plane
-
addDownloadButton
Performs a backend call in the user's context in new window. Useful for downloading Excel, PDF- Parameters:
label
- The label of the buttonurl
- The URL to call
-
addDownloadButton
Performs a backend call in the user's context in new window. Useful for downloading Excel, PDF- Parameters:
label
- The label of the buttonurl
- The URL to callpayload
- The POST data to send along with the request
-