Allows a network applet to make a local copy of itself in order to support occasionally connected computing.
installer: A proc which can create a local copy of the applet. You may use
occ-root-installer directly, or the result of calling
occ-module-installer, to create a proc which can be used to install archives produced by the deployment tool in the IDE.
Returns
permission? (the value of the implicit call to
request-local-data-permission),
network? (true if running from the network),
allowed? (true if updating was allowed), and
updated? (true if any update was done). If any of these values is
false, all following values will also be
false.
This procedure will attempt to create, or update, a local copy of an applet.
First,
request-local-data-permission will be called, and if permission is refused, this procedure will return, with
permission? false.
Second, if the applet is not running from the network, then this procedure will return, with
network? false.
Third, if any other applet on the machine is already inside
occ-install-or-update, and
timeout expires, then this procedure will return, with
allowed? false.
Finally, the
installer will be called, inside a
with-file-caching-style block with the
FileCachingStyle resynchronize, to do all the actual work, and if it returns false, then this procedure will return, with
updated? false.
The
new-root-url argument to the
installer will be a new, writable, temporary directory, into which the local copy of the applet should be placed.
The
old-root-url argument to the
installer will be the read-only final location for the installation, and which, if it already exists, will contain the results of the last successful installation.
If
installer throws no exceptions, and returns true, then a special
curl-root.txt file will be created inside
new-root-url, defining the curl root for the original applet, and then
old-root-url will have its contents atomically replaced with those of
new-root-url.
Note that the
installer should return
false if it determines that
old-root-url is already up to date, to prevent any unnecessary work from being done.
This procedure can only be used by an applet that has a Curl/Pro server license.