docs.intersystems.com
Home  /  Downloading Samples for Use with InterSystems IRIS


Articles
Downloading Samples for Use with InterSystems IRIS
InterSystems: The power behind what matters   
Search:  


This article describes how to download samples for use with InterSystems IRIS Data Platform™, as well as how to create a namespace and database to hold the samples. It contains these sections:
Introduction
The installation kit for InterSystems IRIS Data Platform does not include samples; this enables the kit to be as small as possible. Instead, samples are available online at GitHub. In GitHub terms, each sample is provided as a repository or repo. The following link lists the InterSystems IRIS™ sample repos: https://github.com/search?q=topic%3Aintersystems-samples.
Each of the sample repos includes:
Note that the InterSystems account (https://github.com/intersystems) includes many other repos. The repos that are meant for use with the InterSystems IRIS documentation are tagged with intersystems-samples and have names starting with Samples.
If you are familiar with GitHub, skip ahead to Creating a Namespace and Database to Hold Samples.”
If you are not familiar with GitHub, see the next section for how to download samples. You do not need a GitHub account.
Downloading a Sample
GitHub provides options that let you download a repo as a single packaged unit, which you can then uncompress as a directory with multiple files. The details are different by operating system.
Downloading a Repo on Windows
To download a repo on Windows:
  1. Put the cursor into the address bar of the browser and add the following to the end of the URL: /archive/master.zip
  2. The resulting full URL is https://github.com/intersystems/repo-name/archive/master.zip where repo-name is the repo name.
  3. Press Return.
  4. The browser then downloads a .zip file that contains the full repo. Depending on your browser settings, you may get prompted for a location. If not, check the usual download location for this browser.
  5. Uncompress the .zip file. The uncompressed directory contains a README.md file, a LICENSE file, a buildsample subdirectory, and other files and subdirectories.
  6. Using a text editor, open the README.md file and follow the instructions in it.
Downloading a Repo on Linux and Unix
To download a repo on Linux and Unix®:
  1. Scroll through the list of samples until you find the repo you want.
  2. Click the link for that repo. The upper part of the page summarizes the contents, and the lower part displays the README fle for the repo.
  3. From the shell, type:
    wget -qO- https://github.com/intersystems/file.txt/archive/master.tar.gz | tar xvz -C /samples
  4. Press Return
  5. In the InterSystems IRIS Terminal, type:
    zn SAMPLES
  6. Press Return
  7. Type:
    do $system.OBJ.Load("FullPathToTheBuildRoutine.mac","ck")
    do ^BuildRoutine
  8. The uncompressed directory contains a README.md file, a LICENSE file, a buildsample subdirectory, and other files and subdirectories. Using a text editor, open the README.md file and follow the instructions in it.
Creating a Namespace and Database to Hold Samples
Many of the samples include InterSystems IRIS classes or routines and are meant to be loaded into an InterSystems IRIS instance. InterSystems recommends that you create a dedicated namespace and database for this purpose and then load the samples into that namespace. The steps are as follows:
  1. Create a new namespace and database called SAMPLES. (These steps also create a web application.)
    1. In the Management Portal, click System Administration > Configuration > System Configuration > Namespaces.
    2. In the next step, you are starting to create the namespace.
    3. For Enter the name of your database, enter SAMPLES or your other choice of name. The name is not case-sensitive.
    4. Click Next.
    5. Accept all other values as default.
    6. Click Finish.
      This step finished creating the database.
    7. For Select an existing database for Routines, select the database that you just created.
      Note that for a production system, you would use a different database to store routines and classes.
    8. Accept all other values as default.
    9. Click Save.
    Now the namespace and database are available, as well as a web application that uses the namespace.
  2. To use any samples that contain InterSystems IRIS Analytics options, you must have a web application that enables use of these options. (An appropriate license is also necessary.) Here is how to modify the web application that you created in the previous step:
    1. In the Management Portal, click System Administration > Security > Applications > Web Applications.
    2. Find the row corresponding to the web application (for example, /csp/samples, assuming that the namespace name is SAMPLES).
    3. Click the link in the leftmost column of that row.
    4. Select the DeepSee and iKnow check boxes.
      This step enables this web application to use the InterSystems IRIS Analytics options (the check boxes will be combined and relabeled in a future release).
    5. Click Save.
  3. Download and uncompress the sample or samples you want to use.
  4. Use a text editor to open the README.md file and then follow the setup instructions. The steps include loading, compiling, and running a setup routine; do those steps within the namespace that you have just created.