2 * Copyright (C) 2016, 2017 Roland Häder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.addressbook.beans.businesscontact;
19 import javax.annotation.PostConstruct;
20 import javax.enterprise.context.SessionScoped;
21 import javax.faces.view.facelets.FaceletException;
22 import javax.inject.Inject;
23 import javax.inject.Named;
24 import javax.naming.Context;
25 import javax.naming.InitialContext;
26 import javax.naming.NamingException;
27 import org.mxchange.addressbook.beans.BaseAddressbookController;
28 import org.mxchange.addressbook.beans.user.login.AddressbookUserLoginWebSessionController;
29 import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote;
30 import org.mxchange.jcountry.data.Country;
33 * A business contact bean (controller)
35 * @author Roland Häder<roland@mxchange.org>
37 @Named ("businessDataController")
39 public class AddressbookBusinessContactWebSessionBean extends BaseAddressbookController implements AddressbookBusinessContactWebSessionController {
44 private static final long serialVersionUID = 56_189_028_928_371L;
49 private BusinessDataSessionBeanRemote businessDataBean;
52 * Comments for this company
54 private String companyComments;
57 * Companies (main) email address (example: info@company.example)
59 private String companyEmailAddress;
62 * Company legal status (example: Incorporated, GmbH)
64 private String companyLegalStatus;
69 private String companyName;
72 * Area code for fax number
74 private Integer faxAreaCode;
77 * Country for fax number
79 private Country faxCountry;
82 * Dial number for fax number
84 private Long faxNumber;
87 * Area code for land-line number
89 private Integer landLineAreaCode;
92 * Country for land-line number
94 private Country landLineCountry;
97 * Dial number for land-line number
99 private Long landLineNumber;
105 private AddressbookUserLoginWebSessionController userLoginController;
110 public AddressbookBusinessContactWebSessionBean () {
111 // Call super constructor
116 * Getter for comments
120 public String getCompanyComments () {
121 return this.companyComments;
125 * Setter for comments
127 * @param companyComments Comments
129 public void setCompanyComments (final String companyComments) {
130 this.companyComments = companyComments;
134 * Getter for company's (main) email address
136 * @return Company's (main) email address
138 public String getCompanyEmailAddress () {
139 return this.companyEmailAddress;
143 * Setter for company's (main) email address
145 * @param companyEmailAddress Company's (main) email address
147 public void setCompanyEmailAddress (final String companyEmailAddress) {
148 this.companyEmailAddress = companyEmailAddress;
152 * Getter for company's legal status
154 * @return Company's legal status
156 public String getCompanyLegalStatus () {
157 return this.companyLegalStatus;
161 * Setter for company's legal status
163 * @param companyLegalStatus Company's legal status
165 public void setCompanyLegalStatus (final String companyLegalStatus) {
166 this.companyLegalStatus = companyLegalStatus;
170 * Getter for company name
172 * @return Company name
174 public String getCompanyName () {
175 return this.companyName;
179 * Setter for company name
181 * @param companyName Company name
183 public void setCompanyName (final String companyName) {
184 this.companyName = companyName;
188 * Getter for fax number's area code
190 * @return Fax number's area code
192 public Integer getFaxAreaCode () {
193 return this.faxAreaCode;
197 * Setter for fax number's area code
199 * @param faxAreaCode Fax number's area code
201 public void setFaxAreaCode (final Integer faxAreaCode) {
202 this.faxAreaCode = faxAreaCode;
206 * Getter for fax's country instance
208 * @return Fax' country instance
210 public Country getFaxCountry () {
211 return this.faxCountry;
215 * Setter for fax's country instance
217 * @param faxCountry Fax' country instance
219 public void setFaxCountry (final Country faxCountry) {
220 this.faxCountry = faxCountry;
224 * Getter for fax number
228 public Long getFaxNumber () {
229 return this.faxNumber;
233 * Setter for fax number
235 * @param faxNumber Fax number
237 public void setFaxNumber (final Long faxNumber) {
238 this.faxNumber = faxNumber;
242 * Getter for land-line number's area code
244 * @return Land-line number's area code
246 public Integer getLandLineAreaCode () {
247 return this.landLineAreaCode;
251 * Setter for land-line number's area code
253 * @param landLineAreaCode Land-line number's area code
255 public void setLandLineAreaCode (final Integer landLineAreaCode) {
256 this.landLineAreaCode = landLineAreaCode;
260 * Getter for land-line number's country instance
262 * @return Land-line number's country instance
264 public Country getLandLineCountry () {
265 return this.landLineCountry;
269 * Setter for land-line number's country instance
271 * @param landLineCountry Land-line number's country instance
273 public void setLandLineCountry (final Country landLineCountry) {
274 this.landLineCountry = landLineCountry;
278 * Getter for land-line number
280 * @return Land-line number
282 public Long getLandLineNumber () {
283 return this.landLineNumber;
287 * Setter for land-line number
289 * @param landLineNumber Land-line number
291 public void setLandLineNumber (final Long landLineNumber) {
292 this.landLineNumber = landLineNumber;
296 * Post-initialization of this class
299 public void init () {
302 // Get initial context
303 Context context = new InitialContext();
306 this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/addressbook-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N
307 } catch (final NamingException e) {
309 throw new FaceletException(e);