Define a metadata interceptor to inject metadata into your XML content automatically from property values
stored in Alfresco.
In the following steps you will be creating and/or configuring Spring beans in a Spring context file. A
basic knowledge of Spring and the Spring Framework is required.
-
Open or create a new Spring context file.
-
Create an XPath Interceptor bean.
-
Use an existing XML schema
filter reference to specify the document types for which the interceptor applies.
-
Use the fully-qualified name with Clark notation as the key of the entries and the XPath query as the value.
<bean id="samples.interceptor.troubleshooting.xpath" parent="rdf.interceptor.xpath.abstract">
<property name="xmlSchemaFilter" ref="samples.dtd.troubleshooting" />
<property name="xpathQueries">
<map>
<entry key="{http://www.componize.com/model/samples/troubleshooting/1.0/}shortdesc" value="/tsTroubleshooting/abstract/shortdesc" />
</map>
</property>
</bean>
-
Create an Alfresco RDF property interceptor bean.
<bean id="samples.propertyInterceptor.troubleshooting" parent="alfresco.rdf.propertyInterceptor.abstract">
<property name="property" value="{http://www.componize.com/model/samples/troubleshooting/1.0/}shortdesc" />
</bean>
The Alfresco RDF property interceptor bean will have Componize listen for update events
on the specified properties and react by rewriting the content if needed.
-
Restart the application server for your changes to take effect.