The package allows the import and export of repository contents. You can use packages to install new content, install new features, change event content, and restore saved content for development.
A package is a zip file that saves data stored in a serialized file system (called vault serialization) and provides an easy-to-use and maintainable representation of files and folders. What is included in a package is defined using filters. Additional content not used to extract the material, such as descriptions, images, or illustrations, may be included in the material. This additional content is for customer package content and informational purposes only.
Key Takeaways
- Content and configurations are bundled using packages in AEM.
- You can create, build, and manage packages using AEM’s Package Manager.
- AEM packages can be applied to various tasks, including content deployment between various environments.
- Carefully selecting the assets and filters to add to the package is crucial.
Required Authorizations for Package Creation
To create, modify, download, and install packages, users must have appropriate permissions on:
- All permissions, unless removed from /etc/packages
- The node containing the contents of the package
Package Manager UI
Package Manager is divided into four main functional areas which include the left navigation panel, Package list, Activity log, and toolbar. where Packages can be filtered and sorted using the Left Navigation Panel. All installed packages in our instance will be displayed in the package list. And activity log contains the Clear log and Hide/Show buttons. whereas the toolbar contains refresh buttons for the Left Navigation Panel and Package list and buttons for searching, creating, and uploading packages.
The Process of Package Creation, Installation, and Package Upload
Creating a package in AEM involves many steps; below is a step-by-step guide to help you create the package in AEM.
Accessing the Package Manager Console
To begin, Navigate to the Package Manager Console. This can be found in three different ways: From the AEM main menu > Tools > Deployment > Packages OR From CRXDE Lite using the top switcher bar OR Directly by accessing http://<host>:<port>/crx/packmgr/
Create a New Package in Package Manager
- Click on “Create a package” next to the search bar in the top navigation bar.
- Enter the correct package name and other details, and then click OK
- A package will be created.
Package Name: Give the package a clear and understandable name that will help you and others recognize its contents.
Version: You can indicate a version in this text-based field. This is added to the package name to create the zip file’s name.
Group: This indicates the target group (or folder) name. Groups assist you in package organization. If there isn’t a folder for the group already, one is created. If the group name is left empty, the package will be created in the main package list.
Editing General Settings and Defining Package Filters
We edit the packages to change various package settings, such as the General information and Filter settings. The general setting allows us to manage information such as the package description, dependencies, and provider details. The package filters define the content you wish to include in the package.
- Open the newly created package and click on the edit button
- Edit the general information you want to change, like the package description and version, in the “General” tab.
- Switch to the Filter Tab, click “Add Filter,” and enter the root path of the content you wish to include.
- To save the changes, click “OK.”
Building the Package
Usually, a package is built while it is being created, but you can come back later to rebuild or rebuild the package. This is helpful when the package filters or the content within the repository have changed.
We mostly build the package after applying the package filter.
Build: Click on the “Build” button present on the package. This will build the package according to the filters you have defined.
Downloading the Package
Once the package is built, you can download it. The package will be downloaded as a zip file.
- Click the package name to open the package details from the package list.
- Click the Download button or the package’s linked file name in the package details section.
- AEM downloads the package to your computer.
Uploading and Installing the Shared Package
To upload the shared package, open the Package Manager and click the “Upload Package” button. Provide the relevant details regarding the uploaded package and click OK. The uploaded package will be displayed in the package list. Now Click the Install button to install the uploaded package.
Package: Choose the necessary package from your local file system by using the “Browse” button.
Force Upload: This option forces the upload and overwrites any existing packages with this name if there are already any.
Conclusion
Creating a package in AEM is a simple process involving accessing the Package Manager, creating a new package, defining package filters, and creating the package. Packages are a key component of AEM, allowing content and configuration to be effectively structured and configured across different environments. Knowing how to build these well is important for any AEM developer and tester.