Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-3299

CollectionTool should allow performing ordering using get("foo") and not only getFoo

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.1.0
    • Velocity
    • None
    • Unknown

    Description

      It's currently not possible using CollectionTool to performing ordering of xobjects based on their attributes, because the Object API only gives a #get() method and CollectionTool is looking for a getter with the attribute name. So we end up with error like that:

      2025-03-27 15:26:19,310 [qtp1601292138-142 - http://localhost:8080/xwiki/bin/get/Main/WebHome?xpage=xpart&vm=commentsinline.vm] ERROR o.x.v.t.CollectionTool - exception encountered while sorting: Could not retrieve comparable value for 'date' from com.xpn.xwiki.api.Object@32406bb1: java.lang.NoSuchMethodException: Unknown property 'date' on class 'class com.xpn.xwiki.api.Object'
      

      It would be handy to improve it to allow retrieve values from those #get() methods for sorting comparison.

      Attachments

        Activity

          People

            Unassigned Unassigned
            surli Simon Urli
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: