<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 07:29:29 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>[MGNLSTK-690] Provide for sorting, filtering and shrinking by query in STKUtil</title>
                <link>https://jira.magnolia-cms.com/browse/MGNLSTK-690</link>
                <project id="10287" key="MGNLSTK">Magnolia Standard Templating Kit (closed)</project>
                    <description>&lt;p&gt;Currently any callers of &lt;tt&gt;info.magnolia.module.templatingkit.util.STKUtil.getContentListByTemplateName(Content, String)&lt;/tt&gt; will have to implement sorting, filtering and shrinking of results in Java. This leads to intolerable perfomance when thousands of result objects must be processed in Java.&lt;/p&gt;

&lt;p&gt;The provided patch extends some method signatures of STKUtil so a maxResultSize (for shrinking), andClause (for filtering) and orderByClause (for sorting) can be passed in. This will allow subclasses of  AbstractListItemModel to perform sorting, filtering and shrinking via JCR query rather than in Java.&lt;/p&gt;

&lt;p&gt;The provided patch requires the application of the patch previously provided in &lt;a href=&quot;https://jira.magnolia-cms.com/browse/MAGNOLIA-3331&quot; title=&quot;Provide for maxResultSize in Query-API&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MAGNOLIA-3331&quot;&gt;&lt;del&gt;MAGNOLIA-3331&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="19160">MGNLSTK-690</key>
            <summary>Provide for sorting, filtering and shrinking by query in STKUtil</summary>
                <type id="4" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10890&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/major.svg">Major</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="pbaerfuss">Philipp B&#228;rfuss</assignee>
                                    <reporter username="jfrantzius">Joerg von Frantzius</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Oct 2010 19:12:15 +0200</created>
                <updated>Wed, 23 Jan 2013 08:53:14 +0100</updated>
                            <resolved>Fri, 17 Dec 2010 13:13:55 +0100</resolved>
                                                    <fixVersion>1.4</fixVersion>
                                    <component>base system</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="30551" author="gjoseph" created="Thu, 21 Oct 2010 19:27:40 +0200"  >&lt;p&gt;Thanks ! SureFireModuleManager could go, afaiac, to magnolia-core/test; will review more closely when the patch gets applied - sounds like its just a different ModuleDescriptorLoader no?&lt;/p&gt;</comment>
                            <comment id="30580" author="jfrantzius" created="Fri, 22 Oct 2010 15:38:03 +0200"  >&lt;p&gt;I just realize that it&apos;s not possible to change the AbstractItemListModel class hierarchy to querying instead of Java processing, without potentially breaking existing code (outside of the STK). That&apos;s because either all of filtering, sorting and shrinking must happen by query, or none.&lt;/p&gt;

&lt;p&gt;It&apos;s also not possible to order by query similar to what &lt;tt&gt;info.magnolia.module.templatingkit.util.STKDateContentUtil.sortDateContentList(List&amp;lt;Content&amp;gt;, String, String, Calendar)&lt;/tt&gt; does with its defaultDate.&lt;/p&gt;

&lt;p&gt;So I&apos;ll go for a new class hierarchy &quot;AbstractQueryingItemListModel&quot;, which has &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;String getOrderByClause()&lt;/tt&gt; and&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;String getAndClause()&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;instead of AbstractItemListModel&apos;s &lt;tt&gt;filter(List&amp;lt;Content&amp;gt; itemList)&lt;/tt&gt; and &lt;tt&gt;sort(List&amp;lt;Content&amp;gt; itemList);&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;The resulting classes will be configuration-compatible to their original equivalents, so it should be easy to switch to the querying class counterparts in existing systems. &lt;/p&gt;</comment>
                            <comment id="30649" author="jfrantzius" created="Tue, 26 Oct 2010 22:08:19 +0200"  >&lt;p&gt;Result from discussing with Philipp:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;existing class hierarchy will be kept&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;AbstractItemListModel&lt;/tt&gt; methods &lt;tt&gt;filter()&lt;/tt&gt; and &lt;tt&gt;sort()&lt;/tt&gt; changed to not abstract (so new subclasses don&apos;t need to implement them), and instead implemented empty in &lt;tt&gt;AbstractItemListModel&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;new methods added to &lt;tt&gt;AbstractItemListModel&lt;/tt&gt;:
	&lt;ul&gt;
		&lt;li&gt;&lt;tt&gt;protected String getFilterClause()&lt;/tt&gt;&lt;/li&gt;
		&lt;li&gt;&lt;tt&gt;protected String getSortingClause()&lt;/tt&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;AbstractItemListModel.search()&lt;/tt&gt; changed to first query using &lt;tt&gt;getFilterClause()&lt;/tt&gt;,  &lt;tt&gt;getSortingClause()&lt;/tt&gt; and &lt;tt&gt;getMaxResults()&lt;/tt&gt;, and afterwards invoke &lt;tt&gt;filter()&lt;/tt&gt; and &lt;tt&gt;sort()&lt;/tt&gt;
	&lt;ul&gt;
		&lt;li&gt;this will keep API compatibility, i.e. for existing subclasses outside STK that have overridden these methods&lt;/li&gt;
		&lt;li&gt;only currently known problem: will break overridden &lt;tt&gt;filter()&lt;/tt&gt; in subclasses when these filter less restrictive than the originally overridden &lt;tt&gt;filter()&lt;/tt&gt; implementation&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;AbstractDateContentModel.sort()&lt;/tt&gt;: will still sort in Java if &lt;tt&gt;defaultDate&lt;/tt&gt; is not null, because there is no way to express that behaviour in a ORDER BY clause&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="31629" author="fgrilli" created="Fri, 3 Dec 2010 11:29:11 +0100"  >&lt;p&gt;Hi J&#246;rg, can this issue be considered resolved?&lt;/p&gt;</comment>
                            <comment id="31632" author="jfrantzius" created="Fri, 3 Dec 2010 11:55:40 +0100"  >&lt;p&gt;Hi Federico,&lt;/p&gt;

&lt;p&gt;now that I look closely at the title of this issue I realize that indeed this one can be closed. &lt;/p&gt;

&lt;p&gt;The changes to STKUtil are in place, but they are not yet used by any AbstractListeItemModel subclass. I&apos;ll simply open a new issue for that once I find the time to implement it.&lt;/p&gt;</comment>
                            <comment id="32018" author="gjoseph" created="Fri, 17 Dec 2010 13:13:55 +0100"  >&lt;p&gt;Thanks for all the patches J&#246;rg; indeed this issue is now resolved, it just got lost in the sea of other issues &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.magnolia-cms.com/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10020">
                    <name>dependency</name>
                                            <outwardlinks description="depends upon">
                                        <issuelink>
            <issuekey id="19157">MAGNOLIA-3331</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="13840" name="magnolia-module-standard-templating-kit.patch" size="27400" author="jfrantzius" created="Thu, 21 Oct 2010 19:12:15 +0200"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_14166" key="com.okapya.jira.checklist:checklist">
                        <customfieldname>Acceptance criteria</customfieldname>
                        <customfieldvalues>
                            
        <checklist>
        <![CDATA[
                            




                
                                    <div class="o-completion" style="display: flex; flex-shrink: 0;"><span  class="aui-lozenge aui-lozenge-complete" style="font-size: 12px; font-weight: normal; display: flex; flex-direction: row; align-items: center;" ><span style="padding-right: 4px; vertical-align: middle;"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="white"><path clip-rule="evenodd" d="m10.41037,3.42544l-7.86501,0c-0.72395,0 -1.31084,0.58688 -1.31084,1.31084l0,7.86508c0,0.7239 0.58689,1.3108 1.31084,1.3108l7.86501,0c0.724,0 1.3109,-0.5869 1.3109,-1.3108l0,-7.86508c0,-0.72396 -0.5869,-1.31084 -1.3109,-1.31084zm-7.86501,-0.65542c-1.08593,0 -1.96626,0.88032 -1.96626,1.96626l0,7.86508c0,1.0859 0.88033,1.9662 1.96626,1.9662l7.86501,0c1.086,0 1.9663,-0.8803 1.9663,-1.9662l0,-7.86508c0,-1.08594 -0.8803,-1.96626 -1.9663,-1.96626l-7.86501,0z" fill-rule="evenodd"/><path d="m5.09049,10.18526l-1.82767,-1.82766l-0.78479,0.78479l2.61246,2.61246l5.38758,-5.38754l-0.78483,-0.78479l-4.60275,4.60274z"/></svg></span><span>Empty</span></span></div>
                        ]]>
    </checklist>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>aperto.de</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 21 Oct 2010 19:27:40 +0200</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>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>mmuehlebach</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 10 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>fgrilli</customfieldvalue>
            <customfieldvalue>jfrantzius</customfieldvalue>
            <customfieldvalue>gjoseph</customfieldvalue>
            <customfieldvalue>pbaerfuss</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Patch included</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10100"><![CDATA[Yes]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i042vj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23908</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_10091" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Testcase included</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10101"><![CDATA[Yes]]></customfieldvalue>
    
                        </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>