Template extension spring configuration support

- similar pattern to existing script bean extension support
 - new root model helper objects and custom methods can be added via spring configuration
Cleanup of script extension spring support
Fix to thread safety of configured script extension beans that use the Scopable interface

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5369 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-03-09 12:30:34 +00:00
parent e4e89f4db1
commit 9323a8cd7a
24 changed files with 363 additions and 151 deletions

View File

@@ -2,6 +2,7 @@
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="templateService" class="org.alfresco.repo.template.TemplateServiceImpl">
<!-- A Map of named template engines to class implementations/Spring bean IDs -->
<!-- The key of each property is the name of the engine - this is the name that is passed in -->
@@ -34,4 +35,58 @@
</property>
-->
</bean>
<!-- base config implementation that template extension beans extend from - for auto registration
as a global template helper with the TemplateService -->
<bean id="baseTemplateImplementation" abstract="true" init-method="register">
<property name="templateService">
<ref bean="templateService"/>
</property>
</bean>
<bean id="sessionTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.Session">
<property name="extensionName">
<value>session</value>
</property>
<property name="serviceRegistry">
<ref bean="ServiceRegistry"/>
</property>
</bean>
<bean id="classificationTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.Classification">
<property name="extensionName">
<value>classification</value>
</property>
<property name="storeUrl">
<value>${spaces.store}</value>
</property>
<property name="serviceRegistry">
<ref bean="ServiceRegistry"/>
</property>
</bean>
<bean id="hasAspectTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.HasAspectMethod">
<property name="extensionName">
<value>hasAspect</value>
</property>
</bean>
<bean id="messageTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.I18NMessageMethod">
<property name="extensionName">
<value>message</value>
</property>
</bean>
<bean id="dateCompareTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.DateCompareMethod">
<property name="extensionName">
<value>dateCompare</value>
</property>
</bean>
<bean id="incrementDateTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.DateIncrementMethod">
<property name="extensionName">
<value>incrementDate</value>
</property>
</bean>
</beans>