One way would be to utilize the EventContext and call upon the
displayView method (see:
http://www.mach-ii.com/cfcdocs/1-6-0/MachII.framework/MachII.framework.EventContext.html#displayView).

Unfortunately the EventContext is only accessible through plugins and
filters (as far as I can remember off the top of my head).  So what
you may want to do is perform a filter event like this:

<cffunction name="filterEvent" returntype="boolean" access="public"
output="false">
  <cfargument name="event" type="MachII.framework.Event"
required="true" />
  <cfargument name="eventContext" type="MachII.framework.EventContext"
required="true" />

  <!--- assuming your event scope contains a comma-separated list of
views called 'views' --->
  <cfset var views = arguments.event.getArg('views') />
  <cfset var iter = '' />

  <!--- loop through the list and append the values to an argument
called 'viewCollection' --->
  <cfloop list="#views#" index="iter">
    <!--- invoke the eventContext's displayView method --->
    <cfset arguments.eventContext.displayView(event = arguments.event,
viewName = iter, contentArg = 'viewCollection', append = true) />
  </cfloop>

  <!--- now you should have your views appended within the contentArg
of 'viewCollection' --->

  <cfreturn true />
</cffunction>

So within the XML you could have something like this:

<event-handler event="viewLoader" access="public">
  <event-arg name="views" value="A,B,C" /><!-- or some listener method
or anything else that will set a 'views' variable within the event-
scope -->
  <filter name="viewFilter" /><!-- assuming this is what you named
your filter -->
  <view-page name="viewLoader" /><!-- this would essentially output
what is stored within your 'viewCollection' -->
</event-handler>

It kinda breaks the Mach-II methodology, but it's one way to shoehorn
it to your liking.

Adrian.

On Sep 16, 7:18 am, MercuryNewt <[email protected]> wrote:
> Thanks for the suggestion Brian.  That might work, but I was looking
> for a way of picking through the page-views that I had defined in the
> mach-ii.xml file and for any given event, grab individual page-views
> for a client based upon their specific configuration.  Unless I'm
> totally off in left field, I assume that the page-views or at least
> the paths to those views are store in a struct or array similar to a
> pool of available views and that some component within the Mach-II
> framework grabs those views based upon what is defined in an event-
> handler.  I want to be able to do that without specifically defining
> those page-views within an event-handler.  I want to go get them 1 by
> 1 if a client is configured to have a particular view.  So, if views
> A, B, C & D have been defined in the mach-ii.xml file and I have
> clients 1, 2, 3 & 4, when a user logs into client 1's site I would got
> get views A, B & C for the "homepage" event.  But when a user logs
> into client 2's site I would only get A & B for the "homepage" event.
> Make sense?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/
Wiki / Documentation / Tickets: 
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/
-~----------~----~----~----~------~----~------~--~---

Reply via email to