<rss version="2.0"><channel><title>RSS feed for InstantSpot site Aaron Lynch</title><link>http://ajlcom.instantspot.com</link><description>ColdFusion and some other stuff</description><language>en-us</language><copyright>This work is Copyright &#xA9; 2008 by Aaron Lynch</copyright><generator>RSSVille ColdFusion FeedMaker, version 1.0</generator><pubDate>Thu, 28 Aug 2008 08:25:07 GMT</pubDate><item><title>Never use .CSS files again</title><link>http://ajlcom.instantspot.com/blog/2006/11/03/Never-use-CSS-files-again</link><description>&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
---AKA really really dynamic style
sheets---
&lt;/p&gt;
&lt;!--
@page { size: 8.5in 11in; margin: 0.79in }
P { margin-bottom: 0.08in }
--&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
Recently I blogged about they new way I
am &lt;a href=&quot;http://aaronjlynch.com/blog/index.cfm/2006/10/26/Secure-your-XML&quot;&gt;serving XML data&lt;/a&gt;  to my apps and, thinking along those same lines, 
I decided to serve up the .css  &amp;ldquo;files&amp;rdquo; in much the same manner. 
The need to deliver completely separate styles to the same layout is
not that uncommon if you are writing an application that will give
the user a choice of  &amp;ldquo;skins&amp;rdquo; (as we do on &lt;a href=&quot;http://www.instantspot.com&quot;&gt;InstantSpot.com&lt;/a&gt; ).
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
Here is a basic run-down:
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
Let&amp;#39;s say, we have an object  &amp;ldquo;Skin&amp;rdquo;
which has, as one of its attributes, Style.  Style contains the
actual css info that would normally be housed in your style.css (or
whatever you called it) style sheet. 
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
Now, we have a layout that needs to
link to some style sheet, or we would have a pretty plain looking
site.  Normally there would be a link to a file under the web root
like: 
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;lt;link
rel=&amp;quot;stylesheet&amp;quot; xhref=&amp;quot;/skins/style.css&amp;quot;
type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;/strong&gt; 
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
Since, in this scenario, we don&amp;#39;t
really have anymore style.css anywhere we need to have some new way
to style our site.  One possibility, we could create a Mach-II event
called &amp;ldquo;style.css&amp;rdquo; that pulls that data from the Skin object, and
passes it on to the view. 
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;lt;event-handler event=&amp;rdquo;Style.css&amp;rdquo;
access=&amp;rdquo;public&amp;rdquo;&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;notify listener=&amp;rdquo;StyleListener&amp;rdquo;
method=&amp;rdquo;getStyle&amp;rdquo; resultArg=&amp;rdquo;CSS&amp;rdquo; /&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;view-page name=&amp;rdquo;showCSS&amp;rdquo; /&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;lt;/event-handler&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
ShowCSS  is simple a cfcontent and a
cfoutput much like my other dumb XML view.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;lt;cfcontent type=&amp;rdquo;text/css&amp;rdquo;&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;lt;cfoutput&amp;gt;#event.getArg(&amp;ldquo;CSS&amp;rdquo;)#&amp;lt;/cfoutput&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
And finally, we can now link in that
new style sheet via our Mach-II event.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;&amp;lt;link
rel=&amp;quot;stylesheet&amp;quot; xhref=&amp;quot;/index.cfm/event/style.css&amp;quot;
type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
voila...no more style.css files.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
I have used other methods for using
&lt;a href=&quot;http://ajlcom.instantspot.com/blog/index.cfm/2006/8/1/Dynamic-CSS-with-ColdFusion&quot;&gt;dynamic data in a stylesheet before&lt;/a&gt; &amp;nbsp;
but there is something beautiful to me about using the Mach-II event.
Also, the .css extension on the event name might appease the
validators out there.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
PS.  There is more to this story, stay
tuned for the real reason we needed &amp;ldquo;really really dynamic style
sheets&amp;rdquo;
&lt;/p&gt;
</description><pubDate>Fri, 03 Nov 2006 20:52:28 GMT</pubDate><guid>http://ajlcom.instantspot.com/blog/2006/11/03/Never-use-CSS-files-again</guid><category>MachII</category></item><item><title>Secure your XML</title><link>http://ajlcom.instantspot.com/blog/2006/10/26/Secure-your-XML</link><description>First off, I need to reiterate how great it is to work with Mach-II.&amp;nbsp; It is my best friend.&lt;br /&gt;
&lt;br /&gt;
Second...the issue at hand.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m using a few XML &amp;#39;documents&amp;#39; to feed SPRY ds&amp;#39;s in secured areas of my app, all of which containing sensitive data.&amp;nbsp; &lt;br /&gt;
I don&amp;#39;t want to a) actually write any of the content to a file, or b) allow unauthorized users to ever get to or see that data.&lt;br /&gt;
&lt;br /&gt;
As it turns out its fairly simple to do.&lt;br /&gt;
&lt;br /&gt;
Instead of defining the location of an XML file for my Spry ds like&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; new Spry.Data.XMLDataSet(&amp;quot;UserAccounts.xml&amp;quot;, &amp;quot;useraccounts/useraccount&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
I merely supply that DataSet call with the link to a Mach-II event like so... (I named the event with a &amp;#39;.xml&amp;#39; extension just because I thought it was cool, it is not required)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; new Spry.Data.XMLDataSet(&amp;quot;/index.cfm/event/UserAccounts.xml&amp;quot;, &amp;quot;useraccounts/useraccount&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff3300&quot;&gt;warning...pseudo-code ahead:&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
Then, my event-handler only needs to a)check authentication, b) generate the content, c) pass it to a dumb view.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;event-handler event=&amp;quot;UserAccounts.xml&amp;quot; access=&amp;quot;public&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;filter name=&amp;quot;CheckAdminLogin&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;notify listener=&amp;quot;CustomerAdminListener&amp;quot; method=&amp;quot;generateUserAccountsXML&amp;quot; resultArg=&amp;quot;XML&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;view-page name=&amp;quot;showXml&amp;quot; /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/event-handler&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(I won&amp;#39;t get in to actually creating valid XML since that isn&amp;#39;t really relevant to this post.)&lt;br /&gt;
&lt;br /&gt;
Once that listener has created the eventArg and passed it to the view, all the view does is something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cfcontent type=&amp;quot;text/xml&amp;quot; reset=&amp;quot;yes&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cfoutput&amp;gt;#event.getArg(&amp;quot;XML&amp;quot;)#&amp;lt;/cfoutput&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The end...&lt;br /&gt;
&lt;br /&gt;
</description><pubDate>Thu, 26 Oct 2006 17:57:07 GMT</pubDate><guid>http://ajlcom.instantspot.com/blog/2006/10/26/Secure-your-XML</guid><category>MachII</category></item><item><title>Mach-II, Event Chains, And You</title><link>http://ajlcom.instantspot.com/blog/2006/10/19/MachII-Event-Chains-And-You</link><description>&lt;!--
@page { size: 8.5in 11in; margin: 0.79in }
P { margin-bottom: 0.08in }
--&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;font size=&quot;1&quot;&gt;(Let me preface this by saying the
general concept is successful, but the actual reason I created this
plugin has yet to be addressed...so it may or may not be&lt;/font&gt; the best
solution for the problem at hand.)
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
We have decided that we want to
assemble some user interface sections out of a few different events
(Mach-II Events) but, throughout the process we may or may not want
to do some event mapping to dynamically call events in that process.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;strong&gt;Example:&lt;/strong&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
We want to have an event that sets
specific args  (title, dimensions, data, whatever) that gets passed
to  another event that will assemble that info into a &amp;#39;dumb&amp;#39; form
layout, or form widget, etc.  Now, the big deal here is that these
dumb widgets are going to be used by any number of other events so
they must be able to accept info from previous events, and decide
whether or not to continue announcing other events to complete the
request.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
The hour long drive home yesterday got
me thinking of a way to gracefully dictate that event flow, while
still being very clear in the controller (the machii config xml) what
was going to happen on that request.  The EventChain plugin was born
out of that brainstorming session.  
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
The EventChainPlugin simply has a
postEvent() process that looks for the existence of an event-arg
named &amp;ldquo;EventChain&amp;rdquo; which is a comma delimited list of event names
you would like to have run in that request.  In the very first event
that is run on the request, you build your chain and let the plugin
do the rest.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;event-handler name=&amp;rdquo;Event1&amp;rdquo;&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;event-arg name=&amp;rdquo;EventChain&amp;rdquo;
value=&amp;rdquo;event2,event3,event4,event5&amp;rdquo; /&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- 
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; do event stuff here
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ---&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/event-handler&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;event-handler name=&amp;rdquo;Event2&amp;rdquo;&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- 
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; do event stuff here
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ---&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/event-handler&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
and so on... 
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
(notice:  only assign the arg in that
initial event if you want to be able to use your other events
wherever you want)
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
If you don&amp;#39;t supply the EventChain arg,
or it finishes its list of events, it just rests peacefully waiting
for the next chain.
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0in&quot;&gt;
&lt;a href=&quot;http://www.worldwildweb.biz/aaron/EventChainPlugin.cfc.zip&quot;&gt;click here to download
EventChainPlugin.cfc &lt;/a&gt; &lt;br /&gt;
&lt;/p&gt;
</description><pubDate>Thu, 19 Oct 2006 15:47:03 GMT</pubDate><guid>http://ajlcom.instantspot.com/blog/2006/10/19/MachII-Event-Chains-And-You</guid><category>MachII</category></item><item><title>Robots and main page accessibility</title><link>http://ajlcom.instantspot.com/blog/2005/11/15/Robots-and-main-page-accessibility</link><description>On my quest towards e-stardom (aka a relevant and content-rich website), I realized that the navigation towards my older &amp;quot;news items&amp;quot; was somewhat lacking.  My solution for this problem was to create a side bar menu that would contain all of the news item titles in descending date order (aka newest first). &lt;br /&gt;
&lt;br /&gt;
A day or two after this change, I began to notice a positive side-effect to including all of these titles as links on the main page...The robots (spiders) were crawling all through my site!  I&amp;#39;m not 100% sure, but I can&amp;#39;t imagine how this increased indexing would hurt my chances of being returned in some search results.&lt;br /&gt;
&lt;br /&gt;
In a possibly related subject, a Google search for &amp;#39;Aaron Lynch&amp;#39; now returns this page in the top 10 search results (#6 as of this entry) and an MSN search returns &lt;a href=&quot;http://www.aaronjlynch.com&quot;&gt;www.AaronJLynch.com&lt;/a&gt; as #3!&lt;br /&gt;
&lt;br /&gt;
Does anybody want my autograph?  &lt;img src=&quot;/fckeditor/editor/images/smiley/msn/wink_smile.gif&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
UPDATE 1/25/06:  Either Google has changed my ranking somehow, or my switch to BlogCFC&amp;nbsp; has harmed my accessibility somehow.  I now turn up on like page 5 or something terrible.  Back to the drawing board! 	
</description><pubDate>Tue, 15 Nov 2005 06:00:00 GMT</pubDate><guid>http://ajlcom.instantspot.com/blog/2005/11/15/Robots-and-main-page-accessibility</guid><category>SEO</category></item></channel></rss>