Add this functions to your entrygateway.

 

<cfset variables.recentEntryDays = 0 />

               

                <cffunction name="init" access="public" hint="I configure and return the WntryGateway" output="false" returntype="EntryGateway">

                               <cfargument name="recentEntryDays" hint="I am the number of days an entry is recent." required="yes" type="numeric" />

                               <cfset variables.recentEntryDays = arguments.recentEntryDays />

                               <cfreturn this />

                </cffunction>

               

                <cffunction name="getAuthor" access="public" hint="I return the author who created a record" output="false" returntype="query">

                               <cfargument name="entryId" hint="I am the entryId to match" required="yes" type="numeric" default="0" />

                               <cfset var EntryQuery = createQuery() />

                               <cfset EntryQuery.join("Entry", "User") />

                               <cfset EntryQuery.returnObjectFields("User") />

                               <cfset EntryQuery.getWhere().isEqual("Entry", "entryId", arguments.entryId) />

                              

                               <cfreturn getByQuery(EntryQuery) />

                </cffunction>

               

                <cffunction name="getRecentEntries" access="public" hint="I return a query of recent entries." output="false" returntype="query">

                               <cfargument name="count" hint="I am the number of recent entries to return" required="yes" type="numeric" />

                               <cfset var EntryQuery = createQuery() />

                               <cfset EntryQuery.setMaxRows(arguments.count) />

                               <cfset EntryQuery.returnField("Entry", "entryId").returnField("Entry", "title") />

                               <cfset EntryQuery.getOrder().setDesc("Entry", "publicationDate") />

                               <cfreturn getByQuery(EntryQuery) />

                </cffunction>

               

                <cffunction name="getArchives" access="public" hint="I return a query of months, years and number of entries." output="false" returntype="query">

                               <cfset var archvies = 0 />

                              

                               <cfquery name="archives" datasource="#_getConfig().getDsn()#" cachedwithin="#CreateTimespan(0, 0, 1, 0)#">

                                               SELECT MONTH(publicationDate) as month, YEAR(publicationDate) as year, count(entryId) as entryCount

                                               FROM Entry

                                               GROUP BY MONTH(publicationDate), YEAR(publicationDate)

                                               ORDER BY YEAR(publicationDate) desc, MONTH(publicationDate) desc

                               </cfquery>

                              

                               <cfreturn archives />

                </cffunction>

 

João Fernandes
Dep. Informática - Área de Desenvolvimento
Cofina media

Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL
Tel (+351) 213 185 200 . Fax (+351) 213 540 370
[EMAIL PROTECTED]

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Tilley
Sent: sexta-feira, 31 de Março de 2006 14:48
To: [email protected]
Subject: Re: [Reactor For CF] problem with Blog sample app

 

Doug,

This is all that's been placed in the entrygateway.cfc


<cfcomponent hint="I am the database agnostic custom Gateway object for the Entry object.  I am generated, but not overwritten if I exist.  You are safe to edit me."
    extends="reactor.project.ChrisBlogApp.Gateway.EntryGateway" >
    <!--- Place custom code here, it will not be overwritten --->
</cfcomponent>
   
which is weird.

I am running windows XP pro

Jeff, I'm not seeing any mySQL errors

Chris

On 3/31/06, Doug Hughes <[EMAIL PROTECTED]> wrote:

What do you have in the file C:\CFusionMX7\wwwroot\ChrisBlogApp\data\Gateway\EntryGateway.cfc?  There should be an init method in there.

                                                                                                                                                 

Couple of random questions: 

 

Are you on windows? 

 

If not, do you have different casings of the file EntryGateway.cfc in the gateway folder?  (It might be a case sensitivity bug.) 

 

Doug

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Chris Tilley
Sent: Friday, March 31, 2006 8:07 AM


To: [email protected]
Subject: Re: [Reactor For CF] problem with Blog sample app

 

Here it is:

The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.

The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
The method 'init' could not be found in component C:\CFusionMX7\wwwroot\ChrisBlogApp\Data\Gateway\EntryGatewayoracle.cfc.
Check to ensure that the method is defined, and that it is spelled correctly.
 
The error occurred in C:\CFusionMX7\wwwroot\ChrisBlogApp\controller\BlogController.cfc: line 24
Called from C:\CFusionMX7\wwwroot\ModelGlue\ModelGlue.cfc: line 85
Called from C:\CFusionMX7\wwwroot\ModelGlue\Core\XMLModelGlueLoader.cfc: line 48
Called from C:\CFusionMX7\wwwroot\modelglue\ModelGlue.cfm: line 12
Called from C:\CFusionMX7\wwwroot\ChrisBlogApp\index.cfm: line 27

22 :         <cfset variables.CommentGateway = Reactor.createGateway("Comment") />
23 :         <cfset variables.UserGateway = Reactor.createGateway("User") />
24 :         <cfset variables.EntryGateway = Reactor.createGateway("Entry").init(variables.BlogConfig.getRecentEntryDays ()) />
25 :         <cfset variables.UrlPinger = CreateObject("Component", "ChrisBlogApp.model.blog.UrlPinger").init(variables.BlogConfig.getPingUrlArray()) />
26 :         <cfset variables.Search = CreateObject("Component", "ChrisBlogApp.model.search.Search").init(variables.BlogConfig.getBlogSearchCollection(), variables.BlogConfig.getAdditionalCollectonsList()) />

On 3/31/06, Doug Hughes <[EMAIL PROTECTED]> wrote:

This sounds familiar, but for the life of me I can't remember what this is.

 

Can you send the actual error?

 

Doug

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Chris Tilley
Sent: Friday, March 31, 2006 6:55 AM
To: [email protected]
Subject: Re: [Reactor For CF] problem with Blog sample app

 

Sean,

I also have MySQL 5 on my machine and thought of this same idea (oracle database supported) and set up my environment using MySQL and I'm still getting the same exact error on the same exact line.  I even deleted the projects and data directories.  Anybody have the sample running on MySQL or Oracle, successfully?

Chris

On 3/31/06, Sean Corfield <[EMAIL PROTECTED]> wrote:

On 3/30/06, Jeff Lester < [EMAIL PROTECTED]> wrote:
>  <cfset variables.EntryGateway =
> Reactor.createGateway("Entry").init(variables.BlogConfig.getRecentEntryDays ())
> />
>
> I'm not sure why you're trying to access the init function on an
> auto-generated reactor gatway file...

This is for the sample app. I seem to recall that Doug said the sample
app has custom code for the "supported" databases (the sample app does
not support all of the databases that Reactor itself supports).

The sample app used to be fairly DB-specific so you may have
difficulty getting it to run against Oracle. You could try copying the
mysql or mssql custom files into the oracle directory, renamed
appropriately, but you're off in uncharted territory...
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/




--
Chris Tilley -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/




--
Chris Tilley -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/




--
Chris Tilley -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to