Article summary

Summary
Discusses how to package an Adobe CQ application, including OSGi bundles.
Digital Marketing Solution(s) Adobe Experience Manager (Adobe CQ)
Audience
Administrator
Required Skills
XML
Tested On Adobe Experience Manager 6

Introduction

You can package an Adobe Experience Manager (AEM) 6 application that contains an OSGi bundle by using Package Manager. Once an application (including the OSGi bundle) is placed into a package, you can deploy it to another AEM instance. If your CQ package does not include the OSGi bundle, then the application will not successfully work when deployed to the new AEM instance.

This article discusses how to create AEM packages using AEM 6 Touch UI, as shown in this illustration. 

Packages

For example, assume that you create the weather application that uses an OSGi bundle by following the development article here: Creating Adobe CQ bundles using Apache CXF that consume web services.

To successfully package the weather application, you include the cdynewebservice_1.0.0.jar (which represents the OSGi bundle) into the package.

Note:

This article describes how to package the weather application (that depends upon an OSGi bundle) as an example. You can build the weather application by following the instructions located in the previous link. 

To package an Adobe application that contains an OSGi bundle, perform these tasks:

  1. Create the package by using Package Manager.
  2. Place the OSGi bundle into a deployable folder.
  3. Build the package.
  4. Download the package into a ZIP file.

Note:

On a related note, you can use Package Share to download existing packages. The Package Share menu option is at the same level in the Touch UI as Packages, which is shown in the previous illustration. A typical issue with Package Share is user wonder why they are facing issues accessing packages/hotfix on Package Share?  

There is no anonymous access to the Package Share; that is, only registered users are allowed to view, download and upload packages.

Access to the Package Share is available AEM users (AEM partners and customers). Registration details must be submitted for access rights to be assigned. Click here to know more.

Create the package by using Package Manager

You can use Package Manager to create a new AEM package. The following list describes package contents:

• Package Settings
• Package Filters
• Package Screenshots
• Package Icons

Note:

The package that is created in this article uses package settings and package filters. For more information about these Adobe CQ package settings, see How to Work With Packages.

NewPackage

The following list describes the fields on this dialog box:

Package Name: The name of the package. Once deployed to a new AEM instance, the package name is visible in Package Manager view. Select a descriptive name to help you (and others) easily identify the contents of the package.
Version: The version of the package. This will be appended to the package name to form the name of the zip file.
Group: The target group (or folder) name. Groups are intended to be used to help you organize your packages. A folder will be created for the group if it does not already exist. If you leave the group name blank, it will create the package in the main package list (Home > Packages).

 

Note:

Ensure that you select values that make sense for these package values. For example, name your package something that makee sense to users using the package. This will help reduce issues with packages. 

The following illustration shows the Select Path dialog box displaying content under apps/weatherapp. (This was the application built by following the link at the start of this article.) Also this application is dependent upon an OSGi bundle.

Path

The Select Path dialog box is visible when you define filters for the package. Once you select content and click OK, the content is added to the Edit Package dialog box, as shown in the following illustration.

EditPackage

The content located in the Root path is added to the package. To successfully package the weather application, select the following content: /content/weatherPage (in addition to /apps/weatherapp). The /content/weatherPage content represents the weather application’s web page.

Each piece of content that you add to the package is included in the Edit Package dialog box, as shown in the following illustration.

EditPackage2

Note:

Selecting the correct content is very important. If you do not select the correct content, your package will not function properly on the new AEM instance.

To create the package by using Package Manager in AEM 6 Touch UI, perform these tasks:

  1. To view the CQ welcome page, enter the URL http://[host name]:[port] into a web browser. For example, http://localhost:4502.
  2. Select Tools, Operations, Packaging, Packages.
  3. Click Create Package.
  4. Enter values for Package Name, Version, and Group and click OK.
  5. From the Package Manager list, click on your new package. Notice how the package opens.
  6. From the menu that appears, click Edit.
  7. Select the Filters tab.
  8. Click the Add Filters button.
  9. Click the search button and select the content you want to package (for example, to package the weather application, select apps/weatherapp). Click OK.
  10. Repeat steps 8 and 9 for content/weatherapp.

Place the OSGi bundle into a deployable folder

After you use Package Manager to define the package’s content, place the OSGi bundle (for example, cdynewebservice_1.0.0.jar that the weather application depends on) into a folder under apps/weatherapp. Place this JAR file into the following folder:

apps/weatherapp/osgi-bundles/install

This path is shown in the following illustration.

OSGiView

An OSGi bundle that is placed the the <appName>/osgi-bundles/install folder is placed into the package when you build it. Furthermore, when you deploy the package to a new AEM instance, the OSGi bundle is deployed and placed into an active state.

Build the package

After you define the package’s content by using Package Manager and include the OSGi bundle, you can build the package by again using Package Manager. You can find a Build button on the Package Manager's toolbar, as shown in the following illustration.

BuildButton

To build the package, peform these tasks:

  1. To view the CQ welcome page, enter the URL http://[host name]:[port] into a web browser. For example, http://localhost:4502.
  2. Select Tools, Operations, Packaging, Packages.
  3. Click on your package for which you have defined content.
  4. Click the Build button.
  5. Click the Build button on the confirmation message box.
  6. Watch the messages in the Activity log. If the package was successfully build, you will see a message similar to: Package built in 776ms.

Download the package into a ZIP file

After you have build the package, you can download it as a ZIP file (this ZIP file represents the package). Once you download the package as a ZIP file, you can deploy the package to another CQ instance. If the package contains an OSGi bundle (as is the case with the package build in this article), the OSGi bundle is automatically deployed to the new CQ instance along with the package’s content.

To download the package, perform these tasks:

  1. To view the CQ welcome page, enter the URL http://[host name]:[port] into a web browser. For example, http://localhost:4502.
  2. Select Packages.
  3. Click on your package that you built.
  4. Click the Download button.
  5. The package is saved as a ZIP file on your local file system.

Deploy the package to another CQ instance

You can deploy a package to another CQ instance by using Package Manger. Once deployed, all of the package’s content is deployed to the new CQ instance.

To deploy the package to a new CQ instance, peform these tasks:

  1. To view the CQ welcome page, enter the URL http://[host name]:[port] into a web browser. For example, http://localhost:4502.
  2. Select Tools, Operations, Packaging, Packages.
  3. Click Upload Package.
  4. Click the Browse button and navigate to the ZIP file.
  5. Click OK.
  6. Click the Install button.
  7. Click the Install button that appears on the message box.
  8. Watch the messages in the Activity log. If the package was successfully installed on the new CQ instance, you will see a message similar to: Package installed in 280ms.

See also

Congratulations, you have just created an AEM 6 Touch UI package. Please refer to the AEM community page for other articles that discuss how to build AEM services/applications.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy