Changeset 2436


Ignore:
Timestamp:
06/27/10 04:34:47 (20 months ago)
Author:
mattlevine
Message:
  1. Adding the ability to have theme local contentRenderer.cfc files. Changed it so that each request gets it's own instance of a theme contentRenderer.cfc and the Mura scope lookup first looks into the theme renderer and then the site render. This reverses the previous statement about the hierarchy.
Location:
branches/5.2/www/requirements/mura
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2/www/requirements/mura/Handler/standardSetContentRendererHandler.cfc

    r2434 r2436  
    2424<cffunction name="handle" output="false" returnType="any"> 
    2525        <cfargument name="event" required="true"> 
    26          
    27         <cfset event.setValue('contentRenderer',createObject("component","#event.getSite().getAssetMap()#.includes.contentRenderer").init(event))/> 
    28         <cfset event.setValue("themeRenderer",event.getSite().getThemeRenderer())> 
     26        <cfset var $=event.getValue("muraScope")> 
     27        <cfset event.setValue('contentRenderer',createObject("component","#event.getSite().getAssetMap()#.includes.contentRenderer").init(event=event,$=$,mura=$))/> 
     28        <cfif fileExists(expandPath(event.getSite().getThemeIncludePath()) & "/contentRenderer.cfc")> 
     29                <cfset event.setValue("themeRenderer",createObject("component","#event.getSite().getThemeAssetMap()#.contentRenderer").init(event=event,$=$,mura=$))> 
     30        </cfif> 
    2931</cffunction> 
    3032 
  • branches/5.2/www/requirements/mura/MuraScope.cfc

    r2435 r2436  
    3333                <cfif isObject(getEvent()) and structKeyExists(variables.instance.event,MissingMethodName)> 
    3434                        <cfset object=variables.instance.event> 
     35                <cfelseif isObject(getThemeRenderer()) and structKeyExists(getThemeRenderer(),MissingMethodName)> 
     36                        <cfset object=getThemeRenderer()> 
    3537                <cfelseif isObject(getContentRenderer()) and structKeyExists(getContentRenderer(),MissingMethodName)> 
    3638                        <cfset object=getContentRenderer()> 
    37                 <cfelseif isObject(getThemeRenderer()) and structKeyExists(getThemeRenderer(),MissingMethodName)> 
    38                         <cfset object=getThemeRenderer()> 
    3939                <cfelseif isObject(getContentBean()) and structKeyExists(getContentBean(),MissingMethodName)> 
    4040                        <cfset object=getContentBean()> 
     
    6868                        <cfset event("contentRenderer",request.contentRenderer)> 
    6969                <cfelseif len(event('siteid'))> 
    70                         <cfset event("contentRenderer",createObject("component","#siteConfig().getAssetMap()#.contentRenderer").init(event))> 
     70                        <cfset event("contentRenderer",createObject("component","#siteConfig().getAssetMap()#.contentRenderer").init(event=event,$=event("muraScope"),mura=event("muraScope") ) )> 
    7171                <cfelseif structKeyExists(application,"contentRenderer")> 
    7272                        <cfset event("contentRenderer",application.contentRenderer)> 
     
    8585 
    8686<cffunction name="getThemeRenderer" output="false" returntype="any"> 
    87         <cfreturn event("themeRenderer")> 
     87        <cfif isObject(event("themeRenderer"))> 
     88                <cfreturn event("themeRenderer")> 
     89        <cfelseif len(event('siteid')) and fileExists(expandPath(siteConfig().getThemeIncludePath()) & "/contentRenderer.cfc" )> 
     90                <cfset event("themeRenderer",createObject("component","#siteConfig().getThemeAssetMap()#.contentRenderer").init(event=event,$=event("muraScope"),mura=event("muraScope") ) )> 
     91        <cfelse> 
     92                <cfreturn event("themeRenderer")> 
     93        </cfif> 
     94</cffunction> 
     95 
     96<cffunction name="setThemeRenderer" output="false" returntype="any"> 
     97        <cfargument name="themeRenderer"> 
     98        <cfif isObject(arguments.themeRenderer)> 
     99                <cfset event("themeRenderer",arguments.themeRenderer)> 
     100        </cfif> 
     101        <cfreturn this> 
    88102</cffunction> 
    89103 
  • branches/5.2/www/requirements/mura/event.cfc

    r2434 r2436  
    188188        <cfif not valueExists("contentRenderer")> 
    189189                <cfset setValue("contentRenderer",createObject("component","#application.settingsManager.getSite(getValue('siteid')).getAssetMap()#.includes.contentRenderer").init(this))> 
     190        </cfif> 
     191        <cfif not valueExists("themeRenderer") and fileExists(expandPath(getSite().getThemeIncludePath()) & "/contentRenderer.cfc")> 
     192                <cfset setValue("themeRenderer",createObject("component","#getSite().getThemeAssetMap()#.contentRenderer").init(event=this,$=getValue('MuraScope'),mura=getValue('MuraScope')))> 
    190193        </cfif>  
    191194        <cfif not valueExists("localHandler") and fileExists(expandPath("/#application.configBean.getWebRootMap()#") & "/#getValue('siteid')#/includes/eventHandler.cfc")> 
    192195                <cfset setValue("localHandler",createObject("component","#application.configBean.getWebRootMap()#.#getValue('siteid')#.includes.eventHandler").init())> 
    193196        </cfif> 
    194  
    195         <cfset setValue("themeRenderer",application.settingsManager.getSite(getValue("siteID")).getThemeRenderer())> 
    196197         
    197198        <cfreturn this> 
Note: See TracChangeset for help on using the changeset viewer.