Abstract Functions

Overview

Websydian Express uses a set of new abstract functions. For each of the functions, the corresponding function in standard Websydian is specified with a link to the documentation for the pattern. When developing for Websydian Express you must use the new abstract functions instead of the old.

In some cases it will be necessary to consult the documentation for the standard Websydian function in order to find out how a Websydian Express pattern is used.

It is possible to make a multiple inheritance from a combination of one or more abstract standard Websydian functions and one or more of the new abstract functions.

PageGenerators

PageGeneratorForProcess

Previous: PageGenerator

This is the basic function, which all PageGenerator functions, which is to be used in the application must inherit from.

This function provides the developer with support for SessionControl, Integrity Control in addition to providing the necessary support for using the facilities of the framework.

Inheriting from PageGeneratorForProcess gives the PageGenerator the ability to use the current active presentation and folder list to find the correct template. Furthermore it makes it possible for the PageGenerator to use the special replacement markers used by Websydian Express.

All PageGeneratorForProcess functions can be used as ParentPageGenerators without any further inheritance being needed.

The function is used by letting all PageGenerator functions inherit from it. It is strongly recommended to let this inheritance happen through an abstract layer, where you can place any modifications, which you want to impact all your PageGenerator functions.

GridPageForProcess

Previous: GridPage

This function is to be used, when you want to show a grid on the page.

Let your own grid page inherit from this function and replace the view UIBasic.Grid with your own view to determine the content of the grid. Replace the function UIBasic.Grid.BlockFetch to specify the function fetching the data for the grid.

The GridPageForProcess function supports a special replacement marker you can insert in your template to determine the number of rows in the grid.

If you insert a replacement marker /(ROWS-nnn) before the grid (nnn must be numeric), the grid will contain the number of rows specified by nnn.

You should use the following format in order to hide the replacement marker when editing HTML templates in an HTML editor.

<!--/(ROWS-10)-->

WebGridPageForProcess

Previous: WebGridPage.

This is an extension to the GridPageForProcess. In addition to the support for showing a grid on the generated page it also supplies a next and a position event handler.

Let your own WebGridPage inherit from this function and replace the view UIBasic.Grid with your own view to determine the content of the grid. Replace the function UIBasic.Grid.BlockFetch to specify the function fetching the data for the grid.

The WebGridPageForProcess function supports a special replacement marker you can insert in your template to determine the number of rows in the grid.

If you insert a replacement marker /(ROWS-nnn) before the grid (nnn must be numeric), the grid will contain the number of rows specified by nnn.

You should use the following format in order to hide the replacement marker when editing HTML templates in an HTML editor.

<!--/(ROWS-10)-->

WebInsertPageForProcess

Previous: WebInsertPage

Inheriting from this abstract function gives you a page suitable for inserting records in the database.

The page contains an insert event.

You must replace the views UIBasic.Insert and UIBasic.Detail with the views used to update and fetch records for the entity you want to be able to insert records into.

The insert event will validate the record according to the rules defined in the Plex model.

WebUpdatePageForProcess

Previous: WebUpdatePage

Inheriting from this abstract function gives you a page suitable for updating records in the database.

The page contains an update event.

You must replace the views UIBasic.Update and UIBasic.Detail with the views used to update and fetch records for the entity you want to be able to update the records for.

The update event will validate the record according to the rules defined in the Plex model.

Abstract.ChildPageGeneratorForProcess

Previous: ChildPageGenerator

Inherit from this function if you want your PageGenerator to be able to be used as a child page. (Please note that all functions inheriting from PageGeneratorForProcess can be used as parent pages without any further inheritance being needed).

Please see here for more information.

In many cases it is a good idea to let a child page inherit from PageGeneratorNoPresentation if your child page is used by several business processes that have more than one presentation, because then you do not have to create new templates for each presentation for the child pages.

Abstract.DynamicChildPageGenerator

Inherit from this function if you want to create child PageGenerator functions that can be included on any page.

For more information please read Create a Dynamic Child Page.

Abstract.HTMLDropDownGeneratorForProcess

Previous: HtmlDropDownGenerator

Inherit from this function if you want to have a drop down box, with dynamically loaded data on you page.

Using this function means that the folder lists also will decide where the templates needed to load the drop down boxes are to be found.

In many cases it is a good idea to let HTMLDropDownGeneratorForProcess inherit from PageGeneratorNoPresentation if the drop down box is used by several business processes that have more than one presentation, because then you do not have to create new templates for each presentation for the drop down boxes.

Abstract.PageGeneratorErrorListForProcess

Previous: PageGeneratorWithErrorList

Inherit from this function if you want an error list on your page when users enter invalid data. This can be used on an Insert page, so instead of showing errors on a separate error page, the Insert page is reloaded with the errors displayed.

Using this function means that the folder lists also will decide where the template used to load the error list are to be found.

ErrorPageForProcess

Previous: ErrorPage

This basic error page is used by the PageGeneratorForProcess function. The ErrorPageForProcess supports the folder list based template identification. This means that your error pages can be customized just like the other pages in a business process.

You should make your own error page, which you then replace on an abstract PageGeneratorForProcess. It is important that this customized error page inherits from ErrorPageForProcess.

PageGeneratorNoPresentation

Inherits from PageGeneratorForProcess but does not use the presentation when searching for the template.

This is useful when using child pages to create list boxes or for default error pages which can be called by many PageGenerator functions, because if you create a new presentation then in many situations you do not want to also create new templates for child pages or error pages as the layout for these are the same across presentations.

ErrorPageNoPresentation

Use this when you need an ErrorPage which does not use a presentation (see PageGeneratorNoPresentation).

EventHandlers

EventHandlerForProcess

Previous: EventHandler

This is the basic function, which all event handlers used in the application must inherit from.

In addition to providing support for using facilities offered by the Websydian Express framework, it also supports session control, integrity control etc.

A significant difference from the standard Websydian EventHandlers is that these events can be registered dynamically by the EventDispatcher. This means that you no longer have to regenerate and build the EventDispatcher each time a new event handler function has been made.

The EventHandlerForProcess can be configured to validate the input from the browser (variable WebInput) based on the definitions in the Plex model. By default the validation is disabled.

To enable the validation insert the following triples:

MyEventHandler option NME WSYAPI/ValidationEnabled
...value SYS Yes

Processes

ProcessEntryPoint

The ProcessEntryPoint is the function, which is called when Websydian Express activates a business process.

The implementation name of the ProcessEntryPoint is used as the process ID for the process.

As the ProcessEntryPoint functions are called dynamically (the call is generated at runtime) the interface needs to be the same for all ProcessEntryPoint functions. This means that the developer is not allowed to add fields to the input or output variable groups for these functions.

For information on how to transfer parameters to a ProcessEntryPoint please look in Process Parameters.

Abstract.FramesetProcess

A frameset process is a process used for defining the structure of the site. When a frameset process is called it splits the page/frame into sub frames based on the HTML template defined for the process.

A frameset process is delivered in the Websydian Express runtime (WSFRMP). Basically you should never have to make your own frameset process; just make a new presentation and template for each new instance of a frameset you want to have in the site structure. Please see here for more information.

Abstract.OneLevelMenuProcess

A menu loader process is used to show and populate a menu based on the definitions in the site structure.

A menu loader process that loads one menu level is delivered as part of the Websydian runtime (WSMNUP). In most cases you will use this process and just define new presentations for the process in order to create new menus. Please see here for more information.

Abstract.MultiLevelMenuProcess

A menu loader process is used to show and populate a menu based on the definitions in the site structure.

A menu loader process that loads menus in up to 3 levels is delivered as part of the Websydian runtime (WSMMNUP). In most cases you will use this process and just define new presentations for the process in order to create new menus. Please see here for more information.

Custom field functions

Never change the parameter interface for a custom field function.

Changing the parameter interface can cause Websydian Express to terminate with a runtime error.

For more information on how to develop a custom field function in Plex please look in Create Custom Field Functions.

CustomFieldFormatValueForInput

This function is used to implement an input conversion function for a custom field.

The function only has one dual parameter which contains the custom field value. When the custom field function is called the parameter will contain the value entered by the user, and the function must then return the converted value in the parameter. The returned value will then be written to the database.

CustomFieldFormatValueForOutput

This function is used to implement an output format function for a custom field.

The function only has one dual parameter which contains the custom field value. When the custom field function is called the parameter will contain the value read from the database, and the function must then return the formatted value in the parameter. The returned value will then be displayed on the web page.

CustomFieldValidateValue

This function is used to implement a validation function for a custom field

The function has one input parameter which contains the custom field value that should be validated.

If the validation of the field value is successful, then the function should set *Returning status to *Successful.

If the validation fails then set *Returning status to any other value than *Successful and return an error message in the output field CustomFieldValidationError. If an error message is not returned, then the Websydian Express runtime will display a default error message to the user.

Functions

Abstract.FunctionShell

This is a standard FunctionShell with a couple of additions. All fields in the local and output variables are set empty during the initialization and the returning status is initialized to Successful (blank). A "Go Sub Terminate" statement has been added in the Execute Post Point.

This function is just made available as a service.

Entities

WebEditDialogForProcess

Previous: WebEditDialog

Inheriting from this entity will add a simple web maintenance suite containing a grid page, an insert page, and an update page.

The insert, update, and delete events all perform validation according to the rules defined in the Plex model.