With Interchange 5.3.0, Interchange supports so-called "features". The whole purpose of the new "Feature" facility is to allow easy installation of new capabilities to Interchange.
Interchange already has the convention of "extensions" which allow you to put together features to add to Interchange. But the installation is manual, and requires good docs to make it easily installable for end-users. Also, many features require access to the global configuration. There's also another problem at sight, namely that of feature creep, since everything was just being added to the "standard" catalog.
The basic mechanism is simple:
Inside "feature" modules, there are three special kinds of files, called by
extensions .global
, .init
and
.uninstall
.
(In the included quickpoll
feature, these are named
quickpoll.global
and quickpoll.init
).
If a file has the extension .global
, it is added to the global
configuration. The included quickpoll
feature, for example,
adds the quickpoll
ActionMap, and two usertags:
poll-answer
and ascii-graph
.
If a file has the extension .init
, it is run once —
the first time
the target catalog is accessed. Again, in the quickpoll
example, it is used to add
mv_metadata entries and a couple of sample polls.
All other files in the directory are catalog configuration
(quickpoll.catalog.cfg
for a concrete example).
It could have also been
broken up into say, files quickpoll.sql
and
quickpoll_answer.sql
.
All subdirectories contain files which are copied to the
catalog directory with the same relative path. In this
case,
ICROOT/features/quickpoll/templates/components/quickpoll
would go to
CATROOT/templates/components/quickpoll
.
The .init
file, when run, sends its output to
(and that would be ConfDir
/init/FEATURE
/FEATURE
.initetc/init/quickpoll/quickpoll.init
for
the concrete example.)
Once it is run, the existence of the file prevents it being run again.
Uninstall files, those with the .uninstall
extension,
are ITL files that can perform any uninstall
functions, and they run with temporary AllowGlobal
access to
allow dropping of tables, unlinking of files, etc.
Automated uninstall features include removing any files installed
as a part of the feature -- providing they have not changed. If
the file was edited and is not identical to the originally installed
file, then it is left there and a warning issued.
Uninstall creates file
to note the uninstall, and which prevents the Init process from happening
again (assuming Interchange has not been restarted since the
feature installation).
ConfDir
/init/FEATURE
/uninstall
The uninstall routine is called with the [uninstall_feature]
tag.
Caution | |
---|---|
The catalog user must remove the
Also, there is a short window where a SQL table, if dropped
as a part of the uninstall procedure, could be re-instantiated
based on the existence of the configuration in memory. It
is recommended that if |