<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" 
   href="file://c:/source/xslt/xml-labs/setupguide.xsl"?>
<setupguide>

  <title>
    Installation Guide for Descriptor Systems Liberty Full Stack Web Development Workshop.
  </title>

  <description>
    <p>
      This document describes the setup for the
      Descriptor Systems Liberty Full Stack Web Development Workshop.
    </p>
    <p>
      <b>Important:</b> Please print this document and as you install the
      software, mark up the document with the actual
      directory paths where you installed the software.
      Then leave a copy of the marked-up document for the instructor.
    </p>
    
    <p>
      With the exception of the operating system, all
      of the required software is available at no charge
      for download (some packages will require you to register on
      a website).
    </p>

    <p>
      If you have questions or difficulties with the installation,
      you can contact Joel Barnum at 319-362-3906 or email at
      <literal><![CDATA[
<script language='javascript'>
<!--
var username = "joelbarnum";
var hostname = "descriptor.com";
var linktext = username + "@" + hostname;
document.write("<a href=" + "mail" + "to:" + username +
"@" + hostname + ">" + linktext + "</a>")
//-->
</script>]]>.      
      </literal>
    </p>
  </description>

  <hardware-requirements type="Student">
    <requirement>
      A Pentium 1Ghz processor
    </requirement>
    <requirement>
      500MB of free disk space for installation
    </requirement>
    <requirement>
      256MB of memory, 512MB strongly recommended
    </requirement>
    <requirement>
      1024x768 display, 65536 colors
    </requirement>
    <requirement>
      Optional Internet connection
    </requirement>
  </hardware-requirements>

  <hardware-requirements type="Instructor" >
    <requirement>Projection unit, 800x600 resolution minimum</requirement>
    <requirement>Internet connection strongly recommended</requirement>
  </hardware-requirements>

  <software-requirements type="Student">
    <requirement>
      Microsoft Windows 7 or later
    </requirement>

    <requirement>
       Unzip utility such as 7-Zip from <a 
       href="http://www.7-zip.org/">http://www.7-zip.org</a>
    </requirement>

    <requirement>
      Java Development Kit (JDK) Version 8
    </requirement>

    <requirement>
      Eclipse Neon
    </requirement>
    
    <requirement>
      Tomcat 8
    </requirement>

    <requirement>
      Gradle
    </requirement>
    
    <requirement>
      Spring Boot
    </requirement>
    
    <requirement>
      Student Exercises Archive
    </requirement>

  </software-requirements>
    
  <software-requirements type="Instructor" >
    <requirement>Descriptor Systems Courseware Viewer (screen-show software)</requirement>
    <requirement>Instructor Display Materials </requirement>
  </software-requirements>

  <setup-instructions type="Student">
    <step>
      <p>
        <b>NOTE:</b> This course's labs REQUIRE direct access to the internet from
        the command-line <i>gradle</i> and <i>spring</i> programs. These programs
        download dependent libraries from internet-based repositories to the
        local workstation and cannot do so if there's an authenticating proxy
        server configured. Please ensure that the workstations on which the labs
        will run allow direct internet access.
      </p>
    </step>
    <step>
      <p>
        Login in with the same user name that the students will use, and note the
        user name here:
      </p>
      <pre>

Student user name: ____________________________________
      
      </pre>
      <p>
        In the "home" directory for that user (e.g. <b>c:\Users\username</b>,
        create a folder named <b>java</b>. You will
        install some of the required software into this directory.
      </p>
      <p>
        Then create another folder named <b>gradlehome</b> in the "home"
        directory.
      </p>
    </step>
    
    <step>
      <p>
        Download the Java 8 Java Development Kit from:
      </p>
      <code>
        <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">
        http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</a>
      </code>
      <p>
        Get the Windows 64-bit version. The file name should be something like <b>jdk-8u91-windows-x64.exe</b>.
        It's OK to use a later version than 8u91.
      </p>
      <p>
        Install the JDK using all of the defaults.
      </p>
    </step>
    
    <step>
      <p>
        To test the Java runtime installation, choose Start - Run, then
        enter <i>cmd</i> and press OK. In the new command prompt window, enter:
      </p>
      <code>
        java -fullversion
      </code>
      <p>
        You should see the version number of the JDK that you
        installed.
      </p>
    </step>

    <step>
      <p>
        Download the Eclipse Neon IDE For Java EE Developers for Windows (64-bit) from:
      </p>
      <p>
        <a href="https://www.eclipse.org/downloads/packages/release/Neon/2">
          https://www.eclipse.org/downloads/packages/release/Neon/2
        </a>.
      </p>
      <p>
        The file name should be something like <i>eclipse-jee-neon-2-win32-x86_64.zip</i>.
      </p>
      <p>
        <b>WARNING: </b>Be sure to download the Eclipse IDE for Java EE Developers, not
        Eclipse for Java Developers (doesn't support EE).
      </p>
      <p>
        Unzip the archive to the <i>c:\Users\username\java</i> directory. You should end up
        with a subdirectory named <b>c:\Users\username\java\eclipse</b>.
      </p>
    </step>
    
    <step>
      <p>
        To test the Eclipse installation, use Windows Explorer or My Computer to navigate
        to the c:\Users\username\java\eclipse directory and double-click <b>eclipse.exe</b>.
        Eclipse should start.
      </p>
    </step>

    <step>
      <p>
        Download Tomcat version 8 from:
      </p>
      <p>
        <a href="http://tomcat.apache.org/download-80.cgi">
          http://tomcat.apache.org/download-80.cgi
        </a>
      </p>
      <p>
        Download the <i>Core zip</i> file (not the Windows zip). 
      </p>
      <p>
        <b>Note: </b>Be sure to get version 8.0.xx, NOT 8.5.xx.
      </p>
      <p>
        The file name should be something like <i>apache-tomcat-8.0.45.zip</i>.
      </p>
      <p>
        Unzip the archive to the c:\users\username\java directory. You should end up
        with a subdirectory named <b>c:\users\username\java\apache-tomcat-8.0.45</b>.
      </p>

    </step>
    
    <step>
      <p>
        Download Gradle from:
      </p>
      <p>
        <a href="https://gradle.org/releases/">
          https://gradle.org/releases/
        </a>
      </p>
      <p>
        Get the "Binary only" distribution v 2.14. The file name
        should be something like <i>gradle-2.14-bin.zip</i>.
      </p>
      <p>
        Unzip the archive to the c:\users\username\java.
        You should end up with a subdirectory named  
        <b>c:\users\username\java\gradle-2.14</b>.
      </p>
    </step>
        
    <step>
      <p>
        Download and install Spring Boot:
      </p>
      <p><b>Windows Instructions:</b></p>
        <p>
          Download the Spring CLI distribution from 
          <a href="http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/1.3.1.RELEASE/spring-boot-cli-1.3.1.RELEASE-bin.zip">
            http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/1.3.1.RELEASE/spring-boot-cli-1.3.1.RELEASE-bin.zip
          </a>. 
        </p>
        <p>           
           Unzip the downloaded file to the <i>java</i> folder you created
           in an earlier step. You should end up with
           a directory that matches the version of the Spring Boot CLI that you downloaded,
           for example: <i>\Users\username\java\spring-1.3.1.RELEASE</i>. Please write down
           the directory name here:
        </p>
        <pre>
        
Spring Boot Installation Directory: ____________________________________________        
        </pre>
    </step>
    
    
    <step>
      <p>
        Establish environment variables. Open the Windows Control Panel and
        in the upper-right corner, start typing <b>Environment</b> then
        click <i>Edit the system environment variables</i>. Press the
        <i>Environment variables</i> button.
      </p>
      <p>
        Establish three new User environment variables:
      </p>
      <pre>
GRADLE_HOME=c:\users\username\java\gradle-2.14
GRADLE_USER_HOME=c:\users\username\gradlehome
PATH=%GRADLE_HOME%\bin;\Users\username\java\spring-1.3.1.RELEASE\bin;%PATH%      
      </pre>
      <p>
        Be sure to substitute the actual user name in these variables.
      </p>
    </step>
    
    <step>
      <p>
        Test gradle. Close any open command-prompt windows, then open a
        new one. Enter: 
      </p>
      <code>
gradle -version      
      </code>
      <p>
        You should see the version of Gradle you installed.
      </p>
      <p>
        Next, test gradle's access to internet-based repositories.
        In a temporary directory on the workstation, create a file named
        <b>build.gradle</b> with the following contents:
      </p>
      <pre>
repositories {
    maven {
       mavenCentral()
        url 'https://repo.spring.io/libs-release'
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'

dependencies {
    runtime 'log4j:log4j:1.2.17'
}      </pre>
      <p>
        Then open a command-prompt and change to the temporary directory
        containing the build.gradle file and enter:
      </p>
      <pre>
gradle eclipse      
      </pre>
      <p>
        You should see gradle downloading dependencies, including the line
        shown below:
      </p>
      <pre>
Download https://repo1.maven.org/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar      
      </pre>
      <p>
        If you do NOT see log4j being downloaded, please verify that the
        workstation has proxyless access to the internet.
      </p>
    </step>
    
    <step>
      <p>
        Test Spring Boot. Close any open command-prompt windows, then open
        a new one. Enter:
      </p>
      <pre>
        spring --version
      </pre>
      <p>
        You should see the version number of the Spring Boot CLI that you
        installed.
      </p>
      <p>
        Next, test Spring Boot's access to the internet. In the command-prompt,
        change to a temporary directory on the workstation, then enter:
      </p>
      <pre>
spring init -b 1.3.1.RELEASE --build gradle -x      
      </pre>
      <p>
        If you see the message <i>Failed to retrieve metadata from service at
        'https://start.spring.io'</i>, then please verify that the workstation
        has proxyless access to the internet.
      </p>
    </step>
    <!-- DONE TO HERE -->
       <step>
         <p>
           Download the <i>Student Exercise Archive</i> from
           <a 
         href="http://www.descriptor.com/setupguides/liberty/techstart/2017/webdev/eclipse-neon-spring4-springboot/webclass.zip">
         http://www.descriptor.com/setupguides/liberty/techstart/2017/webdev/eclipse-neon-spring4-springboot/webclass.zip</a>.
         </p>
        <p>
          Unzip the archive to the <b>user's home directory</b>. You should end up with
          a subdirectory named <b>c:\Users\username\webclass</b>.           
         </p>
       </step>
    
  </setup-instructions>

  <setup-instructions type="Instructor">
    <step>
      <p>Repeat the Student software setup on the instructor machine.</p>
    </step>

    <step>
      <p>Download and install the Courseware Viewer program.</p>
      <p>Download the Viewer installation program from:
        <a href="http://www.descriptor.com/viewer/binaries/setup.exe">
        http://www.descriptor.com/viewer/binaries/setup.exe
      </a>
      </p>
      <p>
        Run the installation program, accepting all defaults.
      </p>
    </step>
    <step>
      <p>
         Download the presentation materials from 
         <a href="http://www.descriptor.com/setupguides/liberty/techstart/2017/webdev/webclass-screenshow.zip">
           http://www.descriptor.com/setupguides/liberty/techstart/2017/webdev/webclass-screenshow.zip
         </a>
      </p>
      <p>
        Unzip this archive to the <b>user's home directory</b> on the same drive where you installed
        the <i>Student Exercise Archive</i>. You should end up with a subdirectory like
        <b>c:\Users\username\webclass\courseware</b>.
      </p>
    </step>
    <step>
      <p>
        Test the Courseware Viewer. From the Windows Start menu, choose <b>Descriptor Systems -
        Courseware Viewer</b>. Then use the <b>File - Open</b> menu to open the
        <b>c:\Users\username\webclass\courseware\webclass.crs</b>         
        file. You should see the screen show.
      </p>
    </step>
  </setup-instructions>

</setupguide>
