Configuring the controller for the web script

Once the Java controller is ready, it needs to be configured for the web script so that the web script framework in Alfresco can get to know that this Java class is the controller for the contentlocation web script. This can be done by creating a spring context file and adding the entry for the Java class in it.

Create a file custom-example-webscripts-context.xml that has the following content:

<?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="webscript.example.contentlocation.get" class="com.example.content.ContentLocationWebScript" parent="webscript"> <property name="nodeService" ref="nodeService" ...

Get Learning Alfresco Web Scripts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.