0
votes

I have defined a property in "alfresco-global.properties". How can I access this property from the FTL file of my webscript in Alfresco Share?

I'm using Alfresco Community Version 4.2

1
You're going to need to write a bit of Java code, sorry. It's basically the same process as accessing it from JavaScript - Gagravarr
I don't think this is possible, not with just writing some lines in that very ftl you want it. btw -> stackoverflow.com/questions/11366978/… - Miki
We've written a module with can access these fields in JavaScript, then you can pass the value to the Freemarker ftl file. Send me an email and i'll provide you the details. - Tahir Malik

1 Answers

0
votes

You can't access properties files directly from the view (FTL), it violates the Separation Of Concerns principle.

Since the alfresco-global-properties is actually a spring bean of type java.util.Properties, you can inject the whole thing into your Java Class of your webscript:

<property name="properties">
    <ref bean="global-properties"/>
</property>

And then you can access your property like this properties.getProperty("my.custom.property")