SlideShare una empresa de Scribd logo
1 de 17
How ColdFusion saved me
from a week of grunt work

 Using SQL Server and Coldfusion
to generate 600 Word Documents.
Buy One Class – Get One Class 50% off
           until December 15
Why ColdFusion?
• Quick learning curve
• Similar style to HTML with opening and closing tags
• Supported by Adobe and frequently updated with new features

• ColdFusion isn’t free but also not that expensive
• Hosted ColdFusion accounts are about $30 a month
• Free Developer Edition
Can you guess what this does?


  <cfloop index="i" from="1" to="10">

         <cfoutput> <p> #i# </p> </cfoutput>

  </cfloop>
Can I get this outline as a Word Doc?




                     Ummm…    No.
<cfoutput>

      <h1>#database.h1#</h1>
      <h2>#database.h2#</h2>

      #database.classOutline#

</cfoutput>
I need all of our outlines in Word




                    … super.
Can ColdFusion come to my rescue?




           Yup!
Step 1: Get the info from the database

<cfquery name="allOutlines" datasource="datasource"
               username="username" password="password">

       SELECT ID,
              Name,
              Days,
              H1,
              ClassOutline,
              FileName

       FROM   classroomTable

       ORDER BY Name

</cfquery>
Step 2: Output class info into a variable
<cfoutput query="allOutlines">

     <cfsavecontent variable="myDocument">

     <html xmlns:w="urn:schemas-microsoft-com:office:word">
     <!--- Head tag instructs Word to start up a certain way, specifically in
     print view. --->
         <head>
             <xml>
              <w:WordDocument>
                 <w:View>Print</w:View>
                 <w:SpellingState>Clean</w:SpellingState>
                 <w:GrammarState>Clean</w:GrammarState>
                 <w:Compatibility>
                   <w:BreakWrappedTables/>
                   <w:SnapToGridInCell/>
                   <w:WrapTextWithPunct/>
                   <w:UseAsianBreakRules/>
                 </w:Compatibility>
                 <w:DoNotOptimizeForBrowser/>
              </w:WordDocument>
             </xml>
         </head>
Step 3: Write variable into Word Doc
<body>

          <cfoutput>

            <h1>#allOutlines.Name#</h1>
            <p>#allOutlines.Days# <cfif allOutlines.Days GT "1">days<cfelse>day</cfif></p>

            #allOutlines.classOutline#

         </cfoutput>

</body>
</html>
</cfsavecontent>



<cfscript>

            FileWrite("Server:word-outlines#allOutlines.ID#-#allOutlines.FileName#.doc", "#myDocument#");

</cfscript>

</cfoutput>
This is my lonely directory
my directory with lots of friends…
SUPER CODER!

Más contenido relacionado

La actualidad más candente

Implementation of gui framework part1
Implementation of gui framework part1Implementation of gui framework part1
Implementation of gui framework part1
masahiroookubo
 
w3schools%20javascript%20comments
w3schools%20javascript%20commentsw3schools%20javascript%20comments
w3schools%20javascript%20comments
tutorialsruby
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
Daniel Kanchev
 

La actualidad más candente (20)

Meta Programming with JavaScript
Meta Programming with JavaScriptMeta Programming with JavaScript
Meta Programming with JavaScript
 
S1 Web Development
S1 Web DevelopmentS1 Web Development
S1 Web Development
 
Upstate CSCI 450 jQuery
Upstate CSCI 450 jQueryUpstate CSCI 450 jQuery
Upstate CSCI 450 jQuery
 
Open course(programming languages) 20150318
Open course(programming languages) 20150318Open course(programming languages) 20150318
Open course(programming languages) 20150318
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3
 
Implementation of gui framework part1
Implementation of gui framework part1Implementation of gui framework part1
Implementation of gui framework part1
 
Python Programming Essentials - M44 - Overview of Web Development
Python Programming Essentials - M44 - Overview of Web DevelopmentPython Programming Essentials - M44 - Overview of Web Development
Python Programming Essentials - M44 - Overview of Web Development
 
Implementation of gui framework part2
Implementation of gui framework part2Implementation of gui framework part2
Implementation of gui framework part2
 
Html part 2
Html part 2Html part 2
Html part 2
 
Gd 305 1 133 No27 A.Txt.Xhtml
Gd 305 1 133 No27 A.Txt.XhtmlGd 305 1 133 No27 A.Txt.Xhtml
Gd 305 1 133 No27 A.Txt.Xhtml
 
Java script
Java scriptJava script
Java script
 
BizTalk Server 2010 - Invoking Restful Services - EPC Group
BizTalk Server 2010 - Invoking Restful Services - EPC GroupBizTalk Server 2010 - Invoking Restful Services - EPC Group
BizTalk Server 2010 - Invoking Restful Services - EPC Group
 
Html5 use cases
Html5 use casesHtml5 use cases
Html5 use cases
 
w3schools%20javascript%20comments
w3schools%20javascript%20commentsw3schools%20javascript%20comments
w3schools%20javascript%20comments
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
Html5 & less css
Html5 & less cssHtml5 & less css
Html5 & less css
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
 
DrupalCon Barcelona 2015
DrupalCon Barcelona 2015DrupalCon Barcelona 2015
DrupalCon Barcelona 2015
 
Word press beirut 9th meetup march
Word press beirut 9th meetup   marchWord press beirut 9th meetup   march
Word press beirut 9th meetup march
 

Similar a Coldfusion with Keith Diehl

Top5 scalabilityissues withappendix
Top5 scalabilityissues withappendixTop5 scalabilityissues withappendix
Top5 scalabilityissues withappendix
ColdFusionConference
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
Doris Chen
 
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI LibraryOSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
Andreas Kunz
 
1 Introduction to PHP Overview This lab walks y.docx
1  Introduction to PHP Overview This lab walks y.docx1  Introduction to PHP Overview This lab walks y.docx
1 Introduction to PHP Overview This lab walks y.docx
honey725342
 

Similar a Coldfusion with Keith Diehl (20)

Top5 scalabilityissues withappendix
Top5 scalabilityissues withappendixTop5 scalabilityissues withappendix
Top5 scalabilityissues withappendix
 
Top5 scalabilityissues
Top5 scalabilityissuesTop5 scalabilityissues
Top5 scalabilityissues
 
10 java script projects full source code
10 java script projects full source code10 java script projects full source code
10 java script projects full source code
 
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
jQuery
jQueryjQuery
jQuery
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
crtical points for customizing Joomla templates
crtical points for customizing Joomla templatescrtical points for customizing Joomla templates
crtical points for customizing Joomla templates
 
JavaScriptL18 [Autosaved].pptx
JavaScriptL18 [Autosaved].pptxJavaScriptL18 [Autosaved].pptx
JavaScriptL18 [Autosaved].pptx
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI LibraryOSCON 2014: OpenUI5 - The New Responsive Web UI Library
OSCON 2014: OpenUI5 - The New Responsive Web UI Library
 
1 Introduction to PHP Overview This lab walks y.docx
1  Introduction to PHP Overview This lab walks y.docx1  Introduction to PHP Overview This lab walks y.docx
1 Introduction to PHP Overview This lab walks y.docx
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive Code
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
Joomla Beginner Template Presentation
Joomla Beginner Template PresentationJoomla Beginner Template Presentation
Joomla Beginner Template Presentation
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 

Más de Refresh Annapolis Valley

STEAM Powered! MakerSpace / FabLab @AcadiaU
STEAM Powered! MakerSpace / FabLab @AcadiaUSTEAM Powered! MakerSpace / FabLab @AcadiaU
STEAM Powered! MakerSpace / FabLab @AcadiaU
Refresh Annapolis Valley
 

Más de Refresh Annapolis Valley (20)

IP Matters
IP MattersIP Matters
IP Matters
 
3 Essential Wordpress Tips
3 Essential Wordpress Tips3 Essential Wordpress Tips
3 Essential Wordpress Tips
 
Wordpress introduction
Wordpress introductionWordpress introduction
Wordpress introduction
 
UX Fist Fighting - Designing For Usability
UX Fist Fighting - Designing For UsabilityUX Fist Fighting - Designing For Usability
UX Fist Fighting - Designing For Usability
 
STEAM Powered! MakerSpace / FabLab @AcadiaU
STEAM Powered! MakerSpace / FabLab @AcadiaUSTEAM Powered! MakerSpace / FabLab @AcadiaU
STEAM Powered! MakerSpace / FabLab @AcadiaU
 
The Ag + Tech Opportunity
The Ag + Tech OpportunityThe Ag + Tech Opportunity
The Ag + Tech Opportunity
 
Hello world - intro to node js
Hello world - intro to node jsHello world - intro to node js
Hello world - intro to node js
 
Emergent Learning & New Media
Emergent Learning & New MediaEmergent Learning & New Media
Emergent Learning & New Media
 
Just in time mentors
Just in time mentorsJust in time mentors
Just in time mentors
 
ValleyEvents.ca
ValleyEvents.caValleyEvents.ca
ValleyEvents.ca
 
Predictive analytics in the agriculture industry
Predictive analytics in the agriculture industryPredictive analytics in the agriculture industry
Predictive analytics in the agriculture industry
 
Mobile development frameworks
Mobile development frameworksMobile development frameworks
Mobile development frameworks
 
Just in time mentors
Just in time mentorsJust in time mentors
Just in time mentors
 
Players and Builders: Digital Games and University Learning
Players and Builders: Digital Games and University LearningPlayers and Builders: Digital Games and University Learning
Players and Builders: Digital Games and University Learning
 
Building Startup Communities: Annapolis Valley
Building Startup Communities: Annapolis ValleyBuilding Startup Communities: Annapolis Valley
Building Startup Communities: Annapolis Valley
 
New Media Legal Q&A
New Media Legal Q&ANew Media Legal Q&A
New Media Legal Q&A
 
She++
She++She++
She++
 
Valley Community Fiber Network
Valley Community Fiber NetworkValley Community Fiber Network
Valley Community Fiber Network
 
Valley Community Fiber Network
Valley Community Fiber NetworkValley Community Fiber Network
Valley Community Fiber Network
 
Valley Family Fun
Valley Family FunValley Family Fun
Valley Family Fun
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Coldfusion with Keith Diehl

  • 1. How ColdFusion saved me from a week of grunt work Using SQL Server and Coldfusion to generate 600 Word Documents.
  • 2.
  • 3. Buy One Class – Get One Class 50% off until December 15
  • 4. Why ColdFusion? • Quick learning curve • Similar style to HTML with opening and closing tags • Supported by Adobe and frequently updated with new features • ColdFusion isn’t free but also not that expensive • Hosted ColdFusion accounts are about $30 a month • Free Developer Edition
  • 5. Can you guess what this does? <cfloop index="i" from="1" to="10"> <cfoutput> <p> #i# </p> </cfoutput> </cfloop>
  • 6.
  • 7. Can I get this outline as a Word Doc? Ummm… No.
  • 8.
  • 9. <cfoutput> <h1>#database.h1#</h1> <h2>#database.h2#</h2> #database.classOutline# </cfoutput>
  • 10. I need all of our outlines in Word … super.
  • 11. Can ColdFusion come to my rescue? Yup!
  • 12. Step 1: Get the info from the database <cfquery name="allOutlines" datasource="datasource" username="username" password="password"> SELECT ID, Name, Days, H1, ClassOutline, FileName FROM classroomTable ORDER BY Name </cfquery>
  • 13. Step 2: Output class info into a variable <cfoutput query="allOutlines"> <cfsavecontent variable="myDocument"> <html xmlns:w="urn:schemas-microsoft-com:office:word"> <!--- Head tag instructs Word to start up a certain way, specifically in print view. ---> <head> <xml> <w:WordDocument> <w:View>Print</w:View> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml> </head>
  • 14. Step 3: Write variable into Word Doc <body> <cfoutput> <h1>#allOutlines.Name#</h1> <p>#allOutlines.Days# <cfif allOutlines.Days GT "1">days<cfelse>day</cfif></p> #allOutlines.classOutline# </cfoutput> </body> </html> </cfsavecontent> <cfscript> FileWrite("Server:word-outlines#allOutlines.ID#-#allOutlines.FileName#.doc", "#myDocument#"); </cfscript> </cfoutput>
  • 15. This is my lonely directory
  • 16. my directory with lots of friends…