[ 
http://jira.magnolia-cms.com/browse/MGNLSTK-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=30580#action_30580
 ] 

Jörg von Frantzius commented on MGNLSTK-690:
--------------------------------------------

I just realize that it'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's because either all of filtering, 
sorting and shrinking must happen by query, or none.

It's also not possible to order by query similar to what 
{{info.magnolia.module.templatingkit.util.STKDateContentUtil.sortDateContentList(List<Content>,
 String, String, Calendar)}} does with its defaultDate.

So I'll go for a new class hierarchy "AbstractQueryingItemListModel", which has 
* {{String getOrderByClause()}} and 
* {{String getAndClause()}} 

instead of AbstractItemListModel's {{filter(List<Content> itemList)}} and 
{{sort(List<Content> itemList);}}

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. 

> Provide for sorting, filtering and shrinking by query in STKUtil
> ----------------------------------------------------------------
>
>                 Key: MGNLSTK-690
>                 URL: http://jira.magnolia-cms.com/browse/MGNLSTK-690
>             Project: Magnolia Standard Templating Kit
>          Issue Type: Improvement
>          Components: base system
>            Reporter: Jörg von Frantzius
>            Assignee: Philipp Bärfuss
>         Attachments: magnolia-module-standard-templating-kit.patch
>
>
> Currently any callers of 
> {{info.magnolia.module.templatingkit.util.STKUtil.getContentListByTemplateName(Content,
>  String)}} 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.
> 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.
> The provided patch requires the application of the patch previously provided 
> in [MAGNOLIA-3331].

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to