<?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: site-webscript: Determine if a SURF module is enabled in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262631#M215761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If by active you mean "deployed" (as opposed to "evaluated) then that should be fairly straight-forward, although I'd actually set this as an entry in the WebScript model first (this of course could then be used to create a client-side JS constant in "resources.get.html.ftl". This approach wouldn't work for trying to determine which module will be evaluated to have an effect on each WebScript because the data isn't available and will be different for each WebScript run on the page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm assuming from your question though it will be sufficient to just know which modules have been deployed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Apr 2012 16:42:20 GMT</pubDate>
    <dc:creator>ddraper</dc:creator>
    <dc:date>2012-04-24T16:42:20Z</dc:date>
    <item>
      <title>site-webscript: Determine if a SURF module is enabled</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262628#M215758</link>
      <description>Hi guys,I've developed a custom Share module using Share's/SURF's new extensions mechanism.I'm wondering to how to determine within a site-webscript if a specific module is enabled or not?Thx,Jan</description>
      <pubDate>Tue, 24 Apr 2012 16:03:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262628#M215758</guid>
      <dc:creator>jpfi</dc:creator>
      <dc:date>2012-04-24T16:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: site-webscript: Determine if a SURF module is enabled</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262629#M215759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is possible to determine whether or not a module is deployed, but what is not possible is to determine whether or not it will be applied. This is because the extensions are not evaluated until AFTER the base WebScript has been run. HOWEVER… &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Extension Modules are only evaluated once per request and this information can be retrieved by calling the getEvaluatedModules() method. This means that providing your WebScript is NOT the first one run on the page you can determine the evaluated modules… HOWEVER…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is still not a guarantee that the module will have any effect on the WebScript since there are further evaluations within the module (e.g. path matching for customizations and SubComponent evaluations).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would need to check whether or not you can access the evaluated modules data directly from within the WebScript JavaScript controller or FreeMarker template, but you'd certainly be able do this from a Java-backed WebScript (because the module handler is a Spring bean which you can configure as a property of your controller).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This isn't a use-case that I'd previously considered but I can certainly look at making this easier. It might be worth raising an issue for this to track the work-item properly to capture requirements and for you to track progress as it's not something I'll be able to make a start on immediately.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 16:19:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262629#M215759</guid>
      <dc:creator>ddraper</dc:creator>
      <dc:date>2012-04-24T16:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: site-webscript: Determine if a SURF module is enabled</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262630#M215760</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;SPAN&gt;Ok, what's about submitting the evaluation result of each deployed into a global client-side JS variable, e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alfresco.constants.MODULES = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; "moduleA":true, //active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; "moduleB":false //not active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, Jan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 16:26:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262630#M215760</guid>
      <dc:creator>jpfi</dc:creator>
      <dc:date>2012-04-24T16:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: site-webscript: Determine if a SURF module is enabled</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262631#M215761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If by active you mean "deployed" (as opposed to "evaluated) then that should be fairly straight-forward, although I'd actually set this as an entry in the WebScript model first (this of course could then be used to create a client-side JS constant in "resources.get.html.ftl". This approach wouldn't work for trying to determine which module will be evaluated to have an effect on each WebScript because the data isn't available and will be different for each WebScript run on the page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm assuming from your question though it will be sufficient to just know which modules have been deployed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 16:42:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262631#M215761</guid>
      <dc:creator>ddraper</dc:creator>
      <dc:date>2012-04-24T16:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: site-webscript: Determine if a SURF module is enabled</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262632#M215762</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;SPAN&gt;yub, for my use case it is sufficient to now if a module is deployed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx, jan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 16:58:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262632#M215762</guid>
      <dc:creator>jpfi</dc:creator>
      <dc:date>2012-04-24T16:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: site-webscript: Determine if a SURF module is enabled</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262633#M215763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;+1 for a ootb solution!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, you can already push this to the client JS layer by adding a subcomponent to the global scoped head-resources region:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in a module extension file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;extension&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;modules&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;components&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;component&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;scope&amp;gt;global&amp;lt;/scope&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;region-id&amp;gt;head-resources&amp;lt;/region-id&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;source-id&amp;gt;global&amp;lt;/source-id&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sub-components&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sub-component id="my-module-active-indicator"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;url&amp;gt;/ecm4u/components/module-indicator&amp;lt;/url&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sub-component&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/sub-components&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/component&amp;gt;&lt;BR /&gt;…&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;/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;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;/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;SPAN&gt;and configured a webscript at /ecm4u/components/module-indicator to add this script snippet to the page:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;script type="text/javascript"&amp;gt;//&amp;lt;![CDATA[&lt;BR /&gt;// namespace&lt;BR /&gt;if (typeof ecm4u == "undefined" || !ecm4u) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var ecm4u = {};&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;ecm4u.mymoduleisactive = true;&lt;BR /&gt;&lt;BR /&gt;//]]&amp;gt;&amp;lt;/script&amp;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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;then in client JS test like&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;if(ecm4u.mymoduleisactive) {&lt;BR /&gt;….&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&amp;nbsp; lothar&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;/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:56:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-webscript-determine-if-a-surf-module-is-enabled/m-p/262633#M215763</guid>
      <dc:creator>lotharmärkle</dc:creator>
      <dc:date>2012-04-25T07:56:12Z</dc:date>
    </item>
  </channel>
</rss>

