]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 27 Aug 2017 13:21:06 +0000 (15:21 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 27 Aug 2017 13:21:06 +0000 (15:21 +0200)
- converted administrative fax, land-line and mobile number data templates as
  custom JSF tags, having again more type-safe tags instead of outputting
  messages on missing bean properties

Signed-off-by: Roland Häder <roland@mxchange.org>
web/WEB-INF/resources/tags/admin/form_data/fax/admin_form_fax_data.tpl [new file with mode: 0644]
web/WEB-INF/resources/tags/admin/form_data/landline/admin_form_landline_data.tpl [new file with mode: 0644]
web/WEB-INF/resources/tags/admin/form_data/mobile/admin_form_mobile_data.tpl [new file with mode: 0644]
web/WEB-INF/templates/admin/fax/admin_form_fax_data.tpl [deleted file]
web/WEB-INF/templates/admin/landline/admin_form_landline_data.tpl [deleted file]
web/WEB-INF/templates/admin/mobile/admin_form_mobile_data.tpl [deleted file]
web/WEB-INF/widgets.jsf.taglib.xml
web/admin/fax/admin_fax_edit.xhtml
web/admin/landline/admin_landline_edit.xhtml
web/admin/mobile/admin_mobile_edit.xhtml

diff --git a/web/WEB-INF/resources/tags/admin/form_data/fax/admin_form_fax_data.tpl b/web/WEB-INF/resources/tags/admin/form_data/fax/admin_form_fax_data.tpl
new file mode 100644 (file)
index 0000000..4d773ad
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+       <h:panelGroup styleClass="para" layout="block" rendered="#{empty rendered or rendered}">
+               <fieldset class="fieldset" id="fax_data">
+                       <legend title="#{msg.ADMIN_FAX_NUMBER_DATA_LEGEND_TITLE}">
+                               <h:outputText value="#{msg.ADMIN_FAX_NUMBER_DATA_LEGEND}" />
+                       </legend>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="faxNumberId" value="#{msg.ADMIN_SHOW_PHONE_ID}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:outputText id="faxNumberId" value="#{faxNumber.phoneId}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <widgets:outputFaxInputTableRow targetController="#{adminPhoneController}" labelMessage="#{msg.ADMIN_EDIT_FAX_NUMBER}" />
+               </fieldset>
+       </h:panelGroup>
+</ui:composition>
diff --git a/web/WEB-INF/resources/tags/admin/form_data/landline/admin_form_landline_data.tpl b/web/WEB-INF/resources/tags/admin/form_data/landline/admin_form_landline_data.tpl
new file mode 100644 (file)
index 0000000..8461e52
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+       <h:panelGroup styleClass="para" layout="block" rendered="#{empty rendered or rendered}">
+               <fieldset class="fieldset" id="landline_data">
+                       <legend title="#{msg.ADMIN_LAND_LINE_NUMBER_DATA_LEGEND_TITLE}">
+                               <h:outputText value="#{msg.ADMIN_LAND_LINE_NUMBER_DATA_LEGEND}" />
+                       </legend>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="landLineNumberId" value="#{msg.ADMIN_SHOW_PHONE_ID}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:outputText id="landLineNumberId" value="#{landLineNumber.phoneId}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <widgets:outputLandLineInputTableRow targetController="#{adminPhoneController}" labelMessage="#{msg.ADMIN_EDIT_LAND_LINE_NUMBER}" />
+               </fieldset>
+       </h:panelGroup>
+</ui:composition>
diff --git a/web/WEB-INF/resources/tags/admin/form_data/mobile/admin_form_mobile_data.tpl b/web/WEB-INF/resources/tags/admin/form_data/mobile/admin_form_mobile_data.tpl
new file mode 100644 (file)
index 0000000..6e454c1
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+       <h:panelGroup styleClass="para" layout="block" rendered="#{empty rendered or rendered}">
+               <fieldset class="fieldset" id="mobile_data">
+                       <legend title="#{msg.ADMIN_MOBILE_NUMBER_DATA_LEGEND_TITLE}">
+                               <h:outputText value="#{msg.ADMIN_MOBILE_NUMBER_DATA_LEGEND}" />
+                       </legend>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="mobileNumberId" value="#{msg.ADMIN_SHOW_PHONE_ID}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:outputText id="mobileNumberId" value="#{mobileNumber.phoneId}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="mobileProvider" value="#{msg.ADMIN_EDIT_MOBILE_PROVIDER}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:selectOneMenu styleClass="select" id="mobileProvider" value="#{adminPhoneController.mobileProvider}" required="true" requiredMessage="#{msg.ADMIN_MOBILE_PROVIDER_REQUIRED}">
+                                               <f:converter converterId="MobileProviderConverter" />
+                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                               <f:selectItems value="#{mobileProviderController.allMobileProviders()}" var="mobileProvider" itemValue="#{mobileProvider}" itemLabel="#{mobileProvider.providerCountry.countryExternalDialPrefix}#{mobileProvider.providerDialPrefix} (#{mobileProvider.providerName})" />
+                                       </h:selectOneMenu>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="mobileProvider" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="mobileNumber" value="#{msg.ADMIN_EDIT_MOBILE_NUMBER}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="mobileNumber" size="10" maxlength="20" value="#{adminPhoneController.phoneNumber}" required="true" requiredMessage="#{msg.ADMIN_MOBILE_NUMBER_REQUIRED}">
+                                               <f:validator for="mobileNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="mobileNumber" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+               </fieldset>
+       </h:panelGroup>
+</ui:composition>
diff --git a/web/WEB-INF/templates/admin/fax/admin_form_fax_data.tpl b/web/WEB-INF/templates/admin/fax/admin_form_fax_data.tpl
deleted file mode 100644 (file)
index 78e7d6e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
-       xmlns:f="http://java.sun.com/jsf/core"
-       xmlns:h="http://java.sun.com/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
-
-       <widgets:outputMessageBox message="#{msg.ERROR_BEAN_HELPER_FAX_NUMBER_NOT_SET}" messageStyleClass="alert-danger" rendered="#{empty beanHelper.faxNumber}" />
-
-       <h:panelGroup styleClass="para" layout="block" rendered="#{not empty beanHelper.faxNumber}">
-               <fieldset class="fieldset" id="fax_data">
-                       <legend title="#{msg.ADMIN_FAX_NUMBER_DATA_LEGEND_TITLE}">
-                               <h:outputText value="#{msg.ADMIN_FAX_NUMBER_DATA_LEGEND}" />
-                       </legend>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="faxNumberId" value="#{msg.ADMIN_SHOW_PHONE_ID}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:outputText id="faxNumberId" value="#{beanHelper.faxNumber.phoneId}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <widgets:outputFaxInputTableRow targetController="#{adminPhoneController}" labelMessage="#{msg.ADMIN_EDIT_FAX_NUMBER}" />
-               </fieldset>
-       </h:panelGroup>
-</ui:composition>
diff --git a/web/WEB-INF/templates/admin/landline/admin_form_landline_data.tpl b/web/WEB-INF/templates/admin/landline/admin_form_landline_data.tpl
deleted file mode 100644 (file)
index 6c9a55a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
-       xmlns:f="http://java.sun.com/jsf/core"
-       xmlns:h="http://java.sun.com/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
-
-       <widgets:outputMessageBox message="#{msg.ERROR_BEAN_HELPER_LAND_LINE_NUMBER_NOT_SET}" messageStyleClass="alert-danger" rendered="#{empty beanHelper.landLineNumber}" />
-
-       <h:panelGroup styleClass="para" layout="block" rendered="#{not empty beanHelper.landLineNumber}">
-               <fieldset class="fieldset" id="landline_data">
-                       <legend title="#{msg.ADMIN_LAND_LINE_NUMBER_DATA_LEGEND_TITLE}">
-                               <h:outputText value="#{msg.ADMIN_LAND_LINE_NUMBER_DATA_LEGEND}" />
-                       </legend>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="landLineNumberId" value="#{msg.ADMIN_SHOW_PHONE_ID}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:outputText id="landLineNumberId" value="#{beanHelper.landLineNumber.phoneId}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <widgets:outputLandLineInputTableRow targetController="#{adminPhoneController}" labelMessage="#{msg.ADMIN_EDIT_LAND_LINE_NUMBER}" />
-               </fieldset>
-       </h:panelGroup>
-</ui:composition>
diff --git a/web/WEB-INF/templates/admin/mobile/admin_form_mobile_data.tpl b/web/WEB-INF/templates/admin/mobile/admin_form_mobile_data.tpl
deleted file mode 100644 (file)
index 9eb576d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
-       xmlns:f="http://java.sun.com/jsf/core"
-       xmlns:h="http://java.sun.com/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
-
-       <widgets:outputMessageBox message="#{msg.ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET}" messageStyleClass="alert-danger" rendered="#{empty beanHelper.mobileNumber}" />
-
-       <h:panelGroup styleClass="para" layout="block" rendered="#{not empty beanHelper.mobileNumber}">
-               <fieldset class="fieldset" id="mobile_data">
-                       <legend title="#{msg.ADMIN_MOBILE_NUMBER_DATA_LEGEND_TITLE}">
-                               <h:outputText value="#{msg.ADMIN_MOBILE_NUMBER_DATA_LEGEND}" />
-                       </legend>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="mobileNumberId" value="#{msg.ADMIN_SHOW_PHONE_ID}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:outputText id="mobileNumberId" value="#{beanHelper.mobileNumber.phoneId}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="mobileProvider" value="#{msg.ADMIN_EDIT_MOBILE_PROVIDER}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:selectOneMenu styleClass="select" id="mobileProvider" value="#{adminPhoneController.mobileProvider}" required="true" requiredMessage="#{msg.ADMIN_MOBILE_PROVIDER_REQUIRED}">
-                                               <f:converter converterId="MobileProviderConverter" />
-                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{mobileProviderController.allMobileProviders()}" var="mobileProvider" itemValue="#{mobileProvider}" itemLabel="#{mobileProvider.providerCountry.countryExternalDialPrefix}#{mobileProvider.providerDialPrefix} (#{mobileProvider.providerName})" />
-                                       </h:selectOneMenu>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="mobileProvider" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="mobileNumber" value="#{msg.ADMIN_EDIT_MOBILE_NUMBER}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="mobileNumber" size="10" maxlength="20" value="#{adminPhoneController.phoneNumber}" required="true" requiredMessage="#{msg.ADMIN_MOBILE_NUMBER_REQUIRED}">
-                                               <f:validator for="mobileNumber" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="mobileNumber" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-               </fieldset>
-       </h:panelGroup>
-</ui:composition>
index 66d02b6b45dc773f5b6374fe7851275774a57338..11287cce25ee2730cc225c3bb2f474c9365c83ba 100644 (file)
@@ -138,6 +138,57 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                        <type>java.lang.Boolean</type>
                </attribute>
        </tag>
+       <tag>
+               <tag-name>outputAdminFaxDataFormFields</tag-name>
+               <description>This tag renders a fieldset for administrative purposes of fax data.</description>
+               <source>resources/tags/admin/form_data/fax/admin_form_fax_data.tpl</source>
+               <attribute>
+                       <name>faxNumber</name>
+                       <description>The fax instance that provides the data for this tag.</description>
+                       <required>true</required>
+                       <type>org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber</type>
+               </attribute>
+               <attribute>
+                       <name>rendered</name>
+                       <description>Whether this tag is being rendered by JSF engine.</description>
+                       <required>false</required>
+                       <type>java.lang.Boolean</type>
+               </attribute>
+       </tag>
+       <tag>
+               <tag-name>outputAdminLandLineDataFormFields</tag-name>
+               <description>This tag renders a fieldset for administrative purposes of land-line data.</description>
+               <source>resources/tags/admin/form_data/landline/admin_form_landline_data.tpl</source>
+               <attribute>
+                       <name>landLineNumber</name>
+                       <description>The fax instance that provides the data for this tag.</description>
+                       <required>true</required>
+                       <type>org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber</type>
+               </attribute>
+               <attribute>
+                       <name>rendered</name>
+                       <description>Whether this tag is being rendered by JSF engine.</description>
+                       <required>false</required>
+                       <type>java.lang.Boolean</type>
+               </attribute>
+       </tag>
+       <tag>
+               <tag-name>outputAdminMobileDataFormFields</tag-name>
+               <description>This tag renders a fieldset for administrative purposes of mobile data.</description>
+               <source>resources/tags/admin/form_data/mobile/admin_form_mobile_data.tpl</source>
+               <attribute>
+                       <name>mobileNumber</name>
+                       <description>The mobile instance that provides the data for this tag.</description>
+                       <required>true</required>
+                       <type>org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber</type>
+               </attribute>
+               <attribute>
+                       <name>rendered</name>
+                       <description>Whether this tag is being rendered by JSF engine.</description>
+                       <required>false</required>
+                       <type>java.lang.Boolean</type>
+               </attribute>
+       </tag>
        <tag>
                <tag-name>outputAdminUserDataFormFields</tag-name>
                <description>This tag renders a fieldset for administrative purposes of user data.</description>
index 6d4379e1748534c0ff3fc343ac787d0731520ceb..a4107367204efca78fc0ba6aa1e131870c228f1c 100644 (file)
@@ -30,7 +30,7 @@
                                        </h:outputFormat>
                                </div>
 
-                               <ui:include src="/WEB-INF/templates/admin/fax/admin_form_fax_data.tpl" />
+                               <widgets:outputAdminFaxDataFormFields faxNumber="#{beanHelper.faxNumber}" />
 
                                <div class="table-footer">
                                        <h:commandButton styleClass="reset divider-right" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
index 1c95ee011b7455d2104bc969bf94192b6e68dad7..02715dc740124206cb2691fc0ddf37b9fc6cb7c7 100644 (file)
@@ -30,7 +30,7 @@
                                        </h:outputFormat>
                                </div>
 
-                               <ui:include src="/WEB-INF/templates/admin/landline/admin_form_landline_data.tpl" />
+                               <widgets:outputAdminLandLineDataFormFields landLineNumber="#{beanHelper.landLineNumber}" />
 
                                <div class="table-footer">
                                        <h:commandButton styleClass="reset divider-right" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
index 89558499fff89a7764da8d55a2f8594ea6a25f0f..ab3381bf059d7edc928558b5ec9552b3167495af 100644 (file)
@@ -30,7 +30,7 @@
                                        </h:outputFormat>
                                </div>
 
-                               <ui:include src="/WEB-INF/templates/admin/mobile/admin_form_mobile_data.tpl" />
+                               <widgets:outputAdminMobileDataFormFields mobileNumber="#{beanHelper.mobileNumber}" />
 
                                <div class="table-footer">
                                        <h:commandButton styleClass="reset divider-right" type="reset" value="#{msg.BUTTON_RESET_FORM}" />