[[PageOutline]] = Model-Glue XML Reference = All Model-Glue applications are configured via at least one XML file that follows the "Model-Glue" XML format described in this document. ---- == == Part of a typed event. See [wiki:HowTos/HowToUseTypedEvents How To Use Typed Events] for more information. === Attributes === None === Child Tags === 1. 1. 1. ---- == == A 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. ==== Attributes ==== 1. Name (Required) - Defines the name of the argument. 1. Value (Required) - Defines the value of this argument. ==== Child Tags ==== None ---- == == Part of a typed event. See [wiki:HowTos/HowToUseTypedEvents How To Use Typed Events] for more information. === Attributes === None === Child Tags === 1. 1. 1. ---- == == Contains a list of tags. The tags ''will be broadcast in the order in which they are defined.'' ==== Attributes ==== None ==== Child Tags ==== 1. ---- == == Used in Model-Glue XML fragments to define additional settings and by legacy Model-Glue 1.x applications to define settings. ''This tag was largely unused in Model-Glue 2, but may be used in Model-Glue 3 to define actionpacks.'' ==== Attributes ==== None ==== Child Tags ==== 1. ---- == == Defines a CFC that will act as a Controller in the application. ==== Attributes ==== 1. ID (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. 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" 1. Beans (Optional) - A bean (or comma delimited list, if more than one) as defined in !ColdSpring.xml, that will be accessible to any cffunction in the controller. Replaces the need for getModelGlue().getBean() within controller methods. See [wiki:HowTos/HowToUseBeanInjection How To Use Bean Injection] for more information. ==== Child Tags ==== 1. ---- == == Contains a list of tags. ==== Attributes ==== None ==== Child Tags ==== 1. ---- == == Defines an event or "page" in the application. ==== Attributes ==== 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 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]] 1. Access (Optional, defaults to "public") - If set to "private," the event handler cannot be accessed directly through the URL. 1. Type (Optional) - Set to an event-type to be run before and/or after the event, depending on how the event-type is set up. See event-type and [wiki:HowTos/HowToUseTypedEvents How To Use Typed Events] for more information. ==== Child Tags ==== 1. 1. 1. ---- == == Contains a list of child tags that define the events in the application. ==== Attributes ==== 1. !DefaultType (Optional) - Set to a default event-type to be applied to all event-handler child tags that do not have a TYPE attribute defined. See [wiki:HowTos/HowToUseTypedEvents How To Use Typed Events] for more information. ==== Child Tags ==== 1. 1. ---- == == Defines a custom event type. Makes applying configuration selectively to specific events quite easy. See [wiki:HowTos/HowToUseTypedEvents How To Use Typed Events] for more information. === Attributes === 1. Name (Required) - A unique name for the event type. === Child Tags === 1. 1. ---- == == Defines a collection of event types. See [wiki:HowTos/HowToUseTypedEvents How To Use Typed Events] for more information. === Attributes === None === Child Tags === 1. ---- == (child tag of ) == Defines a path to another Model-Glue XML file to include. Useful for breaking up large Model-Glue XML files into multiple fragments. ==== Attributes ==== 1. Template (Required) - The path to the file to include. !ColdFusion will use expandPath() to turn this into an absolute path to a file. ==== Child Tags ==== None ---- == (child tag of ) == Defines a .CFM template to , creating HTML that will be viewable by the user. Model-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. ==== Attributes ==== 1. Name (Required) - The name by which the rendered content will be known in the !ViewCollection 1. Template (Required) - The filename of a .CFM template inside one of the directories in the !ViewMappings setting 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.) ==== Child Tags ==== 1. ---- == == Defines a message to be broadcast during the execution on an event handler. ''Messages are broadcast in the order in which they are defined.'' ==== Attributes ==== 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. ==== Child Tags ==== 1. ---- == == Relates a inside of a Controller CFC to a message that is broadcast via a tag inside of an 's block. ==== Attributes ==== 1. Message (Required) - The name of a message for which to listen, defined by the tag's NAME attribute. 1. Function (Optional) - The name of a public on the related Controller CFC to execute whenever a is broadcast whose NAME attribute matches the value of the MESSAGE attribute. If no value is provided for Function, the name of the message will be used as Function. ==== Child Tags ==== None ---- == == Declares the root of a Model-Glue XML file. ==== Attributes ==== ==== Child Tags ==== 1. 1. 1. 1. 1. 1. 1. ''(Model-Glue 3.0+ only)'' ---- == == Introduces a set of external definitions into the current Model-Glue XML file. This tag works similarly to the tag, except that all tags are processed before tags. This tag is intended for the loading of actionpacks in Model-Glue 3. ==== Attributes ==== 1. Type (Optional) - The type of module to load. Currently the only supported type is "XML". 1. Location (Required for XML modules) - The path to the XML file to include. ==== Child Tags ==== None ---- == == Defines 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. ==== Attributes ==== 1. Do (Required) - The NAME attribute of an event handler to add to this request. 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. 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. 1. Append (Optional, default = "") - Used to define a list of value names (from the Event object) 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]] 1. !PreserveState (Optional, default = "true") - If set to false and REDIRECT is set to true, then all state values will removed before redirecting to the event handler declared in the DO attribute. If using this be sure that session management is enabled. 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.'' ==== Child Tags ==== None ---- == == Contains a list of tags. ==== Attributes ==== None ==== Child Tags ==== 1. ---- == == Automatically 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. ''In Model-Glue 2, only tags that are children of the tag are processed. In Model-Glue 3, all tags are processed regardless of where they appear in the XML file.'' ==== Attributes ==== 1. Object (Required) - The name of the database table to scaffold 1. Type (Optional, defaults to "list,view,edit,commit,delete") - What types of event-handlers to create 1. Propertylist (optional) - Comma separated list of object properties to use in scaffolds. 1. Event-Type (optional) - Comma separated list of event-types to add to the resulting event-handler tags. ==== Child Tags ==== 1. 1. 1. ---- == == Used in Model-Glue XML fragments to define additional settings and by legacy Model-Glue 1.x applications to define settings. ''This tag was largely unused in Model-Glue 2, but may be used in Model-Glue 3 to define actionpacks.'' ==== Special Behavior ==== A setting tag with a NAME attribute value of "viewMappings" will append its value to the list of existing viewMappings. A setting tag with a NAME attribute value of "helperMappings" will append its value to the list of existing helperMappings. A 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. All other settings are simply set. ==== Attributes ==== 1. Name (Required) - The name of the setting to set 1. Value (Required) - The value of the setting ==== Child Tags ==== None ---- == == A string value to set into the Event object before the .CFM template in the current include is rendered. Its value may be accessed through the Event object in the View API. ==== Attributes ==== 1. Name (Required) - Defines the name of the argument. 1. Value (Required) - Defines the value of this argument. 1. Overwrite (Optional, default = "false") - If set to true, this value will overwrite an existing same-named value in the Event object. ==== Child Tags ==== None ---- == == Defines a .CFM template to , creating HTML that will be viewable by the user. This tag is synonymous with . See (child tag of ) for more information. ---- == == Contains a list of tags. The tags ''will be run in the order in which they are defined.'' ==== Attributes ==== None ==== Child Tags ==== 1.