Skip to content

Commit cdbaa7c

Browse files
committed
Added Author and Book service location replacement
1 parent 1230dd2 commit cdbaa7c

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

README.adoc

+9-3
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,14 @@ project-new --named bookstorefrontend --stack JAVA_EE_7 --type wildfly-swarm --h
171171
wildfly-swarm-add-fraction --fractions undertow
172172
mv ../bookservice/src/main/webapp/ src/main/
173173
174-
# manual step : change the url in the angular services to point
174+
# Keep empty src/main/webapp/WEB-INF
175+
mkdir ../bookservice/src/main/webapp
176+
mkdir ../bookservice/src/main/webapp/WEB-INF
177+
178+
# change the url in the angular services to point
175179
# to http://localhost:8080/rest/ in src/main/webapp/scripts/services
180+
cp ../frontend_assets/services/AuthorFactory.js src/main/webapp/scripts/services/
181+
cp ../frontend_assets/services/BookFactory.js src/main/webapp/scripts/services/
176182
----
177183

178184
=== Create The SellingPoint service Project in Forge
@@ -307,8 +313,8 @@ cd ..
307313
308314
# secure the sellingPoint
309315
310-
cp sellingpoint_assets/keycloak.json sellingpoint/src/main/webapp/WEB-INF
311-
cd sellingpoint
316+
cp sellingpoint_assets/keycloak.json sellingPoint/src/main/webapp/WEB-INF
317+
cd sellingPoint
312318
wildfly-swarm-add-fraction --fractions keycloak
313319
security-add-login-config --auth-method KEYCLOAK --security-realm master
314320
security-add-constraint --web-resource-name SellingPoint --url-patterns /rest/* --security-roles user
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('bookservice').factory('AuthorResource', function($resource){
2+
var resource = $resource('http://localhost:8080/rest/authors/:AuthorId',{AuthorId:'@id'},{'queryAll':{method:'GET',isArray:true},'query':{method:'GET',isArray:false},'update':{method:'PUT'}});
3+
return resource;
4+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('bookservice').factory('BookResource', function($resource){
2+
var resource = $resource('http://localhost:8080/rest/books/:BookId',{BookId:'@id'},{'queryAll':{method:'GET',isArray:true},'query':{method:'GET',isArray:false},'update':{method:'PUT'}});
3+
return resource;
4+
});

scripts/security.fsh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# security steps , make sure a kc server is running and that the demo realm has been importet (holrealm.json)
1+
# security steps , make sure a kc server is running and that the demo realm has been imported (holrealm.json)
22

33
# secure the bookService
44

@@ -29,8 +29,8 @@ cd ..
2929
3030
# secure the sellingPoint
3131
32-
cp sellingpoint_assets/keycloak.json sellingpoint/src/main/webapp/WEB-INF
33-
cd sellingpoint
32+
cp sellingpoint_assets/keycloak.json sellingPoint/src/main/webapp/WEB-INF
33+
cd sellingPoint
3434
wildfly-swarm-add-fraction --fractions keycloak
3535
security-add-login-config --auth-method KEYCLOAK --security-realm master
3636
security-add-constraint --web-resource-name SellingPoint --url-patterns /rest/* --security-roles user

scripts/wsfk-hol.fsh

+8-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ cd ..
4646
project-new --named bookstorefrontend --stack JAVA_EE_7 --type wildfly-swarm --http-port 8081
4747
wildfly-swarm-add-fraction --fractions undertow
4848
mv ../bookservice/src/main/webapp/ src/main/
49-
# manual step : change the url in the angular services to point
50-
# to http://localhost:8080/rest/ in src/main/webapp/scripts/services
49+
50+
# Keep empty src/main/webapp/WEB-INF
51+
mkdir ../bookservice/src/main/webapp
52+
mkdir ../bookservice/src/main/webapp/WEB-INF
5153

5254
cd ~~
5355
cd ..
@@ -84,6 +86,10 @@ cd ~~
8486
cd ..
8587

8688

89+
#---------------- Update front end to consume Author and Books from new service
90+
cp frontend_assets/services/AuthorFactory.js bookstorefrontend/src/main/webapp/scripts/services/
91+
cp frontend_assets/services/BookFactory.js bookstorefrontend/src/main/webapp/scripts/services/
92+
8793
#---------------- Update front end to consume Selling points from new service
8894
cp frontend_assets/sellingpoint/search.html bookstorefrontend/src/main/webapp/views/SellingPoint
8995
cp frontend_assets/sellingpoint/searchSellingPointController.js bookstorefrontend/src/main/webapp/scripts/controllers

0 commit comments

Comments
 (0)