]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/businessdata/JobsBusinessDataWebSessionBean.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / businessdata / JobsBusinessDataWebSessionBean.java
1 /*
2  * Copyright (C) 2016, 2017 Roland Häder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jjobs.beans.businessdata;
18
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;
30
31 /**
32  * A business contact bean (controller)
33  * <p>
34  * @author Roland Häder<roland@mxchange.org>
35  */
36 @Named ("businessContactController")
37 @SessionScoped
38 public class JobsBusinessDataWebSessionBean extends BaseJobsController implements JobsBusinessDataWebSessionController {
39
40         /**
41          * Serial number
42          */
43         private static final long serialVersionUID = 56_189_028_928_371L;
44
45         /**
46          * Remote contact bean
47          */
48         private BusinessDataSessionBeanRemote businessDataBean;
49
50         /**
51          * Comments for this company
52          */
53         private String companyComments;
54
55         /**
56          * An employee as contact person with this company
57          */
58         private Employee companyContactEmployee;
59
60         /**
61          * Companies (main) email address (example: info@company.example)
62          */
63         private String companyEmailAddress;
64
65         /**
66          * Company name
67          */
68         private String companyName;
69
70         /**
71          * Area code for fax number
72          */
73         private Integer faxAreaCode;
74
75         /**
76          * Country for fax number
77          */
78         private Country faxCountry;
79
80         /**
81          * Dial number for fax number
82          */
83         private Long faxNumber;
84
85         /**
86          * Area code for land-line number
87          */
88         private Integer landLineAreaCode;
89
90         /**
91          * Country for land-line number
92          */
93         private Country landLineCountry;
94
95         /**
96          * Dial number for land-line number
97          */
98         private Long landLineNumber;
99
100         /**
101          * Constructor
102          */
103         public JobsBusinessDataWebSessionBean () {
104                 // Call super constructor
105                 super();
106         }
107
108         /**
109          * Getter for comments
110          * <p>
111          * @return Comments
112          */
113         public String getCompanyComments () {
114                 return this.companyComments;
115         }
116
117         /**
118          * Setter for comments
119          * <p>
120          * @param companyComments Comments
121          */
122         public void setCompanyComments (final String companyComments) {
123                 this.companyComments = companyComments;
124         }
125
126         /**
127          * Getter for employee as contact person
128          * <p>
129          * @return Employee as contact person
130          */
131         public Employee getCompanyContactEmployee () {
132                 return this.companyContactEmployee;
133         }
134
135         /**
136          * Setter for employee as contact person
137          * <p>
138          * @param companyContactEmployee Employee as contact person
139          */
140         public void setCompanyContactEmployee (final Employee companyContactEmployee) {
141                 this.companyContactEmployee = companyContactEmployee;
142         }
143
144         /**
145          * Getter for company's (main) email address
146          * <p>
147          * @return Company's (main) email address
148          */
149         public String getCompanyEmailAddress () {
150                 return this.companyEmailAddress;
151         }
152
153         /**
154          * Setter for company's (main) email address
155          * <p>
156          * @param companyEmailAddress Company's (main) email address
157          */
158         public void setCompanyEmailAddress (final String companyEmailAddress) {
159                 this.companyEmailAddress = companyEmailAddress;
160         }
161
162         /**
163          * Getter for company name
164          * <p>
165          * @return Company name
166          */
167         public String getCompanyName () {
168                 return this.companyName;
169         }
170
171         /**
172          * Setter for company name
173          * <p>
174          * @param companyName Company name
175          */
176         public void setCompanyName (final String companyName) {
177                 this.companyName = companyName;
178         }
179
180         /**
181          * Getter for fax number's area code
182          * <p>
183          * @return Fax number's area code
184          */
185         public Integer getFaxAreaCode () {
186                 return this.faxAreaCode;
187         }
188
189         /**
190          * Setter for fax number's area code
191          * <p>
192          * @param faxAreaCode Fax number's area code
193          */
194         public void setFaxAreaCode (final Integer faxAreaCode) {
195                 this.faxAreaCode = faxAreaCode;
196         }
197
198         /**
199          * Getter for fax's country instance
200          * <p>
201          * @return Fax' country instance
202          */
203         public Country getFaxCountry () {
204                 return this.faxCountry;
205         }
206
207         /**
208          * Setter for fax's country instance
209          * <p>
210          * @param faxCountry Fax' country instance
211          */
212         public void setFaxCountry (final Country faxCountry) {
213                 this.faxCountry = faxCountry;
214         }
215
216         /**
217          * Getter for fax number
218          * <p>
219          * @return Fax number
220          */
221         public Long getFaxNumber () {
222                 return this.faxNumber;
223         }
224
225         /**
226          * Setter for fax number
227          * <p>
228          * @param faxNumber Fax number
229          */
230         public void setFaxNumber (final Long faxNumber) {
231                 this.faxNumber = faxNumber;
232         }
233
234         /**
235          * Getter for land-line number's area code
236          * <p>
237          * @return Land-line number's area code
238          */
239         public Integer getLandLineAreaCode () {
240                 return this.landLineAreaCode;
241         }
242
243         /**
244          * Setter for land-line number's area code
245          * <p>
246          * @param landLineAreaCode Land-line number's area code
247          */
248         public void setLandLineAreaCode (final Integer landLineAreaCode) {
249                 this.landLineAreaCode = landLineAreaCode;
250         }
251
252         /**
253          * Getter for land-line number's country instance
254          * <p>
255          * @return Land-line number's country instance
256          */
257         public Country getLandLineCountry () {
258                 return this.landLineCountry;
259         }
260
261         /**
262          * Setter for land-line number's country instance
263          * <p>
264          * @param landLineCountry Land-line number's country instance
265          */
266         public void setLandLineCountry (final Country landLineCountry) {
267                 this.landLineCountry = landLineCountry;
268         }
269
270         /**
271          * Getter for land-line number
272          * <p>
273          * @return Land-line number
274          */
275         public Long getLandLineNumber () {
276                 return this.landLineNumber;
277         }
278
279         /**
280          * Setter for land-line number
281          * <p>
282          * @param landLineNumber Land-line number
283          */
284         public void setLandLineNumber (final Long landLineNumber) {
285                 this.landLineNumber = landLineNumber;
286         }
287
288         /**
289          * Post-initialization of this class
290          */
291         @PostConstruct
292         public void init () {
293                 // Try it
294                 try {
295                         // Get initial context
296                         Context context = new InitialContext();
297
298                         // Try to lookup
299                         this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/jjobs-ejb/businessData!org.mxchange.jcontactsbusiness.basicdata.BusinessDataSessionBeanRemote"); //NOI18N
300                 } catch (final NamingException e) {
301                         // Throw again
302                         throw new FaceletException(e);
303                 }
304         }
305
306 }