org.riotfamily.website.freemarker
Class ActiveRecordClassExposer

java.lang.Object
  extended by org.riotfamily.website.freemarker.ActiveRecordClassExposer
All Implemented Interfaces:
ConfigurationPostProcessor

public class ActiveRecordClassExposer
extends Object
implements ConfigurationPostProcessor

ConfigurationPostProcessor that adds static models for all ActiveRecord classes under their short name as shared variables.

If two ActiveRecord classes with the same name exist in different packages only the first one will be exposed and a warning message will be logged. In order to access the other (shadowed) class you can use the following syntax in your FreeMarker templates: statics["com.example.MyActiveRecord"].

Since:
8.0
Author:
Felix Gnass [fgnass at neteye dot de]
See Also:
ActiveRecord, BeansWrapper.getStaticModels()

Constructor Summary
ActiveRecordClassExposer(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
 void postProcessConfiguration(freemarker.template.Configuration config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveRecordClassExposer

public ActiveRecordClassExposer(org.hibernate.SessionFactory sessionFactory)
Method Detail

postProcessConfiguration

public void postProcessConfiguration(freemarker.template.Configuration config)
                              throws IOException,
                                     freemarker.template.TemplateException
Specified by:
postProcessConfiguration in interface ConfigurationPostProcessor
Throws:
IOException
freemarker.template.TemplateException