]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 30 Mar 2018 17:36:50 +0000 (19:36 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 30 Mar 2018 17:41:10 +0000 (19:41 +0200)
- data output by a p:dataTable with pagination, filtering and sorting cannot
  come from a request-scoped bean as each AJAX request will reset the
  filteredValue-referenced bean property to null which leads to an empty table.
- better is to have a separate backing bean on view-scoped which holds both
  lists, the full ("all") list and filtered list (which are the items that have
  passed the filter).
- also had to update converters and validators
- finally, no need for javax.faces.STATE_SAVING_METHOD=client anymore! yeah!
- rewrote menu system (admin at least, guest and user login is following) to a
  menu-bar-based system which saves a lot space and is a more modern approach
- added filter for not caching xhtml (JSF view) requests

Signed-off-by: Roland Häder <roland@mxchange.org>
18 files changed:
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/FinancialsBasicDataWebRequestController.java
src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewController.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/beans/data/FinancialsDataWebApplicationBean.java
src/java/org/mxchange/jfinancials/converter/business/basicdata/FinancialsBasicCompanyDataConverter.java
src/java/org/mxchange/jfinancials/filter/FinancialsNoCacheFilter.java [new file with mode: 0644]
src/java/org/mxchange/jfinancials/validator/business/basicdata/FinancialsBasicDataCompanyNameValidator.java
src/java/org/mxchange/jfinancials/validator/emailaddress/basicdata/FinancialsBasicDataEmailAddressValidator.java
src/java/org/mxchange/localization/generic_de_DE.properties
src/java/org/mxchange/localization/generic_en_US.properties
web/WEB-INF/templates/admin/admin_menu.tpl
web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl
web/WEB-INF/templates/admin/department/admin_form_department_data.tpl
web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl
web/WEB-INF/templates/base.tpl
web/WEB-INF/templates/widgets/locale_change_widget.tpl
web/WEB-INF/web.xml

index 230195e6c2668faba14bd2b339a1cbde9cbc4f1e..89f4a2f70d949f1f14d9a3321f18e737799f5828 100644 (file)
  */
 package org.mxchange.jfinancials.beans.business.basicdata;
 
-import fish.payara.cdi.jsr107.impl.NamedCache;
-import java.text.MessageFormat;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Objects;
-import javax.annotation.PostConstruct;
-import javax.cache.Cache;
 import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
-import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
 import org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
@@ -44,7 +30,7 @@ import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionCo
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Named ("basicCompanyDataController")
+@Named ("basicDataController")
 @RequestScoped
 public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implements FinancialsBasicDataWebRequestController {
 
@@ -59,24 +45,6 @@ public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implem
        @EJB (lookup = "java:global/jfinancials-ejb/adminBasicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.AdminBasicCompanyDataSessionBeanRemote", description = "A stateless session bean for administrative purposes.")
        private AdminBasicCompanyDataSessionBeanRemote adminBasicCompanyDataBean;
 
-       /**
-        * List of all basic company data
-        */
-       private final List<BasicData> allBasicData;
-
-       /**
-        * A list of all registered companies (globally)
-        */
-       @Inject
-       @NamedCache (cacheName = "basicDataCache")
-       private Cache<Long, BasicData> basicDataCache;
-
-       /**
-        * EJB for general basic business data purposes
-        */
-       @EJB (lookup = "java:global/jfinancials-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote", description = "A stateless session bean for general purposes.")
-       private BasicCompanyDataSessionBeanRemote businessDataBean;
-
        /**
         * Comments for this company
         */
@@ -107,11 +75,6 @@ public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implem
         */
        private Long faxNumber;
 
-       /**
-        * List of filtered basic company data
-        */
-       private List<BasicData> filteredBasicCompanyData;
-
        /**
         * Area code for land-line number
         */
@@ -139,73 +102,6 @@ public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implem
        public FinancialsBasicDataWebRequestBean () {
                // Call super constructor
                super();
-
-               // Init list
-               this.allBasicData = new LinkedList<>();
-       }
-
-       /**
-        * Observers events being fired when an administrator has added company
-        * basic data.
-        * <p>
-        * @param event Event being fired
-        */
-       public void afterAdminAddedBasicCompanyDataEvent (@Observes final ObservableAdminAddedBusinessBasicDataEvent event) {
-               // Is the parameter valid?
-               if (null == event) {
-                       // Throw NPE
-                       throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getBasicData() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.basicData is null"); //NOI18N
-               } else if (event.getBasicData().getBasicDataId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.basicData.basicDataId is null"); //NOI18N
-               } else if (event.getBasicData().getBasicDataId() < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("event.basicData.basicDataId={0} is invalid", event.getBasicData().getBasicDataId())); //NOI18N
-               } else if (event.getBasicData().getCompanyName() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("event.basicData.companyName is null"); //NOI18N
-               } else if (event.getBasicData().getCompanyName().isEmpty()) {
-                       // Throw IAE again
-                       throw new IllegalArgumentException("event.basicData.companyName is empty"); //NOI18N
-               }
-
-               // Add it to list
-               this.basicDataCache.put(event.getBasicData().getBasicDataId(), event.getBasicData());
-               this.allBasicData.add(event.getBasicData());
-       }
-
-       /**
-        * Getter for a list of all business contacts
-        * <p>
-        * @return A list of all business contacts
-        */
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<BasicData> allBasicData () {
-               return this.allBasicData;
-       }
-
-       @Override
-       public BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException {
-               // Validate parameter
-               if (null == basicDataId) {
-                       // Throw NPE
-                       throw new NullPointerException("basicDataId is null"); //NOI18N
-               } else if (basicDataId < 1) {
-                       // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("basicDataId={0} is invalid", basicDataId)); //NOI18N
-               } else if (!this.basicDataCache.containsKey(basicDataId)) {
-                       // Not found
-                       throw new BasicDataNotFoundException(basicDataId);
-               }
-
-               // Get it from cache
-               final BasicData basicData = this.basicDataCache.get(basicDataId);
-
-               // Return it
-               return basicData;
        }
 
        /**
@@ -316,26 +212,6 @@ public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implem
                this.faxNumber = faxNumber;
        }
 
-       /**
-        * Getter for filtered basic company data
-        * <p>
-        * @return Filtered basic company data
-        */
-       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
-       public List<BasicData> getFilteredBasicCompanyData () {
-               return this.filteredBasicCompanyData;
-       }
-
-       /**
-        * Setter for filtered basic company data
-        * <p>
-        * @param filteredBasicCompanyData Filtered basic company data
-        */
-       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
-       public void setFilteredBasicCompanyData (final List<BasicData> filteredBasicCompanyData) {
-               this.filteredBasicCompanyData = filteredBasicCompanyData;
-       }
-
        /**
         * Getter for land-line number's area code
         * <p>
@@ -390,103 +266,6 @@ public class FinancialsBasicDataWebRequestBean extends BaseFinancialsBean implem
                this.landLineNumber = landLineNumber;
        }
 
-       /**
-        * Initializer method
-        */
-       @PostConstruct
-       public void initializeList () {
-               // Is cache there?
-               if (!this.basicDataCache.iterator().hasNext()) {
-                       // Get whole list
-                       final List<BasicData> basicDatas = this.businessDataBean.allBusinessBasicData();
-
-                       // Add all
-                       for (final BasicData basicData : basicDatas) {
-                               // Add it to cache
-                               this.basicDataCache.put(basicData.getBasicDataId(), basicData);
-                       }
-               }
-
-               // Is cache there and list is not full?
-               if ((this.allBasicData.isEmpty()) && (this.basicDataCache.iterator().hasNext())) {
-                       // Get iterator
-                       final Iterator<Cache.Entry<Long, BasicData>> iterator = this.basicDataCache.iterator();
-
-                       // Build up list
-                       while (iterator.hasNext()) {
-                               // GEt next element
-                               final Cache.Entry<Long, BasicData> next = iterator.next();
-
-                               // Add to list
-                               this.allBasicData.add(next.getValue());
-                       }
-
-                       // Sort list
-                       this.allBasicData.sort(new Comparator<BasicData>() {
-                               @Override
-                               public int compare (final BasicData o1, final BasicData o2) {
-                                       return o1.getBasicDataId() > o2.getBasicDataId() ? 1 : o1.getBasicDataId() < o2.getBasicDataId() ? -1 : 0;
-                               }
-                       });
-               }
-       }
-
-       @Override
-       public Boolean isCompanyNameUsed (final String companyName) {
-               // Validate parameter
-               if (null == companyName) {
-                       // Throw NPE
-                       throw new NullPointerException("companyName is null"); //NOI18N
-               } else if (companyName.isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("companyName is empty"); //NOI18N
-               }
-
-               // Default is not found
-               boolean isFound = false;
-
-               // Check all entries
-               for (final BasicData basicData : this.allBasicData()) {
-                       // Is same company name?
-                       if (Objects.equals(basicData.getCompanyName(), companyName)) {
-                               // Found it
-                               isFound = true;
-                               break;
-                       }
-               }
-
-               // Return flag
-               return isFound;
-       }
-
-       @Override
-       public Boolean isEmailAddressRegistered (final String emailAddress) {
-               // Validate parameter
-               if (null == emailAddress) {
-                       // Throw NPE
-                       throw new NullPointerException("emailAddress is null"); //NOI18N
-               } else if (emailAddress.isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
-               }
-
-               // Default is not found
-               boolean isFound = false;
-
-               // Check all entries
-               for (final BasicData basicData : this.allBasicData()) {
-                       // Is email address used?
-                       if (Objects.equals(basicData.getCompanyEmailAddress(), emailAddress)) {
-                               // Found it
-                               isFound = true;
-                               break;
-                       }
-               }
-
-               // Return flag
-               return isFound;
-       }
-
        /**
         * Clears this bean
         */
index 8822ce0ca9e6b3b9caebc6d01d9e8e472fc51c82..cb224bb5fcd70cee0708c33fae3d4f13fd2db517 100644 (file)
@@ -17,8 +17,6 @@
 package org.mxchange.jfinancials.beans.business.basicdata;
 
 import java.io.Serializable;
-import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 
 /**
  * An interface for session-scoped financial controller
@@ -27,36 +25,4 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
  */
 public interface FinancialsBasicDataWebRequestController extends Serializable {
 
-       /**
-        * Checks if given email address is already registered by other basic
-        * company data
-        * <p>
-        * @param emailAddress Email address
-        * <p>
-        * @return Whether the email address has been already registered
-        */
-       Boolean isEmailAddressRegistered (final String emailAddress);
-
-       /**
-        * Retrieves a single business data entity for given id number or throws a
-        * proper exception if not found.
-        * <p>
-        * @param basicDataId Company basic data id to lookup
-        * <p>
-        * @return Business contact instance
-        * <p>
-        * @throws BasicDataNotFoundException If the id number could not be looked
-        * up and solved into an entity
-        */
-       BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException;
-
-       /**
-        * Checks whether given company name already exists
-        * <p>
-        * @param companyName Company name to check
-        * <p>
-        * @return Whether the company name exists
-        */
-       Boolean isCompanyNameUsed (final String companyName);
-
 }
diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewBean.java
new file mode 100644 (file)
index 0000000..fc91ae9
--- /dev/null
@@ -0,0 +1,271 @@
+/*
+ * Copyright (C) 2017, 2018 Free Software Foundation
+ *
+ * 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.jfinancials.beans.business.basicdata.list;
+
+import fish.payara.cdi.jsr107.impl.NamedCache;
+import java.text.MessageFormat;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Objects;
+import javax.annotation.PostConstruct;
+import javax.cache.Cache;
+import javax.ejb.EJB;
+import javax.enterprise.event.Observes;
+import javax.faces.view.ViewScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontactsbusiness.events.basicdata.added.ObservableAdminAddedBusinessBasicDataEvent;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jfinancials.beans.BaseFinancialsBean;
+
+/**
+ * A view-scoped bean for product lists
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("basicDataListController")
+@ViewScoped
+public class FinancialsBasicDataListWebViewBean extends BaseFinancialsBean implements FinancialsBasicDataListWebViewController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 34_869_872_672_645L;
+
+       /**
+        * List of all basic company data
+        */
+       private final List<BasicData> allBasicData;
+
+       /**
+        * EJB for general basic business data purposes
+        */
+       @EJB (lookup = "java:global/jfinancials-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote", description = "A stateless session bean for general purposes.")
+       private BasicCompanyDataSessionBeanRemote basicDataBean;
+
+       /**
+        * A list of all registered companies (globally)
+        */
+       @Inject
+       @NamedCache (cacheName = "basicDataCache")
+       private transient Cache<Long, BasicData> basicDataCache;
+
+       /**
+        * List of filtered basic company data
+        */
+       private List<BasicData> filteredBasicData;
+
+       /**
+        * Default constructor
+        */
+       public FinancialsBasicDataListWebViewBean () {
+               // Call super constructor
+               super();
+
+               // Init list
+               this.allBasicData = new LinkedList<>();
+       }
+
+       /**
+        * Observers events being fired when an administrator has added company
+        * basic data.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterAdminAddedBasicCompanyDataEvent (@Observes final ObservableAdminAddedBusinessBasicDataEvent event) {
+               // Is the parameter valid?
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getBasicData() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.basicData is null"); //NOI18N
+               } else if (event.getBasicData().getBasicDataId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.basicData.basicDataId is null"); //NOI18N
+               } else if (event.getBasicData().getBasicDataId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("event.basicData.basicDataId={0} is invalid", event.getBasicData().getBasicDataId())); //NOI18N
+               } else if (event.getBasicData().getCompanyName() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.basicData.companyName is null"); //NOI18N
+               } else if (event.getBasicData().getCompanyName().isEmpty()) {
+                       // Throw IAE again
+                       throw new IllegalArgumentException("event.basicData.companyName is empty"); //NOI18N
+               }
+
+               // Add it to list
+               this.basicDataCache.put(event.getBasicData().getBasicDataId(), event.getBasicData());
+               this.getAllBasicData().add(event.getBasicData());
+       }
+
+       @Override
+       public BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException {
+               // Validate parameter
+               if (null == basicDataId) {
+                       // Throw NPE
+                       throw new NullPointerException("basicDataId is null"); //NOI18N
+               } else if (basicDataId < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("basicDataId={0} is invalid", basicDataId)); //NOI18N
+               } else if (!this.basicDataCache.containsKey(basicDataId)) {
+                       // Not found
+                       throw new BasicDataNotFoundException(basicDataId);
+               }
+
+               // Get it from cache
+               final BasicData basicData = this.basicDataCache.get(basicDataId);
+
+               // Return it
+               return basicData;
+       }
+
+       /**
+        * Getter for a list of all business contacts
+        * <p>
+        * @return A list of all business contacts
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<BasicData> getAllBasicData () {
+               return this.allBasicData;
+       }
+
+       /**
+        * Getter for filtered basic company data
+        * <p>
+        * @return Filtered basic company data
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<BasicData> getFilteredBasicData () {
+               return this.filteredBasicData;
+       }
+
+       /**
+        * Setter for filtered basic company data
+        * <p>
+        * @param filteredBasicData Filtered basic company data
+        */
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setFilteredBasicData (final List<BasicData> filteredBasicData) {
+               this.filteredBasicData = filteredBasicData;
+       }
+
+       /**
+        * Initializer method
+        */
+       @PostConstruct
+       public void initializeList () {
+               // Is cache there?
+               if (!this.basicDataCache.iterator().hasNext()) {
+                       // Get whole list
+                       final List<BasicData> basicDatas = this.basicDataBean.allBusinessBasicData();
+
+                       // Add all
+                       for (final BasicData basicData : basicDatas) {
+                               // Add it to cache
+                               this.basicDataCache.put(basicData.getBasicDataId(), basicData);
+                       }
+               }
+
+               // Is cache there and list is not full?
+               if ((this.getAllBasicData().isEmpty()) && (this.basicDataCache.iterator().hasNext())) {
+                       // Get iterator
+                       final Iterator<Cache.Entry<Long, BasicData>> iterator = this.basicDataCache.iterator();
+
+                       // Build up list
+                       while (iterator.hasNext()) {
+                               // GEt next element
+                               final Cache.Entry<Long, BasicData> next = iterator.next();
+
+                               // Add to list
+                               this.getAllBasicData().add(next.getValue());
+                       }
+
+                       // Sort list
+                       this.getAllBasicData().sort(new Comparator<BasicData>() {
+                               @Override
+                               public int compare (final BasicData o1, final BasicData o2) {
+                                       return o1.getBasicDataId() > o2.getBasicDataId() ? 1 : o1.getBasicDataId() < o2.getBasicDataId() ? -1 : 0;
+                               }
+                       });
+
+                       // Set full list
+                       this.setFilteredBasicData(this.getAllBasicData());
+               }
+       }
+
+       @Override
+       public Boolean isCompanyNameUsed (final String companyName) {
+               // Validate parameter
+               if (null == companyName) {
+                       // Throw NPE
+                       throw new NullPointerException("companyName is null"); //NOI18N
+               } else if (companyName.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("companyName is empty"); //NOI18N
+               }
+
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all entries
+               for (final BasicData basicData : this.getAllBasicData()) {
+                       // Is same company name?
+                       if (Objects.equals(basicData.getCompanyName(), companyName)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+       @Override
+       public Boolean isEmailAddressRegistered (final String emailAddress) {
+               // Validate parameter
+               if (null == emailAddress) {
+                       // Throw NPE
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
+               } else if (emailAddress.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
+               }
+
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all entries
+               for (final BasicData basicData : this.getAllBasicData()) {
+                       // Is email address used?
+                       if (Objects.equals(basicData.getCompanyEmailAddress(), emailAddress)) {
+                               // Found it
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+}
diff --git a/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewController.java b/src/java/org/mxchange/jfinancials/beans/business/basicdata/list/FinancialsBasicDataListWebViewController.java
new file mode 100644 (file)
index 0000000..c106371
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2018 Free Software Foundation
+ *
+ * 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.jfinancials.beans.business.basicdata.list;
+
+import java.io.Serializable;
+import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+
+/**
+ * An interface of basic data list backing beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsBasicDataListWebViewController extends Serializable {
+
+       /**
+        * Retrieves a single business data entity for given id number or throws a
+        * proper exception if not found.
+        * <p>
+        * @param basicDataId Company basic data id to lookup
+        * <p>
+        * @return Business contact instance
+        * <p>
+        * @throws BasicDataNotFoundException If the id number could not be looked
+        * up and solved into an entity
+        */
+       BasicData findBasicDataById (final Long basicDataId) throws BasicDataNotFoundException;
+
+       /**
+        * Checks if given email address is already registered by other basic
+        * company data
+        * <p>
+        * @param emailAddress Email address
+        * <p>
+        * @return Whether the email address has been already registered
+        */
+       Boolean isEmailAddressRegistered (final String emailAddress);
+
+       /**
+        * Checks whether given company name already exists
+        * <p>
+        * @param companyName Company name to check
+        * <p>
+        * @return Whether the company name exists
+        */
+       Boolean isCompanyNameUsed (final String companyName);
+
+}
index 7c40f4a1ce7648f62cfd143c0c2b485e6d70709f..18470d2d21bcc58cddd5e76467aabf4de15c06df 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Roland Haeder<roland@mxchange.org>
+ * Copyright (C) 2017, 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index b083696f1aec6c2897fb5e4d2c4a13d3fc7ccfb4..8138466bd00476fb85c386260dde83b5bea22a67 100644 (file)
@@ -24,8 +24,8 @@ import javax.faces.convert.ConverterException;
 import javax.faces.convert.FacesConverter;
 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataNotFoundException;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestBean;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestController;
+import org.mxchange.jfinancials.beans.business.basicdata.list.FinancialsBasicDataListWebViewBean;
+import org.mxchange.jfinancials.beans.business.basicdata.list.FinancialsBasicDataListWebViewController;
 
 /**
  * Converter for basic company data id <-> valid basic company data instance
@@ -38,14 +38,14 @@ public class FinancialsBasicCompanyDataConverter implements Converter<BasicData>
        /**
         * Basic company data backing bean
         */
-       private static FinancialsBasicDataWebRequestController BASIC_DATA_CONTROLLER;
+       private static FinancialsBasicDataListWebViewController BASIC_DATA_LIST_CONTROLLER;
 
        @Override
        public BasicData getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
                // Is the instance there?
-               if (null == BASIC_DATA_CONTROLLER) {
+               if (null == BASIC_DATA_LIST_CONTROLLER) {
                        // Get bean from CDI directly
-                       BASIC_DATA_CONTROLLER = CDI.current().select(FinancialsBasicDataWebRequestBean.class).get();
+                       BASIC_DATA_LIST_CONTROLLER = CDI.current().select(FinancialsBasicDataListWebViewBean.class).get();
                }
 
                // Is the value null or empty?
@@ -65,7 +65,7 @@ public class FinancialsBasicCompanyDataConverter implements Converter<BasicData>
                        final Long basicDataId = Long.valueOf(submittedValue);
 
                        // Try to get user instance from it
-                       basicData = BASIC_DATA_CONTROLLER.findBasicDataById(basicDataId);
+                       basicData = BASIC_DATA_LIST_CONTROLLER.findBasicDataById(basicDataId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
diff --git a/src/java/org/mxchange/jfinancials/filter/FinancialsNoCacheFilter.java b/src/java/org/mxchange/jfinancials/filter/FinancialsNoCacheFilter.java
new file mode 100644 (file)
index 0000000..044da91
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2018 Free Software Foundation
+ *
+ * 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.jfinancials.filter;
+
+import java.io.IOException;
+import javax.faces.application.ResourceHandler;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * A filter for no-caching of JSF requests send from client. This class was
+ * taken from stackoverflow.com at
+ * https://stackoverflow.com/questions/3642919/javax-faces-application-viewexpiredexception-view-could-not-be-restored
+ * and was slightly expanded with "final" keyword and comments
+ * <p>
+ * @author Bauke "BalusC" Scholz<unknown@email.invalid>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@WebFilter (servletNames = {"Faces Servlet"})
+public class FinancialsNoCacheFilter implements Filter {
+
+       @Override
+       public void destroy () {
+               System.out.println("destroy!");
+       }
+
+       @Override
+       public void doFilter (final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
+               // Cast parameter
+               final HttpServletRequest req = (HttpServletRequest) request;
+               final HttpServletResponse res = (HttpServletResponse) response;
+
+               // Is the request URI not starting with resource identifier?
+               if (!req.getRequestURI().startsWith(req.getContextPath() + ResourceHandler.RESOURCE_IDENTIFIER)) {
+                       res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); //NOI18N
+                       res.setHeader("Pragma", "no-cache"); // //NOI18N
+                       res.setDateHeader("Expires", 0); // //NOI18N
+               }
+
+               // Continue filtering
+               chain.doFilter(request, response);
+       }
+
+       @Override
+       public void init (final FilterConfig filterConfig) throws ServletException {
+               System.out.println("init!");
+       }
+
+}
index 6044ea0354dda295618593c65497ed66464db75f..7c1511fcb53770f7ff7169c5a412a71a135dd123 100644 (file)
@@ -24,8 +24,8 @@ import javax.faces.context.FacesContext;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.ValidatorException;
 import org.mxchange.jcoreee.validator.string.BaseStringValidator;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestBean;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestController;
+import org.mxchange.jfinancials.beans.business.basicdata.list.FinancialsBasicDataListWebViewBean;
+import org.mxchange.jfinancials.beans.business.basicdata.list.FinancialsBasicDataListWebViewController;
 
 /**
  * A validator for basic data company names
@@ -38,7 +38,7 @@ public class FinancialsBasicDataCompanyNameValidator extends BaseStringValidator
        /**
         * Business basic data backing bean
         */
-       private static FinancialsBasicDataWebRequestController BASIC_DATA_CONTROLLER;
+       private static FinancialsBasicDataListWebViewController BASIC_DATA_LIST_CONTROLLER;
 
        /**
         * Serial number
@@ -48,9 +48,9 @@ public class FinancialsBasicDataCompanyNameValidator extends BaseStringValidator
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
                // Is the instance there?
-               if (null == BASIC_DATA_CONTROLLER) {
+               if (null == BASIC_DATA_LIST_CONTROLLER) {
                        // Get bean from CDI directly
-                       BASIC_DATA_CONTROLLER = CDI.current().select(FinancialsBasicDataWebRequestBean.class).get();
+                       BASIC_DATA_LIST_CONTROLLER = CDI.current().select(FinancialsBasicDataListWebViewBean.class).get();
                }
 
                // All accepted, required fields
@@ -81,7 +81,7 @@ public class FinancialsBasicDataCompanyNameValidator extends BaseStringValidator
                }
 
                // Check if name is already used
-               final Boolean nameExists = BASIC_DATA_CONTROLLER.isCompanyNameUsed(companyName);
+               final Boolean nameExists = BASIC_DATA_LIST_CONTROLLER.isCompanyNameUsed(companyName);
 
                // Is the user id valid?
                if ((!nameExists) && (checkExisting)) {
index b42b24c525d1c8e78ff866827936de1decd1afbf..cdf0c3a0e37c3fae391182d99a33b425857ef955 100644 (file)
@@ -25,8 +25,8 @@ import javax.faces.context.FacesContext;
 import javax.faces.validator.FacesValidator;
 import javax.faces.validator.ValidatorException;
 import org.mxchange.jcoreee.validator.string.BaseStringValidator;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestBean;
-import org.mxchange.jfinancials.beans.business.basicdata.FinancialsBasicDataWebRequestController;
+import org.mxchange.jfinancials.beans.business.basicdata.list.FinancialsBasicDataListWebViewBean;
+import org.mxchange.jfinancials.beans.business.basicdata.list.FinancialsBasicDataListWebViewController;
 
 /**
  * A validator for basic company data email address validation
@@ -39,7 +39,7 @@ public class FinancialsBasicDataEmailAddressValidator extends BaseStringValidato
        /**
         * Branch office backing bean
         */
-       private static FinancialsBasicDataWebRequestController BASIC_DATA_CONTROLLER;
+       private static FinancialsBasicDataListWebViewController BASIC_DATA_LIST_CONTROLLER;
 
        /**
         * Email pattern
@@ -115,13 +115,13 @@ public class FinancialsBasicDataEmailAddressValidator extends BaseStringValidato
                final String clientId = component.getClientId();
 
                // Is the instance there?
-               if (null == BASIC_DATA_CONTROLLER) {
+               if (null == BASIC_DATA_LIST_CONTROLLER) {
                        // Get bean from CDI directly
-                       BASIC_DATA_CONTROLLER = CDI.current().select(FinancialsBasicDataWebRequestBean.class).get();
+                       BASIC_DATA_LIST_CONTROLLER = CDI.current().select(FinancialsBasicDataListWebViewBean.class).get();
                }
 
                // Is it registered?
-               final Boolean isRegistered = BASIC_DATA_CONTROLLER.isEmailAddressRegistered(emailAddress);
+               final Boolean isRegistered = BASIC_DATA_LIST_CONTROLLER.isEmailAddressRegistered(emailAddress);
 
                // Is the email address already registered?
                if ((!clientId.endsWith("resendEmailAddress")) && (isRegistered)) { //NOI18N
index ceee798674569a23927a9d84c64476eb227fb745..e7498fcb377729ac918d88797ef1d3477de1f5f9 100644 (file)
@@ -238,7 +238,7 @@ PAGE_TITLE_ADMIN_EDIT_USER=Benuzteraccount editieren
 CONTENT_TITLE_ADMIN_EDIT_USER=\u00c4ndern von Benutzeraccounts:
 PAGE_TITLE_ADMIN_UNLOCK_USER=Entsperren von Benutzeraccounts
 CONTENT_TITLE_ADMIN_UNLOCK_USER=Entsperren von Benutzeraccounts:
-ADMIN_MENU_USER_TITLE=Benutzerverwaltung
+ADMIN_MENU_USER_TITLE=Benutzer
 #@TODO Please fix German umlauts!
 PAGE_TITLE_ADMIN_ADD_USER=Neues Benutzeraccount hinzufuegen
 CONTENT_TITLE_ADMIN_ADD_USER=Neues Benutzeraccount hinzufuegen:
@@ -472,7 +472,7 @@ GUEST_CONFIRMATION_KEY_NOT_SET=Es wurde keine Best\u00e4tigungsschl\u00fcssel an
 GUEST_CONFIRM_USER_ACCOUNT_DONE_TITLE=Vielen Dank f\u00fcr die Best\u00e4tigung
 GUEST_USER_CONFIRM_ACCOUNT_DONE=Hallo {0} {1} {2}. Sie haben soeben Ihren Account best\u00e4tigt. Es ist eine Mail mit weiteren Details an Sie unterwegs.
 BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Account best\u00e4tigen
-ADMIN_MENU_CONTACT_TITLE=Kontaktdaten verwalten
+ADMIN_MENU_CONTACT_TITLE=Kontaktdaten
 ADMIN_LINK_LIST_CONTACT=Kontaktdaten
 ADMIN_LINK_LIST_CONTACT_TITLE=Listet alle Kontaktdaten auf, egal wo her sie angelegt wurden.
 ADMIN_CONTACT_COUNTRY_CODE=L\u00e4ndercode:
@@ -576,7 +576,7 @@ ERROR_BEAN_HELPER_USER_NOT_SET=Fehler: Instanz 'user' im Bean-Helper nicht geset
 ERROR_BEAN_HELPER_CONTACT_NOT_SET=Fehler: Instanz 'contact' im Bean-Helper nicht gesetzt.
 ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET=Fehler: Instanz 'mobile' in Bean-Helper nicht gesetzt.
 CONTENT_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=Auflisten von Mobiltelefonnummern:
-ADMIN_MENU_PHONE_NUMBERS_TITLE=Telefonnummern:
+ADMIN_MENU_PHONE_NUMBERS_TITLE=Telefonnummern
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS=Handynummern
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS_TITLE=Alle Mobilfunknummern auflisten.
 ADMIN_SHOW_PHONE_CREATED=Telefoneintrag erstellt:
@@ -1163,3 +1163,5 @@ ADMIN_LAND_LINE_NUMBER_REQUIRED=Bitte geben Sie die Rufnummer zur Festnetznummer
 ADMIN_FAX_AREA_CODE_REQUIRED=Bitte geben Sie die Vorwahlnummer zur Faxnummer ein.
 ADMIN_FAX_NUMBER_REQUIRED=Bitte geben Sie die Rufnummer zur Faxnummer ein.
 CHOICE_ALL=Alle/s
+ENTER_KEYWORD=Stichwort eingeben ...
+SEARCH_ALL_FIELDS=Alle Felder durchsuchen:
index 6a6ac24b8fa1b4f82bf95f52979b1d611bf55955..e6c507606a7552145d4f2cc75d2b1f3524a775c3 100644 (file)
@@ -218,7 +218,7 @@ PAGE_TITLE_ADMIN_EDIT_USER=Edit user accounts
 CONTENT_TITLE_ADMIN_EDIT_USER=Edit user accounts:
 PAGE_TITLE_ADMIN_UNLOCK_USER=Unlock user accounts
 CONTENT_TITLE_ADMIN_UNLOCK_USER=Unlock user accounts:
-ADMIN_MENU_USER_TITLE=User management
+ADMIN_MENU_USER_TITLE=Users
 PAGE_TITLE_ADMIN_ADD_USER=Add new user account
 CONTENT_TITLE_ADMIN_ADD_USER=Add new user account:
 TABLE_SUMMARY_ADMIN_LIST_USERS=Administration, list all users
@@ -460,7 +460,7 @@ GUEST_CONFIRMATION_KEY_NOT_SET=No confirmation key was provided. Please check th
 GUEST_CONFIRM_USER_ACCOUNT_DONE_TITLE=Thank you for confirmation of your account
 GUEST_USER_CONFIRM_ACCOUNT_DONE=Hello {0} {1} {2}. You have successfully confirmed your account. An email with more details is on it's way to you.
 BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Confirm account
-ADMIN_MENU_CONTACT_TITLE=Manage contact data
+ADMIN_MENU_CONTACT_TITLE=Contact data
 ADMIN_LINK_LIST_CONTACT=Contact data
 ADMIN_LINK_LIST_CONTACT_TITLE=Lists all contact data regardless where they was created.
 ADMIN_CONTACT_COUNTRY_CODE=Country code:
@@ -561,7 +561,7 @@ ERROR_BEAN_HELPER_USER_NOT_SET=Error: Instance 'user' not set in bean helper.
 ERROR_BEAN_HELPER_CONTACT_NOT_SET=Error: Instance 'contact' not set in bean helper.
 ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET=Error: Instance 'mobile' in bean helper not set.
 CONTENT_TITLE_ADMIN_LIST_CONTACT_MOBILE_NUMBER=List mobile phone numbers:
-ADMIN_MENU_PHONE_NUMBERS_TITLE=Phone numbers:
+ADMIN_MENU_PHONE_NUMBERS_TITLE=Phone numbers
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS=Mobile numbers
 ADMIN_LINK_LIST_MOBILE_PHONE_NUMBERS_TITLE=List all mobile numbers.
 ADMIN_SHOW_PHONE_CREATED=Created:
@@ -1051,3 +1051,5 @@ ADMIN_LAND_LINE_NUMBER_REQUIRED=Please enter caller number for land-line number.
 ADMIN_FAX_AREA_CODE_REQUIRED=Please enter an area-code for fax number.
 ADMIN_FAX_NUMBER_REQUIRED=Please enter caller number for fax number.
 CHOICE_ALL=All
+ENTER_KEYWORD=Enter keyword ...
+SEARCH_ALL_FIELDS=Search all fields:
index b992069a3f40530f8c5b506f5a93a55650c1769b..9310b72eaab039ec2064415b4e539c8d89171c0d 100644 (file)
@@ -1,14 +1,13 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <ui:composition
        xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
-       xmlns:pm="http://primefaces.org/mobile">
+       >
 
        <h:form>
-               <p:menu>
+               <p:menubar id="menu-bar">
                        <p:submenu label="#{msg.ADMIN_MENU_MAIN_TITLE}">
                                <p:menuitem title="#{msg.ADMIN_LINK_INDEX_TITLE}" outcome="admin_index" value="#{msg.ADMIN_LINK_INDEX}" />
                        </p:submenu>
                                <p:menuitem title="#{msg.ADMIN_LINK_LIST_MOBILE_PROVIDER_TITLE}" outcome="admin_list_mobile_provider" value="#{msg.ADMIN_LINK_LIST_MOBILE_PROVIDER}" />
                        </p:submenu>
 
-                       <p:submenu label="#{msg.ADMIN_MENU_LOGOUT_TITLE}">
+                       <p:submenu label="#{msg.ADMIN_MENU_LOGOUT_TITLE}" style="float: right">
                                <p:menuitem title="#{msg.ADMIN_LINK_LOGOUT_TITLE}" outcome="admin_logout" value="#{msg.ADMIN_LINK_LOGOUT}" />
                                <p:menuitem title="#{msg.ADMIN_LINK_TO_WEBPAGE_TITLE}" outcome="index" value="#{msg.ADMIN_LINK_TO_WEBPAGE}" />
                        </p:submenu>
-               </p:menu>
+               </p:menubar>
+
+               <p:sticky target="menu-bar" />
        </h:form>
 </ui:composition>
index 22ebd8a779ee7434cf4530108f1a7d20df85a74b..c8c5a4cf24776bba88b622aaa03c4eb6cecf0d18 100644 (file)
@@ -23,7 +23,7 @@
                                >
                                <f:converter converterId="BasicCompanyDataConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                               <f:selectItems value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="branchContactEmployee" value="#{msg.ADMIN_ASSIGN_BRANCH_OFFICE_CONTACT_EMPLOYEE}" />
index bc7fb9c6a057eddd9a16734d47565534dba804c1..50ef8bad266e90c934a4078a2d4dffebb3de7ae1 100644 (file)
@@ -30,7 +30,7 @@
                                >
                                <f:converter converterId="BasicCompanyDataConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                               <f:selectItems value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="departmentBranchOffice" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE}" />
index e206995b2304ffaa4c5c662e42c3237271cc615a..ca95d35b57b97d3e252581f5a60b091ad6d3d04c 100644 (file)
@@ -23,7 +23,7 @@
                                >
                                <f:converter converterId="BasicCompanyDataConverter" />
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
-                               <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+                               <f:selectItems value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="employeeBranchOffice" value="#{msg.ADMIN_ASSIGN_EMPLOYEE_BRANCH_OFFICE}" />
index 3c397ae58bedb666780c1096e07f364e930c580f..a9da0c56747974da738e976ba339dffdda5653da 100644 (file)
                        <pm:page id="master">
                                <h:panelGroup styleClass="ui-fluid" layout="block">
                                        <pm:header>
-                                               <h:panelGroup layout="block">
-                                                       <h:panelGroup styleClass="page-header" layout="block">
-                                                               <h1>
-                                                                       <h:outputText value="#{initParam['project_title']} - " />
-
-                                                                       <ui:insert name="content_header">
-                                                                               <h:outputText value="Default header title" />
-                                                                       </ui:insert>
-                                                               </h1>
-                                                       </h:panelGroup>
+                                               <h:panelGroup styleClass="page-header" layout="block">
+                                                       <p:outputPanel styleClass="ui-g">
+                                                               <p:outputPanel styleClass="ui-g-12 ui-md-9 ui-g-nopad">
+                                                                       <h1>
+                                                                               <h:outputText value="#{initParam['project_title']} - " />
+
+                                                                               <ui:insert name="content_header">
+                                                                                       <h:outputText value="Default header title" />
+                                                                               </ui:insert>
+                                                                       </h1>
+                                                               </p:outputPanel>
+
+                                                               <p:outputPanel styleClass="ui-g-12 ui-md-3">
+                                                                       <ui:include src="/WEB-INF/templates/widgets/locale_change_widget.tpl" />
+                                                               </p:outputPanel>
+                                                       </p:outputPanel>
+                                               </h:panelGroup>
 
-                                                       <h:panelGroup styleClass="page-content-gap" layout="block">
-                                                       </h:panelGroup>
+                                               <h:panelGroup styleClass="page-content-gap" layout="block">
                                                </h:panelGroup>
                                        </pm:header>
 
                                        <h:panelGroup styleClass="ui-g" layout="block">
-                                               <h:panelGroup styleClass="ui-g-12 ui-md-2" layout="block">
+                                               <h:panelGroup styleClass="ui-g-12 ui-md-12" layout="block">
                                                        <ui:insert name="menu">
                                                                <h:outputText value="Default menu" />
                                                        </ui:insert>
-
-                                                       <ui:include src="/WEB-INF/templates/widgets/locale_change_widget.tpl" />
                                                </h:panelGroup>
 
-                                               <h:panelGroup styleClass="ui-g-12 ui-md-10 ui-g-nopad" layout="block">
-                                                       <h:panelGroup styleClass="ui-g-12 ui-g-nopad">
+                                               <h:panelGroup styleClass="ui-g-12 ui-md-12 ui-g-nopad" layout="block">
+                                                       <h:panelGroup styleClass="ui-g-12">
                                                                <ui:insert name="content">
                                                                        <h:outputText value="Default content" />
                                                                </ui:insert>
                                                </p:growl>
 
                                                <p:ajaxExceptionHandler
-                                                       type="javax.faces.application.ViewExpiredException"
+                                                       type="java.lang.Throwable"
                                                        update="exceptionDialog"
-                                                       onexception="PF('exceptionDialog').show();"
+                                                       onexception="PF('master:exception-dialog-form:exceptionDialog').show();"
                                                        />
 
-                                               <p:dialog id="exceptionDialog" closable="true" closeOnEscape="true" header="Exception '#{pfExceptionHandler.type}' occured!" widgetVar="exceptionDialog"
-                                                                 height="500px">
-                                                       <div class="para">
-                                                               <h:outputText value="#{msg.EXCEPTION_MESSAGE}:" />
-                                                               <h:outputText value="#{pfExceptionHandler.message}" />
-                                                       </div>
-
-                                                       <div class="para">
-                                                               <h:outputText value="#{msg.EXCEPTION_STACK_TRACE}:" />
-                                                               <h:outputText value="#{pfExceptionHandler.formattedStackTrace}" escape="false" />
-                                                       </div>
-
-                                                       <div class="para">
-                                                               <p:button onclick="window.location.href = document.location.href;"
-                                                                                 value="#{msg.RELOAD_PAGE}"
-                                                                                 rendered="#{pfExceptionHandler.type == 'javax.faces.application.ViewExpiredException'}" />
-                                                       </div>
-                                               </p:dialog>
+                                               <h:form id="exception-dialog-form">
+                                                       <p:dialog id="exceptionDialog" closable="true" closeOnEscape="true" header="Exception '#{pfExceptionHandler.type}' occured!" widgetVar="exceptionDialog"
+                                                                         height="500px">
+                                                               <div class="para">
+                                                                       <h:outputText value="#{msg.EXCEPTION_MESSAGE}:" />
+                                                                       <h:outputText value="#{pfExceptionHandler.message}" />
+                                                               </div>
+
+                                                               <div class="para">
+                                                                       <h:outputText value="#{msg.EXCEPTION_STACK_TRACE}:" />
+                                                                       <h:outputText value="#{pfExceptionHandler.formattedStackTrace}" escape="false" />
+                                                               </div>
+
+                                                               <div class="para">
+                                                                       <p:button onclick="window.location.href = document.location.href;"
+                                                                                         value="#{msg.RELOAD_PAGE}"
+                                                                                         rendered="#{pfExceptionHandler.type == 'javax.faces.application.ViewExpiredException'}" />
+                                                               </div>
+                                                       </p:dialog>
+                                               </h:form>
                                        </h:panelGroup>
                                </h:panelGroup>
                        </pm:page>
index e714b82db3459aa8da68e71ccae45b4197930fdb..5e75c095d849ec7cf929ae05a6699d6e42245db1 100644 (file)
@@ -7,15 +7,18 @@
        xmlns:p="http://primefaces.org/ui">
 
        <h:form id="form-change-locale">
-               <p:panelGrid columns="2" layout="grid">
-                       <h:panelGroup layout="block">
-                               <p:selectOneMenu value="#{localizationController.localeCode}" onchange="$('#form-change-locale').submit()">
+               <p:outputPanel styleClass="ui-g">
+                       <p:outputPanel styleClass="ui-g-12 ui-md-6">
+                               <p:selectOneMenu value="#{localizationController.localeCode}">
+                                       <p:ajax update="master" />
                                        <f:selectItem itemLabel="#{msg.SELECT_LANGUAGE}" noSelectionOption="true" itemDisabled="true" />
                                        <f:selectItems value="#{localizationController.supportedLocales}" var="locale" itemValue="#{locale}" itemLabel="#{msg[locale.toString().toUpperCase()]}" />
                                </p:selectOneMenu>
-                       </h:panelGroup>
+                       </p:outputPanel>
 
-                       <p:commandButton styleClass="submit" type="submit" actionListener="#{localizationController.doChangeLocale()}" value="#{msg.BUTTON_CHANGE_LOCALE}" title="#{msg.BUTTON_CHANGE_LOCALE_TITLE}" />
-               </p:panelGrid>
+                       <p:outputPanel styleClass="ui-g-12 ui-md-6">
+                               <p:commandButton styleClass="submit" type="submit" actionListener="#{localizationController.doChangeLocale()}" value="#{msg.BUTTON_CHANGE_LOCALE}" title="#{msg.BUTTON_CHANGE_LOCALE_TITLE}" />
+                       </p:outputPanel>
+               </p:outputPanel>
        </h:form>
 </ui:composition>
index 2852ac73c29651bd831b3b01359cb25ab12e14ed..0402abaf3e3209b1cc6e75c8d881c242a68a4cc5 100644 (file)
         <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
         <param-value>-1</param-value>
     </context-param>
-    <context-param>
-        <description>State saving method</description>
-        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
-        <param-value>client</param-value>
-    </context-param>
     <context-param>
         <description>Development mode for WELD, keep disabled unless really needed. Currently it messes up the website.</description>
         <param-name>org.jboss.weld.development</param-name>