From cdb74558e500fadede7d54b5a2d264c4e42cc205 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 21 Sep 2015 12:15:25 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20added=20controller=20for=20rece?= =?utf8?q?icpt=20link=20(maybe=20not=20working)=20-=20updated=20jars=20Sig?= =?utf8?q?ned-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcore-ee-logger.jar | Bin 8006 -> 8032 bytes lib/jcoreee.jar | Bin 18592 -> 18795 bytes lib/jshop-core.jar | Bin 35810 -> 36825 bytes lib/jshop-ee-lib.jar | Bin 6865 -> 7239 bytes nbproject/build-impl.xml | 9 ++ nbproject/genfiles.properties | 6 +- nbproject/project.properties | 3 + nbproject/project.xml | 12 +++ .../localization/bundle_de_DE.properties | 1 + .../localization/bundle_en_US.properties | 1 + .../beans/checkout/CheckoutWebBean.java | 33 ++++++- .../beans/checkout/CheckoutWebController.java | 15 ++++ .../beans/customer/CustomerWebBean.java | 2 +- .../beans/customer/CustomerWebController.java | 2 +- .../beans/receipt/ReceiptWebBean.java | 83 ++++++++++++++++++ .../beans/receipt/ReceiptWebController.java | 48 ++++++++++ web/WEB-INF/faces-config.xml | 7 ++ web/WEB-INF/web.xml | 2 +- web/customer/checkout_done.xhtml | 6 +- 19 files changed, 219 insertions(+), 11 deletions(-) create mode 100644 src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebBean.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebController.java diff --git a/lib/jcore-ee-logger.jar b/lib/jcore-ee-logger.jar index 903d01684cac1cda94982d4a7c57c683c021ed75..a3e9a18a174e09d63605848180af6d80a61cb381 100644 GIT binary patch delta 985 zcmaJ=O-vI(6rSDf4_z|~wLsE^(h?FXWVaP)tE8;71R6x4A%=K^O4m)zwoBSdz{Hrw zlQ-zxOwdHRnHWt^A~y^tC3xjPG>SJ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!L^pVdb>Ia634HX{!O!Ug1_6Mo z!6`=rDxEF183{2$Xd64zv0}t%0>1IMm?FcxK)hjIA(qSmVqdTk_28L`f1UV?$KD0w z6@QR!Xm5gWAe4%VOZ(d~nw9yb3G3qx?mng2ZUx_)5!?=SP>rMEM(K@8q0fqrE=|W7 z#fb}HH>H<&`h`a6&G2ao>Gh4$vYSFz>(A0|hJ15no&gB!-Q9|_G&|=d;i$)pTfYCL tY0=(X0d!R@n$~I2wLlGaH8hj>&*safRW1^Cu1Y*-ka(%#xO34InSb8L{-FQ> delta 684 zcmX?ZanY1Fz?+$ci-CcIfx)24XdEKl!gX*JNKN4lsW+#>o=|y}5YV8MxRPxY-$a zCO;L-nOrM;RELp;k%5JQm4ShQiGdAFvV#H#$OgKHfdM7BHct~_2irJ#fv5#2;3nS| zg@lQ$m_9fR{KX())g|Tx=ARey0Mk<9{$Tomxb)<9aWg185KN0m1c2#ui2$&h5#crY zs6--IN>fsrNtSi8p_Ibp|BM`y^CS(x!V7`I9qe%7ckJ?$t69WSX zy8^uf14|mKCL2hFD1g-5@CiB40+a_~510ZVy`-_0XR@J$`sCA65MTY3l4eTh2MTFS zzQD^inNv`3@_$Jouo;K|W?-;EF(XV6s6l@6Drs%7!f&_c%54BD0AVW>g~GyMg%+aX NleJ~U*rY{3vH&h1taJbX diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 71688694..ee9577bd 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -882,6 +882,9 @@ exists or setup the property manually. For example like this: + + + @@ -890,6 +893,9 @@ exists or setup the property manually. For example like this: + + + @@ -1035,6 +1041,7 @@ exists or setup the property manually. For example like this: + @@ -1050,6 +1057,7 @@ exists or setup the property manually. For example like this: + @@ -1475,6 +1483,7 @@ exists or setup the property manually. For example like this: + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 96ec5171..6164bbce 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=d49c3b3c +build.xml.data.CRC32=6c97d849 build.xml.script.CRC32=82213886 build.xml.stylesheet.CRC32=651128d4@1.68.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=d49c3b3c -nbproject/build-impl.xml.script.CRC32=6d5d44eb +nbproject/build-impl.xml.data.CRC32=6c97d849 +nbproject/build-impl.xml.script.CRC32=353b1688 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index 71fed62f..4d8c4b20 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -60,6 +60,7 @@ j2ee.server.type=gfv3ee6 jar.compress=false javac.classpath=\ ${file.reference.jcore.jar}:\ + ${reference.jcore-logger-lib.jar}:\ ${reference.jcore-ee-logger.dist}:\ ${file.reference.jcoreee.jar}:\ ${file.reference.jshop-core.jar}:\ @@ -99,9 +100,11 @@ lib.dir=${web.docbase.dir}/WEB-INF/lib persistence.xml.dir=${conf.dir} platform.active=default_platform project.jcore-ee-logger=../jcore-ee-logger +project.jcore-logger-lib=../jcore-logger-lib project.license=gpl30 project.PizzaService-lib=../pizzaservice-lib reference.jcore-ee-logger.dist=${project.jcore-ee-logger}/dist/jcore-ee-logger.jar +reference.jcore-logger-lib.jar=${project.jcore-logger-lib}/dist/jcore-logger-lib.jar reference.PizzaService-lib.jar=${project.PizzaService-lib}/dist/PizzaService-lib.jar resource.dir=setup run.test.classpath=\ diff --git a/nbproject/project.xml b/nbproject/project.xml index be28ec74..6ebdb53c 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -10,6 +10,10 @@ ${file.reference.jcore.jar} WEB-INF/lib + + ${reference.jcore-logger-lib.jar} + WEB-INF/lib + ${reference.jcore-ee-logger.dist} WEB-INF/lib @@ -79,6 +83,14 @@ clean dist + + jcore-logger-lib + jar + + jar + clean + jar + diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index adf460f3..fafeed6e 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -164,3 +164,4 @@ PAGE_TITLE_CUSTOMER_CHECKOUT_DONE=Bestellvorgang abgeschlossen SUB_TITLE_CUSTOMER_CHECKOUT_DONE=Der Bestellvorgang ist abgeschlossen: PAGE_TITLE_CUSTOMER_EMPTY_BASKET=Leerer Warenkorb! SUB_TITLE_CUSTOMER_EMPTY_BASKET=Sie haben keine Artikel zum Warenkorb hinzugef\u00fcgt: +LINK_OPEN_RECEIPT=Rechnung ansehen diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 9c43e8de..a804c136 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -162,3 +162,4 @@ PAGE_TITLE_CUSTOMER_CHECKOUT_DONE=Checkout done SUB_TITLE_CUSTOMER_CHECKOUT_DONE=The checkout is completed: PAGE_TITLE_CUSTOMER_EMPTY_BASKET=Empty basket! SUB_TITLE_CUSTOMER_EMPTY_BASKET=You have no products added to basket: +LINK_OPEN_RECEIPT=View receipt diff --git a/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java index 3de6f0ea..eedb20d5 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebBean.java @@ -41,6 +41,7 @@ import org.mxchange.jshopcore.wrapper.CheckoutWrapper; import org.mxchange.jshopcore.wrapper.WrapableCheckout; import org.mxchange.pizzaapplication.beans.basket.BasketWebController; import org.mxchange.pizzaapplication.beans.customer.CustomerWebController; +import org.mxchange.pizzaapplication.beans.receipt.ReceiptWebController; /** * Checkout controller @@ -70,7 +71,7 @@ public class CheckoutWebBean extends BaseFrameworkBean implements CheckoutWebCon * Queue instance */ private Queue queue; - + /** * Session instance */ @@ -81,6 +82,11 @@ public class CheckoutWebBean extends BaseFrameworkBean implements CheckoutWebCon */ private ObjectMessage message; + /** + * Customer instance + */ + private Customer customer; + ////////////////////// Bean injections /////////////////////// /** * Basket bean @@ -94,6 +100,12 @@ public class CheckoutWebBean extends BaseFrameworkBean implements CheckoutWebCon @Inject private CustomerWebController customerController; + /** + * Receipt bean + */ + @Inject + private ReceiptWebController receiptController; + @Override public String doCheckout () { // Trace message @@ -124,10 +136,10 @@ public class CheckoutWebBean extends BaseFrameworkBean implements CheckoutWebCon } // Create customer instance - Customer customer = this.customerController.createInstance(); + this.setCustomer(this.customerController.createCustomerInstance()); // Debug message - this.getLogger().logDebug(MessageFormat.format("doCheckout: customer={0}", customer)); + this.getLogger().logDebug(MessageFormat.format("doCheckout: customer={0}", this.getCustomer())); // Get ordered list List list = this.basketController.allItems(); @@ -137,7 +149,7 @@ public class CheckoutWebBean extends BaseFrameworkBean implements CheckoutWebCon // Construct container WrapableCheckout wrapper = new CheckoutWrapper(); - wrapper.setCustomer(customer); + wrapper.setCustomer(this.getCustomer()); wrapper.setList(list); try { @@ -155,10 +167,23 @@ public class CheckoutWebBean extends BaseFrameworkBean implements CheckoutWebCon // Clear basket this.basketController.clear(); + // Set customer in receipt controller for verification + this.receiptController.setCustomer(this.getCustomer()); + // All fine return "checkout_done"; //NOI18N } + @Override + public Customer getCustomer () { + return this.customer; + } + + @Override + public void setCustomer (final Customer customer) { + this.customer = customer; + } + @PostConstruct public void init () { // Call super init for getting resource bundle diff --git a/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebController.java b/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebController.java index 4e30f29f..f314f02b 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/checkout/CheckoutWebController.java @@ -17,6 +17,7 @@ package org.mxchange.pizzaapplication.beans.checkout; import java.io.Serializable; +import org.mxchange.jshopcore.model.customer.Customer; /** * An interface for the shop @@ -30,4 +31,18 @@ public interface CheckoutWebController extends Serializable { * @return Page redirection target */ public String doCheckout (); + + /** + * Getter for customer instance + * + * @return Customer instance + */ + public Customer getCustomer (); + + /** + * Setter for customer instance + * + * @param customer Customer instance + */ + public void setCustomer (final Customer customer); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java index 298b056d..4bb35042 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java @@ -140,7 +140,7 @@ public class CustomerWebBean extends BaseFrameworkBean implements CustomerWebCon } @Override - public Customer createInstance () { + public Customer createCustomerInstance () { // Trace message this.getLogger().logTrace("createInstance: CALLED!"); // Required personal data must be set diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java index e912d05d..554e9c1d 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebController.java @@ -32,7 +32,7 @@ public interface CustomerWebController extends Serializable { * * @return A Customer instance */ - public Customer createInstance (); + public Customer createCustomerInstance (); /** * Gender of the contact diff --git a/src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebBean.java new file mode 100644 index 00000000..1c6c3e4a --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebBean.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.receipt; + +import javax.enterprise.context.SessionScoped; +import javax.faces.FacesException; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreee.beans.BaseFrameworkBean; +import org.mxchange.jshopcore.model.customer.Customer; +import org.mxchange.jshopcore.model.receipt.ReceiptBeanRemote; + +/** + * Checkout controller + * + * @author Roland Haeder + */ +@Named ("receiptController") +@SessionScoped +public class ReceiptWebBean extends BaseFrameworkBean implements ReceiptWebController { + + /** + * Serial number + */ + private static final long serialVersionUID = 95_723_834_783_478_781L; + + /** + * Customer instance + */ + private Customer customer; + + /** + * Remote bean instance + */ + private ReceiptBeanRemote receiptBean; + + /** + * Default constructor + */ + public ReceiptWebBean () { + try { + // Get initial context + Context context = new InitialContext(); + + // Get factory from JMS resource + this.receiptBean = (ReceiptBeanRemote) context.lookup("ejb/stateless-receipt"); + } catch (final NamingException e) { + // Continued to throw + throw new FacesException(e); + } + } + + @Override + public String fetchAccessKey () { + return this.receiptBean.fetchAccessKey(this.getCustomer()); + } + + @Override + public Customer getCustomer () { + return this.customer; + } + + @Override + public void setCustomer (final Customer customer) { + this.customer = customer; + } +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebController.java b/src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebController.java new file mode 100644 index 00000000..07f2bd66 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/receipt/ReceiptWebController.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.receipt; + +import java.io.Serializable; +import org.mxchange.jshopcore.model.customer.Customer; + +/** + * An interface for the shop + * + * @author Roland Haeder + */ +public interface ReceiptWebController extends Serializable { + /** + * Fetches last access key for given customer instance + * + * @return Access key to receipt + */ + public String fetchAccessKey (); + + /** + * Setter for customer instamce + * + * @param customer Customer instance + */ + public void setCustomer (final Customer customer); + + /** + * Getter for customer instamce + * + * @return Customer instance + */ + public Customer getCustomer (); +} diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 8a6b22d8..6c71590e 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -102,4 +102,11 @@ /customer/empty_basket.xhtml + + /admin/admin_logout.xhtml + + index + /* + + diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 6899c50e..30b3e002 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -22,7 +22,7 @@ text/plain - pdfRecipt + pdf /customer/recipt.pdf diff --git a/web/customer/checkout_done.xhtml b/web/customer/checkout_done.xhtml index 16460f55..4d1b8621 100644 --- a/web/customer/checkout_done.xhtml +++ b/web/customer/checkout_done.xhtml @@ -18,7 +18,11 @@ - TODO: Noch offen + Rechnung abrufen: + + + + -- 2.39.5