]> git.mxchange.org Git - jfinancials-war.git/blob
155a2c964b3371758a31d6318a88a96a31480015
[jfinancials-war.git] /
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.jfinancials.beans.business.basicdata;
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.AdminBusinessDataSessionBeanRemote;
27 import org.mxchange.jcontactsbusiness.employee.Employee;
28 import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
29 import org.mxchange.jcountry.data.Country;
30 import org.mxchange.jfinancials.beans.BaseFinancialsController;
31 import org.mxchange.jusercore.model.user.User;
32
33 /**
34  * An administrative business contact bean (controller)
35  * <p>
36  * @author Roland Häder<roland@mxchange.org>
37  */
38 @Named ("adminBusinessDataController")
39 @SessionScoped
40 public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsController implements FinancialsAdminBusinessDataWebRequestController {
41
42         /**
43          * Serial number
44          */
45         private static final long serialVersionUID = 56_189_028_928_374L;
46
47         /**
48          * Remote contact bean
49          */
50         private AdminBusinessDataSessionBeanRemote adminBusinessDataBean;
51
52         /**
53          * Comments for this company
54          */
55         private String companyComments;
56
57         /**
58          * An employee as contact person with this company
59          */
60         private Employee companyContactEmployee;
61
62         /**
63          * Companies (main) email address (example: info@company.example)
64          */
65         private String companyEmailAddress;
66
67         /**
68          * Head quarter data for this company
69          */
70         private HeadQuartersData companyHeadQuarters;
71
72         /**
73          * Company name
74          */
75         private String companyName;
76
77         /**
78          * Tax number
79          */
80         private String companyTaxNumber;
81
82         /**
83          * Web site URL
84          */
85         private String companyWebsiteUrl;
86
87         /**
88          * Owning user instance (which this company is assigned to)
89          */
90         private User contactCompanyUserOwner;
91
92         /**
93          * Area code for fax number
94          */
95         private Integer faxAreaCode;
96
97         /**
98          * Country for fax number
99          */
100         private Country faxCountry;
101
102         /**
103          * Dial number for fax number
104          */
105         private Long faxNumber;
106
107         /**
108          * Area code for land-line number
109          */
110         private Integer landLineAreaCode;
111
112         /**
113          * Country for land-line number
114          */
115         private Country landLineCountry;
116
117         /**
118          * Dial number for land-line number
119          */
120         private Long landLineNumber;
121
122         /**
123          * Constructor
124          */
125         public FinancialsAdminBusinessDataWebRequestBean () {
126                 // Call super constructor
127                 super();
128         }
129
130         /**
131          * Getter for comments
132          * <p>
133          * @return Comments
134          */
135         public String getCompanyComments () {
136                 return this.companyComments;
137         }
138
139         /**
140          * Setter for comments
141          * <p>
142          * @param companyComments Comments
143          */
144         public void setCompanyComments (final String companyComments) {
145                 this.companyComments = companyComments;
146         }
147
148         /**
149          * Getter for employee as contact person
150          * <p>
151          * @return Employee as contact person
152          */
153         public Employee getCompanyContactEmployee () {
154                 return this.companyContactEmployee;
155         }
156
157         /**
158          * Setter for employee as contact person
159          * <p>
160          * @param companyContactEmployee Employee as contact person
161          */
162         public void setCompanyContactEmployee (final Employee companyContactEmployee) {
163                 this.companyContactEmployee = companyContactEmployee;
164         }
165
166         /**
167          * Getter for company's (main) email address
168          * <p>
169          * @return Company's (main) email address
170          */
171         public String getCompanyEmailAddress () {
172                 return this.companyEmailAddress;
173         }
174
175         /**
176          * Setter for company's (main) email address
177          * <p>
178          * @param companyEmailAddress Company's (main) email address
179          */
180         public void setCompanyEmailAddress (final String companyEmailAddress) {
181                 this.companyEmailAddress = companyEmailAddress;
182         }
183
184         /**
185          * Getter for headquarters data
186          * <p>
187          * @return Headquarters data
188          */
189         public HeadQuartersData getCompanyHeadQuarters () {
190                 return this.companyHeadQuarters;
191         }
192
193         /**
194          * Setter for headquarters data
195          * <p>
196          * @param companyHeadQuarters Headquarters data
197          */
198         public void setCompanyHeadQuarters (final HeadQuartersData companyHeadQuarters) {
199                 this.companyHeadQuarters = companyHeadQuarters;
200         }
201
202         /**
203          * Getter for company name
204          * <p>
205          * @return Company name
206          */
207         public String getCompanyName () {
208                 return this.companyName;
209         }
210
211         /**
212          * Setter for company name
213          * <p>
214          * @param companyName Company name
215          */
216         public void setCompanyName (final String companyName) {
217                 this.companyName = companyName;
218         }
219
220         /**
221          * Getter for company tax number
222          * <p>
223          * @return Company tax number
224          */
225         public String getCompanyTaxNumber () {
226                 return this.companyTaxNumber;
227         }
228
229         /**
230          * Setter for company tax number
231          * <p>
232          * @param companyTaxNumber Company tax number
233          */
234         public void setCompanyTaxNumber (final String companyTaxNumber) {
235                 this.companyTaxNumber = companyTaxNumber;
236         }
237
238         /**
239          * Getter for company web site URL
240          * <p>
241          * @return Company web site URL
242          */
243         public String getCompanyWebsiteUrl () {
244                 return this.companyWebsiteUrl;
245         }
246
247         /**
248          * Getter for company web site URL
249          * <p>
250          * @param companyWebsiteUrl Company web site URL
251          */
252         public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
253                 this.companyWebsiteUrl = companyWebsiteUrl;
254         }
255
256         /**
257          * Getter for owning user instance
258          * <p>
259          * @return Owning user instance
260          */
261         public User getContactCompanyUserOwner () {
262                 return this.contactCompanyUserOwner;
263         }
264
265         /**
266          * Setter for owning user instance
267          * <p>
268          * @param contactCompanyUserOwner Owning user instance
269          */
270         public void setContactCompanyUserOwner (final User contactCompanyUserOwner) {
271                 this.contactCompanyUserOwner = contactCompanyUserOwner;
272         }
273
274         /**
275          * Getter for fax number's area code
276          * <p>
277          * @return Fax number's area code
278          */
279         public Integer getFaxAreaCode () {
280                 return this.faxAreaCode;
281         }
282
283         /**
284          * Setter for fax number's area code
285          * <p>
286          * @param faxAreaCode Fax number's area code
287          */
288         public void setFaxAreaCode (final Integer faxAreaCode) {
289                 this.faxAreaCode = faxAreaCode;
290         }
291
292         /**
293          * Getter for fax's country instance
294          * <p>
295          * @return Fax' country instance
296          */
297         public Country getFaxCountry () {
298                 return this.faxCountry;
299         }
300
301         /**
302          * Setter for fax's country instance
303          * <p>
304          * @param faxCountry Fax' country instance
305          */
306         public void setFaxCountry (final Country faxCountry) {
307                 this.faxCountry = faxCountry;
308         }
309
310         /**
311          * Getter for fax number
312          * <p>
313          * @return Fax number
314          */
315         public Long getFaxNumber () {
316                 return this.faxNumber;
317         }
318
319         /**
320          * Setter for fax number
321          * <p>
322          * @param faxNumber Fax number
323          */
324         public void setFaxNumber (final Long faxNumber) {
325                 this.faxNumber = faxNumber;
326         }
327
328         /**
329          * Getter for land-line number's area code
330          * <p>
331          * @return Land-line number's area code
332          */
333         public Integer getLandLineAreaCode () {
334                 return this.landLineAreaCode;
335         }
336
337         /**
338          * Setter for land-line number's area code
339          * <p>
340          * @param landLineAreaCode Land-line number's area code
341          */
342         public void setLandLineAreaCode (final Integer landLineAreaCode) {
343                 this.landLineAreaCode = landLineAreaCode;
344         }
345
346         /**
347          * Getter for land-line number's country instance
348          * <p>
349          * @return Land-line number's country instance
350          */
351         public Country getLandLineCountry () {
352                 return this.landLineCountry;
353         }
354
355         /**
356          * Setter for land-line number's country instance
357          * <p>
358          * @param landLineCountry Land-line number's country instance
359          */
360         public void setLandLineCountry (final Country landLineCountry) {
361                 this.landLineCountry = landLineCountry;
362         }
363
364         /**
365          * Getter for land-line number
366          * <p>
367          * @return Land-line number
368          */
369         public Long getLandLineNumber () {
370                 return this.landLineNumber;
371         }
372
373         /**
374          * Setter for land-line number
375          * <p>
376          * @param landLineNumber Land-line number
377          */
378         public void setLandLineNumber (final Long landLineNumber) {
379                 this.landLineNumber = landLineNumber;
380         }
381
382         /**
383          * Post-initialization of this class
384          */
385         @PostConstruct
386         public void init () {
387                 // Try it
388                 try {
389                         // Get initial context
390                         Context context = new InitialContext();
391
392                         // Try to lookup
393                         this.adminBusinessDataBean = (AdminBusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote"); //NOI18N
394                 } catch (final NamingException e) {
395                         // Throw again
396                         throw new FaceletException(e);
397                 }
398         }
399
400 }