Transcript Slide 1

Oğuz Demirkapı Sr. Application Developer, TeraTech 1

 Sr. Application Developer at TeraTech    Coding since ‘85, CGI Programming since ’94 CF Developer since ’97 Founder and Manager (prev) of CFUG for Turkey  Interested in ColdFusion, Flex, Ajax, Frameworks, i18N, L10N, g13N  Have big interest in epistemology TeraTech 2

 What is goal?    History ColdFusion Code Deployment Methods Code Deployment Details  Sample Code TeraTech 3

 Code deployment may needs different scenarios and we will consider a sourceless code deployment in an easy way.

  We also want to resolve misunderstanding points on code deployment techniques.

Pre compiled code advantages would be interesting specially for commercial organizations.

TeraTech 4

 CFEncode and encrypted code    ColdFusion Archives (CAR files) Pre-compiling ◦ ColdFusion MX 7 Souceless Deployment ◦ CFCompile ◦ ColdFusion MX 7 and up ◦ BlueDragon 6.1 and up TeraTech 5

 Direct Source Code (common usage)    Encyrpted Code (CFEncode) CAR (ColdFusion Archive) EAR/WAR Packaging ◦ Only in ColdFusion MX 7 Enterprise Edition  Pre-compiled and Sourceless Deployment ◦ In all version of ColdFusion MX 7 TeraTech 6

 Can be found at ◦ “cf_root/bin” (ColdFusion MX) ◦ “cf_webapp_root/WEB-INF/cfusion/bin” (JRun)   ColdFusion code encryption Good for basic encryption and still using by lots of companies to protect code  Easy to decode (http://downloads.securityfocus.com/vulnerabilities/ exploits/cfdecrypt.c)  Not secure enough TeraTech 7

 Allaire Cold Fusion Template Header Size: New Íû'ÉÊE´Žå¿ˆpcw..*¬Ó¦N47Â{{c;.û=Ò“š.ü.ù>eÐ×åR— ီ¯»~"ß<"©:¥ºmZLìBXIÂÕ¿|°ÍãˆÁ6wÜX..zeA]¸ó ‡[ªŒ‹.×:Oñ.å.ç.f×.¾ .½ÿõ¨.5Öû].¥ ›ÎA/¼¸.Þö‚›í1.Ù’ÈŒ v½Äš ×¢Ñ!Lê«ÚAÁH¬„ TeraTech 8

      Basically J2EE Package Deployment Includes ColdFusion runtime Deploy to J2EE Servers such as JRun, TomCat, WebLogic, WebSpere etc.

The J2EE packaged deployment can be sourceless (optional) and can also omit the CF Administrator (optional).

Create at any ColdFusion Server but deploy only Enterprise edition Need separate license for ColdFusion runtime (otherwise works a developer edition) TeraTech 9

    Compile Source Code (CFM,CFC, and CFR) to create Java byte code The byte code is processed by the JVM - it is not interpreted by the CF runtime But still needs ColdFusion MX 7 to run compiled code and not compatible with old ColdFusion MX versions Deploy into any ColdFusion MX 7 server  No need for any extra license TeraTech 10

 Can be found at ◦ “cf_root/bin” (ColdFusion MX) ◦ “cf_webapp_root/WEB-INF/cfusion/bin” (JRun)    Can be run also for directories Default action is recursively on defined directory Default compile directory is ◦ “cf_webapp_root/WEB-INF/ cfclasses” TeraTech 11

  ◦ ◦ Easy compile: cfcompile webroot [directory-to-compile] C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB INF\cfusion\bin\cfcompile.bat C:\SERVER\Domains\sourceless C:\SERVER\Domains\sourceless\codedir C:\SERVER\Domains\sourceless\codedir\sample.cfm... successful 1 total 1 elapsed 2.453 sec ◦ ◦ Sourceless Compile: cfcompile -deploy webroot directory-to-compile output-directory C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB INF\cfusion\bin\cfcompile.bat -deploy C:\SERVER\Domains\sourceless C:\SERVER\Domains\sourceless\codedir TeraTech 12

Sample Code #loopid#: #Now()# TeraTech 13

- SourceFile /C:\SERVER\Domains\sourceless\codedir\sample.cfm cfsample2ecfm354487559 coldfusion/runtime/CFPage ()V this Lcfsample2ecfm354487559; LocalVariableTable Code bindPageVariables D(Lcoldfus ion/runtime/VariableScope;Lcoldfusion/runtime/LocalScope;)V coldfusion/runtime/CfJspPage LOOPID Lcoldfusion/runtime/Variable; bindPageVariable r(Ljava/lang/String;Lcoldfusion/runtime/ VariableScope;Lcoldfusion/runtime/LocalScope;)Lcoldfusion/runtime/Variable; pageContext #Lcoldfusion/runtime/NeoPageContext; !" com.macromedia.SourceModTime m+ # getOut ()Ljavax/servlet/jsp/JspWriter; %& javax/servlet/jsp/PageContext TeraTech 14

 ◦ ColdFusion MX 7 and Up Both Standard and Enterprise Editions  ◦ ◦ BlueDragon Standard Edition (Server JX) Not in BlueDragon (free) Server Starting from version 6.1 (2004) TeraTech 15

 Let us check some sample code and usage … TeraTech 16

     Macromedia LiveDocs ( http://livedocs.adobe.com/coldfusion/7/htmldocs/00001762.htm

) Designing ColdFusion Applications for Deployment as EAR Files ( http://www.adobe.com/devnet/coldfusion/articles/ear.html

) Protecting Applications with WAR and EAR Packaging and Sourceless Deployment ( http://www.adobe.com/devnet/coldfusion/articles/clustering_06.html

) Deploying Applications with ColdFusion MX 7 ( http://coldfusion.sys con.com/read/48654.htm

) Sourceless / J2EE Deployment ( http://corfield.org/blog/index.cfm/do/blog.entry/entry/Sourceless__J2E E_Deployment ) TeraTech 17

TeraTech

[email protected]

18