Tuesday, July 1, 2008

Generic Render Sequence (1)

XOOPS Cube 1.0 implements the Generic Render-Sequence, that's one of major features that we should check.

We already know Ungeneric Render-Sequence. That's a Render-Sequence of Legacy. A rendering process of Legacy has the same step as XOOPS2 and is the following steps:

(1) Renders blocks before a module execution.
(2) Renders a module after a module execution.
(3) Renders a theme as final output after a module rendering.

The Generic Render-Sequence of XOOPS Cube core 1.0 makes those steps general-purpose.

The Render-Sequence of XOOPS Cube core 1.0 is executed after all business logics. And, the sequence doesn't know type of content units --- modules and blocks, because the sequence has to accept the core feature that the core can exchange BASE with other BASE.

A type of contents --- themes, modules and blocks is not important for the Generic Render-Sequence. The important things are order of rendering and that later rendering process may access previouse rendering result or other Render-Target.



In the Ungeneric Render-Sequence of Legacy, the logic to render theme is executed at final step. But, in Generic Render-Sequence, even if CMS's task requests theme rendering at first step, the sequence can render it at final step.

In other words, order of drawing can be different from order of business logic.



Let's check the mechanism. Read a certain PDF document.

Normally, we should use the Generic Render-Sequence with task system that is also a generic main sequencal process mechanism. Because a ungeneric main sequence has a ungeneric render sequence (examples: Legacy and XOOPS2).

The main sequence of XCube_Root collects Render-Operation from each task. A Render-Operation has a name of using Render-System, sequence ID and so on. The sequence ID is number of rendering to be rendered by correct order.

Render-Operation are collected in random order (out-order). In most cases, a first task is a CMS's task, so perhaos a theme rendering is requested firstly.




If the core does nothing for the collected operations, some modules and blocks are rendered after the theme rendering. Such a order is strange.

For that, the XOOPS Cube core sorts the collected operations to execute render-sequence in order.



Sorting corrects order. The condition made by sort is a kind of command queue. The Generic-Render Sequence of the core renders by fetching a operations from the queue. If BASE uses the Generic Render-System, it can entrust handling Render-System and Render-Target to the core.

When the last operation is finished, final output is completed. You check it with sample programs of XCube_PHP4 minahito branch.

BTW, this entry is the another version of Diff between XC and XCL(X2): Render Sequence.

1 comment:

Gigamaster said...

I have tested Dreamweaver, Rapidware, XCL+Pico+FCKEditor but did not blog about it. No free time.
Also i would like to test cubelet (pseudo postload). May it is possible to create an User Interface (nodes in mind) to associate block=id to content=id.