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.jfinancials.beans.business.basicdata;
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;
34 * An administrative business contact bean (controller)
36 * @author Roland Häder<roland@mxchange.org>
38 @Named ("adminBusinessDataController")
40 public class FinancialsAdminBusinessDataWebRequestBean extends BaseFinancialsController implements FinancialsAdminBusinessDataWebRequestController {
45 private static final long serialVersionUID = 56_189_028_928_374L;
50 private AdminBusinessDataSessionBeanRemote adminBusinessDataBean;
53 * Comments for this company
55 private String companyComments;
58 * An employee as contact person with this company
60 private Employee companyContactEmployee;
63 * Companies (main) email address (example: info@company.example)
65 private String companyEmailAddress;
68 * Head quarter data for this company
70 private HeadQuartersData companyHeadQuarters;
75 private String companyName;
80 private String companyTaxNumber;
85 private String companyWebsiteUrl;
88 * Owning user instance (which this company is assigned to)
90 private User contactCompanyUserOwner;
93 * Area code for fax number
95 private Integer faxAreaCode;
98 * Country for fax number
100 private Country faxCountry;
103 * Dial number for fax number
105 private Long faxNumber;
108 * Area code for land-line number
110 private Integer landLineAreaCode;
113 * Country for land-line number
115 private Country landLineCountry;
118 * Dial number for land-line number
120 private Long landLineNumber;
125 public FinancialsAdminBusinessDataWebRequestBean () {
126 // Call super constructor
131 * Getter for comments
135 public String getCompanyComments () {
136 return this.companyComments;
140 * Setter for comments
142 * @param companyComments Comments
144 public void setCompanyComments (final String companyComments) {
145 this.companyComments = companyComments;
149 * Getter for employee as contact person
151 * @return Employee as contact person
153 public Employee getCompanyContactEmployee () {
154 return this.companyContactEmployee;
158 * Setter for employee as contact person
160 * @param companyContactEmployee Employee as contact person
162 public void setCompanyContactEmployee (final Employee companyContactEmployee) {
163 this.companyContactEmployee = companyContactEmployee;
167 * Getter for company's (main) email address
169 * @return Company's (main) email address
171 public String getCompanyEmailAddress () {
172 return this.companyEmailAddress;
176 * Setter for company's (main) email address
178 * @param companyEmailAddress Company's (main) email address
180 public void setCompanyEmailAddress (final String companyEmailAddress) {
181 this.companyEmailAddress = companyEmailAddress;
185 * Getter for headquarters data
187 * @return Headquarters data
189 public HeadQuartersData getCompanyHeadQuarters () {
190 return this.companyHeadQuarters;
194 * Setter for headquarters data
196 * @param companyHeadQuarters Headquarters data
198 public void setCompanyHeadQuarters (final HeadQuartersData companyHeadQuarters) {
199 this.companyHeadQuarters = companyHeadQuarters;
203 * Getter for company name
205 * @return Company name
207 public String getCompanyName () {
208 return this.companyName;
212 * Setter for company name
214 * @param companyName Company name
216 public void setCompanyName (final String companyName) {
217 this.companyName = companyName;
221 * Getter for company tax number
223 * @return Company tax number
225 public String getCompanyTaxNumber () {
226 return this.companyTaxNumber;
230 * Setter for company tax number
232 * @param companyTaxNumber Company tax number
234 public void setCompanyTaxNumber (final String companyTaxNumber) {
235 this.companyTaxNumber = companyTaxNumber;
239 * Getter for company web site URL
241 * @return Company web site URL
243 public String getCompanyWebsiteUrl () {
244 return this.companyWebsiteUrl;
248 * Getter for company web site URL
250 * @param companyWebsiteUrl Company web site URL
252 public void setCompanyWebsiteUrl (final String companyWebsiteUrl) {
253 this.companyWebsiteUrl = companyWebsiteUrl;
257 * Getter for owning user instance
259 * @return Owning user instance
261 public User getContactCompanyUserOwner () {
262 return this.contactCompanyUserOwner;
266 * Setter for owning user instance
268 * @param contactCompanyUserOwner Owning user instance
270 public void setContactCompanyUserOwner (final User contactCompanyUserOwner) {
271 this.contactCompanyUserOwner = contactCompanyUserOwner;
275 * Getter for fax number's area code
277 * @return Fax number's area code
279 public Integer getFaxAreaCode () {
280 return this.faxAreaCode;
284 * Setter for fax number's area code
286 * @param faxAreaCode Fax number's area code
288 public void setFaxAreaCode (final Integer faxAreaCode) {
289 this.faxAreaCode = faxAreaCode;
293 * Getter for fax's country instance
295 * @return Fax' country instance
297 public Country getFaxCountry () {
298 return this.faxCountry;
302 * Setter for fax's country instance
304 * @param faxCountry Fax' country instance
306 public void setFaxCountry (final Country faxCountry) {
307 this.faxCountry = faxCountry;
311 * Getter for fax number
315 public Long getFaxNumber () {
316 return this.faxNumber;
320 * Setter for fax number
322 * @param faxNumber Fax number
324 public void setFaxNumber (final Long faxNumber) {
325 this.faxNumber = faxNumber;
329 * Getter for land-line number's area code
331 * @return Land-line number's area code
333 public Integer getLandLineAreaCode () {
334 return this.landLineAreaCode;
338 * Setter for land-line number's area code
340 * @param landLineAreaCode Land-line number's area code
342 public void setLandLineAreaCode (final Integer landLineAreaCode) {
343 this.landLineAreaCode = landLineAreaCode;
347 * Getter for land-line number's country instance
349 * @return Land-line number's country instance
351 public Country getLandLineCountry () {
352 return this.landLineCountry;
356 * Setter for land-line number's country instance
358 * @param landLineCountry Land-line number's country instance
360 public void setLandLineCountry (final Country landLineCountry) {
361 this.landLineCountry = landLineCountry;
365 * Getter for land-line number
367 * @return Land-line number
369 public Long getLandLineNumber () {
370 return this.landLineNumber;
374 * Setter for land-line number
376 * @param landLineNumber Land-line number
378 public void setLandLineNumber (final Long landLineNumber) {
379 this.landLineNumber = landLineNumber;
383 * Post-initialization of this class
386 public void init () {
389 // Get initial context
390 Context context = new InitialContext();
393 this.adminBusinessDataBean = (AdminBusinessDataSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.basicdata.AdminBusinessDataSessionBeanRemote"); //NOI18N
394 } catch (final NamingException e) {
396 throw new FaceletException(e);