<?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: Packaging client-side Javascript in AMP/WAR in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304965#M258095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To have stuff in src/main/amp/web end up in the right place, you'll need to add a file called file-mapping.properties in src/main/amp. The file should look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;include.default=true&lt;BR /&gt;/web=/&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This tells the MMT tool (which the Alfresco Maven SDK uses to apply your AMP on the share.war file) that everything in src/main/amp should end up in the root. This will allow you to put the file in src/main/amp/web/modules/. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for a more elegant way to customize create-site.js, it's a tough one, because usually when extending Share's clientside javascript there would be a freemarker template or web script controller that you could extend and tell it to use your own customized version of Alfresco.module.CreateSite where you would create a new object that would extend Alfresco.module.CreateSite. See &lt;/SPAN&gt;&lt;A href="http://docs.alfresco.com/4.0/tasks/tu-share-JS-customize.html" rel="nofollow noopener noreferrer"&gt;http://docs.alfresco.com/4.0/tasks/tu-share-JS-customize.html&lt;/A&gt;&lt;SPAN&gt; for details on how to extend web scripts and freemarker templates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, with the new header the object is initialized from js/alfresco/services/SiteService.js so there seems to be no clean way to tell Share to use your custom object instead of the standard one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When walking through the process if clicking the "Create site" button, it fires off an event to the pub/sub system in the header, which SiteService picks up on and calls createSite in SiteService. In theory you could make a custom component that listens in on the event and intercepts it before it reaches SiteService, but I'm not sure if this is actually possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is an interesting use case, it seems to be a bit too hardcoded, unless I'm missing something obvious. Hope this clears things up a bit&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 12:34:52 GMT</pubDate>
    <dc:creator>oleh</dc:creator>
    <dc:date>2014-05-29T12:34:52Z</dc:date>
    <item>
      <title>Packaging client-side Javascript in AMP/WAR</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304963#M258093</link>
      <description>Hello,As part of a small Share customization project I added a few extra properties to the site model and displayed them for editing in the "Create Site" dialog. I had to modify the client-side JS code in create-site.js; things are working largely as expected, but I have a couple of issues I haven't</description>
      <pubDate>Thu, 29 May 2014 12:09:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304963#M258093</guid>
      <dc:creator>lawrencei</dc:creator>
      <dc:date>2014-05-29T12:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Packaging client-side Javascript in AMP/WAR</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304964#M258094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. the easy way to do this is modify sample amp file with winRAR.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. there is no other easy way than this&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 12:28:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304964#M258094</guid>
      <dc:creator>lementree</dc:creator>
      <dc:date>2014-05-29T12:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Packaging client-side Javascript in AMP/WAR</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304965#M258095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To have stuff in src/main/amp/web end up in the right place, you'll need to add a file called file-mapping.properties in src/main/amp. The file should look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;include.default=true&lt;BR /&gt;/web=/&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This tells the MMT tool (which the Alfresco Maven SDK uses to apply your AMP on the share.war file) that everything in src/main/amp should end up in the root. This will allow you to put the file in src/main/amp/web/modules/. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for a more elegant way to customize create-site.js, it's a tough one, because usually when extending Share's clientside javascript there would be a freemarker template or web script controller that you could extend and tell it to use your own customized version of Alfresco.module.CreateSite where you would create a new object that would extend Alfresco.module.CreateSite. See &lt;/SPAN&gt;&lt;A href="http://docs.alfresco.com/4.0/tasks/tu-share-JS-customize.html" rel="nofollow noopener noreferrer"&gt;http://docs.alfresco.com/4.0/tasks/tu-share-JS-customize.html&lt;/A&gt;&lt;SPAN&gt; for details on how to extend web scripts and freemarker templates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, with the new header the object is initialized from js/alfresco/services/SiteService.js so there seems to be no clean way to tell Share to use your custom object instead of the standard one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When walking through the process if clicking the "Create site" button, it fires off an event to the pub/sub system in the header, which SiteService picks up on and calls createSite in SiteService. In theory you could make a custom component that listens in on the event and intercepts it before it reaches SiteService, but I'm not sure if this is actually possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is an interesting use case, it seems to be a bit too hardcoded, unless I'm missing something obvious. Hope this clears things up a bit&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 12:34:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304965#M258095</guid>
      <dc:creator>oleh</dc:creator>
      <dc:date>2014-05-29T12:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Packaging client-side Javascript in AMP/WAR</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304966#M258096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot, it did clear up things! As you could tell, I'm new to Alfresco Share development and far from a JavaScript expert, so I appreciate the explanation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 12:54:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/packaging-client-side-javascript-in-amp-war/m-p/304966#M258096</guid>
      <dc:creator>lawrencei</dc:creator>
      <dc:date>2014-05-29T12:54:52Z</dc:date>
    </item>
  </channel>
</rss>

