SourceJammer Keyword Expansion in SourceJammer 1.3

Document version: 1.0. Revision Date: 11/12/2002


As of version 1.3, SourceJammer includes keyword expansion. Keyword expansion is a method of including and updating SourceJammer archive information within text files as they are checked in to a SourceJammer archive.

The 1.3 server includes keyword expansion functionality.

Keyword expansion allows you to put special keywords into the a comment header in files. SourceJammer will then dynamically replace the keywords with values describing the file. For example, if you put the keyword $FileName: $, SourceJammer will replace this with $FileName: MyFile.java$.

Keyword expansion is enabled on an archive-by-archive basis. You must turn on keyword expansion for each archive where you want to use expansion. You must also specify a list of file extensions that will have keyword expansion applied to them. For obvious reasons, keyword expansion is only applied to files with a file type of TEXT.

To enable keyword expansion:

1. Log on as an administrative user to your SourceJammer 1.3 server using a 1.3 SourceJammer client.
2. Select Archive | Archive Properties.
3. In the Archive Properties dialog, select the "Are Keywords Enabled" checkbox.
4. In the free-form text field below the checkbox, enter a space-separated list of all the file extensions for which keywords should be expanded. For example: java sql html xml.

The Keywords:

$Archive: $The name of the archive where the file is stored.
$Author: $User name of last user to modify file.
$AuthorName: $Full name of last user to modify file.
$Comment: $Most recent check-in comment.
$Date: $Last modified date of file.
$Description: $Description of the file.
$FileID: $Unique Id of the file.
$FileName: $The name of the file.
$VerID: $The unique ID of the most recent version.
$VerNum: $Number of the most recent version.
$History: $A listing of the file's history.
$KeyWordsOff: $Disables keyword expansion past this point in file.

Keyword Expansion Rules:

  • Don't put more than one keyword on a line.
  • Always include $KeyWordsOff: $ in all files to speed up processing.
  • If a keyword value wraps, the 2nd line of the value will begin with whatever preceeds the keyword. This is to provide simple support to languages that do not have multi-line comments. For example:
  •     ' $Comment: This is a comment that goes on just long enough to
        '           wrap.

    About $History: $:

    Most of the keywords are fairly self explanatory. $History: $ is a bit more complex. When $History: $ is expanded, it will keep getting longer and longer every time a file is checked in and more history is created, so keep this in mind. Also, $History: $ only adds history subsequent to when the $History: $ keyword was included in the file. It will not automatically put the entire file's history into your comment block. But it will append new history over time.