This file contains hidden or 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
package test; | |
import java.io.FileNotFoundException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.Reader; | |
import javax.script.Compilable; | |
import javax.script.CompiledScript; | |
import javax.script.Invocable; |
This file contains hidden or 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
+---webapp <===== la page index et le fichier appcache sont générés à la racine | |
+---cssext <===== css externes (bootstrap ...) | |
+---cssin <===== css propre à l'application | |
+---gen <===== tous les autres fichiers générés sont dans ce répertoire | |
¦ +---js <===== contrôleur principal de l'application | |
¦ +---jsmodules <===== fichiers javascript (contrôleur et service) pour chaque entité | |
¦ +---pages <===== pages html pour chaque entité | |
¦ +---partials <===== header et footer html | |
+---img <===== images de l'application (bootstrap) | |
+---jsext <===== librairies javascript externes (jquery, bootstrap ...) |
This file contains hidden or 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
<div id="authorCreate" data-ng-controller="AuthorCreateCtrl"> | |
<h2>Author Create</h2> | |
<form class="form-horizontal"> | |
<div class="control-group"> | |
<label class="control-label" for="id">id</label> | |
<div class="controls"> |
This file contains hidden or 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
{ | |
"entities": { | |
"author": { | |
"uuid1": { | |
"firstName": "prenom", | |
"id": "1", | |
"lastName": "nom" | |
}, | |
"uuid2": {} | |
}, |
This file contains hidden or 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
bookStoreauthor.controller('AuthorDetailCtrl', ['$scope', '$location', '$routeParams', '$rootScope', 'ApiAuthor', 'ApiStorage', function ($scope, $location, $routeParams, $rootScope, ApiAuthor, ApiStorage) { | |
$rootScope.logMe("AuthorDetailCtrl"); | |
$scope.idCurrent = $routeParams.id; | |
$rootScope.logMe("get author "); | |
$scope.oneauthor = ApiAuthor.get($scope.idCurrent); | |
... |
This file contains hidden or 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
// author Controllers | |
bookStoreauthor.controller('AuthorListCtrl', ['$scope', '$location', '$routeParams', '$rootScope', 'ApiAuthor', 'ApiStorage', function ($scope, $location, $routeParams, $rootScope, ApiAuthor, ApiStorage) { | |
$rootScope.logMe("AuthorListCtrl"); | |
var self = this; | |
$scope.authors = ApiAuthor.search(); | |
$rootScope.logMe("search end"); | |
// new Author call |
This file contains hidden or 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
// author module add into global module (see mainctrl.js) | |
var bookStoreauthor = angular.module('bookStore.author', ['bookStore.author.services'], function($routeProvider, $locationProvider) { | |
// author list | |
$routeProvider.when('/author', { | |
templateUrl: 'gen/pages/author/list.html' | |
}); | |
// author create |
This file contains hidden or 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
// Force template cache to allow offline for all partials | |
$http.get('gen/partials/footer.html', {cache:$templateCache}); | |
$http.get('gen/partials/header.html', {cache:$templateCache}); | |
$http.get('partials/inprogress.html', {cache:$templateCache}); | |
$http.get('partials/welcome.html', {cache:$templateCache}); | |
$http.get('gen/pages/author/create.html', {cache:$templateCache}); | |
$http.get('gen/pages/author/edit.html', {cache:$templateCache}); | |
$http.get('gen/pages/author/list.html', {cache:$templateCache}); | |
This file contains hidden or 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
// Detect html5 compliance with Modernizr | |
$rootScope.localstorageEnable = Modernizr.localstorage; | |
$rootScope.offlineEnable = Modernizr.applicationcache; | |
$rootScope.logMe("localstorage : " + $rootScope.localstorageEnable); | |
$rootScope.logMe("offline : " + $rootScope.offlineEnable); | |
if (($rootScope.offlineEnable == false) || ($rootScope.localstorageEnable == false)) { | |
toastr.error("Your browser isn't applicationCache compliant !"); | |
} else { | |
// localstorage conf and init |
This file contains hidden or 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
// Welcome module | |
var bookStoremain = angular.module('bookStore.main', [], function($routeProvider, $locationProvider) { | |
// Declare welcome route | |
$routeProvider.when('/welcome', { | |
templateUrl : 'partials/welcome.html', | |
controller: 'MainCtrl' | |
}); | |
// Declare futur route |