<?xml version="1.0" encoding="UTF-8"?>
<project default="-deploy-ant" basedir=".">
- <target name="-init-cl-deployment-env" if="deploy.ant.enabled">
- <property file="${deploy.ant.properties.file}" />
- <available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
- <available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
- <available file="${deploy.ant.resource.dir}" property="has.setup"/>
- <tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
- <echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
- </target>
-
- <target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
- <tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
- <copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
- <!-- The doctype triggers resolution which can fail -->
- <replace file="${temp.sun.web}">
- <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
- <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
- </replace>
- <replace file="${temp.sun.web}">
- <replacetoken><![CDATA[<sun-web-app]]></replacetoken>
- <replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
- </replace>
- <xmlproperty file="${temp.sun.web}" validate="false">
- </xmlproperty>
- <delete file="${temp.sun.web}"/>
- <condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
- <isset property="sun-web-app.context-root"/>
- </condition>
- <condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
- <isset property="sun-web-app.context-root"/>
- </condition>
- </target>
- <target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
- <tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
- <copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
- <!-- The doctype triggers resolution which can fail -->
- <replace file="${temp.gf.web}">
- <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
- <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
- </replace>
- <replace file="${temp.gf.web}">
- <replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
- <replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
- </replace>
- <xmlproperty file="${temp.gf.web}" validate="false">
- </xmlproperty>
- <delete file="${temp.gf.web}"/>
- <condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
- <isset property="glassfish-web-app.context-root"/>
- </condition>
- <condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
- <isset property="glassfish-web-app.context-root"/>
- </condition>
- </target>
- <target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
- <property name="deploy.context.root.argument" value=""/>
- </target>
- <target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
- <tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
- <mkdir dir="${gfv3.resources.dir}"/>
- <mkdir dir="${gfv3.resources.dir}/META-INF"/>
- <copy todir="${gfv3.resources.dir}/META-INF">
- <fileset dir="${deploy.ant.resource.dir}"/>
- </copy>
- <jar destfile="${deploy.ant.archive}" update="true">
- <fileset dir="${gfv3.resources.dir}"/>
- </jar>
- <delete dir="${gfv3.resources.dir}"/>
- </target>
- <target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
- <antcall target="-deploy-without-pw"/>
- <antcall target="-deploy-with-pw"/>
- </target>
+ <target name="-init-cl-deployment-env" if="deploy.ant.enabled">
+ <property file="${deploy.ant.properties.file}" />
+ <available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
+ <available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
+ <available file="${deploy.ant.resource.dir}" property="has.setup"/>
+ <tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
+ <echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
+ </target>
- <target name="-deploy-without-pw" unless="gfv3.password">
- <echo message="Deploying ${deploy.ant.archive}"/>
- <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
- <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
- <get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}"
- dest="${gfv3.results.file}"/>
- <delete file="${gfv3.results.file}"/>
- </target>
- <target name="-deploy-with-pw" if="gfv3.password">
- <echo message="Deploying ${deploy.ant.archive}"/>
- <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
- <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
- <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}"
- dest="${gfv3.results.file}"/>
- <delete file="${gfv3.results.file}"/>
- </target>
- <target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
- <antcall target="-undeploy-without-pw"/>
- <antcall target="-undeploy-with-pw"/>
- </target>
+ <target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
+ <tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
+ <copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
+ <!-- The doctype triggers resolution which can fail -->
+ <replace file="${temp.sun.web}">
+ <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
+ <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
+ </replace>
+ <replace file="${temp.sun.web}">
+ <replacetoken><![CDATA[<sun-web-app]]></replacetoken>
+ <replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
+ </replace>
+ <xmlproperty file="${temp.sun.web}" validate="false">
+ </xmlproperty>
+ <delete file="${temp.sun.web}"/>
+ <condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
+ <isset property="sun-web-app.context-root"/>
+ </condition>
+ <condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
+ <isset property="sun-web-app.context-root"/>
+ </condition>
+ </target>
+ <target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
+ <tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
+ <copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
+ <!-- The doctype triggers resolution which can fail -->
+ <replace file="${temp.gf.web}">
+ <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
+ <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
+ </replace>
+ <replace file="${temp.gf.web}">
+ <replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
+ <replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
+ </replace>
+ <xmlproperty file="${temp.gf.web}" validate="false">
+ </xmlproperty>
+ <delete file="${temp.gf.web}"/>
+ <condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
+ <isset property="glassfish-web-app.context-root"/>
+ </condition>
+ <condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
+ <isset property="glassfish-web-app.context-root"/>
+ </condition>
+ </target>
+ <target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
+ <property name="deploy.context.root.argument" value=""/>
+ </target>
+ <target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
+ <tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
+ <mkdir dir="${gfv3.resources.dir}"/>
+ <mkdir dir="${gfv3.resources.dir}/META-INF"/>
+ <copy todir="${gfv3.resources.dir}/META-INF">
+ <fileset dir="${deploy.ant.resource.dir}"/>
+ </copy>
+ <jar destfile="${deploy.ant.archive}" update="true">
+ <fileset dir="${gfv3.resources.dir}"/>
+ </jar>
+ <delete dir="${gfv3.resources.dir}"/>
+ </target>
+ <target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
+ <antcall target="-deploy-without-pw"/>
+ <antcall target="-deploy-with-pw"/>
+ </target>
- <target name="-undeploy-without-pw" unless="gfv3.password">
- <echo message="Undeploying ${deploy.ant.archive}"/>
- <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
- <get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
- dest="${gfv3.results.file}"/>
- <delete file="${gfv3.results.file}"/>
- </target>
- <target name="-undeploy-with-pw" if="gfv3.password">
- <echo message="Undeploying ${deploy.ant.archive}"/>
- <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
- <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
- dest="${gfv3.results.file}"/>
- <delete file="${gfv3.results.file}"/>
- </target>
+ <target name="-deploy-without-pw" unless="gfv3.password">
+ <echo message="Deploying ${deploy.ant.archive}"/>
+ <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
+ <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
+ <get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}"
+ dest="${gfv3.results.file}"/>
+ <delete file="${gfv3.results.file}"/>
+ </target>
+ <target name="-deploy-with-pw" if="gfv3.password">
+ <echo message="Deploying ${deploy.ant.archive}"/>
+ <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
+ <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
+ <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}"
+ dest="${gfv3.results.file}"/>
+ <delete file="${gfv3.results.file}"/>
+ </target>
+ <target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
+ <antcall target="-undeploy-without-pw"/>
+ <antcall target="-undeploy-with-pw"/>
+ </target>
+
+ <target name="-undeploy-without-pw" unless="gfv3.password">
+ <echo message="Undeploying ${deploy.ant.archive}"/>
+ <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
+ <get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
+ dest="${gfv3.results.file}"/>
+ <delete file="${gfv3.results.file}"/>
+ </target>
+ <target name="-undeploy-with-pw" if="gfv3.password">
+ <echo message="Undeploying ${deploy.ant.archive}"/>
+ <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
+ <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
+ dest="${gfv3.results.file}"/>
+ <delete file="${gfv3.results.file}"/>
+ </target>
</project>
<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
<netbeans_installation>/java<version>/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:
</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">
</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">
</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">
</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">
- <ant antfile="${project.addressbook-lib}/build.xml" inheritall="false" target="clean"/>
- </target>
- <target depends="init" name="do-clean">
- <condition property="build.dir.to.clean" value="${build.web.dir}">
- <isset property="dist.ear.dir"/>
- </condition>
- <property name="build.dir.to.clean" value="${build.web.dir}"/>
- <delete includeEmptyDirs="true" quiet="true">
- <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
- </delete>
- <delete dir="${build.dir}"/>
- <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
- <delete dir="${dist.dir}"/>
- </target>
- <target depends="do-clean" if="status.clean-failed" name="check-clean">
- <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
- <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
- </target>
- <target depends="init" if="netbeans.home" name="undeploy-clean">
- <nbundeploy failOnError="false" startServer="false"/>
- </target>
- <target name="-post-clean">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
- <target depends="clean" description="Clean build products." name="clean-ear"/>
+
+ CLEANUP SECTION
+ -->
+ <target depends="init" name="deps-clean" unless="no.deps">
+ <ant antfile="${project.addressbook-lib}/build.xml" inheritall="false" target="clean"/>
+ </target>
+ <target depends="init" name="do-clean">
+ <condition property="build.dir.to.clean" value="${build.web.dir}">
+ <isset property="dist.ear.dir"/>
+ </condition>
+ <property name="build.dir.to.clean" value="${build.web.dir}"/>
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
+ </delete>
+ <delete dir="${build.dir}"/>
+ <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
+ <delete dir="${dist.dir}"/>
+ </target>
+ <target depends="do-clean" if="status.clean-failed" name="check-clean">
+ <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
+ <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
+ </target>
+ <target depends="init" if="netbeans.home" name="undeploy-clean">
+ <nbundeploy failOnError="false" startServer="false"/>
+ </target>
+ <target name="-post-clean">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
+ <target depends="clean" description="Clean build products." name="clean-ear"/>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<Scene Scope="Project" version="2">
- <Scope Scope="Faces Configuration Only">
- <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
- <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
- <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
- <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
- <Node id="*" x="1150" y="150" zoom="true"/>
- <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
- <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
- <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
- <Node id="index.xhtml" x="900" y="150" zoom="true"/>
- <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
- <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
- <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
- <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
- </Scope>
- <Scope Scope="Project">
- <Node id="login/login_show_addressbook.xhtml" x="1650" y="150" zoom="true"/>
- <Node id="user/login.xhtml" x="900" y="150" zoom="true"/>
- <Node id="login/login_other_addressbooks.xhtml" x="650" y="450" zoom="true"/>
- <Node id="user/login_error.xhtml" x="1400" y="150" zoom="true"/>
- <Node id="privacy.xhtml" x="400" y="750" zoom="true"/>
- <Node id="admin/admin_index.xhtml" x="400" y="450" zoom="true"/>
- <Node id="login/login_user_list.xhtml" x="150" y="150" zoom="true"/>
- <Node id="user/user_profile.xhtml" x="1400" y="300" zoom="true"/>
- <Node id="login/login_list_sharing_addressbooks.xhtml" x="900" y="600" zoom="true"/>
- <Node id="admin/admin_logout.xhtml" x="400" y="600" zoom="true"/>
- <Node id="login/login_add_addressbook.xhtml" x="150" y="900" zoom="true"/>
- <Node id="login/login_edit_address.xhtml" x="150" y="300" zoom="true"/>
- <Node id="login/login_edit_user_data.xhtml" x="1150" y="150" zoom="true"/>
- <Node id="user/lost_passwd.xhtml" x="900" y="300" zoom="true"/>
- <Node id="*" x="650" y="150" zoom="true"/>
- <Node id="login/login_own_addressbooks.xhtml" x="400" y="150" zoom="true"/>
- <Node id="terms.xhtml" x="150" y="600" zoom="true"/>
- <Node id="user/register_done.xhtml" x="1150" y="300" zoom="true"/>
- <Node id="bye.xhtml" x="650" y="300" zoom="true"/>
- <Node id="login/login_shared_addressbooks.xhtml" x="1150" y="450" zoom="true"/>
- <Node id="login/login_show_addressbook_entries.xhtml" x="650" y="750" zoom="true"/>
- <Node id="index.xhtml" x="650" y="600" zoom="true"/>
- <Node id="imprint.xhtml" x="900" y="450" zoom="true"/>
- <Node id="login/login_index.xhtml" x="150" y="750" zoom="true"/>
- <Node id="user/register.xhtml" x="400" y="300" zoom="true"/>
- <Node id="user/resend_link.xhtml" x="150" y="450" zoom="true"/>
- </Scope>
- <Scope Scope="All Faces Configurations">
- <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
- <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
- <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
- <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
- <Node id="*" x="1150" y="150" zoom="true"/>
- <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
- <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
- <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
- <Node id="index.xhtml" x="900" y="150" zoom="true"/>
- <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
- <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
- <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
- <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
- </Scope>
+ <Scope Scope="Faces Configuration Only">
+ <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
+ <Node id="*" x="1150" y="150" zoom="true"/>
+ <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
+ <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
+ <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="index.xhtml" x="900" y="150" zoom="true"/>
+ <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
+ <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
+ </Scope>
+ <Scope Scope="Project">
+ <Node id="login/login_show_addressbook.xhtml" x="1650" y="150" zoom="true"/>
+ <Node id="user/login.xhtml" x="900" y="150" zoom="true"/>
+ <Node id="login/login_other_addressbooks.xhtml" x="650" y="450" zoom="true"/>
+ <Node id="user/login_error.xhtml" x="1400" y="150" zoom="true"/>
+ <Node id="privacy.xhtml" x="400" y="750" zoom="true"/>
+ <Node id="admin/admin_index.xhtml" x="400" y="450" zoom="true"/>
+ <Node id="login/login_user_list.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="user/user_profile.xhtml" x="1400" y="300" zoom="true"/>
+ <Node id="login/login_list_sharing_addressbooks.xhtml" x="900" y="600" zoom="true"/>
+ <Node id="admin/admin_logout.xhtml" x="400" y="600" zoom="true"/>
+ <Node id="login/login_add_addressbook.xhtml" x="150" y="900" zoom="true"/>
+ <Node id="login/login_edit_address.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="login/login_edit_user_data.xhtml" x="1150" y="150" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="900" y="300" zoom="true"/>
+ <Node id="*" x="650" y="150" zoom="true"/>
+ <Node id="login/login_own_addressbooks.xhtml" x="400" y="150" zoom="true"/>
+ <Node id="terms.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="user/register_done.xhtml" x="1150" y="300" zoom="true"/>
+ <Node id="bye.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="login/login_shared_addressbooks.xhtml" x="1150" y="450" zoom="true"/>
+ <Node id="login/login_show_addressbook_entries.xhtml" x="650" y="750" zoom="true"/>
+ <Node id="index.xhtml" x="650" y="600" zoom="true"/>
+ <Node id="imprint.xhtml" x="900" y="450" zoom="true"/>
+ <Node id="login/login_index.xhtml" x="150" y="750" zoom="true"/>
+ <Node id="user/register.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="user/resend_link.xhtml" x="150" y="450" zoom="true"/>
+ </Scope>
+ <Scope Scope="All Faces Configurations">
+ <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
+ <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
+ <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
+ <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
+ <Node id="*" x="1150" y="150" zoom="true"/>
+ <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
+ <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
+ <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
+ <Node id="index.xhtml" x="900" y="150" zoom="true"/>
+ <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
+ <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
+ <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
+ <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
+ </Scope>
</Scene>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.web.project</type>
- <configuration>
- <data xmlns="http://www.netbeans.org/ns/web-project/3">
- <name>addressbook-war</name>
- <minimum-ant-version>1.6.5</minimum-ant-version>
- <web-module-libraries>
- <library dirs="200">
- <file>${file.reference.jcore.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.jcoreee.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.jcore-logger-lib.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.jcountry-core.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.jcontacts-core.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.jcontacts-business-core.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.jcontacts-lib.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.jphone-core.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.juser-core.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.juser-lib.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${reference.addressbook-lib.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.cdi-api.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- <library dirs="200">
- <file>${file.reference.gf-client.jar}</file>
- <path-in-war>WEB-INF/lib</path-in-war>
- </library>
- </web-module-libraries>
- <web-module-additional-libraries/>
- <source-roots>
- <root id="src.dir"/>
- </source-roots>
- <test-roots>
- <root id="test.src.dir"/>
- </test-roots>
- </data>
- <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
- <definitions>.\lib\nblibraries.properties</definitions>
- </libraries>
- <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
- <reference>
- <foreign-project>addressbook-lib</foreign-project>
- <artifact-type>jar</artifact-type>
- <script>build.xml</script>
- <target>jar</target>
- <clean-target>clean</clean-target>
- <id>jar</id>
- </reference>
- </references>
- </configuration>
+ <type>org.netbeans.modules.web.project</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/web-project/3">
+ <name>addressbook-war</name>
+ <minimum-ant-version>1.6.5</minimum-ant-version>
+ <web-module-libraries>
+ <library dirs="200">
+ <file>${file.reference.jcore.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jcoreee.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jcore-logger-lib.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jcountry-core.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jcontacts-core.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jcontacts-business-core.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jcontacts-lib.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.jphone-core.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.juser-core.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.juser-lib.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${reference.addressbook-lib.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.cdi-api.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ <library dirs="200">
+ <file>${file.reference.gf-client.jar}</file>
+ <path-in-war>WEB-INF/lib</path-in-war>
+ </library>
+ </web-module-libraries>
+ <web-module-additional-libraries/>
+ <source-roots>
+ <root id="src.dir"/>
+ </source-roots>
+ <test-roots>
+ <root id="test.src.dir"/>
+ </test-roots>
+ </data>
+ <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
+ <definitions>.\lib\nblibraries.properties</definitions>
+ </libraries>
+ <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
+ <reference>
+ <foreign-project>addressbook-lib</foreign-project>
+ <artifact-type>jar</artifact-type>
+ <script>build.xml</script>
+ <target>jar</target>
+ <clean-target>clean</clean-target>
+ <id>jar</id>
+ </reference>
+ </references>
+ </configuration>
</project>
private UserRegistrationSessionBeanRemote registerBean;
/**
- * User controller
+ * An en event fireable when a new user has registered
*/
@Inject
- private UserWebController userController;
+ @Any
+ private Event<UserRegisteredEvent> registeredEvent;
/**
- * An en event fireable when a new user has registered
+ * User controller
*/
@Inject
- @Any
- private Event<UserRegisteredEvent> registeredEvent;
+ private UserWebController userController;
/**
* Default constructor
/**
* Checks if the sharee's user id is empty.
+ * <p>
* @return Whether the sharee's user id is empty.
*/
boolean isShareeUserIdEmpty ();
}
}
- /**
- * Adds user's name and email address to bean's internal list. It also
- * updates the public user list if the user has decided to have a public
- * profile on registration.
- * <p>
- * @param user User instance
- */
- private void addUserNameEmailAddress (final User user) {
- // Make sure the entry is not added yet
- if (this.userNameList.contains(user.getUserName())) {
- // Abort here
- throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); //NOI18N
- } else if (this.emailAddressList.contains(user.getUserContact().getContactEmailAddress())) {
- // Already added
- throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getContactEmailAddress())); //NOI18N
+ @Override
+ public void afterRegistration (final @Observes UserRegisteredEvent event) {
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getUser() == null) {
+ // Throw NPE again
+ throw new NullPointerException("event.user is null"); //NOI18N
+ } else if (event.getUser().getUserId() == null) {
+ // userId is null
+ throw new NullPointerException("event.user.userId is null"); //NOI18N
+ } else if (event.getUser().getUserId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N
}
- // Add user name
- this.userNameList.add(user.getUserName());
+ // Get user instance
+ User registeredUser = event.getUser();
- // Add email addres
- this.emailAddressList.add(user.getUserContact().getContactEmailAddress());
- }
+ // Copy all data from registered->user
+ this.copyUser(registeredUser);
- @Override
- public List<User> allPublicUsers () {
- // Return it
- return Collections.unmodifiableList(this.publicUserList);
- }
+ // Add user name and email address
+ this.addUserNameEmailAddress(registeredUser);
- /**
- * Clears all data in this bean
- */
- private void clearData () {
// Clear all data
- // - personal data
- this.setUserId(null);
- this.setUserProfilePublic(null);
- this.setGender(Gender.UNKNOWN);
- this.setFirstName(null);
- this.setFamilyName(null);
- this.setStreet(null);
- this.setHouseNumber(null);
- this.setZipCode(null);
- this.setCity(null);
- this.setCountry(null);
-
- // - contact data
- this.setEmailAddress(null);
- this.setEmailAddressRepeat(null);
- this.setPhoneAreaCode(null);
- this.setCellphoneCarrier(null);
- this.setFaxAreaCode(null);
+ this.clearData();
- // - other data
- this.setBirthday(null);
- this.setComment(null);
- this.setUserName(null);
- this.setUserPassword(null);
- this.setUserPasswordRepeat(null);
+ // Set user id again
+ this.setUserId(registeredUser.getUserId());
}
- /**
- * Copies given user into the controller
- * <p>
- * @param user User instance
- */
- private void copyUser (final User user) {
- // Copy all fields:
- // - base data
- this.setUserId(user.getUserId());
- this.setUserProfilePublic(user.getUserPublicProfile());
- this.setGender(user.getUserContact().getContactGender());
- this.setFirstName(user.getUserContact().getContactFirstName());
- this.setFamilyName(user.getUserContact().getContactFamilyName());
- this.setStreet(user.getUserContact().getContactStreet());
- this.setHouseNumber(user.getUserContact().getContactHouseNumber());
- this.setZipCode(user.getUserContact().getContactZipCode());
- this.setCity(user.getUserContact().getContactCity());
- this.setCountry(user.getUserContact().getContactCountry());
-
- // Get cellphone, phone and fax instance
- DialableCellphoneNumber cellphone = user.getUserContact().getContactCellphoneNumber();
- DialableFaxNumber fax = user.getUserContact().getContactFaxNumber();
- DialableLandLineNumber phone = user.getUserContact().getContactPhoneNumber();
-
- // - contact data
- if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) {
- this.setPhoneCountry(phone.getPhoneCountry());
- this.setPhoneAreaCode(phone.getPhoneAreaCode());
- this.setPhoneNumber(phone.getPhoneNumber());
- }
- if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof SmsProvider)) {
- this.setCellphoneCarrier(cellphone.getCellphoneProvider());
- this.setCellphoneNumber(cellphone.getPhoneNumber());
- }
- if ((fax instanceof DialableFaxNumber) && (fax.getPhoneAreaCode() > 0)) {
- this.setFaxCountry(fax.getPhoneCountry());
- this.setFaxAreaCode(fax.getPhoneAreaCode());
- this.setFaxNumber(fax.getPhoneNumber());
- }
- this.setEmailAddress(user.getUserContact().getContactEmailAddress());
-
- // -- other data
- this.setBirthday(user.getUserContact().getContactBirthday());
- this.setComment(user.getUserContact().getContactComment());
+ @Override
+ public List<User> allPublicUsers () {
+ // Return it
+ return Collections.unmodifiableList(this.publicUserList);
}
@Override
return user;
}
- @Override
- public void afterRegistration (final @Observes UserRegisteredEvent event) {
- // event should not be null
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getUser() == null) {
- // Throw NPE again
- throw new NullPointerException("event.user is null"); //NOI18N
- } else if (event.getUser().getUserId() == null) {
- // userId is null
- throw new NullPointerException("event.user.userId is null"); //NOI18N
- } else if (event.getUser().getUserId() < 1) {
- // Not avalid id
- throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getUser(), event.getUser().getUserId())); //NOI18N
- }
-
- // Get user instance
- User registeredUser = event.getUser();
-
- // Copy all data from registered->user
- this.copyUser(registeredUser);
-
- // Add user name and email address
- this.addUserNameEmailAddress(registeredUser);
-
- // Clear all data
- this.clearData();
-
- // Set user id again
- this.setUserId(registeredUser.getUserId());
- }
-
@Override
public Date getBirthday () {
return this.birthday;
@Override
public boolean isRequiredPersonalDataSet () {
- return ((this.getUserName() != null)
- && (this.getUserProfilePublic() != null)
- && (this.getGender() != null)
- && (this.getFirstName() != null)
- && (this.getFamilyName() != null)
- && (this.getStreet() != null)
- && (this.getHouseNumber() != null)
- && (this.getZipCode() != null)
- && (this.getCity() != null)
- && (this.getEmailAddress() != null)
- && (this.getEmailAddressRepeat() != null)
- && (this.getUserPassword() != null)
- && (this.getUserPasswordRepeat() != null));
+ return ((this.getUserName() != null) &&
+ (this.getUserProfilePublic() != null) &&
+ (this.getGender() != null) &&
+ (this.getFirstName() != null) &&
+ (this.getFamilyName() != null) &&
+ (this.getStreet() != null) &&
+ (this.getHouseNumber() != null) &&
+ (this.getZipCode() != null) &&
+ (this.getCity() != null) &&
+ (this.getEmailAddress() != null) &&
+ (this.getEmailAddressRepeat() != null) &&
+ (this.getUserPassword() != null) &&
+ (this.getUserPasswordRepeat() != null));
}
@Override
public boolean isUserNameRegistered (final User user) {
return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName())));
}
+
+ /**
+ * Adds user's name and email address to bean's internal list. It also
+ * updates the public user list if the user has decided to have a public
+ * profile on registration.
+ * <p>
+ * @param user User instance
+ */
+ private void addUserNameEmailAddress (final User user) {
+ // Make sure the entry is not added yet
+ if (this.userNameList.contains(user.getUserName())) {
+ // Abort here
+ throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); //NOI18N
+ } else if (this.emailAddressList.contains(user.getUserContact().getContactEmailAddress())) {
+ // Already added
+ throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getContactEmailAddress())); //NOI18N
+ }
+
+ // Add user name
+ this.userNameList.add(user.getUserName());
+
+ // Add email addres
+ this.emailAddressList.add(user.getUserContact().getContactEmailAddress());
+ }
+
+ /**
+ * Clears all data in this bean
+ */
+ private void clearData () {
+ // Clear all data
+ // - personal data
+ this.setUserId(null);
+ this.setUserProfilePublic(null);
+ this.setGender(Gender.UNKNOWN);
+ this.setFirstName(null);
+ this.setFamilyName(null);
+ this.setStreet(null);
+ this.setHouseNumber(null);
+ this.setZipCode(null);
+ this.setCity(null);
+ this.setCountry(null);
+
+ // - contact data
+ this.setEmailAddress(null);
+ this.setEmailAddressRepeat(null);
+ this.setPhoneAreaCode(null);
+ this.setCellphoneCarrier(null);
+ this.setFaxAreaCode(null);
+
+ // - other data
+ this.setBirthday(null);
+ this.setComment(null);
+ this.setUserName(null);
+ this.setUserPassword(null);
+ this.setUserPasswordRepeat(null);
+ }
+
+ /**
+ * Copies given user into the controller
+ * <p>
+ * @param user User instance
+ */
+ private void copyUser (final User user) {
+ // Copy all fields:
+ // - base data
+ this.setUserId(user.getUserId());
+ this.setUserProfilePublic(user.getUserPublicProfile());
+ this.setGender(user.getUserContact().getContactGender());
+ this.setFirstName(user.getUserContact().getContactFirstName());
+ this.setFamilyName(user.getUserContact().getContactFamilyName());
+ this.setStreet(user.getUserContact().getContactStreet());
+ this.setHouseNumber(user.getUserContact().getContactHouseNumber());
+ this.setZipCode(user.getUserContact().getContactZipCode());
+ this.setCity(user.getUserContact().getContactCity());
+ this.setCountry(user.getUserContact().getContactCountry());
+
+ // Get cellphone, phone and fax instance
+ DialableCellphoneNumber cellphone = user.getUserContact().getContactCellphoneNumber();
+ DialableFaxNumber fax = user.getUserContact().getContactFaxNumber();
+ DialableLandLineNumber phone = user.getUserContact().getContactPhoneNumber();
+
+ // - contact data
+ if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) {
+ this.setPhoneCountry(phone.getPhoneCountry());
+ this.setPhoneAreaCode(phone.getPhoneAreaCode());
+ this.setPhoneNumber(phone.getPhoneNumber());
+ }
+ if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof SmsProvider)) {
+ this.setCellphoneCarrier(cellphone.getCellphoneProvider());
+ this.setCellphoneNumber(cellphone.getPhoneNumber());
+ }
+ if ((fax instanceof DialableFaxNumber) && (fax.getPhoneAreaCode() > 0)) {
+ this.setFaxCountry(fax.getPhoneCountry());
+ this.setFaxAreaCode(fax.getPhoneAreaCode());
+ this.setFaxNumber(fax.getPhoneNumber());
+ }
+ this.setEmailAddress(user.getUserContact().getContactEmailAddress());
+
+ // -- other data
+ this.setBirthday(user.getUserContact().getContactBirthday());
+ this.setComment(user.getUserContact().getContactComment());
+ }
}
<h:body>
<div id="top">
- <div id="header">
+ <div id="header">
<div id="title">
<h1>Addressbook - <ui:insert name="title">Default title</ui:insert></h1>
</div>