From 4abb01870371a63af794a9a23631147e5e4c261c Mon Sep 17 00:00:00 2001 From: Julian Hinxlage Date: Thu, 6 Jun 2019 11:18:07 +0200 Subject: [PATCH] +cart link to book ~more infos on cart and bookinfo --- src/main/java/de/hsel/itech/db/pojo/Book.java | 9 +++++++++ src/main/webapp/bookinfo.xhtml | 11 +++++++---- src/main/webapp/cart.xhtml | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/hsel/itech/db/pojo/Book.java b/src/main/java/de/hsel/itech/db/pojo/Book.java index def5539..5fba1d5 100644 --- a/src/main/java/de/hsel/itech/db/pojo/Book.java +++ b/src/main/java/de/hsel/itech/db/pojo/Book.java @@ -6,6 +6,7 @@ import lombok.NonNull; import lombok.RequiredArgsConstructor; import java.time.Year; +import java.util.ArrayList; import java.util.List; /** @@ -47,4 +48,12 @@ public class Book { return res; } + public String getAuthorsString(){ + List names = new ArrayList<>(); + for (Author author : getAuthors()){ + names.add(author.getName()); + } + return String.join(",", names); + } + } \ No newline at end of file diff --git a/src/main/webapp/bookinfo.xhtml b/src/main/webapp/bookinfo.xhtml index d9acf2f..982f073 100644 --- a/src/main/webapp/bookinfo.xhtml +++ b/src/main/webapp/bookinfo.xhtml @@ -31,11 +31,14 @@ alt="Buchcover"/>
-

#{bookBean.book.title}

+

#{bookBean.book.title}

+
+

+ von #{bookBean.book.authorsString} +

+
+ veröffentlicht von #{bookBean.book.publisher.name}
-

- #{bookBean.authors} -


#{bookBean.book.description} diff --git a/src/main/webapp/cart.xhtml b/src/main/webapp/cart.xhtml index 4aeb477..b8ba9a8 100644 --- a/src/main/webapp/cart.xhtml +++ b/src/main/webapp/cart.xhtml @@ -4,7 +4,7 @@ + xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:c="http://java.sun.com/jsf/html"> @@ -17,10 +17,20 @@
- Buchcover + Buchcover
-

#{item.article.title}

+ + + +

+ #{item.article.title} - #{item.article.authorsString} +

+
+
+
+ #{item.article.description}