From: Roland Haeder Date: Wed, 27 Apr 2016 20:02:15 +0000 (+0200) Subject: updated (maybe not cherry-pick this) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=082638190d3515abcdf3b6bdb0c2ffd35d006cde;p=pizzaservice-war.git updated (maybe not cherry-pick this) Signed-off-by: Roland Häder --- diff --git a/src/java/de/chotime/jratecalc/beans/customer/RateCalcAdminCustomerWebRequestBean.java b/src/java/de/chotime/jratecalc/beans/customer/RateCalcAdminCustomerWebRequestBean.java deleted file mode 100644 index 200bec9a..00000000 --- a/src/java/de/chotime/jratecalc/beans/customer/RateCalcAdminCustomerWebRequestBean.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2016 Cho-Time GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package de.chotime.jratecalc.beans.customer; - -import de.chotime.jratecalc.model.customer.RateCalcAdminCustomerSessionBeanRemote; -import java.util.Collections; -import java.util.List; -import javax.annotation.PostConstruct; -import javax.enterprise.context.RequestScoped; -import javax.faces.view.facelets.FaceletException; -import javax.inject.Named; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcustomercore.model.customer.Customer; - -/** - * Administrative customer bean (controller) - *

- * @author Roland Haeder - */ -@Named ("adminCustomerController") -@RequestScoped -public class RateCalcAdminCustomerWebRequestBean implements RateCalcAdminCustomerWebRequestController { - - /** - * Serial number - */ - private static final long serialVersionUID = 12_487_062_487_527_913L; - - /** - * Administrative customer EJB - */ - private RateCalcAdminCustomerSessionBeanRemote adminCustomerBean; - - /** - * A list of all customers - */ - private List customerList; - - /** - * Default constructor - */ - public RateCalcAdminCustomerWebRequestBean () { - // Try it - try { - // Get initial context - Context context = new InitialContext(); - - // Try to lookup - this.adminCustomerBean = (RateCalcAdminCustomerSessionBeanRemote) context.lookup("java:global/jratecalc-ejb/admincustomer!de.chotime.jratecalc.model.customer.RateCalcAdminCustomerSessionBeanRemote"); //NOI18N - } catch (final NamingException e) { - // Throw again - throw new FaceletException(e); - } - } - - @Override - public List allCustomers () { - // Return it - return Collections.unmodifiableList(this.customerList); - } - - @Override - public boolean hasCustomers () { - return (!this.allCustomers().isEmpty()); - } - - /** - * Post-initialization of this class - */ - @PostConstruct - public void init () { - // Initialize customer list - this.customerList = this.adminCustomerBean.allCustomers(); - } - -} diff --git a/src/java/de/chotime/jratecalc/beans/customer/RateCalcAdminCustomerWebRequestController.java b/src/java/de/chotime/jratecalc/beans/customer/RateCalcAdminCustomerWebRequestController.java deleted file mode 100644 index bc50cd53..00000000 --- a/src/java/de/chotime/jratecalc/beans/customer/RateCalcAdminCustomerWebRequestController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2016 Cho-Time GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package de.chotime.jratecalc.beans.customer; - -import java.io.Serializable; -import java.util.List; -import org.mxchange.jcustomercore.model.customer.Customer; - -/** - * An interface for user beans - *

- * @author Roland Haeder - */ -public interface RateCalcAdminCustomerWebRequestController extends Serializable { - - /** - * All customer - *

- * @return A list of all customer profiles - */ - List allCustomers (); - - /** - * Checks whether customers are registered - *

- * @return Whether customers are registered - */ - boolean hasCustomers (); - -} diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java new file mode 100644 index 00000000..9536ebec --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.customer; + +import java.util.Collections; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.enterprise.context.RequestScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcustomercore.model.customer.Customer; +import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote; + +/** + * Administrative customer bean (controller) + *

+ * @author Roland Haeder + */ +@Named ("adminCustomerController") +@RequestScoped +public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRequestController { + + /** + * Serial number + */ + private static final long serialVersionUID = 12_487_062_487_527_913L; + + /** + * Administrative customer EJB + */ + private PizzaAdminCustomerSessionBeanRemote adminCustomerBean; + + /** + * A list of all customers + */ + private List customerList; + + /** + * Default constructor + */ + public PizzaAdminCustomerWebRequestBean () { + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.adminCustomerBean = (PizzaAdminCustomerSessionBeanRemote) context.lookup("java:global/PizzaService-ejb/admincustomer!org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw again + throw new FaceletException(e); + } + } + + @Override + public List allCustomers () { + // Return it + return Collections.unmodifiableList(this.customerList); + } + + @Override + public boolean hasCustomers () { + return (!this.allCustomers().isEmpty()); + } + + /** + * Post-initialization of this class + */ + @PostConstruct + public void init () { + // Initialize customer list + this.customerList = this.adminCustomerBean.allCustomers(); + } + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestController.java new file mode 100644 index 00000000..daddfd88 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestController.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.customer; + +import java.io.Serializable; +import java.util.List; +import org.mxchange.jcustomercore.model.customer.Customer; + +/** + * An interface for user beans + *

+ * @author Roland Haeder + */ +public interface PizzaAdminCustomerWebRequestController extends Serializable { + + /** + * All customer + *

+ * @return A list of all customer profiles + */ + List allCustomers (); + + /** + * Checks whether customers are registered + *

+ * @return Whether customers are registered + */ + boolean hasCustomers (); + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestHelper.java b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestHelper.java index 284858a4..6d538c23 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestHelper.java +++ b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestHelper.java @@ -16,8 +16,6 @@ */ package org.mxchange.pizzaapplication.beans.helper; -import de.chotime.jratecalc.beans.contact.RateCalcAdminContactWebRequestController; -import de.chotime.jratecalc.beans.user.RateCalcAdminUserWebRequestController; import java.text.MessageFormat; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; diff --git a/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestController.java new file mode 100644 index 00000000..3541725e --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestController.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.profile; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * A bean interface for user profiles + *

+ * @author Roland Haeder + */ +public interface PizzaUserProfileWebRequestController extends Serializable { + + /** + * Checks if the user profile link is visible + *

+ * @param userId User id + *

+ * @return Whether the profile link is visible + */ + boolean isProfileLinkVisibleById (final Long userId); + + /** + * Checks if given user's profile is visible + *

+ * @param user User instance to check + *

+ * @return Whether the user's profile is visible + */ + boolean isProfileLinkVisibleByUser (final User user); + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationController.java b/src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationController.java new file mode 100644 index 00000000..e576dca0 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationController.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.profilemode; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; + +/** + * An interface for data beans + *

+ * @author Roland Haeder + */ +public interface PizzaProfileModeWebApplicationController extends Serializable { + + /** + * Getter for all genders as array + *

+ * @return All genders as array + */ + ProfileMode[] getAllProfileModes (); + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java index ec2786a4..6f98b9c6 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java @@ -16,8 +16,6 @@ */ package org.mxchange.pizzaapplication.beans.user; -import de.chotime.jratecalc.beans.contact.RateCalcContactWebSessionController; -import de.chotime.jratecalc.beans.helper.RateCalcAdminWebRequestController; import java.text.MessageFormat; import java.util.Collections; import java.util.Iterator;