I am trying to display new dropdown in aikau search result beside existing dropdown with my custom action.
Below Code I have tried and I am succeed to display.
model.jsonModel.services.push("search/owner"); var menubar = widgetUtils.findObject(model.jsonModel.widgets, "id","FCTSRCH_SEARCH_LIST_MENU_BAR"); if (menubar && menubar.config && menubar.config.widgets) { menubar.config.widgets.unshift({ id : "SELECTED_ITEMS_MENU", name : "alfresco/documentlibrary/AlfSelectedItemsMenuBarPopup", config : { label : "Selected Items...", itemKeyProperty : "nodeRef", widgets : [ { id : "SELECTED_ITEMS_ACTIONS_GROUP", name : "alfresco/menus/AlfMenuGroup", config : { widgets : [ { name : "alfresco/documentlibrary/AlfDocumentActionMenuItem", config : { id : "owner", label : "Action 1", iconImage : "", type : "action-link", permission : "", asset : "", href : "", hasAspect : "", notAspect : "", publishTopic : "CUSTOM_TOPIC", publishPayload: { } } } ] } } ] } }); menubar.config.widgets.unshift({ name : "alfresco/documentlibrary/AlfSelectDocumentListItems", config : { widgets : [ { name : "alfresco/menus/AlfMenuGroup", config : { widgets : [ { name : "alfresco/menus/AlfMenuItem", config : { label : "select.all.label", publishTopic : "ALF_DOCLIST_FILE_SELECTION", publishPayload : { label : "select.all.label", value : "selectAll" } } }, { name : "alfresco/menus/AlfMenuItem", config : { label : "select.none.label", publishTopic : "ALF_DOCLIST_FILE_SELECTION", publishPayload : { label : "select.none.label", value : "selectNone" } } } ] } } ] } }); } var searchresult = widgetUtils.findObject(model.jsonModel.widgets, "id","FCTSRCH_SEARCH_RESULT"); if (searchresult && searchresult.config) { searchresult.config.showSelector = true; }
owner.js
define([ "dojo/_base/declare", "dijit/_WidgetBase", "alfresco/core/Core", "dojo/_base/lang" ], function(declare, _Widget, Core, lang) { return declare([ _Widget, Core ], { constructor : function constructor(args) { this.alfSubscribe("CUSTOM_TOPIC", lang.hitch(this,this._onPayloadReceive)); }, _onPayloadReceive : function(payload) { console.log(payload); } }); });
When I click on Action 1, I am able to subscr that ibe topic in my service file which is owner.js
My question is How Can I pass selected items(or noderef) in my service?I want to get noderef of selected documents.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.