Thoughts n Musings

ColdFusion server-specific error code 2
By Brian Fescoe
January 16, 2017

Had an interesting issue crop up this morning involving one of our legacy Servers running xp IIS 6 and CF 8. ColdFusion stopped working because of a memory heap. But when trying to restart CF through the services control pannel I got the following windows error. service couldn't start due to server-specific error code 2.

Read More
Comments (0)
Search multiple database columns

Quick note, when searching multilpe database columns, avoid using CONCAT I had a terrible time getting it work. Instead I used   where FN +' '+LN like <cfqueryparam cfsqltype="cf_sql_varchar" value="%williams%">

and EE_STAT not like 'T%'

Read More
Comments (0)
Utlizing the JSON APi
By Brian Fescoe
June 22, 2016

Here are two different example of how to use the JSON api in MURA. One pulls back a page based off of a content ID Number the other will display multiple results via a content collection.

Read More
Comments (0)
Importance of declaring local vars in CFC's
By Brian Fescoe
November 11, 2015
This isn't really a new topic and has been discussed many time's before. However I can't not stress the importance or declaring local vars in CFC's, even query's
 
So what can happen, why all the fuss? Truthfully I never really bothered declare them. I mean isn't ColdFusion supposed to do that automatically?
Read More
Comments (0)
Aggregate functions in SQL
By Brian Fescoe
September 30, 2015

When using aggregate functions is SQL it is important to only SELECT the columns you absolutely need.  In my last post I was trying to achieve basically the same thing as in this one, however even though it achieved the same results I was unable to use it to display the results I want without my function getting really complicated. 

Read More
Comments (0)
SQL is powerful! Use it!
By Brian Fescoe
September 24, 2015

I'll admit I tend to use CF for all my coding but sometimes using SQL is by far and away easier to accomplish your goal as well as just a hell of a lot more quicker. I was struggling with retuning a total number of exercise minutes for a project that I'm working on. I tried double looping, adding variables together all kinds of stuff. Sometimes if you just keep it simple its so much better.  
 

Read More
Comments (0)
Access MURA user scope
By Brian Fescoe
September 1, 2015

 

Quick post today, If you have a need to access the current user scope in MURA all you need to do is use $.currentUser().getAllValues() 

For example
<cfset user = $.currentUser().getAllValues() >
<cfdump var="#user#" />

The above code will dump the User Scope which is actually considered a sub scope of the MURA Scope. To learn more visit MURA's site on the MURA Scope

 

Read More
Comments (0)
Coldfusion 10,11 and IIS 6
By Brian Fescoe
August 20, 2015

I know, I know why the hell are you running IIS 6? Well I work at a place that lets just say dosen't beleive in upgrading. So clients have needs and I need to make it work. I just glad this site is interal, but I digress.

My client wanted the latest version of Mura version 6.2 at the time. I went through the process of upgrading CF from 9 to 11 with very little issues basically followed the prompts making sure CF 9 was shut down.

Read More
Comments (0)
User Activation Script Mura
By Brian Fescoe
July 24, 2015

Using the follow technique and code will allow you to utilize the user activation script in MURA under the site config > Edit Site > Email tab. The work flow would be a user signs up but is not active and once an a administrator makes the user active an email is generated letting the user know they are active.

Read More
Comments (0)
Benefits of using REFind vs contains in ColdFusion
By Brian Fescoe
July 2, 2015

If you have a need to break apart a serialized ARGUMENT string from jQuery and JSON, say for list of questions that are getting submitted @ one time it is best to use REFind rather than contains take a look at the example below. 

The url encoded string has answers, feedback elements and urls for a single question. After decoding the string and replacing the + and & symbols that are added when doing an ajax post. (as an aside you will need to decode twice to show the special characters when rendering)

Read More
Comments (0)
Paging the DataTables plug-in using jQuery load
By Brian "DudeHammer" Fescoe
June 18, 2015

I’ve decided to use the DataTables plug-in to list different medical schools for a current project I’m working on with the hospital. All the data is being loaded via AJAX from a CFC, which in it self is pretty neat. If you have never tried using this plug-in to display your data I would recommend giving it a try, you can find it @ www.datatables.net.  

Read More
Comments (1)
MURA On After User Create
By Brian "DudeHammer" Fescoe
June 16, 2015

Continuing on my MURA theme I wanted to share a cool user function that will set multiple options after a user is created in MURA. The benifits are if you want have a need to automaticlly make a user active or assigned to a group for example you can do this. In order for it work I needed to place his code in the Site eventhandler.cfc

Read More
Comments (0)
Dynamically create content in MURA
By Brian Fescoe
June 15, 2015

Sometimes in MURA there's a need to create new pages dynamically. In my case I am creating tests via a plugin and wanted them to also be page in the site manager for tracking purposes. Steve Withington has a great script up on Gist which address this based on an RSS feed. https://gist.github.com/stevewithington/4742829
 
In order to get this to work you would include this in one of your functions in the plugins CFC. For example I included this script after I added new content to a custom database Table. What is does is it takes the current siteID and my custom argument UpdateID which I then set to the remoteID on the advanced tab of my newly created content. Now when a create a new entry into my custom database table MURA will create a page that I can use for tracking purposes or anything else I might need a page for. 
Read More
Comments (0)
Calling Display Objects Dynamically in MURA
By Brian Fescoe
June 13, 2015

One of the nifty things about MURA is creating custom pages, folders etc using the Class extension manager. There are many benefits to creating your own custom page but what I'm going to focus on with this post is taking a display object that has be customized for your particular needs then calling it dynamically through the Theme event handler.cfc
 
Obviously there are multiple ways to skin a cat in MURA this is just my preferred method allowing me to take a display object such as dsp_content_list.cfm naming to whatever I wish then putting in my theme display objects folder make the theme truly portable. 
Read More
Comments (0)
Escaping pound (#) symbol for CF ajax post
By Brian Fescoe
September 26, 2014

Almost everyone out there who uses CF knows that in order to escape the # symbol just simply make add another # so it looks like so “##”.  But what if it’s coming from a POST value; say from a form using Ajax?

For example my string looked like this 'myInputs=&myInputs1=#+<89Rtiahsdf>1&myInputs2=34jarlfkj7&#’ My goal was to remove ‘myInputs', ‘=‘ and the ‘&' symbol then separate everything putting it into an array.

postion one  = #+<89Rtiahsdf>;1
postion two = 34jarlfkj7&#

The string above has two issues with it one it has pound symbols which CF will throw an error if encounters one and there is not a closing one. Second notice the & at the end or the string, well that little beauty caused me to have 3 entries instead of two.

Read More
Comments (0)