ColdDoc 0.2 Released
Not a huge amount to report here, this release fixes a bug in which if there is no 'init' method on a CFC, ColdDoc ends up throwing an error.
Mark Mandel is a software developer in Melbourne Australia that spends most of his working day developing in ColdFusion and Java.
All donations go toward conference travel costs, and funding my open source development
Not a huge amount to report here, this release fixes a bug in which if there is no 'init' method on a CFC, ColdDoc ends up throwing an error.
We are conducting a survey to try and tailor CFUG Melbourne to best fit the ColdFusion users in Melbourne, and provide you guys with the best CFUG we can.
Please take 10 minutes to fill out this quick survey on Google Docs, we would greatly appreciate it:
http://spreadsheets.google.com/viewform?key=pJCuG-fQNocTuTRAdDmagGg&hl=en
There are also prizes for filling out the survey! If you write your
email at the end of the survey, you will be in the running for:
1st prize: An Adobe Backpack
2nd Prize: A copy of the latest Fusion Authority Quarterly Update (Vol III, Issue 1)
3rd Prize: A Metal Adobe Lunchbox
More details on the user group can be found on the Adobe Groups page .
Thanks for taking the time, and look forward to seeing you all at a CFUG meeting this year.
<cfcomponent remoteScope="application" >...</cfcomponent>
<cfcomponent hint="proxy stored in a share scope" output="false" remoteScope="session">
<cfscript>
instance.value = 1;
</cfscript>
<cffunction name="getIncrementingValue" hint="returns a value, and increments it by 1" access="remote" returntype="numeric" output="false">
<cfreturn instance.value++ />
</cffunction>
</cfcomponent><cfcomponent output="false" alias="tests.cfml.cfc.model.Basic">
<cfproperty name="date" type="date" nullvalue="1-1-1900">
<cffunction name="getDate" access="public" returntype="date" output="false">
<cfreturn instance.date />
</cffunction>
<cffunction name="setDate" access="public" returntype="void" output="false">
<cfargument name="date" type="date" required="true">
<cfset instance.date = arguments.date />
</cffunction>
</cfcomponent>
...will set 'Date' to the 1-1-1900 if the AS3 Object's 'date' property
is null. Also, if sending data back up to Flex from CF, the 'date'
property is set to null on the Flex side, if the date value is
1-1-1900. This gives you a type safe way of dealing with null values
coming down from Flex.<cfcomponent output="false" alias="tests.cfml.cfc.model.Basic">
<cfproperty name="simple" type="tests.cfml.cfc.model.Simple" nullmethod="removeSimple">
<cffunction name="setSimple" access="public" returntype="void" output="false">
<cfargument name="Simple" type="Simple" required="true">
<cfset instance.Simple = arguments.Simple />
</cffunction>
<cffunction name="removeSimple" hint="remove simple" access="public" returntype="void" output="false">
<cfset StructDelete(instance, "Simple") />
</cffunction>
</cfcomponent>
<cftry>
<cfthrow type="myException" message="This is my custom exception" detail="This is my custom exception detail"/>
<cfcatch type="myException" />
<cfset writeOutput("Caught Exception") />
</cfcatch>
</cftry>
<cfcomponent name="Exception" hint="Throws a given exception" output="false">
<cffunction name="init" hint="Constructor" access="public" returntype="void" output="false">
<cfargument name="message" hint="the message to throw" type="string" required="Yes">
<cfargument name="detail" hint="the detail in which to throw" type="string" required="Yes">
<cfthrow type="#getMetaData(this).name#" message="#arguments.message#" detail="#detail#">
</cffunction>
</cfcomponent>
<cfcomponent name="myException" hint="Throws myException" extends="Exception" output="false">
<cffunction name="init" hint="Constructor" access="public" returntype="void" output="false">
<cfset super.init("This is my custom exception", "This is my custom exception detail") />
</cffunction>
</cfcomponent>
To then throw myException, I simply do:<cftry>
<cfset createObject("component", "myException").init();
<cfcatch type="myException" />
<cfset writeOutput("Caught Exception") />
</cfcatch>
</cftry><cfcomponent name="MethodNotFoundException" hint="Exception for method not being found" extends="Exception" output="false">
<cffunction name="init" hint="Constructor" access="public" returntype="void" output="false">
<cfargument name="component" hint="the component that the method is attempting to be called on" type="any" required="Yes">
<cfargument name="methodName" hint="the name of the method" type="string" required="Yes">
<cfscript>
super.init("The method '#arguments.methodName#' in '#getMetaData(arguments.component).name#' could not be found.",
"This method could not be found. Please ensure that it was spelled correctly, and is not private"
);
</cfscript>
</cffunction>
</cfcomponent>