Ah, the joys of Groupwise...it was changing my reply to email. Hopefully fixed
now.
Meanwhile, I got my category display working except for one new issue. Within
the page, as I noted earlier, it is outputting a list of fact sheets within a
category. All of this info comes from the query, except the thumbnail, which is
a thumbnail of the PDF.
I may be overthinking this, but I figured I needed to pull that info from the
factsheet bean, which I made, which has the thumbnail and PDF in it, along with
the specific details of each fact sheet. But I can't figure out how to call it
from the looping output. I tried this in my view:
<cfoutput query="factsheetList">
<cfset thisFactSheet = createObject("component",
"model.factsheets.factsheetsListener").getFactSheetDetailFromArg(
WhichFactSheet = factsheetid ) />
<td>
<a
href="?event=getFactSheet&whichfactsheet=#factsheetid#">thumbnail</a><br />
<a
href="?event=getFactSheet&whichfactsheet=#factsheetid#">#factsheetnumber#</a>:
#factsheettitle#
</td>
<cfif (CurrentRow MOD 2) IS 0>
</tr><tr>
</cfif>
<cfif currentrow EQ factsheetList.RecordCount AND (CurrentRow MOD 2) IS
NOT 0>
<td> </td>
</cfif>
</cfoutput>
With the getFactSheetDetailFromArg function being the same as the
getFactSheetDetail function, except it takes an argument instead of an event
<cffunction name="getFactSheetDetailFromArg" access="public" output="false"
returntype="FactSheet">
<cfargument name="WhichFactSheet" type="numeric" required="true">
<cfset var factsheet = "" />
<cfset factsheet = createObject("component", "FactSheet").init(
FactSheetID = arguments.WhichFactSheet ) />
<cfset variables.factsheetDAO.read(factsheet) />
<cfreturn factsheet />
</cffunction>
However, it is throwing an error of "Element FACTSHEETDAO is undefined in a
Java object of type class [Ljava.lang.String;" and referencing the read line.
The read function is similar to the one for categories (which works fine)
except it has more elements and has the PDF and thumbnail added:
<cffunction name="read" access="public" output="false" returntype="boolean">
<!--- the bean to populate? --->
<cfargument name="FactSheet" type="FactSheet" required="true" />
<cfset var queryFactSheets = "" />
<!--- Make sure FactSheet requested is a valid number --->
<cfif val(arguments.FactSheet.getFactSheetID()) GT 0>
<!--- run the query based on the ID loaded from the Listener
function --->
<cfquery name="queryFactSheets" datasource="#variables.DSN#">
SELECT factsheetid, factsheetnumber, factsheettitle,
haspdf, activestatus, dateadded, lastupdated
FROM factsheets
WHERE factsheetid = <cfqueryparam
value="#arguments.FactSheet.getFactSheetID()#" cfsqltype="cf_sql_integer" />
</cfquery>
<cfif haspdf IS TRUE>
<cfpdf name="variables.pdf" action="read"
source="#request.basedirectory#dropinn/pdfs/factsheet_#pubid#.pdf" />
<cfpdf action = "thumbnail"
source =
"#request.basedirectory#dropinn/pdfs/factsheet_#pubid#.pdf"
destination =
"#request.basedirectory#dropinn/thumbnails/factsheet_#pubid#.jpg"
overwrite = "yes"
pages = "1"
resolution= "low"
>
<cfimage name="variables.thumbnail" action="read"
source="#request.basedirectory#dropinn/thumbnails/factsheet_#pubid#.jpg" />
<cfimage action="info"
structname="variables.thumbnailinfo"
source="#request.basedirectory#dropinn/thumbnails/factsheet_#pubid#.jpg" />
<cfelse>
<cfset variables.pdf = "" />
<cfset variables.thumbnail = "" />
<cfset variables.thumbnailinfo = StructNew() />
</cfif>
<!--- re-initialize the bean with data from the query --->
<cfset arguments.FactSheet.init( FactSheetID =
queryFactSheets.factsheetid,
FactSheetNumber = queryFactSheets.factsheetnumber,
FactSheetTitle = queryFactSheets.factsheettitle,
HasPDF = queryFactSheets.haspdf,
ActiveStatus = queryFactSheets.ActiveStatus,
DateAdded = queryFactSheets.dateadded,
LastUpdated = queryFactSheets.lastupdated,
PDF = variables.pdf,
Thumbnail = variables.thumbnail,
ThumbnailInfo = variables.thumbnailinfo ) />
<cfreturn true />
</cfif>
<!--- Return the populated bean --->
<cfreturn false />
</cffunction>
Am I misthinking how one should do this? Am I wrong in thinking of putting the
actual thumbnail and PDF in the bean? Should I just put the path/URL?
--
Summer S. Wilson
Software Engineer II
AgriLife Information Technology, Texas AgriLife
979-458-1458 (p) / 979-845-0829 (f)
2468 TAMU; 110 TAES Annex
>>> On 8/31/2009 at 1:36 PM, in message <[email protected]>,
Matthew Woodward <[email protected]> wrote:
: We moderate new members to avoid spam postings, but if they're actually
: bouncing back to you that's an issue outside our purview. I just checked
: your settings on the google group and the only thing I see is that the
: email address you registered to the group with is not the same one I'm
: seeing show up in your messages.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to Mach-II for CFML list.
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/mach-ii-for-coldfusion?hl=en
SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/
Wiki / Documentation / Tickets:
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/
-~----------~----~----~----~------~----~------~--~---