Commit e201dba1 authored by sumet's avatar sumet
parents 54cb7b1d 9c585f59
mywork @ 983bd3f9
Subproject commit 983bd3f94ac23a9c6931a2e77529d0d8d076e7c1
logs
project/project
project/target
target
tmp
.history
dist
/.idea
/*.iml
/out
/.idea_modules
.classpath
.project
/RUNNING_PID
.settings
.target
.cache
bin
.DS_Store
activator-sbt-*-shim.sbt
dist: trusty
sudo: true
group: beta
language: scala
scala:
- 2.11.11
- 2.12.3
jdk:
- oraclejdk8
cache:
directories:
- "$HOME/.ivy2/cache"
- "$HOME/.sbt/launchers"
before_cache:
- rm -rf $HOME/.ivy2/cache/com.typesafe.play/*
- rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.play/*
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print0 | xargs -n10 -0 rm
notifications:
slack:
secure: K6HWTI6zJpQfxS7sH5ZQ1jEK5TkkUl5GtcGinNecHMBqvfS4IXAnU23lz/kLqCqMVPIFaRx1g6UwgJgMvR4XWeIhpzLOzAnOOcmv+kQzv7A8vEJBM20z1HNzDcxzvuNNO2BHn8EjXh5VD65vXMcA+lKzUxASey/Rs+CBReQWE7M=
License
-------
Written in 2016 by Lightbend <info@lightbend.com>
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
[<img src="https://img.shields.io/travis/playframework/play-java-ebean-example.svg"/>](https://travis-ci.org/playframework/play-java-ebean-example)
# play-java-ebean-example
This is an example Play application that uses Java, and communicates with an in memory database using EBean.
The Github location for this project is:
[https://github.com/playframework/play-java-ebean-example](https://github.com/playframework/play-java-ebean-example)
## Play
Play documentation is here:
[https://playframework.com/documentation/latest/Home](https://playframework.com/documentation/latest/Home)
## EBean
EBean is a Java ORM library that uses SQL:
[https://www.playframework.com/documentation/latest/JavaEbean](https://www.playframework.com/documentation/latest/JavaEbean)
and the documentation can be found here:
[https://ebean-orm.github.io/](https://ebean-orm.github.io/)
package controllers;
import models.Computer;
import play.data.Form;
import play.data.FormFactory;
import play.libs.concurrent.HttpExecutionContext;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.Results;
import repository.CompanyRepository;
import repository.ComputerRepository;
import javax.inject.Inject;
import javax.persistence.PersistenceException;
import java.util.Map;
import java.util.concurrent.CompletionStage;
/**
* Manage a database of computers
*/
public class HomeController extends Controller {
private final ComputerRepository computerRepository;
private final CompanyRepository companyRepository;
private final FormFactory formFactory;
private final HttpExecutionContext httpExecutionContext;
@Inject
public HomeController(FormFactory formFactory,
ComputerRepository computerRepository,
CompanyRepository companyRepository,
HttpExecutionContext httpExecutionContext) {
this.computerRepository = computerRepository;
this.formFactory = formFactory;
this.companyRepository = companyRepository;
this.httpExecutionContext = httpExecutionContext;
}
/**
* This result directly redirect to application home.
*/
private Result GO_HOME = Results.redirect(
routes.HomeController.list(0, "name", "asc", "")
);
/**
* Handle default path requests, redirect to computers list
*/
public Result index() {
return GO_HOME;
}
/**
* Display the paginated list of computers.
*
* @param page Current page number (starts from 0)
* @param sortBy Column to be sorted
* @param order Sort order (either asc or desc)
* @param filter Filter applied on computer names
*/
public CompletionStage<Result> list(int page, String sortBy, String order, String filter) {
// Run a db operation in another thread (using DatabaseExecutionContext)
return computerRepository.page(page, 10, sortBy, order, filter).thenApplyAsync(list -> {
// This is the HTTP rendering thread context
return ok(views.html.list.render(list, sortBy, order, filter));
}, httpExecutionContext.current());
}
/**
* Display the 'edit form' of a existing Computer.
*
* @param id Id of the computer to edit
*/
public CompletionStage<Result> edit(Long id) {
// Run a db operation in another thread (using DatabaseExecutionContext)
CompletionStage<Map<String, String>> companiesFuture = companyRepository.options();
// Run the lookup also in another thread, then combine the results:
return computerRepository.lookup(id).thenCombineAsync(companiesFuture, (computerOptional, companies) -> {
// This is the HTTP rendering thread context
Computer c = computerOptional.get();
Form<Computer> computerForm = formFactory.form(Computer.class).fill(c);
return ok(views.html.editForm.render(id, computerForm, companies));
}, httpExecutionContext.current());
}
/**
* Handle the 'edit form' submission
*
* @param id Id of the computer to edit
*/
public CompletionStage<Result> update(Long id) throws PersistenceException {
Form<Computer> computerForm = formFactory.form(Computer.class).bindFromRequest();
if (computerForm.hasErrors()) {
// Run companies db operation and then render the failure case
return companyRepository.options().thenApplyAsync(companies -> {
// This is the HTTP rendering thread context
return badRequest(views.html.editForm.render(id, computerForm, companies));
}, httpExecutionContext.current());
} else {
Computer newComputerData = computerForm.get();
// Run update operation and then flash and then redirect
return computerRepository.update(id, newComputerData).thenApplyAsync(data -> {
// This is the HTTP rendering thread context
flash("success", "Computer " + newComputerData.name + " has been updated");
return GO_HOME;
}, httpExecutionContext.current());
}
}
/**
* Display the 'new computer form'.
*/
public CompletionStage<Result> create() {
Form<Computer> computerForm = formFactory.form(Computer.class);
// Run companies db operation and then render the form
return companyRepository.options().thenApplyAsync((Map<String, String> companies) -> {
// This is the HTTP rendering thread context
return ok(views.html.createForm.render(computerForm, companies));
}, httpExecutionContext.current());
}
/**
* Handle the 'new computer form' submission
*/
public CompletionStage<Result> save() {
Form<Computer> computerForm = formFactory.form(Computer.class).bindFromRequest();
if (computerForm.hasErrors()) {
// Run companies db operation and then render the form
return companyRepository.options().thenApplyAsync(companies -> {
// This is the HTTP rendering thread context
return badRequest(views.html.createForm.render(computerForm, companies));
}, httpExecutionContext.current());
}
Computer computer = computerForm.get();
// Run insert db operation, then redirect
return computerRepository.insert(computer).thenApplyAsync(data -> {
// This is the HTTP rendering thread context
flash("success", "Computer " + computer.name + " has been created");
return GO_HOME;
}, httpExecutionContext.current());
}
/**
* Handle computer deletion
*/
public CompletionStage<Result> delete(Long id) {
// Run delete db operation, then redirect
return computerRepository.delete(id).thenApplyAsync(v -> {
// This is the HTTP rendering thread context
flash("success", "Computer has been deleted");
return GO_HOME;
}, httpExecutionContext.current());
}
}
package models;
import io.ebean.Model;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
@MappedSuperclass
public class BaseModel extends Model {
@Id
public Long id;
}
package models;
import play.data.validation.Constraints;
import javax.persistence.Entity;
/**
* Company entity managed by Ebean
*/
@Entity
public class Company extends BaseModel {
private static final long serialVersionUID = 1L;
@Constraints.Required
public String name;
}
package models;
import play.data.format.Formats;
import play.data.validation.Constraints;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import java.util.Date;
/**
* Computer entity managed by Ebean
*/
@Entity
public class Computer extends BaseModel {
private static final long serialVersionUID = 1L;
@Constraints.Required
public String name;
@Formats.DateTime(pattern="yyyy-MM-dd")
public Date introduced;
@Formats.DateTime(pattern="yyyy-MM-dd")
public Date discontinued;
@ManyToOne
public Company company;
}
package repository;
import io.ebean.Ebean;
import io.ebean.EbeanServer;
import models.Company;
import play.db.ebean.EbeanConfig;
import javax.inject.Inject;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.CompletionStage;
import static java.util.concurrent.CompletableFuture.supplyAsync;
/**
*
*/
public class CompanyRepository {
private final EbeanServer ebeanServer;
private final DatabaseExecutionContext executionContext;
@Inject
public CompanyRepository(EbeanConfig ebeanConfig, DatabaseExecutionContext executionContext) {
this.ebeanServer = Ebean.getServer(ebeanConfig.defaultServer());
this.executionContext = executionContext;
}
public CompletionStage<Map<String, String>> options() {
return supplyAsync(() -> ebeanServer.find(Company.class).orderBy("name").findList(), executionContext)
.thenApply(list -> {
HashMap<String, String> options = new LinkedHashMap<String, String>();
for (Company c : list) {
options.put(c.id.toString(), c.name);
}
return options;
});
}
}
package repository;
import io.ebean.*;
import models.Computer;
import play.db.ebean.EbeanConfig;
import javax.inject.Inject;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
import static java.util.concurrent.CompletableFuture.supplyAsync;
/**
* A repository that executes database operations in a different
* execution context.
*/
public class ComputerRepository {
private final EbeanServer ebeanServer;
private final DatabaseExecutionContext executionContext;
@Inject
public ComputerRepository(EbeanConfig ebeanConfig, DatabaseExecutionContext executionContext) {
this.ebeanServer = Ebean.getServer(ebeanConfig.defaultServer());
this.executionContext = executionContext;
}
/**
* Return a paged list of computer
*
* @param page Page to display
* @param pageSize Number of computers per page
* @param sortBy Computer property used for sorting
* @param order Sort order (either or asc or desc)
* @param filter Filter applied on the name column
*/
public CompletionStage<PagedList<Computer>> page(int page, int pageSize, String sortBy, String order, String filter) {
return supplyAsync(() ->
ebeanServer.find(Computer.class).where()
.ilike("name", "%" + filter + "%")
.orderBy(sortBy + " " + order)
.fetch("company")
.setFirstRow(page * pageSize)
.setMaxRows(pageSize)
.findPagedList(), executionContext);
}
public CompletionStage<Optional<Computer>> lookup(Long id) {
return supplyAsync(() -> Optional.ofNullable(ebeanServer.find(Computer.class).setId(id).findOne()), executionContext);
}
public CompletionStage<Optional<Long>> update(Long id, Computer newComputerData) {
return supplyAsync(() -> {
Transaction txn = ebeanServer.beginTransaction();
Optional<Long> value = Optional.empty();
try {
Computer savedComputer = ebeanServer.find(Computer.class).setId(id).findOne();
if (savedComputer != null) {
savedComputer.company = newComputerData.company;
savedComputer.discontinued = newComputerData.discontinued;
savedComputer.introduced = newComputerData.introduced;
savedComputer.name = newComputerData.name;
savedComputer.update();
txn.commit();
value = Optional.of(id);
}
} finally {
txn.end();
}
return value;
}, executionContext);
}
public CompletionStage<Optional<Long>> delete(Long id) {
return supplyAsync(() -> {
try {
final Optional<Computer> computerOptional = Optional.ofNullable(ebeanServer.find(Computer.class).setId(id).findOne());
computerOptional.ifPresent(Model::delete);
return computerOptional.map(c -> c.id);
} catch (Exception e) {
return Optional.empty();
}
}, executionContext);
}
public CompletionStage<Long> insert(Computer computer) {
return supplyAsync(() -> {
computer.id = System.currentTimeMillis(); // not ideal, but it works
ebeanServer.insert(computer);
return computer.id;
}, executionContext);
}
}
package repository;
import akka.actor.ActorSystem;
import play.libs.concurrent.CustomExecutionContext;
import javax.inject.Inject;
/**
* Custom execution context, so that blocking database operations don't
* happen on the rendering thread pool.
*
* @link https://www.playframework.com/documentation/latest/ThreadPools
*/
public class DatabaseExecutionContext extends CustomExecutionContext {
@Inject
public DatabaseExecutionContext(ActorSystem actorSystem) {
super(actorSystem, "database.dispatcher");
}
}
@(computerForm: Form[Computer], companies: Map[String, String])
@import helper._
@main {
<h1>Add a computer</h1>
@form(routes.HomeController.save()) {
<fieldset>
@CSRF.formField
@inputText(computerForm("name"), '_label -> "Computer name", '_help -> "")
@inputText(computerForm("introduced"), '_label -> "Introduced date", '_help -> "")
@inputText(computerForm("discontinued"), '_label -> "Discontinued date", '_help -> "")
@select(
computerForm("company.id"),
options(companies),
'_label -> "Company", '_default -> "-- Choose a company --",
'_showConstraints -> false
)
</fieldset>
<div class="actions">
<input type="submit" value="Create this computer" class="btn primary"> or
<a href="@routes.HomeController.list()" class="btn">Cancel</a>
</div>
}
}
@(id: Long, computerForm: Form[Computer], companies: Map[String, String])
@import helper._
@main {
<h1>Edit computer</h1>
@form(routes.HomeController.update(id)) {
<fieldset>
@CSRF.formField
@inputText(computerForm("name"), '_label -> "Computer name", '_help -> "")
@inputText(computerForm("introduced"), '_label -> "Introduced date", '_help -> "")
@inputText(computerForm("discontinued"), '_label -> "Discontinued date", '_help -> "")
@select(
computerForm("company.id"),
options(companies),
'_label -> "Company", '_default -> "-- Choose a company --",
'_showConstraints -> false
)
</fieldset>
<div class="actions">
<input type="submit" value="Save this computer" class="btn primary"> or
<a href="@routes.HomeController.list()" class="btn">Cancel</a>
</div>
}
@form(routes.HomeController.delete(id), 'class -> "topRight") {
@CSRF.formField
<input type="submit" value="Delete this computer" class="btn danger">
}
}
@(currentPage: io.ebean.PagedList[Computer], currentSortBy: String, currentOrder: String, currentFilter: String)
@****************************************
* Helper generating navigation links *
****************************************@
@link(newPage:Int, newSortBy:String) = @{
var sortBy = currentSortBy
var order = currentOrder
if(newSortBy != null) {
sortBy = newSortBy
if(currentSortBy == newSortBy) {
if(currentOrder == "asc") {
order = "desc"
} else {
order = "asc"
}
} else {
order = "asc"
}
}
// Generate the link
routes.HomeController.list(newPage, sortBy, order, currentFilter)
}
@**********************************
* Helper generating table headers *
***********************************@
@header(key:String, title:String) = {
<th class="@key.replace(".","_") header @if(currentSortBy == key) { @{if(currentOrder == "asc") "headerSortDown" else "headerSortUp" } }">
<a href="@link(0, key)">@title</a>
</th>
}
@main {
<h1 id="homeTitle">@Messages("computers.list.title", currentPage.getTotalCount)</h1>
@if(flash.containsKey("success")) {
<div class="alert-message warning">
<strong>Done!</strong> @flash.get("success")
</div>
}
<div id="actions">
<form action="@link(0, "name")" method="GET">
<input type="search" id="searchbox" name="f" value="@currentFilter" placeholder="Filter by computer name...">
<input type="submit" id="searchsubmit" value="Filter by name" class="btn primary">
</form>
<a class="btn success" id="add" href="@routes.HomeController.create()">Add a new computer</a>
</div>
@if(currentPage.getTotalCount == 0) {
<div class="well">
<em>Nothing to display</em>
</div>
} else {
<table class="computers zebra-striped">
<thead>
<tr>
@header("name", "Computer name")
@header("introduced", "Introduced")
@header("discontinued", "Discontinued")
@header("company.name", "Company")
</tr>
</thead>
<tbody>
@for(computer <- currentPage.getList.asScala) {
<tr>
<td><a href="@routes.HomeController.edit(computer.id)">@computer.name</a></td>
<td>
@if(computer.introduced == null) {
<em>-</em>
} else {
@computer.introduced.format("dd MMM yyyy")
}
</td>
<td>
@if(computer.discontinued == null) {
<em>-</em>
} else {
@computer.discontinued.format("dd MMM yyyy")
}
</td>
<td>
@if(computer.company == null) {
<em>-</em>
} else {
@computer.company.name
}
</td>
</tr>
}
</tbody>
</table>
<div id="pagination" class="pagination">
<ul>
@if(currentPage.hasPrev) {
<li class="prev">
<a href="@link(currentPage.getPageIndex - 1, null)">&larr; Previous</a>
</li>
} else {
<li class="prev disabled">
<a>&larr; Previous</a>
</li>
}
<li class="current">
<a>Displaying @currentPage.getDisplayXtoYofZ(" to "," of ")</a>
</li>
@if(currentPage.hasNext) {
<li class="next">
<a href="@link(currentPage.getPageIndex + 1, null)">Next &rarr;</a>
</li>
} else {
<li class="next disabled">
<a>Next &rarr;</a>
</li>
}
</ul>
</div>
}
}
@(content: Html)
<!DOCTYPE html>
<html>
<head>
<title>Computers database</title>
@*************************************
<link rel='stylesheet' href='@routes.Assets.at("lib/bootstrap/css/bootstrap.min.css")'>
<link rel='stylesheet' href='@routes.Assets.at("lib/font-awesome/css/font-awesome.min.css")'>
<script src="@routes.Assets.at("lib/jquery/jquery.js")" type="text/javascript"></script>
<script src="@routes.Assets.at("lib/bootstrap/js/bootstrap.min.js")" type="text/javascript"></script>
*************************************@
<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("stylesheets/bootstrap.min.css")">
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")"/>
</head>
<body>
<header class="topbar">
<h1 class="fill">
<a href="@routes.HomeController.index()">
Play sample application &mdash; Computer database
</a>
</h1>
</header>
<section id="main">
@content
</section>
</body>
</html>
name := "play-java-ebean-example"
version := "1.0.0-SNAPSHOT"
scalaVersion := "2.12.4"
crossScalaVersions := Seq("2.11.12", "2.12.4")
lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)
libraryDependencies += guice
libraryDependencies += jdbc
libraryDependencies += "com.h2database" % "h2" % "1.4.196"
libraryDependencies += "org.awaitility" % "awaitility" % "2.0.0" % Test
libraryDependencies += "org.assertj" % "assertj-core" % "3.6.2" % Test
libraryDependencies += "org.mockito" % "mockito-core" % "2.1.0" % Test
testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-a", "-v")
# Configuration
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
ebean.default="models.*"
# Assets configuration
# ~~~~~
"assets.cache./public/stylesheets/bootstrap.min.css"="max-age=3600"
# Number of database connections
# See https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
fixedConnectionPool = 9
# Set Hikari to fixed size
play.db {
prototype {
hikaricp.minimumIdle = ${fixedConnectionPool}
hikaricp.maximumPoolSize = ${fixedConnectionPool}
}
}
# Job queue sized to HikariCP connection pool
database.dispatcher {
executor = "thread-pool-executor"
throughput = 1
thread-pool-executor {
fixed-pool-size = ${fixedConnectionPool}
}
}
# --- First database schema
# --- !Ups
create table company (
id bigint not null,
name varchar(255),
constraint pk_company primary key (id))
;
create table computer (
id bigint not null,
name varchar(255),
introduced timestamp,
discontinued timestamp,
company_id bigint,
constraint pk_computer primary key (id))
;
create sequence company_seq start with 1000;
create sequence computer_seq start with 1000;
alter table computer add constraint fk_computer_company_1 foreign key (company_id) references company (id) on delete restrict on update restrict;
create index ix_computer_company_1 on computer (company_id);
# --- !Downs
SET REFERENTIAL_INTEGRITY FALSE;
drop table if exists company;
drop table if exists computer;
SET REFERENTIAL_INTEGRITY TRUE;
drop sequence if exists company_seq;
drop sequence if exists computer_seq;
# --- Sample dataset
# --- !Ups
insert into company (id,name) values ( 1,'Apple Inc.');
insert into company (id,name) values ( 2,'Thinking Machines');
insert into company (id,name) values ( 3,'RCA');
insert into company (id,name) values ( 4,'Netronics');
insert into company (id,name) values ( 5,'Tandy Corporation');
insert into company (id,name) values ( 6,'Commodore International');
insert into company (id,name) values ( 7,'MOS Technology');
insert into company (id,name) values ( 8,'Micro Instrumentation and Telemetry Systems');
insert into company (id,name) values ( 9,'IMS Associates, Inc.');
insert into company (id,name) values ( 10,'Digital Equipment Corporation');
insert into company (id,name) values ( 11,'Lincoln Laboratory');
insert into company (id,name) values ( 12,'Moore School of Electrical Engineering');
insert into company (id,name) values ( 13,'IBM');
insert into company (id,name) values ( 14,'Amiga Corporation');
insert into company (id,name) values ( 15,'Canon');
insert into company (id,name) values ( 16,'Nokia');
insert into company (id,name) values ( 17,'Sony');
insert into company (id,name) values ( 18,'OQO');
insert into company (id,name) values ( 19,'NeXT');
insert into company (id,name) values ( 20,'Atari');
insert into company (id,name) values ( 22,'Acorn computer');
insert into company (id,name) values ( 23,'Timex Sinclair');
insert into company (id,name) values ( 24,'Nintendo');
insert into company (id,name) values ( 25,'Sinclair Research Ltd');
insert into company (id,name) values ( 26,'Xerox');
insert into company (id,name) values ( 27,'Hewlett-Packard');
insert into company (id,name) values ( 28,'Zemmix');
insert into company (id,name) values ( 29,'ACVS');
insert into company (id,name) values ( 30,'Sanyo');
insert into company (id,name) values ( 31,'Cray');
insert into company (id,name) values ( 32,'Evans & Sutherland');
insert into company (id,name) values ( 33,'E.S.R. Inc.');
insert into company (id,name) values ( 34,'OMRON');
insert into company (id,name) values ( 35,'BBN Technologies');
insert into company (id,name) values ( 36,'Lenovo Group');
insert into company (id,name) values ( 37,'ASUS');
insert into company (id,name) values ( 38,'Amstrad');
insert into company (id,name) values ( 39,'Sun Microsystems');
insert into company (id,name) values ( 40,'Texas Instruments');
insert into company (id,name) values ( 41,'HTC Corporation');
insert into company (id,name) values ( 42,'Research In Motion');
insert into company (id,name) values ( 43,'Samsung Electronics');
insert into computer (id,name,introduced,discontinued,company_id) values ( 1,'MacBook Pro 15.4 inch',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 2,'CM-2a',null,null,2);
insert into computer (id,name,introduced,discontinued,company_id) values ( 3,'CM-200',null,null,2);
insert into computer (id,name,introduced,discontinued,company_id) values ( 4,'CM-5e',null,null,2);
insert into computer (id,name,introduced,discontinued,company_id) values ( 5,'CM-5','1991-01-01',null,2);
insert into computer (id,name,introduced,discontinued,company_id) values ( 6,'MacBook Pro','2006-01-10',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 7,'Apple IIe',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 8,'Apple IIc',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 9,'Apple IIGS',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 10,'Apple IIc Plus',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 11,'Apple II Plus',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 12,'Apple III','1980-05-01','1984-04-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 13,'Apple Lisa',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 14,'CM-2',null,null,2);
insert into computer (id,name,introduced,discontinued,company_id) values ( 15,'Connection Machine','1987-01-01',null,2);
insert into computer (id,name,introduced,discontinued,company_id) values ( 16,'Apple II','1977-04-01','1993-10-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 17,'Apple III Plus','1983-12-01','1984-04-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 18,'COSMAC ELF',null,null,3);
insert into computer (id,name,introduced,discontinued,company_id) values ( 19,'COSMAC VIP','1977-01-01',null,3);
insert into computer (id,name,introduced,discontinued,company_id) values ( 20,'ELF II','1977-01-01',null,4);
insert into computer (id,name,introduced,discontinued,company_id) values ( 21,'Macintosh','1984-01-24',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 22,'Macintosh II',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 23,'Macintosh Plus','1986-01-16','1990-10-15',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 24,'Macintosh IIfx',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 25,'iMac','1998-01-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 26,'Mac Mini','2005-01-22',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 27,'Mac Pro','2006-08-07',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 28,'Power Macintosh','1994-03-01','2006-08-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 29,'PowerBook','1991-01-01','2006-01-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 30,'Xserve',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 31,'Powerbook 100',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 32,'Powerbook 140',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 33,'Powerbook 170',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 34,'PowerBook Duo',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 35,'PowerBook 190',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 36,'Macintosh Quadra','1991-01-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 37,'Macintosh Quadra 900',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 38,'Macintosh Quadra 700',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 39,'Macintosh LC','1990-01-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 40,'Macintosh LC II','1990-01-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 41,'Macintosh LC III','1993-01-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 42,'Macintosh LC III+',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 43,'Macintosh Quadra 605','1993-10-21',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 44,'Macintosh LC 500 series',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 45,'TRS-80 Color Computer','1980-01-01',null,5);
insert into computer (id,name,introduced,discontinued,company_id) values ( 46,'Acorn System 2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 47,'Dragon 32/64',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 48,'MEK6800D2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 49,'Newbear 77/68',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 50,'Commodore PET',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 51,'Commodore 64','1982-08-01','1994-01-01',6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 52,'Commodore 64C',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 53,'Commodore SX-64',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 54,'Commodore 128',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 55,'Apple I','1976-04-01','1977-10-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 56,'KIM-1','1975-01-01',null,7);
insert into computer (id,name,introduced,discontinued,company_id) values ( 57,'Altair 8800','1974-12-19',null,8);
insert into computer (id,name,introduced,discontinued,company_id) values ( 58,'IMSAI 8080','1975-08-01',null,9);
insert into computer (id,name,introduced,discontinued,company_id) values ( 59,'IMSAI Series Two',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 60,'VAX','1977-10-25',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values ( 61,'VAX 11/780','1977-10-25',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values ( 62,'VAX 11/750','1980-10-01',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values ( 63,'TX-2','1958-01-01',null,11);
insert into computer (id,name,introduced,discontinued,company_id) values ( 64,'TX-0','1956-01-01',null,11);
insert into computer (id,name,introduced,discontinued,company_id) values ( 65,'Whirlwind','1951-04-20',null,11);
insert into computer (id,name,introduced,discontinued,company_id) values ( 66,'ENIAC','1946-02-15','1955-10-02',12);
insert into computer (id,name,introduced,discontinued,company_id) values ( 67,'IBM PC','1981-08-12',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values ( 68,'Macintosh Classic',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 69,'Macintosh Classic II','1991-01-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 70,'Amiga','1985-01-01',null,14);
insert into computer (id,name,introduced,discontinued,company_id) values ( 71,'Amiga 1000',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 72,'Amiga 500','1987-01-01',null,6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 73,'Amiga 500+',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 74,'Amiga 2000','1986-01-01','1990-01-01',6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 75,'Amiga 3000',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 76,'Amiga 600','1992-03-01',null,6);
insert into computer (id,name,introduced,discontinued,company_id) values ( 77,'Macintosh 128K','1984-01-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 78,'Macintosh 512K','1984-09-10','1986-04-14',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 79,'Macintosh SE','1987-03-02','1989-08-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 80,'Macintosh SE/30','1989-01-19','1991-10-21',1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 81,'Canon Cat','1987-01-01',null,15);
insert into computer (id,name,introduced,discontinued,company_id) values ( 82,'Nokia 770',null,null,16);
insert into computer (id,name,introduced,discontinued,company_id) values ( 83,'Nokia N800','2007-01-01',null,16);
insert into computer (id,name,introduced,discontinued,company_id) values ( 84,'Mylo','2006-09-21',null,17);
insert into computer (id,name,introduced,discontinued,company_id) values ( 85,'OQO 02','2007-01-01',null,18);
insert into computer (id,name,introduced,discontinued,company_id) values ( 86,'OQO 01+',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 87,'Pinwheel calculator',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 88,'iBook',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 89,'MacBook','2006-05-16',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values ( 90,'NeXTstation','1990-01-01','1993-01-01',19);
insert into computer (id,name,introduced,discontinued,company_id) values ( 91,'NeXTcube','1988-01-01','1993-01-01',19);
insert into computer (id,name,introduced,discontinued,company_id) values ( 92,'NeXTstation Color Turbo',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 93,'NeXTstation Color',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 94,'NeXTstation Turbo',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 95,'NeXTcube Turbo',null,null,19);
insert into computer (id,name,introduced,discontinued,company_id) values ( 96,'NeXTcube 040',null,null,19);
insert into computer (id,name,introduced,discontinued,company_id) values ( 97,'NeXTcube 030',null,null,19);
insert into computer (id,name,introduced,discontinued,company_id) values ( 98,'Tinkertoy Tic-Tac-Toe Computer',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values ( 99,'Z3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (100,'Z4',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (101,'Z1',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (102,'Z2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (103,'Wang 2200','1973-05-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (104,'Wang VS',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (105,'Wang OIS',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (106,'BBC Micro',null,null,22);
insert into computer (id,name,introduced,discontinued,company_id) values (107,'IBM 650','1953-01-01','1962-01-01',13);
insert into computer (id,name,introduced,discontinued,company_id) values (108,'Cray-1',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (109,'Cray-3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (110,'Cray-2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (111,'Cray-4',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (112,'Cray X1',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (113,'Cray XD1',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (114,'Cray T3D','1993-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (115,'Cray T3E','1995-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (116,'Cray C90',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (117,'Cray T90',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (118,'Cray SV1',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (119,'Cray J90',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (120,'Cray XT3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (121,'Cray CS6400',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (122,'Atari ST','1985-01-01','1993-01-01',20);
insert into computer (id,name,introduced,discontinued,company_id) values (123,'Amiga 2500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (124,'Amiga 2500',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (125,'Amiga 4000',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (126,'Amiga 3000UX',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (127,'Amiga 3000T',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (128,'Amiga 4000T',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (129,'Amiga 1200','1992-10-01','1996-01-01',6);
insert into computer (id,name,introduced,discontinued,company_id) values (130,'Atari 1040 STf','1986-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (131,'Atari 520 ST','1985-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (132,'Atari 520 STfm','1986-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (133,'Atari 1040 STe','1989-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (134,'Atari MEGA STe','1991-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (135,'Atari 520 ST+','1985-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (136,'Atari 520 STm','1985-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (137,'Atari 130 ST','1985-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (138,'Atari 260 ST','1985-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (139,'Atari MEGA ST','1987-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (140,'Atari 520 STf','1986-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (141,'Atari 1040 STfm','1986-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (142,'Atari 2080 ST','1986-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (143,'Atari 260 ST+','1985-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (144,'Atari 4160 STe','1988-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (145,'TRS-80 Color Computer 2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (146,'TRS-80 Color Computer 3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (147,'TRS-80 Model 1','1977-01-01',null,5);
insert into computer (id,name,introduced,discontinued,company_id) values (148,'Timex Sinclair 2068','1983-11-01','1984-04-01',23);
insert into computer (id,name,introduced,discontinued,company_id) values (149,'ZX Spectrum','1982-01-01',null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (150,'Xerox Star','1981-01-01',null,26);
insert into computer (id,name,introduced,discontinued,company_id) values (151,'Xerox Alto',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (152,'Acorn Archimedes',null,null,22);
insert into computer (id,name,introduced,discontinued,company_id) values (153,'Nintendo Entertainment System',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (154,'Super Nintendo Entertainment System','1991-08-01','1999-01-01',24);
insert into computer (id,name,introduced,discontinued,company_id) values (155,'Super Famicom',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (156,'Nintendo GameCube',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (157,'Game Boy line',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (158,'PlayStation','1994-12-03',null,17);
insert into computer (id,name,introduced,discontinued,company_id) values (159,'PlayStation 2','2000-03-24',null,17);
insert into computer (id,name,introduced,discontinued,company_id) values (160,'Game & Watch',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (161,'EDSAC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (162,'IBM System/4 Pi',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (163,'IBM AP-101',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (164,'IBM TC-1',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (165,'IBM AP-101B',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (166,'IBM AP-101S',null,null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (167,'ProLiant',null,null,27);
insert into computer (id,name,introduced,discontinued,company_id) values (168,'Http://nepomuk.semanticdesktop.org/xwiki/',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (169,'Sinclair QL','1984-01-01','1986-01-01',25);
insert into computer (id,name,introduced,discontinued,company_id) values (170,'Sinclair ZX81','1981-01-01',null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (171,'Sinclair ZX80',null,null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (172,'Atari 65XE',null,null,20);
insert into computer (id,name,introduced,discontinued,company_id) values (173,'Deep Blue',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (174,'Macintosh Quadra 650',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (175,'Macintosh Quadra 610',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (176,'Macintosh Quadra 800',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (177,'Macintosh Quadra 950',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (178,'PowerBook 160',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (179,'PowerBook 145B',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (180,'PowerBook 170',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (181,'PowerBook 145',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (182,'PowerBook G3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (183,'PowerBook 140',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (184,'Macintosh IIcx',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (185,'Powerbook 180',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (186,'PowerBook G4',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (187,'Macintosh XL',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (188,'PowerBook 100',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (189,'PowerBook 2400c',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (190,'PowerBook 1400',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (191,'Macintosh Quadra 630',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (192,'Macintosh Quadra 660AV',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (193,'Macintosh Quadra 840AV',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (194,'PowerBook 5300',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (195,'PowerBook 3400c',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (196,'Macintosh Color Classic',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (197,'Macintosh 512Ke',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (198,'Macintosh IIsi',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (199,'Macintosh IIx',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (200,'PowerBook 500 series',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (201,'Power Macintosh G3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (202,'Macintosh IIci',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (203,'iMac G5','2004-08-31',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (204,'Power Mac G4',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (205,'Power Macintosh 7100',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (206,'Power Macintosh 9600',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (207,'Power Macintosh 7200',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (208,'Power Macintosh 7300',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (209,'Power Macintosh 8600',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (210,'Power Macintosh 6200',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (211,'Power Macintosh 8100',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (212,'Compact Macintosh',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (213,'Power Macintosh 4400',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (214,'Power Macintosh 9500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (215,'Macintosh Portable',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (216,'EMac',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (217,'Power Macintosh 7600',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (218,'Power Mac G5',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (219,'Power Macintosh 7500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (220,'Power Macintosh 6100',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (221,'Power Macintosh 8500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (222,'Macintosh IIvi',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (223,'Macintosh IIvx',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (224,'IMac G3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (225,'IMac G4',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (226,'Power Mac G4 Cube',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (227,'Intel iMac',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (228,'Deep Thought',null,null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (229,'Wii','2006-11-19',null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (230,'IBM System x',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (231,'IBM System i','2006-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (232,'IBM System z','2006-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (233,'IBM System p','2000-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (234,'LC 575',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (235,'Macintosh TV',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (236,'Macintosh Performa',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (237,'Macintosh II series',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (238,'Power Macintosh 6400',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (239,'Power Macintosh 6500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (240,'Apple PenLite',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (241,'Wallstreet',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (242,'Twentieth Anniversary Macintosh',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (243,'Power Macintosh 5500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (244,'iBook G3',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (245,'Power Macintosh 5200 LC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (246,'Power Macintosh 5400',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (247,'CM-1',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (248,'MSX','1983-01-01','1995-01-01',28);
insert into computer (id,name,introduced,discontinued,company_id) values (249,'PlayStation 3',null,null,17);
insert into computer (id,name,introduced,discontinued,company_id) values (250,'MSX2','1986-01-01',null,29);
insert into computer (id,name,introduced,discontinued,company_id) values (251,'MSX2+','1988-01-01',null,30);
insert into computer (id,name,introduced,discontinued,company_id) values (252,'MSX turbo R','1990-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (253,'Panasonic FS A1GT',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (254,'Panasonic FS A1ST',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (255,'PDP-11',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (256,'PDP-1',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (257,'PDP-10',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (258,'PDP-8',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (259,'PDP-6',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (260,'DECSYSTEM-20',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (261,'PDP-7',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (262,'PDP-5',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (263,'PDP-12',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (264,'LINC',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (265,'PDP-14',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (266,'PDP-15',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (267,'PDP-16',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (268,'Cray X2','2007-01-01',null,31);
insert into computer (id,name,introduced,discontinued,company_id) values (269,'Cray X-MP','1982-01-01',null,31);
insert into computer (id,name,introduced,discontinued,company_id) values (270,'Evans & Sutherland ES-1',null,null,32);
insert into computer (id,name,introduced,discontinued,company_id) values (271,'Commodore VIC-20','1980-01-01',null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (272,'PowerBook 150',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (273,'MacBook Air','2008-01-15',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (274,'Digi-Comp I','1963-01-01',null,33);
insert into computer (id,name,introduced,discontinued,company_id) values (275,'Digi-Comp',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (276,'Digi-Comp II',null,null,33);
insert into computer (id,name,introduced,discontinued,company_id) values (277,'Manchester Mark I','1949-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (278,'Small-Scale Experimental Machine','1948-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (279,'Nintendo 64',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (280,'Game Boy Advance',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (281,'Game Boy',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (282,'Nintendo DS Lite',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (283,'Nintendo DS','2004-01-01',null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (284,'Game Boy Color',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (285,'Game Boy Advance SP',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (286,'Virtual Boy',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (287,'Game Boy Micro',null,null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (288,'Roadrunner',null,null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (289,'HP 9000',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (290,'OMRON Luna-88K2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (291,'OMRON Luna-88K',null,null,34);
insert into computer (id,name,introduced,discontinued,company_id) values (292,'Motorola series 900',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (293,'Motorola M8120',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (294,'Triton Dolphin System 100',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (295,'BBN TC2000','1989-08-01',null,35);
insert into computer (id,name,introduced,discontinued,company_id) values (296,'WRT54G',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (297,'ThinkPad','1992-01-01',null,36);
insert into computer (id,name,introduced,discontinued,company_id) values (298,'Apple Newton','1993-01-01','1998-01-01',1);
insert into computer (id,name,introduced,discontinued,company_id) values (299,'Atanasoff-Berry Computer','1937-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (300,'Atlas Computer','1962-01-01','1974-01-01',null);
insert into computer (id,name,introduced,discontinued,company_id) values (301,'ASUS Eee PC 901',null,null,37);
insert into computer (id,name,introduced,discontinued,company_id) values (302,'ASUS Eee PC 701',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (303,'IBM 7030','1961-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (304,'System/38','1979-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (305,'System/36','1983-01-01','2000-01-01',13);
insert into computer (id,name,introduced,discontinued,company_id) values (306,'IBM 7090','1959-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (307,'IBM RT',null,null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (308,'System/360','1964-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (309,'IBM 801','1980-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (310,'IBM 1401','1959-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (311,'ASCI White','2001-01-01','2006-01-01',13);
insert into computer (id,name,introduced,discontinued,company_id) values (312,'Blue Gene',null,null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (313,'ASCI Blue Pacific','1998-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (314,'iPhone','2007-06-01',null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (315,'Nokia N810','2007-10-17',null,16);
insert into computer (id,name,introduced,discontinued,company_id) values (316,'EDSAC 2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (317,'Titan',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (318,'Pilot ACE',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (319,'HP Mini 1000','2008-10-29',null,27);
insert into computer (id,name,introduced,discontinued,company_id) values (320,'HP 2133 Mini-Note PC','2008-04-15',null,27);
insert into computer (id,name,introduced,discontinued,company_id) values (321,'Kogan Agora Pro','2008-12-04',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (322,'D-Series Machines',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (323,'ZX Spectrum 48K','1982-01-01',null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (324,'ZX Spectrum 16K','1982-01-01',null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (325,'ZX Spectrum 128','1985-09-01',null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (326,'ZX Spectrum +3',null,null,38);
insert into computer (id,name,introduced,discontinued,company_id) values (327,'ZX Spectrum +2','1986-01-01',null,38);
insert into computer (id,name,introduced,discontinued,company_id) values (328,'ZX Spectrum +2A','1987-01-01',null,38);
insert into computer (id,name,introduced,discontinued,company_id) values (329,'ZX Spectrum +','1984-06-01',null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (330,'Acer Extensa',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (331,'Acer Extensa 5220',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (332,'Dell Latitude',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (333,'Toshiba Satellite',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (334,'Timex Sinclair 2048',null,null,23);
insert into computer (id,name,introduced,discontinued,company_id) values (335,'Sprinter',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (336,'Timex Computer 2048',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (337,'Pentagon',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (338,'Belle',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (339,'Loki',null,null,25);
insert into computer (id,name,introduced,discontinued,company_id) values (340,'Hobbit',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (341,'NeXT Computer',null,null,19);
insert into computer (id,name,introduced,discontinued,company_id) values (342,'TRS-80',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (343,'TRS-80 Model 2','1980-01-01',null,5);
insert into computer (id,name,introduced,discontinued,company_id) values (344,'TRS-80 Model 3',null,null,5);
insert into computer (id,name,introduced,discontinued,company_id) values (345,'STacy','1989-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (346,'ST BOOK','1990-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (347,'Atari 520 STE','1989-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (348,'Amiga 2000 Model A',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (349,'Amiga 2000 Model B',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (350,'Amiga 2000 Model C',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (351,'IBM 3270',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (352,'CALDIC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (353,'Modbook',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (354,'Compaq SystemPro',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (355,'ARRA',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (356,'IBM System Cluster 1350',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (357,'Finite element machine',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (358,'ES7000',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (359,'HP MediaSmart Server',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (360,'HP Superdome',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (361,'IBM Power Systems','2008-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (362,'Oslo Analyzer',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (363,'Microsoft Softcard',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (364,'WITCH',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (365,'Analytical engine',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (366,'EDVAC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (367,'BINAC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (368,'Earth Simulator',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (369,'BARK',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (370,'Harvard Mark I','1944-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (371,'ILLIAC IV',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (372,'ILLIAC II',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (373,'ILLIAC III',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (374,'Water integrator',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (375,'CSIRAC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (376,'System X',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (377,'Harvest',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (378,'ChipTest',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (379,'HiTech',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (380,'Bomba',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (381,'ACE',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (382,'ASCI Red',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (383,'ASCI Thors Hammer',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (384,'ASCI Purple','2005-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (385,'ASCI Blue Mountain',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (386,'Columbia',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (387,'HP Integrity',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (388,'APEXC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (389,'Datasaab D2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (390,'BRLESC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (391,'DYSEAC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (392,'SSEC','1948-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (393,'Hydra',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (394,'FUJIC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (395,'RAYDAC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (396,'Harvard Mark III',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (397,'DATAR',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (398,'ReserVec',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (399,'DASK',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (400,'UTEC',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (401,'DRTE Computer',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (402,'PowerEdge',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (403,'Apple Network Server',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (404,'Goodyear MPP',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (405,'Macintosh 128K technical details',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (406,'Power Macintosh G3',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (407,'CER-10',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (408,'CER-20',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (409,'IBM BladeCenter','2002-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (410,'Wisconsin Integrally Synchronized Computer',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (411,'Amstrad CPC',null,null,38);
insert into computer (id,name,introduced,discontinued,company_id) values (412,'Amstrad CPC 6128',null,null,38);
insert into computer (id,name,introduced,discontinued,company_id) values (413,'Amstrad CPC 664',null,null,38);
insert into computer (id,name,introduced,discontinued,company_id) values (414,'Amstrad CPC 464',null,null,38);
insert into computer (id,name,introduced,discontinued,company_id) values (415,'Intergraph',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (416,'Enterprise',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (417,'MTX500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (418,'Acorn Electron',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (419,'Sony Vaio P','2009-02-01',null,17);
insert into computer (id,name,introduced,discontinued,company_id) values (420,'VAIO',null,null,17);
insert into computer (id,name,introduced,discontinued,company_id) values (421,'Sony Vaio P VGN-P588E/Q',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (422,'Sony Vaio P VGN-P530H/G',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (423,'Sony Vaio P VGN-P530H/W',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (424,'Sony Vaio P VGN-P530H/Q',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (425,'Sony Vaio P VGN-P530H/R',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (426,'Sony Vaio P VGN-P588E/R',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (427,'Sony Vaio P VGN-P598E/Q',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (428,'Timex Sinclair 1000','1982-07-01',null,23);
insert into computer (id,name,introduced,discontinued,company_id) values (429,'Komputer 2086',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (430,'Galaksija',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (431,'Vector-06C',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (432,'Elektronika BK',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (433,'Sun386i',null,null,39);
insert into computer (id,name,introduced,discontinued,company_id) values (434,'Xerox Daybreak','1985-01-01','1989-01-01',null);
insert into computer (id,name,introduced,discontinued,company_id) values (435,'Xerox NoteTaker',null,null,26);
insert into computer (id,name,introduced,discontinued,company_id) values (436,'D4a','1965-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (437,'LGP-30',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (438,'LGP-21',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (439,'ASUS Eee PC 900','2008-05-01',null,37);
insert into computer (id,name,introduced,discontinued,company_id) values (440,'Atari TT030',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (441,'Bi Am ZX-Spectrum 48/64',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (442,'Bi Am ZX-Spectrum 128',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (443,'PlayStation Portable',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (444,'MSI Wind Netbook',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (445,'Sharp Mebius NJ70A','2009-04-21',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (446,'HTC Snap',null,null,41);
insert into computer (id,name,introduced,discontinued,company_id) values (447,'Commodore Educator 64',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (448,'Amiga 1500',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (449,'Commodore 65',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (450,'Commodore 16',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (451,'Commodore CBM-II',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (452,'Commodore Plus/4',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (453,'Commodore LCD',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (454,'Commodore MAX Machine',null,null,6);
insert into computer (id,name,introduced,discontinued,company_id) values (455,'Aster CT-80',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (456,'Test','2009-01-01','2009-01-01',null);
insert into computer (id,name,introduced,discontinued,company_id) values (457,'MSI GX723',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (458,'Eee PC 1000HV','2009-05-22',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (459,'VTech Laser 200','1983-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (460,'CrunchPad',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (461,'Neo Geo','1990-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (462,'Sega Mega Drive',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (463,'Sega Master System',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (464,'TurboGrafx-16',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (465,'Sun-3',null,null,39);
insert into computer (id,name,introduced,discontinued,company_id) values (466,'Pleiades',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (467,'IBM Sequoia',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (468,'Inves Spectrum 48k plus',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (469,'iPhone 3G',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (470,'iPhone 3GS',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (471,'Beagle Board',null,null,40);
insert into computer (id,name,introduced,discontinued,company_id) values (472,'HP nPar',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (473,'MacBook Family',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (474,'Reservisor',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (475,'BladeSystem',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (476,'lenovo thinkpad t60p',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (477,'lenovo thinkpad x200',null,null,36);
insert into computer (id,name,introduced,discontinued,company_id) values (478,'lenovo thinkpad t60',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (479,'lenovo thinkpad w700',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (480,'lenovo thinkpad t41',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (481,'lenovo thinkpad z61p',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (482,'lenovo thinkpad x61s',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (483,'lenovo thinkpad t43',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (484,'lenovo thinkpad r400',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (485,'lenovo thinkpad x60s',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (486,'lenovo thinkpad x301',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (487,'lenovo thinkpad t42',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (488,'lenovo thinkpad r61',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (489,'lenovo thinkpad w500',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (490,'lenovo thinkpad sl400',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (491,'lenovo thinkpad x40',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (492,'lenovo thinkpad x200 tablet',null,null,36);
insert into computer (id,name,introduced,discontinued,company_id) values (493,'lenovo thinkpad t400s',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (494,'Nokia N900','2009-10-01',null,16);
insert into computer (id,name,introduced,discontinued,company_id) values (495,'Internet Tablet',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (496,'Meiko Computing Surface','1986-01-01','1993-01-01',null);
insert into computer (id,name,introduced,discontinued,company_id) values (497,'CS-2',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (498,'IBM 701','1952-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (499,'IBM 5100','1975-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (500,'AN/FSQ-7','1958-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (501,'AN/FSQ-32','1960-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (502,'IBM CPC','1949-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (503,'System/34','1978-01-01','1983-01-01',13);
insert into computer (id,name,introduced,discontinued,company_id) values (504,'System/32','1975-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (505,'System/3','1969-01-01','1985-01-01',13);
insert into computer (id,name,introduced,discontinued,company_id) values (506,'IBM 305','1956-01-01',null,13);
insert into computer (id,name,introduced,discontinued,company_id) values (507,'English Electric DEUCE',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (508,'CER-203',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (509,'CER-22',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (510,'Kentucky Linux Athlon Testbed',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (511,'QNAP TS-101',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (512,'iPad','2010-01-01','2011-03-02',1);
insert into computer (id,name,introduced,discontinued,company_id) values (513,'iPhone 2G',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (514,'Inslaw',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (515,'WePad','2010-07-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (516,'MacBook Parts',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (517,'MacBook 13-inch Core 2 Duo 2.13GHz (MC240LL/A) DDR2 Model',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (518,'MacBook 13-inch Core 2 Duo 2.13GHz (MC240T/A) DDR2 Model',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (519,'MacBook 13-inch Core 2 Duo 2.13GHz (MC240X/A) DDR2 Model',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (520,'MacBook 13-inch Core 2 Duo 2.26GHz (Unibody MC207LL/A) DDR3 Model',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (521,'MC240LL/A',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (522,'D.K.COMMUNICATION',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (523,'iPhone 4',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (524,'Nintendo 3DS','2010-03-23',null,24);
insert into computer (id,name,introduced,discontinued,company_id) values (525,'ASUS Eee PC 1005PE','2010-01-01',null,37);
insert into computer (id,name,introduced,discontinued,company_id) values (526,'National Law Enforcement System',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (527,'BlackBerry PlayBook',null,null,42);
insert into computer (id,name,introduced,discontinued,company_id) values (528,'Barnes & Noble nook','2009-10-20',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (529,'SAM Coupé',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (530,'HTC Dream','2008-10-22',null,41);
insert into computer (id,name,introduced,discontinued,company_id) values (531,'Samsung Galaxy Tab','2010-09-02',null,43);
insert into computer (id,name,introduced,discontinued,company_id) values (532,'BlackBerry PlayBook','2010-09-27',null,42);
insert into computer (id,name,introduced,discontinued,company_id) values (533,'Tianhe-I',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (534,'Kno',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (535,'ThinkPad 701 C',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (536,'ThinkPad 340 CSE',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (537,'ThinkPad 755 CX',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (538,'ThinkPad 755 CE',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (539,'ThinkPad 370 C',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (540,'Coleco Adam','1983-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (541,'Nebulae',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (542,'Alex eReader',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (543,'Acer Iconia',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (544,'Archos 101',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (545,'Fujitsu Lifebook T900',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (546,'Motorola Xoom',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (547,'ViewSonic G Tablet',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (548,'DEC Professional','1982-01-01',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (549,'DEC Multia','1994-11-07',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (550,'DEC Firefly',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (551,'DEC 3000 AXP',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (552,'DEC 2000 AXP','1993-05-25',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (553,'DEC 4000 AXP','1992-11-10',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (554,'DEC 7000/10000 AXP','1992-11-10',null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (555,'DEC Professional 350',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (556,'DEC Rainbow 100',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (557,'DEC Professional 325',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (558,'DECmate II',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (559,'DECmate',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (560,'DECsystem',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (561,'NetApp Filer',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (562,'DEC GT40',null,null,10);
insert into computer (id,name,introduced,discontinued,company_id) values (563,'ecoATM',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (564,'MindWave BrainCubed Education Bundle',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (565,'PalmPilot',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (566,'Upcoming iPhone 5',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (567,'Dell Inspiron 560 Desktop Computer ',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (568,'IPad 2',null,null,1);
insert into computer (id,name,introduced,discontinued,company_id) values (569,'HP TouchPad','2011-02-09',null,27);
insert into computer (id,name,introduced,discontinued,company_id) values (570,'HP Veer','2011-02-09',null,27);
insert into computer (id,name,introduced,discontinued,company_id) values (571,'Lenovo Thinkpad Edge 11',null,null,36);
insert into computer (id,name,introduced,discontinued,company_id) values (572,'Dell Vostro',null,null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (573,'Gateway LT3103U','2008-01-01',null,null);
insert into computer (id,name,introduced,discontinued,company_id) values (574,'iPhone 4S','2011-10-14',null,1);
# --- !Downs
delete from computer;
delete from company;
<!--
~ Copyright (C) 2009-2016 Lightbend Inc. <https://www.lightbend.com>
-->
<!-- The default logback configuration that Play uses if no other configuration is provided -->
<configuration>
<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${application.home:-.}/logs/application.log</file>
<encoder>
<pattern>%date [%level] from %logger in %thread - %message%n%xException</pattern>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%coloredLevel %logger{15} - %message%n%xException{10}</pattern>
</encoder>
</appender>
<appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="STDOUT" />
</appender>
<logger name="play" level="INFO" />
<logger name="application" level="DEBUG" />
<logger name="com.gargoylesoftware.htmlunit" level="ERROR" />
<logger name="org.apache.http.client.protocol" level="ERROR" />
<root level="WARN">
<appender-ref ref="ASYNCFILE" />
<appender-ref ref="ASYNCSTDOUT" />
</root>
</configuration>
# Messages
computers.list.title={0,choice,0#No computers|1#One computer|1<{0,number,integer} computers} found
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Default path will just redirect to the computer list
GET / controllers.HomeController.index()
# Computers list (look at the default values for pagination parameters)
GET /computers controllers.HomeController.list(p:Int ?= 0, s ?= "name", o ?= "asc", f ?= "")
# Add computer
GET /computers/new controllers.HomeController.create()
POST /computers controllers.HomeController.save()
# Edit existing computer
GET /computers/:id controllers.HomeController.edit(id:Long)
POST /computers/:id controllers.HomeController.update(id:Long)
# Delete a computer
POST /computers/:id/delete controllers.HomeController.delete(id:Long)
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.13")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.1.0")
html,body{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;}
table{border-collapse:collapse;border-spacing:0;}
ol,ul{list-style:none;}
q:before,q:after,blockquote:before,blockquote:after{content:"";}
html{overflow-y:scroll;font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
a:focus{outline:thin dotted;}
a:hover,a:active{outline:0;}
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
audio:not([controls]){display:none;}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
sup{top:-0.5em;}
sub{bottom:-0.25em;}
img{border:0;-ms-interpolation-mode:bicubic;}
button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;}
button,input{line-height:normal;*overflow:visible;}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
textarea{overflow:auto;vertical-align:top;}
html,body{background-color:#ffffff;}
body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:18px;color:#404040;}
.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;*display:inline;}
.container:after{clear:both;}
.container-fluid{position:relative;min-width:940px;padding-left:20px;padding-right:20px;zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";zoom:1;*display:inline;}
.container-fluid:after{clear:both;}
.container-fluid>.sidebar{float:left;width:220px;}
.container-fluid>.content{margin-left:240px;}
a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a:hover{color:#00438a;text-decoration:underline;}
.pull-right{float:right;}
.pull-left{float:left;}
.hide{display:none;}
.show{display:block;}
.row{zoom:1;margin-left:-20px;}.row:before,.row:after{display:table;content:"";zoom:1;*display:inline;}
.row:after{clear:both;}
[class*="span"]{display:inline;float:left;margin-left:20px;}
.span1{width:40px;}
.span2{width:100px;}
.span3{width:160px;}
.span4{width:220px;}
.span5{width:280px;}
.span6{width:340px;}
.span7{width:400px;}
.span8{width:460px;}
.span9{width:520px;}
.span10{width:580px;}
.span11{width:640px;}
.span12{width:700px;}
.span13{width:760px;}
.span14{width:820px;}
.span15{width:880px;}
.span16{width:940px;}
.span17{width:1000px;}
.span18{width:1060px;}
.span19{width:1120px;}
.span20{width:1180px;}
.span21{width:1240px;}
.span22{width:1300px;}
.span23{width:1360px;}
.span24{width:1420px;}
.offset1{margin-left:80px;}
.offset2{margin-left:140px;}
.offset3{margin-left:200px;}
.offset4{margin-left:260px;}
.offset5{margin-left:320px;}
.offset6{margin-left:380px;}
.offset7{margin-left:440px;}
.offset8{margin-left:500px;}
.offset9{margin-left:560px;}
.offset10{margin-left:620px;}
.offset11{margin-left:680px;}
.offset12{margin-left:740px;}
.span-one-third{width:300px;}
.span-two-thirds{width:620px;}
.offset-one-third{margin-left:340px;}
.offset-two-thirds{margin-left:660px;}
p{font-size:13px;font-weight:normal;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;}
h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;}
h1{margin-bottom:18px;font-size:30px;line-height:36px;}h1 small{font-size:18px;}
h2{font-size:24px;line-height:36px;}h2 small{font-size:14px;}
h3,h4,h5,h6{line-height:36px;}
h3{font-size:18px;}h3 small{font-size:14px;}
h4{font-size:16px;}h4 small{font-size:12px;}
h5{font-size:14px;}
h6{font-size:13px;color:#bfbfbf;text-transform:uppercase;}
ul,ol{margin:0 0 18px 25px;}
ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
ul{list-style:disc;}
ol{list-style:decimal;}
li{line-height:18px;color:#808080;}
ul.unstyled{list-style:none;margin-left:0;}
dl{margin-bottom:18px;}dl dt,dl dd{line-height:18px;}
dl dt{font-weight:bold;}
dl dd{margin-left:9px;}
hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;}
strong{font-style:inherit;font-weight:bold;}
em{font-style:italic;font-weight:inherit;line-height:inherit;}
.muted{color:#bfbfbf;}
blockquote{margin-bottom:18px;border-left:5px solid #eee;padding-left:15px;}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;}
blockquote small{display:block;font-size:12px;font-weight:300;line-height:18px;color:#bfbfbf;}blockquote small:before{content:'\2014 \00A0';}
address{display:block;line-height:18px;margin-bottom:18px;}
code,pre{padding:0 3px 2px;font-family:Monaco, Andale Mono, Courier New, monospace;font-size:12px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
code{background-color:#fee9cc;color:rgba(0, 0, 0, 0.75);padding:1px 3px;}
pre{background-color:#f5f5f5;display:block;padding:8.5px;margin:0 0 18px;line-height:18px;font-size:12px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;white-space:pre;white-space:pre-wrap;word-wrap:break-word;}
form{margin-bottom:18px;}
fieldset{margin-bottom:18px;padding-top:18px;}fieldset legend{display:block;padding-left:150px;font-size:19.5px;line-height:1;color:#404040;*padding:0 0 5px 145px;*line-height:1.5;}
form .clearfix{margin-bottom:18px;zoom:1;}form .clearfix:before,form .clearfix:after{display:table;content:"";zoom:1;*display:inline;}
form .clearfix:after{clear:both;}
label,input,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:normal;}
label{padding-top:6px;font-size:13px;line-height:18px;float:left;width:130px;text-align:right;color:#404040;}
form .input{margin-left:150px;}
input[type=checkbox],input[type=radio]{cursor:pointer;}
input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
input[type=checkbox],input[type=radio]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:none;}
input[type=file]{background-color:#ffffff;padding:initial;border:initial;line-height:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
input[type=button],input[type=reset],input[type=submit]{width:auto;height:auto;}
select,input[type=file]{height:27px;line-height:27px;*margin-top:4px;}
select[multiple]{height:inherit;}
textarea{height:auto;}
.uneditable-input{background-color:#ffffff;display:block;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;}
:-moz-placeholder{color:#bfbfbf;}
::-webkit-input-placeholder{color:#bfbfbf;}
input,textarea{-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);}
input:focus,textarea:focus{outline:0;border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);}
input[type=file]:focus,input[type=checkbox]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:1px dotted #666;}
form div.clearfix.error{background:#fae5e3;padding:10px 0;margin:-10px 0 10px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}form div.clearfix.error>label,form div.clearfix.error span.help-inline,form div.clearfix.error span.help-block{color:#9d261d;}
form div.clearfix.error input,form div.clearfix.error textarea{border-color:#c87872;-webkit-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);-moz-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);box-shadow:0 0 3px rgba(171, 41, 32, 0.25);}form div.clearfix.error input:focus,form div.clearfix.error textarea:focus{border-color:#b9554d;-webkit-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);-moz-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);box-shadow:0 0 6px rgba(171, 41, 32, 0.5);}
form div.clearfix.error .input-prepend span.add-on,form div.clearfix.error .input-append span.add-on{background:#f4c8c5;border-color:#c87872;color:#b9554d;}
.input-mini,input.mini,textarea.mini,select.mini{width:60px;}
.input-small,input.small,textarea.small,select.small{width:90px;}
.input-medium,input.medium,textarea.medium,select.medium{width:150px;}
.input-large,input.large,textarea.large,select.large{width:210px;}
.input-xlarge,input.xlarge,textarea.xlarge,select.xlarge{width:270px;}
.input-xxlarge,input.xxlarge,textarea.xxlarge,select.xxlarge{width:530px;}
textarea.xxlarge{overflow-y:auto;}
input.span1,textarea.span1,select.span1{display:inline-block;float:none;width:30px;margin-left:0;}
input.span2,textarea.span2,select.span2{display:inline-block;float:none;width:90px;margin-left:0;}
input.span3,textarea.span3,select.span3{display:inline-block;float:none;width:150px;margin-left:0;}
input.span4,textarea.span4,select.span4{display:inline-block;float:none;width:210px;margin-left:0;}
input.span5,textarea.span5,select.span5{display:inline-block;float:none;width:270px;margin-left:0;}
input.span6,textarea.span6,select.span6{display:inline-block;float:none;width:330px;margin-left:0;}
input.span7,textarea.span7,select.span7{display:inline-block;float:none;width:390px;margin-left:0;}
input.span8,textarea.span8,select.span8{display:inline-block;float:none;width:450px;margin-left:0;}
input.span9,textarea.span9,select.span9{display:inline-block;float:none;width:510px;margin-left:0;}
input.span10,textarea.span10,select.span10{display:inline-block;float:none;width:570px;margin-left:0;}
input.span11,textarea.span11,select.span11{display:inline-block;float:none;width:630px;margin-left:0;}
input.span12,textarea.span12,select.span12{display:inline-block;float:none;width:690px;margin-left:0;}
input.span13,textarea.span13,select.span13{display:inline-block;float:none;width:750px;margin-left:0;}
input.span14,textarea.span14,select.span14{display:inline-block;float:none;width:810px;margin-left:0;}
input.span15,textarea.span15,select.span15{display:inline-block;float:none;width:870px;margin-left:0;}
input.span16,textarea.span16,select.span16{display:inline-block;float:none;width:930px;margin-left:0;}
input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#f5f5f5;border-color:#ddd;cursor:not-allowed;}
.actions{background:#f5f5f5;margin-top:18px;margin-bottom:18px;padding:17px 20px 18px 150px;border-top:1px solid #ddd;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.actions .secondary-action{float:right;}.actions .secondary-action a{line-height:30px;}.actions .secondary-action a:hover{text-decoration:underline;}
.help-inline,.help-block{font-size:11px;line-height:18px;color:#bfbfbf;}
.help-inline{padding-left:5px;*position:relative;*top:-5px;}
.help-block{display:block;max-width:600px;}
.inline-inputs{color:#808080;}.inline-inputs span,.inline-inputs input{display:inline-block;}
.inline-inputs input.mini{width:60px;}
.inline-inputs input.small{width:90px;}
.inline-inputs span{padding:0 2px 0 1px;}
.input-prepend input,.input-append input{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
.input-prepend .add-on,.input-append .add-on{position:relative;background:#f5f5f5;border:1px solid #ccc;z-index:2;float:left;display:block;width:auto;min-width:16px;height:18px;padding:4px 4px 4px 5px;margin-right:-1px;font-weight:normal;line-height:18px;color:#bfbfbf;text-align:center;text-shadow:0 1px 0 #ffffff;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
.input-prepend .active,.input-append .active{background:#a9dba9;border-color:#46a546;}
.input-prepend .add-on{*margin-top:1px;}
.input-append input{float:left;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
.input-append .add-on{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;margin-right:0;margin-left:-1px;}
.inputs-list{margin:0 0 5px;width:100%;}.inputs-list li{display:block;padding:0;width:100%;}
.inputs-list label{display:block;float:none;width:auto;padding:0;line-height:18px;text-align:left;white-space:normal;}.inputs-list label strong{color:#808080;}
.inputs-list label small{font-size:11px;font-weight:normal;}
.inputs-list .inputs-list{margin-left:25px;margin-bottom:10px;padding-top:0;}
.inputs-list:first-child{padding-top:6px;}
.inputs-list li+li{padding-top:2px;}
.inputs-list input[type=radio],.inputs-list input[type=checkbox]{margin-bottom:0;}
.form-stacked{padding-left:20px;}.form-stacked fieldset{padding-top:9px;}
.form-stacked legend{padding-left:0;}
.form-stacked label{display:block;float:none;width:auto;font-weight:bold;text-align:left;line-height:20px;padding-top:0;}
.form-stacked .clearfix{margin-bottom:9px;}.form-stacked .clearfix div.input{margin-left:0;}
.form-stacked .inputs-list{margin-bottom:0;}.form-stacked .inputs-list li{padding-top:0;}.form-stacked .inputs-list li label{font-weight:normal;padding-top:0;}
.form-stacked div.clearfix.error{padding-top:10px;padding-bottom:10px;padding-left:10px;margin-top:0;margin-left:-10px;}
.form-stacked .actions{margin-left:-20px;padding-left:20px;}
table{width:100%;margin-bottom:18px;padding:0;border-collapse:separate;*border-collapse:collapse;font-size:13px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}table th,table td{padding:10px 10px 9px;line-height:18px;text-align:left;}
table th{padding-top:9px;font-weight:bold;vertical-align:middle;border-bottom:1px solid #ddd;}
table td{vertical-align:top;}
table th+th,table td+td{border-left:1px solid #ddd;}
table tr+tr td{border-top:1px solid #ddd;}
table tbody tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;}
table tbody tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;}
table tbody tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;}
table tbody tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;}
.zebra-striped tbody tr:nth-child(odd) td{background-color:#f9f9f9;}
.zebra-striped tbody tr:hover td{background-color:#f5f5f5;}
table .header{cursor:pointer;}table .header:after{content:"";float:right;margin-top:7px;border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:hidden;}
table .headerSortUp,table .headerSortDown{background-color:rgba(141, 192, 219, 0.25);text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);}
table .header:hover:after{visibility:visible;}
table .headerSortDown:after,table .headerSortDown:hover:after{visibility:visible;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;}
table .headerSortUp:after{border-bottom:none;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;visibility:visible;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:alpha(opacity=60);-khtml-opacity:0.6;-moz-opacity:0.6;opacity:0.6;}
table .blue{color:#049cdb;border-bottom-color:#049cdb;}
table .headerSortUp.blue,table .headerSortDown.blue{background-color:#ade6fe;}
table .green{color:#46a546;border-bottom-color:#46a546;}
table .headerSortUp.green,table .headerSortDown.green{background-color:#cdeacd;}
table .red{color:#9d261d;border-bottom-color:#9d261d;}
table .headerSortUp.red,table .headerSortDown.red{background-color:#f4c8c5;}
table .yellow{color:#ffc40d;border-bottom-color:#ffc40d;}
table .headerSortUp.yellow,table .headerSortDown.yellow{background-color:#fff6d9;}
table .orange{color:#f89406;border-bottom-color:#f89406;}
table .headerSortUp.orange,table .headerSortDown.orange{background-color:#fee9cc;}
table .purple{color:#7a43b6;border-bottom-color:#7a43b6;}
table .headerSortUp.purple,table .headerSortDown.purple{background-color:#e2d5f0;}
.topbar{height:40px;position:fixed;top:0;left:0;right:0;z-index:10000;overflow:visible;}.topbar a{color:#bfbfbf;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);}
.topbar h3 a:hover,.topbar .brand a:hover,.topbar ul .active>a{background-color:#333;background-color:rgba(255, 255, 255, 0.05);color:#ffffff;text-decoration:none;}
.topbar h3{position:relative;}
.topbar h3 a,.topbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;color:#ffffff;font-size:20px;font-weight:200;line-height:1;}
.topbar p{margin:0;line-height:40px;}.topbar p a:hover{background-color:transparent;color:#ffffff;}
.topbar form{float:left;margin:5px 0 0 0;position:relative;filter:alpha(opacity=100);-khtml-opacity:1;-moz-opacity:1;opacity:1;}
.topbar form.pull-right{float:right;}
.topbar input{background-color:#444;background-color:rgba(255, 255, 255, 0.3);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:normal;font-weight:13px;line-height:1;padding:4px 9px;color:#ffffff;color:rgba(255, 255, 255, 0.75);border:1px solid #111;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.25);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.topbar input:-moz-placeholder{color:#e6e6e6;}
.topbar input::-webkit-input-placeholder{color:#e6e6e6;}
.topbar input:hover{background-color:#bfbfbf;background-color:rgba(255, 255, 255, 0.5);color:#ffffff;}
.topbar input:focus,.topbar input.focused{outline:0;background-color:#ffffff;color:#404040;text-shadow:0 1px 0 #ffffff;border:0;padding:5px 10px;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);}
.topbar-inner,.topbar .fill{background-color:#222;background-color:#222222;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);}
.topbar div>ul,.nav{display:block;float:left;margin:0 10px 0 0;position:relative;left:0;}.topbar div>ul>li,.nav>li{display:block;float:left;}
.topbar div>ul a,.nav a{display:block;float:none;padding:10px 10px 11px;line-height:19px;text-decoration:none;}.topbar div>ul a:hover,.nav a:hover{color:#ffffff;text-decoration:none;}
.topbar div>ul .active>a,.nav .active>a{background-color:#222;background-color:rgba(0, 0, 0, 0.5);}
.topbar div>ul.secondary-nav,.nav.secondary-nav{float:right;margin-left:10px;margin-right:0;}.topbar div>ul.secondary-nav .menu-dropdown,.nav.secondary-nav .menu-dropdown,.topbar div>ul.secondary-nav .dropdown-menu,.nav.secondary-nav .dropdown-menu{right:0;border:0;}
.topbar div>ul a.menu:hover,.nav a.menu:hover,.topbar div>ul li.open .menu,.nav li.open .menu,.topbar div>ul .dropdown-toggle:hover,.nav .dropdown-toggle:hover,.topbar div>ul .dropdown.open .dropdown-toggle,.nav .dropdown.open .dropdown-toggle{background:#444;background:rgba(255, 255, 255, 0.05);}
.topbar div>ul .menu-dropdown,.nav .menu-dropdown,.topbar div>ul .dropdown-menu,.nav .dropdown-menu{background-color:#333;}.topbar div>ul .menu-dropdown a.menu,.nav .menu-dropdown a.menu,.topbar div>ul .dropdown-menu a.menu,.nav .dropdown-menu a.menu,.topbar div>ul .menu-dropdown .dropdown-toggle,.nav .menu-dropdown .dropdown-toggle,.topbar div>ul .dropdown-menu .dropdown-toggle,.nav .dropdown-menu .dropdown-toggle{color:#ffffff;}.topbar div>ul .menu-dropdown a.menu.open,.nav .menu-dropdown a.menu.open,.topbar div>ul .dropdown-menu a.menu.open,.nav .dropdown-menu a.menu.open,.topbar div>ul .menu-dropdown .dropdown-toggle.open,.nav .menu-dropdown .dropdown-toggle.open,.topbar div>ul .dropdown-menu .dropdown-toggle.open,.nav .dropdown-menu .dropdown-toggle.open{background:#444;background:rgba(255, 255, 255, 0.05);}
.topbar div>ul .menu-dropdown li a,.nav .menu-dropdown li a,.topbar div>ul .dropdown-menu li a,.nav .dropdown-menu li a{color:#999;text-shadow:0 1px 0 rgba(0, 0, 0, 0.5);}.topbar div>ul .menu-dropdown li a:hover,.nav .menu-dropdown li a:hover,.topbar div>ul .dropdown-menu li a:hover,.nav .dropdown-menu li a:hover{background-color:#191919;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#292929), to(#191919));background-image:-moz-linear-gradient(top, #292929, #191919);background-image:-ms-linear-gradient(top, #292929, #191919);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #292929), color-stop(100%, #191919));background-image:-webkit-linear-gradient(top, #292929, #191919);background-image:-o-linear-gradient(top, #292929, #191919);background-image:linear-gradient(top, #292929, #191919);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#292929', endColorstr='#191919', GradientType=0);color:#ffffff;}
.topbar div>ul .menu-dropdown .active a,.nav .menu-dropdown .active a,.topbar div>ul .dropdown-menu .active a,.nav .dropdown-menu .active a{color:#ffffff;}
.topbar div>ul .menu-dropdown .divider,.nav .menu-dropdown .divider,.topbar div>ul .dropdown-menu .divider,.nav .dropdown-menu .divider{background-color:#222;border-color:#444;}
.topbar ul .menu-dropdown li a,.topbar ul .dropdown-menu li a{padding:4px 15px;}
li.menu,.dropdown{position:relative;}
a.menu:after,.dropdown-toggle:after{width:0;height:0;display:inline-block;content:"&darr;";text-indent:-99999px;vertical-align:top;margin-top:8px;margin-left:4px;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ffffff;filter:alpha(opacity=50);-khtml-opacity:0.5;-moz-opacity:0.5;opacity:0.5;}
.menu-dropdown,.dropdown-menu{background-color:#ffffff;float:left;display:none;position:absolute;top:40px;z-index:900;min-width:160px;max-width:220px;_width:160px;margin-left:0;margin-right:0;padding:6px 0;zoom:1;border-color:#999;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:0 1px 1px;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.menu-dropdown li,.dropdown-menu li{float:none;display:block;background-color:none;}
.menu-dropdown .divider,.dropdown-menu .divider{height:1px;margin:5px 0;overflow:hidden;background-color:#eee;border-bottom:1px solid #ffffff;}
.topbar .dropdown-menu a,.dropdown-menu a{display:block;padding:4px 15px;clear:both;font-weight:normal;line-height:18px;color:#808080;text-shadow:0 1px 0 #ffffff;}.topbar .dropdown-menu a:hover,.dropdown-menu a:hover{background-color:#dddddd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#eeeeee), to(#dddddd));background-image:-moz-linear-gradient(top, #eeeeee, #dddddd);background-image:-ms-linear-gradient(top, #eeeeee, #dddddd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, #dddddd));background-image:-webkit-linear-gradient(top, #eeeeee, #dddddd);background-image:-o-linear-gradient(top, #eeeeee, #dddddd);background-image:linear-gradient(top, #eeeeee, #dddddd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#dddddd', GradientType=0);color:#404040;text-decoration:none;-webkit-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.025),inset 0 -1px rgba(0, 0, 0, 0.025);}
.open .menu,.dropdown.open .menu,.open .dropdown-toggle,.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);}
.open .menu-dropdown,.dropdown.open .menu-dropdown,.open .dropdown-menu,.dropdown.open .dropdown-menu{display:block;}
.tabs,.pills{margin:0 0 20px;padding:0;list-style:none;zoom:1;}.tabs:before,.pills:before,.tabs:after,.pills:after{display:table;content:"";zoom:1;*display:inline;}
.tabs:after,.pills:after{clear:both;}
.tabs>li,.pills>li{float:left;}.tabs>li>a,.pills>li>a{display:block;}
.tabs{float:left;width:100%;border-bottom:1px solid #ddd;}.tabs>li{position:relative;top:1px;}.tabs>li>a{padding:0 15px;margin-right:2px;line-height:36px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.tabs>li>a:hover{text-decoration:none;background-color:#eee;border-color:#eee #eee #ddd;}
.tabs>li.active>a{color:#808080;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;}
.tabs .menu-dropdown,.tabs .dropdown-menu{top:35px;border-width:1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;}
.tabs a.menu:after,.tabs .dropdown-toggle:after{border-top-color:#999;margin-top:15px;margin-left:5px;}
.tabs li.open.menu .menu,.tabs .open.dropdown .dropdown-toggle{border-color:#999;}
.tabs li.open a.menu:after,.tabs .dropdown.open .dropdown-toggle:after{border-top-color:#555;}
.tab-content{clear:both;}
.pills a{margin:5px 3px 5px 0;padding:0 15px;text-shadow:0 1px 1px #ffffff;line-height:30px;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}.pills a:hover{background:#00438a;color:#ffffff;text-decoration:none;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);}
.pills .active a{background:#0069d6;color:#ffffff;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);}
.tab-content>*,.pill-content>*{display:none;}
.tab-content>.active,.pill-content>.active{display:block;}
.breadcrumb{margin:0 0 18px;padding:7px 14px;background-color:#f5f5f5;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#f5f5f5));background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline;text-shadow:0 1px 0 #ffffff;}
.breadcrumb .divider{padding:0 5px;color:#bfbfbf;}
.breadcrumb .active a{color:#404040;}
.hero-unit{background-color:#f5f5f5;margin-bottom:30px;padding:60px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;}
.hero-unit p{font-size:18px;font-weight:200;line-height:27px;}
footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;}
.page-header{margin-bottom:17px;border-bottom:1px solid #ddd;-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}.page-header h1{margin-bottom:8px;}
.btn.danger,.alert-message.danger,.btn.danger:hover,.alert-message.danger:hover,.btn.error,.alert-message.error,.btn.error:hover,.alert-message.error:hover,.btn.success,.alert-message.success,.btn.success:hover,.alert-message.success:hover,.btn.info,.alert-message.info,.btn.info:hover,.alert-message.info:hover{color:#ffffff;}
.btn.danger,.alert-message.danger,.btn.error,.alert-message.error{background-color:#c43c35;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#c43c35 #c43c35 #882a25;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}
.btn.success,.alert-message.success{background-color:#57a957;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957));background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#57a957 #57a957 #3d773d;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}
.btn.info,.alert-message.info{background-color:#339bb9;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9));background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#339bb9 #339bb9 #22697d;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}
.btn{cursor:pointer;display:inline-block;background-color:#e6e6e6;background-repeat:no-repeat;background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);background-image:-ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);padding:5px 14px 6px;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);color:#333;font-size:13px;line-height:normal;border:1px solid #ccc;border-bottom-color:#bbb;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-webkit-transition:0.1s linear all;-moz-transition:0.1s linear all;-ms-transition:0.1s linear all;-o-transition:0.1s linear all;transition:0.1s linear all;}.btn:hover{background-position:0 -15px;color:#333;text-decoration:none;}
.btn:focus{outline:1px dotted #666;}
.btn.primary{color:#ffffff;background-color:#0064cd;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));background-image:-moz-linear-gradient(top, #049cdb, #0064cd);background-image:-ms-linear-gradient(top, #049cdb, #0064cd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));background-image:-webkit-linear-gradient(top, #049cdb, #0064cd);background-image:-o-linear-gradient(top, #049cdb, #0064cd);background-image:linear-gradient(top, #049cdb, #0064cd);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#0064cd #0064cd #003f81;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}
.btn:active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);}
.btn.disabled{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
.btn[disabled]{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-khtml-opacity:0.65;-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
.btn.large{font-size:15px;line-height:normal;padding:9px 14px 9px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
.btn.small{padding:7px 9px 7px;font-size:11px;}
:root .alert-message,:root .btn{border-radius:0 \0;}
button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;border:0;}
.close{float:right;color:#000000;font-size:20px;font-weight:bold;line-height:13.5px;text-shadow:0 1px 0 #ffffff;filter:alpha(opacity=20);-khtml-opacity:0.2;-moz-opacity:0.2;opacity:0.2;}.close:hover{color:#000000;text-decoration:none;filter:alpha(opacity=40);-khtml-opacity:0.4;-moz-opacity:0.4;opacity:0.4;}
.alert-message{position:relative;padding:7px 15px;margin-bottom:18px;color:#404040;background-color:#eedc94;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));background-image:-moz-linear-gradient(top, #fceec1, #eedc94);background-image:-ms-linear-gradient(top, #fceec1, #eedc94);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));background-image:-webkit-linear-gradient(top, #fceec1, #eedc94);background-image:-o-linear-gradient(top, #fceec1, #eedc94);background-image:linear-gradient(top, #fceec1, #eedc94);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);border-color:#eedc94 #eedc94 #e4c652;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);border-width:1px;border-style:solid;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25);}.alert-message .close{*margin-top:3px;}
.alert-message h5{line-height:18px;}
.alert-message p{margin-bottom:0;}
.alert-message div{margin-top:5px;margin-bottom:2px;line-height:28px;}
.alert-message .btn{-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);box-shadow:0 1px 0 rgba(255, 255, 255, 0.25);}
.alert-message.block-message{background-image:none;background-color:#fdf5d9;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);padding:14px;border-color:#fceec1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}.alert-message.block-message ul,.alert-message.block-message p{margin-right:30px;}
.alert-message.block-message ul{margin-bottom:0;}
.alert-message.block-message li{color:#404040;}
.alert-message.block-message .alert-actions{margin-top:5px;}
.alert-message.block-message.error,.alert-message.block-message.success,.alert-message.block-message.info{color:#404040;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}
.alert-message.block-message.error{background-color:#fddfde;border-color:#fbc7c6;}
.alert-message.block-message.success{background-color:#d1eed1;border-color:#bfe7bf;}
.alert-message.block-message.info{background-color:#ddf4fb;border-color:#c6edf9;}
.pagination{height:36px;margin:18px 0;}.pagination ul{float:left;margin:0;border:1px solid #ddd;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);}
.pagination li{display:inline;}
.pagination a{float:left;padding:0 14px;line-height:34px;border-right:1px solid;border-right-color:#ddd;border-right-color:rgba(0, 0, 0, 0.15);*border-right-color:#ddd;text-decoration:none;}
.pagination a:hover,.pagination .active a{background-color:#c7eefe;}
.pagination .disabled a,.pagination .disabled a:hover{background-color:transparent;color:#bfbfbf;}
.pagination .next a{border:0;}
.well{background-color:#f5f5f5;margin-bottom:20px;padding:19px;min-height:20px;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);}
.modal-backdrop{background-color:#000000;position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;}.modal-backdrop.fade{opacity:0;}
.modal-backdrop,.modal-backdrop.fade.in{filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;}
.modal{position:fixed;top:50%;left:50%;z-index:11000;width:560px;margin:-250px 0 0 -250px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal .close{margin-top:7px;}
.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;}
.modal.fade.in{top:50%;}
.modal-header{border-bottom:1px solid #eee;padding:5px 15px;}
.modal-body{padding:15px;}
.modal-footer{background-color:#f5f5f5;padding:14px 15px 15px;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;zoom:1;margin-bottom:0;}.modal-footer:before,.modal-footer:after{display:table;content:"";zoom:1;*display:inline;}
.modal-footer:after{clear:both;}
.modal-footer .btn{float:right;margin-left:5px;}
.twipsy{display:block;position:absolute;visibility:visible;padding:5px;font-size:11px;z-index:1000;filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;}.twipsy.fade.in{filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;}
.twipsy.above .twipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
.twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
.twipsy.below .twipsy-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
.twipsy.right .twipsy-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;}
.twipsy-inner{padding:3px 8px;background-color:#000000;color:white;text-align:center;max-width:200px;text-decoration:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
.twipsy-arrow{position:absolute;width:0;height:0;}
.popover{position:absolute;top:0;left:0;z-index:1000;padding:5px;display:none;}.popover.above .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;}
.popover.below .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
.popover .arrow{position:absolute;width:0;height:0;}
.popover .inner{background-color:#000000;background-color:rgba(0, 0, 0, 0.8);padding:3px;overflow:hidden;width:280px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);}
.popover .title{background-color:#f5f5f5;padding:9px 15px;line-height:1;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;border-bottom:1px solid #eee;}
.popover .content{background-color:#ffffff;padding:14px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover .content p,.popover .content ul,.popover .content ol{margin-bottom:0;}
.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;}
.label{padding:1px 3px 2px;background-color:#bfbfbf;font-size:9.75px;font-weight:bold;color:#ffffff;text-transform:uppercase;white-space:nowrap;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.label.important{background-color:#c43c35;}
.label.warning{background-color:#f89406;}
.label.success{background-color:#46a546;}
.label.notice{background-color:#62cffc;}
.media-grid{margin-left:-20px;margin-bottom:0;zoom:1;}.media-grid:before,.media-grid:after{display:table;content:"";zoom:1;*display:inline;}
.media-grid:after{clear:both;}
.media-grid li{display:inline;}
.media-grid a{float:left;padding:4px;margin:0 0 20px 20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);}.media-grid a img{display:block;}
.media-grid a:hover{border-color:#0069d6;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);}
\ No newline at end of file
html {
background: #eee;
}
header h1 {
padding: 0.4em 1.1em;
color: white;
font-weight: normal;
font-size: 24px;
}
section#main {
position: relative;
padding: 5em 2em;
border-bottom: 1px solid #ccc;
min-height: 600px;
}
section#main .topRight {
position: absolute;
right: 20px;
top: 70px;
}
table.computers em {
color: #aaa;
}
table.computers .introduced, table.computers .discontinued {
width: 10%;
min-width: 100px;
}
table.computers .company_name {
width: 30%;
min-width: 300px;
}
table.computers .header a {
}
#actions {
position: relative;
}
#actions #add {
position: absolute;
right: 0;
top: 0;
}
#pagination {
position: relative;
}
#pagination ul {
position: absolute;
right: 0;
}
#pagination ul .current a {
color: #666;
}
import org.junit.Test;
import play.api.test.Helpers;
import play.test.WithBrowser;
import static org.fluentlenium.core.filter.FilterConstructor.withText;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
public class BrowserTest extends WithBrowser {
@Test
public void testBrowser() {
browser.goTo("http://localhost:" + Helpers.testServerPort());
assertThat(browser.$("header h1").first().text(), equalTo("Play sample application — Computer database"));
assertThat(browser.$("section h1").first().text(), equalTo("574 computers found"));
assertThat(browser.$("#pagination li.current").first().text(), equalTo("Displaying 1 to 10 of 574"));
browser.$("#pagination li.next a").click();
assertThat(browser.$("#pagination li.current").first().text(), equalTo("Displaying 11 to 20 of 574"));
browser.$("#searchbox").fill().with("Apple");
browser.$("#searchsubmit").click();
assertThat(browser.$("section h1").first().text(), equalTo("13 computers found"));
browser.$("a", withText("Apple II")).click();
assertThat(browser.$("section h1").first().text(), equalTo("Edit computer"));
browser.$("#discontinued").fill().with("10-10-2001");
browser.$("input.primary").click();
assertThat(browser.$("dl.error").size(), equalTo(1));
assertThat(browser.$("dl.error label").first().text() ,equalTo("Discontinued date"));
browser.$("#discontinued").fill().with("xxx");
browser.$("input.primary").click();
assertThat(browser.$("dl.error").size(), equalTo(1));
assertThat(browser.$("dl.error label").first().text(), equalTo("Discontinued date"));
browser.$("#discontinued").fill().with("");
browser.$("input.primary").click();
assertThat(browser.$("section h1").first().text(), equalTo("574 computers found"));
assertThat(browser.$(".alert-message").first().text(), equalTo("Done! Computer Apple II has been updated"));
browser.$("#searchbox").fill().with("Apple");
browser.$("#searchsubmit").click();
browser.$("a", withText("Apple II")).click();
browser.$("input.danger").click();
browser.takeHtmlDump("delete.html");
assertThat(browser.$("section h1").first().text(), equalTo("573 computers found"));
assertThat(browser.$(".alert-message").first().text(), equalTo("Done! Computer has been deleted"));
browser.$("#searchbox").fill().with("Apple");
browser.$("#searchsubmit").click();
assertThat(browser.$("section h1").first().text(), equalTo("12 computers found"));
}
}
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import play.mvc.Result;
import play.test.WithApplication;
import java.util.HashMap;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static play.api.test.CSRFTokenHelper.addCSRFToken;
import static play.test.Helpers.*;
// Use FixMethodOrder to run the tests sequentially
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class FunctionalTest extends WithApplication {
@Test
public void redirectHomePage() {
Result result = route(app, controllers.routes.HomeController.index());
assertThat(result.status()).isEqualTo(SEE_OTHER);
assertThat(result.redirectLocation().get()).isEqualTo("/computers");
}
@Test
public void listComputersOnTheFirstPage() {
Result result = route(app, controllers.routes.HomeController.list(0, "name", "asc", ""));
assertThat(result.status()).isEqualTo(OK);
assertThat(contentAsString(result)).contains("574 computers found");
}
@Test
public void filterComputerByName() {
Result result = route(app, controllers.routes.HomeController.list(0, "name", "asc", "Apple"));
assertThat(result.status()).isEqualTo(OK);
assertThat(contentAsString(result)).contains("13 computers found");
}
@Test
public void createANewComputer() {
Result result = route(app, addCSRFToken(fakeRequest().uri(controllers.routes.HomeController.save().url())));
assertThat(result.status()).isEqualTo(OK);
Map<String, String> data = new HashMap<>();
data.put("name", "FooBar");
data.put("introduced", "badbadbad");
data.put("company.id", "1");
String saveUrl = controllers.routes.HomeController.save().url();
result = route(app, addCSRFToken(fakeRequest().bodyForm(data).method("POST").uri(saveUrl)));
assertThat(result.status()).isEqualTo(BAD_REQUEST);
assertThat(contentAsString(result)).contains("<option value=\"1\" selected=\"selected\">Apple Inc.</option>");
// <input type="text" id="introduced" name="introduced" value="badbadbad" aria-describedby="introduced_info_0 introduced_error_0" aria-invalid="true" class="form-control">
assertThat(contentAsString(result)).contains("<input type=\"text\" id=\"introduced\" name=\"introduced\" value=\"badbadbad\" ");
// <input type="text" id="name" name="name" value="FooBar" aria-describedby="name_info_0" required="true" class="form-control">
assertThat(contentAsString(result)).contains("<input type=\"text\" id=\"name\" name=\"name\" value=\"FooBar\" ");
data.put("introduced", "2011-12-24");
result = route(app, fakeRequest().bodyForm(data).method("POST").uri(saveUrl));
assertThat(result.status()).isEqualTo(SEE_OTHER);
assertThat(result.redirectLocation().get()).isEqualTo("/computers");
assertThat(result.flash().get("success")).isEqualTo("Computer FooBar has been created");
result = route(app, controllers.routes.HomeController.list(0, "name", "asc", "FooBar"));
assertThat(result.status()).isEqualTo(OK);
assertThat(contentAsString(result)).contains("One computer found");
}
}
import io.ebean.PagedList;
import models.Computer;
import org.junit.Test;
import play.Application;
import play.inject.guice.GuiceApplicationBuilder;
import play.test.WithApplication;
import repository.ComputerRepository;
import java.util.Date;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
public class ModelTest extends WithApplication {
@Override
protected Application provideApplication() {
return new GuiceApplicationBuilder().build();
}
private String formatted(Date date) {
return new java.text.SimpleDateFormat("yyyy-MM-dd").format(date);
}
@Test
public void findById() {
final ComputerRepository computerRepository = app.injector().instanceOf(ComputerRepository.class);
final CompletionStage<Optional<Computer>> stage = computerRepository.lookup(21L);
await().atMost(1, SECONDS).until(() ->
assertThat(stage.toCompletableFuture()).isCompletedWithValueMatching(computerOptional -> {
final Computer macintosh = computerOptional.get();
return (macintosh.name.equals("Macintosh") && formatted(macintosh.introduced).equals("1984-01-24"));
})
);
}
@Test
public void pagination() {
final ComputerRepository computerRepository = app.injector().instanceOf(ComputerRepository.class);
CompletionStage<PagedList<Computer>> stage = computerRepository.page(1, 20, "name", "ASC", "");
// Test the completed result
await().atMost(1, SECONDS).until(() ->
assertThat(stage.toCompletableFuture()).isCompletedWithValueMatching(computers ->
computers.getTotalCount() == 574 &&
computers.getTotalPageCount() == 29 &&
computers.getList().size() == 20
)
);
}
}
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({
ModelTest.class,
FunctionalTest.class,
BrowserTest.class
})
public class TestSuite {
// the class remains empty,
// used only as a holder for the above annotations
}
logs
target
build
/.idea
/.idea_modules
/.classpath
/.project
/.settings
/.gradle
/RUNNING_PID
License
-------
Written in 2016 by Lightbend <info@lightbend.com>
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
[<img src="https://img.shields.io/travis/playframework/play-java-starter-example.svg"/>](https://travis-ci.org/playframework/play-java-starter-example)
# play-java-starter-example
This is a starter application that shows how Play works. Please see the documentation at https://www.playframework.com/documentation/latest/Home for more details.
## Running
Run this using [sbt](http://www.scala-sbt.org/). If you downloaded this project from http://www.playframework.com/download then you'll find a prepackaged version of sbt in the project directory:
```
sbt run
```
And then go to http://localhost:9000 to see the running web application.
## Controllers
There are several demonstration files available in this template.
- HomeController.java:
Shows how to handle simple HTTP requests.
- AsyncController.java:
Shows how to do asynchronous programming when handling a request.
- CountController.java:
Shows how to inject a component into a controller and use the component when
handling requests.
## Components
- Module.java:
Shows how to use Guice to bind all the components needed by your application.
- Counter.java:
An example of a component that contains state, in this case a simple counter.
- ApplicationTimer.java:
An example of a component that starts when the application starts and stops
when the application stops.
## Filters
- ExampleFilter.java
A simple filter that adds a header to every response.
\ No newline at end of file
import com.google.inject.AbstractModule;
import java.time.Clock;
import services.ApplicationTimer;
import services.AtomicCounter;
import services.Counter;
/**
* This class is a Guice module that tells Guice how to bind several
* different types. This Guice module is created when the Play
* application starts.
*
* Play will automatically use any class called `Module` that is in
* the root package. You can create modules in other locations by
* adding `play.modules.enabled` settings to the `application.conf`
* configuration file.
*/
public class Module extends AbstractModule {
@Override
public void configure() {
// Use the system clock as the default implementation of Clock
bind(Clock.class).toInstance(Clock.systemDefaultZone());
// Ask Guice to create an instance of ApplicationTimer when the
// application starts.
bind(ApplicationTimer.class).asEagerSingleton();
// Set AtomicCounter as the implementation for Counter.
bind(Counter.class).to(AtomicCounter.class);
}
}
package controllers;
import akka.actor.ActorSystem;
import javax.inject.*;
import akka.actor.Scheduler;
import play.*;
import play.mvc.*;
import java.util.concurrent.Executor;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.TimeUnit;
import scala.concurrent.ExecutionContext;
import scala.concurrent.duration.Duration;
import scala.concurrent.ExecutionContextExecutor;
/**
* This controller contains an action that demonstrates how to write
* simple asynchronous code in a controller. It uses a timer to
* asynchronously delay sending a response for 1 second.
*/
@Singleton
public class AsyncController extends Controller {
private final ActorSystem actorSystem;
private final ExecutionContextExecutor exec;
/**
* @param actorSystem We need the {@link ActorSystem}'s
* {@link Scheduler} to run code after a delay.
* @param exec We need a Java {@link Executor} to apply the result
* of the {@link CompletableFuture} and a Scala
* {@link ExecutionContext} so we can use the Akka {@link Scheduler}.
* An {@link ExecutionContextExecutor} implements both interfaces.
*/
@Inject
public AsyncController(ActorSystem actorSystem, ExecutionContextExecutor exec) {
this.actorSystem = actorSystem;
this.exec = exec;
}
/**
* An action that returns a plain text message after a delay
* of 1 second.
*
* The configuration in the <code>routes</code> file means that this method
* will be called when the application receives a <code>GET</code> request with
* a path of <code>/message</code>.
*/
public CompletionStage<Result> message() {
return getFutureMessage(1, TimeUnit.SECONDS).thenApplyAsync(Results::ok, exec);
}
private CompletionStage<String> getFutureMessage(long time, TimeUnit timeUnit) {
CompletableFuture<String> future = new CompletableFuture<>();
actorSystem.scheduler().scheduleOnce(
Duration.create(time, timeUnit),
() -> future.complete("Hi!"),
exec
);
return future;
}
}
package controllers;
import play.mvc.Controller;
import play.mvc.Result;
import services.Counter;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* This controller demonstrates how to use dependency injection to
* bind a component into a controller class. The class contains an
* action that shows an incrementing count to users. The {@link Counter}
* object is injected by the Guice dependency injection system.
*/
@Singleton
public class CountController extends Controller {
private final Counter counter;
@Inject
public CountController(Counter counter) {
this.counter = counter;
}
/**
* An action that responds with the {@link Counter}'s current
* count. The result is plain text. This action is mapped to
* <code>GET</code> requests with a path of <code>/count</code>
* requests by an entry in the <code>routes</code> config file.
*/
public Result count() {
return ok(Integer.toString(counter.nextCount()));
}
}
package controllers;
import play.mvc.*;
import views.html.*;
import play.Logger;
import play.i18n.*;
public class HomeController extends Controller {
public Result login(){
Messages messages = Http.Context.current().messages();
String user = messages.at ("Username");
String pass = messages.at ("Password");
String log = messages.at ("Login");
return ok(login.render(user,pass,log));
}
public Result index() {
Messages messages = Http.Context.current().messages();
String header = messages.at ("Hello");
Logger.warn("hello = "+header);
return ok(index.render(header));
}
}
package filters;
import play.mvc.EssentialAction;
import play.mvc.EssentialFilter;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.concurrent.Executor;
/**
* This is a simple filter that adds a header to all requests.
*/
@Singleton
public class ExampleFilter extends EssentialFilter {
private final Executor exec;
/**
* @param exec This class is needed to execute code asynchronously.
*/
@Inject
public ExampleFilter(Executor exec) {
this.exec = exec;
}
@Override
public EssentialAction apply(EssentialAction next) {
return EssentialAction.of(request ->
next.apply(request).map(result ->
result.withHeader("X-ExampleFilter", "foo"), exec)
);
}
}
package services;
import java.time.Clock;
import java.time.Instant;
import java.util.concurrent.CompletableFuture;
import javax.inject.*;
import play.Logger;
import play.inject.ApplicationLifecycle;
/**
* This class demonstrates how to run code when the
* application starts and stops. It starts a timer when the
* application starts. When the application stops it prints out how
* long the application was running for.
*
* This class is registered for Guice dependency injection in the
* {@link Module} class. We want the class to start when the application
* starts, so it is registered as an "eager singleton". See the code
* in the {@link Module} class to see how this happens.
*
* This class needs to run code when the server stops. It uses the
* application's {@link ApplicationLifecycle} to register a stop hook.
*/
@Singleton
public class ApplicationTimer {
private final Clock clock;
private final ApplicationLifecycle appLifecycle;
private final Instant start;
private final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger("application");
@Inject
public ApplicationTimer(Clock clock, ApplicationLifecycle appLifecycle) {
this.clock = clock;
this.appLifecycle = appLifecycle;
// This code is called when the application starts.
start = clock.instant();
logger.info("ApplicationTimer demo: Starting application at " + start);
// When the application starts, register a stop hook with the
// ApplicationLifecycle object. The code inside the stop hook will
// be run when the application stops.
appLifecycle.addStopHook(() -> {
Instant stop = clock.instant();
Long runningTime = stop.getEpochSecond() - start.getEpochSecond();
logger.info("ApplicationTimer demo: Stopping application at " + clock.instant() + " after " + runningTime + "s.");
return CompletableFuture.completedFuture(null);
});
}
}
package services;
import java.util.concurrent.atomic.AtomicInteger;
import javax.inject.*;
/**
* This class is a concrete implementation of the {@link Counter} trait.
* It is configured for Guice dependency injection in the {@link Module}
* class.
*
* This class has a {@link Singleton} annotation because we need to make
* sure we only use one counter per application. Without this
* annotation we would get a new instance every time a {@link Counter} is
* injected.
*/
@Singleton
public class AtomicCounter implements Counter {
private final AtomicInteger atomicCounter = new AtomicInteger();
@Override
public int nextCount() {
return atomicCounter.getAndIncrement();
}
}
package services;
/**
* This interface demonstrates how to create a component that is injected
* into a controller. The interface represents a counter that returns a
* incremented number each time it is called.
*
* The {@link Modules} class binds this interface to the
* {@link AtomicCounter} implementation.
*/
public interface Counter {
int nextCount();
}
@(header : String)
<!DOCTYPE html>
<html>
<head>
<title>@header</title>
</head>
<body background="/assets/images/A.jpg">
</body>
</html>
\ No newline at end of file
@(user : String , pass : String , log : String)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>Login Form - Bootsnipp.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<link rel="stylesheet" href="/assets/stylesheets/main.css">
<style type="text/css">
* { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; -ms-box-sizing:border-box; -o-box-sizing:border-box; box-sizing:border-box; }
html { width: 100%; height:100%; overflow:hidden; }
body {
width: 100%;
height:100%;
font-family: 'Open Sans', sans-serif;
background: #092756;
background: -moz-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%),-moz-linear-gradient(top, rgba(57,173,219,.25) 0%, rgba(42,60,87,.4) 100%), -moz-linear-gradient(-45deg, #670d10 0%, #092756 100%);
background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -webkit-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -webkit-linear-gradient(-45deg, #670d10 0%,#092756 100%);
background: -o-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -o-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -o-linear-gradient(-45deg, #670d10 0%,#092756 100%);
background: -ms-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -ms-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -ms-linear-gradient(-45deg, #670d10 0%,#092756 100%);
background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), linear-gradient(to bottom, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), linear-gradient(135deg, #670d10 0%,#092756 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3E1D6D', endColorstr='#092756',GradientType=1 );
}
.login {
position: absolute;
top: 50%;
left: 50%;
margin: -150px 0 0 -150px;
width:300px;
height:300px;
}
.login h1 { color: #fff;text-shadow: 0 0 10px rgba(0,0,0,0.3); letter-spacing:10px; text-align:center; }
input {
width: 100%;
margin-bottom: 10px;
background: rgba(0,0,0,0.3);
border: none;
outline: none;
padding: 10px;
font-size: 13px;
color: #fff;
text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
border: 1px solid rgba(0,0,0,0.3);
border-radius: 4px;
box-shadow: inset 0 -5px 45px rgba(100,100,100,0.2), 0 1px 1px rgba(255,255,255,0.2);
-webkit-transition: box-shadow .5s ease;
-moz-transition: box-shadow .5s ease;
-o-transition: box-shadow .5s ease;
-ms-transition: box-shadow .5s ease;
transition: box-shadow .5s ease;
}
input:focus { box-shadow: inset 0 -5px 45px rgba(100,100,100,0.4), 0 1px 1px rgba(255,255,255,0.2); }
</style>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
</head>
<body class="background-info">
<div class="login">
<h1></h1>
<form method="post">
<input type="text" name="u" placeholder=@user required="required" />
<input type="password" name="p" placeholder=@pass required="required" />
<button type="submit" class="btn btn-primary btn-block btn-large">@log.</button>
</form>
<br>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- login bootsnipp -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9155049400353686"
data-ad-slot="9589048256"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<script type="text/javascript">
/*
I built this login form to block the front end of most of my freelance wordpress projects during the development stage.
This is just the HTML / CSS of it but it uses wordpress's login system.
Nice and Simple
*/
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.versioned("images/favicon.png")">
<script src="@routes.Assets.versioned("javascripts/hello.js")" type="text/javascript"></script>
</head>
<body>
</body>
</html>
@(message: String, style: String = "java")
@defining(play.core.PlayVersion.current) { version =>
<section id="top">
<div class="wrapper">
<h1><a href="https://playframework.com/documentation/@version/Home">@message</a></h1>
</div>
</section>
<div id="content" class="wrapper doc">
<article>
<h1>Welcome to Play</h1>
<p>
Congratulations, you’ve just created a new Play application. This page will help you with the next few steps.
</p>
<blockquote>
<p>
You’re using Play @version
</p>
</blockquote>
<h2>Why do you see this page?</h2>
<p>
The <code>conf/routes</code> file defines a route that tells Play to invoke the <code>HomeController.index</code> action
whenever a browser requests the <code>/</code> URI using the GET method:
</p>
<pre><code># Home page
GET / controllers.HomeController.index</code></pre>
<p>
Play has invoked the <code>controllers.HomeController.index</code> method:
</p>
<pre><code>public Result index() {
return ok(index.render("Your new application is ready."));
}</code></pre>
<p>
An action method handles the incoming HTTP request, and returns the HTTP result to send back to the web client.
Here we send a <code>200 OK</code> response, using a template to fill its content.
</p>
<p>
The template is defined in the <code>app/views/index.scala.html</code> file and compiled as a standard Java class.
</p>
<pre><code>@@(message: String)
@@main("Welcome to Play") {
@@play20.welcome(message, style = "Java")
}</code></pre>
<p>
The first line of the template defines the function signature. Here it just takes a single <code>String</code> parameter.
Then this template calls another function defined in <code>app/views/main.scala.html</code> which displays the HTML layout, and another
function that displays this welcome message. You can freely add any HTML fragment mixed with Scala code in this file.
</p>
<blockquote>
<p>
<strong>Note</strong> that Scala is fully compatible with Java, so if you don’t know Scala don’t panic, a Scala statement is very similar to a Java one.
</p>
</blockquote>
<p>You can read more about <a href="https://www.playframework.com/documentation/@version/ScalaTemplates">Twirl</a>, the template language used by Play, and how Play handles <a href="https://www.playframework.com/documentation/@version/JavaActions">actions</a>.</p>
<h2>Async Controller</h2>
Now that you've seen how Play renders a page, take a look at <code>AsyncController.java</code>, which shows how to do asynchronous programming when handling a request. The code is almost exactly the same as <code>HomeController.java</code>, but instead of returning <code>Result</code>, the action returns <code>CompletionStage&lt;Result&gt;</code> to Play. When the execution completes, Play can use a thread to render the result without blocking the thread in the mean time.
<p>
<a href="@routes.AsyncController.message">Click here for the AsyncController action!</a>
</p>
<p>
You can read more about <a href="https://www.playframework.com/documentation/@version/JavaAsync">asynchronous actions</a> in the documentation.
</p>
<h2>Count Controller</h2>
<p>
Both the HomeController and AsyncController are very simple, and typically controllers present the results of the interaction of several services. As an example, see the <code>CountController</code>, which shows how to inject a component into a controller and use the component when handling requests. The count controller increments every time you click on it, so keep clicking to see the numbers go up.
</p>
<p>
<a href="@routes.CountController.count">Click here for the CountController action!</a>
</p>
<p>
You can read more about <a href="https://www.playframework.com/documentation/@version/JavaDependencyInjection">dependency injection</a> in the documentation.
</p>
<h2>Need more info on the console?</h2>
<p>
For more information on the various commands you can run on Play, i.e. running tests and packaging applications for production, see <a href="https://playframework.com/documentation/@version/PlayConsole">Using the Play console</a>.
</p>
<h2>Need to set up an IDE?</h2>
<p>
You can start hacking your application right now using any text editor. Any changes will be automatically reloaded at each page refresh,
including modifications made to Scala source files.
</p>
<p>
If you want to set-up your application in <strong>IntelliJ IDEA</strong> or any other Java IDE, check the
<a href="https://www.playframework.com/documentation/@version/IDE">Setting up your preferred IDE</a> page.
</p>
<h2>Need more documentation?</h2>
<p>
Play documentation is available at <a href="https://www.playframework.com/documentation/@version">https://www.playframework.com/documentation</a>.
</p>
<p>
Play comes with lots of example templates showcasing various bits of Play functionality at <a href="https://www.playframework.com/download#examples">https://www.playframework.com/download#examples</a>.
</p>
<h2>Need more help?</h2>
<p>
Play questions are asked and answered on Stackoverflow using the "playframework" tag: <a href="https://stackoverflow.com/questions/tagged/playframework">https://stackoverflow.com/questions/tagged/playframework</a>
</p>
<p>
The <a href="https://discuss.playframework.com">Discuss Play Forum</a> is where Play users come to seek help,
announce projects, and discuss issues and new features.
</p>
<p>
Gitter is a real time chat channel, like IRC. The <a href="https://gitter.im/playframework/playframework">playframework/playframework</a> channel is used by Play users to discuss the ins and outs of writing great Play applications.
</p>
</article>
<aside>
<h3>Browse</h3>
<ul>
<li><a href="https://playframework.com/documentation/@version">Documentation</a></li>
<li><a href="https://playframework.com/documentation/@version/api/@style/index.html">Browse the @{style.capitalize} API</a></li>
</ul>
<h3>Start here</h3>
<ul>
<li><a href="https://playframework.com/documentation/@version/PlayConsole">Using the Play console</a></li>
<li><a href="https://playframework.com/documentation/@version/IDE">Setting up your preferred IDE</a></li>
<li><a href="https://playframework.com/download#examples">Example Projects</a>
</ul>
<h3>Help here</h3>
<ul>
<li><a href="https://stackoverflow.com/questions/tagged/playframework">Stack Overflow</a></li>
<li><a href="https://discuss.playframework.com">Discuss Play Forum</a> </li>
<li><a href="https://gitter.im/playframework/playframework">Gitter Channel</a></li>
</ul>
</aside>
</div>
}
plugins {
id 'play'
id 'idea'
}
def playVersion = "2.6.12"
def scalaVersion = System.getProperty("scala.binary.version", /* default = */ "2.12")
model {
components {
play {
platform play: playVersion, scala: scalaVersion, java: '1.8'
injectedRoutesGenerator = true
sources {
twirlTemplates {
defaultImports = TwirlImports.JAVA
}
}
}
}
}
dependencies {
play "com.typesafe.play:play-guice_$scalaVersion:$playVersion"
play "com.typesafe.play:play-logback_$scalaVersion:$playVersion"
play "com.h2database:h2:1.4.196"
playTest "org.assertj:assertj-core:3.6.2"
playTest "org.awaitility:awaitility:2.0.0"
}
repositories {
jcenter()
maven {
name "lightbend-maven-releases"
url "https://repo.lightbend.com/lightbend/maven-release"
}
ivy {
name "lightbend-ivy-release"
url "https://repo.lightbend.com/lightbend/ivy-releases"
layout "ivy"
}
}
name := """play-java-starter-example"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.12.4"
crossScalaVersions := Seq("2.11.12", "2.12.4")
libraryDependencies += guice
// Test Database
libraryDependencies += "com.h2database" % "h2" % "1.4.196"
// Testing libraries for dealing with CompletionStage...
libraryDependencies += "org.assertj" % "assertj-core" % "3.6.2" % Test
libraryDependencies += "org.awaitility" % "awaitility" % "2.0.0" % Test
// Make verbose tests
testOptions in Test := Seq(Tests.Argument(TestFrameworks.JUnit, "-a", "-v"))
# This is the main configuration file for the application.
# https://www.playframework.com/documentation/latest/ConfigFile
# ~~~~~
# Play uses HOCON as its configuration file format. HOCON has a number
# of advantages over other config formats, but there are two things that
# can be used when modifying settings.
#
# You can include other configuration files in this main application.conf file:
#include "extra-config.conf"
#
# You can declare variables and substitute for them:
#mykey = ${some.value}
#
# And if an environment variable exists when there is no other subsitution, then
# HOCON will fall back to substituting environment variable:
#mykey = ${JAVA_HOME}
## Akka
# https://www.playframework.com/documentation/latest/ScalaAkka#Configuration
# https://www.playframework.com/documentation/latest/JavaAkka#Configuration
# ~~~~~
# Play uses Akka internally and exposes Akka Streams and actors in Websockets and
# other streaming HTTP responses.
akka {
# "akka.log-config-on-start" is extraordinarly useful because it log the complete
# configuration at INFO level, including defaults and overrides, so it s worth
# putting at the very top.
#
# Put the following in your conf/logback.xml file:
#
# <logger name="akka.actor" level="INFO" />
#
# And then uncomment this line to debug the configuration.
#
#log-config-on-start = true
}
## Secret key
# http://www.playframework.com/documentation/latest/ApplicationSecret
# ~~~~~
# The secret key is used to sign Play's session cookie.
# This must be changed for production, but we don't recommend you change it in this file.
play.http.secret.key = "changeme"
## Modules
# https://www.playframework.com/documentation/latest/Modules
# ~~~~~
# Control which modules are loaded when Play starts. Note that modules are
# the replacement for "GlobalSettings", which are deprecated in 2.5.x.
# Please see https://www.playframework.com/documentation/latest/GlobalSettings
# for more information.
#
# You can also extend Play functionality by using one of the publically available
# Play modules: https://playframework.com/documentation/latest/ModuleDirectory
play.modules {
# By default, Play will load any class called Module that is defined
# in the root package (the "app" directory), or you can define them
# explicitly below.
# If there are any built-in modules that you want to disable, you can list them here.
#enabled += my.application.Module
# If there are any built-in modules that you want to disable, you can list them here.
#disabled += ""
}
## IDE
# https://www.playframework.com/documentation/latest/IDE
# ~~~~~
# Depending on your IDE, you can add a hyperlink for errors that will jump you
# directly to the code location in the IDE in dev mode. The following line makes
# use of the IntelliJ IDEA REST interface:
#play.editor="http://localhost:63342/api/file/?file=%s&line=%s"
## Internationalisation
# https://www.playframework.com/documentation/latest/JavaI18N
# https://www.playframework.com/documentation/latest/ScalaI18N
# ~~~~~
# Play comes with its own i18n settings, which allow the user's preferred language
# to map through to internal messages, or allow the language to be stored in a cookie.
play.i18n {
# The application languages
langs = [ "en" ,"th" ]
# Whether the language cookie should be secure or not
#langCookieSecure = true
# Whether the HTTP only attribute of the cookie should be set to true
#langCookieHttpOnly = true
}
## Play HTTP settings
# ~~~~~
play.http {
## Router
# https://www.playframework.com/documentation/latest/JavaRouting
# https://www.playframework.com/documentation/latest/ScalaRouting
# ~~~~~
# Define the Router object to use for this application.
# This router will be looked up first when the application is starting up,
# so make sure this is the entry point.
# Furthermore, it's assumed your route file is named properly.
# So for an application router like `my.application.Router`,
# you may need to define a router file `conf/my.application.routes`.
# Default to Routes in the root package (aka "apps" folder) (and conf/routes)
#router = my.application.Router
## Action Creator
# https://www.playframework.com/documentation/latest/JavaActionCreator
# ~~~~~
#actionCreator = null
## ErrorHandler
# https://www.playframework.com/documentation/latest/JavaRouting
# https://www.playframework.com/documentation/latest/ScalaRouting
# ~~~~~
# If null, will attempt to load a class called ErrorHandler in the root package,
#errorHandler = null
## Session & Flash
# https://www.playframework.com/documentation/latest/JavaSessionFlash
# https://www.playframework.com/documentation/latest/ScalaSessionFlash
# ~~~~~
session {
# Sets the cookie to be sent only over HTTPS.
#secure = true
# Sets the cookie to be accessed only by the server.
#httpOnly = true
# Sets the max-age field of the cookie to 5 minutes.
# NOTE: this only sets when the browser will discard the cookie. Play will consider any
# cookie value with a valid signature to be a valid session forever. To implement a server side session timeout,
# you need to put a timestamp in the session and check it at regular intervals to possibly expire it.
#maxAge = 300
# Sets the domain on the session cookie.
#domain = "example.com"
}
flash {
# Sets the cookie to be sent only over HTTPS.
#secure = true
# Sets the cookie to be accessed only by the server.
#httpOnly = true
}
}
## Netty Provider
# https://www.playframework.com/documentation/latest/SettingsNetty
# ~~~~~
play.server.netty {
# Whether the Netty wire should be logged
#log.wire = true
# If you run Play on Linux, you can use Netty's native socket transport
# for higher performance with less garbage.
#transport = "native"
}
## WS (HTTP Client)
# https://www.playframework.com/documentation/latest/ScalaWS#Configuring-WS
# ~~~~~
# The HTTP client primarily used for REST APIs. The default client can be
# configured directly, but you can also create different client instances
# with customized settings. You must enable this by adding to build.sbt:
#
# libraryDependencies += ws // or javaWs if using java
#
play.ws {
# Sets HTTP requests not to follow 302 requests
#followRedirects = false
# Sets the maximum number of open HTTP connections for the client.
#ahc.maxConnectionsTotal = 50
## WS SSL
# https://www.playframework.com/documentation/latest/WsSSL
# ~~~~~
ssl {
# Configuring HTTPS with Play WS does not require programming. You can
# set up both trustManager and keyManager for mutual authentication, and
# turn on JSSE debugging in development with a reload.
#debug.handshake = true
#trustManager = {
# stores = [
# { type = "JKS", path = "exampletrust.jks" }
# ]
#}
}
}
## Cache
# https://www.playframework.com/documentation/latest/JavaCache
# https://www.playframework.com/documentation/latest/ScalaCache
# ~~~~~
# Play comes with an integrated cache API that can reduce the operational
# overhead of repeated requests. You must enable this by adding to build.sbt:
#
# libraryDependencies += cache
#
play.cache {
# If you want to bind several caches, you can bind the individually
#bindCaches = ["db-cache", "user-cache", "session-cache"]
}
## Filter Configuration
# https://www.playframework.com/documentation/latest/Filters
# ~~~~~
# There are a number of built-in filters that can be enabled and configured
# to give Play greater security.
#
play.filters {
# Enabled filters are run automatically against Play.
# CSRFFilter, AllowedHostFilters, and SecurityHeadersFilters are enabled by default.
#enabled += filters.ExampleFilter
enabled = []
# Disabled filters remove elements from the enabled list.
#disabled += filters.ExampleFilter
## CORS filter configuration
# https://www.playframework.com/documentation/latest/CorsFilter
# ~~~~~
# CORS is a protocol that allows web applications to make requests from the browser
# across different domains.
# NOTE: You MUST apply the CORS configuration before the CSRF filter, as CSRF has
# dependencies on CORS settings.
cors {
# Filter paths by a whitelist of path prefixes
#pathPrefixes = ["/some/path", ...]
# The allowed origins. If null, all origins are allowed.
#allowedOrigins = [
# "https://fonts.googleapis.com/",
# "https://code.jquery.com/",
# "https://cdnjs.cloudflare.com/",
# "https://maxcdn.bootstrapcdn.com/"
#]
# The allowed HTTP methods. If null, all methods are allowed
#allowedHttpMethods = ["GET", "POST"]
}
## CSRF Filter
# https://www.playframework.com/documentation/latest/ScalaCsrf#Applying-a-global-CSRF-filter
# https://www.playframework.com/documentation/latest/JavaCsrf#Applying-a-global-CSRF-filter
# ~~~~~
# Play supports multiple methods for verifying that a request is not a CSRF request.
# The primary mechanism is a CSRF token. This token gets placed either in the query string
# or body of every form submitted, and also gets placed in the users session.
# Play then verifies that both tokens are present and match.
csrf {
# Sets the cookie to be sent only over HTTPS
#cookie.secure = true
# Defaults to CSRFErrorHandler in the root package.
#errorHandler = MyCSRFErrorHandler
}
## Security headers filter configuration
# https://www.playframework.com/documentation/latest/SecurityHeaders
# ~~~~~
# Defines security headers that prevent XSS attacks.
# If enabled, then all options are set to the below configuration by default:
headers {
# The X-Frame-Options header. If null, the header is not set.
#frameOptions = "DENY"
# The X-XSS-Protection header. If null, the header is not set.
#xssProtection = "1; mode=block"
# The X-Content-Type-Options header. If null, the header is not set.
#contentTypeOptions = "nosniff"
# The X-Permitted-Cross-Domain-Policies header. If null, the header is not set.
#permittedCrossDomainPolicies = "master-only"
# The Content-Security-Policy header. If null, the header is not set.
#contentSecurityPolicy = "default-src 'self'"
}
## Allowed hosts filter configuration
# https://www.playframework.com/documentation/latest/AllowedHostsFilter
# ~~~~~
# Play provides a filter that lets you configure which hosts can access your application.
# This is useful to prevent cache poisoning attacks.
hosts {
# Allow requests to localhost on ports 9000 (dev) and 19001 (default test) ports
allowed = ["localhost:9000", "localhost:19001"]
}
}
## Evolutions
# https://www.playframework.com/documentation/latest/Evolutions
# ~~~~~
# Evolutions allows database scripts to be automatically run on startup in dev mode
# for database migrations. You must enable this by adding to build.sbt:
#
# libraryDependencies += evolutions
#
play.evolutions {
# You can disable evolutions for a specific datasource if necessary
#db.default.enabled = false
}
## Database Connection Pool
# https://www.playframework.com/documentation/latest/SettingsJDBC
# ~~~~~
# Play doesn't require a JDBC database to run, but you can easily enable one.
#
# libraryDependencies += jdbc
#
play.db {
# The combination of these two settings results in "db.default" as the
# default JDBC pool:
#config = "db"
#default = "default"
# Play uses HikariCP as the default connection pool. You can override
# settings by changing the prototype:
prototype {
# Sets a fixed JDBC connection pool size of 50
#hikaricp.minimumIdle = 50
#hikaricp.maximumPoolSize = 50
}
}
## JDBC Datasource
# https://www.playframework.com/documentation/latest/JavaDatabase
# https://www.playframework.com/documentation/latest/ScalaDatabase
# ~~~~~
# Once JDBC datasource is set up, you can work with several different
# database options:
#
# Slick (Scala preferred option): https://www.playframework.com/documentation/latest/PlaySlick
# JPA (Java preferred option): https://playframework.com/documentation/latest/JavaJPA
# EBean: https://playframework.com/documentation/latest/JavaEbean
# Anorm: https://www.playframework.com/documentation/latest/ScalaAnorm
#
db {
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
# https://www.playframework.com/documentation/latest/Developing-with-the-H2-Database
#default.driver = org.h2.Driver
#default.url = "jdbc:h2:mem:play"
#default.username = sa
#default.password = ""
# You can turn on SQL logging for any datasource
# https://www.playframework.com/documentation/latest/Highlights25#Logging-SQL-statements
#default.logSql=true
}
<!-- https://www.playframework.com/documentation/latest/SettingsLogger -->
<configuration>
<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${application.home:-.}/logs/application.log</file>
<encoder>
<pattern>%date [%level] from %logger in %thread - %message%n%xException</pattern>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%coloredLevel %logger{15} - %message%n%xException{10}</pattern>
</encoder>
</appender>
<appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="STDOUT" />
</appender>
<logger name="play" level="INFO" />
<logger name="application" level="DEBUG" />
<!-- Off these ones as they are annoying, and anyway we manage configuration ourselves -->
<logger name="com.gargoylesoftware.htmlunit.javascript" level="OFF" />
<root level="WARN">
<appender-ref ref="ASYNCFILE" />
<appender-ref ref="ASYNCSTDOUT" />
</root>
</configuration>
Hello=สวัสดี
Username=ชื่อผู้ใช้
Password=รหัสผ่าน
Login=เข้าสู่ระบบ
\ No newline at end of file
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
GET /login controllers.HomeController.login
GET / controllers.HomeController.index
GET /count controllers.CountController.count
GET /message controllers.AsyncController.message
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="play-java-starter-example" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.12")
// Play enhancer - this automatically generates getters/setters for public fields
// and rewrites accessors of these fields to use the getters/setters. Remove this
// plugin if you prefer not to have this feature, or disable on a per project
// basis using disablePlugins(PlayEnhancer) in your build.sbt
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.2.2")
if (window.console) {
console.log("Welcome to your Play application's JavaScript!");
}
!function(a){"use strict";a('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=a(this.hash);if((e=e.length?e:a("[name="+this.hash.slice(1)+"]")).length)return a("html, body").animate({scrollTop:e.offset().top-48},1e3,"easeInOutExpo"),!1}}),a(".js-scroll-trigger").click(function(){a(".navbar-collapse").collapse("hide")}),a("body").scrollspy({target:"#mainNav",offset:54});var e=function(){a("#mainNav").offset().top>100?a("#mainNav").addClass("navbar-shrink"):a("#mainNav").removeClass("navbar-shrink")};e(),a(window).scroll(e)}(jQuery);
\ No newline at end of file
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family: 'Mitr', sans-serif;}
table{border-collapse:collapse;border-spacing:0;}
caption,th,td{text-align:left;font-weight:normal;}
form legend{display:none;}
blockquote:before,blockquote:after,q:before,q:after{content:"";}
blockquote,q{quotes:"" "";}
ol,ul{list-style:none;}
hr{display:none;visibility:hidden;}
:focus{outline:0;}
article{}article h1,article h2,article h3,article h4,article h5,article h6{color:#333;font-weight:bold;line-height:1.25;margin-top:1.3em;}
article h1 a,article h2 a,article h3 a,article h4 a,article h5 a,article h6 a{font-weight:inherit;color:#333;}article h1 a:hover,article h2 a:hover,article h3 a:hover,article h4 a:hover,article h5 a:hover,article h6 a:hover{color:#333;}
article h1{font-size:36px;margin:0 0 18px;border-bottom:4px solid #eee;}
article h2{font-size:25px;margin-bottom:9px;border-bottom:2px solid #eee;}
article h3{font-size:18px;margin-bottom:9px;}
article h4{font-size:15px;margin-bottom:3px;}
article h5{font-size:12px;font-weight:normal;margin-bottom:3px;}
article .subheader{color:#777;font-weight:300;margin-bottom:24px;}
article p{line-height:1.3em;margin:1em 0;}
article p img{margin:0;}
article p.lead{font-size:18px;font-size:1.8rem;line-height:1.5;}
article li>p:first-child{margin-top:0;}
article li>p:last-child{margin-bottom:0;}
article ul li,article ol li{position:relative;padding:4px 0 4px 14px;}article ul li ol,article ol li ol,article ul li ul,article ol li ul{margin-left:20px;}
article ul li:before,article ol li:before{position:absolute;top:8px;left:0;content:"►";color:#ccc;font-size:10px;margin-right:5px;}
article>ol{counter-reset:section;}article>ol li:before{color:#ccc;font-size:13px;}
article>ol>li{padding:6px 0 4px 20px;counter-reset:chapter;}article>ol>li:before{content:counter(section) ".";counter-increment:section;}
article>ol>li>ol>li{padding:6px 0 4px 30px;counter-reset:item;}article>ol>li>ol>li:before{content:counter(section) "." counter(chapter);counter-increment:chapter;}
article>ol>li>ol>li>ol>li{padding:6px 0 4px 40px;}article>ol>li>ol>li>ol>li:before{content:counter(section) "." counter(chapter) "." counter(item);counter-increment:item;}
article em,article i{font-style:italic;line-height:inherit;}
article strong,article b{font-weight:bold;line-height:inherit;}
article small{font-size:60%;line-height:inherit;}
article h1 small,article h2 small,article h3 small,article h4 small,article h5 small{color:#777;}
article hr{border:solid #ddd;border-width:1px 0 0;clear:both;margin:12px 0 18px;height:0;}
article abbr,article acronym{text-transform:uppercase;font-size:90%;color:#222;border-bottom:1px solid #ddd;cursor:help;}
article abbr{text-transform:none;}
article img{max-width:100%;}
article pre{margin:10px 0;border:1px solid #ddd;padding:10px;background:#fafafa;color:#666;overflow:auto;border-radius:5px;}
article code{background:#fafafa;color:#666;font-family:inconsolata, monospace;border:1px solid #ddd;border-radius:3px;height:4px;padding:0;}
article a code{color:#80c846;}article a code:hover{color:#6dae38;}
article pre code{border:0;background:inherit;border-radius:0;line-height:inherit;font-size:14px;}
article pre.prettyprint{border:1px solid #ddd;padding:10px;}
article blockquote,article blockquote p,article p.note{line-height:20px;color:#4c4742;}
article blockquote,article .note{margin:0 0 18px;padding:1px 20px;background:#fff7d6;}article blockquote li:before,article .note li:before{color:#e0bc6f;}
article blockquote code,article .note code{background:#f5d899;border:none;color:inherit;}
article blockquote a,article .note a{color:#6dae38;}
article blockquote pre,article .note pre{background:#F5D899 !important;color:#48484C !important;border:none !important;}
article p.note{padding:15px 20px;}
article table{width:100%;}article table td{padding:8px;}
article table tr{background:#F4F4F7;border-bottom:1px solid #eee;}
article table tr:nth-of-type(odd){background:#fafafa;}
article dl dt{font-weight:bold;}
article dl.tabbed{position:relative;}
article dl.tabbed dt{float:left;margin:0 5px 0 0;border:1px solid #ddd;padding:0 20px;line-height:2;border-radius: 5px 5px 0 0;}
article dl.tabbed dt a{display:block;height:30px;color:#333;text-decoration:none;}
article dl.tabbed dt.current{background: #f7f7f7;}
article dl.tabbed dd{position:absolute;width:100%;left:0;top:30px;}
article dl.tabbed dd pre{margin-top:0;border-top-left-radius:0;}
a{color:#80c846;}a:hover{color:#6dae38;}
p{margin:1em 0;}
h1{-webkit-font-smoothing:antialiased;}
h2{font-weight:bold;font-size:28px;}
hr{clear:both;margin:20px 0 25px 0;border:none;border-top:1px solid #444;visibility:visible;display:block;}
section{padding:50px 0;}
body{background:#f5f5f5;background:#fff;color:#555;font:15px "Helvetica Nueue",sans-serif;padding:0px 0 0px;}
.wrapper{width:960px;margin:0 auto;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:60px 0;}.wrapper:after{content:" ";display:block;clear:both;}
.wrapper article{min-height:310px;width:650px;float:left;}
.wrapper aside{width:270px;float:right;}.wrapper aside ul{margin:2px 0 30px;}.wrapper aside ul a{display:block;padding:3px 0 3px 10px;margin:2px 0;border-left:4px solid #eee;}.wrapper aside ul a:hover{border-color:#80c846;}
.wrapper aside h3{font-size:18px;color:#333;font-weight:bold;line-height:2em;margin:9px 0;border-bottom:1px solid #eee;}
.wrapper aside.stick{position:fixed;right:50%;margin-right:-480px;top:120px;bottom:0;overflow:hidden;}
.half{width:50%;float:left;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;}
header{position:fixed;top:0;z-index:1000;width:100%;height:50px;line-height:50px;padding:30px 0;background:#fff;background:rgba(255, 255, 255, 0.95);border-bottom:1px solid #ccc;box-shadow:0 4px 0 rgba(0, 0, 0, 0.1);}header #logo{position:absolute;left:50%;margin-left:-480px;}
header nav{position:absolute;right:50%;margin-right:-480px;}header nav a{padding:0 10px 4px;font-size:21px;font-weight:500;text-decoration:none;}
header nav a.selected{border-bottom:3px solid #E9E9E9;}
header nav a.download{position:relative;background:#80c846;color:white;margin-left:10px;padding:5px 10px 2px;font-weight:700;border-radius:5px;box-shadow:0 3px 0 #6dae38;text-shadow:-1px -1px 0 rgba(0, 0, 0, 0.2);-webkit-transition:all 70ms ease-out;border:0;}header nav a.download:hover{box-shadow:0 3px 0 #6dae38,0 3px 4px rgba(0, 0, 0, 0.3);}
header nav a.download:active{box-shadow:0 1px 0 #6dae38;top:2px;-webkit-transition:none;}
#download,#getLogo{display:none;position:absolute;padding:5px 20px;width:200px;background:#000;background:rgba(0, 0, 0, 0.8);border-radius:5px;color:#999;line-height:15px;}#download a,#getLogo a{color:#ccc;text-decoration:none;}#download a:hover,#getLogo a:hover{color:#fff;}
#getLogo{text-align:center;}#getLogo h3{font-size:16px;color:#80c846;margin:0 0 15px;}
#getLogo figure{border-radius:3px;margin:5px 0;padding:5px;background:#fff;line-height:25px;width:80px;display:inline-block;}#getLogo figure a{color:#999;text-decoration:none;}#getLogo figure a:hover{color:#666;}
#download{top:85px;right:50%;margin-right:-480px;}#download .button{font-size:16px;color:#80c846;}
#getLogo{top:85px;left:50%;padding:20px;margin-left:-480px;}#getLogo ul{margin:5px 0;}
#getLogo li{margin:1px 0;}
#news{background:#f5f5f5;color:#999;font-size:17px;box-shadow:0 1px 0 rgba(0, 0, 0, 0.1);position:relative;z-index:2;padding:3px 0;}#news ul{box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background:url(/assets/images/news.png) 10px center no-repeat;padding:19px 0 19px 60px;}
#content{padding:30px 0;}
#top{background:#80c846 url(/assets/images/header-pattern.png) fixed;box-shadow:0 -4px 0 rgba(0, 0, 0, 0.1) inset;padding:0;position:relative;}#top .wrapper{padding:30px 0;}
#top h1{float:left;color:#fff;font-size:35px;line-height:48px;text-shadow:2px 2px 0 rgba(0, 0, 0, 0.1);}#top h1 a{text-decoration:none;color:#fff;}
#top nav{float:right;margin-top:10px;line-height:25px;}#top nav .versions,#top nav form{float:left;margin:0 5px;}
#top nav .versions{height:25px;display:inline-block;border:1px solid #6dae38;border-radius:3px;background:#80c846;background:-moz-linear-gradient(top, #80c846 0%, #6dae38 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #80c846), color-stop(100%, #6dae38));background:-webkit-linear-gradient(top, #80c846 0%, #6dae38 100%);background:-o-linear-gradient(top, #80c846 0%, #6dae38 100%);background:-ms-linear-gradient(top, #80c846 0%, #6dae38 100%);background:linear-gradient(top, #80c846 0%, #6dae38 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#80c846', endColorstr='#6dae38',GradientType=0 );box-shadow:inset 0 -1px 1px #80c846;text-align:center;color:#fff;text-shadow:-1px -1px 0 #6dae38;}#top nav .versions span{padding:0 4px;position:absolute;}#top nav .versions span:before{content:"⬍";color:rgba(0, 0, 0, 0.4);text-shadow:1px 1px 0 #80c846;margin-right:4px;}
#top nav .versions select{opacity:0;position:relative;z-index:9;}
#top .follow{display:inline-block;border:1px solid #6dae38;border-radius:3px;background:#80c846;background:-moz-linear-gradient(top, #80c846 0%, #6dae38 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #80c846), color-stop(100%, #6dae38));background:-webkit-linear-gradient(top, #80c846 0%, #6dae38 100%);background:-o-linear-gradient(top, #80c846 0%, #6dae38 100%);background:-ms-linear-gradient(top, #80c846 0%, #6dae38 100%);background:linear-gradient(top, #80c846 0%, #6dae38 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#80c846', endColorstr='#6dae38',GradientType=0 );box-shadow:inset 0 -1px 1px #80c846;text-align:center;vertical-align:middle;color:#fff;text-shadow:-1px -1px 0 #6dae38;padding:4px 8px;text-decoration:none;position:absolute;top:41px;left:50%;margin-left:210px;width:250px;}#top .follow:before{vertical-align:middle;content:url(/assets/images/twitter.png);margin-right:10px;}
#top input{width:80px;-webkit-transition:width 200ms ease-in-out;-moz-transition:width 200ms ease-in-out;}#top input:focus{width:200px;}
#title{width:500px;float:left;font-size:17px;color:#2d6201;}
#quicklinks{width:350px;margin:-15px 0 0 0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;float:right;padding:30px;background:#fff;color:#888;box-shadow:0 3px 5px rgba(0, 0, 0, 0.2);}#quicklinks h2{color:#80c846;font-size:20px;margin-top:15px;padding:10px 0 5px 0;border-top:1px solid #eee;}#quicklinks h2:first-child{margin:0;padding:0 0 5px 0;border:0;}
#quicklinks p{margin:0;}
#quicklinks a{color:#444;}#quicklinks a:hover{color:#222;}
.tweet{border-bottom:1px solid #eee;padding:6px 0 20px 60px;position:relative;min-height:50px;margin-bottom:20px;}.tweet img{position:absolute;left:0;top:8px;}
.tweet strong{font-size:14px;font-weight:bold;}
.tweet span{font-size:12px;color:#888;}
.tweet p{padding:0;margin:5px 0 0 0;}
footer{padding:40px 0;background:#363736;background:#eee;border-top:1px solid #e5e5e5;color:#aaa;position:relative;}footer .logo{position:absolute;top:55px;left:50%;margin-left:-480px;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);}
footer:after{content:" ";display:block;clear:both;}
footer .links{width:960px;margin:0 auto;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin:0 auto;padding-left:200px;}footer .links:after{content:" ";display:block;clear:both;}
footer .links dl{width:33%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:0 10px;float:left;}
footer .links dt{color:#80c846;font-weight:bold;}
footer .links a{color:#aaa;text-decoration:none;}footer .links a:hover{color:#888;}
footer .licence{width:960px;margin:0 auto;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin:20px auto 0;padding-top:20px;border-top:2px solid #ddd;font-size:12px;}footer .licence:after{content:" ";display:block;clear:both;}
footer .licence .typesafe,footer .licence .zenexity{float:right;}
footer .licence .typesafe{position:relative;top:-3px;margin-left:10px;}
footer .licence a{color:#999;}
div.coreteam{position:relative;min-height:80px;border-bottom:1px solid #eee;}div.coreteam img{width:50px;position:absolute;left:0;top:0;padding:2px;border:1px solid #ddd;}
div.coreteam a{color:inherit;text-decoration:none;}
div.coreteam h2{padding-left:70px;border:none;font-size:20px;}
div.coreteam p{margin-top:5px;padding-left:70px;}
ul.contributors{padding:0;margin:0;list-style:none;}ul.contributors li{padding:6px 0 !important;margin:0;}ul.contributors li:before{content:' ';}
ul.contributors img{width:25px;padding:1px;border:1px solid #ddd;margin-right:5px;vertical-align:middle;}
ul.contributors a{color:inherit;text-decoration:none;}
ul.contributors span{font-weight:bold;color:#666;}
ul.contributors.others li{display:inline-block;width:32.3333%;}
div.list{float:left;width:33.3333%;margin-bottom:30px;}
h2{clear:both;}
span.by{font-size:14px;font-weight:normal;}
form dl{padding:10px 0;}
dd.info{color:#888;font-size:12px;}
dd.error{color:#c00;}
aside a[href^="http"]:after,.doc a[href^="http"]:after{content:url(/assets/images/external.png);vertical-align:middle;margin-left:5px;}
.background-info{background:url("/assets/images/bgn.jpg");background-size:100%;}
\ No newline at end of file
#!/usr/bin/env bash
./sbt-dist/bin/sbt "$@"
\ No newline at end of file
#!/usr/bin/env bash
### ------------------------------- ###
### Helper methods for BASH scripts ###
### ------------------------------- ###
realpath () {
(
TARGET_FILE="$1"
FIX_CYGPATH="$2"
cd "$(dirname "$TARGET_FILE")"
TARGET_FILE=$(basename "$TARGET_FILE")
COUNT=0
while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ]
do
TARGET_FILE=$(readlink "$TARGET_FILE")
cd "$(dirname "$TARGET_FILE")"
TARGET_FILE=$(basename "$TARGET_FILE")
COUNT=$(($COUNT + 1))
done
# make sure we grab the actual windows path, instead of cygwin's path.
if [[ "x$FIX_CYGPATH" != "x" ]]; then
echo "$(cygwinpath "$(pwd -P)/$TARGET_FILE")"
else
echo "$(pwd -P)/$TARGET_FILE"
fi
)
}
# Uses uname to detect if we're in the odd cygwin environment.
is_cygwin() {
local os=$(uname -s)
case "$os" in
CYGWIN*) return 0 ;;
*) return 1 ;;
esac
}
# TODO - Use nicer bash-isms here.
CYGWIN_FLAG=$(if is_cygwin; then echo true; else echo false; fi)
# This can fix cygwin style /cygdrive paths so we get the
# windows style paths.
cygwinpath() {
local file="$1"
if [[ "$CYGWIN_FLAG" == "true" ]]; then
echo $(cygpath -w $file)
else
echo $file
fi
}
. "$(dirname "$(realpath "$0")")/sbt-launch-lib.bash"
declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy"
declare -r sbt_opts_file=".sbtopts"
declare -r etc_sbt_opts_file="${sbt_home}/conf/sbtopts"
declare -r win_sbt_opts_file="${sbt_home}/conf/sbtconfig.txt"
usage() {
cat <<EOM
Usage: $script_name [options]
-h | -help print this message
-v | -verbose this runner is chattier
-d | -debug set sbt log level to debug
-no-colors disable ANSI color codes
-sbt-create start sbt even if current directory contains no sbt project
-sbt-dir <path> path to global settings/plugins directory (default: ~/.sbt)
-sbt-boot <path> path to shared boot directory (default: ~/.sbt/boot in 0.11 series)
-ivy <path> path to local Ivy repository (default: ~/.ivy2)
-mem <integer> set memory options (default: $sbt_mem, which is $(get_mem_opts $sbt_mem))
-no-share use all local caches; no sharing
-no-global uses global caches, but does not use global ~/.sbt directory.
-jvm-debug <port> Turn on JVM debugging, open at the given port.
-batch Disable interactive mode
# sbt version (default: from project/build.properties if present, else latest release)
-sbt-version <version> use the specified version of sbt
-sbt-jar <path> use the specified jar as the sbt launcher
-sbt-rc use an RC version of sbt
-sbt-snapshot use a snapshot version of sbt
# java version (default: java from PATH, currently $(java -version 2>&1 | grep version))
-java-home <path> alternate JAVA_HOME
# jvm options and output control
JAVA_OPTS environment variable, if unset uses "$java_opts"
SBT_OPTS environment variable, if unset uses "$default_sbt_opts"
.sbtopts if this file exists in the current directory, it is
prepended to the runner args
/etc/sbt/sbtopts if this file exists, it is prepended to the runner args
-Dkey=val pass -Dkey=val directly to the java runtime
-J-X pass option -X directly to the java runtime
(-J is stripped)
-S-X add -X to sbt's scalacOptions (-S is stripped)
In the case of duplicated or conflicting options, the order above
shows precedence: JAVA_OPTS lowest, command line options highest.
EOM
}
process_my_args () {
while [[ $# -gt 0 ]]; do
case "$1" in
-no-colors) addJava "-Dsbt.log.noformat=true" && shift ;;
-no-share) addJava "$noshare_opts" && shift ;;
-no-global) addJava "-Dsbt.global.base=$(pwd)/project/.sbtboot" && shift ;;
-sbt-boot) require_arg path "$1" "$2" && addJava "-Dsbt.boot.directory=$2" && shift 2 ;;
-sbt-dir) require_arg path "$1" "$2" && addJava "-Dsbt.global.base=$2" && shift 2 ;;
-debug-inc) addJava "-Dxsbt.inc.debug=true" && shift ;;
-batch) exec </dev/null && shift ;;
-sbt-create) sbt_create=true && shift ;;
*) addResidual "$1" && shift ;;
esac
done
# Now, ensure sbt version is used.
[[ "${sbt_version}XXX" != "XXX" ]] && addJava "-Dsbt.version=$sbt_version"
}
loadConfigFile() {
cat "$1" | sed '/^\#/d' | while read line; do
eval echo $line
done
}
# TODO - Pull in config based on operating system... (MSYS + cygwin should pull in txt file).
# Here we pull in the global settings configuration.
[[ -f "$etc_sbt_opts_file" ]] && set -- $(loadConfigFile "$etc_sbt_opts_file") "$@"
# -- Windows behavior stub'd
# JAVA_OPTS=$(cat "$WDIR/sbtconfig.txt" | sed -e 's/\r//g' -e 's/^#.*$//g' | sed ':a;N;$!ba;s/\n/ /g')
# Pull in the project-level config file, if it exists.
[[ -f "$sbt_opts_file" ]] && set -- $(loadConfigFile "$sbt_opts_file") "$@"
run "$@"
#!/usr/bin/env bash
#
# A library to simplify using the SBT launcher from other packages.
# Note: This should be used by tools like giter8/conscript etc.
# TODO - Should we merge the main SBT script with this library?
declare -a residual_args
declare -a java_args
declare -a scalac_args
declare -a sbt_commands
declare java_cmd=java
declare java_version
declare -r sbt_bin_dir="$(dirname "$(realpath "$0")")"
declare -r sbt_home="$(dirname "$sbt_bin_dir")"
echoerr () {
echo 1>&2 "$@"
}
vlog () {
[[ $verbose || $debug ]] && echoerr "$@"
}
dlog () {
[[ $debug ]] && echoerr "$@"
}
jar_file () {
echo "$(cygwinpath "${sbt_home}/bin/sbt-launch.jar")"
}
acquire_sbt_jar () {
sbt_jar="$(jar_file)"
if [[ ! -f "$sbt_jar" ]]; then
echoerr "Could not find launcher jar: $sbt_jar"
exit 2
fi
}
execRunner () {
# print the arguments one to a line, quoting any containing spaces
[[ $verbose || $debug ]] && echo "# Executing command line:" && {
for arg; do
if printf "%s\n" "$arg" | grep -q ' '; then
printf "\"%s\"\n" "$arg"
else
printf "%s\n" "$arg"
fi
done
echo ""
}
# THis used to be exec, but we loose the ability to re-hook stty then
# for cygwin... Maybe we should flag the feature here...
"$@"
}
addJava () {
dlog "[addJava] arg = '$1'"
java_args=( "${java_args[@]}" "$1" )
}
addSbt () {
dlog "[addSbt] arg = '$1'"
sbt_commands=( "${sbt_commands[@]}" "$1" )
}
addResidual () {
dlog "[residual] arg = '$1'"
residual_args=( "${residual_args[@]}" "$1" )
}
addDebugger () {
addJava "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$1"
}
get_mem_opts () {
# if we detect any of these settings in ${JAVA_OPTS} or ${JAVA_TOOL_OPTIONS} we need to NOT output our settings.
# The reason is the Xms/Xmx, if they don't line up, cause errors.
if [[ "${JAVA_OPTS}" == *-Xmx* ]] || [[ "${JAVA_OPTS}" == *-Xms* ]] || [[ "${JAVA_OPTS}" == *-XX:MaxPermSize* ]] || [[ "${JAVA_OPTS}" == *-XX:MaxMetaspaceSize* ]] || [[ "${JAVA_OPTS}" == *-XX:ReservedCodeCacheSize* ]]; then
echo ""
elif [[ "${JAVA_TOOL_OPTIONS}" == *-Xmx* ]] || [[ "${JAVA_TOOL_OPTIONS}" == *-Xms* ]] || [[ "${JAVA_TOOL_OPTIONS}" == *-XX:MaxPermSize* ]] || [[ "${JAVA_TOOL_OPTIONS}" == *-XX:MaxMetaspaceSize* ]] || [[ "${JAVA_TOOL_OPTIONS}" == *-XX:ReservedCodeCacheSize* ]]; then
echo ""
elif [[ "${SBT_OPTS}" == *-Xmx* ]] || [[ "${SBT_OPTS}" == *-Xms* ]] || [[ "${SBT_OPTS}" == *-XX:MaxPermSize* ]] || [[ "${SBT_OPTS}" == *-XX:MaxMetaspaceSize* ]] || [[ "${SBT_OPTS}" == *-XX:ReservedCodeCacheSize* ]]; then
echo ""
else
# a ham-fisted attempt to move some memory settings in concert
# so they need not be messed around with individually.
local mem=${1:-1024}
local codecache=$(( $mem / 8 ))
(( $codecache > 128 )) || codecache=128
(( $codecache < 512 )) || codecache=512
local class_metadata_size=$(( $codecache * 2 ))
local class_metadata_opt=$([[ "$java_version" < "1.8" ]] && echo "MaxPermSize" || echo "MaxMetaspaceSize")
local arg_xms=$([[ "${java_args[@]}" == *-Xms* ]] && echo "" || echo "-Xms${mem}m")
local arg_xmx=$([[ "${java_args[@]}" == *-Xmx* ]] && echo "" || echo "-Xmx${mem}m")
local arg_rccs=$([[ "${java_args[@]}" == *-XX:ReservedCodeCacheSize* ]] && echo "" || echo "-XX:ReservedCodeCacheSize=${codecache}m")
local arg_meta=$([[ "${java_args[@]}" == *-XX:${class_metadata_opt}* ]] && echo "" || echo "-XX:${class_metadata_opt}=${class_metadata_size}m")
echo "${arg_xms} ${arg_xmx} ${arg_rccs} ${arg_meta}"
fi
}
require_arg () {
local type="$1"
local opt="$2"
local arg="$3"
if [[ -z "$arg" ]] || [[ "${arg:0:1}" == "-" ]]; then
echo "$opt requires <$type> argument"
exit 1
fi
}
is_function_defined() {
declare -f "$1" > /dev/null
}
process_args () {
while [[ $# -gt 0 ]]; do
case "$1" in
-h|-help) usage; exit 1 ;;
-v|-verbose) verbose=1 && shift ;;
-d|-debug) debug=1 && shift ;;
-ivy) require_arg path "$1" "$2" && addJava "-Dsbt.ivy.home=$2" && shift 2 ;;
-mem) require_arg integer "$1" "$2" && sbt_mem="$2" && shift 2 ;;
-jvm-debug) require_arg port "$1" "$2" && addDebugger $2 && shift 2 ;;
-batch) exec </dev/null && shift ;;
-sbt-jar) require_arg path "$1" "$2" && sbt_jar="$2" && shift 2 ;;
-sbt-version) require_arg version "$1" "$2" && sbt_version="$2" && shift 2 ;;
-java-home) require_arg path "$1" "$2" && java_cmd="$2/bin/java" && shift 2 ;;
-D*) addJava "$1" && shift ;;
-J*) addJava "${1:2}" && shift ;;
*) addResidual "$1" && shift ;;
esac
done
is_function_defined process_my_args && {
myargs=("${residual_args[@]}")
residual_args=()
process_my_args "${myargs[@]}"
}
java_version=$("$java_cmd" -Xmx512M -version 2>&1 | awk -F '"' '/version/ {print $2}')
vlog "[process_args] java_version = '$java_version'"
}
# Detect that we have java installed.
checkJava() {
local required_version="$1"
# Now check to see if it's a good enough version
if [[ "$java_version" == "" ]]; then
echo
echo No java installations was detected.
echo Please go to http://www.java.com/getjava/ and download
echo
exit 1
elif [[ ! "$java_version" > "$required_version" ]]; then
echo
echo The java installation you have is not up to date
echo $script_name requires at least version $required_version+, you have
echo version $java_version
echo
echo Please go to http://www.java.com/getjava/ and download
echo a valid Java Runtime and install before running $script_name.
echo
exit 1
fi
}
run() {
# no jar? download it.
[[ -f "$sbt_jar" ]] || acquire_sbt_jar "$sbt_version" || {
# still no jar? uh-oh.
echo "Download failed. Obtain the sbt-launch.jar manually and place it at $sbt_jar"
exit 1
}
# process the combined args, then reset "$@" to the residuals
process_args "$@"
set -- "${residual_args[@]}"
argumentCount=$#
# TODO - java check should be configurable...
checkJava "1.6"
#If we're in cygwin, we should use the windows config, and terminal hacks
if [[ "$CYGWIN_FLAG" == "true" ]]; then
stty -icanon min 1 -echo > /dev/null 2>&1
addJava "-Djline.terminal=jline.UnixTerminal"
addJava "-Dsbt.cygwin=true"
fi
# run sbt
execRunner "$java_cmd" \
$(get_mem_opts $sbt_mem) \
${JAVA_OPTS} \
${SBT_OPTS:-$default_sbt_opts} \
${java_args[@]} \
-jar "$sbt_jar" \
"${sbt_commands[@]}" \
"${residual_args[@]}"
exit_code=$?
# Clean up the terminal from cygwin hacks.
if [[ "$CYGWIN_FLAG" == "true" ]]; then
stty icanon echo > /dev/null 2>&1
fi
exit $exit_code
}
@REM SBT launcher script
@REM
@REM Envioronment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.
@REM ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion
@echo off
set SBT_HOME=%~dp0
rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
set DO_NOT_REUSE_ME=%%i
rem ZOMG (Part #2) WE use !! here to delay the expansion of
rem CFG_OPTS, otherwise it remains "" for this loop.
set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)
rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%
if "%_JAVACMD%"=="" (
if not "%JAVA_HOME%"=="" (
if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
)
)
if "%_JAVACMD%"=="" set _JAVACMD=java
rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%
:run
"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
if ERRORLEVEL 1 goto error
goto end
:error
@endlocal
exit /B 1
:end
@endlocal
exit /B 0
# Set the java args to high
-Xmx512M
-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=128m
# Set the extra SBT options
-Dsbt.log.format=true
# ------------------------------------------------ #
# The SBT Configuration file. #
# ------------------------------------------------ #
# Disable ANSI color codes
#
#-no-colors
# Starts sbt even if the current directory contains no sbt project.
#
-sbt-create
# Path to global settings/plugins directory (default: ~/.sbt)
#
#-sbt-dir /etc/sbt
# Path to shared boot directory (default: ~/.sbt/boot in 0.11 series)
#
#-sbt-boot ~/.sbt/boot
# Path to local Ivy repository (default: ~/.ivy2)
#
#-ivy ~/.ivy2
# set memory options
#
#-mem <integer>
# Use local caches for projects, no sharing.
#
#-no-share
# Put SBT in offline mode.
#
#-offline
# Sets the SBT version to use.
#-sbt-version 0.11.3
# Scala version (default: latest release)
#
#-scala-home <path>
#-scala-version <version>
# java version (default: java from PATH, currently $(java -version |& grep version))
#
#-java-home <path>
@REM SBT launcher script
.\sbt-dist\bin\sbt.bat %*
#!/usr/bin/env bash
set -e
set -o pipefail
java_version=$(java -version 2>&1 | java -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ $java_version = 9* ]] ; then
echo "The build is using Java 9 ($java_version). We need additional JVM parameters"
export _JAVA_OPTIONS="$_JAVA_OPTIONS --add-modules=java.xml.bind"
else
echo "The build is NOT using Java 9 ($java_version). No addional JVM params needed."
fi
#!/usr/bin/env bash
. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/script-helper"
# Using cut because TRAVIS_SCALA_VERSION is the full Scala
# version (for example 2.12.4), but Gradle expects just the
# binary version (for example 2.12)
scala_binary_version=$(echo $TRAVIS_SCALA_VERSION | cut -c1-4)
echo "+------------------------------+"
echo "| Executing tests using Gradle |"
echo "+------------------------------+"
./gradlew -Dscala.binary.version=$scala_binary_version check -i --stacktrace
#!/usr/bin/env bash
. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/script-helper"
echo "+----------------------------+"
echo "| Executing tests using sbt |"
echo "+----------------------------+"
sbt ++$TRAVIS_SCALA_VERSION test
import org.junit.Test;
import play.Application;
import play.test.Helpers;
import play.test.TestBrowser;
import play.test.WithBrowser;
import static org.junit.Assert.assertTrue;
import static play.test.Helpers.*;
public class BrowserTest extends WithBrowser {
protected Application provideApplication() {
return fakeApplication(inMemoryDatabase());
}
protected TestBrowser provideBrowser(int port) {
return Helpers.testBrowser(port);
}
/**
* add your integration test here
* in this example we just check if the welcome page is being shown
*/
@Test
public void test() {
browser.goTo("http://localhost:" + play.api.test.Helpers.testServerPort());
assertTrue(browser.pageSource().contains("Your new application is ready."));
}
}
import org.junit.Test;
import play.test.WithApplication;
import play.twirl.api.Content;
import static org.assertj.core.api.Assertions.assertThat;
/**
* A functional test starts a Play application for every test.
*
* https://www.playframework.com/documentation/latest/JavaFunctionalTest
*/
public class FunctionalTest extends WithApplication {
@Test
public void renderTemplate() {
// If you are calling out to Assets, then you must instantiate an application
// because it makes use of assets metadata that is configured from
// the application.
Content html = views.html.index.render("Your new application is ready.");
assertThat("text/html").isEqualTo(html.contentType());
assertThat(html.body()).contains("Your new application is ready.");
}
}
import akka.actor.ActorSystem;
import controllers.AsyncController;
import controllers.CountController;
import org.junit.Test;
import play.mvc.Result;
import scala.concurrent.ExecutionContextExecutor;
import java.util.concurrent.CompletionStage;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import static play.test.Helpers.contentAsString;
/**
* Unit testing does not require Play application start up.
*
* https://www.playframework.com/documentation/latest/JavaTest
*/
public class UnitTest {
@Test
public void simpleCheck() {
int a = 1 + 1;
assertThat(a).isEqualTo(2);
}
// Unit test a controller
@Test
public void testCount() {
final CountController controller = new CountController(() -> 49);
Result result = controller.count();
assertThat(contentAsString(result)).isEqualTo("49");
}
// Unit test a controller with async return
@Test
public void testAsync() {
final ActorSystem actorSystem = ActorSystem.create("test");
try {
final ExecutionContextExecutor ec = actorSystem.dispatcher();
final AsyncController controller = new AsyncController(actorSystem, ec);
final CompletionStage<Result> future = controller.message();
// Block until the result is completed
await().until(() -> {
assertThat(future.toCompletableFuture()).isCompletedWithValueMatching(result -> {
return contentAsString(result).equals("Hi!");
});
});
} finally {
actorSystem.terminate();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment