EbsRouter.parseUrl
(FintechOS Studio 20.1.3 and later)
Extracts the state of a page from a legacy URL.
This function allows you to retrieve the identification information for a page in Single Page Application mode (see EbsRouter for details) based on its legacy (multi-page application) URL.
Syntax
parseUrl(url: string): IRouterState
Return Value
Returns an IRouterState JSON object containing a routeData property with details about the page, for instance:
{routeData: {
entityName: "dataConfigDeploymentPackage"
formName: "default"
menuItemContext: "b32a8a61-86ef-4fd7-b5b2-a7a173824b8c"
type: "insert"
}}
This object can be used as input for the state parameter in functions such as EbsRouter.callRoute or EbsRouter.continueRoute.
Type Aliases
Contains the identification information of a page. The routeData property can take different forms, depending on the type of page (a list, a flow step, a custom form, etc.).
{
routeData: IRouteListState | IRouteFormDrivenState | IRouteCustomActionState | IRouteBusinessTransactionsState | any;
}
| Property | Type | Description |
|---|---|---|
routeData
|
IRouteListState | IRouteFormDrivenState | IRouteCustomActionState | IRouteBusinessTransactionsState | any | JSON object containing information about the page. |
Identification information specific to a list page.
{
type?: string;
mainHtmlId?: string;
entityName: string;
viewName?: string;
menuItemContext?: string;
}
| Property | Type | Description |
|---|---|---|
type (optional) |
string | "list" - Indicates that this is a view page. |
mainHtmlId (optional) |
string | ID of the container HTML element in which the list is shown. This parameter is used only internally in the platform code. |
| entityName | string | Name of the view's source entity. |
viewName (optional) |
string | Name of the view. |
MenuItemContext (optional) |
string | Menu item ID. This parameter is used only internally in the platform code. |
Identification information specific to a form or form driven flow page.
{
formId?: string;
type?: string;
mainHtmlId?: string;
entityName: string;
defaults?: string;
returnHash?: string | any;
formName?: string;
isUserJourney?: boolean;
pageNo?: number|string;
menuItemContext?: string;
}
| Property | Type | Description |
|---|---|---|
formID (optional) |
string | ID of the record (if the form or form driven flow is in edit mode). |
type (optional) |
string |
|
mainHtmlId(optional)
|
string | ID of the container HTML element in which the form is shown. By default, this is ebsContainer. |
entityName
|
string | Name of the form driven flow's source entity. |
defaults(optional)
|
string | Default values for various form fields. Use the following format: attribute1Name:value,attribute2Name:value... |
returnHash (optional) |
string | any | A return URL for when the user completes a certain flow. |
formName (optional) |
string | Name of the form or form driven flow. |
isUserJourney (optional) |
boolean | Indicates is the form driven flow is added as a user journey for an entity. |
pageNo (optional) |
number | string | Name or number of the form or form driven flow's step. NOTE Numbering starts from 0, so the first step is number 0, the second step is number 1, etc. |
menuItemContext (optional) |
string | Menu item ID. This parameter is used only internally in the platform code. |
Identification information specific to a custom form (also known as a custom flow). You can use either the form's unique identifier or name.
{
customActionId?: string;
customActionName?: string;
}
| Property | Type | Description |
|---|---|---|
customActionId (optional) |
string | Custom action unique identifier. |
customActionName (optional) |
string | Custom action name. |
Identification information specific to a record's business workflow transitions list.
{
type: "BW";
formId: string;
entityName: string;
mainHtmlId?: string;
}
| Property | Type | Description |
|---|---|---|
type
|
"BW" | Indicates that the page is a business workflow transitions list. |
formId
|
string | ID of the record. |
entityName
|
string | Name of the entity. |
mainHtmlId (optional) |
string | ID of the container HTML element in which the list is shown. By default, this is ebsContainer. |
Examples
In this example, we generate the page state for a form step:
- We store the page state in the myState variable.
- The base URL of the page is http://myWebsite/myPortal.
- The name of the form's source entity is myEntity.
- The record ID is efed27b8-99ab-4b08-9691-e8e0ea139985.
- The name of the form is default.
- The form is in edit mode.
- The step number is 2 (the third step of the form).
var myState = EbsRouter.parseUrl('http://myWebsite/myPortal/Main#/entity/myEntity/edit/efed27b8-99ab-4b08-9691-e8e0ea139985/form/default/pageNo/2')
The resulting myState variable will have the following value:
{routeData: {
entityName: "myEntity",
formId: "efed27b8-99ab-4b08-9691-e8e0ea139985",
formName: "default",
pageNo: "2",
type: "edit"}
}