<?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 hide version download link for Consumer in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289305#M242435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The basic principal is exactly the same, except that instead of extending the documentlist.get.js controller you're extending the &amp;nbsp;document-versions.get.js controller and instead of extending the&amp;nbsp;Alfresco.DocumentList widget you're extending the&amp;nbsp;Alfresco.DocumentVersions widget and instead of overriding the&amp;nbsp;onFilterChanged function you're overriding the&amp;nbsp;getDocumentVersionMarkup function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Dec 2016 08:14:19 GMT</pubDate>
    <dc:creator>ddraper</dc:creator>
    <dc:date>2016-12-01T08:14:19Z</dc:date>
    <item>
      <title>How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289296#M242426</link>
      <description>Hi,I want to hide version download link for consumers. Please let me know what needs to be done in order to hide the link.</description>
      <pubDate>Mon, 21 Nov 2016 09:03:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289296#M242426</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2016-11-21T09:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289297#M242427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you provide a more detailed description of what you're trying to achieve? There are lots of places/pages in which a download appears? You refer to "version" download - so I would assume that you want to hide a button or buttons on the document details page in the "Version History" section - is this correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 10:29:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289297#M242427</guid>
      <dc:creator>ddraper</dc:creator>
      <dc:date>2016-11-21T10:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289298#M242428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I want to hide the download link available in the version history&lt;/P&gt;&lt;P&gt;section. I have to hide the link for users with consumer role. I am trying&lt;/P&gt;&lt;P&gt;to override the &lt;STRONG&gt;document-versions.js&lt;/STRONG&gt; file's function&lt;/P&gt;&lt;P&gt;"*getDocumentVersionMarkup:&lt;/P&gt;&lt;P&gt;function DocumentVersions_getDocumentVersionMarkup(doc)*." I am calling the&lt;/P&gt;&lt;P&gt;membership webscript to check the role of the user "*var json =&lt;/P&gt;&lt;P&gt;remote.call("/api/sites/" + page.url.templateArgs.site + "/memberships/" +&lt;/P&gt;&lt;P&gt;encodeURIComponent(user.name &amp;lt;http://user.name&amp;gt;));*" and hide the link if&lt;/P&gt;&lt;P&gt;the user role is SiteConsumer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this correct ??&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 10:35:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289298#M242428</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2016-11-21T10:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289299#M242429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I would say that this looks to be the correct approach. Is it not working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 11:12:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289299#M242429</guid>
      <dc:creator>ddraper</dc:creator>
      <dc:date>2016-11-21T11:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289300#M242430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see an error ""&lt;STRONG&gt;Uncaught ReferenceError: remote is not defined&lt;/STRONG&gt; ."&lt;/P&gt;&lt;P&gt;Can you please let me know where I am going wrong ?&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 11:49:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289300#M242430</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2016-11-21T11:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289301#M242431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah... this is because "remote" is a variable that is available in the JavaScript controller of the WebScript - not on the client. You should aim to use this capability in the JavaScript controller to determine whether or not the user is a Site Consumer and then pass that information on to a customized version of the&amp;nbsp;Alfresco.DocumentVersions widget.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should follow the principals outlined in this blog post for how to do it:&amp;nbsp;&lt;A href="https://community.alfresco.com/community/ecm/blog/2012/05/22/customizing-share-javascript-widget-instantiation-part-1" rel="nofollow noopener noreferrer"&gt;https://community.alfresco.com/community/ecm/blog/2012/05/22/customizing-share-javascript-widget-instantiation-part-1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 12:02:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289301#M242431</guid>
      <dc:creator>ddraper</dc:creator>
      <dc:date>2016-11-21T12:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289302#M242432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error while customizing docuement-versions.js&lt;/P&gt;&lt;P&gt;file's getDocumentVersionMarkup: function&lt;/P&gt;&lt;P&gt;DocumentVersions_getDocumentVersionMarkup(doc) method. In this I am getting&lt;/P&gt;&lt;P&gt;response object as null but I can see in the developer console that my&lt;/P&gt;&lt;P&gt;membership webscript is returning the desired result. can you please help&lt;/P&gt;&lt;P&gt;me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my custom code - http://pastebin.com/ABQ8BubJ&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 05:35:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289302#M242432</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2016-11-22T05:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289303#M242433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On first inspection it looks like the problem you have is that you're treating an asynchronous request as being synchronous... so you make the call to&amp;nbsp;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;Alfresco.util.Ajax.jsonGet and then immediately continue the processing and try to reference the variable "json" before the XHR request has completed and set it - this is why it's being reported as null. The XHR request does successfully complete, but not until&amp;nbsp;&lt;STRONG&gt;after&lt;/STRONG&gt; you've tried to reference "json".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;As I suggested in my previous answer, your best best here is to determine whether or not the user is a SiteConsumer in the JavaScript controller of the WebScript and&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; on the client-side - otherwise it's just going to make your client side code that much more complicated. The calls using "remote" in the JavaScript controller&amp;nbsp;&lt;STRONG&gt;are&amp;nbsp;&lt;/STRONG&gt;handled synchronously.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 13:08:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289303#M242433</guid>
      <dc:creator>ddraper</dc:creator>
      <dc:date>2016-11-22T13:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289304#M242434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;Hi Dave,&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;You were right it was an issue related to synchronization, though my Ajax call was fetching the result, albeit late. For the moment I have moved the Ajax call to the controller document-versions.get.js and fetching the result using remote call then passing the result variable to client side javascript document-versions.js. This is achieved by overriding both the files, which works fine, now I want to move the solution to what you have suggested by extending the widget and overriding the function but I am a bit confused.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;In the example you have provided you have extended the function onFilterChanged in your custom widget but in my case I want override the function(getDocumentVersionMarkup: function DocumentVersions_getDocumentVersionMarkup(doc)) and modify the original html object that is sent.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;Please advise me on how I can achieve that.&amp;nbsp;&lt;SPAN&gt;Attaching overridden files for reference.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 05:44:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289304#M242434</guid>
      <dc:creator>hiten_rastogi1</dc:creator>
      <dc:date>2016-12-01T05:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide version download link for Consumer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289305#M242435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The basic principal is exactly the same, except that instead of extending the documentlist.get.js controller you're extending the &amp;nbsp;document-versions.get.js controller and instead of extending the&amp;nbsp;Alfresco.DocumentList widget you're extending the&amp;nbsp;Alfresco.DocumentVersions widget and instead of overriding the&amp;nbsp;onFilterChanged function you're overriding the&amp;nbsp;getDocumentVersionMarkup function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 08:14:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-hide-version-download-link-for-consumer/m-p/289305#M242435</guid>
      <dc:creator>ddraper</dc:creator>
      <dc:date>2016-12-01T08:14:19Z</dc:date>
    </item>
  </channel>
</rss>

