Skip to content

Latest commit

 

History

History
107 lines (68 loc) · 7.19 KB

tutorial.asciidoc

File metadata and controls

107 lines (68 loc) · 7.19 KB

CSC8104: Enterprise Middleware Tutorial

This tutorial guides you through the necessary preparation required to begin your coursework for this module. It is very important that you have completed this and are comfortable with the examples, before the beginning of the first coursework week.

Create Accounts

To complete this coursework you will need accounts on OpenShift and GitHub.

OpenShift

OpenShift is a Platform as a Service (PaaS) Cloud offered by Red Hat. It can host many types of applications, but for this coursework you will be using it to host Java EE 6 applications on JBoss EAP 6.1. OpenShift has a free tier of membership, which you will use for the coursework.

To create an account:

  1. Go to: https://www.openshift.com

  2. Select "Signup for Free" under the "Online" option.

  3. Fill in your details and select "Sign Up".

  4. TODO: any more steps?

GitHub

GitHub offers the Git version control system as a service. You will use it to host your code and to make it available to the demonstrators. GitHub is very popular in the open-source community and works best when you make your code available to others to view, clone and contribute towards. However, given the confidential nature of your coursework, you will need to use a private repository only accessible by yourself and the demonstrators.

If you don’t already have an account you will need to:

  1. Go to: https://github.com/

  2. Fill in your details and select "Sign up for GitHub."

  3. Forward your Github account registration email to Matt Forshaw at ([email protected]). Matt will then create your private repository, grant you access, and email you with the details.

Tip
GitHub is a very popular service, and you are quite likely to use it in your profesional career; especially if you work with open source software in some capacity.

Environment Setup

  • TODO: rhc setup

Angular.js Tutorial

Now you should run through the Angular.js tutorial. It can be found here: http://docs.angularjs.org/tutorial. After running through this, you should understand the technology well enough to understand how the example (see next section) works.

Tip
If you are having problems with your JavaScript, you can use Chrome’s JavaScript console to see what’s happening. To show it go to: View → Developer → JavaScript Console.

Run Example

Now you will run a simple example. This example provides you with a starting point that you will build on when you come to doing the coursework. Therefore, it is very important that you get this working and become familiar with the code.

  • Download JBoss. Get version EAP 6.1.0.Final from here: http://www.jboss.org/jbossas/downloads/. You need to make sure you use this version of JBoss as this matches the version you will be using on OpenShift.

  • Extract. Unzip this to somewhere on your computer.

  • Run kitchensink-angularjs locally. Download the Jboss Developer Framework quickstarts from here: http://www.jboss.org/jdf/. Then run the kitchensink-angularjs quickstart by following the instructions in kitchensink-angularjs/README.md.

  • Run the tests. Follow the section on "Run the Arquillian Tests".

  • Run kitchensink-angularjs on Openshift. Now follow the "Build and Deploy the Quickstart - to OpenShift" section. NOTE: make sure you use 'jbosseap-6' as the APPLICATION_TYPE.

Working with Git

You will be using Git in the coursework for regular checkpoint and backup of your code to GitHub. You will also use Git to deploy new versions of your application to OpenShift. This section will show you how to create a copy of the 'kitchensik-angularjs' example, ready fo you to extend in the coursework, and also how to push the code to GitHub and OpenShift.

  • Build on top of the kitchensink-angularjs example, by moving your clone of the OpenShift git repository at kitchensink-angularjs/kitchensinkangularjs to some other location on your disk, where you want to develop your coursework submission.

  • Now you need to be able to push your code to your git repository on GitHub. To do this, you will need the url of the repository created by Matt on your earlier request.

    git remote add github https://github.com/NewcastleComputingScience/<YOUR ID>.git
    git push github master -f

Viewing your datasource

During development you may find it very useful to be able to inspect the contents of your database. To do this you will use h2console, which is provided as part of the quickstarts.

Deploying h2console

  1. Copy the h2console WAR file into the "deployments" directory of your repository.

    cp ~/[some location]/jboss-as-quickstart/h2-console/h2console.war . (where "." refers to your current directory)
  2. Add this file to your git repository, commit and push.

    git add deployments/h2console.war
    git commit
    git push

Accessing h2console

You can access the console at http://<yourdomainname>.rhcloud.com/h2console.

To log into the datasource for your application, use the following details.

Driver Class: javax.naming.InitialContext
JDBC URL: Your JDBC URL is available in your persistence.xml file, and can be found between the <jta-data-source> tags e.g. java:jboss/datasources/KitchensinkAngularJSQuickstartDS
Username: sa
Passowrd: sa
  1. Click "Test Connection" and if these details are correct you will see "Test successful".

  2. Press "Connect" to view the contents of the datasource.

Course Demonstrator Profiles

Dr Paul Robinson is a Senior Software Engineer at Red Hat and a Visiting Research Fellow at the University. Paul develops software for the JBoss application server and in particular for the Transaction Service component. Paul has lead the Enterprise Distributed Computing coursework for 9 years. He also supervises students for their Masters dissertation through industrial placements at Red Hat.

Matt Forshaw is a fourth year PhD student at Newcastle University. After completing his BSc and MSc ITEC (with Distinction) at Newcastle University, Matt has demonstrated and assessed on CSC8104 for the past four years. Matt is a member of the Systems research group investigating energy efficient operating policies for large computing environments. He also supervises student research projects and dissertations in the areas of energy-efficiency and green computing.

Becky Simmonds is a third year PhD student researching into Twitter analysis using online and offline techniques. She demonstrated on CSC8104 the last two years and completed it herself the year before. Becky demonstrates on other modules and helps supervise a final year dissertation.

Ryan Emerson is a third year PhD student who has studied at Newcastle University since 2007. Ryan graduated with a 2:1 BSc (Hons) in Computer Science in 2010 and obtained his Masters (ITEC) with Distinction in 2011. Currently Ryan is part of the Systems research group conducting research into probabilistic atomic broadcast protocols.

Alocation List

Student Service Repository URL

student1

Taxi

student2

Hotel

student3

Service

Important
If your name does not appear in the allocation list please contact Matt Forshaw at [email protected] as soon as possible (prior to the first practical session) and you will be assigned a service type and a private GitHub repository.