Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2aa24b
commit eef7dda
Showing
15 changed files
with
183 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Web-ContextPath: /tasklist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>tasklist-blueprint-cdi</artifactId> | ||
<groupId>net.lr.tasklist.cdi</groupId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>tasklist-angular-ui</artifactId> | ||
<packaging>bundle</packaging> | ||
|
||
<name>tasklist-angular-ui</name> | ||
<description>angular-ui web bundle</description> | ||
|
||
</project> |
37 changes: 37 additions & 0 deletions
37
tasklist-blueprint-cdi/angular-ui/src/main/resources/app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(function() { | ||
var app = angular.module('myApp', []); | ||
app.factory("Post", function($resource) { | ||
return $resource("/cxf/tasklistRest"); | ||
}); | ||
|
||
app.controller('TaskController', function($scope, $http) { | ||
$scope.task = {}; | ||
$scope.reload = function() { | ||
$http.get("/cxf/tasklistRest") | ||
.success(function (response) {$scope.tasks = response.task;}); | ||
}; | ||
|
||
$scope.put = function() { | ||
var toSend = {task: $scope.task}; | ||
$http.put("/cxf/tasklistRest/" + $scope.task.id, toSend) | ||
.success(function (response) {$scope.reload();}); | ||
|
||
this.task = {}; | ||
}; | ||
|
||
$scope.delete = function(id) { | ||
$http.delete("/cxf/tasklistRest/"+ id) | ||
.success(function (response) {$scope.reload();}); | ||
$scope.task = {}; | ||
} | ||
|
||
$scope.select = function(id) { | ||
$scope.task = $scope.tasks[id]; | ||
} | ||
|
||
$scope.newTask = function(id) { | ||
$scope.task = {}; | ||
} | ||
$scope.reload(); | ||
}); | ||
})(); |
88 changes: 88 additions & 0 deletions
88
tasklist-blueprint-cdi/angular-ui/src/main/resources/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<style> | ||
table, th , td { | ||
border: 1px solid grey; | ||
border-collapse: collapse; | ||
padding: 5px; | ||
} | ||
table tr:nth-child(odd) { | ||
background-color: #f1f1f1; | ||
} | ||
table tr:nth-child(even) { | ||
background-color: #ffffff; | ||
} | ||
table tbody tr:hover { | ||
border-color: red; | ||
cursor: pointer; | ||
} | ||
</style> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> | ||
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script> | ||
<script src= "app.js"></script> | ||
<body> | ||
|
||
<h1>Tasks</h1> | ||
|
||
<div ng-app="myApp" ng-controller="TaskController as taskCtrl"> | ||
<div> | ||
<button class="btn btn-success" ng-click="reload()"><span class="glyphicon glyphicon-refresh"></span> Reload</button> | ||
<button class="btn btn-success" ng-click="newTask()"><span class="glyphicon glyphicon-plus"></span> New Task</button> | ||
</div> | ||
<hr> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Del</th> | ||
<th>Id</th> | ||
<th>Title</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tobdy> | ||
<tr ng-repeat="t in tasks"> | ||
<td><span class="glyphicon glyphicon-remove" ng-click="delete(t.id)"></span> <span class="glyphicon glyphicon-pencil" ng-click="select($index)"></span></td> | ||
<td>{{t.id}}</td> | ||
<td>{{t.title}}</td> | ||
<td>{{t.description}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<hr> | ||
|
||
<h2>Task</h2> | ||
|
||
<form class="form-horizontal" novalidate> | ||
<div class="form-group"> | ||
<label class="col-sm-1 control-label">Id:</label> | ||
<div class="col-sm-10"> | ||
<input type="text" ng-model="task.id"> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="col-sm-1 control-label">Title:</label> | ||
<div class="col-sm-10"> | ||
<input type="text" ng-model="task.title"> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="col-sm-1 control-label">Description:</label> | ||
<div class="col-sm-10"> | ||
<input type="text" ng-model="task.description"> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label class="col-sm-1 control-label"></label> | ||
<div class="col-sm-10"> | ||
<button class="btn btn-success" ng-click="put()"><span class="glyphicon glyphicon-save"></span> Save</button> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Meta-Persistence: \ | ||
META-INF/persistence.xml | ||
Import-Package: \ | ||
org.hibernate.proxy, \ | ||
javassist.util.proxy, \ | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>net.lr.tasklist.cdi</groupId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<artifactId>tasklist-blueprint-cdi</artifactId> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>net.lr.tasklist.cdi</groupId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<artifactId>tasklist-blueprint-cdi</artifactId> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<packaging>bundle</packaging> | ||
<artifactId>tasklist-model</artifactId> | ||
<packaging>bundle</packaging> | ||
<artifactId>tasklist-model</artifactId> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<configuration> | ||
<instructions> | ||
<Meta-Persistence>META-INF/persistence.xml</Meta-Persistence> | ||
<!-- Needed for runtime enhancement --> | ||
<Import-Package>*, org.hibernate.proxy, javassist.util.proxy</Import-Package> | ||
</instructions> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-dsannotations: * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-dsannotations: * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.