Download Plugin (zip)

Stats

Version

0.1

Wheels Compatibility

1.1.7, 1.1.5

Downloads

72

Last Updated

February 17, 2012

About Plugins

Plugins allow you to extend or modify default Wheels application behavior. To use, you just drop the zip file into your plugins directory and reload your application.

Read Using and Creating Plugins for more information.

CFAdminDSN

Abstraction layer for adding/editing/deleting datasources, for Railo and Adobe CF9

Author

Jake Feasel

Project Home

https://github.com/jakefeasel/sqlfiddle/tree/master/plugins

Description

Railo and Adobe CF expose their Admin API in quite different ways.  Railo uses the cfadmin tag, whereas Adobe uses the CFIDE.adminapi.administrator component library.  If you want to be able to dynamically add, edit, or delete datasources in your code, you must use the approprate API for your given CF application server.  However, if you want to support both application servers, you'll find it quite difficult, since references to the Railo cfadmin tag will cause compile-time errors within Adobe CF (since it is an unrecognized tag in that environment).  My plugin abstracts the differences between Adobe CF and Railo, so you can manage datasources in either environment without introducing incompatibilties with the other environment.

Usage/Examples

Adding a datasource, or changing the properties of an existing one:

setDatasource( adminPassword=get('CFAdminPassword'), name="myDSN", class="org.gjt.mm.mysql.Driver", jdbcurl="jdbc:mysql://127.0.0.1:3306/myDB", username="user_myDB", password="secret", customJDBCArguments="allowMultiQueries=true", timeout=0, allowed_select=true, allowed_insert=true, allowed_update=true, allowed_delete=true, allowed_alter=false, allowed_drop=false, allowed_revoke=false, allowed_create=false, allowed_grant=false, pooling=false, description = "Created on #DateFormat(Now(), 'mm/dd/yyyy')# #TimeFormat(Now(), 'hh:mm:ss tt')#" );

Deleting a datasource:

deleteDatasource(adminPassword=get('CFAdminPassword'),name="myDSN");

Change Log

Version 0.1—February 12, 2012 Download

  • Initial release.
  • Wheels compatibility: 1.1.5, 1.1.7.