Skip to content

Commit d75cee2

Browse files
committed
moved to new format for automation via Jenkins
1 parent 1eec116 commit d75cee2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+9231
-225
lines changed

Application.cfc

Lines changed: 59 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,62 @@
1-
<!-----------------------------------------------------------------------
1+
/**
22
********************************************************************************
33
Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
4-
www.coldbox.org | www.luismajano.com | www.ortussolutions.com
4+
www.coldboxframework.com | www.luismajano.com | www.ortussolutions.com
55
********************************************************************************
6-
7-
Author : Luis Majano
8-
Date : 10/16/2007
9-
Description :
10-
This is the Application.cfc for usage withing the ColdBox Framework.
11-
Make sure that it extends the coldbox object:
12-
coldbox.system.Coldbox
13-
14-
So if you have refactored your framework, make sure it extends coldbox.
15-
----------------------------------------------------------------------->
16-
<cfcomponent output="false">
17-
<cfsetting enablecfoutputonly="yes">
18-
19-
<!--- APPLICATION CFC PROPERTIES --->
20-
<cfset this.name = hash( getCurrentTemplatePath() )>
21-
<cfset this.sessionManagement = true>
22-
<cfset this.sessionTimeout = createTimeSpan(0,0,30,0)>
23-
<cfset this.setClientCookies = true>
24-
25-
<!--- COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP --->
26-
<cfset COLDBOX_APP_ROOT_PATH = getDirectoryFromPath(getCurrentTemplatePath())>
27-
<!--- The web server mapping to this application. Used for remote purposes or static purposes --->
28-
<cfset COLDBOX_APP_MAPPING = "">
29-
<!--- COLDBOX PROPERTIES --->
30-
<cfset COLDBOX_CONFIG_FILE = "">
31-
<!--- COLDBOX APPLICATION KEY OVERRIDE --->
32-
<cfset COLDBOX_APP_KEY = "">
33-
34-
<!--- on Application Start --->
35-
<cffunction name="onApplicationStart" returnType="boolean" output="false">
36-
<cfscript>
37-
//Load ColdBox Bootstrap
38-
application.cbBootstrap = new coldbox.system.Coldbox( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );
39-
application.cbBootstrap.loadColdbox();
40-
return true;
41-
</cfscript>
42-
</cffunction>
43-
44-
<!--- on Request Start --->
45-
<cffunction name="onRequestStart" returnType="boolean" output="true">
46-
<!--- ************************************************************* --->
47-
<cfargument name="targetPage" type="string" required="true" />
48-
<!--- ************************************************************* --->
49-
<!--- BootStrap Reinit Check --->
50-
<cfif not structKeyExists( application, "cbBootstrap" ) or application.cbBootStrap.isfwReinit()>
51-
<cflock name="coldbox.bootstrap_#hash( getCurrentTemplatePath() )#" type="exclusive" timeout="5" throwontimeout="true">
52-
<cfset structDelete( application, "cbBootStrap" )>
53-
<cfset onApplicationStart()>
54-
</cflock>
55-
</cfif>
56-
<!--- On Request Start via ColdBox --->
57-
<cfset application.cbBootstrap.onRequestStart( arguments.targetPage )>
58-
59-
<cfreturn true>
60-
</cffunction>
61-
62-
<!--- on Application End --->
63-
<cffunction name="onApplicationEnd" returnType="void" output="false">
64-
<!--- ************************************************************* --->
65-
<cfargument name="appScope" type="struct" required="true">
66-
<!--- ************************************************************* --->
67-
<cfset arguments.appScope.cbBootstrap.onApplicationEnd( argumentCollection=arguments )>
68-
</cffunction>
69-
70-
<!--- on Session Start --->
71-
<cffunction name="onSessionStart" returnType="void" output="false">
72-
<cfset application.cbBootstrap.onSessionStart()>
73-
</cffunction>
74-
75-
<!--- on Session End --->
76-
<cffunction name="onSessionEnd" returnType="void" output="false">
77-
<!--- ************************************************************* --->
78-
<cfargument name="sessionScope" type="struct" required="true">
79-
<cfargument name="appScope" type="struct" required="false">
80-
<!--- ************************************************************* --->
81-
<cfset appScope.cbBootstrap.onSessionEnd( argumentCollection=arguments )>
82-
</cffunction>
83-
84-
<!--- OnMissing Template --->
85-
<cffunction name="onMissingTemplate" access="public" returntype="boolean" output="true" hint="I execute when a non-existing CFM page was requested.">
86-
<cfargument name="template" type="string" required="true" hint="I am the template that the user requested."/>
87-
<cfreturn application.cbBootstrap.onMissingTemplate( argumentCollection=arguments )>
88-
</cffunction>
89-
90-
</cfcomponent>
6+
*/
7+
component{
8+
// Application properties
9+
this.name = hash( getCurrentTemplatePath() );
10+
this.sessionManagement = true;
11+
this.sessionTimeout = createTimeSpan(0,0,30,0);
12+
this.setClientCookies = true;
13+
14+
// Mappings Imports
15+
import coldbox.system.*;
16+
17+
// COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP
18+
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );
19+
// The web server mapping to this application. Used for remote purposes or static purposes
20+
COLDBOX_APP_MAPPING = "";
21+
// COLDBOX PROPERTIES
22+
COLDBOX_CONFIG_FILE = "";
23+
// COLDBOX APPLICATION KEY OVERRIDE
24+
COLDBOX_APP_KEY = "";
25+
26+
// application start
27+
public boolean function onApplicationStart(){
28+
application.cbBootstrap = new coldbox.system.Bootstrap( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );
29+
application.cbBootstrap.loadColdbox();
30+
return true;
31+
}
32+
33+
// request start
34+
public boolean function onRequestStart(String targetPage){
35+
36+
// Bootstrap Reinit
37+
if( not structKeyExists(application,"cbBootstrap") or application.cbBootStrap.isfwReinit() ){
38+
lock name="coldbox.bootstrap_#this.name#" type="exclusive" timeout="5" throwonTimeout=true{
39+
structDelete( application, "cbBootStrap" );
40+
onApplicationStart();
41+
}
42+
}
43+
44+
// Process ColdBox Request
45+
application.cbBootstrap.onRequestStart( arguments.targetPage );
46+
47+
return true;
48+
}
49+
50+
public void function onSessionStart(){
51+
application.cbBootStrap.onSessionStart();
52+
}
53+
54+
public void function onSessionEnd( struct sessionScope, struct appScope ){
55+
arguments.appScope.cbBootStrap.onSessionEnd( argumentCollection=arguments );
56+
}
57+
58+
public boolean function onMissingTemplate( template ){
59+
return application.cbBootstrap.onMissingTemplate( argumentCollection=arguments );
60+
}
61+
62+
}

apidocs/Application.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ component{
99

1010
rootPath = REReplaceNoCase( this.mappings[ "/colddoc" ], "apidocs(\\|\/)$", "" );
1111
this.mappings[ "/root" ] = rootPath;
12-
this.mappings[ "/javaloader" ] = rootPath & "modules/javaloader/model";
12+
this.mappings[ "/javaloader" ] = rootPath & "modules/javaloader/models";
1313

1414
// request start
1515
public boolean function onRequestStart(String targetPage){

apidocs/ColdDoc.cfc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
<cfargument name="inputSource" hint="an array of structs containing inputDir and inputMapping" type="array" required="yes"> <!--- of struct --->
6262

6363
<cfscript>
64-
var qFile = 0;
65-
var qMetaData = QueryNew("package,name,extends,metadata,type,implements,fullextends");
64+
var qFiles = 0;
65+
var qMetaData = QueryNew("package,name,extends,metadata,type,implements,fullextends,currentMapping");
6666
var cfcPath = 0;
6767
var packagePath = 0;
6868
var cfcName = 0;
@@ -73,12 +73,15 @@
7373
</cfscript>
7474

7575
<cfloop index="i" from="1" to="#ArrayLen(arguments.inputSource)#">
76-
7776
<cfdirectory action="list" directory="#arguments.inputSource[i].inputDir#" recurse="true" name="qFiles" filter="*.cfc">
7877

7978
<cfloop query="qFiles">
8079
<cfscript>
81-
currentPath = replace(directory, arguments.inputSource[i].inputDir, "");
80+
81+
// skip Application.cfc
82+
if( qFiles.name == "Application.cfc" ){ continue; }
83+
84+
var currentPath = replace(directory, arguments.inputSource[i].inputDir, "");
8285
currentPath = reReplace(currentPath, "[/\\]", "");
8386
currentPath = reReplace(currentPath, "[/\\]", ".", "all");
8487

@@ -113,6 +116,7 @@
113116
QuerySetCell(qMetaData, "name", cfcName);
114117
QuerySetCell(qMetaData, "metadata", meta);
115118
QuerySetCell(qMetaData, "type", meta.type);
119+
QuerySetCell(qMetaData, "currentMapping", arguments.inputSource[i].inputMapping);
116120

117121
implements = getImplements(meta);
118122
implements = listQualify(arrayToList(implements), ':');

apidocs/strategy/api/HTMLAPIStrategy.cfc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
recursiveCopy(basePath & "resources/static", getOutputDir());
3030

3131
//write the index template
32-
args = {path=getOutputDir() & "/index.html", template="#instance.static.TEMPLATE_PATH#/index.html", projectTitle=getProjectTitle()};
32+
args = {path=getOutputDir() & "/index.html", template="#instance.static.TEMPLATE_PATH#/index.cfm", projectTitle=getProjectTitle()};
3333
writeTemplate(argumentCollection=args);
3434

3535
writeOverviewSummaryAndFrame(arguments.qMetaData);
@@ -62,14 +62,14 @@
6262
qInterfaces = getMetaSubquery(qPackage, "type='interface'", "name asc");
6363

6464
writeTemplate(path=currentDir & "/package-summary.html",
65-
template="#instance.static.TEMPLATE_PATH#/package-summary.html",
65+
template="#instance.static.TEMPLATE_PATH#/package-summary.cfm",
6666
projectTitle = getProjectTitle(),
6767
package = package,
6868
qClasses = qClasses,
6969
qInterfaces = qInterfaces);
7070

7171
writeTemplate(path=currentDir & "/package-frame.html",
72-
template="#instance.static.TEMPLATE_PATH#/package-frame.html",
72+
template="#instance.static.TEMPLATE_PATH#/package-frame.cfm",
7373
projectTitle = getProjectTitle(),
7474
package = package,
7575
qClasses = qClasses,
@@ -115,7 +115,7 @@
115115
}
116116

117117
writeTemplate(path=currentDir & "/#name#.html",
118-
template="#instance.static.TEMPLATE_PATH#/class.html",
118+
template="#instance.static.TEMPLATE_PATH#/class.cfm",
119119
projectTitle = getProjectTitle(),
120120
package = arguments.qPackage.package,
121121
name = arguments.qPackage.name,
@@ -145,16 +145,16 @@
145145

146146
<cfscript>
147147
writeTemplate(path=getOutputDir() & "/overview-summary.html",
148-
template="#instance.static.TEMPLATE_PATH#/overview-summary.html",
148+
template="#instance.static.TEMPLATE_PATH#/overview-summary.cfm",
149149
projectTitle = getProjectTitle(),
150150
qPackages = qPackages);
151151

152152

153153
//overview frame
154154
writeTemplate(path=getOutputDir() & "/overview-frame.html",
155-
template="#instance.static.TEMPLATE_PATH#/overview-frame.html",
155+
template="#instance.static.TEMPLATE_PATH#/overview-frame.cfm",
156156
projectTitle=getProjectTitle(),
157-
qPackages = qPackages);
157+
qMetaData = arguments.qMetaData);
158158
</cfscript>
159159
</cffunction>
160160

@@ -164,7 +164,7 @@
164164
arguments.qMetadata = getMetaSubquery(query=arguments.qMetaData, orderby="name asc");
165165

166166
writeTemplate(path=getOutputDir() & "/allclasses-frame.html",
167-
template="#instance.static.TEMPLATE_PATH#/allclasses-frame.html",
167+
template="#instance.static.TEMPLATE_PATH#/allclasses-frame.cfm",
168168
qMetaData = arguments.qMetaData);
169169
</cfscript>
170170
</cffunction>

0 commit comments

Comments
 (0)