Chapter 10 Importing and Exporting Application Components
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.
Creating an archive that contains merge files
.files
property
(that is, the property that ends in .files
, such
as com.sybase.jaguar.component.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:
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. |
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
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. |
![]() |