User Guide Cancel

Use extensions in ColdFusion Builder

  1. ColdFusion User Guide
  2. Introduction to ColdFusion
    1. About Adobe ColdFusion
    2. Download Adobe ColdFusion
    3. What's new in ColdFusion (2021 release)
    4. ColdFusion (2021 release) Release Notes
    5. Deprecated Features
    6. REST enhancements in ColdFusion (2018 release)
    7. Server Auto-Lockdown
    8. Asynchronous programming
    9. Docker images for ColdFusion
  3. Adobe ColdFusion (2021 release)
    1. Install ColdFusion- Zip Installer
    2. Install ColdFusion- GUI Installer
    3. ColdFusion Licensing and Activation
    4. ColdFusion Package Manager
    5. CFSetup configuration tool
    6. SAML in ColdFusion
    7. ColdFusion and Amazon S3
    8. ColdFusion and DynamoDB
    9. ColdFusion and Amazon SQS
    10. ColdFusion and Amazon SNS
    11. ColdFusion and MongoDB
    12. ColdFusion and Azure Blob
    13. ColdFusion and Azure Service Bus
    14. New and updated language enancements
    15. Multi-cloud storage services
    16. Multi-cloud RDS databases
    17. ColdFusion and Azure Cosmos DB
  4. Install ColdFusion
    1. ColdFusion server profiles
    2. Prepare to install ColdFusion
    3. Install the server configuration
    4. Install the JEE configuration
    5. Install ColdFusion Express
    6. Install integrated technologies
    7. Configure your system
    8. Troubleshoot installation issues
    9. Install ColdFusion silently
    10. Install Adobe ColdFusion (2016 release) hotfix
    11. ColdFusion (2018 release) - Install JEE configuration
  5. Use ColdFusion
    1. Command Line Interface (CLI)
    2. External session storage
    3. Generate Swagger documents
    4. Language enhancements
    5. NTLM support
    6. New and changed functions/tags in Adobe ColdFusion (2016 release)
    7. PDF enhancements
    8. Security enhancements in ColdFusion (2016 release)
  6. Performance Monitoring Toolset
    1. Auto-discovery of ColdFusion nodes and clusters
    2. Code profiler in ColdFusion Performance Monitoring Toolset
    3. Configure ColdFusion Performance Monitoring Toolset settings
    4. Install ColdFusion Performance Monitoring Toolset
    5. Overview of ColdFusion Performance Monitoring Toolset
    6. View cluster and node metrics
    7. View data source metrics
    8. View external services
    9. View incoming services
    10. View list of sites and busy connections
    11. View topology of sites
    12. Datastore Health Monitoring
    13. Performance Monitoring Toolset Update 1
    14. Secure Performance Monitoring Toolset with HTTPS/SSL
    15. Performance Monitoring Toolset deployment guide
  7. Adobe ColdFusion Builder extension for Visual Studio Code
    1. Getting started with Adobe ColdFusion Builder extension for Visual Studio Code
    2. Add a ColdFusion server
    3. Project Manager
    4. Work with ColdFusion code
    5. Profile preferences
    6. Debug applications
    7. Refactoring
    8. Services Browser
    9. RDS support
    10. PMT Code Profiler integration
    11. Security Analyzer report integration
    12. Known issues in this release
  8. Use ColdFusion Builder
    1. About ColdFusion Builder
    2. System requirements | ColdFusion Builder
    3. Install ColdFusion Builder
    4. Edit code in ColdFusion Builder
    5. Manage servers in ColdFusion Builder
    6. Manage projects in ColdFusion Builder
    7. What’s new in Adobe ColdFusion Builder (2018 release)
    8. Frequently Asked Questions (FAQ) | Adobe ColdFusion Builder (2018 release)
    9. Debug applications in ColdFusion Builder
    10. ColdFusion Builder workbench
    11. ColdFusion Builder extensions
    12. Debugging Perspective in ColdFusion Builder
    13. Build mobile applications using ColdFusion Builder
    14. Bundled ColdFusion Server
    15. Debug mobile applications in ColdFusion Builder
    16. Use extensions in ColdFusion Builder
  9. Coldfusion API Manager
    1. Overview of Adobe ColdFusion API Manager
    2. Features in ColdFusion API Manager
    3. Get started with ColdFusion API Manager
    4. Install ColdFusion API Manager
    5. Authentication types
    6. Create and publish APIs
    7. Administrator
    8. Subscriber
    9. Throttling and rate limiting
    10. Notifications
    11. Connectors
    12. Set up cluster support
    13. Integrate ColdFusion and API Manager
    14. Metrics and Logging in API Manager
    15. Generate Swagger documents
    16. Configure SSL
    17. Known issues in this release
    18. Policies in ColdFusion API Manager
    19. Create a Redis cluster
    20. Multitenancy in API Manager
    21. Docker images for ColdFusion API Manager
  10. Configure and administer ColdFusion
    1. Administer ColdFusion
    2. Use the ColdFusion administrator
    3. Data Source Management for ColdFusion
    4. Connect to web servers
    5. Deploy ColdFusion applications
    6. Administer ColdFusion security
    7. Basic Troubleshooting and FAQs
    8. Work with Server Manager
    9. Use multiple server instances
    10. WebSocket Enhancements (ColdFusion 11)
    11. Security Enhancements (ColdFusion 11)
    12. Work with Server Monitor
    13. ColdFusion Administrator API Reference
  11. CFML Reference
    1. Introduction to CFML Reference
      1. New functions in ColdFusion (2018 release)
      2. New and changed functions/tags in Adobe ColdFusion (2016 release)
      3. Script supported tags and functions
      4. New and changed tags/functions in ColdFusion 11
    2. Reserved words and variables
      1. Reserved words and variables
      2. Reserved words
      3. Scope-specific built-in variables
      4. Custom tag variables
      5. ColdFusion tag-specific variables
      6. CGI environment (CGI Scope) variables
    3. ColdFusion tags
      1. ColdFusion tags
      2. Tags in ColdFusion 10
      3. Tag summary
      4. Tags by function
      5. Tag changes since ColdFusion 5
      6. Tags a-b
      7. Tags c
      8. Tags d-e
      9. Tags f
      10. Tags g-h
      11. Tags i
      12. Tags j-l
      13. Tags m-o
      14. Tags p-q
      15. Tags r-s
      16. Tags t
      17. Tags u-z
    4. ColdFusion functions
      1. ColdFusion functions
      2. New functions in ColdFusion 10
      3. ColdFusion functions by category
      4. Function changes since ColdFusion 5
      5. Functions a-b
      6. Functions c-d
      7. Functions e-g
      8. Functions h-im
      9. Functions in-k
      10. Functions l
      11. Functions m-r
      12. Functions s
      13. Functions t-z
      14. BooleanFormat
    5. Ajax JavaScript functions
      1. Ajax JavaScript functions
      2. Function summary Ajax
      3. ColdFusion.Ajax.submitForm
      4. ColdFusion.Autosuggest.getAutosuggestObject
      5. ColdFusion.Layout.enableSourceBind
      6. ColdFusion.MessageBox.getMessageBoxObject
      7. ColdFusion.ProgressBar.getProgressBarObject
      8. ColdFusion.MessageBox.isMessageBoxDefined
      9. JavaScriptFunctionsinColdFusion9Update1
    6. ColdFusion ActionScript functions
      1. ColdFusion ActionScript functions
      2. CF.http
      3. CF.query
    7. ColdFusion mobile functions
      1. ColdFusion Mobile Functions
      2. Accelerometer Functions
      3. Camera Functions
      4. Connection Functions
      5. Contact Functions
      6. Event Functions
      7. File System Functions
      8. Geolocation Functions
      9. Media and Capture Functions
      10. Notification Functions
      11. Splash Screen Functions
      12. Storage Functions
    8. Application.cfc reference
      1. Application.CFC reference
      2. Application variables
      3. Method summary
      4. onAbort
      5. onApplicationEnd
      6. onApplicationStart
      7. onMissingTemplate
      8. onCFCRequest
      9. onError
      10. onRequestEnd
      11. onRequest
      12. onRequestStart
      13. onServerStart
      14. onSessionEnd
      15. onSessionStart
    9. Script functions implemented as CFCs
      1. Script Functions Implemented as CFCs
      2. Accessing the functions
      3. Function summary
      4. ftp
      5. http
      6. mail
      7. pdf
      8. query
      9. Script functions implemented as CFCs in ColdFusion 9 Update 1
      10. storedproc
    10. ColdFusion Flash Form style reference
      1. Styles valid for all controls
      2. Styles for cfform
      3. Styles for cfformgroup with horizontal or vertical type attributes
      4. Styles for box-style cfformgroup elements
      5. Styles for cfformgroup with accordion type attribute
      6. Styles for cfformgroup with tabnavigator type attribute
      7. Styles for cfformitem with hrule or vrule type attributes
      8. Styles for cfinput with radio, checkbox, button, image, or submit type attributes
      9. Styles for cftextarea tag and cfinput with text, password, or hidden type attributes
      10. Styles for cfselect with size attribute value of 1
      11. Styles for cfselect with size attribute value greater than 1
      12. Styles for cfcalendar tag and cfinput with dateField type attribute
      13. Styles for the cfgrid tag
      14. Styles for the cftree tag
      15. ColdFusion Flash Form Style Reference
    11. ColdFusion event gateway reference
      1. ColdFusion Event Gateway reference
      2. addEvent
      3. CFEvent
      4. CFEventclass
      5. Constructor
      6. Gateway development interfaces and classes
      7. getStatus
      8. setCFCPath
      9. setCFCMethod
      10. getOriginatorID
      11. getLogger
      12. getBuddyList
      13. getBuddyInfo
      14. IM gateway message sending commands
      15. IM Gateway GatewayHelper class methods
      16. onIncomingMessage
      17. onIMServerMessage
      18. onBuddyStatus
      19. onAddBuddyResponse
      20. onAddBuddyRequest
      21. IM Gateway CFC incoming message methods
      22. IM gateway methods and commands
      23. CFML CFEvent structure
      24. warn
      25. info
      26. setOriginatorID
      27. data command
      28. submit Multi command
      29. submit command
      30. setGatewayType
      31. setGatewayID
      32. setData
      33. setCFCListeners
      34. outgoingMessage
      35. getStatusTimeStamp
      36. numberOfMessagesReceived
      37. numberOfMessagesSent
      38. removeBuddy
      39. removeDeny
      40. removePermit
      41. setNickName
      42. setPermitMode
      43. setStatus
      44. SMS Gateway CFEvent structure and commands
      45. SMS Gateway incoming message CFEvent structure
      46. getStatusAsString
      47. getProtocolName
      48. getPermitMode
      49. getPermitList
      50. getNickName
      51. getName
      52. getDenyList
      53. getCustomAwayMessage
      54. getQueueSize
      55. getMaxQueueSize
      56. getHelper
      57. getGatewayType
      58. getGatewayServices
      59. getGatewayID_1
      60. getGatewayID
      61. getData
      62. getCFCTimeout
      63. setCFCTimeout
      64. getCFCPath
      65. getCFCMethod
      66. GatewayServices class
      67. Gateway interface
      68. GatewayHelper interface
      69. addPermit
      70. addDeny
      71. addBuddy
      72. error
      73. debug
      74. Logger class
      75. stop
      76. start
      77. CFML event gateway SendGatewayMessage data parameter
      78. restart
      79. fatal
      80. SMS gateway message sending commands
    12. ColdFusion C++ CFX Reference
      1. C++ class overview
      2. Deprecated class methods
      3. CCFXException class
      4. CCFXQuery class
      5. CCFXRequest class
      6. CCFXStringSet class
      7. ColdFusion C++ CFX Reference
    13. ColdFusion Java CFX reference
      1. ColdFusion Java CFX reference
      2. Class libraries overview
      3. Custom tag interface
      4. Query interface
      5. Request interface
      6. Response interface
      7. Debugging classes reference
    14. WDDX JavaScript Objects
      1. WDDX JavaScript objects
      2. JavaScript object overview
      3. WddxRecordset object
      4. WddxSerializer object
  12. Develop ColdFusion applications
    1. Introducing ColdFusion
      1. Introducing ColdFusion
      2. About ColdFusion
      3. About Internet applications and web application servers
      4. About JEE and the ColdFusion architecture
    2. Changes in ColdFusion
      1. Changes in ColdFusion
      2. Replacement of JRun with Tomcat
      3. Security enhancements
      4. ColdFusion WebSocket
      5. Enhanced Java integration
      6. ColdFusion ORM search for indexing and search
      7. Solr enhancements
      8. Scheduler enhancements
      9. Integration with Microsoft Exchange Server 2010
      10. RESTful Web Services in ColdFusion
      11. Lazy loading across client and server in ColdFusion
      12. Web service enhancements
      13. Displaying geolocation
      14. Client-side charting
      15. Caching enhancements
      16. Server update using ColdFusion Administrator
      17. Secure Profile for ColdFusion Administrator
    3. Introduction to application development
      1. Introduction to application development using ColdFusion
      2. Using the Developing ColdFusion Applications guide
      3. About Adobe ColdFusion documentation for Developers
    4. The CFML programming language
      1. The CFML programming language
      2. Elements of CFML
      3. ColdFusion variables
      4. Expressions and number signs
      5. Arrays and structures
      6. Extend ColdFusion pages with CFML scripting
      7. Regular expressions in functions
      8. ColdFusion language enhancements
      9. Built-in functions as first class citizen
      10. Data types- Developing guide
    5. Building blocks of ColdFusion applications
      1. Building blocks of ColdFusion applications
      2. Create ColdFusion elements
      3. Write and call user-defined functions
      4. Build and use ColdFusion Components
      5. Create and use custom CFML tags
      6. Build custom CFXAPI tags
      7. Use the member functions
      8. Object Oriented Programming in ColdFusion
    6. Develop CFML applications
      1. Develop CFML applications
      2. Design and optimize a ColdFusion application
      3. Handle errors
      4. Use persistent data and locking
      5. Use ColdFusion threads
      6. Secure applications
      7. Client-side CFML (for mobile development)
      8. Use the ColdFusion debugger
      9. Debugging and Troubleshooting Applications
      10. Develop globalized applications
      11. REST enhancements in ColdFusion
      12. Authentication through OAuth
      13. Social enhancements
    7. Develop mobile applications
      1. Mobile application development
      2. Build mobile applications
      3. Debug mobile applications
      4. Inspect mobile applications
      5. Package mobile applications
      6. Troubleshoot mobile applications
      7. Device detection
      8. Client-side CFML
      9. Mobile Templates
      10. Code samples to build a mobile application
    8. Access and use data
      1. Access and use data
      2. Introduction to Databases and SQL
      3. Access and retrieve data
      4. Update database
      5. Use Query of Queries
      6. Manage LDAP directories
      7. Solr search support
    9. ColdFusion ORM
      1. ColdFusion ORM
      2. Introducing ColdFusion ORM
      3. ORM architecture
      4. Configure ORM
      5. Define ORM mapping
      6. Work with objects
      7. ORM session management
      8. Transaction and concurrency
      9. Use HQL queries
      10. Autogenerate database schema
      11. Support for multiple data sources for ORM
      12. ColdFusion ORM search
    10. ColdFusion and HTML5
      1. ColdFusion and HTML 5
      2. Use ColdFusion Web Sockets
      3. Media Player enhancements
      4. Client-side charting
      5. Display geolocation data
    11. Flex and AIR integration in ColdFusion
      1. Flex and AIR integration in ColdFusion
      2. Use the Flash Remoting Service
      3. Use Flash Remoting Update
      4. Offline AIR application support
      5. Proxy ActionScript classes for ColdFusion services
      6. Use LiveCycle Data Services ES assembler
      7. Use server-side ActionScript
    12. Request and present information
      1. Request and present information
      2. Retrieve and format data
      3. Build dynamic forms with cfform tags
      4. Validate data
      5. Create forms in Flash
      6. Create skinnable XML forms
      7. Use Ajax data and development features
      8. Use Ajax User Interface components and features
    13. Office file interoperability
      1. Office file interoperability
      2. Using cfdocument
      3. Using cfpresentation
      4. Using cfspreadsheet
      5. Supported Office conversion formats
      6. SharePoint integration
    14. ColdFusion portlets
      1. ColdFusion portlets
      2. Run a ColdFusion portlet on a JBoss portal server
      3. Run a ColdFusion portlet on a WebSphere portal server
      4. Common methods used in portlet.cfc
      5. ColdFusion portlet components
      6. Support for JSR-286
    15. Work with documents, charts, and reports
      1. Work with documents, charts, and reports
      2. Manipulate PDF forms in ColdFusion
      3. Assemble PDF documents
      4. Create and manipulate ColdFusion images
      5. Create charts and graphs
      6. Create reports and documents for printing
      7. Create reports with Report Builder
      8. Create slide presentations
    16. Use web elements and external objects
      1. Use web elements and external objects
      2. Use XML and WDDX
      3. Use web services
      4. Use ColdFusion web services
      5. Integrate JEE and Java elements in CFML applications
      6. Use Microsoft .NET assemblies
      7. Integrate COM and CORBA objects in CFML applications
    17. Use external resources
      1. Send and receive e-mail
      2. Interact with Microsoft Exchange servers
      3. Interact with remote servers
      4. Manage files on the server
      5. Use event gateways
      6. Create custom event gateways
      7. Use the ColdFusion extensions for Eclipse
      8. Use the data services messaging event gateway
      9. Use the data management event gateway
      10. Use the FMS event gateway
      11. Use the instant messaging event gateways
      12. Use the SMS event gateway

 

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.

  • Adobe CFC Generator
  • ActionScript Class Generator

The information covered here discusses how to use these extensions. It does not cover information about developing the extensions.

Note:

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.

Adobe CFC Generator

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.

Install Adobe CFC Generator

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.

Use Adobe CFC Generator (in ColdFusion Builder 2.0)

  1. In the ColdFusion Builder perspective, select RDS Dataview.

  2. If you have configured an RDS user name and password, specify the RDS user name and password.

    Note:

    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.

  3. The list of data sources available in the configured server are listed.

  4. 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.

  5. Right-click the selected tables, select Adobe CFC Generator, and select one of the following options:

    Note:

    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.

  • Create CFC Generates a ColdFusion component.
  • *Create ORM CFC * Generates an ORM CFC and maps it to the database.

Create CFC

  1. Right-click a table in the selected data source, for example, APP.EMPLOYEES table, and select Adobe CFC Generator > Create CFC.

  2. In the Adobe CFC Generator dialog box, do the following:

    • Specify the location to store the generated CFC.
    • Select Generate Service to automatically generate methods.

You can modify the CFC source code to provide additional functionality.

Create ORM CFC

  1. Right-click a table in the selected data source, for example, APP.EMPLOYEES table, and select Adobe CFC Generator > Create ORM CFC.

  2. Specify the location to store the generated CFCs.

  3. The Adobe CFC Generator dialog box displays the selected database tables and fields in a dynamic, editable, sortable, data grid.

    Note:

    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:

    • Change the CFC Name: You can edit the auto-generated CFC name in the CFC Name field.
    • Change the property name: You can edit the property name in the Property Name field.
    • Change the property type: To edit a property type, click the property type that appears in the Property Type column and select a property type from the drop-down list.
    • Specify the primary key: You can edit the primary key settings by selecting "True" or "False" for the required column.
    • You can include or exclude columns that you want to generate in the CFC by selecting or deselecting the check box next to each column name.
    • Sorting data: You can sort tables and columns that appear in the data grid. The direction of the sort can be either ascending or descending. To sort table names, click the Tables column and select the sort order. To sort column data, click the column heading and select the sort order.
  4. 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 Relationships data grid, click Insert. A new row is inserted.
    • Click the Relation Name field and enter a name for the relationship. For example, you can define a relationship between the Art table and Artists table.
    • Select the target table from the Target Table drop-down list.
    • Specify the relationship type by selecting the Multiplicity drop-down list.
    • Specify a Link table, if necessary.
    • Click Save.
    • When you define a relationship, define a join condition. To define a join condition for the specified relationship, click the target table that you selected in step 3.
    • Click Insert in the Join Conditions data grid.
    • Select the source field from the Source drop-down list.
    • Select the target field from the Target drop-down list.
    • Click Save.
    • Click the Generate Code link.
  5. 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.

Use Adobe CFC Generator (in ColdFusion Builder 2.0.1)

The Adobe CFC Generator has been enhanced in ColdFusion Builder 2.0.1 to provide a better user experience.

  1. In ColdFusion Builder, select RDS Data View. It is assumed that you have added a ColdFusion server in the servers view.

  2. Select tables within a data source for which you wish to generate CFCs.

  3. Right-click on selected tables within the data source and then select Adobe CFC Generator > Create ORM CFC.

  4. 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.

  5. Specify the location to store the generated CFCs.

  6. The Adobe CFC Generator displays the selected tables along with their fields.

Adobe CFC Generator dialog box

Move table

On the Adobe CFC Generator, click the table header and drag to move a table.

Edit table

  1. Double-click the table header to display the Table Editor.

  2. You can now do any of the following:

    • If necessary, you can change the name of the CFC.
    • Click property name to edit it.
    • Click the property-type you wish to change and select from the drop-down list.
    • Individually select/unselect table fields using the check box (first grid column). If not selected, the property is not created for that field. If no field is selected in the table, then the CFC for that table is not generated.

Create, edit, and delete relationship

  • To create a relationship between two fields of different tables, drag one field on to other. This displays a connector between the two connected  fields..
  • Double-click the connector to edit the relationship on the Edit Relationship screen dialog box.
  • Select to create  property  for both primary and foreign key.
  • Set cardinality of relationship at each end and specify relationship name.
  • (For many-to-many relationship) Select a link table from the drop-down list.
  • To edit conditions of relationship, click the field that you want to edit.
  • To add  new  condition, click the last empty row of the table.
  • To delete  relationship , click the X mark in the last column of the table.
  • Click the circle in the middle of the linking line to delete the relationship.

AS Class Generator

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.

Install AS Class Generator

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.

Use AS Class Generator

The AS Class Generator application is available at the following levels:

  • RDS Dataview view
  • Project Navigator view

AS class generation is supported in the following scenarios:

  • From a database table
  • From a CFC You can generate the AS class from either an ORM CFC or a traditional CFC.

AS Class Generation from a database table

  1. In the ColdFusion Builder perspective, select RDS Dataview.

  2. If you have configured an RDS user name and password, specify the RDS user name and password.

    Note:

    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.

  3. The list of data sources available in the configured server are listed.

  4. Select a data source.

  5. Right-click a table in the data source and select Generate AS Class from DB Table > Generate AS Class.

    Note:

    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.

  6. Enter the following details in the Generate AS Class dialog box.

  • Specify or select a location to store the ActionScript class files.
  • Select the Include AS Metadata Tags check box to include the following metadata tags:
  • [RemoteClass] Maps the ColdFusion CFC or Java objects on the ColdFusion server with the generated ActionScript class
  • [Entity] Indicates that the generated ActionScript class has to be persisted to the AIR SQLite database as a table. This tag is a ColdFusion-AIR offline integration tag.
  • [Id] Specifies the AS Class property as a primary key after the ActionScript class is persisted to the AIR SQLite database table.
  • 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

Note:

This entry is ignored if you have not selected the AS Metadata Tags check box.

  • Enter the name of the package. The naming convention is the same as the ActionScript naming convention.
  1. The ActionScript Class file is created with the naming convention databasetablename.as

Reviewing the generated ActionScript Class file

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
{
[Id]
public var EMP_ID:int;
public var FIRSTNAME:String;
public var LASTNAME:String;
public var EMAIL:String;
public var PHONE:String;
public var DEPARTMENT:String;
public var LOCATION:String;
public var IM_ID:String;
public function 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.

AS Class Generation from CFC

From an ORM CFC

  1. Create an ORM CFC.

  2. In the Project Navigator, right-click the ORM CFC and select Generate AS Class from CFC > Generate AS Class.

  3. Enter the following details in the Generate AS Class dialog box.

    • Specify or select a location to store the ActionScript class files.
    • Enter the name of the package. The naming convention is the same as the ActionScript naming convention.
    • Select the Include AS Metadata tags check box to include the [RemoteClass] tag.
    • Select the Include CF-AIR Offline Metadata check box to include the following tags:
    • [Entity]
    • [Id]
    • If the ORM CFC already has the necessary information like, primary key and data type for each property, you need not enter the ColdFusion data source.

From a traditional CFC

  1. In the Navigator view, right-click the CFC and select Generate AS Class from CFC > Generate AS Class.

    Note:

    CFCs for which ActionScript classes are generated must be within the ColdFusion web root.

  2. Enter the following details in the Generate AS Class dialog box.

    • Specify or select a location to store the ActionScript class files.
    • Enter the name of the package. The naming convention is the same as the ActionScript naming convention.
    • Select the Include AS Metadata tags check box to include the [RemoteClass] tag.
    • Select the Include CF-AIR Offline Metadata check box to include the following tags:
    • [Entity]
    • [Id]
    • If the primary key and data type for each property is not specified in the CFC, enter the ColdFusion data source name.

Points to remember

  • For CF-AIR offline integration, column-specific metadata tag [Column] additions are not currently supported. However, you can manually add the column-specific metadata tags after the ActionScript class file is generated.
  • RDS does not provide information about the primary key of a table in the data source. Use the  cfdbinfo }}tag to identify the primary key. The {{cfdbinfo }}tag does not support ODBC drivers including Microsoft Access. Hence, for unsupported data sources, you manually define the {{Id column in the generated ActionScript Class file.
  • CFCs for which ActionScript class files are generated must be within the ColdFusion web root.
  • In an ORM CFC, datatype/type is an optional attribute of the {{cfproperty }}tag. If this attribute is not present in the CFC, ActionScript class files are not generated. To ensure that the ActionScript class files are generated, specify the ColdFusion data source. Data type information is retrieved from the database table and the ActionScript class file is created.

Model-Glue Assistant

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.

Prerequisites to use Model-glue Assistant extension

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.

Install Model-Glue Assistant extension

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

  1. Create a ColdFusion project under the web root. See Creating a ColdFusion project for details.

  2. 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.

  3. 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.

  4. 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.

Use Model-Glue Assistant

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.

Add Event

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:

  1. Right-click the project in the Navigator and select ModelGlue Assistant > Add Event.Enter the following details in the Add Event dialog box.

  2. Enter a name for the event.

  3. Enter a broadcast message, if necessary. The message that you enter is broadcast when the event runs.

  4. Enter a view name.

  5. 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.

  6. Enter a value name and value, if necessary.

  7. 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.

Generated code

Model-Glue Assistant adds an event handler entry to the ModelGlue.xml file.

Debug Trace Toggle

The Debug Trace Toggle functionality lets you toggle the display of the Model-Glue web page between showing the debugging messages and clearing them.

  1. Right-click the project in the Navigator and select ModelGlue Assistant > Debug Trace Toggle.

  2. Enter the following URL in your web browser: http://_localhost_/_project name_/index.cfmThe debugging messages are removed.

  3. To display the debugging messages, right-click the project in the Navigator and again select ModelGlue Assistant > Debug Trace Toggle.

Generated code

Model-Glue Assistant toggles the value of the debug node in the ColdSpring.xml file.

Enable Reactor

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).

  • Right-click the project in the Navigator and select ModelGlue Assistant > Enable Reactor.

Generated code

Model-Glue Assistant clears the comments on the Reactor entries in the ColdSpring.xml file.

Creating Scaffolds

Using the Model-Glue Assistant you can create Scaffolds that let you quickly create basic user interfaces to the database table.

  1. In the ColdFusion Builder perspective, select RDS Dataview.

  2. If you have configured an RDS user name and password, specify the RDS user name and password.

    Note:

    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.

  3. The list of data sources available in the configured server are listed.

  4. Select a data source.

    Note:

    Scaffolds do not support all type of data sources.

  5. Right-click a table in the data source, and select ModelGlue Assistant > Create Scaffold Entry.

    Note:

    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.

  6. Select the project configured for Model-Glue Assistant.

  7. Enter the data source user name and password.

    Note:

    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.

  8. Select the data source type from the DB Type drop-down list.

  9. 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

  10. After verifying that the Scaffold entry is created, you see that the following files are created under the Scaffolds folder in the project:

    • dsp_tablename_.cfm
    • dsp_tablename_List.cfm
    • frm_tablename_.cfm
     

Generated code

  • A Scaffold entry is added to Reactor.xml for the selected table. Table relationships are not added.
  • The Reactor configuration in ColdSpring.xml is updated to point to the correct data source.
  • A Scaffold object entry is added to ModelGlue.xml

Update Model-Glue Assistant

You can update the Model-Glue Assistant extension to the version of Model-Glue and supporting frameworks on your computer.

  1. Go to the location in the web root where you have installed Model-Glue Assistant.

  2. In the Model-Glue Assistant folder, you see a Handlers folder and the ide_config.xml file.

  3. 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.

Adobe logo

Sign in to your account