From: Roland Häder Date: Sat, 22 Dec 2018 00:15:33 +0000 (+0100) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7867cd61c382ac822e545c8dcca9e68b945c2158;p=jjobs-war.git Please cherry-pick: - introduced 2nd parameter for beanHelper.renderBasicData() to include short or long name in view components - also use that method instead of invoking getter in same helper backing-bean - re-aligned some JSF tags to have their attributes in distinct lines (easy to add another) Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java b/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java index 6c506324..7a842607 100644 --- a/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java +++ b/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java @@ -443,18 +443,25 @@ public class JobsWebViewHelperBean extends BaseJobsBean implements JobsWebViewHe /** * Renders data of basic company data *

- * @param basicData Basic company data instance + * @param basicData Basic company data instance + * @param useShortName Whether to use short name or long name of company *

* @return Basic company data as string */ - public String renderBasicData (final BasicData basicData) { + public String renderBasicData (final BasicData basicData, final boolean useShortName) { // Default is empty string, so let's get started final StringBuilder sb = new StringBuilder(30); // Is basic company data set? if (basicData instanceof BasicData) { - // Add company name - sb.append(basicData.getCompanyName()); //NOI18N + // Short or long name? + if (useShortName) { + // Add company's long name + sb.append(basicData.getCompanyShortName()); //NOI18N + } else { + // Add company's long name + sb.append(basicData.getCompanyName()); //NOI18N + } // Is email address set? if (basicData.getCompanyEmailAddress() != null) { @@ -491,7 +498,7 @@ public class JobsWebViewHelperBean extends BaseJobsBean implements JobsWebViewHe assert (branchOffice.getBranchCompany() instanceof BasicData) : "branchOffice.branchCompany is null"; //NOI18N // Yes, then append all data - sb.append(branchOffice.getBranchCompany().getCompanyName()); + sb.append(this.renderBasicData(branchOffice.getBranchCompany(), true)); sb.append(", "); //NOI18N sb.append(branchOffice.getBranchStreet()); sb.append(" "); //NOI18N @@ -576,7 +583,7 @@ public class JobsWebViewHelperBean extends BaseJobsBean implements JobsWebViewHe // Then create name sb.append(this.getMessageFromBundle(department.getDepartmentI18nKey())); sb.append(" ("); //NOI18N - sb.append(department.getDepartmentCompany().getCompanyName()); + sb.append(this.renderBasicData(department.getDepartmentCompany(), true)); sb.append(")"); //NOI18N } diff --git a/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl b/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl index 90a88a8d..6b4e9f96 100644 --- a/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl +++ b/web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl @@ -36,7 +36,7 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> diff --git a/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl b/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl index 42747902..6d45042d 100644 --- a/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl +++ b/web/WEB-INF/templates/admin/department/admin_form_department_data.tpl @@ -43,7 +43,7 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> diff --git a/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl b/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl index 290b73ff..1d42dbe8 100644 --- a/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl +++ b/web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl @@ -30,13 +30,18 @@ - + diff --git a/web/admin/branch_office/admin_branch_office_list.xhtml b/web/admin/branch_office/admin_branch_office_list.xhtml index 310934e5..b7abea68 100644 --- a/web/admin/branch_office/admin_branch_office_list.xhtml +++ b/web/admin/branch_office/admin_branch_office_list.xhtml @@ -102,12 +102,16 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> - + @@ -221,7 +225,12 @@ - + diff --git a/web/admin/department/admin_department_list.xhtml b/web/admin/department/admin_department_list.xhtml index 6f49671c..f9df8cc0 100644 --- a/web/admin/department/admin_department_list.xhtml +++ b/web/admin/department/admin_department_list.xhtml @@ -79,16 +79,18 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> - - - - - + + + diff --git a/web/admin/employee/admin_employee_list.xhtml b/web/admin/employee/admin_employee_list.xhtml index b2e7f4f8..5d16be5f 100644 --- a/web/admin/employee/admin_employee_list.xhtml +++ b/web/admin/employee/admin_employee_list.xhtml @@ -134,16 +134,18 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true)}" /> - - - - - + + +