Webman-framework

Lightweight, Component-based, and Database-oriented Web Application Framework

About | Overview | Documentation

 

Documentation > Modules and APIs > webman_component_selector

webman_component_selector

 

Description:

Component-type module that acts as sub-controller inside framework's main-controller (webman_main) to provide dynamic selection logic of other component-type modules through the message passed using special CGI parameter commonly named as task. It's possible for the sub-controller to have the selection logic point back to the sub-controller itself (recursive module calls). This type of sub-controller implementations give the framework some degree of flexibilities to construct more complex component selection logic structure besides the basic logical structure provided by the application main link structure.

 

Dependencies:

Webman-framework's Component-type Modules:

  • CGI_Component::webman_CGI_component (Inheritance)
  • webman_component_selector (Recursive Composition)
  • All other available component-type modules (Composition)

 

1. Component Selection Logic Example

Below is an example of how webman_component_selector module is used to arrange other component-type modules selection logic under the link-node "Course" using framework's web-based development support tool.


 
2. View Template

The template simply contains DYNAMIC_CONTENT template-element named default. It becomes a place-holder for view content generated by other component-type modules which are under the control of component selection logic imposed by webman_component_selector module.

  1 <html>                                  
  2 <body>                                  
  3 <!-- start_view_ //-->                  
  4 <!-- dynamic_content_ name=default //-->
  5 <!-- end_view_ //-->                    
  6 </body>                                 
  7 </html>