Fork me on GitHub

Installing Bloomreach XM Extra Folder Context Menus 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>https://maven.bloomreach.com/maven2-forge/</url>
        <snapshots />
      </repository>

      <!-- SNIP -->

    </repositories>

    <!-- SNIP -->

    <dependencyManagement>

      <!-- SNIP -->

      <dependencies>

        <!-- SNIP -->

        <!-- NOTE: You should set a property named 'forge.folderctxmenus.version' to a version of this plugin! -->

        <dependency>
          <groupId>org.onehippo.forge.folderctxmenus</groupId>
          <artifactId>folderctxmenus-repository</artifactId>
          <version>${forge.folderctxmenus.version}</version>
        </dependency>

        <dependency>
          <groupId>org.onehippo.forge.folderctxmenus</groupId>
          <artifactId>folderctxmenus-frontend</artifactId>
          <version>${forge.folderctxmenus.version}</version>
        </dependency>

        <!-- SNIP -->

      </dependencies>

      <!-- SNIP -->

    </dependencyManagement>
    

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

    <dependencies>

      <!-- SNIP -->

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

      <dependency>
        <groupId>org.onehippo.forge.folderctxmenus</groupId>
        <artifactId>folderctxmenus-frontend</artifactId>
      </dependency>

      <!-- SNIP -->

    </dependencies>
    

Now, you're ready to use the plugin!

Installing Only the Common module of Bloomreach XM Extra Folder Context Menus Plugin

Add Dependencies

If you want to use only Programmatic Folder Copy and Move, then you may add the following dependency only.

    <repositories>

      <!-- SNIP -->

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

      <!-- SNIP -->

    </repositories>

    <!-- SNIP -->

    <dependencyManagement>

      <!-- SNIP -->

      <dependencies>

        <!-- SNIP -->

        <!-- NOTE: You should set a property named 'forge.folderctxmenus.version' to a version of this plugin! -->

        <dependency>
          <groupId>org.onehippo.forge.folderctxmenus</groupId>
          <artifactId>folderctxmenus-common</artifactId>
          <version>${forge.folderctxmenus.version}</version>
        </dependency>

        <!-- SNIP -->

      </dependencies>

      <!-- SNIP -->

    </dependencyManagement>
    

And add the following dependency reference into your Web Application module subproject(s).

    <dependencies>

      <!-- SNIP -->

      <dependency>
        <groupId>org.onehippo.forge.folderctxmenus</groupId>
        <artifactId>folderctxmenus-common</artifactId>
      </dependency>

      <!-- SNIP -->

    </dependencies>
    

Now, you're ready to use the common module of the plugin!

Permissions for Extra Folder Context Menus Plugin

Granting permissions / privileges for extra folder options

For users to have access to the extra folder options, it is required that they are granted an additional role folderctxmenus-editor (privilege 'folderctxmenus:editor'). This privilege should be granted on the folders for which those extra actions should become available.

By default only the admin has privileges to use the extra folder options. This is specified in the security domain 'extra-folder-options'. By default all users that have the xm.content.admin user role, will have the extra folder options on all content.

Extending privileges to allow extra folder options on folders for certain users

To allow editors to access the copy and move options on folders, a domain rule needs to be added which provides the 'folderctxmenus-editor' privilege to a specified set of folders. The following example will provide those options on the folderctxmenusdemo specific (documents, gallery and assets) folders.

definitions:
  config:
    /hippo:configuration/hippo:domains/folder-context-menus-demo-content:
      jcr:primaryType: hipposys:domain
      /content-document-domain:
        jcr:primaryType: hipposys:domainrule
        /content-and-descendants:
          jcr:primaryType: hipposys:facetrule
          hipposys:equals: true
          hipposys:facet: jcr:path
          hipposys:type: Reference
          hipposys:value: /content/documents/folderctxmenusdemo
      /content-gallery-domain:
        jcr:primaryType: hipposys:domainrule
        /content-and-descendants:
          jcr:primaryType: hipposys:facetrule
          hipposys:equals: true
          hipposys:facet: jcr:path
          hipposys:type: Reference
          hipposys:value: /content/gallery/folderctxmenusdemo
      /content-assets-domain:
        jcr:primaryType: hipposys:domainrule
        /content-and-descendants:
          jcr:primaryType: hipposys:facetrule
          hipposys:equals: true
          hipposys:facet: jcr:path
          hipposys:type: Reference
          hipposys:value: /content/assets/folderctxmenusdemo
      /editor:
        jcr:primaryType: hipposys:authrole
        hipposys:groups:
          .meta:category: system
          .meta:add-new-system-values: true
          type: string
          value: []
        hipposys:role: folderctxmenus-editor
        hipposys:userrole: xm.content.editor
        hipposys:users:
          .meta:category: system
          .meta:add-new-system-values: true
          type: string
          value: []
        

For more information about Bloomreach Authorization model concepts, check out the Bloomreach documentation website.