mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
- 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
93 lines
3.8 KiB
XML
93 lines
3.8 KiB
XML
<?xml version='1.0' encoding='UTF-8'?>
|
|
<!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 -->
|
|
<!-- to the TemplateService by the caller. The value is either a fully qualified class name for -->
|
|
<!-- the object to create, or the Spring bean ID if the object requires Spring service injection. -->
|
|
<property name="templateEngines">
|
|
<map>
|
|
<entry key="freemarker">
|
|
<value>freeMarkerProcessor</value>
|
|
</entry>
|
|
</map>
|
|
</property>
|
|
<property name="defaultTemplateEngine">
|
|
<value>freemarker</value>
|
|
</property>
|
|
</bean>
|
|
|
|
<!-- This engine requires Spring config setup to use Repository services -->
|
|
<!-- The beans are not thread safe and therefore we create one per request -->
|
|
<bean id="freeMarkerProcessor" class="org.alfresco.repo.template.FreeMarkerProcessor" singleton="false">
|
|
<property name="nodeService">
|
|
<ref bean="NodeService"/>
|
|
</property>
|
|
<property name="contentService">
|
|
<ref bean="ContentService"/>
|
|
</property>
|
|
<!--
|
|
<property name="defaultEncoding">
|
|
<value>UTF-8</value>
|
|
</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>
|