Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczak-cg committed Mar 9, 2016
2 parents 19e68e7 + 87db738 commit caf41d3
Showing 1 changed file with 36 additions and 29 deletions.
65 changes: 36 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@ The sample application is built on top of the [application template](https://git
Getting Started
---

To get started you need to clone the oasp4j repository containing the server part, build and deploy it on a Tomcat server. To get started with the client part you need to clone the oasp4js repository, build the client and start it.
To get started you need to clone both the `oasp4j` and `oasp4js` repositories containing the server and the client part respectively. Each of them is to be built and started to talk to each other it. There are two ways to get the sample application working: eithter by getting the [oasp IDE](https://github.com/oasp/oasp4j/wiki/oasp-ide-setup) and running it from there or setting up the IDE manually.

Install prerequisites
---
#Full oasp IDE installation

If you want to install full OASP IDE and get both server and client code please follow steps described in [oasp IDE setup](https://github.com/oasp/oasp4j/wiki/oasp-ide-setup). The `oasp IDE` already contains software (Node.js, Gulp, Bower, Maven) required to run the sample application; only Git has to be additionally installed.

#Getting oasp4js client working
##Install prerequisites

There are two ways to get sample application working: eighter by getting OASP IDE and running it from there or without installing IDE.
If the [oasp IDE setup](https://github.com/oasp/oasp4j/wiki/oasp-ide-setup) is not used, additional software has to be installed manually. You need a Git client to clone the repositories and the Node.js platform (including its package manager - npm) which allows Gulp and Bower to install the dependencies and build the application. [Here](https://github.com/oasp/oasp4js/wiki/Prerequisites) you can learn how to install the prerequisites.
Also, for the server part you need Maven (tested against the version: 3.3.9) to be installed. For installation details please refer to the [Maven's](http://maven.apache.org/download.cgi) home page.

OASP IDE already contains software (Node.js, Gulp, Bower, Maven) required to run sample application so only Git must be additionally installed.
If OASP IDE is not used additional software must be installed manually so you need a Git client to clone the repositories and the Node.js platform (including its package manager - npm) which allows Gulp and Bower to install the dependencies and build the application. [Here](https://github.com/oasp/oasp4js/wiki/Prerequisites) you can learn how to install the prerequisites.
Also, for the server part you need Maven (required version: 3.x) to be installed. For installation details please refer to the [Maven's](http://maven.apache.org/download.cgi) home page.
Please note that this client version was tested with following versions of the additional software:
- node.js version 5.0.0
- npm version 3.3.6
- gulp version 3.9.1
- bower version 1.7.7

Create the `<oasp_dir>` directory for the sample application
---
Expand All @@ -31,7 +38,7 @@ Set up the server part of the application
Clone the oasp4j repository:

```
git clone https://github.com/oasp/oasp4j.git
git clone --recursive https://github.com/oasp/oasp4j.git -b master
```

Let Maven build the server part:
Expand All @@ -45,23 +52,20 @@ After a successful build go to the following directory

```
cd samples\core\target
```
Start the oasp4j-samples-core project as spring boot application by running following command in your console:

```
java -jar oasp4j-sample-core-dev-SNAPSHOT.jar
Configure the port number which should be used by the embedded tomcat server and its context path. To do this, create a new `application.properties` file in the `<oasp_dir>\oasp4j\samples\core\target` directory and add the following entries:

```
server.port=8081
server.context-path=/oasp4j-sample-server
```

By default tomcat server will use port 8081. This can be changed by creating new application.properties file in <oasp_dir>\oasp4j\oasp4j-samples\core\target directory and adding following entry:
Start the oasp4j-samples-core project as a Spring Boot application by running the following command in your console:

```
java -jar oasp4j-sample-core-dev-SNAPSHOT.jar
```
server.port=8888.
```
Replace '8888' with the port number which you want to use for your Tomcat.
If you change the Tomcat's port, then see the _[hint about how to configure a different port on the client side](#howToChangeTomcatsPortInConfigJson)_.


Set up the client part of the application
---
Expand All @@ -71,7 +75,7 @@ We asume you are back in the `<oasp_dir>` directory.
Clone the oasp4js repository:

```
git clone https://github.com/oasp/oasp4js.git
git clone https://github.com/oasp/oasp4js.git -b master
```

Install the client part's dependencies:
Expand All @@ -81,20 +85,12 @@ cd oasp4js
npm install
```

During npm install process bower downloads some libraries and uses git for it. Git defaults to the git protocol whose standard port (9418) is sometimes blocked by the company firewall. A solution for this problem is to configure Git to use the https instead of the git protocol with following command:
During the `npm install` process Bower downloads some libraries and uses Git for it. Git defaults to the Git protocol whose standard port (9418) is sometimes blocked by firewalls. A solution for this problem is to configure Git to use the `https` instead of the git protocol with following command:

```
git config --global url."https://".insteadOf git://
```
and to rerun npm install command.


<a name="howToChangeTomcatsPortInConfigJson"></a>
_**Hint about how to configure a different Tomcat's port to be used on the client side:** If you changed the Tomcat's port as [described here](#changeTomcatsPortInServerXml), then you have to change the default port which is configured in the client part of the application, in the `<oasp_dir>\oasp4js\config.json` file. You have to set the correct port number in the following line of the aforementioned configuration file (replace '8888' with the port number which you configured for your Tomcat):_

```
"proxy": "http://localhost:8888",
```
and to rerun the `npm install` command.

Start the application using Gulp:

Expand All @@ -105,3 +101,14 @@ gulp serve
The above Gulp's task opens the client part of the application in your default browser and watches for any changes in HTML/JavaScript/CSS files. Once you change one, the page is reloaded automatically!

You can sign in using the following credentials: waiter/waiter or cook/cook.

If for some reason your client should talk to the server configured in a different way, you can configure the server details in the client's configuration file, `<oasp_dir>\oasp4js\config.json`, in the `proxy` part:

```
{
"proxy": {
"baseUrl": "http://localhost:8081",
"context": "/oasp4j-sample-server"
}
}
```

0 comments on commit caf41d3

Please sign in to comment.