<?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 custom share-header in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/custom-share-header/m-p/90291#M26958</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I tried to override the getSiteData() in the share-header.lib.js file. I created the modified share-header.get.js in the following directory of SDK folder sites-webscripts/&lt;/P&gt;&lt;P&gt;sites-webscripts/com/alfresco/share/header/&lt;/P&gt;&lt;P&gt;and my extension file is like as follow&lt;/P&gt;&lt;P&gt;&amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;id&amp;gt;custom shareService&amp;lt;/id&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;auto-deploy&amp;gt;true&amp;lt;/auto-deploy&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;customizations&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;customization&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;targetPackageRoot&amp;gt;org.alfresco.share.header&amp;lt;/targetPackageRoot&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;sourcePackageRoot&amp;gt;com.alfresco.share.header&amp;lt;/sourcePackageRoot&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;/customization&amp;gt;&lt;BR /&gt;&amp;lt;customization&amp;gt;&lt;BR /&gt;&amp;lt;targetPackageRoot&amp;gt;org.alfresco.share.pages&amp;lt;/targetPackageRoot&amp;gt;&lt;BR /&gt;&amp;lt;sourcePackageRoot&amp;gt;com.alfresco.share.header&amp;lt;/sourcePackageRoot&amp;gt;&lt;BR /&gt;&amp;lt;alwaysApply&amp;gt;&lt;BR /&gt;&amp;lt;webscript&amp;gt;share-header&amp;lt;/webscript&amp;gt;&lt;BR /&gt;&amp;lt;/alwaysApply&amp;gt;&lt;BR /&gt;&amp;lt;/customization&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/customizations&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/module&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My file:share-header.get.js&lt;/P&gt;&lt;P&gt;&amp;lt;import resource="classpath:/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js"&amp;gt;&lt;/P&gt;&lt;P&gt;model.jsonModel = {&lt;BR /&gt;rootNodeId: "share-header",&lt;BR /&gt;services: getHeaderServices(),&lt;BR /&gt;widgets: [&lt;BR /&gt;{&lt;BR /&gt;id: "SHARE_VERTICAL_LAYOUT",&lt;BR /&gt;name: "alfresco/layout/VerticalWidgets",&lt;BR /&gt;config:&lt;BR /&gt;{&lt;BR /&gt;widgets: getHeaderModel()&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;getSiteData(){&lt;BR /&gt;...&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;But the changes made are not supported. Do I need to add anything more?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2020 15:04:24 GMT</pubDate>
    <dc:creator>ALfreSara</dc:creator>
    <dc:date>2020-10-07T15:04:24Z</dc:date>
    <item>
      <title>custom share-header</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-share-header/m-p/90291#M26958</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I tried to override the getSiteData() in the share-header.lib.js file. I created the modified share-header.get.js in the following directory of SDK folder sites-webscripts/&lt;/P&gt;&lt;P&gt;sites-webscripts/com/alfresco/share/header/&lt;/P&gt;&lt;P&gt;and my extension file is like as follow&lt;/P&gt;&lt;P&gt;&amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;id&amp;gt;custom shareService&amp;lt;/id&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;auto-deploy&amp;gt;true&amp;lt;/auto-deploy&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;customizations&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;customization&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;targetPackageRoot&amp;gt;org.alfresco.share.header&amp;lt;/targetPackageRoot&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;sourcePackageRoot&amp;gt;com.alfresco.share.header&amp;lt;/sourcePackageRoot&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;/customization&amp;gt;&lt;BR /&gt;&amp;lt;customization&amp;gt;&lt;BR /&gt;&amp;lt;targetPackageRoot&amp;gt;org.alfresco.share.pages&amp;lt;/targetPackageRoot&amp;gt;&lt;BR /&gt;&amp;lt;sourcePackageRoot&amp;gt;com.alfresco.share.header&amp;lt;/sourcePackageRoot&amp;gt;&lt;BR /&gt;&amp;lt;alwaysApply&amp;gt;&lt;BR /&gt;&amp;lt;webscript&amp;gt;share-header&amp;lt;/webscript&amp;gt;&lt;BR /&gt;&amp;lt;/alwaysApply&amp;gt;&lt;BR /&gt;&amp;lt;/customization&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/customizations&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/module&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My file:share-header.get.js&lt;/P&gt;&lt;P&gt;&amp;lt;import resource="classpath:/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js"&amp;gt;&lt;/P&gt;&lt;P&gt;model.jsonModel = {&lt;BR /&gt;rootNodeId: "share-header",&lt;BR /&gt;services: getHeaderServices(),&lt;BR /&gt;widgets: [&lt;BR /&gt;{&lt;BR /&gt;id: "SHARE_VERTICAL_LAYOUT",&lt;BR /&gt;name: "alfresco/layout/VerticalWidgets",&lt;BR /&gt;config:&lt;BR /&gt;{&lt;BR /&gt;widgets: getHeaderModel()&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;getSiteData(){&lt;BR /&gt;...&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;But the changes made are not supported. Do I need to add anything more?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 15:04:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-share-header/m-p/90291#M26958</guid>
      <dc:creator>ALfreSara</dc:creator>
      <dc:date>2020-10-07T15:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: custom share-header</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-share-header/m-p/90292#M26959</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Any help please&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 17:18:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-share-header/m-p/90292#M26959</guid>
      <dc:creator>ALfreSara</dc:creator>
      <dc:date>2020-10-07T17:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: custom share-header</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-share-header/m-p/90293#M26960</link>
      <description>&lt;P&gt;Can you explain what you are trying to achieve, there might be a better way to do it.&lt;/P&gt;
&lt;P&gt;However, following your comments, If you are following documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/tasks/dev-extensions-share-tutorials-custom-share-header-menu.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/5.2/tasks/dev-extensions-share-tutorials-custom-share-header-menu.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/concepts/dev-extensions-share-override-ootb-surf-webscripts.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/5.2/concepts/dev-extensions-share-override-ootb-surf-webscripts.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And If you are extending share header menu, items etc., this should be enough to extend them.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;module&amp;gt;
	&amp;lt;id&amp;gt;&lt;SPAN&gt;custom shareService&lt;/SPAN&gt;&amp;lt;/id&amp;gt;
	&amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;
	&amp;lt;auto-deploy&amp;gt;true&amp;lt;/auto-deploy&amp;gt;
	&amp;lt;customizations&amp;gt;
		&amp;lt;customization&amp;gt;
		  &amp;lt;!-- extension for share header --&amp;gt;
		  &amp;lt;targetPackageRoot&amp;gt;org.alfresco.share.header&amp;lt;/targetPackageRoot&amp;gt;
&lt;STRONG&gt;		  &amp;lt;sourcePackageRoot&amp;gt;com.alfresco.share.header&amp;lt;/sourcePackageRoot&amp;gt;
&lt;/STRONG&gt;		&amp;lt;/customization&amp;gt;
	&amp;lt;/customizations&amp;gt;
&amp;lt;/module&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Since you are trying to extend the '&lt;SPAN&gt;share-header.lib.js&lt;/SPAN&gt;', it can't be done via '&lt;SPAN&gt;customization&lt;/SPAN&gt;' (extension module). The '&lt;SPAN&gt;customisation' does post-processing which is used to add/update the result of the ootb webscripts and it is targetted to extend webscripts not a library.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Use:&amp;nbsp;&lt;A href="https://docs.alfresco.com/6.0/concepts/dev-extensions-share-override-ootb-aikau-pages.html" target="_blank" rel="noopener nofollow noreferrer"&gt;widgetUtils.findObject&lt;/A&gt;(model.jsonModel, "id", "ID") instead to modify/update any existing widgets.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN&gt;In worst case, if you have to make changes in&amp;nbsp;'share-header.lib.js' then it needs to be copied in web-extension directory as:&amp;nbsp;&lt;EM&gt;/alfresco/web-extension/site-webscripts/org/alfresco/share/imports/share-header.lib.js&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Also copy the original share-header.get.js to the path:&lt;EM&gt; /alfresco/web-extension/site-webscripts/org/alfresco/share/header/share-header.get.js&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Update the 'share-header.get.js' import statement:&lt;/U&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;import resource="classpath:/alfresco/web-extension/site-webscripts/org/alfresco/share/imports/share-header.lib.js"&amp;gt;&lt;/PRE&gt;
&lt;P&gt;This may work and any changes made to share-header.lib.js may be visible. Also you won't need 'customization' (i.e. no need of creating the extension module as done above).&amp;nbsp;I wouldn't recommend doing this though because it is not correct approach for future upgrades.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Extension modules keeps your custom changes isolated from OOTB changes.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 20:44:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-share-header/m-p/90293#M26960</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-10-07T20:44:55Z</dc:date>
    </item>
  </channel>
</rss>

