Skip to content

Commit

Permalink
ok, almost there in initial refactoring to ColdBox 4
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Jul 31, 2015
1 parent f60cdbe commit 7845477
Show file tree
Hide file tree
Showing 13 changed files with 217 additions and 275 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ workbench/dependencies
Icon?
workbench/build.number
workbench/apidocs/docbox
coldbox/*
testbox/*
modules/*
55 changes: 0 additions & 55 deletions APACHE_LICENSE.TXT

This file was deleted.

71 changes: 22 additions & 49 deletions Application.cfc
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
/**
********************************************************************************
ContentBox - A Modular Content Platform
Copyright 2012 by Luis Majano and Ortus Solutions, Corp
www.ortussolutions.com
********************************************************************************
Apache License, Version 2.0
Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
********************************************************************************
* ContentBox - A Modular Content Platform
* Copyright since 2012 by Ortus Solutions, Corp
* www.ortussolutions.com/products/contentbox
* ---
* Application Bootstrap
*/
component{
// THIS LOADS THE DSN CREATOR WHEN INSTALLING CONTENTBOX FOR THE FIRST TIME
Expand All @@ -29,16 +13,16 @@ component{
// Application properties, modify as you see fit
this.name = "ContentBox-Shell-" & hash( getCurrentTemplatePath() );
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,0,45,0);
this.sessionTimeout = createTimeSpan( 0, 1, 0, 0 );
this.setClientCookies = true;
this.scriptProtect = false;

/**************************************
Railo Specific Settings
LUCEE Specific Settings
**************************************/
// buffer the output of a tag/function body to output in case of a exception
this.bufferOutput = true;
// Activate Railo Gzip Compression
// Activate Gzip Compression
this.compression = false;
// Turn on/off white space managemetn
this.whiteSpaceManagement = "smart";
Expand All @@ -50,20 +34,21 @@ component{
COLDBOX_APP_MAPPING = "";
COLDBOX_CONFIG_FILE = "";
COLDBOX_APP_KEY = "";

// LOCATION MAPPINGS
this.mappings["/contentbox"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox";
this.mappings["/contentbox-ui"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox-ui";
this.mappings["/contentbox-admin"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox-admin";
// THE LOCATION OF EMBEDDED COLDBOX
this.mappings["/coldbox"] = COLDBOX_APP_ROOT_PATH & "coldbox";
this.mappings[ "/cbapp" ] = COLDBOX_APP_ROOT_PATH;
this.mappings[ "/contentbox" ] = COLDBOX_APP_ROOT_PATH & "modules_cb/contentbox";
// THE LOCATION OF EMBEDDED COLDBOX & MODULES
this.mappings[ "/coldbox" ] = COLDBOX_APP_ROOT_PATH & "coldbox";
this.mappings[ "/cborm" ] = COLDBOX_APP_ROOT_PATH & "modules/cborm";

// THE DATASOURCE FOR CONTENTBOX MANDATORY
this.datasource = "contentbox";
// ORM SETTINGS
this.ormEnabled = true;
this.ormSettings = {
// ENTITY LOCATIONS, ADD MORE LOCATIONS AS YOU SEE FIT
cfclocation=[ "model", "modules" ],
cfclocation=[ "models", "modules" ],
// THE DIALECT OF YOUR DATABASE OR LET HIBERNATE FIGURE IT OUT, UP TO YOU TO CONFIGURE
//dialect = "MySQLwithInnoDB",
// DO NOT REMOVE THE FOLLOWING LINE OR AUTO-UPDATES MIGHT FAIL.
Expand All @@ -77,7 +62,7 @@ component{
autoManageSession = false,
// ORM EVENTS MUST BE TURNED ON FOR CONTENTBOX TO WORK
eventHandling = true,
eventHandler = "modules.contentbox.model.system.EventHandler",
eventHandler = "cborm.models.EventHandler",
// THIS IS ADDED SO OTHER CFML ENGINES CAN WORK WITH CONTENTBOX
skipCFCWithError = true
};
Expand All @@ -86,32 +71,20 @@ component{

// application start
public boolean function onApplicationStart(){
application.cbBootstrap = new coldbox.system.Coldbox( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );
application.cbBootstrap = new coldbox.system.Bootstrap( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );
application.cbBootstrap.loadColdbox();
return true;
}

// request start
public boolean function onRequestStart( string targetPage ){

//if( structKeyExists(url,"ormReload") ){ ormReload(); }
//applicationstop();abort;

// Bootstrap Reinit
if( not structKeyExists(application,"cbBootstrap") or application.cbBootStrap.isfwReinit() ){
lock name="coldbox.bootstrap_#this.name#" type="exclusive" timeout="5" throwonTimeout=true{
structDelete(application,"cbBootStrap");
application.cbBootstrap = new coldbox.system.ColdBox( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );
}
// Local Logging
if( structKeyExists( application, "cbController") AND application.cbController.getSetting( "environment" ) == "development" ){
this.ormsettings.logSQL = true;
}

// ColdBox Reload Checks
application.cbBootStrap.reloadChecks();

//Process a ColdBox request only
if( findNoCase( 'index.cfm', listLast( arguments.targetPage, "/" ) ) ){
application.cbBootStrap.processColdBoxRequest();
}
// Process ColdBox Request
application.cbBootstrap.onRequestStart( arguments.targetPage );

return true;
}
Expand Down
85 changes: 60 additions & 25 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,67 @@
{
"name" : "ContentBox Modular CMS",
"version" : "[email protected]@",
"author" : "Ortus Solutions <[email protected]>",
"slug" : "contentbox",
"type" : "cms",
"keywords" : "cms,content management,modular cms",
"homepage" : "http://www.ortussolutions.com/products/contentbox",
"documentation" : "http://contentbox.ortusbooks.com",
"repository" : { "type" : "git", "url" : "https://github.com/Ortus-Solutions/ContentBox" },
"bugs" : "https://ortussolutions.atlassian.net/browse/CONTENTBOX",
"shortDescription" : "A Modular Content Management System",
"createPackageDirectory" : false,
"engines" : [
{ "type" : "railo", "version" : ">4.1" },
{ "type" : "lucee", "version" : ">4.5" },
{ "type" : "adobe", "version" : ">9.0.2" }
"name":"ContentBox Modular CMS",
"version":"[email protected]@",
"author":"Ortus Solutions <[email protected]>",
"slug":"contentbox",
"type":"cms",
"keywords":"cms,content management,modular cms",
"homepage":"http://www.ortussolutions.com/products/contentbox",
"documentation":"http://contentbox.ortusbooks.com",
"repository":{
"type":"git",
"url":"https://github.com/Ortus-Solutions/ContentBox"
},
"bugs":"https://ortussolutions.atlassian.net/browse/CONTENTBOX",
"shortDescription":"A Modular Content Management System",
"createPackageDirectory":false,
"engines":[
{
"type":"lucee",
"version":">4.5"
},
{
"type":"adobe",
"version":">10"
}
],
"license" : [
{ "type" : "Apache2", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }
"license":[
{
"type":"Apache2",
"url":"http://www.apache.org/licenses/LICENSE-2.0.html"
}
],
"contributors" : [
"Joel Watson <[email protected]>", "Brad Wood <[email protected]>", "Curt Gratz <[email protected]>"
"contributors":[
"Joel Watson <[email protected]>",
"Brad Wood <[email protected]>",
"Curt Gratz <[email protected]>"
],
"testbox" : {
"runner" : [
{ "cf10" : "http://cf10contentbox.local/tests/runner.cfm" },
{ "cf11" : "http://cf11contentbox.local/tests/runner.cfm" },
{ "lucee" : "http://luceecontentbox.local/tests/runner.cfm" }
"testbox":{
"runner":[
{
"cf10":"http://cf10contentbox.local/tests/runner.cfm"
},
{
"cf11":"http://cf11contentbox.local/tests/runner.cfm"
},
{
"lucee":"http://luceecontentbox.local/tests/runner.cfm"
}
]
},
"dependencies":{
"coldbox":"4.1.0+00002",
"cborm":"1.0.3",
"cbmailservices":"1.0.0",
"cbsecurity":"1.1.0"
},
"installPaths":{
"coldbox":"coldbox",
"testbox":"testbox",
"cborm":"modules/cborm",
"cbmailservices":"modules/cbmailservices",
"cbsecurity":"modules/cbsecurity"
},
"devDependencies":{
"testbox":"2.0.0"
}
}
37 changes: 10 additions & 27 deletions config/CacheBox.cfc
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
<!-----------------------------------------------------------------------
********************************************************************************
ContentBox - A Modular Content Platform
Copyright 2012 by Luis Majano and Ortus Solutions, Corp
www.ortussolutions.com
********************************************************************************
Apache License, Version 2.0
Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
********************************************************************************
----------------------------------------------------------------------->
<cfcomponent output="false">
<cfscript>
/**
* ContentBox - A Modular Content Platform
* Copyright since 2012 by Ortus Solutions, Corp
* www.ortussolutions.com/products/contentbox
* ---
* CacheBox Configuration
*/
component{

/**
* Configure CacheBox for ColdBox Application Operation
Expand Down Expand Up @@ -70,5 +53,5 @@ limitations under the License.
}
};
}
</cfscript>
</cfcomponent>

}
Loading

0 comments on commit 7845477

Please sign in to comment.