Hi Brenden,
This is awesome!
However, I found a bug if you extend a core without adding an extra
property.
It barfs on line 255 of fourq.cfc :
<!--- build props for object type--->
<cfloop from=1 to="#arraylen(md.properties)#" index="prop">
<cfset thisprop = md.properties[prop]>
<cfset ArrayAppend(aProps, md.properties[prop])>
<cfset lPropsProcessed = ListAppend(lPropsProcessed, thisprop.name)>
</cfloop>
However, if you wrap this around it it works okay:
<cfif structkeyexists(md, "properties")>
<!--- build props for object type--->
<cfloop
...
</cfloop>
</cfif>
Cheers
Niklas
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Brendan Sisson
> Sent: Tuesday, December 09, 2003 5:14 AM
> To: FarCry Developers
> Subject: [farcry-dev] v2.1 Beta - extending core types
>
> 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
>
---
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