Lets say I create a custom property called "test123" inside of the alfresco-global.properties file. Is there a custom object or some other way which I can use to access its value inside of a Java bean in Alfresco?
The Spring bean is called "global-properties" and it's a java.util.Properties type
So you can inject it like that:
<property name="properties">
<ref bean="global-properties"/>
</property
and add a properties property of type java.util.Properties to your bean
All properties from the alfresco-global.properties are available as placeholders in the Spring bean definition. You can simply use:
<property name="myCustomOption" value="${my.custom.option}"/>
in your bean definition and in alfresco-global.properties:
my.custom.option=Some string value
Injecting the whole global-properties bean (as proposed above) also works but violates the principle of least knowledge.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With