<?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: Include custom javascript library in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265174#M218304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Script tags are typically referenced in the HEAD part of an HTML page. In Alfresco Share, everything you see in the web page is rendered by a web script. A web script has a controller, typically server-side JavaScript, and one or more views. In Share's case, those views are implemented as Freemarker templates that spit out HTML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A given web script is made up of multiple files. One of those files is named using the syntax:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;some_script_id.some_http_method.head.ftl.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, go look at $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/wiki at the page.get.head.ftl file. You'll see some tags like "&amp;lt;@script&amp;gt;". That is a macro that produces "&amp;lt;script&amp;gt;" tags. The macros switches between compressed ("minified") JavaScript and uncompressed JavaScript depending on the debug setting in share config.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So to add your own client-side JavaScript library, you need to override the head file of a web script and add your own script reference. The easiest way to do this is to copy the script you want to override into $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/web-extension, so in this example the page.get.head.ftl file would be copied to $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/wiki. Then make changes as you see fit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This approach works for 3.4 and 4.0. In 4.0 there's an alternative way to override web scripts. See &lt;/SPAN&gt;&lt;A href="http://blogs.alfresco.com/wp/ddraper/" rel="nofollow noopener noreferrer"&gt;Dave Draper's blog&lt;/A&gt;&lt;SPAN&gt; for more details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if that is the EXACT web script or head file you want–you'll have to figure that out for yourself. You might look at enabling surf bug–it can show you which web scripts are responsible for which parts of the Share app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry that I don't have time to give you step-by-step instructions, but this should give you enough to go on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2012 21:28:01 GMT</pubDate>
    <dc:creator>jpotts</dc:creator>
    <dc:date>2012-09-28T21:28:01Z</dc:date>
    <item>
      <title>Include custom javascript library</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265173#M218303</link>
      <description>Hello allI would like to integrate MathJaxhttp://www.mathjax.org/ into an Alfresco implementation. Installation aside; the Alfresco involves including a &amp;lt;script&amp;gt; tag to the rendered document. What files would I need to modify to make this possible? Also, would it be possible to customize such</description>
      <pubDate>Thu, 27 Sep 2012 15:53:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265173#M218303</guid>
      <dc:creator>jackjm</dc:creator>
      <dc:date>2012-09-27T15:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Include custom javascript library</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265174#M218304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Script tags are typically referenced in the HEAD part of an HTML page. In Alfresco Share, everything you see in the web page is rendered by a web script. A web script has a controller, typically server-side JavaScript, and one or more views. In Share's case, those views are implemented as Freemarker templates that spit out HTML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A given web script is made up of multiple files. One of those files is named using the syntax:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;some_script_id.some_http_method.head.ftl.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, go look at $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/wiki at the page.get.head.ftl file. You'll see some tags like "&amp;lt;@script&amp;gt;". That is a macro that produces "&amp;lt;script&amp;gt;" tags. The macros switches between compressed ("minified") JavaScript and uncompressed JavaScript depending on the debug setting in share config.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So to add your own client-side JavaScript library, you need to override the head file of a web script and add your own script reference. The easiest way to do this is to copy the script you want to override into $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/web-extension, so in this example the page.get.head.ftl file would be copied to $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/wiki. Then make changes as you see fit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This approach works for 3.4 and 4.0. In 4.0 there's an alternative way to override web scripts. See &lt;/SPAN&gt;&lt;A href="http://blogs.alfresco.com/wp/ddraper/" rel="nofollow noopener noreferrer"&gt;Dave Draper's blog&lt;/A&gt;&lt;SPAN&gt; for more details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if that is the EXACT web script or head file you want–you'll have to figure that out for yourself. You might look at enabling surf bug–it can show you which web scripts are responsible for which parts of the Share app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry that I don't have time to give you step-by-step instructions, but this should give you enough to go on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 21:28:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265174#M218304</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2012-09-28T21:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Include custom javascript library</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265175#M218305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you very much Jeff, this is certainly very helpful in getting started. I will try this out later this evening and let you know. Sorry for the late response; I got pulled away in other projects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 20:40:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265175#M218305</guid>
      <dc:creator>jackjm</dc:creator>
      <dc:date>2012-10-08T20:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Include custom javascript library</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265176#M218306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much; things worked as expected and I was able to include the custom&amp;nbsp; library. However; the library also requires options to be included in the script tag as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;script type="text/x-mathjax-config"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; MathJax.Hub.Config({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; extensions: ["tex2jax.js"],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; jax: ["input/TeX","output/HTML-CSS"],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any guidance on where and how I can get this information included?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for all your assistance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;best regards.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2012 15:36:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265176#M218306</guid>
      <dc:creator>jackjm</dc:creator>
      <dc:date>2012-10-09T15:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Include custom javascript library</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265177#M218307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I (think) I figured this out; I over-wrote the page.get.html.ftl to get the custom &amp;lt;script text="…"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can see in the source of the page that library and the respective information is rendered. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One final question; I notice that most of the tags have //&amp;lt;!CDATA[ in them; is this necessary for the custom text that I want rendered and if so any reason? In my early days I remember this had something to do with XML but I don't remember exactly!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now that I have things the library included, I have to continue working on the integration and the MathJax library to kick in as required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As far the inclusion goes, I think this issue is mostly resolved. I say mostly because I am not sure if what I did above was correct; if you can please confirm, I will close the issue and mark it resolved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for all the help Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 21:59:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265177#M218307</guid>
      <dc:creator>jackjm</dc:creator>
      <dc:date>2012-10-10T21:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Include custom javascript library</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265178#M218308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should be able to put that script tag in head as-is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 19:18:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/include-custom-javascript-library/m-p/265178#M218308</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2012-10-11T19:18:25Z</dc:date>
    </item>
  </channel>
</rss>

