|
Improving the ContentMapFacade class in order to filter and sort results
------------------------------------------------------------------------ Key: OFBIZ-2988 URL: https://issues.apache.org/jira/browse/OFBIZ-2988 Project: OFBiz Issue Type: Improvement Components: content Affects Versions: SVN trunk Reporter: Patrick Antivackis Priority: Minor Today's ContentMapFacade.class is mapped in the content application to the ${thisContent} variable in Freemarker templates. Using {$thisContent.subcontent_all} return all the "subcontents" associated with thisContent sorting by -fromDate. (in fact you usually use it like <#list thisContent.subcontent_all as contentItem> ${contentItem} </#list> ) Using {$thisContent.subcontent.foo} return all the first "subcontent" associated with thisContent and mapped by foo mapKey (first sorted by -fromDate). Unfortunatelly this facade don't bring any filter or sorting options. I updated this class in order to allow to : - sort the subcontents (both sucontent_all or subcontent.foo) by whatever field of the ContentAssocViewTo view. For this you need to write in the Freemarker template ${thisContent.setSortOrder(sortString)} before using the sucontent_all or subcontent .foo operations. - filter the output of subcontent_all by mapKey. For this you need to write in the Freemarker template ${thisContent.setMapKeyFilter(mapKeyString)} before using the subcontent_all operation. - filter the output of subcontent_all or subcontent.foo by statusId of the content. For this you need to write in the Freemarker template ${thisContent.setStatusFilter(CONTENT_STATUS)} before using the sbucontent_all or subcontent.foo operations. Examples : ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} <#list thisContent.subcontent_all as contentItem> ${contentItem} </#list> will display all subcontents ordered by caSequenceNum ASC, fromDate DESC ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} ${thisContent.setMapKeyFilter("wideImage")} <#list thisContent.subcontent_all as contentItem> ${contentItem} </#list> will display all subcontents that are mapped with the key wideImade and ordered by caSequenceNum ASC, fromDate DESC ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} ${thisContent.setMapKeyFilter("wideImage")} ${thisContent.setStatusFilter("CTNT_PUBLISHED")} <#list thisContent.subcontent_all as contentItem> ${contentItem} </#list> will display all subcontents that are mapped with the key wideImade and that are in the status PUblished and ordered by caSequenceNum ASC, fromDate DESC -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
[ https://issues.apache.org/jira/browse/OFBIZ-2988?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Patrick Antivackis updated OFBIZ-2988: -------------------------------------- Attachment: Patch-OFBIZ-2988.txt > Improving the ContentMapFacade class in order to filter and sort results > ------------------------------------------------------------------------ > > Key: OFBIZ-2988 > URL: https://issues.apache.org/jira/browse/OFBIZ-2988 > Project: OFBiz > Issue Type: Improvement > Components: content > Affects Versions: SVN trunk > Reporter: Patrick Antivackis > Priority: Minor > Attachments: Patch-OFBIZ-2988.txt > > > Today's ContentMapFacade.class is mapped in the content application to the ${thisContent} variable in Freemarker templates. > Using {$thisContent.subcontent_all} return all the "subcontents" associated with thisContent sorting by -fromDate. > (in fact you usually use it like > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > ) > Using {$thisContent.subcontent.foo} return all the first "subcontent" associated with thisContent and mapped by foo mapKey (first sorted by -fromDate). > Unfortunatelly this facade don't bring any filter or sorting options. > I updated this class in order to allow to : > - sort the subcontents (both sucontent_all or subcontent.foo) by whatever field of the ContentAssocViewTo view. For this you need to write in the Freemarker template ${thisContent.setSortOrder(sortString)} before using the sucontent_all or subcontent .foo operations. > - filter the output of subcontent_all by mapKey. For this you need to write in the Freemarker template ${thisContent.setMapKeyFilter(mapKeyString)} before using the subcontent_all operation. > - filter the output of subcontent_all or subcontent.foo by statusId of the content. For this you need to write in the Freemarker template ${thisContent.setStatusFilter(CONTENT_STATUS)} before using the sbucontent_all or subcontent.foo operations. > Examples : > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > ${thisContent.setStatusFilter("CTNT_PUBLISHED")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and that are in the status PUblished and ordered by caSequenceNum ASC, fromDate DESC -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-2988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762002#action_12762002 ] Jacques Le Roux commented on OFBIZ-2988: ---------------------------------------- Thanks Patrick, Your patch is in trunk at r821474 > Improving the ContentMapFacade class in order to filter and sort results > ------------------------------------------------------------------------ > > Key: OFBIZ-2988 > URL: https://issues.apache.org/jira/browse/OFBIZ-2988 > Project: OFBiz > Issue Type: Improvement > Components: content > Affects Versions: SVN trunk > Reporter: Patrick Antivackis > Priority: Minor > Fix For: SVN trunk > > Attachments: Patch-OFBIZ-2988.txt > > > Today's ContentMapFacade.class is mapped in the content application to the ${thisContent} variable in Freemarker templates. > Using {$thisContent.subcontent_all} return all the "subcontents" associated with thisContent sorting by -fromDate. > (in fact you usually use it like > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > ) > Using {$thisContent.subcontent.foo} return all the first "subcontent" associated with thisContent and mapped by foo mapKey (first sorted by -fromDate). > Unfortunatelly this facade don't bring any filter or sorting options. > I updated this class in order to allow to : > - sort the subcontents (both sucontent_all or subcontent.foo) by whatever field of the ContentAssocViewTo view. For this you need to write in the Freemarker template ${thisContent.setSortOrder(sortString)} before using the sucontent_all or subcontent .foo operations. > - filter the output of subcontent_all by mapKey. For this you need to write in the Freemarker template ${thisContent.setMapKeyFilter(mapKeyString)} before using the subcontent_all operation. > - filter the output of subcontent_all or subcontent.foo by statusId of the content. For this you need to write in the Freemarker template ${thisContent.setStatusFilter(CONTENT_STATUS)} before using the sbucontent_all or subcontent.foo operations. > Examples : > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > ${thisContent.setStatusFilter("CTNT_PUBLISHED")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and that are in the status PUblished and ordered by caSequenceNum ASC, fromDate DESC -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-2988?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-2988. ---------------------------------- Resolution: Fixed Fix Version/s: SVN trunk > Improving the ContentMapFacade class in order to filter and sort results > ------------------------------------------------------------------------ > > Key: OFBIZ-2988 > URL: https://issues.apache.org/jira/browse/OFBIZ-2988 > Project: OFBiz > Issue Type: Improvement > Components: content > Affects Versions: SVN trunk > Reporter: Patrick Antivackis > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: Patch-OFBIZ-2988.txt > > > Today's ContentMapFacade.class is mapped in the content application to the ${thisContent} variable in Freemarker templates. > Using {$thisContent.subcontent_all} return all the "subcontents" associated with thisContent sorting by -fromDate. > (in fact you usually use it like > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > ) > Using {$thisContent.subcontent.foo} return all the first "subcontent" associated with thisContent and mapped by foo mapKey (first sorted by -fromDate). > Unfortunatelly this facade don't bring any filter or sorting options. > I updated this class in order to allow to : > - sort the subcontents (both sucontent_all or subcontent.foo) by whatever field of the ContentAssocViewTo view. For this you need to write in the Freemarker template ${thisContent.setSortOrder(sortString)} before using the sucontent_all or subcontent .foo operations. > - filter the output of subcontent_all by mapKey. For this you need to write in the Freemarker template ${thisContent.setMapKeyFilter(mapKeyString)} before using the subcontent_all operation. > - filter the output of subcontent_all or subcontent.foo by statusId of the content. For this you need to write in the Freemarker template ${thisContent.setStatusFilter(CONTENT_STATUS)} before using the sbucontent_all or subcontent.foo operations. > Examples : > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > ${thisContent.setStatusFilter("CTNT_PUBLISHED")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and that are in the status PUblished and ordered by caSequenceNum ASC, fromDate DESC -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-2988?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reassigned OFBIZ-2988: -------------------------------------- Assignee: Jacques Le Roux > Improving the ContentMapFacade class in order to filter and sort results > ------------------------------------------------------------------------ > > Key: OFBIZ-2988 > URL: https://issues.apache.org/jira/browse/OFBIZ-2988 > Project: OFBiz > Issue Type: Improvement > Components: content > Affects Versions: SVN trunk > Reporter: Patrick Antivackis > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: Patch-OFBIZ-2988.txt > > > Today's ContentMapFacade.class is mapped in the content application to the ${thisContent} variable in Freemarker templates. > Using {$thisContent.subcontent_all} return all the "subcontents" associated with thisContent sorting by -fromDate. > (in fact you usually use it like > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > ) > Using {$thisContent.subcontent.foo} return all the first "subcontent" associated with thisContent and mapped by foo mapKey (first sorted by -fromDate). > Unfortunatelly this facade don't bring any filter or sorting options. > I updated this class in order to allow to : > - sort the subcontents (both sucontent_all or subcontent.foo) by whatever field of the ContentAssocViewTo view. For this you need to write in the Freemarker template ${thisContent.setSortOrder(sortString)} before using the sucontent_all or subcontent .foo operations. > - filter the output of subcontent_all by mapKey. For this you need to write in the Freemarker template ${thisContent.setMapKeyFilter(mapKeyString)} before using the subcontent_all operation. > - filter the output of subcontent_all or subcontent.foo by statusId of the content. For this you need to write in the Freemarker template ${thisContent.setStatusFilter(CONTENT_STATUS)} before using the sbucontent_all or subcontent.foo operations. > Examples : > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and ordered by caSequenceNum ASC, fromDate DESC > ${thisContent.setSortOrder("+caSequenceNum, -fromDate")} > ${thisContent.setMapKeyFilter("wideImage")} > ${thisContent.setStatusFilter("CTNT_PUBLISHED")} > <#list thisContent.subcontent_all as contentItem> > ${contentItem} > </#list> > will display all subcontents that are mapped with the key wideImade and that are in the status PUblished and ordered by caSequenceNum ASC, fromDate DESC -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
| Free forum by Nabble | Edit this page |
