<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to call My ftl/desc.xml/js on new multi-select action in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104750#M29685</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below way you can call repository webscript.&lt;/P&gt;&lt;PRE&gt;.Bubbling.fire("registerAction", {
	actionName: "actionname",
	fn: function _anyFunction(selectedNodes) {
		
		
		this.modules.actions.genericAction({
			success: {
				message: this.msg("message")
			},
			failure: {
				message: this.msg("message")
			},
			webscript: {
				name: "url",
				method: Alfresco.util.Ajax.POST
			},
			config: {
				requestContentType: Alfresco.util.Ajax.JSON,
				dataObj: {
					nodeRefs: dataObj
				}
			}
		})
	}
});&lt;/PRE&gt;&lt;P&gt;You can use ajax also to get/send data to repository.&lt;/P&gt;</description>
    <pubDate>Fri, 08 May 2020 16:21:38 GMT</pubDate>
    <dc:creator>sp2</dc:creator>
    <dc:date>2020-05-08T16:21:38Z</dc:date>
    <item>
      <title>Unable to call My ftl/desc.xml/js on new multi-select action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104747#M29682</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created new action in multi-select of documentLibrary but I am unable to call my create-package.ftl by clicking on it.&lt;/P&gt;&lt;P&gt;Code for creating new action&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Document Library config section --&amp;gt;&lt;BR /&gt;&amp;lt;config evaluator="string-compare" condition="DocumentLibrary"&amp;gt;&lt;BR /&gt;&amp;lt;multi-select&amp;gt;&lt;BR /&gt;&amp;lt;action type="action-link" id="onActionCreatePackage" icon="document-copy-to" label="menu.selected-items.createPackage" /&amp;gt;&lt;BR /&gt;&amp;lt;/multi-select&amp;gt;&lt;BR /&gt;&amp;lt;/config&amp;gt;&lt;/P&gt;&lt;P&gt;code of my create-package..get.desc.xml&lt;/P&gt;&lt;P&gt;&amp;lt;webscript&amp;gt;&lt;BR /&gt;&amp;lt;shortname&amp;gt;London Weather&amp;lt;/shortname&amp;gt;&lt;BR /&gt;&amp;lt;description&amp;gt;Simple Surf Web Script fetching London weather information&amp;lt;/description&amp;gt;&lt;BR /&gt;&amp;lt;family&amp;gt;Share&amp;lt;/family&amp;gt;&lt;BR /&gt;&amp;lt;url&amp;gt;/supplierPortal/createPackage&amp;lt;/url&amp;gt;&lt;BR /&gt;&amp;lt;/webscript&amp;gt;&lt;/P&gt;&lt;P&gt;Kindly suggest how can I call this .get.desc.xml from my new custom action.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 06:21:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104747#M29682</guid>
      <dc:creator>Isha</dc:creator>
      <dc:date>2020-05-08T06:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to call My ftl/desc.xml/js on new multi-select action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104748#M29683</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to define&amp;nbsp;&lt;SPAN&gt;onActionCreatePackage function in javascript file and from that you can call your repository webscript.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 09:56:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104748#M29683</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-05-08T09:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to call My ftl/desc.xml/js on new multi-select action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104749#M29684</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/36939"&gt;@sanjaybandhniya&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;I tried writing function in action.js and able to call this function but facing issue while calling repository action.below is the code written in onActionCrateFucntion. If Possible can you please share some example of calling repo in action.js&lt;/P&gt;&lt;P&gt;onActionCreatePackage: function dlA__SendPackage(record)&lt;BR /&gt;{&lt;BR /&gt;var theurl;&lt;BR /&gt;theurl = "/alfresco/apiCallCreation";&lt;BR /&gt;json = remote.call(theurl);&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 11:10:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104749#M29684</guid>
      <dc:creator>Isha</dc:creator>
      <dc:date>2020-05-08T11:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to call My ftl/desc.xml/js on new multi-select action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104750#M29685</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below way you can call repository webscript.&lt;/P&gt;&lt;PRE&gt;.Bubbling.fire("registerAction", {
	actionName: "actionname",
	fn: function _anyFunction(selectedNodes) {
		
		
		this.modules.actions.genericAction({
			success: {
				message: this.msg("message")
			},
			failure: {
				message: this.msg("message")
			},
			webscript: {
				name: "url",
				method: Alfresco.util.Ajax.POST
			},
			config: {
				requestContentType: Alfresco.util.Ajax.JSON,
				dataObj: {
					nodeRefs: dataObj
				}
			}
		})
	}
});&lt;/PRE&gt;&lt;P&gt;You can use ajax also to get/send data to repository.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 16:21:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104750#M29685</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-05-08T16:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to call My ftl/desc.xml/js on new multi-select action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104751#M29686</link>
      <description>&lt;P&gt;Hi Sanjay,&lt;/P&gt;&lt;P&gt;I have a similar problem with an action called from the multiple selection menu in Share (Alfresco 6.2). In your example, what is the format of "url" (in name&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;? My webscript for testing with a fixed parameter works like this:&lt;/P&gt;&lt;P&gt;http://localhost:8180/share/proxy/alfresco/mywebscript?nodeRef=workspace://SpacesStore/f63a0c20-27b3-4830-b3a5-345d38a10c3f&lt;/P&gt;&lt;P&gt;it returns xml.&lt;/P&gt;&lt;P&gt;My js code is:&lt;/P&gt;&lt;PRE&gt;YAHOO.Bubbling.fire("registerAction",
{
  actionName: "onActionWebscript",
  fn: function my_onActionWebscript(selectedNodes) {
    this.modules.actions.genericAction({
    success: {
      message: this.msg("msg-success")
      },
    failure: {
      message: this.msg("msg-failure")
    },
    webscript: {
      name: "http://localhost:8180/share/proxy/alfresco/mywebscript?nodeRef=workspace://SpacesStore/f63a0c20-27b3-4830-b3a5-345d38a10c3f",
      method: Alfresco.util.Ajax.GET
    },
    config: {
      requestContentType: Alfresco.util.Ajax.XML,
    params: {
    }
  }
})
}
});&lt;/PRE&gt;&lt;P&gt;I also tried it with just this part:&lt;/P&gt;&lt;P&gt;"mywebscript?nodeRef=workspace://SpacesStore/f63a0c20-27b3-4830-b3a5-345d38a10c3f"&lt;/P&gt;&lt;P&gt;It always shows me my failure message.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 03:40:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104751#M29686</guid>
      <dc:creator>konsultex</dc:creator>
      <dc:date>2020-07-28T03:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to call My ftl/desc.xml/js on new multi-select action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104752#M29687</link>
      <description>&lt;P&gt;After examining many examples in different posts I managed to solve my problem. In case it helps someone in the future, here's what I did:&lt;/P&gt;&lt;P&gt;1) Web script description defined as GET with JSON as the default:&lt;/P&gt;&lt;PRE&gt;&amp;lt;webscript&amp;gt; &amp;lt;shortname&amp;gt;Extract image tags&amp;lt;/shortname&amp;gt; &amp;lt;description&amp;gt;Extrct image tags&amp;lt;/description&amp;gt; &amp;lt;url&amp;gt;/mywebscript?nodeRef={nodeRef}&amp;lt;/url&amp;gt; &amp;lt;format default="json"&amp;gt;&amp;lt;/format&amp;gt; &amp;lt;authentication&amp;gt;user&amp;lt;/authentication&amp;gt; &amp;lt;/webscript&amp;gt;&lt;/PRE&gt;&lt;P&gt;2) ftl template like this:&lt;/P&gt;&lt;PRE&gt;{"Return" :
&amp;nbsp; {
&amp;nbsp; "Images processed" : "${images}",
&amp;nbsp; }
}&lt;/PRE&gt;&lt;P&gt;3) Java controller like this:&lt;/P&gt;&lt;PRE&gt;.....
String nodeRef = req.getParameter("nodeRef");
StoreRef storeRef = new StoreRef("workspace", "SpacesStore");
// split into individual node IDs (* is a regex meta character)
String[] images = nodeRef.split("\\*");
		int len = images.length;
		int i = 0;
		while (i &amp;lt; len) {
			NodeRef node = new NodeRef(storeRef, images[i]);
			.......
			i =i + 1;
		}
		// construct model for response template to render
		Map&amp;lt;String, Object&amp;gt; model = new HashMap&amp;lt;String, Object&amp;gt;();
		model.put("images", len);
.......&lt;/PRE&gt;&lt;P&gt;4) js script custom-doclib-actions.js&lt;/P&gt;&lt;PRE&gt;(function () {

	YAHOO.Bubbling.fire("registerAction", 
			{
				actionName: "onActionWebscript",
				fn: function my_onActionWebscript(selectedNodes) {
					var nodeIDs = "";
                    var ii = 0;
                    for (var i=0, ii=selectedNodes.length ; i&amp;lt;ii ; i++){
        	        	nodeIDs = nodeIDs + "*" + selectedNodes[i].nodeRef.substring(24);
        	    	}
                    nodeIDs = nodeIDs.substring(1);
					this.modules.actions.genericAction({
						success: {
							message: this.msg("msg-success")
						},
						failure: {
							message: this.msg("msg-failure")
						},
						webscript: {
							name: "mywebscript?nodeRef={nodeRef}",
							stem: Alfresco.constants.PROXY_URI,
							method: Alfresco.util.Ajax.GET,
							params: {
                                nodeRef: nodeIDs
                            }
						},
						config: {
							requestContentType: Alfresco.util.Ajax.JSON
						}
			})
		}
	});
})();&lt;/PRE&gt;&lt;P&gt;This worked for me. It may not be the best way though. I couldn't find any documentation to make it better.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 03:46:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104752#M29687</guid>
      <dc:creator>konsultex</dc:creator>
      <dc:date>2020-07-29T03:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to call My ftl/desc.xml/js on new multi-select action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104753#M29688</link>
      <description>&lt;P&gt;I wrote a &lt;A href="https://ecmarchitect.com/archives/2020/08/04/4474" target="_self" rel="nofollow noopener noreferrer"&gt;blog post&lt;/A&gt; on this to try to help others who may also wonder how to add custom actions to the Selected Items menu in Share. There is an &lt;A href="https://github.com/jpotts/multiselect-demo" target="_self" rel="nofollow noopener noreferrer"&gt;accompanying source code project&lt;/A&gt; on GitHub as well.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 17:08:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unable-to-call-my-ftl-desc-xml-js-on-new-multi-select-action/m-p/104753#M29688</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2020-08-04T17:08:31Z</dc:date>
    </item>
  </channel>
</rss>

