MuraCon 2012 - Creating a Mura CMS plugin with FW/1

3,201 views
3,011 views

Published on

My presentation about building Plugins in Mura CMS using FW/1.

Includes updates to base Mura FW/1 plugin, including support for Auto Deploying plugins (Very handy!!)

Presented August 2011 in Sacramento at MuraCon 2011. Any questions please find me @JasPanesar.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,201
On SlideShare
0
From Embeds
0
Number of Embeds
856
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

MuraCon 2012 - Creating a Mura CMS plugin with FW/1

  1. 1. Creating a Mura CMS Plugin with FW/1 @JasPanesar jas@damaag.com blog: panesar.net MuraCon 2012 - Washington, DC - October 10 2012Wednesday, 10 October, 12 1
  2. 2. Today Why Mura FW/1 Why Q/A Intro Plugins Plugin FW/1 ... or Rock Quickstart ~50 minutes to Mura Plugin ZenWednesday, 10 October, 12 2
  3. 3. Jas • Made in Canada, eh. • Lead Architect + Integrator @ Damaag.com • I love building and integrating software systems that answer one question: Where is everything at? • Custom web + mobile development of product Enterprise products, projects across NA • 20 in 10: SMB + Enterprise consulting since 99. • Big fan of lean methodologies.Wednesday, 10 October, 12 3
  4. 4. Jas: ColdFusion + • ColdFusion since 98 just as 4.0 came out. Fusebox, ColdBox.. • Guilty Polyglot: .NET, J2EE, Lotus Notes, SAP + more • Custom development for retail (The Brick), manufacturing, shipping, logistics, workflow, legal, eLearning, eServices, eCommerce + beyond. • Connecting the dots: Reporting, BI, accounting systems, ERP, shipping systems, JIT / lean manufacturing, barcoding and scanning everything imaginable, workflow management systems • CFML has remained the vital and productive glue to connect everything to everything and more.Wednesday, 10 October, 12 4
  5. 5. My Journey to Mura • Started: Mura 5.1 ish before plugins. Lots of potential, upgrading was tougher after customizing. • Mura seemed more like a platform than a CMS to me. • Mura seemed very different than the other CMS’ I used.Wednesday, 10 October, 12 5
  6. 6. What I needed from Mura • Do things one way, in one place. • Actually "reuse code". • Modularity in both back and front end. • Avoid the 80% of app support logic we implement over and over • I just want to build business logic and solve problems! • Frameworks like Coldbox are great, but I want more platform with the framework.Wednesday, 10 October, 12 6
  7. 7. I was hesitant.. • Like anyone unsure about a new system. • Jas bugs Malcolm about A/B testing • Jas bugs Matt about something • Jas meets the Grant • Jas asks the Grant "how do you best do.." x1000. Eureka. • Jas is unhappy Mura didnt exist in 1999.Wednesday, 10 October, 12 7
  8. 8. Let’s connect you to plugins • How many Designers? Devs? Managers? • Years of CFML experience? • Mura experience? • Plugin experience? With FW/1?Wednesday, 10 October, 12 8
  9. 9. Why do plugins Make the world go round?Wednesday, 10 October, 12 9
  10. 10. Plugins make life easier* • Plugins aid every skill level. • Plugins reduce re-inventing the wheel. • Plugins encourage time to be spent solving new problems. • Every plugin saves time. * May only be in Mura CMSWednesday, 10 October, 12 10
  11. 11. Why Plugins are a big deal for Developers • Mura Plugins make + keep customization easier • Mura is actually, easily extensible & easily upgradeable. • Avoid The Application Logic trap and build your custom business logic quickly • Spend your time on solving actual problems instead of wasting cycles on your stack. • Ever tried writing / understanding a plugin for any other CMS?Wednesday, 10 October, 12 11
  12. 12. Why Plugins are a big deal for Designers • More output from less hours: Extremely quick Turn-key websites ala WP, if not quicker. • Extremely easy to develop themes for. Convert existing, or create a new one. • Enjoy website backup + restoration with site bundler. Why spend $75 on BackupBuddy plugin for WP? • Themes that actually work and load the first time. Ever tried loading / creating a theme made for another CMS? • Mura’s site manager is yet to intimidate a non-technical end user. Self managed sites = happy clients. • Developers can be found to do custom coding. If a dev knows FW/1 or Coldbox, they can start with Mura.Wednesday, 10 October, 12 12
  13. 13. Plugins Grow Ecosystems • Your Personal Ecosystems apps and sites • Mura Ecosystems • ColdFusion Ecosystems • Designer Ecosystems (WP, etc) • CMS Ecosystems (Drupal, Joomla, etc.)Wednesday, 10 October, 12 13
  14. 14. Plugins are a big deal for Managers • The #1 cost in software dev is labour. • Easier to answer the one question every org asks.. Where is everything at? • Mura gets more done, with less effort. Using CFML is another multiplier. • Custom Mura plugins let you connect + share data in any separate system to a central Mura portal easily. • Boost profitability, savings, and value by connecting information to create insights that weren’t as easily possible.Wednesday, 10 October, 12 14
  15. 15. Why Mura Plugins? Plugins grow ecosystems. Customers Need it all! Mura CMS Agencies Designers Consultants Plugins Themes Developers I wish I had one I wish I had one More plugins + themes = place to get place to do Easier, and easier adoption. everything.. everything..Wednesday, 10 October, 12 15
  16. 16. Plugins + Themes. More Mura, Plugins + Themes uptake Easier Mura Usage++ More design + Community++ dev Commerce++ Customer needs growWednesday, 10 October, 12 16
  17. 17. Everyone needs plugins, even that weird one. • No plugin is too lonely, simple, or has code thats too ugly, especially if you use FW/1.   • Put it on GitHub, and let someone improve it with you.  Wednesday, 10 October, 12 17
  18. 18. Why does every plugin have value? • "I cant be the first one with this need... There has to be a plugin.." • Small plugins still save big time. In the short + long term, do you really want to hand code the weather in? • Big plugins = entire applications. Plugins + FW/1 let create apps inside Mura easilyWednesday, 10 October, 12 18
  19. 19. A small challenge. • Today, get involved in the plugin conversation. Let’s keep talking. Let it be any idea. • Designers: throw some ideas out on the Mura forums See if someone’s interested. • Developers: solve the next small problem you have with a plugin, or one on the Forum, or find a WP plugin you like and..Wednesday, 10 October, 12 19
  20. 20. Maybe building a plugin isn’t so bad after all.. But is it really that easy? How can FW/1 make it easy when so many other CMS’ can’t?Wednesday, 10 October, 12 20
  21. 21. FW/1 is not your average framework. • FW/1 is invisible. Convention > Configuration = One of the most invisible MVC frameworks Ive enjoyed. • FW/1 does everything, and nothing. Does nothing but leaves nothing undone. Performant too. • FW/1 stays out of the way. Doesnt aim to solve every problem Ive ever had before I have it. I appreciate that. • FW/1 lets you do it your way. Roll your own user login, tie into external authentication, or use entire Mura platform in FW/1.Wednesday, 10 October, 12 21
  22. 22. FW/1 fits all situations. • Proof of concept. Extremely quick to build a plugin instead of throwaway code. • Weekend/hobby projects. FW/1 builds and organizes as you go. It grows with you. • Build entire web apps. Ever dream of just starting to build business logic functionality without caring about login/out/security...? • Software as a Service startup. Between CF, Mura and FW/1.Wednesday, 10 October, 12 22
  23. 23. They say you know when you know.. • FW/1 plugins complement Mura perfectly. Plugins and CMS fit each other so well that I havent found in many other CMS’. • Mura and FW/1 may be a near perfect marriage. Mura handles app logic. FW/1 keeps your business logic organized. • How can you start solving your problems today?Wednesday, 10 October, 12 23
  24. 24. Mura Plugin QuickStart! So quick Ill do it hands free.Wednesday, 10 October, 12 24
  25. 25. First, How do Mura Plugins work? • Plugins are installed globally. All sites can be given access to it in Site Settings > Global Settings > Plugins Tab • Plugins have display objects. Display objects are a plugins’ views that embed in a page. FW/1 manages these views very well. • Display objects are embedded in a Mura page under Content Objects. Thats all.Wednesday, 10 October, 12 25
  26. 26. Layers of FW/1 Plugin File Structure • Config Layer We need to edit/set these up before starting. • Sub-system Layer Easily separate admin screens from public/end-user screens. - Admin pages render inside Mura Admin - Public Subsystem pages render in CMS PagesWednesday, 10 October, 12 26
  27. 27. Mura FW/1 folders • /assets stores your Plugins Assets, css, Etc. • /model can be created manually to store ORM or DAL using FW/1 examples.Wednesday, 10 October, 12 27
  28. 28. Mura FW/1 structure • FW/1 Subsystems separate Client + Admin Logic • Mura Plugin has Admin + Public subsystems as default. - Admin pages rendering inside Mura Admin - Public Subsystem pages rendering in CMS pages for end-user • Access Mura scope inside plugin via rc.$Wednesday, 10 October, 12 28
  29. 29. Step 1: Download. • Download the latest FW/1 base plugin from Marketplace • http://bit.ly/mura-fw1-plugin • Mura FW/1 Plugin is an *almost* ready-to-upload ZIP file • ... first a tiny bit of config .. ... then zip up the plugin folder to deploy the pluginWednesday, 10 October, 12 29
  30. 30. Step 2a: Configure. • Before we begin... Name the plugin • We need a display App name App Name: “MuraCon Plugin” • We need a unique package name Pkg Name: “MuraConPlugin” (Unique, no spaces)Wednesday, 10 October, 12 30
  31. 31. Step 2b: Configure. • Setup the plugin with a unique app name + unique package name App Name: “MuraCon Plugin” Pkg Name: “MuraConPlugin” • /plugin/config.xml.cfm • Plugin Name • Package Name • Unique Version # • /fw1config.cfm • UNIQUE Package Name is used everywhere! ?PackageNameAction=subsystem:cfcName.FunctionName • set framework.reloadApplicationOnEveryRequest = true; • Zip the folder up into an archive to load into your Mura install.Wednesday, 10 October, 12 31
  32. 32. Step 2c: Auto Deploy Plugin. • New since MuraCon 2011 • config/settings.ini.cfm set autoDiscoverPlugins=true • ..clone your plugin into /plugins and reload Mura! • plugin/config.xml set <autodeploy>true</autodeploy> to make it live <siteid>siteA,siteB</siteID> • ...autodeploy a site straight from source code control!Wednesday, 10 October, 12 32
  33. 33. Step 2: Configure.Wednesday, 10 October, 12 33
  34. 34. Step 3: Upload • Upload your updated plugin file into Mura via Mura Admin > Global Settings > Plugins • We’re almost ready to start coding a plugin while installed in Mura.Wednesday, 10 October, 12 34
  35. 35. Step 3: Upload.Wednesday, 10 October, 12 35
  36. 36. Step 4: Develop. • Let’s build an Admin feature • New admin subsystem action called users.list to list all users in the systemWednesday, 10 October, 12 36
  37. 37. Step 4a. Let’s refresh.. FW/1 MVC • If your plugin URL is ?PackageNameaction=public:main.home .. FW/1 will call in this order: • First the code in a function called home() located in {Mura Dir}/{plugin dir}/public/controllers/main.cfc • Second your view (output to screen) in {Mura Dir}/plugin dir}/public/views/main/home.cfm • *** Move information between controller and view through the request context (rc) • Get the FW/1 Cheatsheet! http://bit.ly/fw1cheatsheetWednesday, 10 October, 12 37
  38. 38. Step 4b. Let’s refresh.. Datasources • Prefix all field + table names (“mcp_”) • No matter how, prefix custom tables ie.. “mcp_” for muraConPlugin • Mura Datasource • Seperate Datasource • ORMWednesday, 10 October, 12 38
  39. 39. Step 4c: Develop.Wednesday, 10 October, 12 39
  40. 40. Step 4d: Develop • Let’s build an public feature • New public subsystem action called users.list to list all users in the systemWednesday, 10 October, 12 40
  41. 41. Step 4d: Public DevWednesday, 10 October, 12 41
  42. 42. Step 4e: Forms..!Wednesday, 10 October, 12 42
  43. 43. Step 5: Package it. • Download your completed plugin as a zip file • SCM is possible with Mura / Plugins too..Wednesday, 10 October, 12 43
  44. 44. Step 6: Release. • Upload your plugin to GitHub and Mura Plugin Marketplace • Seriously.Wednesday, 10 October, 12 44
  45. 45. Step 7: Repeat. • Betcha cant make just one. • Need a Plugin contest.. like TwilioWednesday, 10 October, 12 45
  46. 46. Next steps.. • Start some conversations • About plugin ideas while you’re here. • Links • bit.ly/mura-fw1-plugin • bit.ly/murafw1cheatsheet • http://bit.ly/submit-fw1-plugin • github.com • Contact Me • Jas Panesar jas.panesar@damaag.com Twitter: @JasPanesarWednesday, 10 October, 12 46
  47. 47. Q&A MuraCon - Creating Mura CMS Plugins with FW/1 @JasPanesar blog: www.panesar.net www.damaag.com - Jas@Damaag.Com Connect with me anytime!Wednesday, 10 October, 12 47

×