Swiss Magic Data Editor

From IHRIS Wiki

The Swiss Magic Data Editor is a set of php classes to hierarchically edit and view the configuration magic data.

Features

  • Provides different ways of traversing the configuration magic data hierarchy via different factories
  • Lots of AJAX goodness built in to display sub-menus within the current menu
  • Used in the "Form Relationship" builder and the "Custom Reporting" tool
  • Used in the "Configure Modules" tool
  • Processing and Displaying of data is already localized. You only need to call "renameInputs()" to rename any of your html form elements.

The Swiss Class

The I2CE_Swiss class is the base class used to

The Swiss Factories

The Swiss Factory handles:

  • determines the root swiss node
  • provides the appropriate magic data node associated to a swiss node
  • creates the appropriate child swiss nodes
  • traverses the swiss nodes when given a path
  • pre-process GET/POST variables and passes them to the appropriate swiss node.
  • handles errors in updating values based on GET/POST values.
  • implements the Iterator and Count Interface

There are two factories available Swiss Magic and Swiss Config. These have corresponding I2CE_Page sub-classes to access the web interface.

Swiss Magic Factory

This is is the swiss factory do create dynamic content in I2CE. This includes:

  • Custom Form Relationships
  • Custom Reports
  • Custom Report Views

Parent and Children

Any (non-scalar) magic data node can serve as the root swiss node.

The children of a swiss node are in one to one correspondence with the child nodes of the corresponding magic data node. The names of the child swiss nodes are the same as the names of the child magic data nodes.

=Page Access

This factory can be accessed in the web interface as in instance of the I2CE_Page_SwissMagic class.

Swiss Config Factory

This is the Swiss Factory designed for the configure modules tool.

Parent And Children

In this factory the child swiss nodes of a given swiss class are defined by a module configuration XML#Defining Magic Data in Configuration Files file. The root parent swiss node is the main <configurationGroup> in the configuration XML file.

The child swiss nodes associated to a given <configurationGroup> are exactly the child <configuration>s and <configurationGroup>s on that node. The names of the child swiss nodes are the names of the child <configuration> and <configurationGroup> nodes.

The magic data node associated to a swiss node is the exactly the magic data node associated to the given <configuration> or <configurationGroup> node as defined by the path and name attributes.

Page Access

For the "Configure Modules" page, each module instantiates the a swiss factory by the an instance of the I2CE_Page_SwissConfig class.