Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Filter Content Finder data using path property

Avatar

Level 2

Hi,

 

I have created a custom XTYPE that allow users to select a path from the repository, and am trying to use this in content Finder by adding this XTYPE as filter. This XTYPE returns me the selected path, but I further want to filter data (assets) based on the selected path. 

Could anyone help me with the approach/sample code to refer to. Here's my assets.js file from contentFinder, that adds my custom path field XType to the tab:

    

{ "tabTip": CQ.I18n.getMessage("VDM Assets"), "id": "cfTab-VDM-Assets", "xtype": "contentfindertab", "iconCls": "cq-cft-tab-icon images", /*"closable": true,*/ "ranking": 30, "allowedPaths": [ "/content/*", "/etc/scaffolding/*", "/etc/commerce/*", "/etc/workflow/packages/*" ], "items": [ CQ.wcm.ContentFinderTab.getQueryBoxConfig({ "id": "cfTab-Images-QueryBox", /*"height": 95,*/ "items": [ { "xtype": "custompathfield", "style": "width:100%", "typeAhead": false, "mode": "local", "name":"browse", "emptyText":"VDM Tree", }, CQ.wcm.ContentFinderTab.getSuggestFieldConfig({"url": "/bin/wcm/contentfinder/suggestions.json/content"}) /* , { "xtype": "combo", "name": "size", "value": CQ.I18n.getMessage("Any format"), "mode": "local", "store": new CQ.Ext.data.SimpleStore({ "fields": ["value", "text"], "data": [ { "text": CQ.I18n.getMessage("Any Format"), "value": "image" },{ "text": CQ.I18n.getMessage("Web Graphics (GIF)"), "value": "image/gif" },{ "text": CQ.I18n.getMessage("Photographs (JPEG)"), "value": "image/jpeg" },{ "text": CQ.I18n.getMessage("Web Images (PNG)"), "value": "image/png" } ] }) } */ ] }), CQ.wcm.ContentFinderTab.getResultsBoxConfig({ "itemsDDGroups": [CQ.wcm.EditBase.DD_GROUP_ASSET], "mergeItemsDDGroups": ["s7media"], "itemsDDNewParagraph": { "path": "foundation/components/image", "propertyName": "./fileReference" }, "noRefreshButton": true, "tbar": [ CQ.wcm.ContentFinderTab.REFRESH_BUTTON, "->", { "toggleGroup": "cfTab-Images-TG", "enableToggle": true, "toggleHandler": function(button, pressed) { var tab = CQ.Ext.getCmp("cfTab-Images"); if (pressed) { tab.dataView.tpl = new CQ.Ext.XTemplate(CQ.wcm.ContentFinderTab.THUMBS_TEMPLATE); tab.dataView.itemSelector = CQ.wcm.ContentFinderTab.THUMBS_ITEMSELECTOR; } if (tab.dataView.store != null) { tab.dataView.refresh(); } }, "pressed": true, "allowDepress": false, "cls": "cq-btn-thumbs cq-cft-dataview-btn", "iconCls":"cq-cft-dataview-mosaic", "tooltip": { "text": CQ.I18n.getMessage("Mosaic View"), "autoHide":true } }, { "toggleGroup": "cfTab-Images-TG", "enableToggle": true, "toggleHandler": function(button, pressed) { var tab = CQ.Ext.getCmp("cfTab-Images"); if (pressed) { tab.dataView.tpl = new CQ.Ext.XTemplate(CQ.wcm.ContentFinderTab.DETAILS_TEMPLATE); tab.dataView.itemSelector = CQ.wcm.ContentFinderTab.DETAILS_ITEMSELECTOR; } if (tab.dataView.store != null) { tab.dataView.refresh(); } }, "pressed": false, "allowDepress": false, "cls": "cq-btn-details cq-cft-dataview-btn", "iconCls":"cq-cft-dataview-list", "tooltip": { "text": CQ.I18n.getMessage("List View"), "autoHide": true } } ] },{ "url": "/bin/wcm/contentfinder/asset/view.json/content" }, { "baseParams": { /*"defaultMimeType": "image"*/ "mimeType": "image" }, "autoLoad":false, "reader": new CQ.Ext.data.JsonReader({ "totalProperty": "results", "root": "hits", "fields": [ "name", "path", "title", "mimeType", "ddGroups", "size", "lastModified", "ck", "templateParams", "imageWidth", "imageHeight" ], "id": "path" }) }) ] }
1 Accepted Solution

Avatar

Correct answer by
Level 10

Look at this article - it talks about adding a tab to content finder and using Java on the backend to populate it.  

https://chanchal.wordpress.com/2013/06/26/how-to-add-your-own-content-finder-tab-in-cq5/

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Look at this article - it talks about adding a tab to content finder and using Java on the backend to populate it.  

https://chanchal.wordpress.com/2013/06/26/how-to-add-your-own-content-finder-tab-in-cq5/