Article summary

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

Introduction

You can package an Adobe Experience Manager 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 Experience Manager instance. If your package does not include the OSGi bundle, then the application will not successfully work when deployed to the new Experience Manager instance.

For example, assume that you create the weather application that uses an OSGi bundle by following the development article here: Creating an AEM HTML Template Language Component that displays data from a SOAP Web Service.

To successfully package the weather application, you include 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. 

Create the package by using Package Manager

You can use Package Manager to create a new Experience Manager 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 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 instance, the package name is visible in the OSGi console view.
  • Version: The version of the package.
  • 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).

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 does not function properly on the new Experience Manager instance.

To create the package by using Package Manager, perform these tasks:

  1. To view the Package Manager page, enter the URL: http://localhost:4502/crx/packmgr/index.jsp .
  2. Click Create Package.
  3. Enter values for Package Name, Version, and Group and click OK.
  4. From the Package Manager list, click on your new package. Notice how the package opens.
  5. From the menu that appears, click Edit.
  6. Select the Filters tab.
  7. Click the Add Filters button.
  8. Click the search button and select the content you want to package (for example, to package the weather application, select apps/weatherapp). Click OK.
  9. 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/weather. 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 Experience Manager instance, the OSGi bundle is deployed.

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. Enter the URL http://localhost:4502/crx/packmgr/index.jsp.
  2. Click on your package for which you have defined content.
  3. Click the Build button.
  4. Click the Build button on the confirmation message box.
  5. 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 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 instance along with the package’s content.

To download the package, perform these tasks:

  1. Enter the URL: http://localhost:4502/crx/packmgr/index.jsp.
  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 Experience Manager instance

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

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

  1. Enter the URL: http://localhost:4502/crx/packmgr/index.jsp.
  2. Select 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 instance, you will see a message similar to: Package installed in 280ms.

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