I'm at a dead end. I need to access the next nth row in a query loop to show version differences between posts.
I use <cfquery> to output changes in groups, and this is my expected result:
Rev4 diff(rev4.title, original.title) diff(rev4.brief, rev2.brief) Rev3 diff(rev3.body, rev2.body) Rev2 diff(rev2.brief, original.brief) diff(rev2.body, original.body) Original query.title query.brief query.body
I initially thought that using Java methods to get the next line of query. This does not work:
- Rev4 should show the difference between its own short line and the last revision made in a short line; which in this case occurred in Rev2 ; so he needs to jump one line.
- To show diff for your title bar, Rev4 needs to go to the original record, since the first change in the title bar occurred in Rev4 .
Some things to consider:
- The revision scheme is one row for each edited column; therefore, if you download a message and edit its title and body, two entries are created in the revision scheme; one for the header and one for the body, under the same version of GUID.
- The request is grouped by version of GUID.
- It is ordered by revision date, latest and oldest; then by type of revision (name, short, body).
I noted this with Java because ColdFusion allows you to use Java methods for query objects , but it is not documented, so just knowing about its existence does not help me.
Can anyone show me the [best] way to do this?
The code structure I was thinking about:
<cfoutput query="revisions" group="revisionGUID"> #revision.revisionGUID# <cfoutput> // conditional logic to get diff(); <cfoutput> </cfoutput>
source share