Hello!
WARNING: noob ramblings and really long post. Only read if very bored
or feeling very benevolent.
I need some help conceptualizing and determining the 'best practice'
with app development in the farcry 4.0 world.
Here's my scenario:
I have a crm plugin. It has a crmOrganization type and a
ruleCrmOrganization rule. In fact, heck, here's the directory structure:
/plugins
-/crm
--/customadmin
---crm.xml
---/customlists
----crmOrganization.cfm
----crmOrganizationType.cfm
----crmSpecies.cfm
----crmState.cfm
--/packages
---/rules
----ruleCrmOrganization.cfc
---/types
----crmOrganization.cfc
----crmOrganizationType.cfc
----crmSpecies.cfc
----crmState.cfc
--/webskin
---/crmOrganization
----displayEditOrganization.cfm
OK, now that I've got that laid out, here's a little explaination of
what I have done so far:
1) Basically all that I have this doing so far is some simple CRUD
operations on the admin webtop by way of the ft:objectAdmin tag in the
customlists.
2) I've also got the rule working so that a user can add a content
container to the front end and choose displayEditOrganization.cfm as the
template. This will display a form using the formtools tags.
Here's how I'm doing that:
------ entirety of ruleCrmOrganization.cfc ------
<cfcomponent displayname="CRM Organization rule"
extends="farcry.core.packages.rules.rules"
hint="Allows you to place an edit form to register an
organization.">
<cfproperty ftSeq="1" ftFieldSet="Intro" name="intro"
type="longchar" hint="Introduction HTML for map." ftLabel="Intro"
ftType="longchar" />
<cfproperty ftseq="3" ftFieldset="List" name="displayMethod"
type="string" hint="Display method to render." required="yes"
default="display" fttype="webskin" ftprefix="display"
ftTypename="crmOrganization" ftlabel="Content Template" />
<cffunction name="execute" hint="Displays the text rule on the page."
output="true" returntype="void" access="public">
<cfargument name="objectID" required="true" type="uuid" default="" />
<cfset var stObj = getData(arguments.objectid) />
<cfset var oOrg =
createObject("component","farcry.plugins.crm.packages.types.crmOrganization")
/>
<cfset var stData = oOrg.getData(createUUID()) />
<cfset var stInvoke = structNew() />
<cfscript>
if (len(stobj.intro))
arrayAppend(request.aInvocations,stobj.intro);
stInvoke.objectID = stData.ObjectID;
stInvoke.typename = application.types.crmOrganization.typepath;
stInvoke.method = stObj.displayMethod;
arrayAppend(request.aInvocations,stInvoke);
</cfscript>
</cffunction>
</cfcomponent>
------ end ruleCrmOrganization.cfc ------
------ entirety of displayEditOrganization.cfm ------
<cfimport taglib="/farcry/core/tags/formtools/" prefix="ft" />
<ft:form>
<ft:object typename="crmOrganization" />
<ft:farcrybutton />
</ft:form>
------ end displayEditOrganization.cfm ------
Which leads me to my questions:
1) Is this breaking any 'best practices'? What if I had multiple
display templates? One to view an organization, and one to edit an
existing, and one to add a new? How would I go about rendering the
different templates? Should I have a cfcase statement inside my execute
function to run different methods depending on which template was selected?
2) How would I go about submitting this form and saving the data?
Should I write a save function in my rule cfc? How would I pass the
data along? I know that there's an action="" attribute that I can throw
in the ft:form tag...is there a way to pass along a typename and a
methodname so that it will call the save method for me?
3) Any general comments/suggestions/examples/noob bashing....?
If you've made it this far without hitting the delete button,
Thanks!
Mike
--
Michael Haggerty
Internet Applications Developer
SiteVision, Inc.
<e>[EMAIL PROTECTED]</e>
<p>540.343.8322 x116</p>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---