theo rushin, jr. [email protected] senior web application developer world singles and doubleblack...

22
Theo Rushin, Jr. [email protected] Senior Web Application Developer World Singles and DoubleBlack Technologies 01/23/22 1

Upload: ralf-griffin

Post on 21-Jan-2016

221 views

Category:

Documents


3 download

TRANSCRIPT

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

Theo Rushin, [email protected]

Senior Web Application DeveloperWorld Singles and

DoubleBlack Technologies

04/21/23 1

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

About MeApplication Developer and Trainer Since ‘85ColdFusion Developer Since ‘99Flash Developer Since ’99Flex Developer Since ‘05Also work with SQL, JavaScript, HTML, and

CSS

Currently working for WorldSingles - a subsidiary of NicheClick Media (http://nicheclick.com/index.html)

04/21/23 2

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

What We Will Cover TodayWhat is the ColdFusion Administrator

API?Using the CF Admin APIBuilding the Flex 2 InterfaceSummaryLearn MoreQ & A

04/21/23 3

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

What is the ColdFusion Administrator API?

04/21/23 4

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

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.

04/21/23 5

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

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 CacheMaintain DatasourcesRefresh WebServicesShared Hosting

ColdFusion 8 is still in Beta (as of 7/10/2007)

04/21/23 6

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

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.

04/21/23 7

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

CF Admin API CFCs (cont.)

04/21/23 8

CFC Description

administrator.cfc Contains basic Administrator functionality, including login, logout, the Migration Wizard, and the Setup Wizard.

base.cfc Base object for all other Administrator API CFCs.

datasource.cfc Add, modify, and delete ColdFusion data sources.

debugging.cfc Manage debug settings.

eventgateway.cfc Manage event gateways.

extensions.cfc Manage custom tags, mappings, CFXs, applets, CORBA, and web services.

mail.cfc Manage ColdFusion mail settings.

runtime.cfc Manage runtime settings for fonts, cache, charts, configuration, and other settings.

security.cfc Manage passwords, RDS, and sandbox security.

serverinstance.cfc Start, stop, and restart JRun servers. This CFC only works when running the multiserver configuration.

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

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.

04/21/23 9

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

CF Admin API Methods (cont.)

04/21/23 10

CFC Descriptionadministrator.cfc getAdminProperty, login, logout, setAdminProperty, etc.

base.cfc isAdminUser, etc.

datasource.cfc deleteDatasource, getDatasources, setMSAccess, setMSSQL, verifyDsn, etc.

debugging.cfc addDebugEvent, deleteIP, getDebugProperty, getIPList, setIP, getLogProperty, etc.

eventgateway.cfc deleteGatewayInstance, deleteGatewayType, getGatewayInstances, etc.

extensions.cfc deleteCFX, deleteCustomTagPath, getCFX, getCustomTagPaths, getMappings, etc.

mail.cfc getMailProperty, getMailServers, setMailServer, setMailProperty, etc.

runtime.cfc clearTrustedCache, getCacheProperty, getRuntimeProperty, getScopeProperty, etc.

security.cfc setUseRDSPassword, setUseAdminPassword, setEnableRDS, etc.

serverinstance.cfc restartInstance,

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

Using the CF Admin API

04/21/23 11

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

Accessing a ComponentAccessing an object …

… using CFML<cfset adminObj =

createObject("component","cfide.adminapi.administrator")>

… using CFSCRIPTadminObj =

createObject("component","cfide.adminapi.administrator");

04/21/23 12

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

Calling a MethodCalling a method …

… using CFML<cfset adminObj .login(“mycfadminpassword”)>

… using CFSCRIPTadminObj.login(“mycfadminpassword”);

04/21/23 13

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

Demo – ColdFusion

Show a simple ColdFusion page that allows you to set your IP address for debugging.

04/21/23 14

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

Building the Flex 2 Interface

04/21/23 15

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

Calling your ColdFusion ComponentUse the RemoteObject service to invoke your

ColdFusion cfc methodsThe 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.

04/21/23 16

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

Calling your ColdFusion Component (cont.)RemoteObject service example;

<mx:RemoteObject id="srv" source="samples.data.EmployeeService"> <mx:method name="addEmployee"/> </mx:RemoteObject>

04/21/23 17

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

Working with the result dataMost 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.

04/21/23 18

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

Demo – Flex

Show a simple Flex 2 application that allows you to maintain various datasources.

04/21/23 19

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

SummaryPros: 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 CFCsUse ColdFusion Try/Catch blocks to capture any

possible errors.Use Flex RemoteObject calls to access your

components.It’s easy!!!

04/21/23 20

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

Learn MoreAdobe Administrator API LiveDocs

http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001734.htm

Adobe Flex 2 RemoteObject LiveDocshttp://livedocs.adobe.com/flex/2/langref/mx/rpc/

remoting/RemoteObject.htmlMoving data from ColdFusion CFCs to Flex 2

applicationshttp://www.adobe.com/devnet/flex/articles/

helloworld.html04/21/23 21

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

Q & AEmail:

[email protected]:

http://therush.wordpress.com/Presentation materials:

http://therush.wordpress.com/my-presentations/

04/21/23 22