In the ColdFusion Builder perspective, select RDS Dataview.
The following extensions are automatically installed with ColdFusion Builder if you selected the Install Extensions option when creating a server. For more information, see Adding ColdFusion servers.
The information covered here discusses how to use these extensions. It does not cover information about developing the extensions.
The extension user interface is rendered in the default browser of your computer. If you want to specify the browser as Mozilla, go to the Preferences dialog box and select ColdFusion > Extensions. Then, select Use Mozilla Browser For Extensions.
The Adobe CFC Generator generator generates ORM CFCs (ColdFusion Components) from database tables. The Adobe CFC Generator extension lets you create a traditional CFC or an ORM CFC from a set of tables.
Object Relational Mapping (ORM) is a programming technique that lets you define a mapping strategy to store and retrieve data from a relational database using object models. The Adobe CFC Generator lets you define the mapping for relations, specify join conditions, and generate services for the CFCs. For more information about ORM, see ColdFusion ORM.
The Adobe CFC Generator extension is installed with ColdFusion Builder, if you selected the Install Extension option when creating a server.
If you did not install the extension when creating a server and want to install it now, see Install and uninstall extensions. The Adobe CFC Generator extension archive file (AdobeCfcGenerator.zip) comes packaged with ColdFusion Builder. The archive file is in the Extensions directory within the ColdFusion Builder installation.
In the ColdFusion Builder perspective, select RDS Dataview.
If you have configured an RDS user name and password, specify the RDS user name and password.
You set the RDS password in the ColdFusion Administrator. Do not confuse the RDS password with the ColdFusion Administrator password, which is also managed through the ColdFusion Administrator.
The list of data sources available in the configured server are listed.
Select a data source and the table for which you want to generate CFCs. You can select multiple tables at once by pressing Shift and selecting the table names.
Right-click the selected tables, select Adobe CFC Generator, and select one of the following options:
The Adobe CFC Generator option appears only if you right-click a table name. Clicking the data source or records within the data source does not show these options.
Right-click a table in the selected data source, for example, APP.EMPLOYEES table, and select Adobe CFC Generator > Create CFC.
In the Adobe CFC Generator dialog box, do the following:
You can modify the CFC source code to provide additional functionality.
Right-click a table in the selected data source, for example, APP.EMPLOYEES table, and select Adobe CFC Generator > Create ORM CFC.
Specify the location to store the generated CFCs.
The Adobe CFC Generator dialog box displays the selected database tables and fields in a dynamic, editable, sortable, data grid.
Because the data grid is an Ajax-rich user interface, it can sometimes take a few moments to load.
You can customize the ORM CFC as follows:
To generate a basic ORM CFC, click the Generate Code link. To define relations and join conditions for the ORM CFC, do the following:
In the Navigator view, right-click the folder that contains the CFC and select Refresh. You can modify the CFC source code to provide additional functionality.
The Adobe CFC Generator has been enhanced in ColdFusion Builder 2.0.1 to provide a better user experience.
In ColdFusion Builder, select RDS Data View. It is assumed that you have added a ColdFusion server in the servers view.
Select tables within a data source for which you wish to generate CFCs.
Right-click on selected tables within the data source and then select Adobe CFC Generator > Create ORM CFC.
You can choose to generate services and scripts CFCs by selecting appropriate options. When Generate Services option is selected, CRUD (create, read, update, and delete) operations are created for each selected table. Scripts CFC allows you to generate code in Scripts style instead of tags.
Specify the location to store the generated CFCs.
The Adobe CFC Generator displays the selected tables along with their fields.
On the Adobe CFC Generator, click the table header and drag to move a table.
Double-click the table header to display the Table Editor.
You can now do any of the following:
The AS Class Generator generates ActionScript classes with or without offline metadata. Offline metadata is a part of the ColdFusion-AIR offline integration feature of ColdFusion. You can generate ActionScript classes either from a CFC or directly from a database table.
The AS Class Generator extension is installed with ColdFusion Builder, if you selected the Install Extension option when creating a server.
If you did not install the AS Class Generator extension when creating a server and want to install it now, use the AS Class Generator extension archive file (ASClassGenerator.zip). The AS Class Generator extension archive file comes packaged with ColdFusion Builder and is in the Extensions directory within the ColdFusion Builder installation. For more information on installing an extension, see Install and uninstall extensions.
The AS Class Generator application is available at the following levels:
AS class generation is supported in the following scenarios:
In the ColdFusion Builder perspective, select RDS Dataview.
If you have configured an RDS user name and password, specify the RDS user name and password.
You set the RDS password in the ColdFusion Administrator. Do not confuse the RDS password with the ColdFusion Administrator password, which is also managed through the ColdFusion Administrator.
The list of data sources available in the configured server are listed.
Select a data source.
Right-click a table in the data source and select Generate AS Class from DB Table > Generate AS Class.
The Generate AS Class from DB Table option appears only if you right-click the table name. Clicking the data source or records within the data source does not show these options.
Enter the following details in the Generate AS Class dialog box.
Enter the path to the remote CFC class using dot notation relative to the web root. For example, if the path to the CFC is C:\ColdFusion9\wwwroot\CFProj\xyz.cfc, the dot notation path is CFProj.xyz
This entry is ignored if you have not selected the AS Metadata Tags check box.
The following code is an example of an ActionScript class file - Employees.as that is generated from the Employees table in the cfdocexamples data source.
|
Code |
Description |
|---|---|
|
package package1 |
The package is created with the name “package1” |
|
[RemoteClass(alias="cfproj.xyz")] |
The ActionScript Class maps with cfproj/xyz.cfc on the server. |
|
public class EMPLOYEES |
The class name is the same as the database table name. Each property in this class corresponds to a column in the Employees database table. The data type of each property is mapped automatically after introspecting the column data type. |
From an ORM CFC
Create an ORM CFC.
In the Project Navigator, right-click the ORM CFC and select Generate AS Class from CFC > Generate AS Class.
Enter the following details in the Generate AS Class dialog box.
From a traditional CFC
In the Navigator view, right-click the CFC and select Generate AS Class from CFC > Generate AS Class.
CFCs for which ActionScript classes are generated must be within the ColdFusion web root.
Enter the following details in the Generate AS Class dialog box.
Model-Glue Assistant is a ColdFusion Builder application that is designed to help you get started with Model-Glue.
Model-Glue is a web application framework to develop ColdFusion web applications.
Before you use the Model-Glue Assistant extension, install the following supporting frameworks:
If you already have the supporting frameworks installed on your computer, you do not have to reinstall the frameworks again.
The Model-Glue Assistant is designed to work with Model-Glue version v2.0.304. If the version of Model-Glue on your computer is other than the specified version, update Model-Glue Assistant.
The Model-Glue Assistant extension is installed with ColdFusion Builder, if you selected the Install Extension option when creating a server.
If you did not install the Model-Glue Assistant extension when creating a server and want to install it now, see Install and uninstall extensions. The Model-Glue Assistant extension archive file (ModelGlue Assistant.zip) comes packaged with ColdFusion Builder. The archive file is in the Extensions directory within the ColdFusion Builder installation.
Create a ColdFusion project under the web root. See Creating a ColdFusion project for details.
In the Add Existing Sources and Referenced Project dialog box, ensure that you select the ModelGlue Assistant Application check box in the list of Applications.
Once you create the ColdFusion project, right-click the project in the Project Navigator and select Refresh to see the files and folders that are created. The ModelGlue.xml and ColdSpring.xml files in the Config folder are automatically configured for your project.
To check if the Model-Glue Assistant is configured correctly, enter the following URL in your web browser: http://_localhost_/_project name_/index.cfmThe ModelGlue 2.0 web page appears with the message that it is up and running. You see many debug messages that you can comment out; see Debug Trace Toggle for details.
In the Project Navigator, right-click the configured project and select ModelGlue Assistant. You see the following options. Relevant code is generated for each of following actions.
In Model-Glue, when you add an event, you associate a CFM page with the event. When you add an event, the code that is added to the CFM file is typically as follows:
<broadcasts> <message name="Hello" /> </broadcasts> <views> <include name="body" template="dspPhrase.cfm"> <value name="xe.translationForm" value="translationForm" /> </include> </views> </event-handler>
The code includes a handler name, a message to broadcast when the event runs, and a view that is associated with a CFM file.
The Model-Glue Assistant lets you add this code easily as follows:
Right-click the project in the Navigator and select ModelGlue Assistant > Add Event.Enter the following details in the Add Event dialog box.
Enter a name for the event.
Enter a broadcast message, if necessary. The message that you enter is broadcast when the event runs.
Enter a view name.
Enter the location to store the CFM file associated with the view. The location must be a folder or subfolder within the Views folder of the project.
Enter a value name and value, if necessary.
To check if the event is added, enter the following URL in your web browser:
http://_localhost_/_project name_/index.cfm?event=event name
Model-Glue Assistant displays a default message in the web page. To change this message, edit the CFM file that you associated with the view.
Model-Glue Assistant adds an event handler entry to the ModelGlue.xml file.
The Debug Trace Toggle functionality lets you toggle the display of the Model-Glue web page between showing the debugging messages and clearing them.
Right-click the project in the Navigator and select ModelGlue Assistant > Debug Trace Toggle.
Enter the following URL in your web browser: http://_localhost_/_project name_/index.cfmThe debugging messages are removed.
To display the debugging messages, right-click the project in the Navigator and again select ModelGlue Assistant > Debug Trace Toggle.
Model-Glue Assistant toggles the value of the debug node in the ColdSpring.xml file.
For database-related events, Model-Glue works with the Reactor framework. To get Model-Glue working with Reactor, enable Reactor. To enable Reactor, clear comments on the Reactor entries in the ColdSpring.xml file (located in the Config folder of your project).
Model-Glue Assistant clears the comments on the Reactor entries in the ColdSpring.xml file.
Using the Model-Glue Assistant you can create Scaffolds that let you quickly create basic user interfaces to the database table.
In the ColdFusion Builder perspective, select RDS Dataview.
If you have configured an RDS user name and password, specify the RDS user name and password.
You set the RDS password in the ColdFusion Administrator. Do not confuse the RDS password with the ColdFusion Administrator password, which is also managed through the ColdFusion Administrator.
The list of data sources available in the configured server are listed.
Select a data source.
Scaffolds do not support all type of data sources.
Right-click a table in the data source, and select ModelGlue Assistant > Create Scaffold Entry.
The ModelGlue Assistant option appears only if you right-click the table name. Clicking the data source or records within the data source does not show the Create Scaffold Entry option.
Enter the following details in the Create Scaffold Entry dialog box.
Select the project configured for Model-Glue Assistant.
Enter the data source user name and password.
You set the data source user name and password in the ColdFusion Administrator. The data source password is different from the RDS password and the ColdFusion Administrator password.
Select the data source type from the DB Type drop-down list.
To check if the Scaffold entry is added, enter the following URL in your web browser: http://_localhost_/_project name_/index.cfm?event=table name.list
After verifying that the Scaffold entry is created, you see that the following files are created under the Scaffolds folder in the project:
You can update the Model-Glue Assistant extension to the version of Model-Glue and supporting frameworks on your computer.
Go to the location in the web root where you have installed Model-Glue Assistant.
In the Model-Glue Assistant folder, you see a Handlers folder and the ide_config.xml file.
To update the Model Glue Application template files to point to the version of Model-Glue on your computer, edit the modelapp.ini file in the Handlers folder. The code in the modelapp.ini file is as follows:
<sampleapp name="modelglueapplicationtemplate" location="" /> </model>
Specify the absolute path to Model-Glue Application Template folder in the location attribute. For example, location="C:\ColdFusion9\wwwroot\ModelGlueApplicationTemplate"
Model-Glue Assistant performs string-handling operations for code generation. To customize the code generated, you can update the CFM files in the Handler folder, as required.
Sign in to your account