Skip to content

Commit

Permalink
Specify env vars for the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo committed Oct 23, 2016
1 parent 5aa1e78 commit 73a3d27
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ list_all_SPs_csv.xsl

## Overview

Bash script ``http_xsltproc.sh`` is a wrapper around the ``xsltproc`` command-line tool. Unlike ``xsltproc``, script ``http_xsltproc.sh`` fetches the target XML document from an HTTP server. See the inline help file for details:
Bash script ``http_xsltproc.sh`` is a wrapper around the ``xsltproc`` command-line tool. Unlike ``xsltproc``, the ``http_xsltproc.sh`` script fetches the target XML document from an HTTP server using HTTP Conditional GET [RFC 7232]. If the server responds with 200, the script caches the resource and returns the response body. If the server responds with 304, the script returns the cached resource instead. See the inline help file for details:

```Shell
$ $BIN_DIR/http_xsltproc.sh -h
```

The following examples illustrate usage of the script.
The ``http_xsltproc.sh`` script requires two environment variables. ``CACHE_DIR`` is the absolute path to the cache directory (which may or may not exist) whereas ``LIB_DIR`` specifies a directory containing various helper scripts.

For example, let's use the library installed in the previous section and specify the cache as follows:

```Shell
$ export CACHE_DIR=/tmp/cache
```

The following examples show how to use the script to create some cron jobs on incommon.org.

### Example #1

Expand Down Expand Up @@ -78,7 +86,7 @@ Observe that the command ``http_xsltproc.sh -F`` forces a fresh SAML metadata fi

### Example #2

Consider the following URLs:
This example is similar to the previous example except that two resources are created. Consider the following URLs:

```Shell
xml_location=http://md.incommon.org/InCommon/InCommon-metadata.xml
Expand Down Expand Up @@ -117,7 +125,7 @@ mv $resource1_file $resource2_file $resource_dir
exit 0
```

Observe the commands ``http_xsltproc.sh -F`` and ``http_xsltproc.sh -C``. The former forces a fresh SAML metadata file as in the previous example. The latter goes directly to cache. If file is not in the cache (which is highly unlikely), the process terminates without updating any resource files.
Observe the commands ``http_xsltproc.sh -F`` and ``http_xsltproc.sh -C``. The former forces a fresh SAML metadata file as in the previous example; the latter goes directly to cache. If file is not in the cache (which is highly unlikely), the process terminates without updating any resource files.

### Example #3

Expand Down

0 comments on commit 73a3d27

Please sign in to comment.