Extending dmEvent in v3+ Removes Editable Draft option on Approved records

View: New views
3 Messages — Rating Filter:   Alert me  

Extending dmEvent in v3+ Removes Editable Draft option on Approved records

by Jeff-121 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I have attempted to extend dmEvent in order to add two custom fields
("City" and "State") to the edit form. After doing so, I can see the
new fields in the form now, and successfully submit to the update DB
table. However, now when I attempt to edit any record that is
"Approved", I no longer receive the options to: "Create an Editable
Draft", "Send this Content Item Back to Draft", or "Delete". I only
see the "Preview" button on the right, with no other options. I do not
know what I have done wrong.

To do the extension, I ...

1) copied the entire _dmEvent directory from the Core to the local
packages/types/ directory;

2) created a new _dmEvent.cfc file in the packages/types/ directory
and added the "city" and "state" properties (see code snippet below)

3) In the new, local _dmEvent/edit.cfm file, I changed the stepDir
path to:
stepDir="/farcry/#application.applicationname#/packages/types/_dmEvent/
plpEdit"



FROM MY NEW _dmEvent.cfc FILE
---------------------------------------------
<cfcomponent name="dmEvents"
extends="farcry.farcry_core.packages.types.dmEvent"
displayname="Events"  hint="Event objects" bUseInTree="1"
bSchedule="1">


    <cfproperty name="city" type="string" hint="City of event"
required="no" default="">
        <cfproperty name="state" type="string" hint="State of event"
required="no" default="">
        <!--- Object Methods --->

        <cffunction name="edit" access="public" output="true">
                <cfargument name="objectid" required="yes" type="UUID">

                <!--- getData for object edit --->
                <cfset var stObj = this.getData(arguments.objectid)>
                <!--- check if datePublished has been set --->
                <!---<cfif not isDate(stObj.documentDate)>
                        <cfset stObj.documentDate = stObj.dateTimeCreated>
                </cfif>--->
                <!--- include edit handler --->
                <cfinclude template="_dmEvent/edit.cfm">
        </cffunction>

</cfcomponent>
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Extending dmEvent in v3+ Removes Editable Draft option on Approved records

by Jeff-121 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I forgot to mention that I edited the "start.cfm" file in the new
_dmEvent/plpEdit/  directory by adding the two new fields for city and
state.


On Nov 5, 7:46 am, Jeff <j...@...> wrote:

> I have attempted to extend dmEvent in order to add two custom fields
> ("City" and "State") to theeditform.Afterdoing so, I can see the
> new fields in the form now, and successfully submit to the update DB
> table. However, now when I attempt toeditany record that is
> "Approved", I no longer receive the options to: "Create an Editable
> Draft", "Send this Content Item Back to Draft", or "Delete". I only
> see the "Preview" button on the right, with no other options. I do not
> know what I have done wrong.
>
> To do the extension, I ...
>
> 1) copied the entire _dmEvent directory from the Core to the local
> packages/types/ directory;
>
> 2) created a new _dmEvent.cfc file in the packages/types/ directory
> and added the "city" and "state" properties (see code snippet below)
>
> 3) In the new, local _dmEvent/edit.cfm file, I changed the stepDir
> path to:
> stepDir="/farcry/#application.applicationname#/packages/types/_dmEvent/
> plpEdit"
>
> FROM MY NEW _dmEvent.cfc FILE
> ---------------------------------------------
> <cfcomponent name="dmEvents"
> extends="farcry.farcry_core.packages.types.dmEvent"
> displayname="Events"  hint="Event objects" bUseInTree="1"
> bSchedule="1">
>
>     <cfproperty name="city"type="string" hint="City of event"
> required="no" default="">
>         <cfproperty name="state"type="string" hint="State of event"
> required="no" default="">
>         <!--- Object Methods --->
>
>         <cffunction name="edit" access="public" output="true">
>                 <cfargument name="objectid" required="yes"type="UUID">
>
>                 <!--- getData for objectedit--->
>                 <cfset var stObj = this.getData(arguments.objectid)>
>                 <!--- check if datePublished has been set --->
>                 <!---<cfif not isDate(stObj.documentDate)>
>                         <cfset stObj.documentDate = stObj.dateTimeCreated>
>                 </cfif>--->
>                 <!--- includeedithandler --->
>                 <cfinclude template="_dmEvent/edit.cfm">
>         </cffunction>
>
> </cfcomponent>
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Extending dmEvent in v3+ Removes Editable Draft option on Approved records

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

not knowing FC3 at all, my guess would be that your edit function is overriding the farcry_core default edit function. You might need to call super.edit or something similar before the including the edit handler?

Tomek

On Thu, Nov 5, 2009 at 8:25 AM, Jeff <jeff@...> wrote:

I forgot to mention that I edited the "start.cfm" file in the new
_dmEvent/plpEdit/  directory by adding the two new fields for city and
state.


On Nov 5, 7:46 am, Jeff <j...@...> wrote:
> I have attempted to extend dmEvent in order to add two custom fields
> ("City" and "State") to theeditform.Afterdoing so, I can see the
> new fields in the form now, and successfully submit to the update DB
> table. However, now when I attempt toeditany record that is
> "Approved", I no longer receive the options to: "Create an Editable
> Draft", "Send this Content Item Back to Draft", or "Delete". I only
> see the "Preview" button on the right, with no other options. I do not
> know what I have done wrong.
>
> To do the extension, I ...
>
> 1) copied the entire _dmEvent directory from the Core to the local
> packages/types/ directory;
>
> 2) created a new _dmEvent.cfc file in the packages/types/ directory
> and added the "city" and "state" properties (see code snippet below)
>
> 3) In the new, local _dmEvent/edit.cfm file, I changed the stepDir
> path to:
> stepDir="/farcry/#application.applicationname#/packages/types/_dmEvent/
> plpEdit"
>
> FROM MY NEW _dmEvent.cfc FILE
> ---------------------------------------------
> <cfcomponent name="dmEvents"
> extends="farcry.farcry_core.packages.types.dmEvent"
> displayname="Events"  hint="Event objects" bUseInTree="1"
> bSchedule="1">
>
>     <cfproperty name="city"type="string" hint="City of event"
> required="no" default="">
>         <cfproperty name="state"type="string" hint="State of event"
> required="no" default="">
>         <!--- Object Methods --->
>
>         <cffunction name="edit" access="public" output="true">
>                 <cfargument name="objectid" required="yes"type="UUID">
>
>                 <!--- getData for objectedit--->
>                 <cfset var stObj = this.getData(arguments.objectid)>
>                 <!--- check if datePublished has been set --->
>                 <!---<cfif not isDate(stObj.documentDate)>
>                         <cfset stObj.documentDate = stObj.dateTimeCreated>
>                 </cfif>--->
>                 <!--- includeedithandler --->
>                 <cfinclude template="_dmEvent/edit.cfm">
>         </cffunction>
>
> </cfcomponent>



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---