<?xml version="1.0" encoding="UTF-8"?>
<chapter id="getting_started" xreflabel="getting_started">
      <?dbhtml filename="getting_started.html"?>
      <chapterinfo>
            <keywordset>
                  <keyword>RichFaces</keyword>
                  
            </keywordset>
      </chapterinfo>
      <title>Getting started</title>
      <section>
            <title>Environment Configuration</title>
            <para>
                  In order to download, build, modify, and deploy the Photo Album application 
                  you need the following installed and configured: 
            </para>
            <itemizedlist>
                  <listitem>
                  	<para>
                  		<ulink url="http://java.sun.com/javase/downloads/index.jsp">JDK 1.5 and higher</ulink>
                  	</para>
                  </listitem>
                  <listitem>
                  	<para>
                  		<ulink url="http://maven.apache.org/download.html">Maven 2.0.10</ulink>
                  	</para>
                  </listitem>
                  <listitem>
                  	<para>
                  		<ulink url="http://www.jboss.org/tools">JBoss Tools</ulink> 
                  		(or <ulink url="http://www.eclipse.org/">Eclipse</ulink>)
					</para>
				  </listitem>
                  <listitem>
                  	<para>
                  		<ulink url="http://www.jboss.org/jbossas/downloads/">JBoss Server</ulink> (4.2.3.GA, 5.0.x.GA)  
                  	</para>
                  </listitem>
                  <listitem>
                  	<para>
                  		<ulink url="http://subversion.tigris.org/">SVN client</ulink>
                  	</para>
                  </listitem>
            </itemizedlist>
      </section>
      
      <section>
            <title>Installation</title>
            <para>
            	Once you have configured the environment you can install the Photo Album application:
            </para>
            <itemizedlist>
                  <listitem>
                  	<para>
                  		<emphasis>Checkout the project</emphasis>
                    </para>
                    <programlisting role="XML"><![CDATA[svn co http://anonsvn.jboss.org/repos/richfaces/trunk/examples/photoalbum/]]></programlisting>
                  </listitem>
                  <listitem>
                  	<para>
                  		<emphasis>Build the project</emphasis>. 
                        Open command line console, 
                        point to the folder with checkouted project,
                        and tell Maven:
                     </para>
                     <programlisting role="XML"><![CDATA[mvn clean install eclipse:eclipse -Dwtpversion=1.5]]></programlisting>
                  </listitem>
                  <listitem>
                  	<para>
                  		<emphasis>Import the project into your IDE</emphasis>. 
                  		You can just deploy Photo Album application onto the server, but
                  		the convenient way is to import the project into your IDE. 
                        We recommend Eclipse with JBoss Tools since this bundle is more preferable to 
                        ensure rapid development process with Seam and RichFaces.
                        You can find a step-by-step tutorial &quot;Importing existing projects&quot; 
                        at the 
<ulink url="http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.user/tasks/tasks-importproject.htm">Eclipse documentation</ulink> page 
or simply in the <emphasis>Help</emphasis> &gt; <emphasis>Help Contents</emphasis> of the Eclipse. 
                        <!-- 
                        Steps to follow for JBDS users: 
                        click <code>File</code> -> <code>Import</code> and select <code>Existing project into Workspace</code> as import source; 
                        in <code>Import Project</code> window click <code>Browse</code> button and point to the realworld project folder; сlick <code>OK</code>.  
                        -->
                        As the result three modules of Photo Album project appear in the Workspace:
                    </para>
                    <figure>
        				<title>Modules of Photo Album in the Workspace</title>
        				<mediaobject> 
            				<imageobject>
                				<imagedata fileref="images/modulesList.png"/>
            				</imageobject>
        				</mediaobject>
    				</figure>
                  </listitem>
                  <listitem>
                  	<para>
                  		<emphasis>Add JBoss AS</emphasis>. 
                  		Now you need to add JBoss Application Server runtime.
                  		
                  		Detailed instructions on how you can do it are given in the
                  		<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html/runtimes_servers.html">Runtimes and Servers in the JBoss AS plugin</ulink>
                  		chapter from the <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html/index.html">JBoss Server Manager Reference Guide</ulink>. 
                  	</para>
                  </listitem>
                  <listitem>
                  	<para>
                  		<emphasis>Run photoalbum-ear-1.0-SNAPSHOT</emphasis> on the JBoss Application Server
                  		you have just installed.
                  	</para>
                  </listitem>
                  <listitem>
                  	<para>
                  		Browse to <code>http:/localhost:8080/photoalbum</code>.
                  	</para>
                  </listitem>                  
            </itemizedlist>
            
            <tip>
                  <title>Tip:</title>
                  <para>
                        By default Photo Album is assembled with a limited set of images (4-5 in each album).
                        In order to build the version of the application with a full set of images you need to use <property>livedemo</property> profile while building Photo Album like this:
                  </para>
<programlisting role="JAVA"><![CDATA[
mvn clean install -Plivedemo
]]></programlisting> 
               
                  </tip>
      </section>
      <section>
            <title>Running Functional(Selenium) Tests</title>
            <para>
                  Before starting Selenium test please make sure that you have Firefox browser installed on your local machine and 
                 since the Photo Album application is designed to be deployed and run on JBoss Application server,
                 so please make sure that the &lt;jboss.installer.url&gt; property of the project pom.xml (<code>examples/photoalbum/</code>) points to a existing JBoss Application server copy.
            </para>
            
            <para>
                  You also need to build the Photo Album project in <code>inexamples/photoalbum/reource</code>.
            </para>
            <para>
                  Then, you need to go to the test folder of the project (examples/photoalbum/test/) and run the
                  
               
            </para>
            <programlisting role="XML"><![CDATA[...
mvn clean integration-test
...]]></programlisting> 
            <para>
                  By default Selenium tests are executed in the Firefox browser, hence you need to have it installed. 
                  If you configured everything like it is said above you will see tests being executed in the Firefox browser.  
                  When the tests are finished you can read  test reports  in the <code>examples/photoalbum/tests/target/surefire-reports/</code> folder.
            </para>
      </section>
      
      <section>
            <title>Context Help</title>
            <para>
               The Photo Album appellation was developed in the first place to demonstrate the mighty power of RichFaces thus most of UI elements in the application has a context help article that tells how a particular element works, providing technical details about it.
               A context help article is displayed when you click on the question mark icon ( 
                  <inlinemediaobject>  
                             <imageobject>
                                   <imagedata fileref="images/help_sign.png"/>
                           </imageobject>
                  </inlinemediaobject> 
             ).
                  
            </para>
      </section>
      
      
      
      
      
</chapter>