]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 22 Dec 2018 00:15:33 +0000 (01:15 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 22 Jul 2019 00:26:32 +0000 (02:26 +0200)
- 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 <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java
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/admin/branch_office/admin_branch_office_list.xhtml
web/admin/department/admin_department_list.xhtml
web/admin/employee/admin_employee_list.xhtml

index 6c50632482e8ac9ca4e061fc475fb3a832de4bfb..7a8426072c68ca189438cd0d9074963837326c78 100644 (file)
@@ -443,18 +443,25 @@ public class JobsWebViewHelperBean extends BaseJobsBean implements JobsWebViewHe
        /**
         * Renders data of basic company data
         * <p>
-        * @param basicData Basic company data instance
+        * @param basicData    Basic company data instance
+        * @param useShortName Whether to use short name or long name of company
         * <p>
         * @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
                }
 
index 90a88a8d4169406794aa4bf99166c49d80271532..6b4e9f96126288aba08c8a8f86c8ce96d3e279c3 100644 (file)
@@ -36,7 +36,7 @@
                                        value="#{basicDataListController.allBasicData}"
                                        var="basicData"
                                        itemValue="#{basicData}"
-                                       itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                       itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                        />
                        </p:selectOneMenu>
 
index 4274790236653b179e61de6a8f9f1be293ad3efe..6d45042d116d1f84542a8dbaaae23c0d6edae082 100644 (file)
@@ -43,7 +43,7 @@
                                        value="#{basicDataListController.allBasicData}"
                                        var="basicData"
                                        itemValue="#{basicData}"
-                                       itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                       itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                        />
                        </p:selectOneMenu>
 
index 290b73ffe788490ca0f3613bb7f33b6b2e8d95d3..1d42dbe8c1981a46a55d5863439c14cb12041046 100644 (file)
 
                                <f:converter converterId="BasicCompanyDataConverter" />
 
-                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItem
+                                       itemValue="#{null}"
+                                       itemLabel="#{msg.PLEASE_SELECT}"
+                                       noSelectionOption="true"
+                                       itemDisabled="true"
+                                       />
 
                                <f:selectItems
                                        value="#{basicDataListController.allBasicData}"
                                        var="basicData"
                                        itemValue="#{basicData}"
-                                       itemLabel="#{basicData.companyName}"
+                                       itemLabel="#{beanHelper.renderBasicData(basicData)}"
                                        />
                        </p:selectOneMenu>
 
index 310934e5672fdf33de7a9d38802918d2cba0c331..b7abea680c0b1ee040da5afad7fb9485ee7147a0 100644 (file)
                                                                value="#{basicDataListController.allBasicData}"
                                                                var="basicData"
                                                                itemValue="#{basicData}"
-                                                               itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                                               itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <p:link outcome="admin_show_basic_data" value="#{beanHelper.renderBasicData(branchOffice.branchCompany)}" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}">
+                                       <p:link
+                                               outcome="admin_show_basic_data"
+                                               value="#{beanHelper.renderBasicData(branchOffice.branchCompany, true)}"
+                                               title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                               >
                                                <f:param name="basicDataId" value="#{branchOffice.branchCompany.basicDataId}" />
                                        </p:link>
                                </p:column>
                                                                <h:outputText value="#{branchOfficeListController.selectedBranchOffice.branchNumber}" />
 
                                                                <p:outputLabel value="#{msg.ASSIGNED_BASIC_DATA_HEADER}" title="#{msg.ASSIGNED_BASIC_DATA_TO_BRANCH_OFFICE_TITLE}" />
-                                                               <p:link outcome="admin_show_basic_data" target="_blank" value="#{beanHelper.renderBasicData(branchOfficeListController.selectedBranchOffice.branchCompany)}" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}">
+                                                               <p:link
+                                                                       outcome="admin_show_basic_data"
+                                                                       target="_blank"
+                                                                       value="#{beanHelper.renderBasicData(branchOfficeListController.selectedBranchOffice.branchCompany, false)}"
+                                                                       title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                                                       >
                                                                        <f:param name="basicDataId" value="#{branchOfficeListController.selectedBranchOffice.branchCompany.basicDataId}" />
                                                                </p:link>
 
index 6f49671c2f750ecde1e0b55f466811481fd6234a..f9df8cc0a65b5e9ea6d585a9717b732fb1e2d2f4 100644 (file)
                                                                value="#{basicDataListController.allBasicData}"
                                                                var="basicData"
                                                                itemValue="#{basicData}"
-                                                               itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                                               itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <h:outputLink value="#{department.departmentCompany.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty department.departmentCompany.companyWebsiteUrl}">
-                                               <h:outputText value="#{beanHelper.renderBasicData(department.departmentCompany)}" />
-                                       </h:outputLink>
-
-                                       <h:outputText value="#{beanHelper.renderBasicData(department.departmentCompany)}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty department.departmentCompany.companyWebsiteUrl}" />
+                                       <p:link
+                                               outcome="admin_show_basic_data"
+                                               value="#{beanHelper.renderBasicData(department.departmentCompany, true)}"
+                                               title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                               >
+                                               <f:param name="basicDataId" value="#{department.departmentCompany.basicDataId}" />
+                                       </p:link>
                                </p:column>
 
                                <p:column headerText="#{msg.ADMIN_ASSIGNED_BRANCH_OFFICE}" sortBy="#{department.departmentBranchOffice}" filterBy="#{department.departmentBranchOffice}" filterMatchMode="in">
index b2e7f4f87c0a2334fd323be4faa6042ef3a32ffd..5d16be5f687562eb028a503c5379573b8b8736b2 100644 (file)
                                                                value="#{basicDataListController.allBasicData}"
                                                                var="basicData"
                                                                itemValue="#{basicData}"
-                                                               itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                                               itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <h:outputLink value="#{employee.employeeBasicData.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty employee.employeeBasicData.companyWebsiteUrl}">
-                                               <h:outputText value="#{beanHelper.renderBasicData(employee.employeeBasicData)}" />
-                                       </h:outputLink>
-
-                                       <h:outputText value="#{beanHelper.renderBasicData(employee.employeeBasicData)}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty employee.employeeBasicData.companyWebsiteUrl}" />
+                                       <p:link
+                                               outcome="admin_show_basic_data"
+                                               value="#{beanHelper.renderBasicData(employee.employeeBasicData, true)}"
+                                               title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                               >
+                                               <f:param name="basicDataId" value="#{employee.employeeBasicData.basicDataId}" />
+                                       </p:link>
                                </p:column>
 
                                <p:column headerText="#{msg.DATA_EMAIL_ADDRESS}" sortBy="#{employee.employeeEmailAddress}" filterBy="#{employee.employeeEmailAddress}" filterMatchMode="contains">