public class DashboardController extends Object implements Serializable, ComplexCalculationResult
Modifier and Type | Class and Description |
---|---|
class |
DashboardController.ControllerItem |
static class |
DashboardController.ControllerItemType |
Constructor and Description |
---|
DashboardController() |
Modifier and Type | Method and Description |
---|---|
void |
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 |
addButton(String label,
String targetPage)
Adds a button to the controller
|
void |
addButton(String label,
String targetPage,
Object targetPageState)
Adds a button to the controller
|
void |
addButton(String label,
String targetPage,
Object targetPageState,
Object componentId)
Adds a button to the controller
|
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 |
addHTML(String html)
Adds a HTML snippet into the controller
|
List<DashboardController.ControllerItem> |
getItems() |
String |
getResultType() |
public String getResultType()
getResultType
in interface ComplexCalculationResult
public List<DashboardController.ControllerItem> getItems()
public void addButton(String label, String targetPage)
label
- The label of the buttontargetPage
- The name of the target page. Hint: This is also displayed in the URL after the hash symbol
Sample code:@code def controller = api.newController() controller.addButton("1. STEP: Go to Live Price Grids","priceGridPage")
public void addButton(String label, String targetPage, Object targetPageState)
label
- The label of the buttontargetPage
- The name of the target page. Hint: This is also displayed in the URL after the hash symboltargetPageState
- A extra parameter that is used for deep links. E.g. a typed id to open a specific page
Sample code:@code def controller = api.newController() controller.addButton("2. STEP: Go to LPG ABC","priceGridPage","45.PG")
public void addButton(String label, String targetPage, Object targetPageState, Object componentId)
label
- The label of the buttontargetPage
- The name of the target page. Hint: This is also displayed in the URL after the hash symboltargetPageState
- 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)
Sample code:@code def controller = api.newController() controller.addButton("Open Dashboard","dashboardPage",null,"FirstDash")
public void addBackendCall(String label, String apiUrl)
label
- The label of the buttonapiUrl
- The URL to call
Sample code:@code def controller = api.newController() controller.addBackendCall("Calculate LPG","/pricegridmanager.calculate/45")
public void addBackendCall(String label, String apiUrl, String payload)
label
- The label of the buttonapiUrl
- The URL to callpayload
- The POST data to send along with the requestpublic void addBackendCall(String label, String apiUrl, String payload, String successMessage, String failMessage)
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
Sample code:@code def controller = api.newController() controller.addBackendCall("Calculate LPG","/pricegridmanager.calculate/45",null,"OK","Not OK")
public void addHTML(String html)
html
- The html snippet
Sample code:@code def controller = api.newController() controller.addHTML("Welcome to Price f(x)
")
public void addDownloadButton(String label, String url)
label
- The label of the buttonurl
- The URL to callpublic void addDownloadButton(String label, String url, String payload)
label
- The label of the buttonurl
- The URL to callpayload
- The POST data to send along with the requestCopyright © 2018. All rights reserved.