Midgard Execution Phases

From OpenPSA Wiki

Jump to: navigation, search

Midgard processes code in different steps. Here's an overview (which may not be entirely accurate):

Contents

[edit] URL Handling

Midgard takes the request URL from the Apache server and maps it to Hosts and Pages

[edit] Caching

all requested elements are gathered and written into the cache directory for performance reasons

[edit] Page-Style Phase

Next, the Page Elements code-compat, code-global and code-init are called, then the ROOT Page Element. If it is not present, the ROOT Element of the parent Page is called. Root Pages must have ROOT elements in order to be able to display any content.

From the ROOT Page Element or one of it's children, there is a reference to the associated style which is executed starting at the ROOT Style Element or the ROOT element of a parent Style. Root Styles must have a ROOT Element to function.

[edit] Content Output Phase

The Content Output Phase is entered when a reference to the content (usually in the form <(content)>) is found in one of the Style's elements.


[edit] MidCOM Content Output Phase

If the current Topic is associated with a MidCOM Component, it is loaded at this point and will try to execute the request. The MidCOM Style Engine can load further Style Elements with midcom_show_style.

[edit] style-init

At the start of the phase the Style Element style-init is executed (on MidCOM-based Hosts). When content from another Topic (which has to be associated with a Component) is loaded with the MidCOM Method dynamic_load, this Topic's style-init element is also executed.

After that, the Topic's Component will try to process the request and return it's results.

[edit] style-finish

After the Content Output Phase, the Style Element style-finish is executed (on MidCOM-based Hosts). When content from another Topic is loaded with the MidCOM Method dynamic_load, this Topic's style-finish element is also executed.

[edit] Page-Style Phase

Then, the rest of the Style and Page Elements referenced in the apllicable Root Style and the Root Page are executed, and after the Page execution, the special Page Element code-finish is parsed.


[edit] Weblinks

http://www.midgard-project.org/documentation/concepts-midcom-specs-architecture-flow/

Personal tools