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.jjobs.beans.businessdata;
19 import javax.annotation.PostConstruct;
20 import javax.enterprise.context.SessionScoped;
21 import javax.faces.view.facelets.FaceletException;
22 import javax.inject.Named;
23 import javax.naming.Context;
24 import javax.naming.InitialContext;
25 import javax.naming.NamingException;
26 import org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote;
27 import org.mxchange.jcontactsbusiness.employee.Employee;
28 import org.mxchange.jcountry.data.Country;
29 import org.mxchange.jjobs.beans.BaseJobsController;
32 * A business contact bean (controller)
34 * @author Roland Häder<roland@mxchange.org>
36 @Named ("businessContactController")
38 public class JobsBusinessDataWebSessionBean extends BaseJobsController implements JobsBusinessDataWebSessionController {
43 private static final long serialVersionUID = 56_189_028_928_371L;
48 private BusinessDataSessionBeanRemote businessDataBean;
51 * Comments for this company
53 private String companyComments;
56 * An employee as contact person with this company
58 private Employee companyContactEmployee;
61 * Companies (main) email address (example: info@company.example)
63 private String companyEmailAddress;
68 private String companyName;
71 * Area code for fax number
73 private Integer faxAreaCode;
76 * Country for fax number
78 private Country faxCountry;
81 * Dial number for fax number
83 private Long faxNumber;
86 * Area code for land-line number
88 private Integer landLineAreaCode;
91 * Country for land-line number
93 private Country landLineCountry;
96 * Dial number for land-line number
98 private Long landLineNumber;
103 public JobsBusinessDataWebSessionBean () {
104 // Call super constructor
109 * Getter for comments
113 public String getCompanyComments () {
114 return this.companyComments;
118 * Setter for comments
120 * @param companyComments Comments
122 public void setCompanyComments (final String companyComments) {
123 this.companyComments = companyComments;
127 * Getter for employee as contact person
129 * @return Employee as contact person
131 public Employee getCompanyContactEmployee () {
132 return this.companyContactEmployee;
136 * Setter for employee as contact person
138 * @param companyContactEmployee Employee as contact person
140 public void setCompanyContactEmployee (final Employee companyContactEmployee) {
141 this.companyContactEmployee = companyContactEmployee;
145 * Getter for company's (main) email address
147 * @return Company's (main) email address
149 public String getCompanyEmailAddress () {
150 return this.companyEmailAddress;
154 * Setter for company's (main) email address
156 * @param companyEmailAddress Company's (main) email address
158 public void setCompanyEmailAddress (final String companyEmailAddress) {
159 this.companyEmailAddress = companyEmailAddress;
163 * Getter for company name
165 * @return Company name
167 public String getCompanyName () {
168 return this.companyName;
172 * Setter for company name
174 * @param companyName Company name
176 public void setCompanyName (final String companyName) {
177 this.companyName = companyName;
181 * Getter for fax number's area code
183 * @return Fax number's area code
185 public Integer getFaxAreaCode () {
186 return this.faxAreaCode;
190 * Setter for fax number's area code
192 * @param faxAreaCode Fax number's area code
194 public void setFaxAreaCode (final Integer faxAreaCode) {
195 this.faxAreaCode = faxAreaCode;
199 * Getter for fax's country instance
201 * @return Fax' country instance
203 public Country getFaxCountry () {
204 return this.faxCountry;
208 * Setter for fax's country instance
210 * @param faxCountry Fax' country instance
212 public void setFaxCountry (final Country faxCountry) {
213 this.faxCountry = faxCountry;
217 * Getter for fax number
221 public Long getFaxNumber () {
222 return this.faxNumber;
226 * Setter for fax number
228 * @param faxNumber Fax number
230 public void setFaxNumber (final Long faxNumber) {
231 this.faxNumber = faxNumber;
235 * Getter for land-line number's area code
237 * @return Land-line number's area code
239 public Integer getLandLineAreaCode () {
240 return this.landLineAreaCode;
244 * Setter for land-line number's area code
246 * @param landLineAreaCode Land-line number's area code
248 public void setLandLineAreaCode (final Integer landLineAreaCode) {
249 this.landLineAreaCode = landLineAreaCode;
253 * Getter for land-line number's country instance
255 * @return Land-line number's country instance
257 public Country getLandLineCountry () {
258 return this.landLineCountry;
262 * Setter for land-line number's country instance
264 * @param landLineCountry Land-line number's country instance
266 public void setLandLineCountry (final Country landLineCountry) {
267 this.landLineCountry = landLineCountry;
271 * Getter for land-line number
273 * @return Land-line number
275 public Long getLandLineNumber () {
276 return this.landLineNumber;
280 * Setter for land-line number
282 * @param landLineNumber Land-line number
284 public void setLandLineNumber (final Long landLineNumber) {
285 this.landLineNumber = landLineNumber;
289 * Post-initialization of this class
292 public void init () {
295 // Get initial context
296 Context context = new InitialContext();
299 this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/jjobs-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote"); //NOI18N
300 } catch (final NamingException e) {
302 throw new FaceletException(e);