root / framework / branches / dev / fuseboxImplicitFuse.cfc

Revision 448, 3.1 kB (checked in by scorfield, 2 years ago)

Fixed relative path for implicitly discovered fuses in
implicitly discovered circuit directories.

Line 
1<!---
2Copyright 2006 TeraTech, Inc. http://teratech.com/
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15--->
16<cfcomponent output="false"
17                        hint="I represent a fuseaction as a file within an implicit circuit.">
18
19        <cffunction name="init" returntype="any" access="public" output="false"
20                                hint="I am the constructor.">
21                <cfargument name="circuit" type="any" required="false"
22                                        hint="I am the circuit to which this fuseaction belongs. I am required but it's faster to specify that I am not required." />
23                <cfargument name="name" type="any" required="false"
24                                        hint="I am the name of the fuseaction. I am required but it's faster to specify that I am not required." />
25               
26                <cfset variables.circuit = arguments.circuit />
27                <cfset variables.name = arguments.name />
28               
29                <!--- implicit circuit fuseactions are public by default --->
30                <cfset this.access = "public" />
31                <cfset this.permissions = "" />
32               
33                <cfreturn this />
34               
35        </cffunction>
36       
37        <cffunction name="compile" returntype="void" access="public" output="false"
38                                hint="I compile this fuseaction.">
39                <cfargument name="writer" type="any" required="false"
40                                        hint="I am the writer object to which the compiled code should be written. I am required but it's faster to specify that I am not required." />
41       
42                <!--- TODO: really need to do better exception handling --->
43                <cfset arguments.writer.println('<cfinclude template="#getCircuit().getApplication().parseRootPath##getCircuit().getRelativePath()#/#getName()#.cfm" />') />
44
45        </cffunction>
46       
47        <cffunction name="getName" returntype="string" access="public" output="false"
48                                hint="I return the name of the fuseaction.">
49               
50                <cfreturn variables.name />
51               
52        </cffunction>
53
54        <cffunction name="getCircuit" returntype="any" access="public" output="false"
55                                hint="I return the enclosing circuit object.">
56       
57                <cfreturn variables.circuit />
58       
59        </cffunction>
60       
61        <cffunction name="getAccess" returntype="string" access="public" output="false"
62                                hint="I am a convenience method to return this fuseaction's access attribute value.">
63       
64                <cfreturn this.access />
65       
66        </cffunction>
67       
68        <cffunction name="getPermissions" returntype="string" access="public" output="false"
69                                hint="I return the aggregated permissions for this fuseaction.">
70       
71                <cfreturn this.permissions />
72               
73        </cffunction>
74       
75        <cffunction name="getCustomAttributes" returntype="struct" access="public" output="false"
76                                hint="I return the custom (namespace-qualified) attributes for this fuseaction tag.">
77                <cfargument name="ns" type="string" required="true"
78                                        hint="I am the namespace prefix whose attributes should be returned." />
79               
80                <cfreturn structNew() />
81
82        </cffunction>
83
84</cfcomponent>
Note: See TracBrowser for help on using the browser.