Deploying Netcentric accesscontroltool with AEM Project Archetype 23


Adobe had recently announced availability of AEM as a Cloud Service (AaaCS). To be compatible with the new architecture, we need to follow a recommended Project Structure.

AEM Project Archetype 23 automatically creates a maven project that is as per the AaaCS guidelines.

The current blog focuses on how we can deploy Netcentric AccessControlTool via the maven project created with Archetype-23.

Challenges faced

  • Issue 1: The latest Project structure recommends deployment of third-party packages via embed statement. Though, I was able to deploy “accesscontroltool-oakindex-package” via embed, “accesscontroltool-package” didn’t install.
    • Resolution: Use sub-package for deployment of “accesscontroltool-package
  • Issue 2: We had created a separate module for ACL deployment. The module needs to be deployed only after “accesscontroltool-package” is installed. When using Cloud Manager, the acl module was deployed prior to deployment of any other maven module.
    • Resolution: Declare the dependency of acl module on “accesscontroltool-package“. Also assure that the cloudManagerTarget is set to none.
  • Issue 3: Custom user groups are created in AEM, but ACLs are missing.
    • Resolution: If the issue occurs only on first installation for the maven project, then one should check the order in which modules are deployed. For example: If ACL should be applied on a content path, which is unavailable, then ACL set-up would fail. In this case, ACL module should be installed only after all necessary paths are available in AEM. Often, we might need to assure ui.content is deployed prior to ACL module.

Code Snippets

Sharing the configurations that need to be part of multiple pom.xml in the project structure. Appending the snippets in the appropriate pom.xml should resolve both the challenges mentioned above.

Step 1: Declare the dependency in project’s pom.xml

<!– Netcentric ACL Tool –>
<dependency>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-package</artifactId>
<type>content-package</type>
<version>2.5.3</version>
</dependency>
<!– Oak Index for netcentric ACL Tool –>
<dependency>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-oakindex-package</artifactId>
<type>zip</type>
<version>2.5.3</version>
</dependency>
view raw Project pom.xml hosted with ❤ by GitHub

Step 2: Declare third party packages for deployment via maven project

Add the following snippets in relevant sections of “all” module’s pom.xml

<!– Add accesscontroltool-oakindex-package configuration to embedded section of filevault-package-maven-plugin–>
<embedded>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-oakindex-package</artifactId>
<type>zip</type>
<target>/apps/techrevel-vendor-packages/application/install</target>
</embedded>
<!– Add accesscontroltool-package configuration to subPackage section of filevault-package-maven-plugin–>
<subPackage>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-package</artifactId>
<filter>true</filter>
</subPackage>
<!– Declare the dependencies in the corressponding section –>
<!– Netcentric ACL Tool –>
<dependency>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-package</artifactId>
<type>content-package</type>
</dependency>
<!– Oak Index for netcentric ACL Tool –>
<dependency>
<artifactId>accesscontroltool-oakindex-package</artifactId>
<type>zip</type>
</dependency>
view raw all pom.xml hosted with ❤ by GitHub

Step 3: Declare accesscontroltool-package in dependency section of ui.apps module

<!– Netcentric ACL Tool –>
<dependency>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-package</artifactId>
<type>content-package</type>
</dependency>
<!– Oak Index for netcentric ACL Tool –>
<dependency>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-oakindex-package</artifactId>
<type>zip</type>
</dependency>
view raw apps pom.xml hosted with ❤ by GitHub

Step 4: Declare the dependency of acl module on accesscontroltool-package, ui.apps and ui.content module

This step assures that the acl module is installed after accesscontroltool-package. Thus, the install hook needed by acl module will be available. Add the following snippets in relevant sections of “acl” module’s pom.xml

Also, configure cloudManagerTarget as none. This assures that the acl module is installed via all module and not separately. Refer link for details.

<!– ====================================================================== –>
<!– V A U L T P A C K A G E P L U G I N S –>
<!– ====================================================================== –>
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>com.techrevel.dam</group>
<name>techrevel.acl</name>
<packageType>application</packageType>
<properties>
<installhook.actool.class>biz.netcentric.cq.tools.actool.installhook.AcToolInstallHook</installhook.actool.class>
<cloudManagerTarget>none</cloudManagerTarget>
</properties>
<dependencies>
<dependency>
<groupId>com.techrevel.dam</groupId>
<artifactId>techrevel.ui.apps</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.techrevel.dam</groupId>
<artifactId>techrevel.ui.content</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-package</artifactId>
</dependency>
</dependencies>
</configuration>
</plugin>
</plugins>
</build>
<!– ====================================================================== –>
<!– D E P E N D E N C I E S –>
<!– ====================================================================== –>
<dependencies>
<dependency>
<groupId>com.techrevel.dam</groupId>
<artifactId>techrevel.ui.conetnt</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>com.techrevel.dam</groupId>
<artifactId>techrevel.ui.apps</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool-package</artifactId>
<type>content-package</type>
</dependency>
</dependencies>
view raw acl pom.xml hosted with ❤ by GitHub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s