[MGNLRSSAGG-12] Sortation of imported feed is wrong Created: 20/Mar/09  Updated: 13/May/09  Resolved: 13/May/09

Status: Closed
Project: Magnolia RSS Aggregator Module
Component/s: None
Affects Version/s: 1.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Olivier Marti Assignee: Jan Haderka
Resolution: Outdated Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Running the module in a 3.6.3 EE instance


Attachments: XML File data.rssaggregator.Jans-Blog.xml     PNG File screenshot.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

When importing the data from: http://neatresults.com/rah003/index.rdf we have it correctly sorted in the repository, but when displaying it on the website something goes wrong and the newest entry isn't on top anymore. Already the class info.magnolia.module.rssaggregator.CombinedFeedAction is bringing the collection back unsorted.

See the attached file as an export of the data.



 Comments   
Comment by Jan Haderka [ 23/Mar/09 ]

Feed importer itself doesn't sort any of the imported items. All sorting is done by paragraphs when they are displaying the data. The default paragraphs provided with the module are sorting content just fine (see attached screenshot).

Comment by Olivier Marti [ 24/Mar/09 ]

I don't agree. Sorting is made by the class.

The normal query made by the class gives back a wrong sorting in my project.
queryString = /jcr:root/rssaggregator/Jans-Blog/data[1]// order by @pubDate ascending

When I remove the ordering in the class result is just fine.
queryString = /jcr:root/rssaggregator/Jans-Blog/data[1]//

Comment by Jan Haderka [ 24/Mar/09 ]

yeah indeed. This is what I meant when I said ordering is done by paragraph or more precisely by the ActionBasedParagraph class which is tied to the paragraph template and executed before template is rendered
the current code of the CombinedFeedAction class reads as

            String queryString = "/jcr:root"+this.getContent().getNodeData("link").getString()+"/data[1]/*/* order by " + orderByNodeValue + " " + sortDirectionNodeValue;

and actually in the screenshot I've attached the orderByNodeValue was set to @pubDate and sortDirectionNodeValue was set to ascending resulting in the same query as you use (and the result is correct as you can see in the screenshot). I was under impression you are not using default CombinedFeedParagraph but one written explicitly for you. Maybe just send me svn link to it and I'll try with your paragraph. We might also want to move this issue to support

Comment by Olivier Marti [ 24/Mar/09 ]

Nope, I use the paragraph provided with the module as well with the settings you suggested (orderByNodeValue was set to @pubDate and sortDirectionNodeValue), but the same as on our custom paragraph: the newest entry of your blog is not on top.

It's actually independent of the template, I can print out the result directly in the class and it's not what it should be. Not as long as I live the "order by" statement in the class.

Comment by Jan Haderka [ 24/Mar/09 ]

Hmm, just read through your export file again. The reason why sorting doesn't work for you is quite simple - there is no pubDate property in the attached export file anywhere. Normally you should have somthing like

        <sv:property sv:name="pubDate" sv:type="Long">
          <sv:value>1227696951000</sv:value>
        </sv:property>

for each entry.
Since it is import handler that is responsible for creating those entries, I'd say something is wrong there. I think I tagged the svn before moving module to 4.0 so I'll try to see if I can figure out what is going on there.

Comment by Jan Haderka [ 13/May/09 ]

Not reproducible with the latest version (4.x compatible). Since this code have been backported to 3.6.x compatible branch use that instead of old snapshot.

Generated at Mon Feb 12 07:04:38 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.