Files
alfresco-community-repo/config/alfresco/template-services-context.xml
Kevin Roast 98f2e85cc0 New API for templates.
Provides access to AVM stores and nodes within those stores. The majority of the standard template Node API is available (such as properties, children, content, icons etc.) and some additional AVM specific methods. 

Root level helper object 'avm' provides lookup for AVM store object and AVM nodes objects by path in the OO style expected by template writers. Once retrieved, the store object provides store meta-data and access to the root Template AVM node for the store (or lookup of individual nodes by path) which exposes the standard template Node API.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5460 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2007-04-04 16:26:16 +00:00

120 lines
4.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="avmExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.AVM">
<property name="extensionName">
<value>avm</value>
</property>
<property name="serviceRegistry">
<ref bean="ServiceRegistry"/>
</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>