<?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: How to fetch document version as a drop down for an action in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291995#M245125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to crack this. For anyone looking for solution please check out &lt;A _jive_internal="true" href="https://community.alfresco.com/message/808007-re-how-to-get-noderef-in-a-custom-dialog-template?commentID=808007#comment-808007" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; comment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Feb 2017 05:55:35 GMT</pubDate>
    <dc:creator>hiten_rastogi1</dc:creator>
    <dc:date>2017-02-17T05:55:35Z</dc:date>
    <item>
      <title>How to fetch document version as a drop down for an action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291991#M245121</link>
      <description>Hi Guys,I developing an action the will allow the site manager to delete one or more versions of a document through an action. Right now I am asking user for input in the action through a dialog box but I want show a drop down that will fetch all the versions of the document and display it to user f</description>
      <pubDate>Thu, 01 Dec 2016 05:53:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291991#M245121</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2016-12-01T05:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch document version as a drop down for an action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291992#M245122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;It depends on how you are implementing your action, but you may already have a dialog in your custom action client side code.&lt;BR /&gt;Within that dialog you can define the template to be a custom webscript (Share tier)&lt;/P&gt;&lt;PRE&gt;...&lt;BR /&gt;templateUrl : Alfresco.constants.URL_SERVICECONTEXT + "yourCustomDialogWebscriptURL?nodeRef=" + file.nodeRef,&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;In that webscript controller, you need to call api/version for your node, something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;...&lt;BR /&gt;var getVersionsURL = "/api/version?nodeRef=" + args.nodeRef;&lt;BR /&gt;var connector = remote.connect("alfresco");&lt;BR /&gt;var result = connector.get(getVersionsURL);&lt;BR /&gt;if(result.status == 200)&lt;BR /&gt;{&lt;BR /&gt; model.versions = JSON.parse(result);&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And finally you can iterate the versionHistory in the dialog freemarker template, something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;...&lt;BR /&gt;&amp;lt;select name="versionSelect"&amp;gt;&lt;BR /&gt; &amp;lt;#list versions as version&amp;gt;&lt;BR /&gt; &amp;lt;option value="${version.label}"&amp;gt;${version.label}&amp;lt;/option&amp;gt; &lt;BR /&gt; &amp;lt;/#list&amp;gt;&lt;BR /&gt;&amp;lt;/select&amp;gt;&lt;/PRE&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally, this is an example json returned by api/version&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;[&lt;BR /&gt; {&lt;BR /&gt; "nodeRef": "versionStore:\/\/version2Store\/ee0c0cde-db24-40eb-835c-a81478da9535",&lt;BR /&gt; "name": "Project Contract.pdf",&lt;BR /&gt; "label": "2.1",&lt;BR /&gt; "description": "I made so many changes to this doc",&lt;BR /&gt; "createdDate": "01 dic 2016 12:07:11 GMT+0100 (CET)",&lt;BR /&gt; "createdDateISO": "2016-12-01T12:07:11.365+01:00",&lt;BR /&gt; "creator":&lt;BR /&gt; {&lt;BR /&gt; "userName": "admin",&lt;BR /&gt; "firstName": "Administrator",&lt;BR /&gt; "lastName": ""&lt;BR /&gt; }&lt;BR /&gt; },&lt;BR /&gt; ... &lt;BR /&gt;]&lt;/PRE&gt;&lt;P&gt;I hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 11:38:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291992#M245122</guid>
      <dc:creator>mikel_asla</dc:creator>
      <dc:date>2016-12-01T11:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch document version as a drop down for an action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291993#M245123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mike. I will try this and post the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hiten Rastogi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sr. Software Engineer&lt;/P&gt;&lt;P&gt;Mobile:   +91 9899586608&lt;/P&gt;&lt;P&gt;Email:     hiten.rastogi@eisenvault.com &amp;lt;vipul.swarup@eisenvault.com&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On 1 December 2016 at 17:09, mikel_asla_keensoft &amp;lt;community@alfresco.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 11:54:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291993#M245123</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2016-12-01T11:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch document version as a drop down for an action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291994#M245124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mikel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I know it is a bit late but I got involved in other stuff and kept this on the back-burner. So, I was trying what you suggested above but instead of calling a custom share side webscript which would call the versions webscript I called the versions webscript directly from the ftl script tag. The issue I am facing here is that I am not able to get the nodeRef of the document. I tried getting the nodeRef by&amp;nbsp;&lt;STRONG style="color: #000000; border: 0px; font-weight: bold;"&gt;form.arguments.itemId&lt;/STRONG&gt;&amp;nbsp;as suggested by Alex in my other post &lt;A _jive_internal="true" href="https://community.alfresco.com/message/807655-re-how-to-get-noderef-in-a-custom-dialog-template?commentID=807655&amp;amp;et=watches.email.thread#comment-807655" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt; but it gave me&amp;nbsp;&lt;STRONG style="color: #000000; border: 0px; font-weight: bold;"&gt;version-delete&lt;/STRONG&gt;&amp;nbsp;as value&amp;nbsp;&amp;nbsp;Below is the ftl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#include "/org/alfresco/components/form/controls/common/utils.inc.ftl" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript"&amp;gt;//&amp;lt;![CDATA[&lt;BR /&gt;YAHOO.util.Event.onContentReady("${fieldHtmlId}", function ()&lt;BR /&gt;{&lt;BR /&gt; Alfresco.util.Ajax.jsonGet({&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// supplementing hardcoded noderef just to check if the ftl works; needs to be replaced by object containing noderef. YAY!! it works.&lt;/STRONG&gt;&amp;nbsp;&lt;BR /&gt; url: encodeURI(Alfresco.constants.PROXY_URI + 'api/version?nodeRef=workspace://SpacesStore/284202aa-e21f-4e23-bf18-b163c4d9fa49'),&lt;BR /&gt; successCallback:&lt;BR /&gt; {&lt;BR /&gt; fn: function loadWebscript_successCallback(response, config)&lt;BR /&gt; {&lt;BR /&gt; var obj = JSON.parse(response.serverResponse.responseText);&lt;BR /&gt; if (obj)&lt;BR /&gt; {&lt;BR /&gt; for (i = 0; i &amp;lt; obj.length; i++) {&lt;BR /&gt; var newOption = document.createElement('option');&lt;BR /&gt; newOption.value = obj[i].label;&lt;BR /&gt; newOption.text = obj[i].label;&lt;BR /&gt; YAHOO.util.Dom.get("${fieldHtmlId}").options.add(newOption);&lt;BR /&gt; }&lt;BR /&gt; // Current value&lt;BR /&gt; var sp = document.getElementById("${fieldHtmlId}");&lt;BR /&gt; sp.value = "${field.value}";&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt;}, this);&lt;BR /&gt;//]]&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#if field.control.params.optionSeparator??&amp;gt;&lt;BR /&gt; &amp;lt;#assign optionSeparator=field.control.params.optionSeparator&amp;gt;&lt;BR /&gt;&amp;lt;#else&amp;gt;&lt;BR /&gt; &amp;lt;#assign optionSeparator=","&amp;gt;&lt;BR /&gt;&amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;#if field.control.params.labelSeparator??&amp;gt;&lt;BR /&gt; &amp;lt;#assign labelSeparator=field.control.params.labelSeparator&amp;gt;&lt;BR /&gt;&amp;lt;#else&amp;gt;&lt;BR /&gt; &amp;lt;#assign labelSeparator="|"&amp;gt;&lt;BR /&gt;&amp;lt;/#if&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#assign fieldValue=field.value&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#if fieldValue?string == "" &amp;amp;&amp;amp; field.control.params.defaultValueContextProperty??&amp;gt;&lt;BR /&gt; &amp;lt;#if context.properties[field.control.params.defaultValueContextProperty]??&amp;gt;&lt;BR /&gt; &amp;lt;#assign fieldValue = context.properties[field.control.params.defaultValueContextProperty]&amp;gt;&lt;BR /&gt; &amp;lt;#elseif args[field.control.params.defaultValueContextProperty]??&amp;gt;&lt;BR /&gt; &amp;lt;#assign fieldValue = args[field.control.params.defaultValueContextProperty]&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;/#if&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div class="form-field"&amp;gt;&lt;BR /&gt; &amp;lt;#if form.mode == "view"&amp;gt;&lt;BR /&gt; &amp;lt;div class="viewmode-field"&amp;gt;&lt;BR /&gt; &amp;lt;#if field.mandatory &amp;amp;&amp;amp; !(fieldValue?is_number) &amp;amp;&amp;amp; fieldValue?string == ""&amp;gt;&lt;BR /&gt; &amp;lt;span class="incomplete-warning"&amp;gt;&amp;lt;img src="${url.context}/res/components/form/images/warning-16.png" title="${msg("form.field.incomplete")}" /&amp;gt;&amp;lt;span&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;span class="viewmode-label"&amp;gt;${field.label?html}:&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;#if fieldValue?string == ""&amp;gt;&lt;BR /&gt; &amp;lt;#assign valueToShow=msg("form.control.novalue")&amp;gt;&lt;BR /&gt; &amp;lt;#else&amp;gt;&lt;BR /&gt; &amp;lt;#assign valueToShow=fieldValue&amp;gt;&lt;BR /&gt; &amp;lt;#if field.control.params.options?? &amp;amp;&amp;amp; field.control.params.options != ""&amp;gt;&lt;BR /&gt; &amp;lt;#list field.control.params.options?split(optionSeparator) as nameValue&amp;gt;&lt;BR /&gt; &amp;lt;#if nameValue?index_of(labelSeparator) == -1&amp;gt;&lt;BR /&gt; &amp;lt;#if nameValue == fieldValue?string || (fieldValue?is_number &amp;amp;&amp;amp; fieldValue?c == nameValue)&amp;gt;&lt;BR /&gt; &amp;lt;#assign valueToShow=nameValue&amp;gt;&lt;BR /&gt; &amp;lt;#break&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#else&amp;gt;&lt;BR /&gt; &amp;lt;#assign choice=nameValue?split(labelSeparator)&amp;gt;&lt;BR /&gt; &amp;lt;#if choice[0] == fieldValue?string || (fieldValue?is_number &amp;amp;&amp;amp; fieldValue?c == choice[0])&amp;gt;&lt;BR /&gt; &amp;lt;#assign valueToShow=msgValue(choice[1])&amp;gt;&lt;BR /&gt; &amp;lt;#break&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;/#list&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;span class="viewmode-value"&amp;gt;${valueToShow?html}&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;#else&amp;gt;&lt;BR /&gt; &amp;lt;label for="${fieldHtmlId}"&amp;gt;${field.label?html}:&amp;lt;#if field.mandatory&amp;gt;&amp;lt;span class="mandatory-indicator"&amp;gt;${msg("form.required.fields.marker")}&amp;lt;/span&amp;gt;&amp;lt;/#if&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt; &amp;lt;select id="${fieldHtmlId}" name="${field.name}" tabindex="0"&lt;BR /&gt; &amp;lt;#if field.description??&amp;gt;title="${field.description}"&amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if field.control.params.size??&amp;gt;size="${field.control.params.size}"&amp;lt;/#if&amp;gt; &lt;BR /&gt; &amp;lt;#if field.control.params.styleClass??&amp;gt;class="${field.control.params.styleClass}"&amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if field.control.params.style??&amp;gt;style="${field.control.params.style}"&amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if field.disabled &amp;amp;&amp;amp; !(field.control.params.forceEditable?? &amp;amp;&amp;amp; field.control.params.forceEditable == "true")&amp;gt;disabled="true"&amp;lt;/#if&amp;gt;&amp;gt;&lt;BR /&gt; &amp;lt;/select&amp;gt;&lt;BR /&gt; &amp;lt;@formLib.renderFieldHelp field=field /&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hiten Rastogi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 09:11:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291994#M245124</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2017-02-13T09:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch document version as a drop down for an action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291995#M245125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to crack this. For anyone looking for solution please check out &lt;A _jive_internal="true" href="https://community.alfresco.com/message/808007-re-how-to-get-noderef-in-a-custom-dialog-template?commentID=808007#comment-808007" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; comment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2017 05:55:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291995#M245125</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2017-02-17T05:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch document version as a drop down for an action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291996#M245126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I didn't read your question on time...&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2017 11:33:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-fetch-document-version-as-a-drop-down-for-an-action/m-p/291996#M245126</guid>
      <dc:creator>mikel_asla</dc:creator>
      <dc:date>2017-02-17T11:33:19Z</dc:date>
    </item>
  </channel>
</rss>

