Fork me on GitHub

Installing Hippo CMS Document Commenting Plugin

Add Dependencies

Make sure you have the forge Maven2 repository reference and dependency definition in the root pom.xml of your project.

    <repositories>

      <!-- SNIP -->

      <repository>
        <id>hippo-maven2-forge</id>
        <name>Hippo Maven 2 Forge repository</name>
        <url>http://maven.onehippo.com/maven2-forge/</url>
        <snapshots />
      </repository>

      <!-- SNIP -->

    </repositories>

    <!-- SNIP -->

    <dependencyManagement>

      <!-- SNIP -->

      <dependencies>

        <!-- SNIP -->

        <!-- NOTE: You should set a property named 'doc-commenting.version' to a version of this plugin! -->
        <dependency>
          <groupId>org.onehippo.forge.doc-commenting</groupId>
          <artifactId>doc-commenting-repository</artifactId>
          <version>${doc-commenting.version}</version>
        </dependency>

        <dependency>
          <groupId>org.onehippo.forge.doc-commenting</groupId>
          <artifactId>doc-commenting-cms</artifactId>
          <version>${doc-commenting.version}</version>
        </dependency>

        <!-- SNIP -->

      </dependencies>

      <!-- SNIP -->

    </dependencyManagement>
    

Add the following dependencies to either cms-dependencies/pom.xml in Hippo CMS v13 or cms/pom.xml in the earlier versions.

    <dependencies>

      <!-- SNIP -->

      <dependency>
        <groupId>org.onehippo.forge.doc-commenting</groupId>
        <artifactId>doc-commenting-repository</artifactId>
      </dependency>

      <dependency>
        <groupId>org.onehippo.forge.doc-commenting</groupId>
        <artifactId>doc-commenting-cms</artifactId>
      </dependency>

      <!-- SNIP -->

    </dependencies>
    

Now, you're ready to use the plugin!

Security Domain Configuration

This plugin stores comment data in JCR node structure by default (using DefaultJcrCommentPersistenceManager). The default CommentPersistenceManager requires the user to be able to write doccommenting-commentdatacontainer and doccommenting:commentdata nodes under /doccommentdata node.

Therefore, you should add Hippo Security Domain configurations under /hippo:configuration/hippo:domains/ like the following (in System View XML format), in order to allow users in both 'author' and 'editor' group to be able to read/write the comment data nodes, for instance:

<?xml version="1.0" encoding="UTF-8"?>
<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="doccommenting">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>hipposys:domain</sv:value>
  </sv:property>
  <sv:node sv:name="commentdata-nodes">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposys:domainrule</sv:value>
    </sv:property>
    <sv:node sv:name="doccommenting-commentdata">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>hipposys:facetrule</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:equals" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:facet" sv:type="String">
        <sv:value>jcr:primaryType</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:filter" sv:type="Boolean">
        <sv:value>false</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:type" sv:type="String">
        <sv:value>Name</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:value" sv:type="String">
        <sv:value>doccommenting:commentdata</sv:value>
      </sv:property>
    </sv:node>
  </sv:node>
  <sv:node sv:name="commentdatacontainer-nodes">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposys:domainrule</sv:value>
    </sv:property>
    <sv:node sv:name="doccommenting-commentdatacontainer">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>hipposys:facetrule</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:equals" sv:type="Boolean">
        <sv:value>true</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:facet" sv:type="String">
        <sv:value>jcr:primaryType</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:filter" sv:type="Boolean">
        <sv:value>false</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:type" sv:type="String">
        <sv:value>Name</sv:value>
      </sv:property>
      <sv:property sv:name="hipposys:value" sv:type="String">
        <sv:value>doccommenting:commentdatacontainer</sv:value>
      </sv:property>
    </sv:node>
  </sv:node>
  <sv:node sv:name="editor-readwrite">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposys:authrole</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:groups" sv:type="String" sv:multiple="true">
      <sv:value>editor</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:role" sv:type="String">
      <sv:value>readwrite</sv:value>
    </sv:property>
  </sv:node>
  <sv:node sv:name="author-readwrite">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposys:authrole</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:groups" sv:type="String" sv:multiple="true">
      <sv:value>author</sv:value>
    </sv:property>
    <sv:property sv:name="hipposys:role" sv:type="String">
      <sv:value>readwrite</sv:value>
    </sv:property>
  </sv:node>
</sv:node>