Blog

Category Filtering: 'ColdFusion'

Remove Filter


Coldfusion Snippet: Make a sleep timer using Java

Posted by Luis Majano
Sep 13, 2005 00:00:00 UTC
This snippet utilizes the power of java to create an execution sleep timer. There are various applications for this snippet, but the purpose of the snippet is to provide you with a mechanism of making the coldfusion thread sleep for a period of time. Please be careful when setting the timer variable since it might just lock the execution thread.

I have also included a copy-paste snippet of my actual CFC function.

The snippet is actually very simple:

<cfset thread = CreateObject("java", "java.lang.Thread")>

<cfset thread.sleep(arguments.milliseconds)>

Coldfusion Snippet: Bugtracking Methods

Posted by Luis Majano
Sep 08, 2005 00:00:00 UTC
This entry is for those developers trying to standardize their application development with a bugtracking module. I personally use a bugtracking.cfc and extend it on all my model components. The following snippet is the actual logError method that I use.

The method is self explanatory. You send in some ErrorDetails, the cfcatch structure, and application(cfc) name. The method will then construct a variable using cfsavecontent with the bug report and creates a LogFile in the coldfusion administrator. It then finally sends the bugreport to the email list that you can provide in the constructor of the cfc.

<cfset this.bugEmails = "[email protected],[email protected]">

Ben Forta's XMPP Cool CFDOCS

Posted by Luis Majano
Sep 07, 2005 00:00:00 UTC
Ben Forta has done it again!!

He has created a CFDOCS bot using CFMX7 event gateways. You can find the information here.

I have been using it now everyday. It is an incredible and quick way of getting CFMX function and tag information.

A true indispensable Coldfusion Developer Tool.

Thanks Ben!!

Refreshing Coldfusion Web Service Stubs

Posted by Luis Majano
Sep 06, 2005 00:00:00 UTC
Coldfusion introduced the use of web services in coldfusion MX and what a great feature. However, there are some intricacies on this feature. Web Service stubs, stubs are created by Java in order to define the signature of a web service. This holds the request and response headers, the arguments and their data types. So if a change in signature occurs, the stubs need to be refreshed or recreated. You can either do this programmatically or manually.

Most of the time the programatic approach will work, but sometimes these little bastards persist. So you have to follow a procedure and clean them out. Below you will find the programmatic way first:

<cfobject type="JAVA"

action="Create"

name="factory"

class="coldfusion.server.ServiceFactory">


<cfset RpcService = factory.XmlRpcService>


<cfset RpcService.refreshWebService("http://testwebsite/webservice/myservice.cfc?wsdl")>

Coldfusion Snippet: Get your local server hostname

Posted by Luis Majano
Sep 06, 2005 00:00:00 UTC
This is a pretty useful snippet for a clustered environment. It is a simple java snippet to get your local server host name. Please remember that if your servers are Unix based, this values are retrieved from the /etc/hosts file.

<cfset inet = CreateObject("java", "java.net.InetAddress")>

<cfset inet = inet.getLocalHost()>

<cfoutput>#inet.getHostName()#</cfoutput>

NetDebugger and CF Flash Forms

Posted by Luis Majano
Sep 02, 2005 00:00:00 UTC
This entry is to enlighten those who need to enable the Flash Remoting NetDebugger using CF Flash Forms. By default, coldfusion has the flex debuggin off, so you either have to tweak the flex settings or programmatically activate the debugging.

I would not recommend the first solution on a production environment, due to the nature of somebody peaking in to your requests and responses. However, for development is fine. So to start, find the following file: flex-config.xml which can be found under the following directory:

{CF_ROOT}/WEB-INF/cfform/flex-config.xml

Open the xml file and locate the following section:

<!-- When production-mode=true, the debugging options are always

false and may not be set. -->

<debugging>


<!-- allow override of values in debugging section via

query parameter on a per-request basis, if applicable -->

<process-debug-query-params>true</process-debug-query-params>
......

</debugging>

This is the flex debuggin configuration. So in order to activate the debugger change the following entries to true.

<!-- turn on debug to see the request and response on the server side as well

as debug information in client side tracing -->

<remote-objects-debug>false</remote-objects-debug>


<!-- turn on debug to see the request and response on the server side as well

as debug information in client side tracing -->

<web-service-proxy-debug>false</web-service-proxy-debug>


<!-- turn on debug to see the request and response on the server side -->

<http-service-proxy-debug>false</http-service-proxy-debug>

My First Blog

Posted by Luis Majano
Sep 01, 2005 00:00:00 UTC
Hi and welcome to my blog. This is my first time blogging and all thanks to Ray Camden's BlogCFC.

It is a great tool, a basic plug and play application. However, I took the liberty of modifying some of the Look And Feel. I created a new podlayout on the left and use my own site's css. And well, added a few tweaks here and there.

Overall BlogCFC is an incredible tool. As a software engineer I found the code to be extremely well organized and everything where it should be. So a big applause for Mr Ray Camden.

I will start posting my software ideas and personal notes in this blog, so feel free to comment all you want. Suggestions are always welcomed.

Site Updates

Archives

Entries Search