SlideShare a Scribd company logo
ColdFusion10: CFScript
Enhancements
WHAT’S NEW IN CF10?
•
•
•
•

Colon separators in structures (key:value pairs).
Use of FOR-IN loop over queries and Java arrays.
Use of ArrayEach() And StructEach().
New tag equivalents in script statements(setting,
cookie)
• New tag equivalents as functions(invoke)
• New tag equivalents as CFCs(collection, index,
search)
colon separators in structures
(key:value pairs)
We can now define the key:value pairs within a structure
using colon (:) separator when defining them with implicit
structure notation.
Ex: <cfscript>
student = {firstname:"abc", lastname:"def",
grades:[12,23,45]};
</cfscript>
Also supported:
• <cfset student = {firstName:"Jane", lastName:"Doe",
grades:[77, 84, 91]}>
• Not supported: <cfset name:”Jane”> or name:”Jane”;
Looping Over Queries and Java Arrays
Using For-In Loop
• ColdFusion has long been able to use the for-in
statement to loop over structures
• And ColdFusion 9.0.1 added the ability to loop over
CFML arrays
• Now can loop over query results.
Various Java methods return java arrays
• Can now loop over those in CFSCRIPT
Use of ArrayEach() And StructEach()
• “ArrayEach” is used to loop over an array object.
• The Handle Function can have each element of
the array during looping.
• We can apply our business logic inside the
handler function .
• We can write the handler function as inline
function or a named function which we can reuse
in multiple cases.
• Similarly in StructEach, we can loop over a
structure elements.
New tag equivalents in script
statements(setting, cookie)
• CFSETTING can be used to set requesttimeout,
enablecfoutputonly, showdebugoutput.
• Especially valuable for use in cfscript-based
application.cfc.
• Now it can set requesttimeout=0
Turns off any requesttimeout set in Admin or
previously in request
Cookie
• We could always set as cookie.name=“value”, but
now can set all properties
Example:
<cfscript>
cookie.firstname = {value="Charlie",expires="10"};
cookie.firstname = {value:"Charlie",expires:"10"};
</cfscript>
• Properties that can be set: value, expires, domain,
path, secure, and httponly.
New tag equivalents as
functions(invoke)
• We can now invoke CFC/web service methods using
invoke().
• Example: <cfscript>
retval=invoke("demo","helloWorld");
</cfscript>
• Also we can pass arguments.
<cfscript>
retval=invoke("demo","helloFriend",{name="Charlie"});
</cfscript>
• Also We can use instances here.
Example:
helloInstance=createobject("component","demo");
retval=invoke(helloInstance,"helloWorld");
• We can invoke a web service using cfscript.
<cfscript>
tempSvc=createobject("webservice","http://wsf.cdyne.
com/WeatherWS/Weather.asmx?WSDL");
retval=invoke(tempSvc,"GetCityWeatherByZIP",{zip="30
005"});
</cfscript>
New tag equivalents as
CFCs(collection, index, search)
• Can create a Solr collection in a directory anywhere
on server.
• Can create and delete collections inside cfscript.
• Also can map, optimize, and categoryList (New for
Solr)
Index
• Now we can put data into the collection using cfindex,
which is now possible inside cfscript.
Example: m=new index();
m.update(collection="merchandise",query=merch,key="me
rchid",type="custom",title="merchname",body="merchd
escription");
Also we can use.
• delete (to remove one or more items from the index)
• purge (to remove all items from the index)
• ColdFusion 10 adds other CFINDEX actions: abort,
deltaimport, fullimport, and status
Search
• CFSEARCH is used to search Solr collections which is
now possible inside cfscript.
Example: <cfscript>
merch=new
search().search(collection="merchandise",criteria="ti
tle:ColdFusion",maxRows=10);
writeDump(var=merch.getresult().name,show="score,ti
tle,summary");
</cfscript>
Thank You
Questions??

More Related Content

PPTX
자바스터디 4
PDF
Docker & CoreOS at Utah Gophers
PPTX
Nashorn: nova engine Javascript do Java SE 8
PDF
Gazelle - Plack Handler for performance freaks #yokohamapm
PPTX
Installing odoo v8 from github
DOCX
PDF
ElePHPant7 - Introduction to PHP7
PDF
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
자바스터디 4
Docker & CoreOS at Utah Gophers
Nashorn: nova engine Javascript do Java SE 8
Gazelle - Plack Handler for performance freaks #yokohamapm
Installing odoo v8 from github
ElePHPant7 - Introduction to PHP7
SECCOM 2017 - Conan.io o gerente de pacote para C e C++

What's hot (20)

KEY
MongoDB: How it Works
PDF
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
PDF
Queue in swift
PDF
You Don't Know Query (WordCamp Netherlands 2012)
PDF
Python Google Cloud Function with CORS
PDF
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
ODP
Caching and tuning fun for high scalability
PDF
Trading with opensource tools, two years later
PDF
NoSQL com Cassandra e Python
PPTX
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
PPTX
Install odoo v8 the easiest way on ubuntu debian
PDF
HTTP Caching and PHP
PDF
[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지
PPTX
Learning Puppet basic thing
PDF
mdpress(MarkDown Press)を使ったプレゼンテーション作成
PDF
djangocon dajaxproject lightning talk
PDF
Mongo à la Resque
ODP
Tutorial Puppet
PPTX
Ansible for Beginners
PDF
MySQL Slow Query log Monitoring using Beats & ELK
MongoDB: How it Works
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Queue in swift
You Don't Know Query (WordCamp Netherlands 2012)
Python Google Cloud Function with CORS
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
Caching and tuning fun for high scalability
Trading with opensource tools, two years later
NoSQL com Cassandra e Python
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Install odoo v8 the easiest way on ubuntu debian
HTTP Caching and PHP
[Droid knights 2019] Tensorflow Lite 부터 ML Kit, Mobile GPU 활용 까지
Learning Puppet basic thing
mdpress(MarkDown Press)を使ったプレゼンテーション作成
djangocon dajaxproject lightning talk
Mongo à la Resque
Tutorial Puppet
Ansible for Beginners
MySQL Slow Query log Monitoring using Beats & ELK
Ad

Similar to ColdFusion 10 CFScript Enhancements (20)

PDF
CakePHP
PDF
Top5 scalabilityissues
PDF
#PDR15 - waf, wscript and Your Pebble App
PDF
ColdFusion Features for More Modern Coding
PDF
Cfml features modern_coding
PDF
Google App Engine Developer - Day3
PDF
How to use the new Domino Query Language
PDF
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
PPTX
20140821 delapsley-cloudopen-public
PDF
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
PDF
Migration strategies 4
KEY
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
PDF
Spock
PDF
Language enhancements in cold fusion 11
PPT
Cluster your application using CDI and JCache - Jonathan Gallimore
PDF
Views Style Plugins
PDF
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
PDF
DEV-1550: Why Java 8? Or, What's a Lambda? – IBM Connect 2017
PPT
PDF
Infrastructure as code with Amazon Web Services
CakePHP
Top5 scalabilityissues
#PDR15 - waf, wscript and Your Pebble App
ColdFusion Features for More Modern Coding
Cfml features modern_coding
Google App Engine Developer - Day3
How to use the new Domino Query Language
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
20140821 delapsley-cloudopen-public
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
Migration strategies 4
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
Spock
Language enhancements in cold fusion 11
Cluster your application using CDI and JCache - Jonathan Gallimore
Views Style Plugins
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
DEV-1550: Why Java 8? Or, What's a Lambda? – IBM Connect 2017
Infrastructure as code with Amazon Web Services
Ad

More from Mindfire Solutions (20)

PDF
Physician Search and Review
PDF
diet management app
PDF
Business Technology Solution
PDF
Remote Health Monitoring
PDF
Influencer Marketing Solution
PPT
High Availability of Azure Applications
PPTX
IOT Hands On
PPTX
Glimpse of Loops Vs Set
ODP
Oracle Sql Developer-Getting Started
PPT
Adaptive Layout In iOS 8
PPT
Introduction to Auto-layout : iOS/Mac
PPT
LINQPad - utility Tool
PPT
Get started with watch kit development
PPTX
Swift vs Objective-C
ODP
Material Design in Android
ODP
Introduction to OData
PPT
Ext js Part 2- MVC
PPT
ExtJs Basic Part-1
PPT
Spring Security Introduction
Physician Search and Review
diet management app
Business Technology Solution
Remote Health Monitoring
Influencer Marketing Solution
High Availability of Azure Applications
IOT Hands On
Glimpse of Loops Vs Set
Oracle Sql Developer-Getting Started
Adaptive Layout In iOS 8
Introduction to Auto-layout : iOS/Mac
LINQPad - utility Tool
Get started with watch kit development
Swift vs Objective-C
Material Design in Android
Introduction to OData
Ext js Part 2- MVC
ExtJs Basic Part-1
Spring Security Introduction

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Network Security Unit 5.pdf for BCA BBA.
Chapter 3 Spatial Domain Image Processing.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25-Week II
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
The Rise and Fall of 3GPP – Time for a Sabbatical?

ColdFusion 10 CFScript Enhancements

  • 2. WHAT’S NEW IN CF10? • • • • Colon separators in structures (key:value pairs). Use of FOR-IN loop over queries and Java arrays. Use of ArrayEach() And StructEach(). New tag equivalents in script statements(setting, cookie) • New tag equivalents as functions(invoke) • New tag equivalents as CFCs(collection, index, search)
  • 3. colon separators in structures (key:value pairs) We can now define the key:value pairs within a structure using colon (:) separator when defining them with implicit structure notation. Ex: <cfscript> student = {firstname:"abc", lastname:"def", grades:[12,23,45]}; </cfscript> Also supported: • <cfset student = {firstName:"Jane", lastName:"Doe", grades:[77, 84, 91]}> • Not supported: <cfset name:”Jane”> or name:”Jane”;
  • 4. Looping Over Queries and Java Arrays Using For-In Loop • ColdFusion has long been able to use the for-in statement to loop over structures • And ColdFusion 9.0.1 added the ability to loop over CFML arrays • Now can loop over query results. Various Java methods return java arrays • Can now loop over those in CFSCRIPT
  • 5. Use of ArrayEach() And StructEach() • “ArrayEach” is used to loop over an array object. • The Handle Function can have each element of the array during looping. • We can apply our business logic inside the handler function . • We can write the handler function as inline function or a named function which we can reuse in multiple cases. • Similarly in StructEach, we can loop over a structure elements.
  • 6. New tag equivalents in script statements(setting, cookie) • CFSETTING can be used to set requesttimeout, enablecfoutputonly, showdebugoutput. • Especially valuable for use in cfscript-based application.cfc. • Now it can set requesttimeout=0 Turns off any requesttimeout set in Admin or previously in request
  • 7. Cookie • We could always set as cookie.name=“value”, but now can set all properties Example: <cfscript> cookie.firstname = {value="Charlie",expires="10"}; cookie.firstname = {value:"Charlie",expires:"10"}; </cfscript> • Properties that can be set: value, expires, domain, path, secure, and httponly.
  • 8. New tag equivalents as functions(invoke) • We can now invoke CFC/web service methods using invoke(). • Example: <cfscript> retval=invoke("demo","helloWorld"); </cfscript> • Also we can pass arguments. <cfscript> retval=invoke("demo","helloFriend",{name="Charlie"}); </cfscript>
  • 9. • Also We can use instances here. Example: helloInstance=createobject("component","demo"); retval=invoke(helloInstance,"helloWorld"); • We can invoke a web service using cfscript. <cfscript> tempSvc=createobject("webservice","http://wsf.cdyne. com/WeatherWS/Weather.asmx?WSDL"); retval=invoke(tempSvc,"GetCityWeatherByZIP",{zip="30 005"}); </cfscript>
  • 10. New tag equivalents as CFCs(collection, index, search) • Can create a Solr collection in a directory anywhere on server. • Can create and delete collections inside cfscript. • Also can map, optimize, and categoryList (New for Solr)
  • 11. Index • Now we can put data into the collection using cfindex, which is now possible inside cfscript. Example: m=new index(); m.update(collection="merchandise",query=merch,key="me rchid",type="custom",title="merchname",body="merchd escription"); Also we can use. • delete (to remove one or more items from the index) • purge (to remove all items from the index) • ColdFusion 10 adds other CFINDEX actions: abort, deltaimport, fullimport, and status
  • 12. Search • CFSEARCH is used to search Solr collections which is now possible inside cfscript. Example: <cfscript> merch=new search().search(collection="merchandise",criteria="ti tle:ColdFusion",maxRows=10); writeDump(var=merch.getresult().name,show="score,ti tle,summary"); </cfscript>