|
Re: A silly little tag for architecting FB3
|
je-@grokfusebox.com
|
Jul 27, 2005 13:23 PDT
|
Interesting stuff, Lee. Sort of like the "Pleasantville" technique
I've used: style everything in greyscale until it goes live, then
colorize as it's coded. Your approach is hands-off, though. I may
have to try this on a guinea pig...
- Jeff
On 26 Jul 2005 at 15:04, BORKMAN Lee wrote:
| |
Hi all,
Just mucking around while re-architecting a small app still in FB3.
Built myself a little old-fashioned Custom Tag "cf_include".
Probably others have built similar things before. Would obviously be
easy to implement in FB4+ engines too.
Anyway,here is a samplechunk offbx_switch code:
<cfcase value="User_Start_ACTION,default">
<cfset xfa.onSuccess="vacancies.User_ID_FORM"/>
<cfset xfa.onPositionNonexistent="vacancies.Error_page"/>
<cfset xfa.onPositionClosed="vacancies.Error_page"/>
<cf_include template="sel_position.cfm">
Input:
positionID: attributes.number
Output:
position: recordset
</cf_include>
<cf_include template="in_userid.cfm">
Input:
position: recordset
Output:
fuseaction: attributes.string
positionID: attributes.integer
userID: attributes.string
Responsibilities:
If the Position recordset is non-empty, show a form for
capturing the User's ID
</cf_include>
<cfset request.page.subtitle="User Start - ACTION"/>
</cfcase>
And here is the custom tag, cf_include:
<CFIF thisTag.ExecutionMode is 'end'>
<CFTRY>
<CFINCLUDE TEMPLATE="#attributes.template#">
<CFSET thisTag.GeneratedContent = "">
<CFCATCH TYPE="MissingInclude">
<CFSET thisTag.GeneratedContent = "<p><table border=1
cellpadding=10 cellspacing=0
width=75%><tr><td><h4>#attributes.template#</h4>#htmlcodeformat(thisTa
g.generatedContent)#</td></tr></table>">
</CFCATCH>
</CFTRY>
</CFIF>
Nowyou can run the application. If the required template exists,
it is cfincluded as usual. If it does not exist, then the template
name and enclosed description/specification are displayed. With a
bit of tweaking, the cf_include tag can display any error down at the
fuse level side-by-side with the fuse's specification, which could be
very handy.
Anyways, just a trivial little thing to amuse myself when the air-
conditioning is too hot for real work...
See ya,
LeeBB
IMPORTANT NOTICE: This e-mail and any attachment to it are intended
only to be read or used by the named addressee. It is confidential
and may contain legally privileged information. No confidentiality or
privilege is waived or lost by any mistaken transmission to you. The
RTA is not responsible for any unauthorised alterations to this e-
mail or attachment to it. Views expressed in this message are those
of the individual sender, and are not necessarily the views of the
RTA. If you receive this e-mail in error, please immediately delete
it from your system and notify the sender. You must not disclose,
copy or use any part of this e-mail if you are not the intended
recipient.
|
http://www.GrokFusebox.com
"Fusebox 4 & FLiP: Master-Class ColdFusion Applications"
Now available at ProtonArts.com
|
|
 |
|