Advertisement
murp

Adding contentbox modules to coldbox

Sep 11th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Yes!  Being able to deploy the ContentBox modules inside any ColdBox app has always been one of it's big features.  Follow these steps to do it:
  2.  
  3. 1. Update ColdBox to latest included on ContentBox
  4. 2. Add orm configurations to parent application.cfc
  5.  
  6. // THE DATASOURCE FOR CONTENTBOX MANDATORY
  7. this.datasource = "contentbox";
  8. // CONTENTBOX ORM SETTINGS
  9. this.ormEnabled = true;
  10. this.ormSettings = {
  11. // ENTITY LOCATIONS, ADD MORE LOCATIONS AS YOU SEE FIT
  12. cfclocation=["model","modules"],
  13. // THE DIALECT OF YOUR DATABASE OR LET HIBERNATE FIGURE IT OUT, UP TO YOU
  14. //dialect = "MySQLwithInnoDB",
  15. // DO NOT REMOVE THE FOLLOWING LINE OR AUTO-UPDATES MIGHT FAIL.
  16. dbcreate = "update",
  17. // FILL OUT: IF YOU WANT CHANGE SECONDARY CACHE, PLEASE UPDATE HERE
  18. secondarycacheenabled = true,
  19. cacheprovider= "ehCache",
  20. // ORM SESSION MANAGEMENT SETTINGS, DO NOT CHANGE
  21. logSQL = false,
  22. flushAtRequestEnd = false,
  23. autoManageSession= false,
  24. // ORM EVENTS MUST BE TURNED ON FOR CONTENTBOX TO WORK
  25. eventHandling = true,
  26. eventHandler= "modules.contentbox.model.system.EventHandler",
  27. // THIS IS ADDED SO OTHER CFML ENGINES CAN WORK WITH CONTENTBOX
  28. skipCFCWithError= true
  29. };
  30. 3. Add ContentBox mappings to parent application.cfc
  31.  
  32. // LOCATION MAPPINGS
  33. this.mappings["/contentbox"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox";
  34. this.mappings["/contentbox-ui"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox-ui";
  35. this.mappings["/contentbox-admin"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox-admin";
  36.  
  37. 3. Drop ContentBox modules into modules folder
  38. 4. Remove the DSN creator module as I am guessing you are integrating, so delete it from disk
  39. 5. Open your parent application's config/ColdBox.cfc and make sure that
  40. a. The SES interceptor is defined
  41.  
  42. //Register interceptors as an array, we need order
  43. interceptors = [
  44.   //SES
  45.   {class="coldbox.system.interceptors.SES"}
  46. ];
  47.  
  48. b. The ORM injection is enabled:
  49.  
  50. // ORM
  51. orm = {
  52.   // Enable Injection
  53.   injection = {
  54. enabled = true
  55.   }
  56. };
  57.  
  58. 4. By default ContentBox UI takes over your application routes and display. You can segregate the module to a separate entry point by opening the ModuleConfig in the ContentBox UI module (/modules/contentbox-ui/ModuleConfig.cfc)  and adding an entry point:
  59.  
  60. // YOUR SES URL ENTRY POINT FOR CONTENTBOX, IF EMPTY IT WILL TAKE OVER THE ENTIRE APPLICATION
  61. // IF YOU WANT TO SECTION OFF CONTENTBOX THEN FILL OUT AN SES ENTRY POINT LIKE /site OR /content
  62. // BY DEFAULT IT TAKES OVER THE ENTIRE APPLICATION
  63. this.entryPoint= "blog";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement