|
Re: A silly little tag for architecting FB3
|
James Husum
|
Jul 28, 2005 04:41 PDT
|
Greetings,
Very nifty Lee. I'm in the process of putting together a FB3 site at the
moment and this will come in rather handy.
Thanks!
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 sample chunk of fbx_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(thisTag.generatedContent)#</td></tr></table>">
</CFCATCH>
</CFTRY>
</CFIF>
Now you 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.
|
--
James Husum
Visit the Writers' Portal - http://www.smotu.org/
Brainsludge- all the shtuff running around my brain - http://www.brainsludge.com/
Interested in Science Fiction TV? I need your input! - http://www.scifitvfans.com/polls/
Currently reading: Mind Hacks by Tom Stafford and Matt Webb
|
|
 |
|