The biggest feature for v2.1 is the ability to extend core types and rules. The way to do it couldn't be easier. For this example I am going to extend dmProfile.

1. create a dmProfile.cfc in <your_app>/packages/system folder, eg
2. set the extends property to farcry.farcry_core.packages.types.dmProfile
3. add your new properties/methods

eg

<cfcomponent extends="farcry.farcry_core.packages.types.dmProfile">

<cfproperty name="Country" type="string" hint="Country of residence" required="no">

</cfcomponent>

To deploy this new property go to the usual COAPI types interface, deploy and your done!.


To over-ride an existing core methods such as the dmHTML edit method, you need to create a function called the same in your extended cfc. eg


<cfcomponent extends="farcry.farcry_core.packages.types.dmHTML" >

<cffunction name="edit" access="public" output="true">
        <cfargument name="objectid" required="yes" type="UUID">
        
        <!--- getData for object edit --->
        <cfset stObj = this.getData(arguments.objectid)>
        <cfinclude template="_dmhtml/edit.cfm">
</cffunction>
</cfcomponent>

Copy across existing edit code and modify (eg remove a plp step) or make your own edit code.

Too easy!

You can now reference a types path by using

#application.types[typename].typepath#

A big thanks to Tom Cornilliac for implementing the changes here.

-Brendan
http://farcry.daemon.com.au


--- You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to