12-22-2017 06:14 AM
How we will read alfresco-global.properties file through java backend webscript??
For example mail.username
11-30-2018 01:58 PM
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.
In the links below, you can find some samples:
How to define de bean to inject the alfresco-global.properties into the Java class: alfresco-audit-analysis-reporting/webscript-context.xml at master · fcorti/alfresco-audit-analysis-r...
How to define a setter method to the property: alfresco-audit-analysis-reporting/GetCountersWebScript.java at master · fcorti/alfresco-audit-analys...
12-22-2017 09:15 AM
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.
<bean id="org.alfresco.tutorial.policy.documentEventHandler"
class="com.trantorinc.liferay.webservice.Sample"
init-method="registerEventHandlers">
<property name="liferayServerHost" value="${server.host}"/>
<property name="liferayServerPort" value="${server.port}"/>
<property name="userName" value="${username}"/>
<property name="password" value="${lpassword}"/>
</bean>
01-04-2018 12:23 PM
It is also possible to get the access to all the properties by using the method described at Accessing values from Alfresco's alfresco-global.properties file - Stack Overflow
07-26-2018 10:04 AM
Hi,
this what i have added in one of my xml config file :
<bean id="global-properties" parent="baseJavaScriptExtension" class="java.util.Properties">
<property name="properties">
<ref bean="global-properties"/>
</property>
</bean>
But how can i use it in my java class ?
Thank you
11-30-2018 01:58 PM
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.
In the links below, you can find some samples:
How to define de bean to inject the alfresco-global.properties into the Java class: alfresco-audit-analysis-reporting/webscript-context.xml at master · fcorti/alfresco-audit-analysis-r...
How to define a setter method to the property: alfresco-audit-analysis-reporting/GetCountersWebScript.java at master · fcorti/alfresco-audit-analys...
01-04-2019 12:45 AM
Thanks .This worked for me perfectly.
<!--Inside Bean-->
<property name="properties"> <ref bean="global-properties"/> </property
//In Java Class
private Properties properties;
// And while accessing
properties.getProperty("your key from alfresco-global.properties");
Reference : Accessing values from Alfresco's alfresco-global.properties file - Stack Overflow
Explore our Alfresco products with the links below. Use labels to filter content by product module.