From: Roland Häder Date: Thu, 27 Jul 2017 21:08:56 +0000 (+0200) Subject: Please repeat: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6dccec0d6e6c486e47ec01bd06425065eb1f900b;p=jfinancials-war.git Please repeat: - renamed package to businessdata (not just contact, okay, still the newly added depdencies are named like that) - renamed classes/interfaces accordingly - removed Local annotation as this is for local EJBs (?) Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebRequestBean.java deleted file mode 100644 index aa8e0417..00000000 --- a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebRequestBean.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (C) 2016, 2017 Roland Häder - * - * 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.jfinancials.beans.businesscontact; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.SessionScoped; -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.jcontactsbusiness.BusinessDataAdminSessionBeanRemote; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jfinancials.beans.BaseFinancialsController; - -/** - * An administrative business contact bean (controller) - *

- * @author Roland Häder - */ -@Named ("adminBusinessDataController") -@SessionScoped -public class FinancialsAdminBusinessContactWebRequestBean extends BaseFinancialsController implements FinancialsAdminBusinessContactWebRequestController { - - /** - * Serial number - */ - private static final long serialVersionUID = 56_189_028_928_374L; - - /** - * Remote contact bean - */ - private BusinessDataAdminSessionBeanRemote adminBusinessDataBean; - - /** - * Comments for this company - */ - private String companyComments; - - /** - * Companies (main) email address (example: info@company.example) - */ - private String companyEmailAddress; - - /** - * Company legal status (example: Incorporated, GmbH) - */ - private String companyLegalStatus; - - /** - * Company name - */ - private String companyName; - - /** - * Area code for fax number - */ - private Integer faxAreaCode; - - /** - * Country for fax number - */ - private Country faxCountry; - - /** - * Dial number for fax number - */ - private Long faxNumber; - - /** - * Area code for land-line number - */ - private Integer landLineAreaCode; - - /** - * Country for land-line number - */ - private Country landLineCountry; - - /** - * Dial number for land-line number - */ - private Long landLineNumber; - - /** - * Constructor - */ - public FinancialsAdminBusinessContactWebRequestBean () { - // Call super constructor - super(); - } - - /** - * Getter for comments - *

- * @return Comments - */ - public String getCompanyComments () { - return this.companyComments; - } - - /** - * Setter for comments - *

- * @param companyComments Comments - */ - public void setCompanyComments (final String companyComments) { - this.companyComments = companyComments; - } - - /** - * Getter for company's (main) email address - *

- * @return Company's (main) email address - */ - public String getCompanyEmailAddress () { - return this.companyEmailAddress; - } - - /** - * Setter for company's (main) email address - *

- * @param companyEmailAddress Company's (main) email address - */ - public void setCompanyEmailAddress (final String companyEmailAddress) { - this.companyEmailAddress = companyEmailAddress; - } - - /** - * Getter for company's legal status - *

- * @return Company's legal status - */ - public String getCompanyLegalStatus () { - return this.companyLegalStatus; - } - - /** - * Setter for company's legal status - *

- * @param companyLegalStatus Company's legal status - */ - public void setCompanyLegalStatus (final String companyLegalStatus) { - this.companyLegalStatus = companyLegalStatus; - } - - /** - * Getter for company name - *

- * @return Company name - */ - public String getCompanyName () { - return this.companyName; - } - - /** - * Setter for company name - *

- * @param companyName Company name - */ - public void setCompanyName (final String companyName) { - this.companyName = companyName; - } - - /** - * Getter for fax number's area code - *

- * @return Fax number's area code - */ - public Integer getFaxAreaCode () { - return this.faxAreaCode; - } - - /** - * Setter for fax number's area code - *

- * @param faxAreaCode Fax number's area code - */ - public void setFaxAreaCode (final Integer faxAreaCode) { - this.faxAreaCode = faxAreaCode; - } - - /** - * Getter for fax's country instance - *

- * @return Fax' country instance - */ - public Country getFaxCountry () { - return this.faxCountry; - } - - /** - * Setter for fax's country instance - *

- * @param faxCountry Fax' country instance - */ - public void setFaxCountry (final Country faxCountry) { - this.faxCountry = faxCountry; - } - - /** - * Getter for fax number - *

- * @return Fax number - */ - public Long getFaxNumber () { - return this.faxNumber; - } - - /** - * Setter for fax number - *

- * @param faxNumber Fax number - */ - public void setFaxNumber (final Long faxNumber) { - this.faxNumber = faxNumber; - } - - /** - * Getter for land-line number's area code - *

- * @return Land-line number's area code - */ - public Integer getLandLineAreaCode () { - return this.landLineAreaCode; - } - - /** - * Setter for land-line number's area code - *

- * @param landLineAreaCode Land-line number's area code - */ - public void setLandLineAreaCode (final Integer landLineAreaCode) { - this.landLineAreaCode = landLineAreaCode; - } - - /** - * Getter for land-line number's country instance - *

- * @return Land-line number's country instance - */ - public Country getLandLineCountry () { - return this.landLineCountry; - } - - /** - * Setter for land-line number's country instance - *

- * @param landLineCountry Land-line number's country instance - */ - public void setLandLineCountry (final Country landLineCountry) { - this.landLineCountry = landLineCountry; - } - - /** - * Getter for land-line number - *

- * @return Land-line number - */ - public Long getLandLineNumber () { - return this.landLineNumber; - } - - /** - * Setter for land-line number - *

- * @param landLineNumber Land-line number - */ - public void setLandLineNumber (final Long landLineNumber) { - this.landLineNumber = landLineNumber; - } - - /** - * Post-initialization of this class - */ - @PostConstruct - public void init () { - // Try it - try { - // Get initial context - Context context = new InitialContext(); - - // Try to lookup - this.adminBusinessDataBean = (BusinessDataAdminSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote"); //NOI18N - } catch (final NamingException e) { - // Throw again - throw new FaceletException(e); - } - } - -} diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebRequestController.java deleted file mode 100644 index d4c97d25..00000000 --- a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsAdminBusinessContactWebRequestController.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2017 Roland Häder - * - * 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.jfinancials.beans.businesscontact; - -import java.io.Serializable; -import javax.ejb.Local; - -/** - * An interface for session-scoped financial controller - *

- * @author Roland Häder - */ -@Local -public interface FinancialsAdminBusinessContactWebRequestController extends Serializable { - -} diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionBean.java deleted file mode 100644 index ca8995ea..00000000 --- a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionBean.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (C) 2016, 2017 Roland Häder - * - * 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.jfinancials.beans.businesscontact; - -import java.util.List; -import javax.annotation.PostConstruct; -import javax.enterprise.context.RequestScoped; -import javax.faces.view.facelets.FaceletException; -import javax.inject.Inject; -import javax.inject.Named; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcontactsbusiness.BusinessBasicData; -import org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote; -import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote; -import org.mxchange.jcountry.data.Country; -import org.mxchange.jfinancials.beans.BaseFinancialsController; -import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController; - -/** - * A business contact bean (controller) - *

- * @author Roland Häder - */ -@Named ("businessDataController") -@RequestScoped -public class FinancialsBusinessContactWebSessionBean extends BaseFinancialsController implements FinancialsBusinessContactWebSessionController { - - /** - * Serial number - */ - private static final long serialVersionUID = 56_189_028_928_371L; - - /** - * Remote contact bean - */ - private BusinessDataAdminSessionBeanRemote adminBusinessDataBean; - - /** - * A list of all registered companies (globally) - */ - private List businessContacts; - - /** - * Remote contact bean - */ - private BusinessDataSessionBeanRemote businessDataBean; - - /** - * Comments for this company - */ - private String companyComments; - - /** - * Companies (main) email address (example: info@company.example) - */ - private String companyEmailAddress; - - /** - * Company legal status (example: Incorporated, GmbH) - */ - private String companyLegalStatus; - - /** - * Company name - */ - private String companyName; - - /** - * Area code for fax number - */ - private Integer faxAreaCode; - - /** - * Country for fax number - */ - private Country faxCountry; - - /** - * Dial number for fax number - */ - private Long faxNumber; - - /** - * Area code for land-line number - */ - private Integer landLineAreaCode; - - /** - * Country for land-line number - */ - private Country landLineCountry; - - /** - * Dial number for land-line number - */ - private Long landLineNumber; - - /** - * User instance - */ - @Inject - private FinancialsUserLoginWebSessionController userLoginController; - - /** - * Constructor - */ - public FinancialsBusinessContactWebSessionBean () { - // Call super constructor - super(); - } - - @Override - @SuppressWarnings ("ReturnOfCollectionOrArrayField") - public List allBusinessContacts () { - return this.businessContacts; - } - - /** - * Getter for comments - *

- * @return Comments - */ - public String getCompanyComments () { - return this.companyComments; - } - - /** - * Setter for comments - *

- * @param companyComments Comments - */ - public void setCompanyComments (final String companyComments) { - this.companyComments = companyComments; - } - - /** - * Getter for company's (main) email address - *

- * @return Company's (main) email address - */ - public String getCompanyEmailAddress () { - return this.companyEmailAddress; - } - - /** - * Setter for company's (main) email address - *

- * @param companyEmailAddress Company's (main) email address - */ - public void setCompanyEmailAddress (final String companyEmailAddress) { - this.companyEmailAddress = companyEmailAddress; - } - - /** - * Getter for company's legal status - *

- * @return Company's legal status - */ - public String getCompanyLegalStatus () { - return this.companyLegalStatus; - } - - /** - * Setter for company's legal status - *

- * @param companyLegalStatus Company's legal status - */ - public void setCompanyLegalStatus (final String companyLegalStatus) { - this.companyLegalStatus = companyLegalStatus; - } - - /** - * Getter for company name - *

- * @return Company name - */ - public String getCompanyName () { - return this.companyName; - } - - /** - * Setter for company name - *

- * @param companyName Company name - */ - public void setCompanyName (final String companyName) { - this.companyName = companyName; - } - - /** - * Getter for fax number's area code - *

- * @return Fax number's area code - */ - public Integer getFaxAreaCode () { - return this.faxAreaCode; - } - - /** - * Setter for fax number's area code - *

- * @param faxAreaCode Fax number's area code - */ - public void setFaxAreaCode (final Integer faxAreaCode) { - this.faxAreaCode = faxAreaCode; - } - - /** - * Getter for fax's country instance - *

- * @return Fax' country instance - */ - public Country getFaxCountry () { - return this.faxCountry; - } - - /** - * Setter for fax's country instance - *

- * @param faxCountry Fax' country instance - */ - public void setFaxCountry (final Country faxCountry) { - this.faxCountry = faxCountry; - } - - /** - * Getter for fax number - *

- * @return Fax number - */ - public Long getFaxNumber () { - return this.faxNumber; - } - - /** - * Setter for fax number - *

- * @param faxNumber Fax number - */ - public void setFaxNumber (final Long faxNumber) { - this.faxNumber = faxNumber; - } - - /** - * Getter for land-line number's area code - *

- * @return Land-line number's area code - */ - public Integer getLandLineAreaCode () { - return this.landLineAreaCode; - } - - /** - * Setter for land-line number's area code - *

- * @param landLineAreaCode Land-line number's area code - */ - public void setLandLineAreaCode (final Integer landLineAreaCode) { - this.landLineAreaCode = landLineAreaCode; - } - - /** - * Getter for land-line number's country instance - *

- * @return Land-line number's country instance - */ - public Country getLandLineCountry () { - return this.landLineCountry; - } - - /** - * Setter for land-line number's country instance - *

- * @param landLineCountry Land-line number's country instance - */ - public void setLandLineCountry (final Country landLineCountry) { - this.landLineCountry = landLineCountry; - } - - /** - * Getter for land-line number - *

- * @return Land-line number - */ - public Long getLandLineNumber () { - return this.landLineNumber; - } - - /** - * Setter for land-line number - *

- * @param landLineNumber Land-line number - */ - public void setLandLineNumber (final Long landLineNumber) { - this.landLineNumber = landLineNumber; - } - - /** - * Post-initialization of this class - */ - @PostConstruct - public void init () { - // Try it - try { - // Get initial context - Context context = new InitialContext(); - - // Try to lookup - this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote"); //NOI18N - - // Try to lookup - this.adminBusinessDataBean = (BusinessDataAdminSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote"); //NOI18N - } catch (final NamingException e) { - // Throw again - throw new FaceletException(e); - } - - // Init user's contact list - this.businessContacts = this.adminBusinessDataBean.allBusinessContacts(); - } - -} diff --git a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionController.java b/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionController.java deleted file mode 100644 index dc1d93d3..00000000 --- a/src/java/org/mxchange/jfinancials/beans/businesscontact/FinancialsBusinessContactWebSessionController.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2017 Roland Häder - * - * 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.jfinancials.beans.businesscontact; - -import java.io.Serializable; -import java.util.List; -import javax.ejb.Local; -import org.mxchange.jcontactsbusiness.BusinessBasicData; - -/** - * An interface for session-scoped financial controller - *

- * @author Roland Häder - */ -@Local -public interface FinancialsBusinessContactWebSessionController extends Serializable { - - /** - * Returns a list of all business contacts - *

- * @return A list of all business contacts - */ - List allBusinessContacts (); - -} diff --git a/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsAdminBusinessDataWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsAdminBusinessDataWebRequestBean.java new file mode 100644 index 00000000..42c5a160 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsAdminBusinessDataWebRequestBean.java @@ -0,0 +1,305 @@ +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * 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.jfinancials.beans.businessdata; + +import javax.annotation.PostConstruct; +import javax.enterprise.context.SessionScoped; +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.jcontactsbusiness.BusinessDataAdminSessionBeanRemote; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jfinancials.beans.BaseFinancialsController; + +/** + * An administrative business contact bean (controller) + *

+ * @author Roland Häder + */ +@Named ("adminBusinessDataController") +@SessionScoped +public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsController implements FinancialsAdminBusinessDataWebRequestController { + + /** + * Serial number + */ + private static final long serialVersionUID = 56_189_028_928_374L; + + /** + * Remote contact bean + */ + private BusinessDataAdminSessionBeanRemote adminBusinessDataBean; + + /** + * Comments for this company + */ + private String companyComments; + + /** + * Companies (main) email address (example: info@company.example) + */ + private String companyEmailAddress; + + /** + * Company legal status (example: Incorporated, GmbH) + */ + private String companyLegalStatus; + + /** + * Company name + */ + private String companyName; + + /** + * Area code for fax number + */ + private Integer faxAreaCode; + + /** + * Country for fax number + */ + private Country faxCountry; + + /** + * Dial number for fax number + */ + private Long faxNumber; + + /** + * Area code for land-line number + */ + private Integer landLineAreaCode; + + /** + * Country for land-line number + */ + private Country landLineCountry; + + /** + * Dial number for land-line number + */ + private Long landLineNumber; + + /** + * Constructor + */ + public FinancialsAdminBusinessDataWebRequestBean () { + // Call super constructor + super(); + } + + /** + * Getter for comments + *

+ * @return Comments + */ + public String getCompanyComments () { + return this.companyComments; + } + + /** + * Setter for comments + *

+ * @param companyComments Comments + */ + public void setCompanyComments (final String companyComments) { + this.companyComments = companyComments; + } + + /** + * Getter for company's (main) email address + *

+ * @return Company's (main) email address + */ + public String getCompanyEmailAddress () { + return this.companyEmailAddress; + } + + /** + * Setter for company's (main) email address + *

+ * @param companyEmailAddress Company's (main) email address + */ + public void setCompanyEmailAddress (final String companyEmailAddress) { + this.companyEmailAddress = companyEmailAddress; + } + + /** + * Getter for company's legal status + *

+ * @return Company's legal status + */ + public String getCompanyLegalStatus () { + return this.companyLegalStatus; + } + + /** + * Setter for company's legal status + *

+ * @param companyLegalStatus Company's legal status + */ + public void setCompanyLegalStatus (final String companyLegalStatus) { + this.companyLegalStatus = companyLegalStatus; + } + + /** + * Getter for company name + *

+ * @return Company name + */ + public String getCompanyName () { + return this.companyName; + } + + /** + * Setter for company name + *

+ * @param companyName Company name + */ + public void setCompanyName (final String companyName) { + this.companyName = companyName; + } + + /** + * Getter for fax number's area code + *

+ * @return Fax number's area code + */ + public Integer getFaxAreaCode () { + return this.faxAreaCode; + } + + /** + * Setter for fax number's area code + *

+ * @param faxAreaCode Fax number's area code + */ + public void setFaxAreaCode (final Integer faxAreaCode) { + this.faxAreaCode = faxAreaCode; + } + + /** + * Getter for fax's country instance + *

+ * @return Fax' country instance + */ + public Country getFaxCountry () { + return this.faxCountry; + } + + /** + * Setter for fax's country instance + *

+ * @param faxCountry Fax' country instance + */ + public void setFaxCountry (final Country faxCountry) { + this.faxCountry = faxCountry; + } + + /** + * Getter for fax number + *

+ * @return Fax number + */ + public Long getFaxNumber () { + return this.faxNumber; + } + + /** + * Setter for fax number + *

+ * @param faxNumber Fax number + */ + public void setFaxNumber (final Long faxNumber) { + this.faxNumber = faxNumber; + } + + /** + * Getter for land-line number's area code + *

+ * @return Land-line number's area code + */ + public Integer getLandLineAreaCode () { + return this.landLineAreaCode; + } + + /** + * Setter for land-line number's area code + *

+ * @param landLineAreaCode Land-line number's area code + */ + public void setLandLineAreaCode (final Integer landLineAreaCode) { + this.landLineAreaCode = landLineAreaCode; + } + + /** + * Getter for land-line number's country instance + *

+ * @return Land-line number's country instance + */ + public Country getLandLineCountry () { + return this.landLineCountry; + } + + /** + * Setter for land-line number's country instance + *

+ * @param landLineCountry Land-line number's country instance + */ + public void setLandLineCountry (final Country landLineCountry) { + this.landLineCountry = landLineCountry; + } + + /** + * Getter for land-line number + *

+ * @return Land-line number + */ + public Long getLandLineNumber () { + return this.landLineNumber; + } + + /** + * Setter for land-line number + *

+ * @param landLineNumber Land-line number + */ + public void setLandLineNumber (final Long landLineNumber) { + this.landLineNumber = landLineNumber; + } + + /** + * Post-initialization of this class + */ + @PostConstruct + public void init () { + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.adminBusinessDataBean = (BusinessDataAdminSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw again + throw new FaceletException(e); + } + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsAdminBusinessDataWebRequestController.java b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsAdminBusinessDataWebRequestController.java new file mode 100644 index 00000000..be4a7705 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsAdminBusinessDataWebRequestController.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * 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.jfinancials.beans.businessdata; + +import java.io.Serializable; + +/** + * An interface for session-scoped financial controller + *

+ * @author Roland Häder + */ +public interface FinancialsAdminBusinessDataWebRequestController extends Serializable { + +} diff --git a/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsBusinessDataWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsBusinessDataWebSessionBean.java new file mode 100644 index 00000000..9e6481a5 --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsBusinessDataWebSessionBean.java @@ -0,0 +1,338 @@ +/* + * Copyright (C) 2016, 2017 Roland Häder + * + * 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.jfinancials.beans.businessdata; + +import java.util.List; +import javax.annotation.PostConstruct; +import javax.enterprise.context.SessionScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcontactsbusiness.BusinessBasicData; +import org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote; +import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote; +import org.mxchange.jcountry.data.Country; +import org.mxchange.jfinancials.beans.BaseFinancialsController; +import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController; + +/** + * A business contact bean (controller) + *

+ * @author Roland Häder + */ +@Named ("businessDataController") +@SessionScoped +public class FinancialsBusinessDataWebSessionBean extends BaseFinancialsController implements FinancialsBusinessDataWebSessionController { + + /** + * Serial number + */ + private static final long serialVersionUID = 56_189_028_928_371L; + + /** + * Remote contact bean + */ + private BusinessDataAdminSessionBeanRemote adminBusinessDataBean; + + /** + * A list of all registered companies (globally) + */ + private List businessContacts; + + /** + * Remote contact bean + */ + private BusinessDataSessionBeanRemote businessDataBean; + + /** + * Comments for this company + */ + private String companyComments; + + /** + * Companies (main) email address (example: info@company.example) + */ + private String companyEmailAddress; + + /** + * Company legal status (example: Incorporated, GmbH) + */ + private String companyLegalStatus; + + /** + * Company name + */ + private String companyName; + + /** + * Area code for fax number + */ + private Integer faxAreaCode; + + /** + * Country for fax number + */ + private Country faxCountry; + + /** + * Dial number for fax number + */ + private Long faxNumber; + + /** + * Area code for land-line number + */ + private Integer landLineAreaCode; + + /** + * Country for land-line number + */ + private Country landLineCountry; + + /** + * Dial number for land-line number + */ + private Long landLineNumber; + + /** + * User instance + */ + @Inject + private FinancialsUserLoginWebSessionController userLoginController; + + /** + * Constructor + */ + public FinancialsBusinessDataWebSessionBean () { + // Call super constructor + super(); + } + + @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List allBusinessContacts () { + return this.businessContacts; + } + + /** + * Getter for comments + *

+ * @return Comments + */ + public String getCompanyComments () { + return this.companyComments; + } + + /** + * Setter for comments + *

+ * @param companyComments Comments + */ + public void setCompanyComments (final String companyComments) { + this.companyComments = companyComments; + } + + /** + * Getter for company's (main) email address + *

+ * @return Company's (main) email address + */ + public String getCompanyEmailAddress () { + return this.companyEmailAddress; + } + + /** + * Setter for company's (main) email address + *

+ * @param companyEmailAddress Company's (main) email address + */ + public void setCompanyEmailAddress (final String companyEmailAddress) { + this.companyEmailAddress = companyEmailAddress; + } + + /** + * Getter for company's legal status + *

+ * @return Company's legal status + */ + public String getCompanyLegalStatus () { + return this.companyLegalStatus; + } + + /** + * Setter for company's legal status + *

+ * @param companyLegalStatus Company's legal status + */ + public void setCompanyLegalStatus (final String companyLegalStatus) { + this.companyLegalStatus = companyLegalStatus; + } + + /** + * Getter for company name + *

+ * @return Company name + */ + public String getCompanyName () { + return this.companyName; + } + + /** + * Setter for company name + *

+ * @param companyName Company name + */ + public void setCompanyName (final String companyName) { + this.companyName = companyName; + } + + /** + * Getter for fax number's area code + *

+ * @return Fax number's area code + */ + public Integer getFaxAreaCode () { + return this.faxAreaCode; + } + + /** + * Setter for fax number's area code + *

+ * @param faxAreaCode Fax number's area code + */ + public void setFaxAreaCode (final Integer faxAreaCode) { + this.faxAreaCode = faxAreaCode; + } + + /** + * Getter for fax's country instance + *

+ * @return Fax' country instance + */ + public Country getFaxCountry () { + return this.faxCountry; + } + + /** + * Setter for fax's country instance + *

+ * @param faxCountry Fax' country instance + */ + public void setFaxCountry (final Country faxCountry) { + this.faxCountry = faxCountry; + } + + /** + * Getter for fax number + *

+ * @return Fax number + */ + public Long getFaxNumber () { + return this.faxNumber; + } + + /** + * Setter for fax number + *

+ * @param faxNumber Fax number + */ + public void setFaxNumber (final Long faxNumber) { + this.faxNumber = faxNumber; + } + + /** + * Getter for land-line number's area code + *

+ * @return Land-line number's area code + */ + public Integer getLandLineAreaCode () { + return this.landLineAreaCode; + } + + /** + * Setter for land-line number's area code + *

+ * @param landLineAreaCode Land-line number's area code + */ + public void setLandLineAreaCode (final Integer landLineAreaCode) { + this.landLineAreaCode = landLineAreaCode; + } + + /** + * Getter for land-line number's country instance + *

+ * @return Land-line number's country instance + */ + public Country getLandLineCountry () { + return this.landLineCountry; + } + + /** + * Setter for land-line number's country instance + *

+ * @param landLineCountry Land-line number's country instance + */ + public void setLandLineCountry (final Country landLineCountry) { + this.landLineCountry = landLineCountry; + } + + /** + * Getter for land-line number + *

+ * @return Land-line number + */ + public Long getLandLineNumber () { + return this.landLineNumber; + } + + /** + * Setter for land-line number + *

+ * @param landLineNumber Land-line number + */ + public void setLandLineNumber (final Long landLineNumber) { + this.landLineNumber = landLineNumber; + } + + /** + * Post-initialization of this class + */ + @PostConstruct + public void init () { + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/businessData!org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote"); //NOI18N + + // Try to lookup + this.adminBusinessDataBean = (BusinessDataAdminSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw again + throw new FaceletException(e); + } + + // Init user's contact list + this.businessContacts = this.adminBusinessDataBean.allBusinessContacts(); + } + +} diff --git a/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsBusinessDataWebSessionController.java b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsBusinessDataWebSessionController.java new file mode 100644 index 00000000..deefec8c --- /dev/null +++ b/src/java/org/mxchange/jfinancials/beans/businessdata/FinancialsBusinessDataWebSessionController.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * 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.jfinancials.beans.businessdata; + +import java.io.Serializable; +import java.util.List; +import org.mxchange.jcontactsbusiness.BusinessBasicData; + +/** + * An interface for session-scoped financial controller + *

+ * @author Roland Häder + */ +public interface FinancialsBusinessDataWebSessionController extends Serializable { + + /** + * Returns a list of all business contacts + *

+ * @return A list of all business contacts + */ + List allBusinessContacts (); + +}