]> git.mxchange.org Git - pizzaservice-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>
Thu, 27 Jul 2017 19:19:21 +0000 (21:19 +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>
41 files changed:
lib/poi-3.14-all-LICENSE.txt
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaAdminBusinessContactWebSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaAdminBusinessContactWebSessionController.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaBusinessContactWebSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaBusinessContactWebSessionController.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/converter/businesscontact/PizzaBusinessContactConverter.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/converter/contact/PizzaContactConverter.java
src/java/org/mxchange/pizzaapplication/converter/country/PizzaCountryConverter.java
src/java/org/mxchange/pizzaapplication/converter/fax/PizzaFaxNumberConverter.java
src/java/org/mxchange/pizzaapplication/converter/landline/PizzaLandLineNumberConverter.java
src/java/org/mxchange/pizzaapplication/converter/mobile/PizzaMobileConverter.java [deleted file]
src/java/org/mxchange/pizzaapplication/converter/mobile/PizzaMobileNumberConverter.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/converter/mobileprovider/PizzaMobileProviderConverter.java
src/java/org/mxchange/pizzaapplication/converter/user/PizzaUserConverter.java
src/java/org/mxchange/pizzaapplication/validator/emailaddress/PizzaEmailAddressValidator.java
src/java/org/mxchange/pizzaapplication/validator/user/PizzaUserIdValidator.java
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

index 9942ab17dd4254880ed49e129b4bdb73e1e02a1f..dd2cbd5fbc180bf1cbc6ae9b5dc9058b28c841b6 100644 (file)
-\r
-                                 Apache License\r
-                           Version 2.0, January 2004\r
-                        http://www.apache.org/licenses/\r
-\r
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
-   1. Definitions.\r
-\r
-      "License" shall mean the terms and conditions for use, reproduction,\r
-      and distribution as defined by Sections 1 through 9 of this document.\r
-\r
-      "Licensor" shall mean the copyright owner or entity authorized by\r
-      the copyright owner that is granting the License.\r
-\r
-      "Legal Entity" shall mean the union of the acting entity and all\r
-      other entities that control, are controlled by, or are under common\r
-      control with that entity. For the purposes of this definition,\r
-      "control" means (i) the power, direct or indirect, to cause the\r
-      direction or management of such entity, whether by contract or\r
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
-      outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
-      "You" (or "Your") shall mean an individual or Legal Entity\r
-      exercising permissions granted by this License.\r
-\r
-      "Source" form shall mean the preferred form for making modifications,\r
-      including but not limited to software source code, documentation\r
-      source, and configuration files.\r
-\r
-      "Object" form shall mean any form resulting from mechanical\r
-      transformation or translation of a Source form, including but\r
-      not limited to compiled object code, generated documentation,\r
-      and conversions to other media types.\r
-\r
-      "Work" shall mean the work of authorship, whether in Source or\r
-      Object form, made available under the License, as indicated by a\r
-      copyright notice that is included in or attached to the work\r
-      (an example is provided in the Appendix below).\r
-\r
-      "Derivative Works" shall mean any work, whether in Source or Object\r
-      form, that is based on (or derived from) the Work and for which the\r
-      editorial revisions, annotations, elaborations, or other modifications\r
-      represent, as a whole, an original work of authorship. For the purposes\r
-      of this License, Derivative Works shall not include works that remain\r
-      separable from, or merely link (or bind by name) to the interfaces of,\r
-      the Work and Derivative Works thereof.\r
-\r
-      "Contribution" shall mean any work of authorship, including\r
-      the original version of the Work and any modifications or additions\r
-      to that Work or Derivative Works thereof, that is intentionally\r
-      submitted to Licensor for inclusion in the Work by the copyright owner\r
-      or by an individual or Legal Entity authorized to submit on behalf of\r
-      the copyright owner. For the purposes of this definition, "submitted"\r
-      means any form of electronic, verbal, or written communication sent\r
-      to the Licensor or its representatives, including but not limited to\r
-      communication on electronic mailing lists, source code control systems,\r
-      and issue tracking systems that are managed by, or on behalf of, the\r
-      Licensor for the purpose of discussing and improving the Work, but\r
-      excluding communication that is conspicuously marked or otherwise\r
-      designated in writing by the copyright owner as "Not a Contribution."\r
-\r
-      "Contributor" shall mean Licensor and any individual or Legal Entity\r
-      on behalf of whom a Contribution has been received by Licensor and\r
-      subsequently incorporated within the Work.\r
-\r
-   2. Grant of Copyright License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      copyright license to reproduce, prepare Derivative Works of,\r
-      publicly display, publicly perform, sublicense, and distribute the\r
-      Work and such Derivative Works in Source or Object form.\r
-\r
-   3. Grant of Patent License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      (except as stated in this section) patent license to make, have made,\r
-      use, offer to sell, sell, import, and otherwise transfer the Work,\r
-      where such license applies only to those patent claims licensable\r
-      by such Contributor that are necessarily infringed by their\r
-      Contribution(s) alone or by combination of their Contribution(s)\r
-      with the Work to which such Contribution(s) was submitted. If You\r
-      institute patent litigation against any entity (including a\r
-      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
-      or a Contribution incorporated within the Work constitutes direct\r
-      or contributory patent infringement, then any patent licenses\r
-      granted to You under this License for that Work shall terminate\r
-      as of the date such litigation is filed.\r
-\r
-   4. Redistribution. You may reproduce and distribute copies of the\r
-      Work or Derivative Works thereof in any medium, with or without\r
-      modifications, and in Source or Object form, provided that You\r
-      meet the following conditions:\r
-\r
-      (a) You must give any other recipients of the Work or\r
-          Derivative Works a copy of this License; and\r
-\r
-      (b) You must cause any modified files to carry prominent notices\r
-          stating that You changed the files; and\r
-\r
-      (c) You must retain, in the Source form of any Derivative Works\r
-          that You distribute, all copyright, patent, trademark, and\r
-          attribution notices from the Source form of the Work,\r
-          excluding those notices that do not pertain to any part of\r
-          the Derivative Works; and\r
-\r
-      (d) If the Work includes a "NOTICE" text file as part of its\r
-          distribution, then any Derivative Works that You distribute must\r
-          include a readable copy of the attribution notices contained\r
-          within such NOTICE file, excluding those notices that do not\r
-          pertain to any part of the Derivative Works, in at least one\r
-          of the following places: within a NOTICE text file distributed\r
-          as part of the Derivative Works; within the Source form or\r
-          documentation, if provided along with the Derivative Works; or,\r
-          within a display generated by the Derivative Works, if and\r
-          wherever such third-party notices normally appear. The contents\r
-          of the NOTICE file are for informational purposes only and\r
-          do not modify the License. You may add Your own attribution\r
-          notices within Derivative Works that You distribute, alongside\r
-          or as an addendum to the NOTICE text from the Work, provided\r
-          that such additional attribution notices cannot be construed\r
-          as modifying the License.\r
-\r
-      You may add Your own copyright statement to Your modifications and\r
-      may provide additional or different license terms and conditions\r
-      for use, reproduction, or distribution of Your modifications, or\r
-      for any such Derivative Works as a whole, provided Your use,\r
-      reproduction, and distribution of the Work otherwise complies with\r
-      the conditions stated in this License.\r
-\r
-   5. Submission of Contributions. Unless You explicitly state otherwise,\r
-      any Contribution intentionally submitted for inclusion in the Work\r
-      by You to the Licensor shall be under the terms and conditions of\r
-      this License, without any additional terms or conditions.\r
-      Notwithstanding the above, nothing herein shall supersede or modify\r
-      the terms of any separate license agreement you may have executed\r
-      with Licensor regarding such Contributions.\r
-\r
-   6. Trademarks. This License does not grant permission to use the trade\r
-      names, trademarks, service marks, or product names of the Licensor,\r
-      except as required for reasonable and customary use in describing the\r
-      origin of the Work and reproducing the content of the NOTICE file.\r
-\r
-   7. Disclaimer of Warranty. Unless required by applicable law or\r
-      agreed to in writing, Licensor provides the Work (and each\r
-      Contributor provides its Contributions) on an "AS IS" BASIS,\r
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
-      implied, including, without limitation, any warranties or conditions\r
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
-      PARTICULAR PURPOSE. You are solely responsible for determining the\r
-      appropriateness of using or redistributing the Work and assume any\r
-      risks associated with Your exercise of permissions under this License.\r
-\r
-   8. Limitation of Liability. In no event and under no legal theory,\r
-      whether in tort (including negligence), contract, or otherwise,\r
-      unless required by applicable law (such as deliberate and grossly\r
-      negligent acts) or agreed to in writing, shall any Contributor be\r
-      liable to You for damages, including any direct, indirect, special,\r
-      incidental, or consequential damages of any character arising as a\r
-      result of this License or out of the use or inability to use the\r
-      Work (including but not limited to damages for loss of goodwill,\r
-      work stoppage, computer failure or malfunction, or any and all\r
-      other commercial damages or losses), even if such Contributor\r
-      has been advised of the possibility of such damages.\r
-\r
-   9. Accepting Warranty or Additional Liability. While redistributing\r
-      the Work or Derivative Works thereof, You may choose to offer,\r
-      and charge a fee for, acceptance of support, warranty, indemnity,\r
-      or other liability obligations and/or rights consistent with this\r
-      License. However, in accepting such obligations, You may act only\r
-      on Your own behalf and on Your sole responsibility, not on behalf\r
-      of any other Contributor, and only if You agree to indemnify,\r
-      defend, and hold each Contributor harmless for any liability\r
-      incurred by, or claims asserted against, such Contributor by reason\r
-      of your accepting any such warranty or additional liability.\r
-\r
-   END OF TERMS AND CONDITIONS\r
-\r
-   APPENDIX: How to apply the Apache License to your work.\r
-\r
-      To apply the Apache License to your work, attach the following\r
-      boilerplate notice, with the fields enclosed by brackets "[]"\r
-      replaced with your own identifying information. (Don't include\r
-      the brackets!)  The text should be enclosed in the appropriate\r
-      comment syntax for the file format. We also recommend that a\r
-      file or class name and description of purpose be included on the\r
-      same "printed page" as the copyright notice for easier\r
-      identification within third-party archives.\r
-\r
-   Copyright [yyyy] [name of copyright owner]\r
-\r
-   Licensed under the Apache License, Version 2.0 (the "License");\r
-   you may not use this file except in compliance with the License.\r
-   You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-   Unless required by applicable law or agreed to in writing, software\r
-   distributed under the License is distributed on an "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-   See the License for the specific language governing permissions and\r
-   limitations under the License.\r
-\r
-\r
-APACHE POI SUBCOMPONENTS:\r
-\r
-Apache POI includes subcomponents with separate copyright notices and\r
-license terms. Your use of these subcomponents is subject to the terms\r
-and conditions of the following licenses:\r
-\r
-\r
-Office Open XML schemas (ooxml-schemas-1.1.jar)\r
-\r
-    The Office Open XML schema definitions used by Apache POI are\r
-    a part of the Office Open XML ECMA Specification (ECMA-376, [1]).\r
-    As defined in section 9.4 of the ECMA bylaws [2], this specification\r
-    is available to all interested parties without restriction:\r
-\r
-        9.4 All documents when approved shall be made available to\r
-            all interested parties without restriction.\r
-\r
-    Furthermore, both Microsoft and Adobe have granted patent licenses\r
-    to this work [3,4,5].\r
-\r
-    [1] http://www.ecma-international.org/publications/standards/Ecma-376.htm\r
-    [2] http://www.ecma-international.org/memento/Ecmabylaws.htm\r
-    [3] http://www.microsoft.com/openspecifications/en/us/programs/osp/default.aspx\r
-    [4] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/Patent%20statements%20ok/ECMA-376%20Edition%202%20Microsoft%20Patent%20Declaration.pdf\r
-    [5] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/Patent%20statements%20ok/ECMA-376%20Adobe%20Patent%20Declaration.pdf\r
-\r
-\r
-JUnit test library (junit-4.11.jar)\r
-\r
-    Common Public License - v 1.0\r
-\r
-    THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON\r
-    PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION\r
-    OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\r
-\r
-    1. DEFINITIONS\r
-\r
-    "Contribution" means:\r
-\r
-    a) in the case of the initial Contributor, the initial code and\r
-       documentation distributed under this Agreement, and\r
-\r
-    b) in the case of each subsequent Contributor:\r
-\r
-       i)  changes to the Program, and\r
-\r
-       ii) additions to the Program;\r
-\r
-       where such changes and/or additions to the Program originate from\r
-       and are distributed by that particular Contributor. A Contribution\r
-       'originates' from a Contributor if it was added to the Program by\r
-       such Contributor itself or anyone acting on such Contributor's behalf.\r
-       Contributions do not include additions to the Program which: (i) are\r
-       separate modules of software distributed in conjunction with the\r
-       Program under their own license agreement, and (ii) are not derivative\r
-       works of the Program.\r
-\r
-    "Contributor" means any person or entity that distributes the Program.\r
-\r
-    "Licensed Patents " mean patent claims licensable by a Contributor which\r
-    are necessarily infringed by the use or sale of its Contribution alone\r
-    or when combined with the Program.\r
-\r
-    "Program" means the Contributions distributed in accordance with this\r
-    Agreement.\r
-\r
-    "Recipient" means anyone who receives the Program under this Agreement,\r
-    including all Contributors.\r
-\r
-    2. GRANT OF RIGHTS\r
-\r
-    a) Subject to the terms of this Agreement, each Contributor hereby grants\r
-       Recipient a non-exclusive, worldwide, royalty-free copyright license\r
-       to reproduce, prepare derivative works of, publicly display, publicly\r
-       perform, distribute and sublicense the Contribution of such\r
-       Contributor, if any, and such derivative works, in source code and\r
-       object code form.\r
-\r
-    b) Subject to the terms of this Agreement, each Contributor hereby grants\r
-       Recipient a non-exclusive, worldwide, royalty-free patent license under\r
-       Licensed Patents to make, use, sell, offer to sell, import and\r
-       otherwise transfer the Contribution of such Contributor, if any, in\r
-       source code and object code form. This patent license shall apply to\r
-       the combination of the Contribution and the Program if, at the time\r
-       the Contribution is added by the Contributor, such addition of the\r
-       Contribution causes such combination to be covered by the Licensed\r
-       Patents. The patent license shall not apply to any other combinations\r
-       which include the Contribution. No hardware per se is licensed\r
-       hereunder.\r
-\r
-    c) Recipient understands that although each Contributor grants the\r
-       licenses to its Contributions set forth herein, no assurances are\r
-       provided by any Contributor that the Program does not infringe the\r
-       patent or other intellectual property rights of any other entity.\r
-       Each Contributor disclaims any liability to Recipient for claims\r
-       brought by any other entity based on infringement of intellectual\r
-       property rights or otherwise. As a condition to exercising the rights\r
-       and licenses granted hereunder, each Recipient hereby assumes sole\r
-       responsibility to secure any other intellectual property rights\r
-       needed, if any. For example, if a third party patent license is\r
-       required to allow Recipient to distribute the Program, it is\r
-       Recipient's responsibility to acquire that license before\r
-       distributing the Program.\r
-\r
-    d) Each Contributor represents that to its knowledge it has sufficient\r
-       copyright rights in its Contribution, if any, to grant the copyright\r
-       license set forth in this Agreement.\r
-\r
-    3. REQUIREMENTS\r
-\r
-    A Contributor may choose to distribute the Program in object code form\r
-    under its own license agreement, provided that:\r
-\r
-    a) it complies with the terms and conditions of this Agreement; and\r
-\r
-    b) its license agreement:\r
-\r
-       i)   effectively disclaims on behalf of all Contributors all warranties\r
-            and conditions, express and implied, including warranties or\r
-            conditions of title and non-infringement, and implied warranties\r
-            or conditions of merchantability and fitness for a particular\r
-            purpose;\r
-\r
-       ii)  effectively excludes on behalf of all Contributors all liability\r
-            for damages, including direct, indirect, special, incidental and\r
-            consequential damages, such as lost profits;\r
-\r
-       iii) states that any provisions which differ from this Agreement are\r
-            offered by that Contributor alone and not by any other party; and\r
-\r
-       iv)  states that source code for the Program is available from such\r
-            Contributor, and informs licensees how to obtain it in a\r
-            reasonable manner on or through a medium customarily used for\r
-            software exchange.\r
-\r
-    When the Program is made available in source code form:\r
-\r
-    a) it must be made available under this Agreement; and\r
-\r
-    b) a copy of this Agreement must be included with each copy of\r
-       the Program.\r
-\r
-    Contributors may not remove or alter any copyright notices contained\r
-    within the Program.\r
-\r
-    Each Contributor must identify itself as the originator of its\r
-    Contribution, if any, in a manner that reasonably allows subsequent\r
-    Recipients to identify the originator of the Contribution.\r
-\r
-    4. COMMERCIAL DISTRIBUTION\r
-\r
-    Commercial distributors of software may accept certain responsibilities\r
-    with respect to end users, business partners and the like. While this\r
-    license is intended to facilitate the commercial use of the Program,\r
-    the Contributor who includes the Program in a commercial product offering\r
-    should do so in a manner which does not create potential liability for\r
-    other Contributors. Therefore, if a Contributor includes the Program\r
-    in a commercial product offering, such Contributor ("Commercial\r
-    Contributor") hereby agrees to defend and indemnify every other\r
-    Contributor ("Indemnified Contributor") against any losses, damages\r
-    and costs (collectively "Losses") arising from claims, lawsuits and\r
-    other legal actions brought by a third party against the Indemnified\r
-    Contributor to the extent caused by the acts or omissions of such\r
-    Commercial Contributor in connection with its distribution of the\r
-    Program in a commercial product offering. The obligations in this\r
-    section do not apply to any claims or Losses relating to any actual\r
-    or alleged intellectual property infringement. In order to qualify,\r
-    an Indemnified Contributor must: a) promptly notify the Commercial\r
-    Contributor in writing of such claim, and b) allow the Commercial\r
-    Contributor to control, and cooperate with the Commercial Contributor\r
-    in, the defense and any related settlement negotiations. The Indemnified\r
-    Contributor may participate in any such claim at its own expense.\r
-\r
-    For example, a Contributor might include the Program in a commercial\r
-    product offering, Product X. That Contributor is then a Commercial\r
-    Contributor. If that Commercial Contributor then makes performance\r
-    claims, or offers warranties related to Product X, those performance\r
-    claims and warranties are such Commercial Contributor's responsibility\r
-    alone. Under this section, the Commercial Contributor would have to\r
-    defend claims against the other Contributors related to those\r
-    performance claims and warranties, and if a court requires any other\r
-    Contributor to pay any damages as a result, the Commercial Contributor\r
-    must pay those damages.\r
-\r
-    5. NO WARRANTY\r
-\r
-    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED\r
-    ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER\r
-    EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR\r
-    CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR\r
-    A PARTICULAR PURPOSE. Each Recipient is solely responsible for\r
-    determining the appropriateness of using and distributing the Program\r
-    and assumes all risks associated with its exercise of rights under this\r
-    Agreement, including but not limited to the risks and costs of program\r
-    errors, compliance with applicable laws, damage to or loss of data,\r
-    programs or equipment, and unavailability or interruption of operations.\r
-\r
-    6. DISCLAIMER OF LIABILITY\r
-\r
-    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR\r
-    ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,\r
-    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING\r
-    WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF\r
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR\r
-    DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED\r
-    HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\r
-\r
-    7. GENERAL\r
-\r
-    If any provision of this Agreement is invalid or unenforceable under\r
-    applicable law, it shall not affect the validity or enforceability of\r
-    the remainder of the terms of this Agreement, and without further\r
-    action by the parties hereto, such provision shall be reformed to the\r
-    minimum extent necessary to make such provision valid and enforceable.\r
-\r
-    If Recipient institutes patent litigation against a Contributor with\r
-    respect to a patent applicable to software (including a cross-claim or\r
-    counterclaim in a lawsuit), then any patent licenses granted by that\r
-    Contributor to such Recipient under this Agreement shall terminate as of\r
-    the date such litigation is filed. In addition, if Recipient institutes\r
-    patent litigation against any entity (including a cross-claim or\r
-    counterclaim in a lawsuit) alleging that the Program itself (excluding\r
-    combinations of the Program with other software or hardware) infringes\r
-    such Recipient's patent(s), then such Recipient's rights granted under\r
-    Section 2(b) shall terminate as of the date such litigation is filed.\r
-\r
-    All Recipient's rights under this Agreement shall terminate if it fails\r
-    to comply with any of the material terms or conditions of this Agreement\r
-    and does not cure such failure in a reasonable period of time after\r
-    becoming aware of such noncompliance. If all Recipient's rights under\r
-    this Agreement terminate, Recipient agrees to cease use and distribution\r
-    of the Program as soon as reasonably practicable. However, Recipient's\r
-    obligations under this Agreement and any licenses granted by Recipient\r
-    relating to the Program shall continue and survive.\r
-\r
-    Everyone is permitted to copy and distribute copies of this Agreement,\r
-    but in order to avoid inconsistency the Agreement is copyrighted and may\r
-    only be modified in the following manner. The Agreement Steward reserves\r
-    the right to publish new versions (including revisions) of this Agreement\r
-    from time to time. No one other than the Agreement Steward has the right\r
-    to modify this Agreement. IBM is the initial Agreement Steward. IBM may\r
-    assign the responsibility to serve as the Agreement Steward to a suitable\r
-    separate entity. Each new version of the Agreement will be given a\r
-    distinguishing version number. The Program (including Contributions) may\r
-    always be distributed subject to the version of the Agreement under which\r
-    it was received. In addition, after a new version of the Agreement is\r
-    published, Contributor may elect to distribute the Program (including\r
-    its Contributions) under the new version. Except as expressly stated in\r
-    Sections 2(a) and 2(b) above, Recipient receives no rights or licenses\r
-    to the intellectual property of any Contributor under this Agreement,\r
-    whether expressly, by implication, estoppel or otherwise. All rights in\r
-    the Program not expressly granted under this Agreement are reserved.\r
-\r
-    This Agreement is governed by the laws of the State of New York and the\r
-    intellectual property laws of the United States of America. No party to\r
-    this Agreement will bring a legal action under this Agreement more than\r
-    one year after the cause of action arose. Each party waives its rights\r
-    to a jury trial in any resulting litigation.\r
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+APACHE POI SUBCOMPONENTS:
+
+Apache POI includes subcomponents with separate copyright notices and
+license terms. Your use of these subcomponents is subject to the terms
+and conditions of the following licenses:
+
+
+Office Open XML schemas (ooxml-schemas-1.1.jar)
+
+    The Office Open XML schema definitions used by Apache POI are
+    a part of the Office Open XML ECMA Specification (ECMA-376, [1]).
+    As defined in section 9.4 of the ECMA bylaws [2], this specification
+    is available to all interested parties without restriction:
+
+        9.4 All documents when approved shall be made available to
+            all interested parties without restriction.
+
+    Furthermore, both Microsoft and Adobe have granted patent licenses
+    to this work [3,4,5].
+
+    [1] http://www.ecma-international.org/publications/standards/Ecma-376.htm
+    [2] http://www.ecma-international.org/memento/Ecmabylaws.htm
+    [3] http://www.microsoft.com/openspecifications/en/us/programs/osp/default.aspx
+    [4] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/Patent%20statements%20ok/ECMA-376%20Edition%202%20Microsoft%20Patent%20Declaration.pdf
+    [5] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/Patent%20statements%20ok/ECMA-376%20Adobe%20Patent%20Declaration.pdf
+
+
+JUnit test library (junit-4.11.jar)
+
+    Common Public License - v 1.0
+
+    THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON
+    PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+    OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+    1. DEFINITIONS
+
+    "Contribution" means:
+
+    a) in the case of the initial Contributor, the initial code and
+       documentation distributed under this Agreement, and
+
+    b) in the case of each subsequent Contributor:
+
+       i)  changes to the Program, and
+
+       ii) additions to the Program;
+
+       where such changes and/or additions to the Program originate from
+       and are distributed by that particular Contributor. A Contribution
+       'originates' from a Contributor if it was added to the Program by
+       such Contributor itself or anyone acting on such Contributor's behalf.
+       Contributions do not include additions to the Program which: (i) are
+       separate modules of software distributed in conjunction with the
+       Program under their own license agreement, and (ii) are not derivative
+       works of the Program.
+
+    "Contributor" means any person or entity that distributes the Program.
+
+    "Licensed Patents " mean patent claims licensable by a Contributor which
+    are necessarily infringed by the use or sale of its Contribution alone
+    or when combined with the Program.
+
+    "Program" means the Contributions distributed in accordance with this
+    Agreement.
+
+    "Recipient" means anyone who receives the Program under this Agreement,
+    including all Contributors.
+
+    2. GRANT OF RIGHTS
+
+    a) Subject to the terms of this Agreement, each Contributor hereby grants
+       Recipient a non-exclusive, worldwide, royalty-free copyright license
+       to reproduce, prepare derivative works of, publicly display, publicly
+       perform, distribute and sublicense the Contribution of such
+       Contributor, if any, and such derivative works, in source code and
+       object code form.
+
+    b) Subject to the terms of this Agreement, each Contributor hereby grants
+       Recipient a non-exclusive, worldwide, royalty-free patent license under
+       Licensed Patents to make, use, sell, offer to sell, import and
+       otherwise transfer the Contribution of such Contributor, if any, in
+       source code and object code form. This patent license shall apply to
+       the combination of the Contribution and the Program if, at the time
+       the Contribution is added by the Contributor, such addition of the
+       Contribution causes such combination to be covered by the Licensed
+       Patents. The patent license shall not apply to any other combinations
+       which include the Contribution. No hardware per se is licensed
+       hereunder.
+
+    c) Recipient understands that although each Contributor grants the
+       licenses to its Contributions set forth herein, no assurances are
+       provided by any Contributor that the Program does not infringe the
+       patent or other intellectual property rights of any other entity.
+       Each Contributor disclaims any liability to Recipient for claims
+       brought by any other entity based on infringement of intellectual
+       property rights or otherwise. As a condition to exercising the rights
+       and licenses granted hereunder, each Recipient hereby assumes sole
+       responsibility to secure any other intellectual property rights
+       needed, if any. For example, if a third party patent license is
+       required to allow Recipient to distribute the Program, it is
+       Recipient's responsibility to acquire that license before
+       distributing the Program.
+
+    d) Each Contributor represents that to its knowledge it has sufficient
+       copyright rights in its Contribution, if any, to grant the copyright
+       license set forth in this Agreement.
+
+    3. REQUIREMENTS
+
+    A Contributor may choose to distribute the Program in object code form
+    under its own license agreement, provided that:
+
+    a) it complies with the terms and conditions of this Agreement; and
+
+    b) its license agreement:
+
+       i)   effectively disclaims on behalf of all Contributors all warranties
+            and conditions, express and implied, including warranties or
+            conditions of title and non-infringement, and implied warranties
+            or conditions of merchantability and fitness for a particular
+            purpose;
+
+       ii)  effectively excludes on behalf of all Contributors all liability
+            for damages, including direct, indirect, special, incidental and
+            consequential damages, such as lost profits;
+
+       iii) states that any provisions which differ from this Agreement are
+            offered by that Contributor alone and not by any other party; and
+
+       iv)  states that source code for the Program is available from such
+            Contributor, and informs licensees how to obtain it in a
+            reasonable manner on or through a medium customarily used for
+            software exchange.
+
+    When the Program is made available in source code form:
+
+    a) it must be made available under this Agreement; and
+
+    b) a copy of this Agreement must be included with each copy of
+       the Program.
+
+    Contributors may not remove or alter any copyright notices contained
+    within the Program.
+
+    Each Contributor must identify itself as the originator of its
+    Contribution, if any, in a manner that reasonably allows subsequent
+    Recipients to identify the originator of the Contribution.
+
+    4. COMMERCIAL DISTRIBUTION
+
+    Commercial distributors of software may accept certain responsibilities
+    with respect to end users, business partners and the like. While this
+    license is intended to facilitate the commercial use of the Program,
+    the Contributor who includes the Program in a commercial product offering
+    should do so in a manner which does not create potential liability for
+    other Contributors. Therefore, if a Contributor includes the Program
+    in a commercial product offering, such Contributor ("Commercial
+    Contributor") hereby agrees to defend and indemnify every other
+    Contributor ("Indemnified Contributor") against any losses, damages
+    and costs (collectively "Losses") arising from claims, lawsuits and
+    other legal actions brought by a third party against the Indemnified
+    Contributor to the extent caused by the acts or omissions of such
+    Commercial Contributor in connection with its distribution of the
+    Program in a commercial product offering. The obligations in this
+    section do not apply to any claims or Losses relating to any actual
+    or alleged intellectual property infringement. In order to qualify,
+    an Indemnified Contributor must: a) promptly notify the Commercial
+    Contributor in writing of such claim, and b) allow the Commercial
+    Contributor to control, and cooperate with the Commercial Contributor
+    in, the defense and any related settlement negotiations. The Indemnified
+    Contributor may participate in any such claim at its own expense.
+
+    For example, a Contributor might include the Program in a commercial
+    product offering, Product X. That Contributor is then a Commercial
+    Contributor. If that Commercial Contributor then makes performance
+    claims, or offers warranties related to Product X, those performance
+    claims and warranties are such Commercial Contributor's responsibility
+    alone. Under this section, the Commercial Contributor would have to
+    defend claims against the other Contributors related to those
+    performance claims and warranties, and if a court requires any other
+    Contributor to pay any damages as a result, the Commercial Contributor
+    must pay those damages.
+
+    5. NO WARRANTY
+
+    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
+    ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
+    EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
+    CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
+    A PARTICULAR PURPOSE. Each Recipient is solely responsible for
+    determining the appropriateness of using and distributing the Program
+    and assumes all risks associated with its exercise of rights under this
+    Agreement, including but not limited to the risks and costs of program
+    errors, compliance with applicable laws, damage to or loss of data,
+    programs or equipment, and unavailability or interruption of operations.
+
+    6. DISCLAIMER OF LIABILITY
+
+    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+    ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+    WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+    DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+    HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+    7. GENERAL
+
+    If any provision of this Agreement is invalid or unenforceable under
+    applicable law, it shall not affect the validity or enforceability of
+    the remainder of the terms of this Agreement, and without further
+    action by the parties hereto, such provision shall be reformed to the
+    minimum extent necessary to make such provision valid and enforceable.
+
+    If Recipient institutes patent litigation against a Contributor with
+    respect to a patent applicable to software (including a cross-claim or
+    counterclaim in a lawsuit), then any patent licenses granted by that
+    Contributor to such Recipient under this Agreement shall terminate as of
+    the date such litigation is filed. In addition, if Recipient institutes
+    patent litigation against any entity (including a cross-claim or
+    counterclaim in a lawsuit) alleging that the Program itself (excluding
+    combinations of the Program with other software or hardware) infringes
+    such Recipient's patent(s), then such Recipient's rights granted under
+    Section 2(b) shall terminate as of the date such litigation is filed.
+
+    All Recipient's rights under this Agreement shall terminate if it fails
+    to comply with any of the material terms or conditions of this Agreement
+    and does not cure such failure in a reasonable period of time after
+    becoming aware of such noncompliance. If all Recipient's rights under
+    this Agreement terminate, Recipient agrees to cease use and distribution
+    of the Program as soon as reasonably practicable. However, Recipient's
+    obligations under this Agreement and any licenses granted by Recipient
+    relating to the Program shall continue and survive.
+
+    Everyone is permitted to copy and distribute copies of this Agreement,
+    but in order to avoid inconsistency the Agreement is copyrighted and may
+    only be modified in the following manner. The Agreement Steward reserves
+    the right to publish new versions (including revisions) of this Agreement
+    from time to time. No one other than the Agreement Steward has the right
+    to modify this Agreement. IBM is the initial Agreement Steward. IBM may
+    assign the responsibility to serve as the Agreement Steward to a suitable
+    separate entity. Each new version of the Agreement will be given a
+    distinguishing version number. The Program (including Contributions) may
+    always be distributed subject to the version of the Agreement under which
+    it was received. In addition, after a new version of the Agreement is
+    published, Contributor may elect to distribute the Program (including
+    its Contributions) under the new version. Except as expressly stated in
+    Sections 2(a) and 2(b) above, Recipient receives no rights or licenses
+    to the intellectual property of any Contributor under this Agreement,
+    whether expressly, by implication, estoppel or otherwise. All rights in
+    the Program not expressly granted under this Agreement are reserved.
+
+    This Agreement is governed by the laws of the State of New York and the
+    intellectual property laws of the United States of America. No party to
+    this Agreement will bring a legal action under this Agreement more than
+    one year after the cause of action arose. Each party waives its rights
+    to a jury trial in any resulting litigation.
index 81a171bf37e09a3a2070f3ee1e649a4f59c21408..4525edc126601b02bce9fd09f9423cedbee55acf 100644 (file)
@@ -791,3 +791,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 3736373bf961a956f5375481109a53ce09dbedc0..bf9983f45167a9c5b75bad442b3000617d02466c 100644 (file)
@@ -784,3 +784,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.
diff --git a/src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaAdminBusinessContactWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaAdminBusinessContactWebSessionBean.java
new file mode 100644 (file)
index 0000000..0213298
--- /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.pizzaapplication.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.pizzaapplication.beans.BasePizzaController;
+
+/**
+ * An administrative business contact bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("adminBusinessDataController")
+@SessionScoped
+public class PizzaAdminBusinessContactWebSessionBean extends BasePizzaController implements PizzaAdminBusinessContactWebSessionController {
+
+       /**
+        * 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 PizzaAdminBusinessContactWebSessionBean () {
+               // 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/pizzaapplication-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/pizzaapplication/beans/businesscontact/PizzaAdminBusinessContactWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaAdminBusinessContactWebSessionController.java
new file mode 100644 (file)
index 0000000..cf28564
--- /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.pizzaapplication.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 PizzaAdminBusinessContactWebSessionController extends Serializable {
+
+       /**
+        * Returns a list of all business contacts
+        * <p>
+        * @return A list of all business contacts
+        */
+       List<BusinessBasicData> allBusinessContacts ();
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaBusinessContactWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaBusinessContactWebSessionBean.java
new file mode 100644 (file)
index 0000000..c61c5e0
--- /dev/null
@@ -0,0 +1,313 @@
+/*
+ * 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.pizzaapplication.beans.businesscontact;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+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.BusinessDataSessionBeanRemote;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
+import org.mxchange.pizzaapplication.beans.user.login.PizzaUserLoginWebSessionController;
+
+/**
+ * A business contact bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("businessDataController")
+@SessionScoped
+public class PizzaBusinessContactWebSessionBean extends BasePizzaController implements PizzaBusinessContactWebSessionController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 56_189_028_928_371L;
+
+       /**
+        * Remote contact bean
+        */
+       private BusinessDataSessionBeanRemote businessDataBean;
+
+       /**
+        * 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;
+
+       /**
+        * User instance
+        */
+       @Inject
+       private PizzaUserLoginWebSessionController userLoginController;
+
+       /**
+        * Constructor
+        */
+       public PizzaBusinessContactWebSessionBean () {
+               // Call super constructor
+               super();
+       }
+
+       /**
+        * 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.businessDataBean = (BusinessDataSessionBeanRemote) context.lookup("java:global/pizzaapplication-ejb/businessContact!org.mxchange.jcontactsbusiness.BusinessContactSessionBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
+       }
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaBusinessContactWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/businesscontact/PizzaBusinessContactWebSessionController.java
new file mode 100644 (file)
index 0000000..e06503f
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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.pizzaapplication.beans.businesscontact;
+
+import java.io.Serializable;
+import javax.ejb.Local;
+
+/**
+ * An interface for session-scoped financial controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Local
+public interface PizzaBusinessContactWebSessionController extends Serializable {
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/converter/businesscontact/PizzaBusinessContactConverter.java b/src/java/org/mxchange/pizzaapplication/converter/businesscontact/PizzaBusinessContactConverter.java
new file mode 100644 (file)
index 0000000..bfd590e
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * 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.pizzaapplication.converter.businesscontact;
+
+import java.text.MessageFormat;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontactsbusiness.BusinessBasicData;
+import org.mxchange.jcontactsbusiness.BusinessDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.exceptions.BusinessDataNotFoundException;
+
+/**
+ * Converter for contact id <-> valid business contact instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter (value = "BusinessContactConverter")
+public class PizzaBusinessContactConverter implements Converter {
+
+       /**
+        * Business contact EJB
+        */
+       private static BusinessDataSessionBeanRemote BUSINESS_CONTACT_BEAN;
+
+       /**
+        * Initialization of this converter
+        */
+       public PizzaBusinessContactConverter () {
+       }
+
+       @Override
+       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the value null or empty?
+               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+                       // Warning message
+                       // @TODO Not working with JNDI (no remote interface) 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 == PizzaBusinessContactConverter.BUSINESS_CONTACT_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and user controller
+                               PizzaBusinessContactConverter.BUSINESS_CONTACT_BEAN = (BusinessDataSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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
+               BusinessBasicData businessContact = null;
+
+               try {
+                       // Try to parse the value as long
+                       Long contactId = Long.valueOf(submittedValue);
+
+                       // Try to get user instance from it
+                       businessContact = PizzaBusinessContactConverter.BUSINESS_CONTACT_BEAN.findBusinessDataById(contactId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(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
+               }
+
+               // Return it
+               return businessContact;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
+               // Is the object null?
+               if ((null == value) || ((String.valueOf(value)).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               } else if (!(value instanceof Contact)) {
+                       // Not same interface
+                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement Contact.", value)); //NOI18N
+               }
+
+               // Return category id
+               return String.valueOf(((BusinessBasicData) value).getBusinessDataId());
+       }
+
+}
index af15d8387acd6ce6d0db0849e725bcef4ef9dd0f..37ee533a9e5d13b3140992bfa8c82f67725dac3a 100644 (file)
@@ -40,7 +40,7 @@ public class PizzaContactConverter implements Converter {
        /**
         * User EJB
         */
-       private ContactSessionBeanRemote contactBean;
+       private static ContactSessionBeanRemote CONTACT_BEAN;
 
        /**
         * Initialization of this converter
@@ -59,20 +59,19 @@ public class PizzaContactConverter 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 == PizzaContactConverter.CONTACT_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.contactBean = (ContactSessionBeanRemote) initialContext.lookup("java:global/pizzaservice-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
+                               PizzaContactConverter.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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 PizzaContactConverter implements Converter {
                        Long contactId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       contact = this.contactBean.findContactById(contactId);
+                       contact = PizzaContactConverter.CONTACT_BEAN.findContactById(contactId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 21e844c0a7b1fd994a9a2f1f62153541deefd0fd..c8a0faf869b81344fa8ad43626177889b85e99eb 100644 (file)
@@ -41,7 +41,7 @@ public class PizzaCountryConverter implements Converter {
        /**
         * Country bean
         */
-       private CountrySingletonBeanRemote countryBean = null;
+       private static CountrySingletonBeanRemote COUNTRY_BEAN;
 
        /**
         * Initialization of this converter
@@ -60,25 +60,24 @@ public class PizzaCountryConverter 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/pizzaservice-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 == PizzaCountryConverter.COUNTRY_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and country bean
+                               PizzaCountryConverter.COUNTRY_BEAN = (CountrySingletonBeanRemote) initialContext.lookup("java:global/pizzaapplication-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 = PizzaCountryConverter.COUNTRY_BEAN.allCountries();
 
                // Init value
                Country country = null;
index 696e3c19b58f2ed42cc9b370ab4434e604ae294f..40fcd72412d1474332db8ac2052f33d9af223234 100644 (file)
-/*\r
- * Copyright (C) 2017 Roland Häder\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU Affero General Public License as\r
- * published by the Free Software Foundation, either version 3 of the\r
- * License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU Affero General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Affero General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-package org.mxchange.pizzaapplication.converter.fax;\r
-\r
-import java.text.MessageFormat;\r
-import javax.faces.component.UIComponent;\r
-import javax.faces.context.FacesContext;\r
-import javax.faces.convert.Converter;\r
-import javax.faces.convert.ConverterException;\r
-import javax.faces.convert.FacesConverter;\r
-import javax.naming.Context;\r
-import javax.naming.InitialContext;\r
-import javax.naming.NamingException;\r
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;\r
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;\r
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;\r
-import org.mxchange.jphone.phonenumbers.DialableNumber;\r
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;\r
-import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;\r
-\r
-/**\r
- * Converter for fax id <-> valid fax number instance\r
- * <p>\r
- * @author Roland Häder<roland@mxchange.org>\r
- */\r
-@FacesConverter (value = "FaxNumberConverter")\r
-public class PizzaFaxNumberConverter implements Converter {\r
-\r
-       /**\r
-        * Logger instance\r
-        */\r
-       @Log\r
-       private LoggerBeanLocal loggerBeanLocal;\r
-\r
-       /**\r
-        * Phone EJB\r
-        */\r
-       private PhoneSessionBeanRemote phoneBean;\r
-\r
-       /**\r
-        * Initialization of this converter\r
-        */\r
-       public PizzaFaxNumberConverter () {\r
-               // Try to get it\r
-               try {\r
-                       // Get initial context\r
-                       Context context = new InitialContext();\r
-\r
-                       // Lookup logger\r
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N\r
-\r
-                       // ... and user controller\r
-                       this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N\r
-               } catch (final NamingException ex) {\r
-                       // Continue to throw it\r
-                       throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N\r
-               }\r
-       }\r
-\r
-       @Override\r
-       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {\r
-               // Log message\r
-               this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: context={1},component={2},submittedValue={3} - CALLED!", this.getClass().getSimpleName(), context, component, submittedValue)); //NOI18N\r
-\r
-               // Is the value null or empty?\r
-               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {\r
-                       // Warning message\r
-                       this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N\r
-\r
-                       // Return null\r
-                       return null;\r
-               }\r
-\r
-               // Init instance\r
-               DialableFaxNumber faxNumber = null;\r
-\r
-               try {\r
-                       // Try to parse the value as long\r
-                       Long faxNumberId = Long.valueOf(submittedValue);\r
-\r
-                       // Log message\r
-                       this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject: faxNumberId={1}", this.getClass().getSimpleName(), faxNumberId)); //NOI18N\r
-\r
-                       // Try to get mobile instance from it\r
-                       faxNumber = this.phoneBean.findFaxNumberById(faxNumberId);\r
-               } catch (final NumberFormatException ex) {\r
-                       // Throw again\r
-                       throw new ConverterException(ex);\r
-               } catch (final PhoneEntityNotFoundException ex) {\r
-                       // Debug message\r
-                       this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N\r
-               }\r
-\r
-               // Log message\r
-               this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: faxNumber={1} - EXIT!", this.getClass().getSimpleName(), faxNumber)); //NOI18N\r
-\r
-               // Return it\r
-               return faxNumber;\r
-       }\r
-\r
-       @Override\r
-       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {\r
-               // Is the object null?\r
-               if ((null == value) || ((String.valueOf(value)).isEmpty())) {\r
-                       // Is null\r
-                       return ""; //NOI18N\r
-               } else if (!(value instanceof DialableNumber)) {\r
-                       // Not same interface\r
-                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N\r
-               }\r
-\r
-               // Return category id\r
-               return String.valueOf(((DialableNumber) value).getPhoneId());\r
-       }\r
-\r
-}\r
+/*
+ * 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.pizzaapplication.converter.fax;
+
+import java.text.MessageFormat;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jphone.phonenumbers.DialableNumber;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
+
+/**
+ * Converter for fax id <-> valid fax number instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter (value = "FaxNumberConverter")
+public class PizzaFaxNumberConverter implements Converter {
+
+       /**
+        * Phone EJB
+        */
+       private static PhoneSessionBeanRemote PHONE_BEAN;
+
+       /**
+        * Initialization of this converter
+        */
+       public PizzaFaxNumberConverter () {
+       }
+
+       @Override
+       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Log message
+               // @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
+                       // @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 == PizzaFaxNumberConverter.PHONE_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and user controller
+                               PizzaFaxNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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;
+
+               try {
+                       // Try to parse the value as long
+                       Long faxNumberId = Long.valueOf(submittedValue);
+
+                       // Log message
+                       // @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 = PizzaFaxNumberConverter.PHONE_BEAN.findFaxNumberById(faxNumberId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final PhoneEntityNotFoundException ex) {
+                       // Debug message
+                       // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+               }
+
+               // Log message
+               // @TODO Not possible here: this.loggerBeanLocal.logTrace(MessageFormat.format("{0}.getAsObject: faxNumber={1} - EXIT!", this.getClass().getSimpleName(), faxNumber)); //NOI18N
+               // Return it
+               return faxNumber;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
+               // Is the object null?
+               if ((null == value) || ((String.valueOf(value)).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               } else if (!(value instanceof DialableNumber)) {
+                       // Not same interface
+                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N
+               }
+
+               // Return category id
+               return String.valueOf(((DialableNumber) value).getPhoneId());
+       }
+
+}
index 492bd80a882ce014796b13db9e25c11304994f68..1ed9af2114e914a152692be3831d7f7a66890912 100644 (file)
-/*\r
- * Copyright (C) 2017 Roland Häder\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU Affero General Public License as\r
- * published by the Free Software Foundation, either version 3 of the\r
- * License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU Affero General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Affero General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-package org.mxchange.pizzaapplication.converter.landline;\r
-\r
-import java.text.MessageFormat;\r
-import javax.faces.component.UIComponent;\r
-import javax.faces.context.FacesContext;\r
-import javax.faces.convert.Converter;\r
-import javax.faces.convert.ConverterException;\r
-import javax.faces.convert.FacesConverter;\r
-import javax.naming.Context;\r
-import javax.naming.InitialContext;\r
-import javax.naming.NamingException;\r
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;\r
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;\r
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;\r
-import org.mxchange.jphone.phonenumbers.DialableNumber;\r
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;\r
-import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;\r
-\r
-/**\r
- * Converter for land-line id <-> valid land-line number instance\r
- * <p>\r
- * @author Roland Häder<roland@mxchange.org>\r
- */\r
-@FacesConverter (value = "LandLineNumberConverter")\r
-public class PizzaLandLineNumberConverter implements Converter {\r
-\r
-       /**\r
-        * Logger instance\r
-        */\r
-       @Log\r
-       private LoggerBeanLocal loggerBeanLocal;\r
-\r
-       /**\r
-        * Phone EJB\r
-        */\r
-       private PhoneSessionBeanRemote phoneBean;\r
-\r
-       /**\r
-        * Initialization of this converter\r
-        */\r
-       public PizzaLandLineNumberConverter () {\r
-               // Try to get it\r
-               try {\r
-                       // Get initial context\r
-                       Context context = new InitialContext();\r
-\r
-                       // Lookup logger\r
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N\r
-\r
-                       // ... and user controller\r
-                       this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N\r
-               } catch (final NamingException ex) {\r
-                       // Continue to throw it\r
-                       throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N\r
-               }\r
-       }\r
-\r
-       @Override\r
-       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {\r
-               // Is the value null or empty?\r
-               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {\r
-                       // Warning message\r
-                       this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N\r
-\r
-                       // Return null\r
-                       return null;\r
-               }\r
-\r
-               // Init instance\r
-               DialableLandLineNumber landLineNumber = null;\r
-\r
-               try {\r
-                       // Try to parse the value as long\r
-                       Long landLineNumberId = Long.valueOf(submittedValue);\r
-\r
-                       // Try to get mobile instance from it\r
-                       landLineNumber = this.phoneBean.findLandLineNumberById(landLineNumberId);\r
-               } catch (final NumberFormatException ex) {\r
-                       // Throw again\r
-                       throw new ConverterException(ex);\r
-               } catch (final PhoneEntityNotFoundException ex) {\r
-                       // Debug message\r
-                       this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N\r
-               }\r
-\r
-               // Return it\r
-               return landLineNumber;\r
-       }\r
-\r
-       @Override\r
-       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {\r
-               // Is the object null?\r
-               if ((null == value) || ((String.valueOf(value)).isEmpty())) {\r
-                       // Is null\r
-                       return ""; //NOI18N\r
-               } else if (!(value instanceof DialableNumber)) {\r
-                       // Not same interface\r
-                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N\r
-               }\r
-\r
-               // Return category id\r
-               return String.valueOf(((DialableNumber) value).getPhoneId());\r
-       }\r
-\r
-}\r
+/*
+ * 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.pizzaapplication.converter.landline;
+
+import java.text.MessageFormat;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jphone.phonenumbers.DialableNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
+
+/**
+ * Converter for land-line id <-> valid land-line number instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter (value = "LandLineNumberConverter")
+public class PizzaLandLineNumberConverter implements Converter {
+
+       /**
+        * Phone EJB
+        */
+       private static PhoneSessionBeanRemote PHONE_BEAN;
+
+       /**
+        * Initialization of this converter
+        */
+       public PizzaLandLineNumberConverter () {
+       }
+
+       @Override
+       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the value null or empty?
+               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+                       // Warning message
+                       // @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 == PizzaLandLineNumberConverter.PHONE_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and user controller
+                               PizzaLandLineNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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;
+
+               try {
+                       // Try to parse the value as long
+                       Long landLineNumberId = Long.valueOf(submittedValue);
+
+                       // Try to get mobile instance from it
+                       landLineNumber = PizzaLandLineNumberConverter.PHONE_BEAN.findLandLineNumberById(landLineNumberId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final PhoneEntityNotFoundException ex) {
+                       // Debug message
+                       // @TODO Not possible here: this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+               }
+
+               // Return it
+               return landLineNumber;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
+               // Is the object null?
+               if ((null == value) || ((String.valueOf(value)).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               } else if (!(value instanceof DialableNumber)) {
+                       // Not same interface
+                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N
+               }
+
+               // Return category id
+               return String.valueOf(((DialableNumber) value).getPhoneId());
+       }
+
+}
diff --git a/src/java/org/mxchange/pizzaapplication/converter/mobile/PizzaMobileConverter.java b/src/java/org/mxchange/pizzaapplication/converter/mobile/PizzaMobileConverter.java
deleted file mode 100644 (file)
index e448d8f..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.pizzaapplication.converter.mobile;
-
-import java.text.MessageFormat;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.convert.FacesConverter;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
-import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
-
-/**
- * Converter for mobile id <-> valid mobile instance
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@FacesConverter (value = "CellphoneConverter")
-public class PizzaMobileConverter implements Converter {
-
-       /**
-        * Phone EJB
-        */
-       private PhoneSessionBeanRemote phoneBean;
-
-       /**
-        * Initialization of this converter
-        */
-       public PizzaMobileConverter () {
-       }
-
-       @Override
-       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Is the value null or empty?
-               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
-                       // Warning message
-                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
-                       // Return null
-                       return null;
-               }
-
-               synchronized (this) {
-                       // Is the EJB instanciated?
-                       if (null == this.phoneBean) {
-                               // Try to get it
-                               try {
-                                       // Get initial context
-                                       Context initialContext = new InitialContext();
-
-                                       // ... and user controller
-                                       this.phoneBean = (PhoneSessionBeanRemote) initialContext.lookup("java:global/pizzaservice-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
-                               }
-                       }
-               }
-
-               // Init instance
-               DialableMobileNumber mobile = null;
-
-               try {
-                       // Try to parse the value as long
-                       Long mobileId = Long.valueOf(submittedValue);
-
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: userId{0}", userId)); //NOI18N
-
-                       // Try to get mobile instance from it
-                       mobile = this.phoneBean.findMobileNumberById(mobileId);
-
-                       // Debug message
-                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: mobile={0}", mobile)); //NOI18N
-               } catch (final NumberFormatException ex) {
-                       // Throw again
-                       throw new ConverterException(ex);
-               } catch (final PhoneEntityNotFoundException 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
-               }
-
-               // Return it
-               return mobile;
-       }
-
-       @Override
-       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
-               // Is the object null?
-               if ((null == value) || ((String.valueOf(value)).isEmpty())) {
-                       // Is null
-                       return ""; //NOI18N
-               } else if (!(value instanceof DialableNumber)) {
-                       // Not same interface
-                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N
-               }
-
-               // Return category id
-               return String.valueOf(((DialableNumber) value).getPhoneId());
-       }
-
-}
diff --git a/src/java/org/mxchange/pizzaapplication/converter/mobile/PizzaMobileNumberConverter.java b/src/java/org/mxchange/pizzaapplication/converter/mobile/PizzaMobileNumberConverter.java
new file mode 100644 (file)
index 0000000..1f7c91d
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * 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.pizzaapplication.converter.mobile;
+
+import java.text.MessageFormat;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jphone.phonenumbers.DialableNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
+
+/**
+ * Converter for mobile id <-> valid mobile instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter (value = "CellphoneConverter")
+public class PizzaMobileNumberConverter implements Converter {
+
+       /**
+        * Phone EJB
+        */
+       private static PhoneSessionBeanRemote PHONE_BEAN;
+
+       /**
+        * Initialization of this converter
+        */
+       public PizzaMobileNumberConverter () {
+       }
+
+       @Override
+       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Is the value null or empty?
+               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+                       // Warning message
+                       // @TODO Not working with JNDI (no remote interface) 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 == PizzaMobileNumberConverter.PHONE_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // ... and user controller
+                               PizzaMobileNumberConverter.PHONE_BEAN = (PhoneSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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
+                       }
+               }
+
+               // Init instance
+               DialableMobileNumber mobileNumber = null;
+
+               try {
+                       // Try to parse the value as long
+                       Long mobileId = Long.valueOf(submittedValue);
+
+                       // Debug message
+                       // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: userId{0}", userId)); //NOI18N
+
+                       // Try to get mobile instance from it
+                       mobileNumber = PizzaMobileNumberConverter.PHONE_BEAN.findMobileNumberById(mobileId);
+               } catch (final NumberFormatException ex) {
+                       // Throw again
+                       throw new ConverterException(ex);
+               } catch (final PhoneEntityNotFoundException 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
+               }
+
+               // Return it
+               return mobileNumber;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
+               // Is the object null?
+               if ((null == value) || ((String.valueOf(value)).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               } else if (!(value instanceof DialableNumber)) {
+                       // Not same interface
+                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement DialableNumber.", value)); //NOI18N
+               }
+
+               // Return category id
+               return String.valueOf(((DialableNumber) value).getPhoneId());
+       }
+
+}
index 602e4641487b56b3b84916bc4ca31814297696c1..6661f39b83e5f0216811c0315f3bb7e4dc6b98db 100644 (file)
@@ -41,7 +41,7 @@ public class PizzaMobileProviderConverter implements Converter {
        /**
         * Mobile provider bean
         */
-       private MobileProviderSingletonBeanRemote mobileRemoteBean;
+       private static MobileProviderSingletonBeanRemote MOBILE_PROVIDER_BEAN;
 
        /**
         * Initialization of this converter
@@ -60,25 +60,24 @@ public class PizzaMobileProviderConverter 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/pizzaservice-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 == PizzaMobileProviderConverter.MOBILE_PROVIDER_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               /// and mobile provider controller
+                               PizzaMobileProviderConverter.MOBILE_PROVIDER_BEAN = (MobileProviderSingletonBeanRemote) initialContext.lookup("java:global/pizzaapplication-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 = PizzaMobileProviderConverter.MOBILE_PROVIDER_BEAN.allMobileProvider();
 
                // Init value
                MobileProvider provider = null;
index e1749402145006018ad5f8ed96802a7912fe53ea..02e828f289db9f29a1b4e647ebffb2fe852ca846 100644 (file)
@@ -40,7 +40,7 @@ public class PizzaUserConverter implements Converter {
        /**
         * User EJB
         */
-       private UserSessionBeanRemote userBean;
+       private static UserSessionBeanRemote USER_BEAN;
 
        /**
         * Initialization of this converter
@@ -59,20 +59,19 @@ public class PizzaUserConverter 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 == PizzaUserConverter.USER_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.userBean = (UserSessionBeanRemote) initialContext.lookup("java:global/pizzaservice-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
+                               PizzaUserConverter.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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 PizzaUserConverter implements Converter {
                        Long userId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       user = this.userBean.findUserById(userId);
+                       user = PizzaUserConverter.USER_BEAN.findUserById(userId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
index 919c14dcd6d20fcd6620f7ad114dee0f0a3ce7ea..a16c55cb80ea9fdf9c59ea9e37a73d6c6d970f97 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.pizzaapplication.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 PizzaEmailAddressValidator 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(PizzaEmailAddressValidator.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 PizzaEmailAddressValidator extends BaseStringValidator implements V
                // 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 PizzaEmailAddressValidator extends BaseStringValidator implements V
                        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/pizzaservice-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 == PizzaEmailAddressValidator.CONTACT_BEAN) {
+                       // Try it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
+
+                               // Try to lookup
+                               PizzaEmailAddressValidator.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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 = PizzaEmailAddressValidator.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 aa6e1de80a3e5cae45fd969dd5fbdeea1c724862..523a45b678864fd9da79b09bdc25f938a8b82897 100644 (file)
@@ -46,7 +46,7 @@ public class PizzaUserIdValidator extends BaseLongValidator implements Validator
        /**
         * Remote bean
         */
-       private UserSessionBeanRemote userBean;
+       private static UserSessionBeanRemote USER_BEAN;
 
        /**
         * Initialization of this converter
@@ -65,25 +65,24 @@ public class PizzaUserIdValidator 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 == PizzaUserIdValidator.USER_BEAN) {
+                       // Try to get it
+                       try {
+                               // Get initial context
+                               Context initialContext = new InitialContext();
 
-                                       // ... and user controller
-                                       this.userBean = (UserSessionBeanRemote) initialContext.lookup("java:global/pizzaservice-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
+                               PizzaUserIdValidator.USER_BEAN = (UserSessionBeanRemote) initialContext.lookup("java:global/pizzaapplication-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 = PizzaUserIdValidator.USER_BEAN.ifUserIdExists(userId);
 
                // Is the user id valid?
                if (!ifUserExists) {
index 4edeec9f6a30c28035aa9aa5be10c93a4dd512bd..b897412899bbd3e080d5a0bbe33298debb010dd9 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 24b4d8bee9243cc8f2fed9ae36c2f98a909eb764..88c1313d37eb08c5e8de81926658b83beceb7f6c 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 41f49a3f20cbb26076eb36114d3b3568a47b0625..16b8c5c01e4394b5e82172004c128fa020368660 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>