<?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 Get system properties in the webscript in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/get-system-properties-in-the-webscript/m-p/122072#M33459</link>
    <description>&lt;P&gt;How to get system properties like alfresco.host, share.host, share.port, e.t.c in the webscript?&lt;/P&gt;&lt;P&gt;This code works in the Javascript console, but does not for the webscript.&lt;/P&gt;&lt;PRE&gt;var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var properties =  ctxt.getBean('global-properties', java.util.Properties);
&lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; protocol = properties["share.protocol"] || &lt;SPAN class=""&gt;'http'&lt;/SPAN&gt;; &lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; host = properties["share.host"] || &lt;SPAN class=""&gt;'localhost'&lt;/SPAN&gt;; &lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; port = properties["share.port"] || &lt;SPAN class=""&gt;'8080'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Webscript returns: Packages not defined.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2024 17:46:41 GMT</pubDate>
    <dc:creator>fedorow</dc:creator>
    <dc:date>2024-08-06T17:46:41Z</dc:date>
    <item>
      <title>Get system properties in the webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-system-properties-in-the-webscript/m-p/122072#M33459</link>
      <description>&lt;P&gt;How to get system properties like alfresco.host, share.host, share.port, e.t.c in the webscript?&lt;/P&gt;&lt;P&gt;This code works in the Javascript console, but does not for the webscript.&lt;/P&gt;&lt;PRE&gt;var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var properties =  ctxt.getBean('global-properties', java.util.Properties);
&lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; protocol = properties["share.protocol"] || &lt;SPAN class=""&gt;'http'&lt;/SPAN&gt;; &lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; host = properties["share.host"] || &lt;SPAN class=""&gt;'localhost'&lt;/SPAN&gt;; &lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; port = properties["share.port"] || &lt;SPAN class=""&gt;'8080'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Webscript returns: Packages not defined.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 17:46:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-system-properties-in-the-webscript/m-p/122072#M33459</guid>
      <dc:creator>fedorow</dc:creator>
      <dc:date>2024-08-06T17:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get system properties in the webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-system-properties-in-the-webscript/m-p/122073#M33460</link>
      <description>&lt;P&gt;You may try using this approach:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/aborroy/alfresco-script-root-object" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/aborroy/alfresco-script-root-object&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 07:07:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-system-properties-in-the-webscript/m-p/122073#M33460</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2024-08-07T07:07:51Z</dc:date>
    </item>
  </channel>
</rss>

