<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon Whatley &#187; scope</title>
	<atom:link href="http://www.simonwhatley.co.uk/tag/scope/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simonwhatley.co.uk</link>
	<description>The opposite of every great idea is another great idea</description>
	<lastBuildDate>Wed, 02 Nov 2011 09:28:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Application-Based Paths in ColdFusion</title>
		<link>http://www.simonwhatley.co.uk/application-based-paths-in-coldfusion</link>
		<comments>http://www.simonwhatley.co.uk/application-based-paths-in-coldfusion#comments</comments>
		<pubDate>Fri, 14 Mar 2008 11:20:08 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[Application.cfc]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Administrator]]></category>
		<category><![CDATA[out-of-the-box]]></category>
		<category><![CDATA[out-of-the-box applications]]></category>
		<category><![CDATA[pathing]]></category>
		<category><![CDATA[scope]]></category>
		<category><![CDATA[shared hosting]]></category>
		<category><![CDATA[this]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=457</guid>
		<description><![CDATA[The THIS scope in the Application.cfc contains several built-in variables that allow you to set the properties of the application; the name, session management etc. With the release ColdFusion 8 comes the introduction of application-based pathing in the form of the <code>THIS.mappings</code> and <code>THIS.customTagPaths</code> variables.]]></description>
			<content:encoded><![CDATA[<p>The THIS scope in the Application.cfc contains several built-in variables that allow you to set the properties of the application; the name, session management etc. With the release ColdFusion 8 comes the introduction of application-based pathing in the form of the <code>THIS.mappings</code> and <code>THIS.customTagPaths</code> variables.</p>
<p>The <code>THIS.mappings</code> variable can specify a structure that contains ColdFusion mappings. These settings take precedence over the mappings defined by ColdFusion Administrator Server Settings > Mappings page for the current application. Each structure element consists of the logical path as the key and the absolute path as the value. To use this variable, you must set the Enable Per Application Settings option on the ColdFusion Administrator Server Settings > Settings page.</p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> THIS.mappings<span style="color: #000000;">&#91;</span><span style="color: #009900;">'/com'</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;C:\Inetpub\com&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span></pre></div></div>

<p>This is syntactically equivalent to using the <code>structInsert()</code> function:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> <span style="color: #800080;">structInsert</span><span style="color: #000000;">&#40;</span>THIS.mappings, <span style="color: #009900;">'/com'</span>, <span style="color: #009900;">'C:\Inetpub\com'</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span></pre></div></div>

<p>The <code>THIS.customTagPaths</code> variable can specify a list that contains ColdFusion custom tag paths. These settings take precedence over the custom tag paths defined by the ColdFusion Administrator Server Settings > Mappings page for the current application. To use this variable, you must set the Enable Per Application Settings option on the ColdFusion Administrator Server Settings > Settings page.</p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> THIS.customTagPaths <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;C:\Inetpub\wwwroot\myAppOne\customTags&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span></pre></div></div>

<p>Since we can specify a list, this is also valid:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> THIS.customTagPaths <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;C:\Inetpub\wwwroot\myAppOne\customTags,C:\Inetpub\wwwroot\myAppTwo\customTags&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span></pre></div></div>

<p>Alternatively, we could represent the list as:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> THIS.customTagPaths <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;C:\Inetpub\wwwroot\myAppOne\customTags&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> THIS.customTagPaths <span style="color: #0000ff">=</span> <span style="color: #800080;">listAppend</span><span style="color: #000000;">&#40;</span>THIS.customTagPaths, <span style="color: #009900;">&quot;C:\Inetpub\wwwroot\myAppTwo\customTags&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span></pre></div></div>

<p>For a long time, ColdFusion developers have needed the ability to define application-level settings actually in the application itself. These two new application-based pathing variables bring the ColdFusion developer a step closer to being able to produce out-of-the-box applications that can install in shared environments with little fuss and, more importantly, without the need to access the ColdFusion Adminsitrator to create the necessary mappings and custom tag paths.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/application-based-paths-in-coldfusion/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

