Files
alfresco-community-repo/config/alfresco/template-services-context.xml

111 lines
4.5 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="hasPermissionTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.HasPermissionMethod">
<property name="extensionName">
<value>hasPermission</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>
<bean id="xmlDateTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.ISO8601DateFormatMethod">
<property name="extensionName">
<value>xmldate</value>
</property>
</bean>
<bean id="urlEncodeTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.ISO8601DateFormatMethod">
<property name="extensionName">
<value>urlencode</value>
</property>
</bean>
</beans>