]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Continued with data export with PrimeFaces:
authorRoland Häder <roland@mxchange.org>
Fri, 20 May 2016 10:32:12 +0000 (12:32 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 21 May 2016 12:36:41 +0000 (14:36 +0200)
- added prime faces 5.3 to project
- added admin_contact_export.xhtml with navigation rule to export contact data (currently only CSV but e.g. Excel is easy to add)
- added missing contact i18n and export string
- added controller methods generatePhoneNumber() and generateCellphoneNumber(), if e.g. ui:fragment is used, an object id instead of the phone numbers is shown. Maybe a bug in PrimeFaces or wrong usage of ui:fragment? Sometimes a POJO property like contactFaxNumber can be null. Then this needs to be taken care of.

Signed-off-by: Roland Häder <roland@mxchange.org>
13 files changed:
lib/nblibraries.properties
lib/primefaces/primefaces-5.3.jar [new file with mode: 0644]
nbproject/build-impl.xml
nbproject/faces-config.NavData
nbproject/project.properties
nbproject/project.xml
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/faces-config.xml
web/WEB-INF/templates/admin/admin_menu.tpl
web/admin/contact/admin_contact_export.xhtml [new file with mode: 0644]

index 6d0afb59d64978f1c42b37eda93de4d6acaa674c..15ca34e36d020a5631209c7c8ec9d0486820c6cd 100644 (file)
@@ -2,3 +2,8 @@ libs.CopyLibs.classpath=\
     ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
 libs.CopyLibs.displayName=CopyLibs Task
 libs.CopyLibs.prop-version=2.0
+libs.primefaces.classpath=\
+    ${base}/primefaces/primefaces-5.3.jar
+libs.primefaces.displayName=PrimeFaces 5.3
+libs.primefaces.prop-maven-dependencies=\n                org.primefaces:primefaces:5.3:jar\n
+libs.primefaces.prop-maven-repositories=default:http://repository.primefaces.org/
diff --git a/lib/primefaces/primefaces-5.3.jar b/lib/primefaces/primefaces-5.3.jar
new file mode 100644 (file)
index 0000000..6865631
Binary files /dev/null and b/lib/primefaces/primefaces-5.3.jar differ
index a7d5ecdafc22bf1826817ba1ec6c329f6462ed41..943c684b25b19b54699888bcaede717831ea11cf 100644 (file)
@@ -821,9 +821,9 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
     <target name="-init-taskdefs">
         <fail unless="libs.CopyLibs.classpath">
 The libs.CopyLibs.classpath property is not set up.
-This property must point to 
+This property must point to
 org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
-of NetBeans IDE installation and is usually located at 
+of NetBeans IDE installation and is usually located at
 &lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
 Either open the project in the IDE and make sure CopyLibs library
 exists or setup the property manually. For example like this:
@@ -1056,6 +1056,7 @@ exists or setup the property manually. For example like this:
         <copyfiles files="${file.reference.jaddressbook-lib.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.addressbook-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${reference.addressbook-mailer.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${libs.primefaces.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <mkdir dir="${build.web.dir}/META-INF"/>
         <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
     </target>
@@ -1074,6 +1075,7 @@ exists or setup the property manually. For example like this:
         <copyfiles files="${file.reference.jaddressbook-lib.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.addressbook-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${reference.addressbook-mailer.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${libs.primefaces.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
     </target>
     <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
         <delete dir="${build.web.dir}/WEB-INF/lib"/>
@@ -1386,7 +1388,7 @@ exists or setup the property manually. For example like this:
     </target>
     <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
     <!--
-                
+
                 TEST COMPILATION SECTION
             -->
     <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
@@ -1425,7 +1427,7 @@ exists or setup the property manually. For example like this:
     </target>
     <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
     <!--
-                
+
                 TEST EXECUTION SECTION
             -->
     <target depends="init" if="have.tests" name="-pre-test-run">
@@ -1461,7 +1463,7 @@ exists or setup the property manually. For example like this:
     </target>
     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
     <!--
-                
+
                 TEST DEBUGGING SECTION
             -->
     <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
@@ -1483,7 +1485,7 @@ exists or setup the property manually. For example like this:
     </target>
     <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
     <!--
-                
+
                 CLEANUP SECTION
             -->
     <target depends="init" name="deps-clean" unless="no.deps">
index 2da090e4faff12c8bd8d52e4a638a8dd33ff53be..3407e86f989c029ef556717baebf76c4adb94346 100644 (file)
@@ -3,68 +3,69 @@
     <Scope Scope="Faces Configuration Only"/>
     <Scope Scope="Project">
         <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="1900" y="600" zoom="true"/>
-        <Node id="admin/contact/admin_contact_show.xhtml" x="150" y="750" zoom="true"/>
-        <Node id="privacy.xhtml" x="900" y="450" zoom="true"/>
-        <Node id="guest/user/show_addressbook.xhtml" x="650" y="150" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="400" y="750" zoom="true"/>
-        <Node id="admin/user/admin_user_show.xhtml" x="1900" y="300" zoom="true"/>
-        <Node id="admin/index.xhtml" x="150" y="450" zoom="true"/>
-        <Node id="user/login_own_addressbooks.xhtml" x="1150" y="1050" zoom="true"/>
-        <Node id="user/login_user_data_saved.xhtml" x="1150" y="900" zoom="true"/>
-        <Node id="user/index.xhtml" x="2400" y="300" zoom="true"/>
-        <Node id="admin/admin_logout.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="user/login_data_saved.xhtml" x="900" y="1200" zoom="true"/>
-        <Node id="admin/user/admin_user_unlock.xhtml" x="1150" y="300" zoom="true"/>
-        <Node id="user/login_other_addressbooks.xhtml" x="1150" y="450" zoom="true"/>
-        <Node id="user/login_start_sharing_addressbook.xhtml" x="650" y="900" zoom="true"/>
-        <Node id="index.xhtml" x="650" y="300" zoom="true"/>
-        <Node id="guest/user/user_list.xhtml" x="1650" y="150" zoom="true"/>
-        <Node id="user/login_edit_user_data.xhtml" x="900" y="1050" zoom="true"/>
-        <Node id="admin/admin_category_delete.xhtml" x="900" y="150" zoom="true"/>
-        <Node id="*" x="1150" y="150" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="150" y="900" zoom="true"/>
-        <Node id="user/login_index.xhtml" x="150" y="1050" zoom="true"/>
-        <Node id="guest/user/lost_passwd.xhtml" x="650" y="1200" zoom="true"/>
-        <Node id="guest/user/register_done.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="guest/user/show_addressbook_entries.xhtml" x="650" y="450" zoom="true"/>
-        <Node id="user/login.xhtml" x="150" y="1500" zoom="true"/>
-        <Node id="admin/country/admin_country_list.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="400" y="900" zoom="true"/>
-        <Node id="login/login_edit_user_data.xhtml" x="1400" y="600" zoom="true"/>
-        <Node id="guest/user/login_error.xhtml" x="400" y="1200" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="150" y="1200" zoom="true"/>
-        <Node id="user/login_change_password.xhtml" x="1650" y="300" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="1400" y="750" zoom="true"/>
-        <Node id="guest/user/user_profile.xhtml" x="1400" y="150" zoom="true"/>
-        <Node id="guest/user/confirm_account.xhtml" x="1650" y="750" zoom="true"/>
-        <Node id="exception.xhtml" x="150" y="300" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="900" y="300" zoom="true"/>
-        <Node id="user/login_list_sharing_addressbooks.xhtml" x="1400" y="450" zoom="true"/>
-        <Node id="admin/user/admin_user_delete.xhtml" x="900" y="750" zoom="true"/>
-        <Node id="login/login_index.xhtml" x="900" y="600" zoom="true"/>
-        <Node id="guest/user/register_page2.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="admin/user/admin_user_edit.xhtml" x="650" y="750" zoom="true"/>
-        <Node id="terms.xhtml" x="1150" y="600" zoom="true"/>
-        <Node id="admin/contact/admin_contact_list.xhtml" x="650" y="600" zoom="true"/>
-        <Node id="admin/contact/admin_contact_edit.xhtml" x="400" y="1050" zoom="true"/>
-        <Node id="admin/user/admin_user_list.xhtml" x="1650" y="450" zoom="true"/>
-        <Node id="admin/country/admin_country_delete.xhtml" x="2150" y="450" zoom="true"/>
-        <Node id="user/login_change_personal_data.xhtml" x="400" y="1350" zoom="true"/>
-        <Node id="admin/country/admin_country_edit.xhtml" x="2400" y="150" zoom="true"/>
-        <Node id="logout.xhtml" x="2150" y="300" zoom="true"/>
-        <Node id="user/login_add_addressbook.xhtml" x="400" y="150" zoom="true"/>
-        <Node id="guest/user/resend_link.xhtml" x="400" y="450" zoom="true"/>
-        <Node id="user/login_contact_data_saved.xhtml" x="900" y="900" zoom="true"/>
-        <Node id="admin/contact/admin_contact_delete.xhtml" x="150" y="600" zoom="true"/>
-        <Node id="user/user_profile.xhtml" x="1650" y="600" zoom="true"/>
-        <Node id="imprint.xhtml" x="1400" y="900" zoom="true"/>
-        <Node id="user/login_shared_addressbooks.xhtml" x="1150" y="750" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="650" y="1050" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="2650" y="150" zoom="true"/>
-        <Node id="guest/user/login.xhtml" x="1900" y="150" zoom="true"/>
-        <Node id="admin/admin_product_delete.xhtml" x="150" y="1350" zoom="true"/>
-        <Node id="guest/user/register.xhtml" x="2150" y="150" zoom="true"/>
-        <Node id="user/login_change_email_address.xhtml" x="1900" y="450" zoom="true"/>
+        <Node id="admin/contact/admin_contact_show.xhtml" x="400" y="1350" zoom="true"/>
+        <Node id="privacy.xhtml" x="900" y="600" zoom="true"/>
+        <Node id="guest/user/show_addressbook.xhtml" x="2400" y="150" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="2400" y="300" zoom="true"/>
+        <Node id="admin/user/admin_user_show.xhtml" x="650" y="750" zoom="true"/>
+        <Node id="admin/index.xhtml" x="1400" y="600" zoom="true"/>
+        <Node id="user/login_own_addressbooks.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="user/login_user_data_saved.xhtml" x="400" y="1200" zoom="true"/>
+        <Node id="user/index.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
+        <Node id="user/login_data_saved.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="admin/user/admin_user_unlock.xhtml" x="900" y="900" zoom="true"/>
+        <Node id="user/login_other_addressbooks.xhtml" x="650" y="1200" zoom="true"/>
+        <Node id="user/login_start_sharing_addressbook.xhtml" x="150" y="750" zoom="true"/>
+        <Node id="guest/user/user_list.xhtml" x="150" y="1350" zoom="true"/>
+        <Node id="index.xhtml" x="1150" y="1050" zoom="true"/>
+        <Node id="user/login_edit_user_data.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="*" x="650" y="1050" zoom="true"/>
+        <Node id="admin/admin_category_delete.xhtml" x="1650" y="600" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="650" y="900" zoom="true"/>
+        <Node id="user/login_index.xhtml" x="1650" y="750" zoom="true"/>
+        <Node id="guest/user/lost_passwd.xhtml" x="1150" y="600" zoom="true"/>
+        <Node id="guest/user/register_done.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="guest/user/show_addressbook_entries.xhtml" x="900" y="300" zoom="true"/>
+        <Node id="user/login.xhtml" x="650" y="600" zoom="true"/>
+        <Node id="admin/country/admin_country_list.xhtml" x="1150" y="150" zoom="true"/>
+        <Node id="login/login_edit_user_data.xhtml" x="1150" y="900" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="900" y="1050" zoom="true"/>
+        <Node id="guest/user/login_error.xhtml" x="900" y="750" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="150" y="1050" zoom="true"/>
+        <Node id="user/login_change_password.xhtml" x="900" y="1200" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="1150" y="450" zoom="true"/>
+        <Node id="admin/contact/admin_contact_export.xhtml" x="1400" y="900" zoom="true"/>
+        <Node id="guest/user/user_profile.xhtml" x="1650" y="450" zoom="true"/>
+        <Node id="guest/user/confirm_account.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="exception.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="1400" y="450" zoom="true"/>
+        <Node id="admin/user/admin_user_delete.xhtml" x="1150" y="750" zoom="true"/>
+        <Node id="user/login_list_sharing_addressbooks.xhtml" x="2150" y="300" zoom="true"/>
+        <Node id="login/login_index.xhtml" x="2150" y="150" zoom="true"/>
+        <Node id="admin/user/admin_user_edit.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="guest/user/register_page2.xhtml" x="1900" y="300" zoom="true"/>
+        <Node id="terms.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="admin/contact/admin_contact_list.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="admin/contact/admin_contact_edit.xhtml" x="650" y="1350" zoom="true"/>
+        <Node id="admin/user/admin_user_list.xhtml" x="400" y="600" zoom="true"/>
+        <Node id="admin/country/admin_country_delete.xhtml" x="400" y="1050" zoom="true"/>
+        <Node id="user/login_change_personal_data.xhtml" x="2150" y="450" zoom="true"/>
+        <Node id="admin/country/admin_country_edit.xhtml" x="900" y="450" zoom="true"/>
+        <Node id="logout.xhtml" x="400" y="900" zoom="true"/>
+        <Node id="user/login_add_addressbook.xhtml" x="1650" y="150" zoom="true"/>
+        <Node id="guest/user/resend_link.xhtml" x="150" y="1500" zoom="true"/>
+        <Node id="user/login_contact_data_saved.xhtml" x="150" y="900" zoom="true"/>
+        <Node id="user/user_profile.xhtml" x="1900" y="150" zoom="true"/>
+        <Node id="admin/contact/admin_contact_delete.xhtml" x="2650" y="150" zoom="true"/>
+        <Node id="imprint.xhtml" x="1400" y="750" zoom="true"/>
+        <Node id="user/login_shared_addressbooks.xhtml" x="1900" y="450" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="150" y="1200" zoom="true"/>
+        <Node id="guest/user/login.xhtml" x="1400" y="300" zoom="true"/>
+        <Node id="admin/admin_product_delete.xhtml" x="1650" y="300" zoom="true"/>
+        <Node id="guest/user/register.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="user/login_change_email_address.xhtml" x="900" y="150" zoom="true"/>
     </Scope>
     <Scope Scope="All Faces Configurations"/>
 </Scene>
index 284697218728e2a232ff1514d0051d3d2bb0a983..7655b264ac453e539e50af15b7d4cbb0142999fe 100644 (file)
@@ -82,7 +82,8 @@ javac.classpath=\
     ${reference.addressbook-lib.jar}:\
     ${reference.addressbook-mailer.jar}:\
     ${file.reference.cdi-api.jar}:\
-    ${file.reference.gf-client.jar}
+    ${file.reference.gf-client.jar}:\
+    ${libs.primefaces.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
 javac.debug=true
index 82c00c24bb1cd5e526b8144deb7ee9b6bd79097f..f5d968e651e94ddb845b8302f7fcdf6291883f62 100644 (file)
                 <library dirs="200">
                     <file>${file.reference.gf-client.jar}</file>
                 </library>
+                <library dirs="200">
+                    <file>${libs.primefaces.classpath}</file>
+                    <path-in-war>WEB-INF/lib</path-in-war>
+                </library>
             </web-module-libraries>
             <web-module-additional-libraries/>
             <source-roots>
index cd91f9a2752f7e7c29eab96e6c19c189e7d0476d..d912dbbeff67b7c0c509092a0a7f4cf060830ae6 100644 (file)
@@ -42,6 +42,7 @@ import org.mxchange.jcontacts.events.contact.update.AdminContactUpdatedEvent;
 import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.phonenumbers.DialableNumber;
 import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
@@ -410,6 +411,46 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                return "admin_list_contact"; //NOI18N
        }
 
+       @Override
+       public String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) {
+               // Is it null?
+               if (null == cellphoneNumber) {
+                       // Return null
+                       return null;
+               }
+
+               // Get all data
+               String number = String.format(
+                          "%s%d%d", //NOI18N
+                          cellphoneNumber.getCellphoneProvider().getProviderCountry().getCountryExternalDialPrefix(),
+                          cellphoneNumber.getCellphoneProvider().getProviderDialPrefix(),
+                          cellphoneNumber.getPhoneNumber()
+          );
+
+               // Return it
+               return number;
+       }
+
+       @Override
+       public String generatePhoneNumber (final DialableNumber phoneNumber) {
+               // Is it null?
+               if (null == phoneNumber) {
+                       // Return null
+                       return null;
+               }
+
+               // Generate it
+               String number = String.format(
+                          "%s%d%d", //NOI18N
+                          phoneNumber.getPhoneCountry().getCountryExternalDialPrefix(),
+                          phoneNumber.getPhoneAreaCode(),
+                          phoneNumber.getPhoneNumber()
+          );
+
+               // Return it
+               return number;
+       }
+
        @Override
        @SuppressWarnings ("ReturnOfDateField")
        public Date getBirthday () {
index 17da4a01b8b0bdae00b2b2ecb712849f3c597b7a..4e4a7d89782c328dd7d8936e261c880bff03e836 100644 (file)
@@ -21,6 +21,8 @@ import java.util.Date;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.phonenumbers.DialableNumber;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
@@ -381,4 +383,23 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
         */
        void setZipCode (final Integer zipCode);
 
+       /**
+        * Returns a text respresentation of given phone number or null if not set.
+        * <p>
+        * @param phoneNumber Phone number
+        * <p>
+        * @return Text respresentation or null
+        */
+       String generatePhoneNumber (final DialableNumber phoneNumber);
+
+       /**
+        * Returns a text representation of given cellphone number or null if not
+        * set.
+        * <p>
+        * @param cellphoneNumber Cellphone number
+        * <p>
+        * @return Text respresentation or null
+        */
+       String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber);
+
 }
index 93bc22fbaf980e0dfcffe7b56ca4eb98abf680ce..74ff692782ef4d1b109b188b10c47249b040ca21 100644 (file)
@@ -540,3 +540,14 @@ BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Account best\u00e4tigen
 ADMIN_MENU_CONTACT_TITLE=Manage contact data
 LINK_ADMIN_LIST_CONTACT=Kontaktdaten auflisten
 LINK_ADMIN_LIST_CONTACT_TITLE=Listet alle Kontaktdaten auf, egal wo her sie angelegt wurden.
+ADMIN_CONTACT_COUNTRY_CODE=L\u00e4ndercode:
+ADMIN_CONTACT_CELLPHONE_NUMBER=Handynummer:
+ADMIN_CONTACT_LANDLINE_NUMBER=Telefonnummer:
+ADMIN_CONTACT_FAX_NUMBER=Faxnummer:
+PAGE_TITLE_ADMIN_EXPORT_CONTACT=Kontaktdaten exportieren
+CONTENT_TITLE_ADMIN_EXPORT_CONTACT=Kontaktdaten exportieren:
+ADMIN_EXPORT_CONTACTS_TITLE=Datenexport starten
+ADMIN_EXPORT_CONTACTS_TIMEOUT_WARNING=Bei sehr gro\u00dfen Datenmengen kann es eventuell zu Zeit\u00fcberschreitungen kommen. Daher sollten Sie besser seitenweise exportieren.
+BUTTON_ADMIN_EXPORT_CONTACTS_CSV=Alle Daten als CSV-Datei exportieren
+LINK_ADMIN_EXPORT_CONTACT=Daten exportieren
+LINK_ADMIN_EXPORT_CONTACT_TITLE=Kontaktdaten exportieren
index 12ab7824c2d831e3c6c3edfc9a9c66369dc57306..56efcee8d0e133c6d84db0815db94b60d8b8e38b 100644 (file)
@@ -537,3 +537,15 @@ BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Confirm account
 ADMIN_MENU_CONTACT_TITLE=Manage contact data
 LINK_ADMIN_LIST_CONTACT=List contact data
 LINK_ADMIN_LIST_CONTACT_TITLE=Lists all contact data regardless where they was created.
+ADMIN_CONTACT_COUNTRY_CODE=Country code:
+ADMIN_CONTACT_CELLPHONE_NUMBER=Cellphone number:
+ADMIN_CONTACT_LANDLINE_NUMBER=Phone number:
+ADMIN_CONTACT_FAX_NUMBER=Fax number:
+PAGE_TITLE_ADMIN_EXPORT_CONTACT=Export contact data
+CONTENT_TITLE_ADMIN_EXPORT_CONTACT=Export contact data:
+ADMIN_EXPORT_CONTACTS_TITLE=Start data export
+#Bei sehr gro\u00dfen Datenmengen kann es eventuell zu Zeit\u00fcberschreitungen kommen. Daher sollten Sie besser seitenweise exportieren.
+ADMIN_EXPORT_CONTACTS_TIMEOUT_WARNING=Big data amount may lead to timeouts. You should then try to export each page separately.
+BUTTON_ADMIN_EXPORT_CONTACTS_CSV=Export all data as CSV file
+LINK_ADMIN_EXPORT_CONTACT=Export data
+LINK_ADMIN_EXPORT_CONTACT_TITLE=Export contact data
index 89624e7a91485f6a1127bc2773c25aa20b868bf4..a18ce4c7b310c6368d2e12cacc387411b27ba3cc 100644 (file)
                        <from-outcome>admin_list_contact</from-outcome>
                        <to-view-id>/admin/contact/admin_contact_list.xhtml</to-view-id>
                </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_export_contact</from-outcome>
+                       <to-view-id>/admin/contact/admin_contact_export.xhtml</to-view-id>
+               </navigation-case>
                <navigation-case>
                        <from-outcome>admin_list_user</from-outcome>
                        <to-view-id>/admin/user/admin_user_list.xhtml</to-view-id>
index 8f7fa3ffebcffcd4ef418e5f30706b301f40cf1d..c9de554d5e9dda2df976b66178965a94ac7b2771 100644 (file)
                                <li><h:link title="#{msg.LINK_ADMIN_LIST_USER_TITLE}" outcome="admin_list_user" value="#{msg.LINK_ADMIN_LIST_USER}" /></li>
                        </ul>
 
+                       <div class="menu_header">
+                               #{msg.ADMIN_MENU_CONTACT_TITLE}
+                       </div>
+
+                       <ul>
+                               <li><h:link title="#{msg.LINK_ADMIN_LIST_CONTACT_TITLE}" outcome="admin_list_contact" value="#{msg.LINK_ADMIN_LIST_CONTACT}" /></li>
+                               <li><h:link title="#{msg.LINK_ADMIN_EXPORT_CONTACT_TITLE}" outcome="admin_export_contact" value="#{msg.LINK_ADMIN_EXPORT_CONTACT}" /></li>
+                       </ul>
+
                        <div class="menu_header">
                                #{msg.ADMIN_MENU_COUNTRY_TITLE}
                        </div>
diff --git a/web/admin/contact/admin_contact_export.xhtml b/web/admin/contact/admin_contact_export.xhtml
new file mode 100644 (file)
index 0000000..91b6c58
--- /dev/null
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+       lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+
+       xmlns:p="http://primefaces.org/ui">
+
+       <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
+               <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_EXPORT_CONTACT}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_ADMIN_EXPORT_CONTACT}
+               </ui:define>
+
+               <ui:define name="content">
+                       <h:form id="form_export_contacts">
+                               <p:dataTable id="table_export_contacts" var="contact" value="#{contactController.allContacts()}" tableStyleClass="table_big" paginator="true" rows="10" summary="#{msg.TABLE_SUMMARY_ADMIN_EXPORT_CONTACT}" rendered="#{contactController.hasContacts()}">
+                                       <p:column exportable="false">
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_ID}" />
+                                               </f:facet>
+
+                                               <h:link outcome="admin_show_contact" title="#{msg.ADMIN_LINK_SHOW_CONTACT_TITLE}" value="#{contact.contactId}">
+                                                       <f:param name="contactId" value="#{contact.contactId}" />
+                                               </h:link>
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_GENDER}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{msg[contact.contactGender.messageKey]}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_TITLE}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactTitle}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactFirstName}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactFamilyName}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_STREET}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactStreet}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_HOUSE_NUMBER}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactHouseNumber}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_COUNTRY_CODE}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactCountry.countryCode}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_ZIP_CODE}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactZipCode}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_CITY}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactCity}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_EMAIL_ADDRESS}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{contact.contactEmailAddress}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_CELLPHONE_NUMBER}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{adminContactController.generateCellphoneNumber(contact.contactCellphoneNumber)}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_LANDLINE_NUMBER}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{adminContactController.generatePhoneNumber(contact.contactLandLineNumber)}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_FAX_NUMBER}" />
+                                               </f:facet>
+
+                                               <h:outputText value="#{adminContactController.generatePhoneNumber(contact.contactFaxNumber)}" />
+                                       </p:column>
+
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_CREATED}" />
+                                               </f:facet>
+
+                                               <h:outputText id="contactCreated" value="#{contact.contactCreated.time}">
+                                                       <f:convertDateTime for="contactCreated" type="both" timeStyle="short" dateStyle="short" />
+                                               </h:outputText>
+                                       </p:column>
+                               </p:dataTable>
+
+                               <div class="table_medium">
+                                       <div class="table_header">
+                                               #{msg.ADMIN_EXPORT_CONTACTS_TITLE}
+                                       </div>
+
+                                       <div class="para">
+                                               <h:outputText value="#{msg.ADMIN_EXPORT_CONTACTS_TIMEOUT_WARNING}" />
+                                       </div>
+
+                                       <div class="table_footer">
+                                               <h:commandButton styleClass="submit" type="submit" id="export_contacts" value="#{msg.BUTTON_ADMIN_EXPORT_CONTACTS_CSV}">
+                                                       <p:dataExporter type="csv" target="table_export_contacts" fileName="all_contacts" />
+                                               </h:commandButton>
+                                       </div>
+                               </div>
+                       </h:form>
+               </ui:define>
+       </ui:composition>
+</html>