Chapter 10 Importing and Exporting Application Components


Merging property files in Jaguar JAR archives

You can add merge files to Jaguar JAR files so that property files are merged rather than being overwritten. Normally, a Jaguar JAR file contains all the properties for the entities exported in the archive. In some cases, you may not want to overwrite existing property files. For example, if you create an entity collection that contains a server, you may not want to overwrite the existing server properties when the archive is imported.

You can also add "cleaner" files, which cause entities to be removed entirely when an archive is exported.

Steps Creating an archive that contains merge files

  1. Create the merge and cleaner files for the entities to be exported.
  2. For each entity that requires a merge or cleaner file, add the file name to the entities .files property (that is, the property that ends in .files , such as com.sybase.jaguar.component.files ).
  3. Create the archive using jagtool or Jaguar Manager.

Creating merge files

Merge files must exist in the same directory as the properties file to merge with, and have the same base name with the .merge extension. For example, to merge properties for server Jaguar, the JAR file must contain these files:

Server/Jaguar.props
Server/Jaguar.merge

If a property is set in the merge file and in the .props file, the value is merged based on the merge-file setting, and the .props file setting is ignored. If a property is not set by either the merge file or in the .props file, it is left as is when the archive is imported. Merge files are text files, with one merge operation per line. Each merge operation uses the syntax:

MergeOperation:Property=NewValue

Where:

Table 10-2: Merge operations
Merge operation Action
SetDefault If the property is not set, or set with no value, set the property to the specified value. No action if the property is already set.
AppendToList For properties that take comma-separated lists of values, append the specified value to the existing value and remove duplicate entries.
PrependToList For properties that take comma-separated lists of values, prepend the specified value to the existing value and remove duplicate entries.
RemoveFromList For properties that take comma-separated lists of values, remote the specified entry to the existing value.
Delete Remove the property entirely.

Example merge operations

This example uses the AppendToList and RemoveFromList operations. For a server, this syntax could be used to remove an old version of a package and install a new version:

RemoveFromList:com.sybase.jaguar.server.packages=OEMPackageVersion1 
AppendToList:com.sybase.jaguar.server.packages=OEMPackageVersion2 

This example deletes the com.sybase.jaguar.server.timeout property:

Delete:com.sybase.jaguar.server.timeout

Creating cleaner files

If present in a Jaguar JAR file, cleaner files cause an entity to be removed entirely when an JAR file is imported. Cleaner files must exist in the same directory as the properties file for the entity to be deleted, and have the same base name with the .clean extension. For example, to cause deletion of the component MyStuff/Account, the JAR file must contain these files:

Component/MyStuff/Account.props
Component/MyStuff/Account.clean

 


Copyright © 2002 Sybase, Inc. All rights reserved.