Tiered Events with Model-Glue

January 29, 2006

http://www.web-relevant.com/mg_tutorial


Model-Glue FAQ

January 29, 2006

General:

Which view in the view stack is displayed to the user?
Only the last view rendered is the one that is shown to the user.

Where are the HTML form and URL variables stored?
All HTML form and URL variables are stored in the ModelGlue.Core.Event object.

What is the order of firing events?
explicit results (those with a name attribute) will fire before implicit results (those without a name attribute).

Controller:

How to send data to a view?
To send data (including complex data types) to a view, use arguments.event.setValue("name", value)

How to access configuration settings in ModelGlue.xml?
To access the configuration settings in ModelGlue.xml (what’s between and ), use GetModelGlue().getConfigSetting("settingName")

How to invoke a mapped event?
To map a result to an event and invoke the event use arguments.event.addResult("eventName")

How to get a reference to a config bean?
Use

then use appConfig.getSettingName() to fetch the setting value.

How to access message arguments?
Use arguments.event.getArgument("name")

ModelGlue.xml:

How to send data to a view?
To send data to a view use the tag inside the tag like this:

You can specify whether or not to overwrite the value if it exists by adding the attribute overwrite=”true” or overwrite=”false” to the tag.

How to append to an existing view?
If we give an include tag a non-unique name, but add ‘append=”true”‘ to its attributes, it’ll add to the existing view’s content.

If ‘append=”true”‘ is not present, it’ll overwrite the existing view.

Can I have more than one controller declaration in ModelGlue.xml?
Yes, you can have multiple controller declarations, but each has to have a unique controller name.

Can multiple controllers listen to the same message?
Yes, multiple controllers can listen to the same message; In fact, they can listen more than once if they like. This is valid:

Should I declare a message-listener for every function in my controller?
No. Declare message listeners only for those functions that need to respond to messages.

Should the name of a message be the same as the name of the corresponding function in the controller?
No, they can be different. Both of the following are legitimate:


Are there any special messages built in into the framework?
In ModelGlue.xml, you can map the following special messages to functions in your controller:

onRequestStart: Put here any code that you need to execute at the start of each request.
onRequestEnd: Put here any code that you need to execute at the end of each request.
onQueueComplete: Put here any code that you need to execute after all views have been added to the queue and before they are rendered.

In case of multiple controller declarations, is the execution order of the OnRequestStart message listeners guaranteed ?
No, there is no guarantee of execution order.

Can I add arguments to my messages?
Yes, you can add an argument to a message like this:


You can then read the argument in the corresponding function in your controller like this: arguments.event.getArgument("name")

Views:

How to send data to the view or views that are rendered after the current one in the stack?
UseviewState.setValue("name","value")

How to read data sent from a controller, ModelGlue.xml or a previous view in the stack?
Use viewState.getValue("name", "default value")

How to check the existence of a view in the view stack?
Use viewCollection.Exists("viewName")

How to display the content of a previously defined view?
Use viewCollection.getView("viewName")

via:http://awads.net/wp/2005/06/24/model-glue-faq/


Open Source Project: DBDesigner

January 26, 2006

dbdesigner4 

DBDesigner 4 is a visual database design system that integrates database design, modeling, creation and maintenance into a single, seamless environment.

It combines professional features and a clear and simple user interface to offer the most efficient way to handle your databases.

DBDesigner 4 compares to products like Oracle’s Designer©, IBM’s Rational Rose©, Computer Associates’s ERwin© and theKompany’s DataArchitect© but is an Open Source Project available for Microsoft Windows© 2k/XP and Linux KDE/Gnome. It is release on the GPL.

DBDesigner 4 is developed and optimized for the open source MySQL-Database to support MySQL users with a powerful and free available design tool.

All MySQL specific features have been built in to offer the most convenient way to design and keep control of your MySQL-Databases.


ColdFusion中的设计模式

January 25, 2006

CFDJBrendan O’Hara写了一系列关于ColdFusion设计模式的文章,很值得拜读,收藏起来以后慢慢看。


ColdFusionMX 下 Mach-II 和 Fusebox 的比较

January 25, 2006

ColdFusion MX 开发社区正在逐渐成熟。大多数 CF 开发人员过去写的代码都像意大利面条一样乱七八糟,而且业务逻辑和表示代码都混在一起。但是要重新编写以前编写的每一个应用程序是一件难事,而且也很浪费时间。

框架(Framework)可以推动好的开发实践和标准,并为创建应用程序提供较好的基础。在 ColdFusion 的世界,有两个框架比较突出:这两个框架分别是 Fusebox 和 Mach-II。在这篇文章中,我将谈一谈这两个免费的框架,并对其进行一个比较,然后给出一些建议,以帮助你决定采用哪个框架(或者两个框架都用)。 Read the rest of this entry »


Open Source CAPTCHA CFC v0.1 Released

January 20, 2006

一个开源的ColdFusion验证码组件,虽然ColdFusion的验证码程序也有几个,比如The Alagad Captcha,cfx_captcha.但要么是商业程序,要么不开源,很高兴现在ColdFusion的开源项目越来越多了。

查看生成验证码后的效果

下载CAPTCHA CFC v0.1


The free CAPTCHA-Service

January 17, 2006

The ColdFusion Podcast

January 15, 2006

www.coldfusionpodcast.com

此站点每隔一段时间推出一段音频文件就近期关于ColdFusion的一些信息进行讨论,目前已出到第10期。

详情访问


ColdFusion Cookbook

January 15, 2006

Raymond Camden创建的站点,目的就是帮助CFer快速解决问题,在这里你可以提交在开发CF中遇到的问题,由专人整理回复后分类列出来,相当于一个FAQ。并且此站点是用Model-Glue开发的。


ColdFusion on Wheels

January 15, 2006

ColdFusion on Wheels

ColdFusion on Wheels是ColdFusion的一个开发框架,它仿照Ruby on Rails提供快速的,基于MVC设计模式的应用程序开发。其发明者是来自Cube6 MediaRob Cameron

官方的视频教程一演示了怎样创建一个简单的应用程序及使用生成器生成controllers和actions,视频教程二演示了什么是routes和配置routes。

从这里可以下载框架程序在线查看帮助文档,获取更多关于ColdFusion on Wheels的信息可以访问Cube6 MediaWeblog

框架原理及流程图:

Application Flow