<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 05:00:55 CET 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[MGNLDAM-546] AssetQuery: add sorting capabilities</title>
                <link>https://jira.magnolia-cms.com/browse/MGNLDAM-546</link>
                <project id="10660" key="MGNLDAM">Magnolia DAM Module</project>
                    <description>&lt;p&gt;Add ability to specify sorting in query.&lt;/p&gt;

&lt;p&gt;Rationale: Decoupling UI and JCR yields the need for abstract query statements  directed to AssetProviders. &lt;tt&gt;AssetQuery&lt;/tt&gt; fulfills this role, but it lacks sorting ability.&lt;/p&gt;</description>
                <environment></environment>
        <key id="43189">MGNLDAM-546</key>
            <summary>AssetQuery: add sorting capabilities</summary>
                <type id="5" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10896&amp;avatarType=issuetype">Sub-task</type>
                            <parent id="43360">MGNLDAM-549</parent>
                                    <priority id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/neutral.gif">Neutral</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="rsiska">Robert &#352;i&#353;ka</assignee>
                                    <reporter username="rsiska">Robert &#352;i&#353;ka</reporter>
                        <labels>
                            <label>api</label>
                    </labels>
                <created>Mon, 16 Feb 2015 15:21:46 +0100</created>
                <updated>Thu, 25 Jun 2015 14:45:55 +0200</updated>
                            <resolved>Fri, 12 Jun 2015 13:21:58 +0200</resolved>
                                                    <fixVersion>2.1</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="100780" author="gjoseph" created="Fri, 20 Mar 2015 12:49:53 +0100"  >&lt;p&gt;Similarly to &lt;a href=&quot;https://jira.magnolia-cms.com/browse/MGNLDAM-545&quot; title=&quot;AssetQuery: add offset&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MGNLDAM-545&quot;&gt;&lt;del&gt;MGNLDAM-545&lt;/del&gt;&lt;/a&gt;, we need more specification here. In particular, the &lt;tt&gt;propertyId&lt;/tt&gt; should be specified, and, arguably, typed. Instead of an arbitrary String, which we can&apos;t know will be supported across providers (&lt;tt&gt;&quot;name&quot;&lt;/tt&gt; will mean something different for each provider (it&apos;s not even a property of the &lt;tt&gt;Asset&lt;/tt&gt; interface) : I&apos;d rather limit that to an enum of the basic properties defined on the &lt;tt&gt;Asset&lt;/tt&gt; interface. &lt;/p&gt;

&lt;p&gt;Similarly, I&apos;d rather use an enum for asc/desc rather than a boolean.&lt;/p&gt;

&lt;p&gt;A couple more remarks:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;AssetQuery.OrderBy&lt;/tt&gt; probably doesn&apos;t need to be public, but it should be static, unless there&apos;s a reason not to.&lt;/li&gt;
	&lt;li&gt;Its fields should be final.&lt;/li&gt;
	&lt;li&gt;Your API could be simpler to use with &lt;tt&gt;orderBy(String propertyId, boolean isAscending)&lt;/tt&gt; instead of &lt;tt&gt;withSorter(OrderBy... sorters)&lt;/tt&gt;: &lt;a href=&quot;https://gist.github.com/gjoseph/ae08f0e21a1d05a2846a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gist.github.com/gjoseph/ae08f0e21a1d05a2846a&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And as an example, using the suggested enum; to be completed, documented, validated, etc.. : &lt;a href=&quot;https://gist.github.com/gjoseph/811015992ed488a18edd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gist.github.com/gjoseph/811015992ed488a18edd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="100784" author="gjoseph" created="Fri, 20 Mar 2015 13:15:36 +0100"  >&lt;p&gt;Also keep the following in mind:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;In real life, those sorting methods will many times be too weak anyway - they rely on &quot;natural order&quot; for the given properties, which is very loosely defined. What if you want case-insensitive sorting, etc etc.&lt;/li&gt;
	&lt;li&gt;I would rather do &lt;tt&gt;.sortWith(Comparator&amp;lt;Asset&amp;gt;)&lt;/tt&gt;, but that doesn&apos;t translate well to remote queries &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.magnolia-cms.com/images/icons/emoticons/biggrin.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/li&gt;
	&lt;li&gt;Especially for remote providers, we need to build a caching layer. When most (or all) providers are caching, then we can think about utilizing modern cache/index querying capabilities.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="101084" author="rsiska" created="Fri, 27 Mar 2015 10:07:22 +0100"  >&lt;p&gt;I know that the enum would be a bit nicer, but I think that limiting the sort to some set of properties just won&apos;t cut it. &lt;/p&gt;

&lt;p&gt;Note that the need for these changes arose from the real life integrations, not just out of my whim. Out of three recent integrations (wcs,cumulus,konakart), all use offset/maxResults pagination &amp;amp; ordering by the name of the property + asc/desc. Some of them expect to be able to sort queries by properties like price or ratings.&lt;/p&gt;

&lt;p&gt;So we either leave it as String, which is ugly &amp;amp; loosely defined or we need to rethink the idea of &quot;asset property&quot; altogether. How about sorting by metadata properties? We still need to redo metadata anyway...&lt;/p&gt;</comment>
                            <comment id="105996" author="rsiska" created="Fri, 12 Jun 2015 13:21:47 +0200"  >&lt;p&gt;OrderBy now takes the metadata class as argument.&lt;/p&gt;

&lt;p&gt;Commited in:&lt;br/&gt;
&lt;a href=&quot;https://git.magnolia-cms.com/gitweb/?p=modules/dam.git;a=commitdiff;h=6c628f9749259862d579e943927c2f25a64d6960&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.magnolia-cms.com/gitweb/?p=modules/dam.git;a=commitdiff;h=6c628f9749259862d579e943927c2f25a64d6960&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10160">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="43183">MGNLDAM-545</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10020">
                    <name>dependency</name>
                                            <outwardlinks description="depends upon">
                                        <issuelink>
            <issuekey id="36996">MGNLDAM-411</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended upon by">
                                        <issuelink>
            <issuekey id="43168">MGNLDAMEXT-32</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10021">
                    <name>duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="36717">MGNLDAM-405</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>magnolia-cms.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 4 Mar 2015 11:22:42 +0100</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ajones</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 36 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>gjoseph</customfieldvalue>
            <customfieldvalue>rsiska</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i04nqf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>27329</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>