Okay how does XFB handle nested applications?
For example
The fuseaction admin.home would take me to the directory admin and then find
the fuseaction home on the index.cfm.
So now we are in the /admin folder
This folder has subdirectories for say PEOPLE, DEPARTMENTS, PROJECTS, or
whatever.
Each sub directory is its own application and in so much has its own
fuseactions.
Now normally I would handle this by having a cascading list of fuseactions
in the index.cfm switches
That is on the root index.cfm I would have
<cfcase value="admin,adminValidate,adminThis,AdminThat," delimiters=",">
<cfinclude template="admin/index.cfm">
</cfcase>
<cfcase value="Adminprojects,AdminprojectsThis,AdminprojectsThat"
delimiters=",">
<cfinclude template="admin/index.cfm">
</cfcase>
<cfcase value="Admindepartments,AdmindepartmentsThis,AdmindepartmentsThat"
delimiters=",">
<cfinclude template="admin/index.cfm">
</cfcase>
<cfcase value="Adminpeople,AdminpeopleThis,AdminpeopleThat" delimiters=",">
<cfinclude template="admin/index.cfm">
</cfcase>
--The reason I use 3 separate cases is so that I can easily disable the
fuses.
In the admin folder the nested applications would be like this:
<cfcase value="Adminprojects,AdminprojectsThis,AdminprojectsThat"
delimiters=",">
<cfinclude template="projects/index.cfm">
</cfcase>
<cfcase value="Admindepartments,AdmindepartmentsThis,AdmindepartmentsThat"
delimiters=",">
<cfinclude template="departments/index.cfm">
</cfcase>
<cfcase value="Adminpeople,AdminpeopleThis,AdminpeopleThat" delimiters=",">
<cfinclude template="people/index.cfm">
</cfcase>
So to do the same thing in EXB, you would have to have fuseactions that look
like admin.projects.projectsThis
So using ListLast(attributes.fuseaction,'.') and
ListFirst(attributes.fuseaction,'.') in the index pages doesn't work.
One of the reasons I use fusebox is because I subcontract a lot of work.
Some of those subcontracted apps, themselves have mini apps. The way I am
currently integrating this allows for two things:
a) individual directory security that is cfapplication based and LDAP
integrated.
b) the ability to just plugin apps no matter how many
subapplications/directories they contain
So, how is this handled in XFB? I really like the idea of XFB, but this
seems to be a bump in the road. Do we just make a tag that drops the first
thing in the list in each subdirectory? And always use
ListFirst(attributes.fuseaction,'.') in all index.cfm's
That is:
a fuseaction that is admin.projects.projectsThis
/
--- index.cfm----
<cfswitch expression="#ListFirst(attributes.fuseaction,'.')#">
<cfcase value="admin" delimiters=",">
<cfinclude template="admin/index.cfm">
</cfcase>
</cfswitch>
/admin
--- index.cfm----
<cfset attributes.fuseaction = listdeleteat(attributes.fuseaction, 1)>
----the fuseaction becomes projects.projectsThis---
<cfswitch expression="#ListFirst(attributes.fuseaction,'.')#">
<cfcase value="projects" delimiters=",">
<cfinclude template="projects/index.cfm">
</cfcase>
</cfswitch>
/admin/projects
<cfset attributes.fuseaction = listdeleteat(attributes.fuseaction, 1)>
----the fuseaction becomes projectsThis---
<cfswitch expression="#ListFirst(attributes.fuseaction,'.')#">
<cfcase value="projectsThis" delimiters=",">
<cfinclude template="dsp_projects.cfm">
</cfcase>
</cfswitch>
And so on down the tree.....
So maybe a tag that you put in all of the top level fuseactions, and if the
fuseaction isn't contained in that list it drops the first thing in the
fuseaction list. Then this tag could be located on app_locals.cfm of any sub
application.
Sean Renet
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists