<?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: Reading properties file through java backend webscript in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26888#M11579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know there has been a long time since you asked, but I am going to answer anyway, as it can be a reference for someone searching for the same in future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the links below, you can find some samples:&lt;/P&gt;&lt;P&gt;How to define de bean to inject the alfresco-global.properties into the Java class: &lt;A class="link-titled" href="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/amp/config/alfresco/module/AAAR-Alfresco-CE-v4.2-Repository/context/webscript-context.xml#L30" title="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/amp/config/alfresco/module/AAAR-Alfresco-CE-v4.2-Repository/context/webscript-context.xml#L30" rel="nofollow noopener noreferrer"&gt;alfresco-audit-analysis-reporting/webscript-context.xml at master · fcorti/alfresco-audit-analysis-reporting · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to define a setter method to the property: &lt;A class="link-titled" href="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/java/com/fcorti/aaar/GetCountersWebScript.java#L395" title="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/java/com/fcorti/aaar/GetCountersWebScript.java#L395" rel="nofollow noopener noreferrer"&gt;alfresco-audit-analysis-reporting/GetCountersWebScript.java at master · fcorti/alfresco-audit-analysis-reporting · GitHu…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Nov 2018 18:58:35 GMT</pubDate>
    <dc:creator>douglascrp</dc:creator>
    <dc:date>2018-11-30T18:58:35Z</dc:date>
    <item>
      <title>Reading properties file through java backend webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26884#M11575</link>
      <description>How we will read alfresco-global.properties file through java backend webscript??&amp;nbsp;For example mail.username&amp;nbsp;</description>
      <pubDate>Fri, 22 Dec 2017 11:14:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26884#M11575</guid>
      <dc:creator>kranthi</dc:creator>
      <dc:date>2017-12-22T11:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading properties file through java backend webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26885#M11576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is one sample bean where I am reading properties from alfresco-global.properties file like server host port etc..You can use similarly in case of webscript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;bean id="org.alfresco.tutorial.policy.documentEventHandler"&lt;BR /&gt; class="com.trantorinc.liferay.webservice.Sample"&lt;BR /&gt; init-method="registerEventHandlers"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="liferayServerHost" value="${server.host}"/&amp;gt;&lt;BR /&gt; &amp;lt;property name="liferayServerPort" value="${server.port}"/&amp;gt;&lt;BR /&gt;&amp;lt;property name="userName" value="${username}"/&amp;gt;&lt;BR /&gt; &amp;lt;property name="password" value="${lpassword}"/&amp;gt;&lt;BR /&gt;&amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2017 14:15:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26885#M11576</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2017-12-22T14:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading properties file through java backend webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26886#M11577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is also possible&amp;nbsp;to get the access to all the&amp;nbsp;properties by using&amp;nbsp;the method described at&amp;nbsp;&lt;A class="link-titled" href="https://stackoverflow.com/a/10504210/1571186" title="https://stackoverflow.com/a/10504210/1571186" rel="nofollow noopener noreferrer"&gt;Accessing values from Alfresco's alfresco-global.properties file - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 17:23:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26886#M11577</guid>
      <dc:creator>douglascrp</dc:creator>
      <dc:date>2018-01-04T17:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reading properties file through java backend webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26887#M11578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this what i have added in one of my xml config file&amp;nbsp; :&lt;/P&gt;&lt;P&gt;&amp;lt;bean id="global-properties" parent="baseJavaScriptExtension" class="java.util.Properties"&amp;gt;&lt;BR /&gt; &amp;lt;property name="properties"&amp;gt;&lt;BR /&gt; &amp;lt;ref bean="global-properties"/&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how can i use it in my java class ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 14:04:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26887#M11578</guid>
      <dc:creator>anakin59490</dc:creator>
      <dc:date>2018-07-26T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading properties file through java backend webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26888#M11579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know there has been a long time since you asked, but I am going to answer anyway, as it can be a reference for someone searching for the same in future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the links below, you can find some samples:&lt;/P&gt;&lt;P&gt;How to define de bean to inject the alfresco-global.properties into the Java class: &lt;A class="link-titled" href="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/amp/config/alfresco/module/AAAR-Alfresco-CE-v4.2-Repository/context/webscript-context.xml#L30" title="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/amp/config/alfresco/module/AAAR-Alfresco-CE-v4.2-Repository/context/webscript-context.xml#L30" rel="nofollow noopener noreferrer"&gt;alfresco-audit-analysis-reporting/webscript-context.xml at master · fcorti/alfresco-audit-analysis-reporting · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to define a setter method to the property: &lt;A class="link-titled" href="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/java/com/fcorti/aaar/GetCountersWebScript.java#L395" title="https://github.com/fcorti/alfresco-audit-analysis-reporting/blob/master/Alfresco/Alfresco-CE-v4.2/AAAR-Alfresco-CE-v4.2-Repository/src/main/java/com/fcorti/aaar/GetCountersWebScript.java#L395" rel="nofollow noopener noreferrer"&gt;alfresco-audit-analysis-reporting/GetCountersWebScript.java at master · fcorti/alfresco-audit-analysis-reporting · GitHu…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2018 18:58:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26888#M11579</guid>
      <dc:creator>douglascrp</dc:creator>
      <dc:date>2018-11-30T18:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reading properties file through java backend webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26889#M11580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;A __default_attr="84633" __jive_macro_name="user" _jive_internal="true" class="jive_macro jive_macro_user link-titled" href="https://community.alfresco.com/people/douglascrp" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;&amp;nbsp;.This worked for me perfectly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE style="color: #242729; background-color: #eff0f1; border: 0px; margin: 0px 0px 1em; padding: 5px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit;"&gt;&amp;lt;!--Inside Bean--&amp;gt;&lt;BR /&gt;&amp;lt;property name="properties"&amp;gt;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="global-properties"/&amp;gt; &amp;lt;/property&lt;/CODE&gt;&lt;/PRE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//In Java Class&lt;/P&gt;&lt;P&gt;private Properties properties;&lt;/P&gt;&lt;P&gt;// And while accessing&amp;nbsp;&lt;/P&gt;&lt;P&gt;properties.getProperty("&lt;SPAN style="color: #242729; background-color: #ffffff;"&gt;your key from alfresco-global.properties");&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Reference :&amp;nbsp;&lt;A class="link-titled" href="https://stackoverflow.com/questions/10452800/accessing-values-from-alfrescos-alfresco-global-properties-file" title="https://stackoverflow.com/questions/10452800/accessing-values-from-alfrescos-alfresco-global-properties-file" rel="nofollow noopener noreferrer"&gt;Accessing values from Alfresco's alfresco-global.properties file - Stack Overflow&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2019 05:45:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reading-properties-file-through-java-backend-webscript/m-p/26889#M11580</guid>
      <dc:creator>gtarafder</dc:creator>
      <dc:date>2019-01-04T05:45:19Z</dc:date>
    </item>
  </channel>
</rss>

