I've been working with Reactor, but thought it'd be better to 
learn how these things really work before I get too much into an ORM that does 
it mostly for me.

----------------------------------------

                                From: Nando <[EMAIL PROTECTED]>
Sent: Tuesday, May 06, 2008 4:49 AM
To: [email protected]
Subject: [CFCDEV] Re: Help in learning service objects: How to use

Ah, there's my cue. Transfer recommended!

Another option is Transfer (before someone recommends it :-) )

Alan

________________________________________

From: [email protected] [EMAIL PROTECTED] On Behalf Of wkolcz [EMAIL 
PROTECTED]

Sent: 06 May 2008 12:36

To: [email protected]

Subject: [CFCDEV] Help in learning service objects: How to use

I downloaded and installed Brian Rinaldi's Illudium PU-36 Code Generator. It 
produced a DAO, a Gateway, a bean, and a service object. I am attempting to 
learn how a service object works, or, more imporantly, how to use the service 
object. It comes with the following functions. (mine happens to be 
releasesServices.cfc)

init (takes an instance of the DAO and the Gateway)

createreleases

getreleases

getreleasess

savereleases

deletereleases

So basically, I am getting the DAO (create,get,save,delete) and a Gateway 
(getreleasess)? How can I call the gateway to return a list of records. Or, 
more important, how can I use the results on my view? Its returned as an array. 
What am I missing. I need the education :-)

I can setting my controller to:

<cfset RDAO = createObject("component", 
"medPortal.apps.newsroom.model.releases.releasesDAO").init("prmc-media_asql")>

        <cfset RGW = createObject("component", 
"medPortal.apps.newsroom.model.releases.releasesGateway").init("prmc-media_asql")>

        <cfset RS = createObject("component", 
"medPortal.apps.newsroom.model.releases.releasesService").init(#RDAO#, #RGW#)>

        <cfset allReleases = RS.getreleasess()>

Here is the full function:

    <cffunction name="getreleasess" access="public" output="false" 
returntype="array">

        <cfargument name="ID" type="Numeric" required="false" />

        <cfargument name="urllink" type="String" required="false" />

        <cfargument name="linktext" type="String" required="false" />

        <cfargument name="story" type="String" required="false" />

        <cfargument name="summary" type="String" required="false" />

        <cfargument name="keyword1" type="String" required="false" />

        <cfargument name="keyword2" type="String" required="false" />

        <cfargument name="keyword3" type="String" required="false" />

        <cfargument name="keyword4" type="String" required="false" />

        <cfargument name="um_department" type="String" required="false" />

        <cfargument name="photo" type="String" required="false" />

        <cfargument name="hiresphoto" type="String" required="false" />

        <cfargument name="releaseDate" type="Date" required="false" />

        <cfargument name="rss_feed" type="String" required="false" />

        <cfargument name="contactName" type="String" required="false" />

        <cfargument name="contactEmail" type="String" required="false" />

        <cfargument name="contactPhone" type="String" required="false" />

        <cfargument name="guestEmail" type="String" required="false" />

        <cfargument name="guestName" type="String" required="false" />

        <cfargument name="subTitle" type="String" required="false" />

        <cfargument name="city" type="String" required="false" />

        <cfargument name="videoCode" type="String" required="false" />

        <cfargument name="audioCode" type="String" required="false" />

        <cfargument name="ExpertName" type="String" required="false" />

        <cfargument name="ExpertURL" type="String" required="false" />

        <cfargument name="learnMoreText" type="String" required="false" />

        <cfargument name="learnMoreURL" type="String" required="false" />

        <cfargument name="studyURL" type="String" required="false" />

        <cfargument name="reportURL" type="String" required="false" />

        <cfargument name="topStory" type="Boolean" required="false" />

        <cfargument name="photoCaption" type="String" required="false" />

        <cfargument name="spanishURL" type="String" required="false" />

        <cfargument name="defaultLogo" type="String" required="false" />

        <cfreturn 
variables.releasesGateway.getByAttributes(argumentCollection=arguments) />

    </cffunction>

--

Nando M. Breiter
The CarbonZero Project
CP 234
6934 Bioggio
Switzerland
+41 76 303 4477
[EMAIL PROTECTED]




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" 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/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to