Creating a smart library of reusable components
You can create a smart library using BMC Helix Platform and it can be used as a reusable building block for building applications.
To create a smart library, perform the following steps:
- Create a library project.
- Deploy the library project.
- Create the required record definitions for the library. See Defining-record-definitions-to-store-and-manage-data.
- Create the required view definitions for the library. See Defining-the-user-interface-through-view-definitions.
- Package the library.
To create a library project
You can create source files for a library project using Maven archetype. Create a directory to store the project code.
- On the command prompt, navigate to the directory created.
For example: C:\projects To create project, run the following command:
mvn archetype:generate -DarchetypeGroupId=com.bmc.arsys -DarchetypeArtifactId=rx-sdk-archetype-lib -DarchetypeCatalog=localArchetype Argument
Description
-DarchetypeGroupId=com.bmc.arsys
Maven uses BMC archetypes
-DarchetypeArtifactId=rx-sdk-archetype-lib
Selects the library archetype. This sets the POM file to create a library package and does not generates a working UI.
-DarchetypeCatalog=local
Uses only the local catalog
The command starts the archetype plugin in interactive mode and prompts for the following options:
Property
Description
Example Values
groupId
Project group ID. The ID usually follows the naming conventions of Java package names.
Note: You must provide the Developer ID as the groupID value.
com.example
artifactId
Project ID that is used as a part of filename. It usually has a short name as the project is already name spaced by the groupId.
Note: The artifactId cannot be a combination of '-' (hyphen) and numeric character. For example, work-order-lib-12 is not a valid artifactId.
work-order-lib
version
Project version. You can provide the value in any format (major.minor or major.minor.maintenance).
1.0-SNAPSHOT
package
Default Java package for the project. The default value is groupId value.
com.example
name
Bundle name. This is used by the archetype to display the name of the application on the login page.
Work Order
Confirm the configuration of all the properties.
After you create a new project, you should create a deployment package and deploy the package to BMC Helix Platform server.
To deploy the library project
To built and deploy the library project, navigate to the project directory and run the following command:
For example:
\projects\suggestion-box> mvn clean install -Pdeploy
Once the build is complete, verify that the library is available in the BMC Helix Innovation Studio.
To package the library
To create a deployment package for the library, on the command prompt, navigate to the library project and run the following command:
For example:
work-order-lib> mvn install -Pexport -Pdeploy
The deployment package is created in the target folder located in the library project directory.
For example, the deployment package for work-order-lib is located at projects\work-order-lib\package\target\com.example.work-order-lib-1.0-SNAPSHOT.zip
The deployment package zip file contains the code bundle jar file and the def file which consists the definitions.
For example, com.example.work-order-lib-1.0-SNAPSHOT.jar file and com.example.work-order-lib-1.0-SNAPSHOT.def file.