Swiss Magic Data -- Form Relationships: Difference between revisions

From IHRIS Wiki
Line 53: Line 53:
'''Note:''' The functionality of this swiss node should probably be moved to a sub-module of the FormLimits modules
'''Note:''' The functionality of this swiss node should probably be moved to a sub-module of the FormLimits modules


==I2CE_Swiss_FormRelationship_ReportingFunctions==   
==I2CE_Swiss_FormRelationship_ReportingFunctions==
This swiss node is a container for all of the SQL functions that are defined for the form relationship. It has the following functionality:
*display the existing sql functions in the relationship
*adds in a place for a new sql function determined by "Short Name," a "Display Name" and a "Description"
 
All children of this node have type [[#I2CE_Swiss_FormRelationship_ReportingFunctions|FormRelationship_ReportingFunctions]].
 
'''Note:''' This functionality should probably be moved to be a sub-module of Forms.
 
==I2CE_Swiss_SQLFunction.php==
==I2CE_Swiss_SQLFunction.php==



Revision as of 13:27, 4 September 2009

In this article we describe how swiss magic is used to create the web interface to define form relationships. Recall that a swiss node of type XXX is implemented by the class I2CE_Swiss_XXX. All the classes mentioned are contained in the

I2CE/modules/Forms/modules/FormRelationships/lib

directory.


Form Relationship Base

This is the base class which is sub-classed by all of the Swiss classes used to edit form Relationships.

Form Relationships

The root swiss node of a the form relationship editor has type FormRelationships. It has the following functionality:

  • It is a container node which contains all of the form relationships.
  • Creates a new form relationship with a given "Display Name" and "Short Name" by creating a new child magic data node. The new relationship can be based on:
    • Choosing a primary form
    • Choosing an existing relationship to copy from.

All children of this swiss node have type FormRelationship.

I2CE_Swiss_FormRelationship

This is the swiss node that contains all the information about a particular form relationship.

The child swiss nodes are named:

I2CE_Swiss_FormRelationship_Joins

This is the swiss node that contains all information about forms joined to the form of the parent swiss node. It has the functionality:

  • Join in a form related the the form defined by parent swiss node

All children of this swiss node have type FormRelationship_Join.

I2CE_Swiss_FormRelationship_Join

This is the swiss node that represents a form joined into the form relationship.

It subclasses #I2CE_Swiss_FormRelationship and has almost the same functionality and children. The difference is that:

  • It defines how this form is joined to the parent form in the relationship (the primary form does not need this as it has no parent)
  • It allows you to "drop empty rows."
    Note: The language should be cleaned up here as we use form relationships outside of the Custom Reporting scenario. It means that a set of forms potentially satisfying a form relationship is will fail to satisfy the relationship if there is no form matching the where clause at this node.

I2CE_Swiss_FormRelationship_Where

This provides a where (sub)-clause for a form relationship. It has the following functionality:

  • specify the type of the node as either a logical operator (AND, OR, NOT, XOR) or as a limit on a field in the form

There is one child swiss node 'operands' which has type Swiss_FormRelationship_Where_Operand

Note: The functionality of this swiss node should probably be moved to a sub-module of the FormLimits modules

I2CE_Swiss_FormRelationship_Where_Operands

This node is used in the case where the parent swiss node is one of the logical operators AND, OR, NOT or XOR. It has the following functionality:

  • Add the operands for the logical operators

All children of this node are of type Swiss_FormRelationship_Where Note: The functionality of this swiss node should probably be moved to a sub-module of the FormLimits modules

I2CE_Swiss_FormRelationship_ReportingFunctions

This swiss node is a container for all of the SQL functions that are defined for the form relationship. It has the following functionality:

  • display the existing sql functions in the relationship
  • adds in a place for a new sql function determined by "Short Name," a "Display Name" and a "Description"

All children of this node have type FormRelationship_ReportingFunctions.

Note: This functionality should probably be moved to be a sub-module of Forms.

I2CE_Swiss_SQLFunction.php