Changes between Initial Version and Version 1 of ReferenceMaterials/ModelGlueXmlReference

Show
Ignore:
Timestamp:
04/15/09 19:43:31 (17 years ago)
Author:
trac (IP: 127.0.0.1)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ReferenceMaterials/ModelGlueXmlReference

    v1 v1  
     1[[PageOutline]] 
     2 
     3= Model-Glue XML Reference = 
     4 
     5All Model-Glue applications are configured via at least one XML file that follows the "Model-Glue" XML format described in this document. 
     6 
     7== <argument> == 
     8 
     9A string value passed to a function registered to listen for a given message as part of the function's Event argument. Its value can be acessed through the Event API's getArgument() method. 
     10 
     11==== Attributes ==== 
     12 
     13  1. Name (Required) - Defines the name of the argument. 
     14  1. Value (Required) - Defines the value of this argument. 
     15 
     16==== Child Tags ==== 
     17 
     18None 
     19 
     20== <broadcasts> == 
     21 
     22Contains a list of <message> tags. The <message> tags ''will be broadcast in the order in which they are defined.'' 
     23 
     24==== Attributes ==== 
     25 
     26None 
     27 
     28==== Child Tags ==== 
     29 
     30  1. <message> 
     31 
     32== <config> == 
     33 
     34Used in Model-Glue XML fragments to define additional settings and by legacy Model-Glue 1.x applications to define settings. 
     35 
     36''This tag is largely unused in Model-Glue 2.0+! '' 
     37 
     38==== Attributes ==== 
     39 
     40None 
     41 
     42==== Child Tags ==== 
     43 
     44  1. <setting> 
     45 
     46== <controller> == 
     47 
     48Defines a CFC that will act as a Controller in the application. 
     49 
     50==== Attributes ==== 
     51 
     52  1. Name (Required) - A unique name for this controller. A Model-Glue application where multiple controllers are added with the same name will currently confuse the framework (as of 2.0 Beta 1). This will eventually be resolved. 
     53  1. Type (Required) - The CFC to use for a controller in the same format that you'd use in a !CreateObject() call, such as "myapplication.controller.!MyController" 
     54 
     55==== Child Tags ==== 
     56 
     57None 
     58 
     59== <controllers> == 
     60 
     61Contains a list of <controller> tags. 
     62 
     63==== Attributes ==== 
     64 
     65None 
     66 
     67==== Child Tags ==== 
     68 
     69  1. <controller> 
     70 
     71== <event-handler> == 
     72 
     73Defines an event or "page" in the application. 
     74 
     75==== Attributes ==== 
     76 
     77  1. Name (Required) - A unique name for the event handler. This defines how the event will be accessed through the URL, such as "index.cfm?event=!MyEvent". [[BR]][[BR]]''If an <event-handler> is added whose NAME attribute is in use by another event-handler, it will overwrite the previous event-handler, except in the case of the predefined modelglue.onRequestStart, modelglue.onQueueComplete, and modelglue.onRequestEnd event-handlers. In this case, any messages, views, or results defined will be added to the predefined event handlers.''[[BR]][[BR]] 
     78  1. Access (Optional, defaults to "public") - If set to "private," the event handler cannot be accessed directly through the URL. 
     79 
     80==== Child Tags ==== 
     81 
     82  1. <broadcasts> 
     83  1. <results> 
     84  1. <views> 
     85 
     86== <event-handlers> == 
     87 
     88Contains a list of child tags that define the events in the application. 
     89 
     90==== Attributes ==== 
     91 
     92None 
     93 
     94==== Child Tags ==== 
     95 
     96  1. <event-handler> 
     97  1. <scaffold> 
     98 
     99== <include> (child tag of <modelglue>) == 
     100 
     101Defines a path to another Model-Glue XML file to include. 
     102 
     103Useful for breaking up large Model-Glue XML files into multiple fragments. 
     104 
     105==== Attributes ==== 
     106 
     107  1. Template (Required) - The path to the file to include. !ColdFusion will use expandPath() to turn this into an absolute path to a file. 
     108 
     109==== Child Tags ==== 
     110 
     111None 
     112 
     113== <include> (child tag of <views>) == 
     114 
     115Defines a .CFM template to <cfinclude>, creating HTML that will be viewable by the user. 
     116 
     117Model-Glue will search the mappings listed in the !ViewMappings setting (defined in the application's !ColdSpring.xml file) in order, searching for the template defined in the TEMPLATE attribute. 
     118 
     119==== Attributes ==== 
     120 
     121  1. Name (Required) - The name by which the rendered content will be known in the !ViewCollection 
     122  1. Template (Required) - The filename of a .CFM template inside one of the directories in the !ViewMappings setting 
     123  1. Append (Optional, default = "false") - If an include by this NAME has already been rendered, should the content from this include be appended to the existing content or should it overwrite the existing content? (False will overwrite, True will append.) 
     124 
     125==== Child Tags ==== 
     126 
     127  1. <value> 
     128 
     129== <message> == 
     130 
     131Defines a message to be broadcast during the execution on an event handler. ''Messages are broadcast in the order in which they are defined.'' 
     132 
     133==== Attributes ==== 
     134 
     135  1. Name (Required) - The name of the message. The same message may be broadcast multiple times during a single event handler, with or without different sets of arguments. Any message-listener tags whose MESSAGE attribute value matches the value of attribute will execute the function registered via their FUNCTION attribute. 
     136 
     137==== Child Tags ==== 
     138 
     139  1. <argument> 
     140 
     141== <message-listener> == 
     142 
     143Relates a <cffunction> inside of a Controller CFC to a message that is broadcast via a <message> tag inside of an <event-handler>'s <broadcasts> block. 
     144 
     145==== Attributes ==== 
     146 
     147  1. Message (Required) - The name of a message for which to listen, defined by the <message> tag's NAME attribute. 
     148  1. Function (Required) - The name of a public <cffunction> on the related Controller CFC to execute whenever a <message> is broadcast whose NAME attribute matches the value of the MESSAGE attribute 
     149 
     150==== Child Tags ==== 
     151 
     152None 
     153 
     154== <modelglue> == 
     155 
     156Declares the root of a Model-Glue XML file. 
     157 
     158==== Attributes ==== 
     159 
     160==== Child Tags ==== 
     161 
     162  1. <controllers> 
     163  1. <event-handlers> 
     164  1. <include> 
     165  1. <config> 
     166 
     167== <result> == 
     168 
     169Defines an additional event-handler to execute as part of the current request.  Can use the NAME attribute to determine whether or not a certain result should be executed, and the REDIRECT attribute to abort the current request and redirect to a different event handler. 
     170 
     171Model-Glue will search the mappings listed in the !ViewMappings setting (defined in the application's !ColdSpring.xml file) in order, searching for the template defined in the TEMPLATE attribute. 
     172 
     173==== Attributes ==== 
     174 
     175  1. Do (Required) - The NAME attribute of an event handler to add to this request. 
     176  1. Name (Optional) - If not set ''or set to an empty string'', the event handler declared in the DO attribute will always be added to the request.  If not empty, the event handler declared will only execute if a function in a Controller CFC uses the addResult() method of the Event API to add a result with the value of the NAME attribute. 
     177  1. Redirect (Optional, default = "false") - If true, a redirect will immediately redirect the entire request to the event handler declared in the DO attribute.  All state value will be maintained if session is enabled. 
     178  1. Append (Optional, default = "") -  Used to define a list of value names (from the viewstate) that should be appended to the URL.  [[BR]][[BR]] Example:  If APPEND is set to articleId and DO is set to article, the redirect URL would be index.cfm?event=article&articleId=[value of articleId].[[BR]][[BR]]''Advanced, rarely used attributes:''[[BR]][[BR]] 
     179  1. !PreserveState (Optional, default = "true") - If set to false and REDIRECT is set to true, the all state values will removed before redirecting to the event handler declared in the DO attribute 
     180  1. Reset (Optional, default = "false") - If set to true, any previously declared results of the same name will be erased.  ''This is only useful for redefining results added by scaffolds.'' 
     181 
     182==== Child Tags ==== 
     183 
     184None 
     185 
     186== <results> == 
     187 
     188Contains a list of <result> tags. 
     189 
     190==== Attributes ==== 
     191 
     192None 
     193 
     194==== Child Tags ==== 
     195 
     196  1. <result> 
     197 
     198== <scaffold> == 
     199 
     200Automatically defines and creates user interface for listing and editing data from a database table. By default, creates ''object''.list, ''object''.view, ''object''.edit, ''object''.commit, and ''object''.delete event-handlers, where ''object'' is the value of the OBJECT attribute. This list of event-handlers to create is controlled by the TYPE attribute. 
     201 
     202==== Attributes ==== 
     203 
     204  1. Object (Required) - The name of the database table to scaffold 
     205  1. Type (Optional, defaults to "list,view,edit,commit,delete") - What types of event-handlers to create 
     206 
     207==== Child Tags ==== 
     208 
     209  1. <broadcasts> 
     210  1. <results> 
     211  1. <views> 
     212 
     213== <setting> == 
     214 
     215Used in Model-Glue XML fragments to define additional settings and by legacy Model-Glue 1.x applications to define settings. 
     216 
     217This tag is largely unused in Model-Glue 2.0+! 
     218 
     219==== Special Behavior ==== 
     220 
     221A setting tag with a NAME attribute value of "viewMappings" will append its value to the list of existing viewMappings. 
     222 
     223A setting tag with a NAME attribute value of "beanMappings" will (!ColdSpring) load the file defined into the !BeanFactory or (!ChiliBeans) append its value to the list of existing beanMappings. 
     224 
     225All other settings are simply set. 
     226 
     227==== Attributes ==== 
     228 
     229  1. Name (Required) - The name of the setting to set 
     230  1. Value (Required) - The value of the setting 
     231 
     232==== Child Tags ==== 
     233 
     234None 
     235 
     236== <value> == 
     237 
     238A string value to set into the !ViewState before the .CFM template in the current include is rendered. Its value may be accessed through the !ViewState object in the View API. 
     239 
     240==== Attributes ==== 
     241 
     242  1. Name (Required) - Defines the name of the argument. 
     243  1. Value (Required) - Defines the value of this argument. 
     244  1. Overwrite (Optional, default = "true") - If set to true, this value will overwrite an existing same-named value in the !ViewState. 
     245 
     246==== Child Tags ==== 
     247 
     248None 
     249 
     250== <views> == 
     251 
     252Contains a list of <include> tags. The <include> tags ''will be run in the order in which they are defined.'' 
     253 
     254==== Attributes ==== 
     255 
     256None 
     257 
     258==== Child Tags ==== 
     259 
     260  1. <include>