Skip to main content

How to use Packages.xml

Overview

The objective of this tutorial is to provide a comprehensive understanding of the Enactor Packages.xml. The tutorial will guide you through the process of creating a Packages.xml file and demonstrate how to register various resources, including Application Processes, Page Definitions, and Process Extensions, within the Packages.xml file.

What You Will Learn

  • What is a Packages.xml file
  • How to create a Packages.xml?
  • How to register resources?

What is a Packages.xml file

The Packages.xml is a dedicated file for resource management and the deployment process. It exists within a java project however, it is not mandatory for projects exclusively comprising Java code nor is it madatory for the project.

Each Packages.xml file is distinguished by a Package ID, which is required to be distinct across all Packages.xml files accessible to the application.

note

The POS project is assigned the Package ID 'POS,' while the Customer Order POS project is identified by the Package ID 'CustomerOrdersPos.

Resources that are registered in the Packages.xml:

  • Application Processes
  • Messages Resources
  • Page Definitions
  • Themes
  • Process Extensions
  • Entity Definition
  • JAXB Classes

In addition, the Packages.xml file serves the purpose of registering Deployment Handlers, which are code segments executed upon the initiation of the application, such as the POS application or EM. However, this aspect is not addressed in the current tutorial.

The Packages.xml file is situated in the src/META-INF folder within a project.

Packages.xml Location

The Packages Editor offers a user interface for managing the Packages.xml file, featuring several tabs such as:

  • Description: Provides information about the project and the Package ID.
  • Source: Allows direct access to the XML content in the file.
  • Processes: Facilitates the registration of application processes, page definitions, and message resources.
  • Themes: Manages themes within the Packages.xml file.

Package Editor Tabs

Create a new Packages.xml

Right click the META-INF folder within a project and select New → Other → Enactor Development → Package

Choose new Package

From the select wizard, expand the Enactor Development Group

Create new Package

Optionaly update the Package ID and Name fields

Create new Package

Package Resource Registration

Resources can be registered in the Packages.xml file through various methods.

Automatic registration

When utilizing Enactor Tools wizards to create resources, there may be an option to automatically register the resource within a specified Packages.xml file.

Manual Registration

Alternatively, resources can be introduced to the project through means such as importing from external sources or copying them from another project or workspace. In the case of resources originating from Enactor Tools wizard creation but imported into the current context, manual registration becomes necessary. This can be achieved by right-clicking on the imported item in the Project panel and applying the 'Register in Packages' option from the Enactor menu, as demonstrated below.

Register Application Processes

Automatic registration

Create a new application process using the Application Process Wizard, locate the checkbox labeled Register in Packages. When this checkbox is selected, the newly created application process will be automatically registered in the resolved Packages.xml file.

Register in Packages

Register in Packages

Manual Registration

To register an existing Application Process, open the Packages.xml file using the Packages editor

Register in Packages

Select the Processes tab

Register in Packages

Under the Package Process Group, Click Add... button

Register in Packages

Search for the Application Process you wish to add

Register in Packages

note

When selecting the Folder Ensure you are selecting the folder located in a project.

Register Page Definitions

Automatic registration

The process of registering page definitions is akin to that of an Application Processes. Locate the Register in Packages flag within the Page Definition Wizard, the only additional step is to provide the Package Process ID in the designated field. This Package Process ID corresponds to the application process under which the page definition will be displayed.

Register Page Definition

Manual Registration

To register an already created Page Definition using the Package Editor, Selecte the Process tab

Expand the page definition Group

Click Add... button

Register Page Definition In PackageEditor

Register Extensions

To register an extension point using the Extensions tab in the Package Editor, select the Extensions tab

Under the Package Extensions Group, Click Add... button

Register Extensions

Enter a value for the Name text box. A basic name for the Extension Point

Update a value for the Extension Point text box. The identity of the extension point at which the extension should be injected

Enter a value for the Extension URL text box. The URL of the extension (Process Id, JSP)

Select a value for the Type drop down. The type of extension (Process, Page, Tab, JSP)

Optionaly, the Extension points order can be specified using the Apply Before Packages group.

An additional option is to override another extension using the Extension Overrides.