Presentation is loading. Please wait.

Presentation is loading. Please wait.

Theo Rushin, Jr. Senior Web Application Developer World Singles and DoubleBlack Technologies 12/26/2015 1.

Similar presentations


Presentation on theme: "Theo Rushin, Jr. Senior Web Application Developer World Singles and DoubleBlack Technologies 12/26/2015 1."— Presentation transcript:

1 Theo Rushin, Jr. rushint@yahoo.com Senior Web Application Developer World Singles and DoubleBlack Technologies 12/26/2015 1

2 About Me Application Developer and Trainer Since ‘85 ColdFusion Developer Since ‘99 Flash Developer Since ’99 Flex Developer Since ‘05 Also work with SQL, JavaScript, HTML, and CSS Currently working for WorldSingles - a subsidiary of NicheClick Media (http://nicheclick.com/index.html) 12/26/2015 2

3 What We Will Cover Today What is the ColdFusion Administrator API? Using the CF Admin API Building the Flex 2 Interface Summary Learn More Q & A 12/26/2015 3

4 What is the ColdFusion Administrator API? 12/26/2015 4

5 What is it? It allows you to perform most ColdFusion MX administrator tasks programmatically. In ColdFusion MX 6.x you could use the “undocumented” ServiceFactory to programmatically access ColdFusion’s administrator tasks. In ColdFusion 7.x you can use the Administrator API, a set of CFCs that offer a formal and secure way of accessing that functionality. 12/26/2015 5

6 Why use it? You could give developers the ability to perform certain administrator tasks without having to give out the single CF Administrator password featured in ColdFusion 6.x – 7.x. Refresh Trusted Cache Maintain Datasources Refresh WebServices Shared Hosting ColdFusion 8 is still in Beta (as of 7/10/2007) 12/26/2015 6

7 Where to find the CF Admin CFCs? The ColdFusion Administrator API exists as a set of CFCs located in the [coldfusion_webroot]/CFIDE/adminapi/ directory. 12/26/2015 7

8 CF Admin API CFCs (cont.) 12/26/2015 8 CFCDescription administrator.cfcContains basic Administrator functionality, including login, logout, the Migration Wizard, and the Setup Wizard. base.cfcBase object for all other Administrator API CFCs. datasource.cfcAdd, modify, and delete ColdFusion data sources. debugging.cfcManage debug settings. eventgateway.cfcManage event gateways. extensions.cfcManage custom tags, mappings, CFXs, applets, CORBA, and web services. mail.cfcManage ColdFusion mail settings. runtime.cfcManage runtime settings for fonts, cache, charts, configuration, and other settings. security.cfcManage passwords, RDS, and sandbox security. serverinstance.cfcStart, stop, and restart JRun servers. This CFC only works when running the multiserver configuration.

9 What are the CF Admin Methods? You may introspect the ColdFusion Administrator API cfc’s by entering http://[webserver]/CFIDE/adminapi/[apicfc].cfc in you browser’s address bar. 12/26/2015 9

10 CF Admin API Methods (cont.) 12/26/2015 10 CFCDescription administrator.cfcgetAdminProperty, login, logout, setAdminProperty, etc. base.cfcisAdminUser, etc. datasource.cfcdeleteDatasource, getDatasources, setMSAccess, setMSSQL, verifyDsn, etc. debugging.cfcaddDebugEvent, deleteIP, getDebugProperty, getIPList, setIP, getLogProperty, etc. eventgateway.cfcdeleteGatewayInstance, deleteGatewayType, getGatewayInstances, etc. extensions.cfcdeleteCFX, deleteCustomTagPath, getCFX, getCustomTagPaths, getMappings, etc. mail.cfcgetMailProperty, getMailServers, setMailServer, setMailProperty, etc. runtime.cfcclearTrustedCache, getCacheProperty, getRuntimeProperty, getScopeProperty, etc. security.cfcsetUseRDSPassword, setUseAdminPassword, setEnableRDS, etc. serverinstance.cfcrestartInstance,

11 Using the CF Admin API 12/26/2015 11

12 Accessing a Component Accessing an object … … using CFML … using CFSCRIPT adminObj = createObject("component","cfide.adminapi.administrator"); 12/26/2015 12

13 Calling a Method Calling a method … … using CFML … using CFSCRIPT adminObj.login(“mycfadminpassword”); 12/26/2015 13

14 Demo – ColdFusion Show a simple ColdFusion page that allows you to set your IP address for debugging. 12/26/2015 14

15 Building the Flex 2 Interface 12/26/2015 15

16 Calling your ColdFusion Component Use the RemoteObject service to invoke your ColdFusion cfc methods The RemoteObject uses AMF (Action Message Format), a binary encoding format, over HTTP. AMF is faster and leaner than using a standard HTTP or WebService call. 12/26/2015 16

17 Calling your ColdFusion Component (cont.) RemoteObject service example; 12/26/2015 17

18 Working with the result data Most methods return simple data types. Some methods return more complex data types such as arrays. Your ColdFusion code should return more complex data types such as structures and arrays that can contain result data or error messages. 12/26/2015 18

19 Demo – Flex Show a simple Flex 2 application that allows you to maintain various datasources. 12/26/2015 19

20 Summary Pros: Developers have access to most of the ColdFusion Administrator features through code. Cons: Developers have access to most of the ColdFusion Administrator features through code. Encapsulate your code using CFCs Use ColdFusion Try/Catch blocks to capture any possible errors. Use Flex RemoteObject calls to access your components. It’s easy!!! 12/26/2015 20

21 Learn More Adobe Administrator API LiveDocs http://livedocs.adobe.com/coldfusion/7/htmldocs/wwh elp/wwhimpl/common/html/wwhelp.htm?context=Col dFusion_Documentation&file=00001734.htm http://livedocs.adobe.com/coldfusion/7/htmldocs/wwh elp/wwhimpl/common/html/wwhelp.htm?context=Col dFusion_Documentation&file=00001734.htm Adobe Flex 2 RemoteObject LiveDocs http://livedocs.adobe.com/flex/2/langref/mx/rpc/remot ing/RemoteObject.html http://livedocs.adobe.com/flex/2/langref/mx/rpc/remot ing/RemoteObject.html Moving data from ColdFusion CFCs to Flex 2 applications http://www.adobe.com/devnet/flex/articles/helloworld. html http://www.adobe.com/devnet/flex/articles/helloworld. html 12/26/2015 21

22 Q & A Email: rushint@yahoo.com Blog: http://therush.wordpress.com/ Presentation materials: http://therush.wordpress.com/my-presentations/ 12/26/2015 22


Download ppt "Theo Rushin, Jr. Senior Web Application Developer World Singles and DoubleBlack Technologies 12/26/2015 1."

Similar presentations


Ads by Google