]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick (Massive rewrite):
authorRoland Häder <roland@mxchange.org>
Mon, 24 Jul 2017 21:20:36 +0000 (23:20 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 25 Jul 2017 19:35:05 +0000 (21:35 +0200)
Only jcontacts-business-core:
- added administrative session-scoped bean (aka. "controller") for business
  data
- added initial JSF view and template for above bean, added also first form
  fields
- added option to enable (default) or disable business contacts in admin
  menu

In general:
- removed h:outputText where it was not needed as the parent JSF tag can
  do it, too
- still I'm a bit undecided about where the attribute styleClass is used
- fixed i18n key, was a copy-paste mistake
- added missing for-attribute
- phoneId was long time ago valid, now that there are 2 numbers,
  land-line and fax, the ids should be named accordingly
- added validator for email address validation
- removed id-attribute where it was not really needed or might cause
  harm to the rendering engine (?)
- h:message should be always outside, h:panelGroup, not really required
  by JSF but by design (consistency)
- added validatorMessage-attribute for email address fields
- added context parameter (thanks to BalusC for the idea) for making all
  empty strings being interpreted as null
- added missing i18n strings

Performance rewrites:
- rewrote converters and validators, they seem to be re-instanciated after
  each use, so the set EJB instances must be static to be loaded and set
  on-demand
- still this may ask for a lot room for improvement as the EJB is still called
  each time the converter/validator is being used
- also the Pattern instance for email validator should be "static cached"
  because it will use a lot CPU cycles and will then slow-down the application

Signed-off-by: Roland Häder <roland@mxchange.org>
39 files changed:
src/java/org/mxchange/jjobs/beans/businesscontact/JobsAdminBusinessContactWebSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/businesscontact/JobsAdminBusinessContactWebSessionController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/businesscontact/JobsBusinessContactWebSessionBean.java
src/java/org/mxchange/jjobs/beans/businesscontact/JobsBusinessContactWebSessionController.java
src/java/org/mxchange/jjobs/converter/businesscontact/JobsBusinessContactConverter.java
src/java/org/mxchange/jjobs/converter/contact/JobsContactConverter.java
src/java/org/mxchange/jjobs/converter/country/JobsCountryConverter.java
src/java/org/mxchange/jjobs/converter/fax/JobsFaxNumberConverter.java
src/java/org/mxchange/jjobs/converter/landline/JobsLandLineNumberConverter.java
src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java
src/java/org/mxchange/jjobs/converter/mobileprovider/JobsMobileProviderConverter.java
src/java/org/mxchange/jjobs/converter/user/JobsUserConverter.java
src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java
src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/faces-config.xml
web/WEB-INF/templates/admin/admin_menu.tpl
web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl
web/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl [new file with mode: 0644]
web/WEB-INF/templates/admin/fax/admin_fax_links.tpl
web/WEB-INF/templates/admin/landline/admin_landline_links.tpl
web/WEB-INF/templates/admin/mobile/admin_mobile_data.tpl
web/WEB-INF/templates/admin/mobile/admin_mobile_links.tpl
web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl
web/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl
web/WEB-INF/templates/user/user_profile_link.tpl
web/WEB-INF/web.xml
web/admin/contact/admin_contact_show.xhtml
web/admin/contact/unlink/admin_contact_fax_unlink.xhtml
web/admin/contact/unlink/admin_contact_landline_unlink.xhtml
web/admin/contact/unlink/admin_contact_mobile_unlink.xhtml
web/admin/contact_business/admin_contact_business_list.xhtml [new file with mode: 0644]
web/admin/fax/admin_fax_list.xhtml
web/admin/fax/admin_fax_show.xhtml
web/admin/landline/admin_landline_list.xhtml
web/admin/landline/admin_landline_show.xhtml
web/admin/mobile/admin_mobile_list.xhtml
web/admin/mobile/admin_mobile_show.xhtml

diff --git a/src/java/org/mxchange/jjobs/beans/businesscontact/JobsAdminBusinessContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/businesscontact/JobsAdminBusinessContactWebSessionBean.java
new file mode 100644 (file)
index 0000000..4f2f3be
--- /dev/null
@@ -0,0 +1,321 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.businesscontact;
+
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.jjobs.beans.BaseJobsController;
+
+/**
+ * An administrative business contact bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("adminBusinessDataController")
+@SessionScoped
+public class JobsAdminBusinessContactWebSessionBean extends BaseJobsController implements JobsAdminBusinessContactWebSessionController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 56_189_028_928_374L;
+
+       /**
+        * Remote contact bean
+        */
+       private BusinessDataAdminSessionBeanRemote adminBusinessDataBean;
+
+       /**
+        * A list of all registered companies (globally)
+        */
+       private List<BusinessBasicData> businessContacts;
+
+       /**
+        * Comments for this company
+        */
+       private String companyComments;
+
+       /**
+        * Companies (main) email address (example: info@company.example)
+        */
+       private String companyEmailAddress;
+
+       /**
+        * Company legal status (example: Incorporated, GmbH)
+        */
+       private String companyLegalStatus;
+
+       /**
+        * Company name
+        */
+       private String companyName;
+
+       /**
+        * Area code for fax number
+        */
+       private Integer faxAreaCode;
+
+       /**
+        * Country for fax number
+        */
+       private Country faxCountry;
+
+       /**
+        * Dial number for fax number
+        */
+       private Long faxNumber;
+
+       /**
+        * Area code for land-line number
+        */
+       private Integer landLineAreaCode;
+
+       /**
+        * Country for land-line number
+        */
+       private Country landLineCountry;
+
+       /**
+        * Dial number for land-line number
+        */
+       private Long landLineNumber;
+
+       /**
+        * Constructor
+        */
+       public JobsAdminBusinessContactWebSessionBean () {
+               // Call super constructor
+               super();
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<BusinessBasicData> allBusinessContacts () {
+               return this.businessContacts;
+       }
+
+       /**
+        * Getter for comments
+        * <p>
+        * @return Comments
+        */
+       public String getCompanyComments () {
+               return this.companyComments;
+       }
+
+       /**
+        * Setter for comments
+        * <p>
+        * @param companyComments Comments
+        */
+       public void setCompanyComments (final String companyComments) {
+               this.companyComments = companyComments;
+       }
+
+       /**
+        * Getter for company's (main) email address
+        * <p>
+        * @return Company's (main) email address
+        */
+       public String getCompanyEmailAddress () {
+               return this.companyEmailAddress;
+       }
+
+       /**
+        * Setter for company's (main) email address
+        * <p>
+        * @param companyEmailAddress Company's (main) email address
+        */
+       public void setCompanyEmailAddress (final String companyEmailAddress) {
+               this.companyEmailAddress = companyEmailAddress;
+       }
+
+       /**
+        * Getter for company's legal status
+        * <p>
+        * @return Company's legal status
+        */
+       public String getCompanyLegalStatus () {
+               return this.companyLegalStatus;
+       }
+
+       /**
+        * Setter for company's legal status
+        * <p>
+        * @param companyLegalStatus Company's legal status
+        */
+       public void setCompanyLegalStatus (final String companyLegalStatus) {
+               this.companyLegalStatus = companyLegalStatus;
+       }
+
+       /**
+        * Getter for company name
+        * <p>
+        * @return Company name
+        */
+       public String getCompanyName () {
+               return this.companyName;
+       }
+
+       /**
+        * Setter for company name
+        * <p>
+        * @param companyName Company name
+        */
+       public void setCompanyName (final String companyName) {
+               this.companyName = companyName;
+       }
+
+       /**
+        * Getter for fax number's area code
+        * <p>
+        * @return Fax number's area code
+        */
+       public Integer getFaxAreaCode () {
+               return this.faxAreaCode;
+       }
+
+       /**
+        * Setter for fax number's area code
+        * <p>
+        * @param faxAreaCode Fax number's area code
+        */
+       public void setFaxAreaCode (final Integer faxAreaCode) {
+               this.faxAreaCode = faxAreaCode;
+       }
+
+       /**
+        * Getter for fax's country instance
+        * <p>
+        * @return Fax' country instance
+        */
+       public Country getFaxCountry () {
+               return this.faxCountry;
+       }
+
+       /**
+        * Setter for fax's country instance
+        * <p>
+        * @param faxCountry Fax' country instance
+        */
+       public void setFaxCountry (final Country faxCountry) {
+               this.faxCountry = faxCountry;
+       }
+
+       /**
+        * Getter for fax number
+        * <p>
+        * @return Fax number
+        */
+       public Long getFaxNumber () {
+               return this.faxNumber;
+       }
+
+       /**
+        * Setter for fax number
+        * <p>
+        * @param faxNumber Fax number
+        */
+       public void setFaxNumber (final Long faxNumber) {
+               this.faxNumber = faxNumber;
+       }
+
+       /**
+        * Getter for land-line number's area code
+        * <p>
+        * @return Land-line number's area code
+        */
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
+       }
+
+       /**
+        * Setter for land-line number's area code
+        * <p>
+        * @param landLineAreaCode Land-line number's area code
+        */
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       /**
+        * Getter for land-line number's country instance
+        * <p>
+        * @return Land-line number's country instance
+        */
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
+
+       /**
+        * Setter for land-line number's country instance
+        * <p>
+        * @param landLineCountry Land-line number's country instance
+        */
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
+       }
+
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
+       }
+
+       /**
+        * Setter for land-line number
+        * <p>
+        * @param landLineNumber Land-line number
+        */
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
+       }
+
+       /**
+        * Post-initialization of this class
+        */
+       @PostConstruct
+       public void init () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup
+                       this.adminBusinessDataBean = (BusinessDataAdminSessionBeanRemote) context.lookup("java:global/jjobs-ejb/adminBusinessData!org.mxchange.jcontactsbusiness.BusinessDataAdminSessionBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
+
+               // Init user's contact list
+               this.businessContacts = this.adminBusinessDataBean.allBusinessContacts();
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/businesscontact/JobsAdminBusinessContactWebSessionController.java b/src/java/org/mxchange/jjobs/beans/businesscontact/JobsAdminBusinessContactWebSessionController.java
new file mode 100644 (file)
index 0000000..38fb4ae
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.businesscontact;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.ejb.Local;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
+
+/**
+ * An interface for session-scoped financial controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Local
+public interface JobsAdminBusinessContactWebSessionController extends Serializable {
+
+       /**
+        * Returns a list of all business contacts
+        * <p>
+        * @return A list of all business contacts
+        */
+       List<BusinessBasicData> allBusinessContacts ();
+
+}
index 8c823122358c1d2b0c4ee7908fd1892dc899d5a3..d481b1d41ac1f139505ec881feb553857787f670 100644 (file)
  */
 package org.mxchange.jjobs.beans.businesscontact;
 
-import java.text.MessageFormat;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.SessionScoped;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jcontactsbusiness.BusinessContact;
-import org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote;
+import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
 
@@ -44,7 +36,7 @@ import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
  */
 @Named ("businessContactController")
 @SessionScoped
-public abstract class JobsBusinessContactWebSessionBean extends BaseJobsController implements JobsBusinessContactWebSessionController {
+public class JobsBusinessContactWebSessionBean extends BaseJobsController implements JobsBusinessContactWebSessionController {
 
        /**
         * Serial number
@@ -54,12 +46,57 @@ public abstract class JobsBusinessContactWebSessionBean extends BaseJobsControll
        /**
         * Remote contact bean
         */
-       private BusinessContactSessionBeanRemote businessContactBean;
+       private BusinessDataSessionBeanRemote businessDataBean;
 
        /**
-        * A list of all registered companies (globally)
+        * Comments for this company
         */
-       private List<BusinessContact> registeredCompanies;
+       private String companyComments;
+
+       /**
+        * Companies (main) email address (example: info@company.example)
+        */
+       private String companyEmailAddress;
+
+       /**
+        * Company legal status (example: Incorporated, GmbH)
+        */
+       private String companyLegalStatus;
+
+       /**
+        * Company name
+        */
+       private String companyName;
+
+       /**
+        * Area code for fax number
+        */
+       private Integer faxAreaCode;
+
+       /**
+        * Country for fax number
+        */
+       private Country faxCountry;
+
+       /**
+        * Dial number for fax number
+        */
+       private Long faxNumber;
+
+       /**
+        * Area code for land-line number
+        */
+       private Integer landLineAreaCode;
+
+       /**
+        * Country for land-line number
+        */
+       private Country landLineCountry;
+
+       /**
+        * Dial number for land-line number
+        */
+       private Long landLineNumber;
 
        /**
         * User instance
@@ -75,157 +112,202 @@ public abstract class JobsBusinessContactWebSessionBean extends BaseJobsControll
                super();
        }
 
-       @Override
-       public List<BusinessContact> allRegisteredCompanies () {
-               return Collections.unmodifiableList(this.registeredCompanies);
+       /**
+        * Getter for comments
+        * <p>
+        * @return Comments
+        */
+       public String getCompanyComments () {
+               return this.companyComments;
+       }
+
+       /**
+        * Setter for comments
+        * <p>
+        * @param companyComments Comments
+        */
+       public void setCompanyComments (final String companyComments) {
+               this.companyComments = companyComments;
        }
 
        /**
-        * Post-initialization of this class
+        * Getter for company's (main) email address
+        * <p>
+        * @return Company's (main) email address
         */
-       @PostConstruct
-       public void init () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
+       public String getCompanyEmailAddress () {
+               return this.companyEmailAddress;
+       }
 
-                       // Try to lookup
-                       this.businessContactBean = (BusinessContactSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N
+       /**
+        * Setter for company's (main) email address
+        * <p>
+        * @param companyEmailAddress Company's (main) email address
+        */
+       public void setCompanyEmailAddress (final String companyEmailAddress) {
+               this.companyEmailAddress = companyEmailAddress;
+       }
 
-                       // Init list
-                       this.registeredCompanies = this.businessContactBean.allBusinessContacts();
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
+       /**
+        * Getter for company's legal status
+        * <p>
+        * @return Company's legal status
+        */
+       public String getCompanyLegalStatus () {
+               return this.companyLegalStatus;
        }
 
        /**
-        * Returns given property key or throws an exception if not found.
+        * Setter for company's legal status
         * <p>
-        * @param parameterKey Property key
+        * @param companyLegalStatus Company's legal status
+        */
+       public void setCompanyLegalStatus (final String companyLegalStatus) {
+               this.companyLegalStatus = companyLegalStatus;
+       }
+
+       /**
+        * Getter for company name
+        * <p>
+        * @return Company name
+        */
+       public String getCompanyName () {
+               return this.companyName;
+       }
+
+       /**
+        * Setter for company name
         * <p>
-        * @return Property value
+        * @param companyName Company name
+        */
+       public void setCompanyName (final String companyName) {
+               this.companyName = companyName;
+       }
+
+       /**
+        * Getter for fax number's area code
         * <p>
-        * @throws NullPointerException If given key is not found
-        * @throws NumberFormatException If no number is given in context parameter
+        * @return Fax number's area code
         */
-       protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
-               // Get context parameter
-               Integer contextValue = Integer.parseInt(this.getStringContextParameter(parameterKey));
-               // Return it
-               return contextValue;
+       public Integer getFaxAreaCode () {
+               return this.faxAreaCode;
        }
 
        /**
-        * Returns given property key or throws an exception if not found.
+        * Setter for fax number's area code
         * <p>
-        * @param parameterKey Property key
+        * @param faxAreaCode Fax number's area code
+        */
+       public void setFaxAreaCode (final Integer faxAreaCode) {
+               this.faxAreaCode = faxAreaCode;
+       }
+
+       /**
+        * Getter for fax's country instance
         * <p>
-        * @return Property value
+        * @return Fax' country instance
+        */
+       public Country getFaxCountry () {
+               return this.faxCountry;
+       }
+
+       /**
+        * Setter for fax's country instance
         * <p>
-        * @throws NullPointerException If given key is not found
+        * @param faxCountry Fax' country instance
         */
-       protected String getStringContextParameter (final String parameterKey) throws NullPointerException {
-               // Get context parameter
-               String contextValue = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(parameterKey);
-               // Is it null?
-               if (null == contextValue) {
-                       // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("parameterKey={0} is not set.", parameterKey)); //NOI18N
-               }
-               // Return it
-               return contextValue;
+       public void setFaxCountry (final Country faxCountry) {
+               this.faxCountry = faxCountry;
        }
 
        /**
-        * Checks whether debug mode is enabled for given controller
+        * Getter for fax number
         * <p>
-        * @param controllerName Name of controller
+        * @return Fax number
+        */
+       public Long getFaxNumber () {
+               return this.faxNumber;
+       }
+
+       /**
+        * Setter for fax number
         * <p>
-        * @return Whether debug mode is enabled
+        * @param faxNumber Fax number
         */
-       protected boolean isDebugModeEnabled (final String controllerName) {
-               // Parameters should be valid
-               if (null == controllerName) {
-                       // Throw NPE
-                       throw new NullPointerException("controllerName is null"); //NOI18N
-               } else if (controllerName.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("controllerName is empty"); //NOI18N
-               }
-               // Try to get context parameter
-               String contextParameter = this.getStringContextParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
-               // Is it set and true?
-               boolean isEnabled = Boolean.parseBoolean(contextParameter) == Boolean.TRUE;
-               // Return it
-               return isEnabled;
+       public void setFaxNumber (final Long faxNumber) {
+               this.faxNumber = faxNumber;
+       }
+
+       /**
+        * Getter for land-line number's area code
+        * <p>
+        * @return Land-line number's area code
+        */
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
        }
 
        /**
-        * Loads resource bundle for given locale. This must be implemented per
-        * project so all projects can still customize their methods. Calling
-        * ResourceBundleloadBundle() in this class means that also the bundle files
-        * must be present here.
+        * Setter for land-line number's area code
         * <p>
-        * @param locale Locale from e.g. FacesContext
+        * @param landLineAreaCode Land-line number's area code
+        */
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       /**
+        * Getter for land-line number's country instance
         * <p>
-        * @return Initialized and loaded resource bundle
+        * @return Land-line number's country instance
         */
-       protected abstract ResourceBundle loadResourceBundle (final Locale locale);
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
 
        /**
-        * Shows a faces message for given causing exception. The message from the
-        * exception is being inserted into the message.
+        * Setter for land-line number's country instance
         * <p>
-        * @param clientId Client id to send message to
-        * @param cause    Causing exception
+        * @param landLineCountry Land-line number's country instance
         */
-       protected void showFacesMessage (final String clientId, final Throwable cause) {
-               // Get context and add message
-               this.showFacesMessage(clientId, cause.getMessage());
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
        }
 
        /**
-        * Shows a faces message with given message (i18n) key.
+        * Getter for land-line number
         * <p>
-        * @param clientId Client id to send message to
-        * @param i18nKey  Message key
+        * @return Land-line number
+        */
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
+       }
+
+       /**
+        * Setter for land-line number
         * <p>
-        * @throws NullPointerException If clientId or i18nKey is null
-        * @throws IllegalArgumentException If clientId or i18nKey is empty
+        * @param landLineNumber Land-line number
         */
-       protected void showFacesMessage (final String clientId, final String i18nKey) throws NullPointerException, IllegalArgumentException {
-               // Both parameter must be valid
-               if (null == clientId) {
-                       // Throw NPE
-                       throw new NullPointerException("clientId is null"); //NOI18N
-               } else if (clientId.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("clientId is null"); //NOI18N
-               } else if (null == i18nKey) {
-                       // Throw NPE
-                       throw new NullPointerException("i18nKey is null"); //NOI18N
-               } else if (i18nKey.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("i18nKey is null"); //NOI18N
-               }
-               // Get current locale
-               Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-               // Get bundle bundle
-               ResourceBundle bundle = this.loadResourceBundle(locale);
-               // Default is i18nKey
-               String message = MessageFormat.format("!{0}!", i18nKey); //NOI18N
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
+       }
+
+       /**
+        * Post-initialization of this class
+        */
+       @PostConstruct
+       public void init () {
                // Try it
                try {
-                       // Get message
-                       message = bundle.getString(i18nKey);
-               } catch (final MissingResourceException ex) {
-                       // Did not find it, ignored
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup
+                       this.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/jjobs-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
                }
-               // Get context and add message
-               FacesContext.getCurrentInstance().addMessage(clientId, new FacesMessage(message));
        }
 
 }
index ff839ffa51cacee99a771a14efa8bfd12c0c8576..0debb590592bf22fba4b594dc290d38f7284f59f 100644 (file)
@@ -17,9 +17,7 @@
 package org.mxchange.jjobs.beans.businesscontact;
 
 import java.io.Serializable;
-import java.util.List;
 import javax.ejb.Local;
-import org.mxchange.jcontactsbusiness.BusinessContact;
 
 /**
  * An interface for session-scoped financial controller
@@ -29,11 +27,4 @@ import org.mxchange.jcontactsbusiness.BusinessContact;
 @Local
 public interface JobsBusinessContactWebSessionController extends Serializable {
 
-       /**
-        * Returns a list of all registered companies
-        * <p>
-        * @return A list of all registered companies
-        */
-       List<BusinessContact> allRegisteredCompanies ();
-
 }
index e809f7b7509019a749d467ea3d013155ea9bcf45..5cfd6c042b2ef3c9448369aab809ea270d5558b9 100644 (file)
@@ -26,9 +26,9 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontactsbusiness.BusinessContact;
-import org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.exceptions.BusinessContactNotFoundException;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.exceptions.BusinessDataNotFoundException;
 
 /**
  * Converter for contact id <-> valid business contact instance
@@ -41,7 +41,7 @@ public class JobsBusinessContactConverter implements Converter {
        /**
         * Business contact EJB
         */
-       private BusinessContactSessionBeanRemote businessContactBean;
+       private static BusinessDataSessionBeanRemote BUSINESS_CONTACT_BEAN;
 
        /**
         * Initialization of this converter
@@ -60,36 +60,35 @@ public class JobsBusinessContactConverter implements Converter {
                        return null;
                }
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.businessContactBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsBusinessContactConverter.BUSINESS_CONTACT_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.businessContactBean = (BusinessContactSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+                               // ... and user controller
+                               JobsBusinessContactConverter.BUSINESS_CONTACT_BEAN = (BusinessDataSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
                // Init instance
-               BusinessContact businessContact = null;
+               BusinessBasicData businessContact = null;
 
                try {
                        // Try to parse the value as long
                        Long contactId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       businessContact = this.businessContactBean.findBusinessContactById(contactId);
+                       businessContact = JobsBusinessContactConverter.BUSINESS_CONTACT_BEAN.findBusinessDataById(contactId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
-               } catch (final BusinessContactNotFoundException ex) {
+               } catch (final BusinessDataNotFoundException ex) {
                        // Debug message
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
                }
@@ -110,7 +109,7 @@ public class JobsBusinessContactConverter implements Converter {
                }
 
                // Return category id
-               return String.valueOf(((BusinessContact) value).getBusinessContactId());
+               return String.valueOf(((BusinessBasicData) value).getBusinessDataId());
        }
 
 }
index c15454dfd387ffa064ed2cb9af75ba2641d34164..5d77237375c695fcdb23752ef858998aea8f450a 100644 (file)
@@ -40,7 +40,7 @@ public class JobsContactConverter implements Converter {
        /**
         * User EJB
         */
-       private ContactSessionBeanRemote contactBean;
+       private static ContactSessionBeanRemote CONTACT_BEAN;
 
        /**
         * Initialization of this converter
@@ -59,20 +59,19 @@ public class JobsContactConverter implements Converter {
                        return null;
                }
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.contactBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsContactConverter.CONTACT_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.contactBean = (ContactSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+                               // ... and user controller
+                               JobsContactConverter.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
@@ -84,7 +83,7 @@ public class JobsContactConverter implements Converter {
                        Long contactId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       contact = this.contactBean.findContactById(contactId);
+                       contact = JobsContactConverter.CONTACT_BEAN.findContactById(contactId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 9f0fe4d10c3bafc972486f0a7b278dab0d02db56..5876f0cd33034abe1410a2407fbde8cc7d2e0f5d 100644 (file)
@@ -41,7 +41,7 @@ public class JobsCountryConverter implements Converter {
        /**
         * Country bean
         */
-       private CountrySingletonBeanRemote countryBean = null;
+       private static CountrySingletonBeanRemote COUNTRY_BEAN;
 
        /**
         * Initialization of this converter
@@ -60,25 +60,24 @@ public class JobsCountryConverter implements Converter {
                        return null;
                }
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.countryBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
-
-                                       // ... and country bean
-                                       this.countryBean = (CountrySingletonBeanRemote) initialContext.lookup("java:global/jjobs-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsCountryConverter.COUNTRY_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and country bean
+                               JobsCountryConverter.COUNTRY_BEAN = (CountrySingletonBeanRemote) initialContext.lookup("java:global/jjobs-ejb/country!org.mxchange.jcountry.data.CountrySingletonBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
                // Get full list
-               List<Country> countryList = this.countryBean.allCountries();
+               List<Country> countryList = JobsCountryConverter.COUNTRY_BEAN.allCountries();
 
                // Init value
                Country country = null;
index 9845006ef324a2f6dbfb61cd17cd504153c27ba2..9294a04ba0aaeeffe8b8cd25013fdc61ca20878c 100644 (file)
@@ -25,8 +25,6 @@ import javax.faces.convert.FacesConverter;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
 import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
@@ -40,51 +38,47 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
 @FacesConverter (value = "FaxNumberConverter")
 public class JobsFaxNumberConverter implements Converter {
 
-       /**
-        * Logger instance
-        */
-       @Log
-       private LoggerBeanLocal loggerBeanLocal;
-
        /**
         * Phone EJB
         */
-       private PhoneSessionBeanRemote phoneBean;
+       private static PhoneSessionBeanRemote PHONE_BEAN;
 
        /**
         * Initialization of this converter
         */
        public JobsFaxNumberConverter () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
-                       // ... and user controller
-                       this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-               }
        }
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Log message
-               this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: context={1},component={2},submittedValue={3} - CALLED!", this.getClass().getSimpleName(), context, component, submittedValue)); //NOI18N
+               // @TODO Not possible here: this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: context={1},component={2},submittedValue={3} - CALLED!", this.getClass().getSimpleName(), context, component, submittedValue)); //NOI18N
 
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
-                       this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+                       // @TODO Not possible here: this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
 
                        // Return null
                        return null;
                }
 
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsFaxNumberConverter.PHONE_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and user controller
+                               JobsFaxNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+                       }
+               }
+
                // Init instance
                DialableFaxNumber faxNumber = null;
 
@@ -93,21 +87,19 @@ public class JobsFaxNumberConverter implements Converter {
                        Long faxNumberId = Long.valueOf(submittedValue);
 
                        // Log message
-                       this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject: faxNumberId={1}", this.getClass().getSimpleName(), faxNumberId)); //NOI18N
-
+                       // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject: faxNumberId={1}", this.getClass().getSimpleName(), faxNumberId)); //NOI18N
                        // Try to get mobile instance from it
-                       faxNumber = this.phoneBean.findFaxNumberById(faxNumberId);
+                       faxNumber = JobsFaxNumberConverter.PHONE_BEAN.findFaxNumberById(faxNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
                } catch (final PhoneEntityNotFoundException ex) {
                        // Debug message
-                       this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+                       // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
                }
 
                // Log message
-               this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: faxNumber={1} - EXIT!", this.getClass().getSimpleName(), faxNumber)); //NOI18N
-
+               // @TODO Not possible here: this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: faxNumber={1} - EXIT!", this.getClass().getSimpleName(), faxNumber)); //NOI18N
                // Return it
                return faxNumber;
        }
index 3e5b6f6e093d4151627eb7b76c622e9f48da33bb..18414be57cab6528491b5a96d87916b222a55c6d 100644 (file)
@@ -25,8 +25,6 @@ import javax.faces.convert.FacesConverter;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
 import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
@@ -40,35 +38,15 @@ import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
 @FacesConverter (value = "LandLineNumberConverter")
 public class JobsLandLineNumberConverter implements Converter {
 
-       /**
-        * Logger instance
-        */
-       @Log
-       private LoggerBeanLocal loggerBeanLocal;
-
        /**
         * Phone EJB
         */
-       private PhoneSessionBeanRemote phoneBean;
+       private static PhoneSessionBeanRemote PHONE_BEAN;
 
        /**
         * Initialization of this converter
         */
        public JobsLandLineNumberConverter () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
-                       // ... and user controller
-                       this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-               }
        }
 
        @Override
@@ -76,12 +54,28 @@ public class JobsLandLineNumberConverter implements Converter {
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
                        // Warning message
-                       this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+                       // @TODO Not possible here: this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
 
                        // Return null
                        return null;
                }
 
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsLandLineNumberConverter.PHONE_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and user controller
+                               JobsLandLineNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+                       }
+               }
+
                // Init instance
                DialableLandLineNumber landLineNumber = null;
 
@@ -90,13 +84,13 @@ public class JobsLandLineNumberConverter implements Converter {
                        Long landLineNumberId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       landLineNumber = this.phoneBean.findLandLineNumberById(landLineNumberId);
+                       landLineNumber = JobsLandLineNumberConverter.PHONE_BEAN.findLandLineNumberById(landLineNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
                } catch (final PhoneEntityNotFoundException ex) {
                        // Debug message
-                       this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+                       // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
                }
 
                // Return it
index 8f084b4d8563648dcd04dba33ee7bc1ff9bc983a..9e9ae7b52dbaa1d0466a90dbab304491effed380 100644 (file)
@@ -41,7 +41,7 @@ public class JobsMobileNumberConverter implements Converter {
        /**
         * Phone EJB
         */
-       private PhoneSessionBeanRemote phoneBean;
+       private static PhoneSessionBeanRemote PHONE_BEAN;
 
        /**
         * Initialization of this converter
@@ -60,20 +60,19 @@ public class JobsMobileNumberConverter implements Converter {
                        return null;
                }
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.phoneBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsMobileNumberConverter.PHONE_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.phoneBean = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+                               // ... and user controller
+                               JobsMobileNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
@@ -85,7 +84,7 @@ public class JobsMobileNumberConverter implements Converter {
                        Long mobileNumberId = Long.valueOf(submittedValue);
 
                        // Try to get mobile instance from it
-                       mobileNumber = this.phoneBean.findMobileNumberById(mobileNumberId);
+                       mobileNumber = JobsMobileNumberConverter.PHONE_BEAN.findMobileNumberById(mobileNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 713dc54c831167546947b8e4fd44f5193c1a4acc..062cf02a254cda3f9d61fc5eaa6ff7b3aeb44f98 100644 (file)
@@ -41,7 +41,7 @@ public class JobsMobileProviderConverter implements Converter {
        /**
         * Mobile provider bean
         */
-       private MobileProviderSingletonBeanRemote mobileRemoteBean;
+       private static MobileProviderSingletonBeanRemote MOBILE_PROVIDER_BEAN;
 
        /**
         * Initialization of this converter
@@ -60,25 +60,24 @@ public class JobsMobileProviderConverter implements Converter {
                        return null;
                }
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.mobileRemoteBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
-
-                                       /// and mobile provider controller
-                                       this.mobileRemoteBean = (MobileProviderSingletonBeanRemote) initialContext.lookup("java:global/jjobs-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote"); //NOI18N
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsMobileProviderConverter.MOBILE_PROVIDER_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               /// and mobile provider controller
+                               JobsMobileProviderConverter.MOBILE_PROVIDER_BEAN = (MobileProviderSingletonBeanRemote) initialContext.lookup("java:global/jjobs-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
                // Get full list
-               List<MobileProvider> providerList = this.mobileRemoteBean.allMobileProvider();
+               List<MobileProvider> providerList = JobsMobileProviderConverter.MOBILE_PROVIDER_BEAN.allMobileProvider();
 
                // Init value
                MobileProvider provider = null;
index 92579ad14662dd5976f06b6ae21805a0614477de..77b6d32f5b606cd87b91ae8ce30e70e74db31e39 100644 (file)
@@ -40,7 +40,7 @@ public class JobsUserConverter implements Converter {
        /**
         * User EJB
         */
-       private UserSessionBeanRemote userBean;
+       private static UserSessionBeanRemote USER_BEAN;
 
        /**
         * Constructor of this converter
@@ -59,20 +59,19 @@ public class JobsUserConverter implements Converter {
                        return null;
                }
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.userBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
+               // Is the bean there?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsUserConverter.USER_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.userBean = (UserSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new RuntimeException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+                               // ... and user controller
+                               JobsUserConverter.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new RuntimeException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
@@ -84,7 +83,7 @@ public class JobsUserConverter implements Converter {
                        Long userId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       user = this.userBean.findUserById(userId);
+                       user = JobsUserConverter.USER_BEAN.findUserById(userId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 4bc5ac411a702f3e79d7e6854c926093a5a7c43c..4afd8e1d1807db0ee4bd6d5b30a72802e6a6961d 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.validator.emailaddress;
 
 import java.text.MessageFormat;
-import java.util.List;
 import java.util.regex.Pattern;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
@@ -41,19 +40,24 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator;
 public class JobsEmailAddressValidator extends BaseStringValidator implements Validator {
 
        /**
-        * Serial number
+        * Contact session-scoped bean
         */
-       private static final long serialVersionUID = 187_536_745_607_192L;
+       private static ContactSessionBeanRemote CONTACT_BEAN;
 
        /**
-        * Contact session-scoped bean
+        * Pattern matcher
         */
-       private ContactSessionBeanRemote contactBean;
+       private static final Pattern EMAIL_PATTERN = Pattern.compile(JobsEmailAddressValidator.EMAIL_REGEX);
 
        /**
-        * Cached list of all email addresses
+        * Email pattern
         */
-       private List<String> emailAddresses;
+       private static final String EMAIL_REGEX = "([^.@]+)(\\\\.[^.@]+)*@([^.@]+\\\\.)+([^.@]+)"; //NOI18N
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 187_536_745_607_192L;
 
        /**
         * Default constructor
@@ -66,16 +70,25 @@ public class JobsEmailAddressValidator extends BaseStringValidator implements Va
                // The required field
                String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N
 
+               // Check if allowNull is given, otherwise assume "not allowed"
+               Boolean allowEmpty = (component.getAttributes().containsKey("allowEmpty") ? Boolean.parseBoolean((String) component.getAttributes().get("allowEmpty")) : Boolean.FALSE); //NOI18N
+
                // Pre-validation (example: not null, not a string, empty string ...)
-               super.preValidate(context, component, value, requiredFields, false);
+               super.preValidate(context, component, value, requiredFields, allowEmpty);
 
                // Get string from object ... ;-)
                // @TODO Add IDN support (GNU lib?) Search for emailAddressRepeat
                String emailAddress = String.valueOf(value);
 
+               // Is the email address empty and allowed?
+               if (emailAddress.isEmpty() && allowEmpty) {
+                       // Then accept this here
+                       return;
+               }
+
                // Checks if the email address matches a regex ("low-level" check)
                // @TODO Should also be done by <f:validatorRegex />)
-               boolean matches = Pattern.matches("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", emailAddress); //NOI18N
+               boolean matches = EMAIL_PATTERN.matcher(emailAddress).matches(); //NOI18N
 
                // Is the email address valid?
                if (!matches) {
@@ -86,37 +99,36 @@ public class JobsEmailAddressValidator extends BaseStringValidator implements Va
                        throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
                }
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.contactBean) {
-                               // Try it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
-
-                                       // Try to lookup
-                                       this.contactBean = (ContactSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
-
-                                       // Get whole list of email addresses
-                                       this.emailAddresses = this.contactBean.getEmailAddressList();
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+               // Is the bean not yet set?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsEmailAddressValidator.CONTACT_BEAN) {
+                       // Try it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // Try to lookup
+                               JobsEmailAddressValidator.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
                // Get client id (aka form id)
                String clientId = component.getClientId();
 
+               // Is it registered?
+               Boolean isRegistered = JobsEmailAddressValidator.CONTACT_BEAN.isEmailAddressRegistered(emailAddress);
+
                // Is the email address already registered?
-               if ((!clientId.endsWith("resendEmailAddress")) && (this.emailAddresses.contains(emailAddress))) { //NOI18N
+               if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N
                        // Generate message
                        String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N
 
                        // No, then abort here
                        throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
-               } else if ((clientId.endsWith("resendEmailAddress")) && (!this.emailAddresses.contains(emailAddress))) { //NOI18N
+               } else if ((clientId.endsWith("resendEmailAddress")) && (!isRegistered)) { //NOI18N
                        // Generate message
                        String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N
 
index c56a07faba339bc258478ef9704214aeb1442f2c..fbb76390a4b5ec1e6a080295d8450f7f5ba85f95 100644 (file)
@@ -46,7 +46,7 @@ public class JobsUserIdValidator extends BaseLongValidator implements Validator
        /**
         * Remote bean
         */
-       private UserSessionBeanRemote userBean;
+       private static UserSessionBeanRemote USER_BEAN;
 
        /**
         * Initialization of this converter
@@ -65,25 +65,24 @@ public class JobsUserIdValidator extends BaseLongValidator implements Validator
                // Cast value
                Long userId = (Long) value;
 
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.userBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
+               // Is the bean not yet set?
+               // @TODO Requires this synchronization or is it (sync) confusing the container?
+               if (null == JobsUserIdValidator.USER_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.userBean = (UserSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
-                               } catch (final NamingException ex) {
-                                       // Continue to throw it
-                                       throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-                               }
+                               // ... and user controller
+                               JobsUserIdValidator.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
+                       } catch (final NamingException ex) {
+                               // Continue to throw it
+                               throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
                        }
                }
 
                // Define variable
-               Boolean ifUserExists = this.userBean.ifUserIdExists(userId);
+               Boolean ifUserExists = JobsUserIdValidator.USER_BEAN.ifUserIdExists(userId);
 
                // Is the user id valid?
                if (!ifUserExists) {
index ebc60506c34fd231b2032083dac94f72c739dc14..3c7516a0b4da8d7d913144eb560bf66aa16c67bc 100644 (file)
@@ -808,3 +808,44 @@ GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Bitte geben Sie ein Passwort ein. Dies m
 #@TODO Please fix German umlauts!
 GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Bitte wiederholen Sie das eingegebene Passwort. Dies wird zur Bestaetigung benoetigt.
 PAGE_TITLE_ADMIN_AREA=Administration
+#@TODO Please fix German umlauts!
+ADMIN_MENU_CONTACT_BUSINESS_TITLE=Geschaeftliche Kontakte
+#@TODO Please fix German umlauts!
+LINK_ADMIN_LIST_CONTACT_BUSINESS=Geschaeftskontakte auflisten
+#@TODO Please fix German umlauts!
+LINK_ADMIN_LIST_CONTACT_BUSINESS_TITLE=Listet geschaeftliche Kontakte auf
+#@TODO Please fix German umlauts!
+LINK_ADMIN_EXPORT_CONTACT_BUSINESS=Geschaeftliche Kontakte exportieren
+#@TODO Please fix German umlauts!
+LINK_ADMIN_EXPORT_CONTACT_BUSINESS_TITLE=Exportiert geschaeftliche Kontakte
+#@TODO Please fix German umlauts!
+PAGE_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Geschaeftliche Kontakte auflisten
+#@TODO Please fix German umlauts!
+CONTENT_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Auflisten von geschaeftlichen Kontakt
+#@TODO Please fix German umlauts!
+ADMIN_CONTACT_BUSINESS_LIST_EMPTY=Es befinden sich keine geschaeftlichen Kontakte in der Datenbank.
+#@TODO Please fix German umlauts!
+TABLE_SUMMARY_ADMIN_LIST_CONTACT_BUSINESS=Tabelle listet geschaeftliche Kontakte auf.
+ADMIN_CONTACT_BUSINESS_ID=Id-Nummer:
+#@TODO Please fix German umlauts!
+ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Details des geschaeftlichen Kontaktes anzeigen.
+ADMIN_CONTACT_BUSINESS_OWNER_ID=Zugew. Benutzer:
+ADMIN_LINK_SHOW_CONTACT_BUSINESS_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen.
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER=Zuweisen
+#@TODO Please fix German umlauts!
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER_TITLE=Geschaeftlichen Kontakt einen Benutzeraccount zuweisen.
+ADMIN_CONTACT_BUSINESS_COMPANY_NAME=Firmenname:
+ADMIN_CONTACT_BUSINESS_CONTACT_PERSON=Ansprechpartner:
+ADMIN_LINK_SHOW_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Zeigt einen Mitarbeiter an, der als Ansprechpartner eingetragen ist.
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON=Zuweisen
+#@TODO Please fix German umlauts!
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Weisst einen Mitarbeiter als Ansprechpartner des geschaftlichen Kontaktes zu.
+ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Zeigt das komplette Kontaktprofil an.
+ADMIN_BUSINESS_DATA_COMPANY_COMMENTS=Anmerkungen:
+ADMIN_BUSINESS_DATA_PHONE_NUMBER=Haupttelefonnummer:
+ADMIN_BUSINESS_DATA_FAX_NUMBER=Hauptfaxnummer:
+#@TODO Please fix German umlauts!
+ADMIN_ADD_CONTACT_BUSINESS_TITLE=Neuen geschaeftlichen Kontakt hinzufuegen
+ADMIN_ADD_CONTACT_BUSINESS_MINIMUM_DATA=Bitte mindestens Firmennamen mit Rechtsstand ein.
+#@TODO Please fix German umlauts!
+ENTERED_EMAIL_ADDRESS_IS_INVALID=Die eingegebene Email-Addresse entspricht nicht dem gueltigen Format.
index 4fa078fd852ae88996170c82c1e2fed220d2ac0b..af487eca757e431e926b96e386b3dcba8817d929 100644 (file)
@@ -803,3 +803,30 @@ GUEST_REGISTRATION_USER_PASSWORDS_EMPTY_NOT_ALLOWED=You have to enter an own pas
 GUEST_REGISTRATION_PASSWORD_NOT_ENTERED=Please enter a password. This must match with security rules.
 GUEST_REGISTRATION_PASSWORD_REPEAT_NOT_ENTERED=Please repeat the entered password. This done to confirm the password.
 PAGE_TITLE_ADMIN_AREA=Administration
+ADMIN_MENU_CONTACT_BUSINESS_TITLE=Business Contacts
+LINK_ADMIN_LIST_CONTACT_BUSINESS=List business contacts
+LINK_ADMIN_LIST_CONTACT_BUSINESS_TITLE=Lists business contacts
+LINK_ADMIN_EXPORT_CONTACT_BUSINESS=Export business contacts
+LINK_ADMIN_EXPORT_CONTACT_BUSINESS_TITLE=Exports business contacts
+PAGE_TITLE_ADMIN_LIST_CONTACT_BUSINESS=List business contacts
+CONTENT_TITLE_ADMIN_LIST_CONTACT_BUSINESS=Lists business contacts
+ADMIN_CONTACT_BUSINESS_LIST_EMPTY=There are currently no business contacts in database.
+TABLE_SUMMARY_ADMIN_LIST_CONTACT_BUSINESS=This table lists business contacts.
+ADMIN_CONTACT_BUSINESS_ID=Id Number:
+ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE=Show details of this business contact.
+ADMIN_CONTACT_BUSINESS_OWNER_ID=Assigned user:
+ADMIN_LINK_SHOW_CONTACT_BUSINESS_OWNER_USER_TITLE=Shows assigned user profile.
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER=Assign
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER_TITLE=Assigns this business contact to a user account.
+ADMIN_CONTACT_BUSINESS_COMPANY_NAME=Company name:
+ADMIN_CONTACT_BUSINESS_CONTACT_PERSON=Contact person:
+ADMIN_LINK_SHOW_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Shows a single employee entry who has been assigned as contact person.
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON=Assign
+ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON_TITLE=Assigns an employee as a contact person for given business contact.
+ADMIN_SHOW_FULL_CONTACT_DATA_TITLE=Shows complete contact profile.
+ADMIN_BUSINESS_DATA_COMPANY_COMMENTS=Comments:
+ADMIN_BUSINESS_DATA_PHONE_NUMBER=Main phone number:
+ADMIN_BUSINESS_DATA_FAX_NUMBER=Main fax number:
+ADMIN_ADD_CONTACT_BUSINESS_TITLE=Add new business contact
+ADMIN_ADD_CONTACT_BUSINESS_MINIMUM_DATA=Please enter at least company name and legal status.
+ENTERED_EMAIL_ADDRESS_IS_INVALID=Your entered email address is not valid.
index 089188c11de941c8537c0bf102155c922bca3542..c3579385a2b9d37d055e7f786e2c2e2a0bda4db4 100644 (file)
                        <from-outcome>admin_export_contact</from-outcome>
                        <to-view-id>/admin/contact/admin_contact_export.xhtml</to-view-id>
                </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_list_contact_business</from-outcome>
+                       <to-view-id>/admin/contact_business/admin_contact_business_list.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_export_contact_business</from-outcome>
+                       <to-view-id>/admin/contact_business/admin_contact_business_export.xhtml</to-view-id>
+               </navigation-case>
                <navigation-case>
                        <from-outcome>admin_list_user</from-outcome>
                        <to-view-id>/admin/user/admin_user_list.xhtml</to-view-id>
index b865ba022208e5e19d6b8e2870e857a4c5941030..12d3bb233a2780f30d3cf3393c67c458e1ecfc75 100644 (file)
                                <li><h:link title="#{msg.LINK_ADMIN_EXPORT_CONTACT_TITLE}" outcome="admin_export_contact" value="#{msg.LINK_ADMIN_EXPORT_CONTACT}" /></li>
                        </ul>
 
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('business_contacts')}">
+                               <div class="menu_header">
+                                       <h:outputText value="#{msg.ADMIN_MENU_CONTACT_BUSINESS_TITLE}" />
+                               </div>
+
+                               <ul>
+                                       <li><h:link title="#{msg.LINK_ADMIN_LIST_CONTACT_BUSINESS_TITLE}" outcome="admin_list_contact_business" value="#{msg.LINK_ADMIN_LIST_CONTACT_BUSINESS}" /></li>
+                                       <li><h:link title="#{msg.LINK_ADMIN_EXPORT_CONTACT_BUSINESS_TITLE}" outcome="admin_export_contact_business" value="#{msg.LINK_ADMIN_EXPORT_CONTACT_BUSINESS}" /></li>
+                               </ul>
+                       </ui:fragment>
+
                        <div class="menu_header">
                                <h:outputText value="#{msg.ADMIN_MENU_PHONE_NUMBERS_TITLE}" />
                        </div>
index 5b015a0d8eb59a4e9c0e1bd8e2ae159fc9cb367f..8ed4e71e910fb96c89838ecc0923d52fa33b48eb 100644 (file)
 
                        <h:panelGroup styleClass="table_row" layout="block">
                                <div class="table_left_medium">
-                                       <h:outputLabel value="#{msg.ADMIN_PERSONAL_DATA_PHONE_NUMBER}" />
+                                       <h:outputLabel for="landLineCountryCode" value="#{msg.ADMIN_PERSONAL_DATA_PHONE_NUMBER}" />
                                </div>
 
                                <div class="table_right_medium">
-                                       <h:selectOneMenu styleClass="select right_space" id="countryPhoneCode" value="#{adminContactController.landLineCountry}">
+                                       <h:selectOneMenu styleClass="select right_space" id="landLineCountryCode" value="#{adminContactController.landLineCountry}">
                                                <f:converter converterId="CountryConverter" />
                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryPhoneCode}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryCode}" />
                                        </h:selectOneMenu>
 
                                        <h:inputText styleClass="input right_space" id="landLineAreaCode" size="5" maxlength="10" value="#{adminContactController.landLineAreaCode}">
 
                        <h:panelGroup styleClass="table_row" layout="block">
                                <div class="table_left_medium">
-                                       <h:outputLabel for="faxNumber" value="#{msg.ADMIN_PERSONAL_DATA_FAX_NUMBER}" />
+                                       <h:outputLabel for="faxCountryCode" value="#{msg.ADMIN_PERSONAL_DATA_FAX_NUMBER}" />
                                </div>
 
                                <div class="table_right_medium">
                                        <h:selectOneMenu styleClass="select right_space" id="faxCountryCode" value="#{adminContactController.faxCountry}">
                                                <f:converter converterId="CountryConverter" />
                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryPhoneCode}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryCode}" />
                                        </h:selectOneMenu>
 
                                        <h:inputText styleClass="input right_space" id="faxAreaCode" size="5" maxlength="10" value="#{adminContactController.faxAreaCode}">
                                </div>
 
                                <div class="table_right_medium">
-                                       <h:inputText styleClass="input" id="emailAddress" size="10" maxlength="255" value="#{adminContactController.emailAddress}" />
+                                       <h:inputText styleClass="input" id="emailAddress" size="10" maxlength="255" value="#{adminContactController.emailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
+                                               <f:validator validatorId="EmailAddressValidator" />
+                                       </h:inputText>
                                </div>
 
                                <div class="clear"></div>
diff --git a/web/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl b/web/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl
new file mode 100644 (file)
index 0000000..8693702
--- /dev/null
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+       <div class="para">
+               <fieldset class="fieldset" id="business_basic_data">
+                       <legend title="#{msg.ADMIN_CONTACT_BUSINESS_DATA_LEGEND_TITLE}">
+                               <h:outputText value="#{msg.ADMIN_CONTACT_BUSINESS_DATA_LEGEND}" />
+                       </legend>
+
+                       <h:panelGroup styleClass="table_row" layout="block">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="companyName" value="#{msg.ADMIN_BUSINESS_DATA_COMPANY_NAME}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputText styleClass="input" id="companyName" size="30" maxlength="200" required="true" requiredMessage="#{msg.ADMIN_BUSINESS_DATA_COMPANY_NAME_REQUIRED}" value="#{adminBusinessDataController.companyName}" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="companyName" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table_row" layout="block">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="companyLegalStatus" value="#{msg.ADMIN_BUSINESS_DATA_COMPANY_LEGAL_STATUS}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputText styleClass="input" id="companyLegalStatus" size="5" maxlength="10" required="true" requiredMessage="#{msg.ADMIN_BUSINESS_DATA_COMPANY_LEGAL_STATUS_REQUIRED}" value="#{adminBusinessDataController.companyLegalStatus}" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="companyLegalStatus" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table_row" layout="block">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="companyEmailAddress" value="#{msg.ADMIN_BUSINESS_DATA_COMPANY_EMAIL_ADDRESS}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputText styleClass="input" id="companyEmailAddress" size="20" maxlength="255" value="#{adminBusinessDataController.companyEmailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
+                                               <f:validator validatorId="EmailAddressValidator" />
+                                               <f:attribute name="allowEmpty" value="true" />
+                                       </h:inputText>
+                               </div>
+
+                               <div class="clear"></div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="companyEmailAddress" errorClass="errors" warnClass="warnings" fatalClass="errors" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table_row" layout="block">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="companyComments" value="#{msg.ADMIN_BUSINESS_DATA_COMPANY_COMMENTS}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputTextarea styleClass="input" id="companyComments" rows="7" cols="25" value="#{adminBusinessDataController.companyComments}" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table_row" layout="block">
+                               <div class="table_left_medium">
+                                       <h:outputLabel value="#{msg.ADMIN_BUSINESS_DATA_PHONE_NUMBER}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:selectOneMenu styleClass="select right_space" id="landLineCountryCode" value="#{adminBusinessDataController.landLineCountry}">
+                                               <f:converter converterId="CountryConverter" />
+                                               <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryCode}" />
+                                       </h:selectOneMenu>
+
+                                       <h:inputText styleClass="input right_space" id="landLineAreaCode" size="5" maxlength="10" value="#{adminBusinessDataController.landLineAreaCode}">
+                                               <f:validator for="landLineAreaCode" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+
+                                       <h:inputText styleClass="input" id="landLineNumber" size="10" maxlength="20" value="#{adminBusinessDataController.landLineNumber}">
+                                               <f:validator for="landLineNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+                               </div>
+
+                               <div class="clear"></div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table_row" layout="block">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="faxCountryCode" value="#{msg.ADMIN_BUSINESS_DATA_FAX_NUMBER}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:selectOneMenu styleClass="select right_space" id="faxCountryCode" value="#{adminBusinessDataController.faxCountry}">
+                                               <f:converter converterId="CountryConverter" />
+                                               <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryCode}" />
+                                       </h:selectOneMenu>
+
+                                       <h:inputText styleClass="input right_space" id="faxAreaCode" size="5" maxlength="10" value="#{adminBusinessDataController.faxAreaCode}">
+                                               <f:validator for="faxAreaCode" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+
+                                       <h:inputText styleClass="input" id="faxNumber" size="10" maxlength="20" value="#{adminBusinessDataController.faxNumber}">
+                                               <f:validator for="faxNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+                               </div>
+
+                               <div class="clear"></div>
+                       </h:panelGroup>
+               </fieldset>
+       </div>
+</ui:composition>
index 61e466e12d97917ba2ff8c2eb5f70c7636ea281f..33c33bcf02188c8ae284b5999f7fa789346d7867 100644 (file)
                <ul class="mini_nav">
                        <ui:fragment rendered="#{empty isShowPage or not isShowPage}">
                                <li class="mini_link">
-                                       <h:link outcome="admin_show_fax">
-                                               <h:outputText value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}" />
+                                       <h:link outcome="admin_show_fax" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}">
                                                <f:param name="phoneId" value="#{beanHelper.faxNumber.phoneId}" />
                                        </h:link>
                                </li>
                        </ui:fragment>
 
                        <li class="mini_link">
-                               <h:link outcome="admin_edit_fax">
-                                       <h:outputText value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_SHORT_TITLE}" />
+                               <h:link outcome="admin_edit_fax" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_SHORT_TITLE}">
                                        <f:param name="phoneId" value="#{beanHelper.faxNumber.phoneId}" />
                                </h:link>
                        </li>
index 6ffb7660ec53283799f59c77c63539c967be4fa4..4292e6ddfbfde0f955deaffebb5616861ae344f2 100644 (file)
                <ul class="mini_nav">
                        <ui:fragment rendered="#{empty isShowPage or not isShowPage}">
                                <li class="mini_link">
-                                       <h:link outcome="admin_show_landline">
-                                               <h:outputText value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}" />
+                                       <h:link outcome="admin_show_landline" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}">
                                                <f:param name="phoneId" value="#{beanHelper.landLineNumber.phoneId}" />
                                        </h:link>
                                </li>
                        </ui:fragment>
 
                        <li class="mini_link">
-                               <h:link outcome="admin_edit_landline">
-                                       <h:outputText value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_SHORT_TITLE}" />
+                               <h:link outcome="admin_edit_landline" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_SHORT_TITLE}">
                                        <f:param name="phoneId" value="#{beanHelper.landLineNumber.phoneId}" />
                                </h:link>
                        </li>
index 95cfde3f5d5a97b9c86dc9e3129ea9ec9268fe35..f579fab23a4f6111e92d2f88ff19d835399784a1 100644 (file)
@@ -30,9 +30,9 @@
                <h:column>
                        <h:outputLabel for="mobileProvider" styleClass="table_data_label" value="#{msg.ADMIN_SHOW_MOBILE_PROVIDER_NAME}" />
 
-                       <h:link outcome="admin_show_mobile_provider">
+                       <h:link id="mobileProvider" outcome="admin_show_mobile_provider">
+                               <h:outputText styleClass="table_data_field" value="#{beanHelper.mobileNumber.mobileProvider.providerName}" />
                                <f:param name="providerId" value="#{beanHelper.mobileNumber.mobileProvider.providerId}" />
-                               <h:outputText id="mobileProvider" styleClass="table_data_field" value="#{beanHelper.mobileNumber.mobileProvider.providerName}" />
                        </h:link>
                </h:column>
 
index 33d5ed3a951cef76df99079a4fd0ceba7f40a479..48d218af05a02039aba60060393418c059be3ee7 100644 (file)
                <ul class="mini_nav">
                        <ui:fragment rendered="#{empty isShowPage or not isShowPage}">
                                <li class="mini_link">
-                                       <h:link outcome="admin_show_mobile">
-                                               <h:outputText value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}" />
+                                       <h:link outcome="admin_show_mobile" value="#{msg.ADMIN_LINK_SHOW_SHORT}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}">
                                                <f:param name="phoneId" value="#{beanHelper.mobileNumber.phoneId}" />
                                        </h:link>
                                </li>
                        </ui:fragment>
 
                        <li class="mini_link">
-                               <h:link outcome="admin_edit_mobile">
-                                       <h:outputText value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_SHORT_TITLE}" />
+                               <h:link outcome="admin_edit_mobile" value="#{msg.ADMIN_LINK_EDIT_SHORT}" title="#{msg.ADMIN_LINK_EDIT_SHORT_TITLE}">
                                        <f:param name="phoneId" value="#{beanHelper.mobileNumber.phoneId}" />
                                </h:link>
                        </li>
index 0a47f71b8d101210ab462f9b7263f4a14267e3af..0f512b25db11dc60295e7d183ced47c596ca2ca5 100644 (file)
                </div>
 
                <div class="table_right_medium">
-                       <h:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{contactController.emailAddress}" required="true" requiredMessage="#{msg.EMAIL_ADDRESS_NOT_ENTERED}">
+                       <h:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{contactController.emailAddress}" required="true" requiredMessage="#{msg.EMAIL_ADDRESS_NOT_ENTERED}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
                                <f:validator validatorId="EmailAddressValidator" />
                        </h:inputText>
                </div>
 
                <div class="clear"></div>
+       </h:panelGroup>
 
-               <h:panelGroup styleClass="error_container" layout="block">
-                       <h:message for="emailAddress" errorClass="errors" warnClass="warnings" fatalClass="errors" />
-               </h:panelGroup>
+       <h:panelGroup styleClass="error_container" layout="block">
+               <h:message for="emailAddress" errorClass="errors" warnClass="warnings" fatalClass="errors" />
        </h:panelGroup>
 
        <h:panelGroup styleClass="table_row" layout="block">
@@ -34,9 +34,9 @@
                </div>
 
                <div class="clear"></div>
+       </h:panelGroup>
 
-               <h:panelGroup styleClass="error_container" layout="block">
-                       <h:message for="emailAddressRepeat" errorClass="errors" warnClass="warnings" fatalClass="errors" />
-               </h:panelGroup>
+       <h:panelGroup styleClass="error_container" layout="block">
+               <h:message for="emailAddressRepeat" errorClass="errors" warnClass="warnings" fatalClass="errors" />
        </h:panelGroup>
 </ui:composition>
index a54a8306953c2c9c8385f29b0a8bd1347ce72bca..7c3976d9bd342ba2faf16270b371e466297433f0 100644 (file)
                </div>
 
                <div class="table_right">
-                       <h:inputText class="input" id="emailAddress" size="20" maxlength="255" value="#{userEmailChangeController.emailAddress}" required="true" requiredMessage="#{msg.EMAIL_ADDRESS_NOT_ENTERED}">
+                       <h:inputText class="input" id="emailAddress" size="20" maxlength="255" value="#{userEmailChangeController.emailAddress}" required="true" requiredMessage="#{msg.EMAIL_ADDRESS_NOT_ENTERED}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
                                <f:validator validatorId="EmailAddressValidator" />
                        </h:inputText>
                </div>
 
                <div class="clear"></div>
+       </h:panelGroup>
 
-               <h:panelGroup styleClass="error_container" layout="block">
-                       <h:message for="emailAddress" errorClass="errors" warnClass="warnings" fatalClass="errors" />
-               </h:panelGroup>
+       <h:panelGroup styleClass="error_container" layout="block">
+               <h:message for="emailAddress" errorClass="errors" warnClass="warnings" fatalClass="errors" />
        </h:panelGroup>
 
        <h:panelGroup styleClass="table_row" layout="block">
@@ -34,9 +34,9 @@
                </div>
 
                <div class="clear"></div>
+       </h:panelGroup>
 
-               <h:panelGroup styleClass="error_container" layout="block">
-                       <h:message for="emailAddressRepeat" errorClass="errors" warnClass="warnings" fatalClass="errors" />
-               </h:panelGroup>
+       <h:panelGroup styleClass="error_container" layout="block">
+               <h:message for="emailAddressRepeat" errorClass="errors" warnClass="warnings" fatalClass="errors" />
        </h:panelGroup>
 </ui:composition>
index e85accf1ecdaf6ac77163db9da8ee70f7a3a26c9..1ddb6de71bab2ba4eb7c6ab2051f25245f062fcf 100644 (file)
@@ -14,8 +14,8 @@
 
        <h:outputText styleClass="notice" value="#{msg.USER_PROFILE_NOT_PUBLICLY_VISIBLE}" rendered="#{not empty user and not profileController.isProfileLinkVisibleByUser(user)}" />
 
-       <h:link id="userProfileLink" outcome="user_profile" title="#{msg.LINK_USER_PROFILE_TITLE}" rendered="#{not empty user and profileController.isProfileLinkVisibleByUser(user)}">
-               <h:outputText id="userName" value="#{user.userName}" />
+       <h:link outcome="user_profile" title="#{msg.LINK_USER_PROFILE_TITLE}" rendered="#{not empty user and profileController.isProfileLinkVisibleByUser(user)}">
+               <h:outputText value="#{user.userName}" />
                <f:param name="userId" value="#{user.userId}" />
        </h:link>
 </ui:composition>
index 5c57de59a39ce3c8180274d19f544e0f89af5f50..05fcc540fd3f49754b90070b23514dc1fd814710 100644 (file)
         <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
         <param-value>true</param-value>
     </context-param>
+    <context-param>
+        <description>All empty strings should be converted to null.</description>
+        <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
+        <param-value>true</param-value>
+    </context-param>
     <context-param>
         <description>Whether the multi-page registration page or a single registration page is active</description>
         <param-name>is_feature_user_register_multiple_page_enabled</param-name>
         <param-name>is_feature_allow_user_registration_empty_password_enabled</param-name>
         <param-value>false</param-value>
     </context-param>
+    <context-param>
+        <description>Whether business contacts are used in this project.</description>
+        <param-name>is_feature_business_contacts_enabled</param-name>
+        <param-value>true</param-value>
+    </context-param>
     <context-param>
         <description>Maximum passwords that must be different.</description>
         <param-name>max_user_password_history</param-name>
index fefe5d66542d90ca8e2be065cdeffe3ab490c7ac..8a21a69408ebe73813042c01926287206da266a4 100644 (file)
@@ -10,7 +10,7 @@
        <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
                <ui:define name="metadata">
                        <f:metadata>
-                               <f:viewParam name="contactId" value="#{beanHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" converterMessage="#{msg.PARAMETER_PHONE_ID_INVALID}" />
+                               <f:viewParam name="contactId" value="#{beanHelper.contact}" converter="ContactConverter" required="true" requiredMessage="#{msg.ERROR_PARAMETER_CONTACT_ID_NOT_SET}" converterMessage="#{msg.PARAMETER_CONTACT_ID_INVALID}" />
                                <f:viewAction onPostback="true" action="#{beanHelper.copyContactToController()}" />
                        </f:metadata>
                </ui:define>
index b2bb1eb9ddc68d15fdbf6ee68482eba0a4f3db83..8d1ee9b99e2dab505bfaf456f8bfee443cf11a22 100644 (file)
@@ -35,8 +35,7 @@
                                        </div>
 
                                        <div class="para">
-                                               <h:link outcome="admin_show_contact">
-                                                       <h:outputText value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}" />
+                                               <h:link outcome="admin_show_contact" value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}">
                                                        <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
                                                </h:link>
                                        </div>
index 28d1ed27723ed683ffeb2c3dd62a8ca08d2a79ee..aa4a24a4414dc955df1c1b9bb0687c0bc7b1a557 100644 (file)
@@ -35,8 +35,7 @@
                                        </div>
 
                                        <div class="para">
-                                               <h:link outcome="admin_show_contact">
-                                                       <h:outputText value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}" />
+                                               <h:link outcome="admin_show_contact" value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}">
                                                        <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
                                                </h:link>
                                        </div>
index eb4c5c5c05254d17c0222a137a314520a1c38967..7b020fffb2f4e548e8f70c9a276a050f45732afe 100644 (file)
@@ -35,8 +35,7 @@
                                        </div>
 
                                        <div class="para">
-                                               <h:link outcome="admin_show_contact">
-                                                       <h:outputText value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}" />
+                                               <h:link outcome="admin_show_contact" title="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA_TITLE}" value="#{msg.ADMIN_SHOW_FULL_CONTACT_DATA}">
                                                        <f:param name="contactId" value="#{beanHelper.contact.contactId}" />
                                                </h:link>
                                        </div>
diff --git a/web/admin/contact_business/admin_contact_business_list.xhtml b/web/admin/contact_business/admin_contact_business_list.xhtml
new file mode 100644 (file)
index 0000000..8bfc600
--- /dev/null
@@ -0,0 +1,97 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+       lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       >
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">
+                       <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_CONTACT_BUSINESS}" />
+               </ui:define>
+
+               <ui:define name="content_header">
+                       <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_CONTACT_BUSINESS}" />
+               </ui:define>
+
+               <ui:define name="content">
+                       <ui:fragment rendered="#{adminBusinessDataController.allBusinessContacts().isEmpty()}">
+                               <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
+                                       <ui:param name="message" value="#{msg.ADMIN_CONTACT_BUSINESS_LIST_EMPTY}" />
+                                       <ui:param name="styleClass" value="errors" />
+                               </ui:include>
+                       </ui:fragment>
+
+                       <h:dataTable id="table_list_business_contacts" var="businessContact" value="#{adminBusinessDataController.allBusinessContacts()}" styleClass="table_full" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_CONTACT_BUSINESS}" rendered="#{not adminBusinessDataController.allBusinessContacts().isEmpty()}">
+                               <h:column>
+                                       <f:facet name="header">
+                                               <h:outputText value="#{msg.ADMIN_CONTACT_BUSINESS_ID}" />
+                                       </f:facet>
+
+                                       <h:link outcome="admin_show_contact_business" title="#{msg.ADMIN_LINK_SHOW_BUSINESS_CONTACT_DATA_TITLE}" value="#{businessContact.businessDataId}">
+                                               <f:param name="businessDataId" value="#{businessContact.businessDataId}" />
+                                       </h:link>
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">
+                                               <h:outputText value="#{msg.ADMIN_CONTACT_BUSINESS_OWNER_ID}" />
+                                       </f:facet>
+
+                                       <h:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_CONTACT_BUSINESS_OWNER_USER_TITLE}" value="#{businessContact.contactCompanyUserOwner.userId}" rendered="#{not empty businessContact.contactCompanyUserOwner}" />
+
+                                       <h:link outcome="admin_assign_contact_business_owner" title="#{msg.ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER_TITLE}" value="#{msg[ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_OWNER_USER]}" rendered="#{empty businessContact.contactCompanyUserOwner}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">
+                                               <h:outputText value="#{msg.ADMIN_CONTACT_BUSINESS_COMPANY_NAME}" />
+                                       </f:facet>
+
+                                       <h:outputText value="#{businessContact.companyName}&nbsp;#{businessContact.companyLegalStatus}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">
+                                               <h:outputText value="#{msg.ADMIN_CONTACT_BUSINESS_CONTACT_PERSON}" />
+                                       </f:facet>
+
+                                       <h:link outcome="admin_show_business_employee" title="#{msg.ADMIN_LINK_SHOW_CONTACT_BUSINESS_CONTACT_PERSON_TITLE}" value="#{businessContact.companyContact.employeeId}" rendered="#{not empty businessContact.companyContact}" />
+
+                                       <h:link outcome="admin_assign_contact_business_contact" title="#{msg.ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON_TITLE}" value="#{msg[ADMIN_LINK_ASSIGN_CONTACT_BUSINESS_CONTACT_PERSON]}" rendered="#{empty businessContact.companyContact}" />
+                               </h:column>
+
+                               <h:column>
+                                       <f:facet name="header">
+                                               <h:outputText value="#{msg.ADMIN_CONTACT_BUSINESS_CREATED}" />
+                                       </f:facet>
+
+                                       <h:outputText id="contactCreated" value="#{businessContact.contactCreated.time}">
+                                               <f:convertDateTime for="contactCreated" type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
+                               </h:column>
+                       </h:dataTable>
+
+                       <h:form id="form_admin_add_contact_business">
+                               <h:panelGroup styleClass="table_medium" layout="block">
+                                       <div class="table_header">
+                                               <h:outputText value="#{msg.ADMIN_ADD_CONTACT_BUSINESS_TITLE}" />
+                                       </div>
+
+                                       <div class="para">
+                                               <h:outputText value="#{msg.ADMIN_ADD_CONTACT_BUSINESS_MINIMUM_DATA}" />
+                                       </div>
+
+                                       <ui:include src="/WEB-INF/templates/admin/contact_business/admin_form_contact_business_data.tpl" />
+
+                                       <div class="table_footer">
+                                               <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                               <h:commandButton styleClass="submit" type="submit" id="add_contact" value="#{msg.BUTTON_ADMIN_CONTINUE_BUSINESS_CONTACT_PERSON}" action="#{adminBusinessDataController.addBusinessBasicData()}" />
+                                       </div>
+                               </h:panelGroup>
+                       </h:form>
+               </ui:define>
+       </ui:composition>
+</html>
index e6606f805efde6e80a13433f1df18f6dab011acc..e9573610de0b5087a31f989535fd5de006f8fdc8 100644 (file)
@@ -23,8 +23,7 @@
                                                <h:outputText value="#{msg.ADMIN_SHOW_PHONE_ID}" />
                                        </f:facet>
 
-                                       <h:link outcome="admin_show_fax">
-                                               <h:outputText value="#{faxNumber.phoneId}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}" />
+                                       <h:link outcome="admin_show_fax" value="#{faxNumber.phoneId}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}">
                                                <f:param name="phoneId" value="#{faxNumber.phoneId}" />
                                        </h:link>
                                </h:column>
index f091d4023fdbb67f034fdfe8b490302ea566b217..0d2852123cb4060b87a73efa96492410d97b6286 100644 (file)
@@ -38,8 +38,7 @@
                                <h:column>
                                        <h:outputLabel for="contactId" styleClass="table_data_label" value="#{msg.ADMIN_CONTACT_ID}" />
 
-                                       <h:link id="contactId" styleClass="table_data_field" outcome="admin_show_contact">
-                                               <h:outputText value="#{contact.contactId}" />
+                                       <h:link id="contactId" styleClass="table_data_field" outcome="admin_show_contact" value="#{contact.contactId}">
                                                <f:param name="contactId" value="#{contact.contactId}" />
                                        </h:link>
                                </h:column>
index 354478e69cd3b8989551daab26c6d170cf77d585..b1584ff5d38dcc9df37e4efecec015c39b4620b3 100644 (file)
@@ -23,8 +23,7 @@
                                                <h:outputText value="#{msg.ADMIN_SHOW_PHONE_ID}" />
                                        </f:facet>
 
-                                       <h:link outcome="admin_show_landline">
-                                               <h:outputText value="#{landLineNumber.phoneId}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}" />
+                                       <h:link outcome="admin_show_landline" value="#{landLineNumber.phoneId}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}">
                                                <f:param name="phoneId" value="#{landLineNumber.phoneId}" />
                                        </h:link>
                                </h:column>
index 7259c5875ef3433cc9fc99ba07ded3b90a400c62..e900d982ee0a258ece194034d85b1cc3ba20ec28 100644 (file)
@@ -38,8 +38,8 @@
                                <h:column>
                                        <h:outputLabel for="contactId" styleClass="table_data_label" value="#{msg.ADMIN_CONTACT_ID}" />
 
-                                       <h:link id="contactId" styleClass="table_data_field" outcome="admin_show_contact">
-                                               <h:outputText value="#{contact.contactId}" />
+                                       <h:link id="contactId" outcome="admin_show_contact">
+                                               <h:outputText styleClass="table_data_field" value="#{contact.contactId}" />
                                                <f:param name="contactId" value="#{contact.contactId}" />
                                        </h:link>
                                </h:column>
index 6c4dcad19bdbdc30660326ce6f36999696462518..5230f8b70449ffd1ebfa1a6a54cd72d497b47bba 100644 (file)
@@ -23,8 +23,7 @@
                                                <h:outputText value="#{msg.ADMIN_SHOW_PHONE_ID}" />
                                        </f:facet>
 
-                                       <h:link outcome="admin_show_mobile">
-                                               <h:outputText value="#{mobile.phoneId}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}" />
+                                       <h:link outcome="admin_show_mobile" value="#{mobile.phoneId}" title="#{msg.ADMIN_LINK_SHOW_SHORT_TITLE}">
                                                <f:param name="phoneId" value="#{mobile.phoneId}" />
                                        </h:link>
                                </h:column>
@@ -34,9 +33,8 @@
                                                <h:outputText value="#{msg.ADMIN_SHOW_MOBILE_PROVIDER_NAME}" />
                                        </f:facet>
 
-                                       <h:link outcome="admin_show_mobile_provider">
+                                       <h:link outcome="admin_show_mobile_provider" value="#{mobile.mobileProvider.providerName}">
                                                <f:param name="providerId" value="#{mobile.mobileProvider.providerId}" />
-                                               <h:outputText value="#{mobile.mobileProvider.providerName}" />
                                        </h:link>
                                </h:column>
 
index 887adbeca2aa2ebb509b61964020281bcf2aec55..df52fa8647ac9d901457b974feb9bd9d8809877a 100644 (file)
@@ -38,8 +38,7 @@
                                <h:column>
                                        <h:outputLabel for="contactId" styleClass="table_data_label" value="#{msg.ADMIN_CONTACT_ID}" />
 
-                                       <h:link id="contactId" styleClass="table_data_field" outcome="admin_show_contact">
-                                               <h:outputText value="#{contact.contactId}" />
+                                       <h:link id="contactId" styleClass="table_data_field" outcome="admin_show_contact" value="#{contact.contactId}">
                                                <f:param name="contactId" value="#{contact.contactId}" />
                                        </h:link>
                                </h:column>