Lab 7 - Configure a category graph writer

During the lab, you will be configuring a category graph writer to use the ts:tsResponseRoleLabel property to categorize your troubleshooting topics automatically.

  1. In the lab folder, create a new Spring context file named context.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
    
    </beans>
  2. Open the context.xml file in your favorite editor.
  3. Create a new Category Graph Writer bean.
  4. Add the following properties to the Category Graph Writer bean as required:
    Property Type Mandatory Description
    mappings Map <QName,QName> Required Map defining how predicates should be mapped to Alfresco properties. Use a fully-qualified name with Clark notation as the key of the entry.
    Important: Use the following QName for the Alfresco property: {http://www.alfresco.org/model/content/1.0}categories
    <bean id="samples.categoryGraphWriter.mappings" parent="alfresco.rdf.categoryGraphWriter.mappings.abstract">
      <property name="mappings">
        <map>
          <entry key="{http://www.componize.com/model/samples/troubleshooting/1.0/}tsResponseRoleLabel" value="{http://www.alfresco.org/model/content/1.0}categories" />
        </map>
      </property>
    </bean>
  5. Save your changes.
  6. Test your Category Graph Writer with the com.componize.samples.lab07.CategoryGraphWriterTest unit test.
  7. Deploy your files to the application server.
  8. Once the application server has started, connect to the Alfresco Share interface.
  9. Create a new category called KEYWORD_1.
  10. Open the troubleshooting-sample.dita file in your favorite editor.
  11. Add the following element:
    <tsResponseRoleLabel>KEYWORD_1</tsResponseRoleLabel>
  12. Save your changes.
The sample file should have been categorized with the KEYWORD_1 category.