Oğuz Demirkapı Sr. Application Developer, TeraTech 1
TeraTech 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 2
TeraTech What is goal? History ColdFusion Code Deployment Methods Code Deployment Details Sample Code 3
TeraTech 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. 4
TeraTech 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 5
TeraTech 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 6
TeraTech 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 ( exploits/cfdecrypt.c) Not secure enough 7
TeraTech Allaire Cold Fusion Template Header Size: New Version.ȆüVHE5:[‰ø„ñ.hqؤä8X°É¿Ìò©‰P^qv.ßNÊÒ‡ù F.Íû'ÉÊE´Žå¿ˆpcw..*¬Ó¦N47Â{{c;.û=Ò“š.ü.ù>eÐ×åR— ˜î¥¡’¡è‡rB^T.½¸6ÛºÀE’)ñf{.âÑôÚ<Üû¶.Y%ŽQÄmBœ4.H.P’.„ ÷ီ¯»~"ß<"©:¥ºmZLìBXIÂÕ¿|°ÍãˆÁ6wÜX..zeA]¸ó ‡[ªŒ‹.×:Oñ.å.ç.f×.¾ w\Œ·.Êó»¢È³‚)8...®Ü—ã\÷.*ÝÐ1Ì4&— ÜÓ¸!®.0¸‰.næ‘YU&.½ÿõ¨.5Öû].¥ ›ÎA/¼¸.Þö‚›í1.Ù’ÈŒ v½Äš ×¢Ñ!Lê«ÚAÁH¬„ 8
TeraTech 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) 9
TeraTech 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 10
TeraTech 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” 11
TeraTech 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 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 12
TeraTech Sample Code #loopid#: #Now()# 13
TeraTech - SourceFile/C:\SERVER\Domains\sourceless\codedir\sample.cfmcfsample2ecfm coldfusion/runtime /CFPage ()V thisLcfsample2ecfm ;LocalVariableTableCodebindPageVariablesD(Lcoldfusion/runtime/Variable Scope;Lcoldfusion/runtime/LocalScope;)Vcoldfusion/runtime/CfJspPage LOOPIDLcoldfusion/runtime/Variable;bindPageVariabler(Ljava/lang/String;Lcoldfusion/runtime/VariableScop e;Lcoldfusion/runtime/LocalScope;)Lcoldfusion/runtime/Variable; com.macromedia.SourceModTimem+ pageContext#Lcoldfusion/runtime/NeoPageContext;!" #getOut()Ljavax/servlet/jsp/JspWriter;%&javax/servlet/jsp/PageContext 14
TeraTech 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) 15
TeraTech Let us check some sample code and usage … 16
TeraTech Macromedia LiveDocs ( Designing ColdFusion Applications for Deployment as EAR Files ( Protecting Applications with WAR and EAR Packaging and Sourceless Deployment ( Deploying Applications with ColdFusion MX 7 ( con.com/read/48654.htm) con.com/read/48654.htm Sourceless / J2EE Deployment ( E_Deployment) E_Deployment 17
TeraTech ? 18