0

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

Miki
  • 2,493
  • 2
  • 27
  • 39
  • 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 Sep 22 '14 at 14:36
  • I don't think this is possible, not with just writing some lines in that very ftl you want it. btw -> http://stackoverflow.com/questions/11366978/how-to-access-values-from-alfresco-global-properties-in-freemarker-and-yui-javas – Miki Sep 22 '14 at 21:12
  • 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 Sep 29 '14 at 08:09

1 Answers1

0

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")