Skip to main content
Kinetic Community

Import Catalog

This command will import a service catalog given a directory with multiple KURL definition files.

Details

This command expects a directory with a very specific directory structure.  First it loads a file named catalog.rb in the root of the directory.  This file should contain the catalog definition because the catalog must be created before any service items.  Second it looks for a directory named authentication and loads any definitions found within.  This is necessary because items used for authentication must be loaded before service items that reference them.  Finally it looks for a directory named forms and recursively loads every definition found within.

Normally when building service items, if a service item with the same name already exists within the same catalog it will be skipped. This behavior can be changed by adding the archive or overwrite flag to configure KURL to run in archive or overwrite mode.

Archive

In archive mode, if there is an existing service item with the same name and catalog that service item will be renamed with a timestamp and the new service item will be created as normal.  The timestamp added is the integer number of seconds since epoch.

Also note that this timestamp adds 10 characters to the length of the service item name and the maximum name length is 50 characters.  Therefore if we try to archive a service item with a name longer than 40 characters we will encounter an error.

Overwrite

In overwrite mode, if there is an existing service item with the same name and catalog that service item will be DELETED and the new service item will be created as normal.

Arguments

directory Specifies the directory that contains the KURL definitions to be imported
zip Specifies a zipped directory that contains the KURL definitions to be imported
archive If used KURL will run in archive mode as described above
overwrite If used KURL will run in overwrite mode as described above

Either the directory or the zip argument must be used for this command, but both cannot be used at the same time.

Examples

java -jar kurl.jar -action=build_catalog -directory=ServiceCatalog

This example will import a service catalog from the KURL definitions within the ServiceCatalog directory.  It will skip existing matching service items.

java -jar kurl.jar -action=build_catalog -zip=ServiceCatalog.zip -archive

This example will import a service catalog from the KURL definitions within the ServiceCatalog.zip file.  It will archive existing matching service items.