Your SlideShare is downloading. ×
0
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
ColdFusion Builder Extensions
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

ColdFusion Builder Extensions

1,682

Published on

How to get started doing extension development for ColdFusion Builder

How to get started doing extension development for ColdFusion Builder

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,682
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ColdFusion Builder Extensions
    Terry Ryan
    Adobe ColdFusion Evangelist
    http://terrenceryan.com
    @tpryan
  • 2. Google Translator
  • 3. Builder Stats
  • 4. Riaforge Download
  • 5. Getting Started Using
  • 6. Installation
    Install
    Packaged Zip files
    Import
  • 7. Using Extensions
    Available as Context Menus (Right Click thingies) for:
    RDS View
    Project View
    Outline View
    Editor
  • 8. RDS VIEW
    EDITOR VIEW
    PROJECT VIEW
    OUTLINE VIEW
  • 9. Getting Started Writing
  • 10. Extension Components
    Ide_config.xml
    CFML Handlers
    Supporting Code
  • 11. <application>
    [Metadata]
    [Menu Contributions]
    [Handlers]
    </application>
    ide_config.xml
  • 12. ide_config.xml
    <application>
    <name>DemoExtensions</name>
    <author>Terrence Ryan</author>
    <version>1.0</version>
    <email>terry.ryan@adobe.com</email>
    <description>Simple Extension</description>
    [Menu Contributions]
    [Handlers]
    </application>
  • 13. Licensing
    Add License agreement to metadata.
  • 14. ide_config.xml
    <application>
    [Metadata]
    <menucontributions>
    <contribution target="rdsview" >
    <menu name="Database Info">
    <action name=“DBVersion" handlerid="databaseVersion" />
    </menu>
    </contribution>
    </menucontributions>
    [Handlers]
    </application>
  • 15. ide_config.xml
    <application>
    [Metadata]
    [Menu Contributions]
    <handlers>
    <handler id="databaseVersion" type="CFM" filename="databaseVersion.cfm" />
    </handlers>
    </application>
  • 16. ide_config.xml
    <application>
    <name>DemoExtensions</name>
    <author>Terrence Ryan</author>
    <version>1.0</version>
    <email>terry.ryan@adobe.com</email>
    <description>Simple Extension</description>
    <menucontributions>
    <contribution target="rdsview" >
    <menu name="Database Info">
    <action name=“DBVersion" handlerid="databaseVersion" />
    <action name="Inspect Table" handlerid="inspectTables" />
    </menu>
    </contribution>
    </menucontributions>
    <handlers>
    <handler id="databaseVersion" type="CFM" filename="databaseVersion.cfm" />
    </handlers>
    </application>
  • 17. Handlers
    [Parse IDE input]
    [Do something]
    [Respond to IDE]
  • 18. Parse IDE Input
    <event>
    <ide version="2.0">
    <callbackurl>
    http://192.168.180.208:53301/index.cfm?extension=ColdFusion Builder Test Creator
    </callbackurl>
    <rdsview>
    <database name="cfartgallery">
    <table name="APP.ART">
    <fields>
    <field name="ARTID" type="INTEGER" length="10"/>
    <field name="ARTISTID" type="INTEGER" length="10"/>
    <field name="ARTNAME" type="VARCHAR" length="50"/>
    <field name="DESCRIPTION" type="CLOB" length="2147483647"/>
    <field name="PRICE" type="DECIMAL" length="19"/>
    <field name="LARGEIMAGE" type="VARCHAR" length="30"/>
    <field name="MEDIAID" type="INTEGER" length="10"/>
    <field name="ISSOLD" type="SMALLINT" length="5"/>
    </fields>
    </table>
    </database>
    </rdsview>
    </ide>
    </event>
  • 19. Parse IDE Input
    <cfsetXMLDoc= XMLParse(form.ideeventInfo) />
    <cfsetdb.dbname=XMLDoc.event.ide.rdsview.database[1].XMLAttributes.name />
    [Do something]
    [Respond to IDE]
  • 20. Do Something
    [Parse IDE input]
    <cfdbinfodatasource="#db.dbname#" name="version" type="version" />
    [Respond to IDE]
  • 21. Respond to IDE
    [Parse IDE input]
    [Do something]
    <cfheader name="Content-Type" value="text/xml">
    <response status="success" showresponse="true">
    <ide>
    <dialog width="600" height="400" />
    <body>
    <![CDATA[
    <cf_versionDisplayversionQuery = "#version#" />
    ]]>
    </body>
    </ide>
    </response>
  • 22. Put it all together
    <cfsetXMLDoc= XMLParse(form.ideeventInfo) />
    <cfsetdb.dbname=XMLDoc.event.ide.rdsview.database[1].XMLAttributes.name />
    <cfdbinfodatasource="#db.dbname#" name="version" type="version" />
    <cfheader name="Content-Type" value="text/xml">
    <response status="success" showresponse="true">
    <ide>
    <dialog width="600" height="400" />
    <body>
    <![CDATA[
    <cf_versionDisplayversionQuery = "#version#" />
    ]]>
    </body>
    </ide>
    </response>
  • 23. Interacting with IDE
  • 24. Collecting Input
    <menucontributions>
    <contribution target="rdsview" >
    <menu name="Database Info">
    <action name="Database Version" handlerid="databaseVersion" />
    <action name="Inspect Table" handlerid="inspectTables">
    <input name="showPK" label="Show Primary Key" type="boolean"/>
    <input name="showFK" label="Show Foreign Key" type="boolean"/>
    </action>
    </menu>
    </contribution>
    </menucontributions>
  • 25. User input
    <event>
    <user>
    <input name="showPK" value="true"/>
    <input name="showFK" value="true"/>
    </user>
    </event>
  • 26. Collecting Input
    Types
    String
    Dir
    Boolean
    File
    Password
    List
    Name
    Label
    Tooltip
    Required
    Default
    Checked
    Pattern
    ErrorMessage
    HelpMessage
  • 27. Workspace Keywords
    Leverage Workspace Values
    projectlocation
    projectname
    serverhome
    wwwroot
    <input name=“outputDir" label=“Output Folder" default="{$projectlocation}" type="dir"/>
  • 28. Workspace Keywords - Gotchas
    Does not work in RDSview
    Keywords are case sensitive
  • 29. Menu Filters
    Add Context-Menus only to specific items
    Folders
    Projects
    Files
    Outline Nodes
    Pattern match against name or RegEx
    <filters>
    <filter type="file" pattern=“index.cfm" /><filter type=“cffunction" />
    </filters>
  • 30. Menu Filters - Gotchas
    *.cfc does not work
    It’s a regular expression
    .*.cfc
  • 31. Menus
    RDS View
    Project View
    Outline View
    Editor
  • 32. RDS View
    <event>
    <ide version="2.0">
    <callbackurl>
    http://192.168.180.208:53301/index.cfm?extension=ColdFusion Builder Test Creator
    </callbackurl>
    <rdsview>
    <database name="cfartgallery">
    <table name="APP.ART">
    <fields>
    <field name="ARTID" type="INTEGER" length="10"/>
    <field name="ARTISTID" type="INTEGER" length="10"/>
    <field name="ARTNAME" type="VARCHAR" length="50"/>
    <field name="DESCRIPTION" type="CLOB" length="2147483647"/>
    <field name="PRICE" type="DECIMAL" length="19"/>
    <field name="LARGEIMAGE" type="VARCHAR" length="30"/>
    <field name="MEDIAID" type="INTEGER" length="10"/>
    <field name="ISSOLD" type="SMALLINT" length="5"/>
    </fields>
    </table>
    </database>
    </rdsview>
    </ide>
    </event>
  • 33. Project View
    <event>
    <ide version="2.0">
    <callbackurl>
    http://192.168.180.208:53301/index.cfm?extension=ColdFusion Builder Test Creator
    </callbackurl>
    <projectviewprojectname="DemoExtensions" projectlocation=”[Project Path]">
    <resource path=”[File Path]" type="file"/>
    </projectview>
    </ide>
    </event>
  • 34. Outline View
    <event>
    <ide version="2.0">
    <callbackurl>
    http://192.168.180.208:53301/index.cfm?extension=ColdFusion Builder Test Creator
    </callbackurl>
    <outlineviewprojectname="FlexGumboDemo" projectlocation="[Project Path]">
    <source filename="artists.cfc" path="[FilePath]">
    <node type="cffunction">
    <function name="getIDName" returntype=" void">
    </function>
    </node>
    </source>
    </outlineview>
    </ide>
    </event>
  • 35. Editor View
    <event>
    <ide version="2.0">
    <callbackurl>
    http://192.168.180.208:53301/index.cfm?extension=ColdFusion Builder Test Creator
    </callbackurl>
    <editor>
    <file location="/Users/terryr/Sites/centaur.dev/translator/test.cfm" name="test.cfm" project="Translator"
    projectlocation="/Users/terryr/Sites/centaur.dev/translator" projectrelativelocation="test.cfm" />
    <selection endcolumn="86" endline="4" startcolumn="1" startline="1">
    <text>
    Editor content
    Editor content
    Editor content
    Editor content
    </text>
    </selection>
    </editor>
    </ide></event>
  • 36. Getting information via callbacks
    <event>
    <ide version="2.0">
    <callbackurl>
    http://192.168.180.208:53301/index.cfm?extension=ColdFusion Builder Test Creator
    </callbackurl>

    </event>
  • 37. Getting information via callbacks
    <cfsetcallbackURL= XMLParse(form.ideeventinfo).event.ide.callbackurl.XMLText/>
    <cfsavecontent variable="postData">
    <response>
    <ide>
    <commands>
    <command type="getdatasources">
    </command>
    </commands>
    </ide>
    </response>
    </cfsavecontent>
    <cfhttp method="post" url="#callbackURL#">
    <cfhttpparam type="body" value="#postData#" >
    </cfhttp>
  • 38. Callback results
    <?xml version="1.0" encoding="UTF-8"?>
    <event>
    <ide version="2.0">
    <callbackurl>
    http://192.168.180.208:53301/index.cfm?extension=Storm Extensions
    </callbackurl>
    <command_results>
    <command_resulttype="getdatasources">
    <datasources>
    <datasourcename="max2010" server="centaur.dev"/>
    <datasourcename="webdu" server="centaur.dev"/>
    <datasourcename="indy" server="centaur.dev"/>
    <datasourcename="inventory" server="centaur.dev"/>
    ...
    </datasources>
    </command_result>
    </command_results>
    </ide>
    </event>
  • 39. Callbacks data fetches
    getServers
    getDatasources
    getTables
    getTable
    searchFile
    getFunctionsAndVariables
  • 40. Callbacks can perform operations
    refreshProject
    refreshFolder
    refreshFile
    insertText
    openFile
  • 41. Callbacks- Gotchas
    IDE has to have them enabled (it does by default)
  • 42. Creating Dynamic Extensions
    ColdFusion Builder Extensions Responses
    XML
    HTML
    Flash
    Eclipse SWT
  • 43. XML Response to Create Dynamic UI
    <response status="success" type="default">
    <idemessage="">
    <dialog height="400" width="400" >
    <input name="location" default="${projectlocation}" />
    <input name="Generate View" type="boolean" checked="yes" />
    </dialog>
    </ide>
    </response>
  • 44. XML Response to Create HTML UI
    <response status="success" showresponse="true">
    <ide>
    <dialog width="600" height="400" />
    <body>
    <![CDATA[
    <p>This is an HTML Response</p>
    ]]>
    </body>
    </ide>
    </response>
  • 45. Two Browsers
    Internally, ColdFusion Builder utilizes two different browsers to render extensions
    Internal browser
    System default browser
  • 46. IDE Browser
    Pros
    Crappy CSS Support
    Cons
    Call backs for more interaction with the IDE
  • 47. Native Browser
    Pros
    Full CSS
    Cons
    No Callbacks
  • 48. XML Response to Native Browser
    <response status="success" showresponse="true">
    <ide url="#attributes.messageURL#" >
    <dialog width="600" height="400" />
    </ide>
    </response>
  • 49. Responding to views
    <cfheader name="Content-Type" value="text/xml">
    <response status="success" showresponse="true">
    <ide >
    <view id="stormExtensions" title="Storm Extensions Test" icon="" />
    <body>
    <![CDATA[

    ]]>
    </body>
    </ide>
    </response>
  • 50. <codeassistcontribution>
    <functions>
    <function name="linkTo" variableName="event" componentName=""
    handlerId="CodeAssistHandler">
    <parameterindex="1" />
    </function>
    </functions>
    </codeassistcontribution>
    Extension Code Assist
  • 51. <codeassist_response>
    <proposal display="display_value" insert="insert_this_value" inquotes="true/false"/>
    </codeassist_response>
    Extension Code Assist
  • 52. Development Tips
  • 53. Development Tips
    <cfsettingsshowdebugoutput=“false” />
  • 54. Development Tips
    Reload / Import ExtensionsPreferences > ColdFusion > Extensions
    Have to do when you alter ide_config.xml
  • 55. Development Tips
    Errors output to Eclipse error logsWindow > Show View > Other > General > Error Log
  • 56. Development Tips
    Simulate submissions
    Capture IDE input to text file
    Read IDE input from text file
    Develop like a webapp, until you are ready for full testing with IDE
  • 57. Testing and Debugging
  • 58. Run ColdFusion from command line and dump to the console
  • 59. Use a custom tag to dump to the IDE window
  • 60. Use ColdFusion Builder Tester Extension
  • 61. Demo
    ColdFusion Builder Tester
  • 62. Skinning
  • 63. HTML/CSS/JS
    Pros
    Easy to write
    Compliments other things you do
    Cons
    Some Concepts aren’t well expressed
  • 64. Flex
    Pros
    Can do some cool stuff
    Cons
    Harder to just throw together an extensions
  • 65. Logo
    You can place a logo in the upper right hand corner
  • 66. <response showresponse="true" >
    <ide >
    <dialog title="Apptacular"
    image="handlers/logo.png"
    width="710" height="690"/>
    </ide>
    </response>
  • 67. Menu Spacer
    You can add spacers to menu items.
    They’re clickable, but do nothing
  • 68. <menucontributions>
    <contribution target="rdsview" >
    <menu name="Apptacular">
    <action name="------------------------------" />
    </menu>
    </contribution>
  • 69. Like an app put ui in Custom tags
  • 70. Instant Code Review
  • 71. Follow up?
    Feel free to contact me
    terry.ryan@adobe.com
    http://terrenceryan.com
    Twitter: @tpryan

×