Figure 1 shows how a table pagination
request is handled.
Figure 1. How a table pagination request
is handled
The following steps are involved in the handling of a table pagination
request:
- Table page sends a pagination request to the server side via the
AJAX channel.
- beforeExecuteBizOp(): This step is used for
customer extension. It is designed to perform logic before calling
the business operation; the logic is implemented on the project-level.
For example, it retrieves required parameters from the received data
and enters the parameters into the processor context.
- initBizOp(): This is a private method, and
it initializes the business operation instance and related resources.
For example, it creates the business operation object and chains its
context to the parent context, and register an event listener for
the business operation.
handleBizOpInputMapping(): This step used
for customer extension. The developer who creates a new pagination
operation can extend this method to add data mapping from the parent/processor
context to the business operation context.
After this, the handleBizOpInputMapping() method
uses the user-defined input data mapper, which is defined in the XUI
tooling, to map data from the process context to the business operation
context. An input mapper is a mapper that defines how processor context
data is mapped into business operation context data so that the business
operation can retrieve information for execution later.
There
are four types of input mappers:
- initialInputMapping
- Is used when the table is shown on first loading.
- nextInputMapping
- Is used when the total table record number is unknown, and the
next page event is fired.
- previousInputMapping
- Is used when the total table record number is unknown, and the
previous page event is fired
- directInputMapping
- Is used when the total table record number is known, and a new
page data request is fired.
- Invokes the business operation to retrieve the real data. When
execution is completed, the business operation fires an event.
- Based on each event, it uses different output mappers to map the
business context data into processor context. Candidate values are
“error” and “ok”. “error”: it will use the errorOutputMapping; “ok":
it will use the normalOutputMapping.
- handleBizOpOutputMapping(): This step is used
for customer extension. The developer who creates a new pagination
operation can extend the handleBizOpOutputMapping() method
to add data mapping from the business operation context to parent/processor
context.
- afterExecuteBizOp(): This step is used for
customer extension. It is designed to perform logic after business
operation execution. The logic is implemented at the project level;
for example, entering the necessary data into the pagination operation
context
- updateReplyData(): This is an internal method
that organizes the formatted business data as structured data for
table page usage.