Author: achabatar
Date: 2007-11-16 12:40:23 -0500 (Fri, 16 Nov 2007)
New Revision: 4954
Added:
trunk/seam/docs/reference/en/images/crud_database_application/
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_01.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_02.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_03.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_04.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_05.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_06.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_07.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_08.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_09.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_10.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_11.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_12.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_13.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_14.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_15.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_16.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_17.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_18.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_19.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_20.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_21.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_22.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_23.png
Modified:
trunk/seam/docs/reference/en/modules/crud_database_application.xml
Log:
http://jira.jboss.com/jira/browse/RHDS-312
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_01.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_01.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_02.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_02.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_03.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_03.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_04.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_04.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_05.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_05.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_06.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_06.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_07.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_07.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_08.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_08.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_09.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_09.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_10.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_10.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_11.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_11.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_12.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_12.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_13.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_13.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_14.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_14.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_15.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_15.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_16.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_16.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_17.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_17.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_18.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_18.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_19.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_19.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_20.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_20.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_21.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_21.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_22.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_22.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_23.png
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_23.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/docs/reference/en/modules/crud_database_application.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/crud_database_application.xml 2007-11-16 17:29:35
UTC (rev 4953)
+++ trunk/seam/docs/reference/en/modules/crud_database_application.xml 2007-11-16 17:40:23
UTC (rev 4954)
@@ -1,16 +1,309 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="crud_database_application"
xreflabel="crud_database_application">
- <?dbhtml filename="crud_database_application.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>Red Hat Developer Studio</keyword>
- <keyword>Eclipse</keyword>
- <keyword>Java</keyword>
- <keyword>CRUD</keyword>
- <keyword>Database Application</keyword>
- </keywordset>
- </chapterinfo>
- <title>Generate a CRUD Database Application</title>
-
-</chapter>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="crud_database_application"
+ xreflabel="crud_database_application">
+ <?dbhtml filename="crud_database_application.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>Red Hat Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>CRUD</keyword>
+ <keyword>Database Application</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>Generate a CRUD Database Application</title>
+ <section>
+ <title>What is CRUD?</title>
+ <para>
+ <property>CRUD</property>
+ ("Create, read, update and delete") are the four
+ basic functions of persistent storage, a major part of nearly
+ all computer software.
+ </para>
+ <para>
+ More information can be found on Wikipedia site:
+ <ulink
url="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete&qu...
+
www.wikipedia.org</ulink>
+ </para>
+ </section>
+
+ <section>
+ <title>How to create the CRUD Database Application in Red Hat Developer
Studio</title>
+
+ <itemizedlist>
+ <listitem><para>Create a new Seam Web Project using New Project
wizard or main menu <emphasis><property>File > New > Seam Web
Project</property>.</emphasis></para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Seam Web Project Creation</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_01.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Name your project as
<emphasis><property>crudapp</property></emphasis> and follow the
next wizard steps keeping default settings.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>New Seam Project Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_02.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>On <emphasis><property>Seam
Facet</property></emphasis> page click
<emphasis><property>New...</property></emphasis> to create a new
<property>Connection profile</property>.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Seam Facet page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_03.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>On <property>New Connection
Profile</property> dialog select the <emphasis><property>PostgreSQL JDBC
Connection</property></emphasis> type and click
<emphasis><property>Next</property></emphasis>.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>New JDBC Connection Profile</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_04.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Name your profile as
<emphasis><property>cruddb</property></emphasis> and press
<emphasis><property>Next</property></emphasis>.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>New JDBC Connection Profile Name</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_05.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>On the next page click
<emphasis><property>...</property></emphasis> to select a database
driver.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>New JDBC Connection Profile Database Driver</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_06.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>On <property>Driver
Definitions</property> dialog select the
<emphasis><property>PostgreSQL->8.x</property></emphasis> and
click
<emphasis><property>Add...</property></emphasis>.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Driver Definitions List</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_07.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Set the location of <property>JDBC
driver</property> and fill all other necessary fields
(<emphasis><property>URL</property></emphasis>,
<emphasis><property>Database Name</property></emphasis>,
<emphasis><property>Password</property></emphasis>,
<emphasis><property>User Id</property></emphasis>) and click
<emphasis><property>OK</property></emphasis>.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Edit Driver Definition</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_09.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Click
<emphasis><property>OK</property></emphasis> on the next dialog
with newly created driver.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Driver Definitions List</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_10.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Click <emphasis><property>Test
Connection</property></emphasis> on the next dialog and observe that
connection can be established.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Test JDBC Connection</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_11.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <figure>
+ <title>JDBC Connection is OK</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_12.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Validate <emphasis><property>JDBC
Connection profile</property></emphasis> settings and press
<emphasis><property>Finish</property></emphasis> or
<emphasis><property>Back</property></emphasis> if something is
wrong.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Validate JDBC Connection settings</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_13.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Observe that newly created profile has been selected on
<emphasis><property>Seam Facet</property></emphasis> page and
click
<emphasis><property>Finish</property></emphasis>.</para>
+ <para>This will create 2 projects -
<emphasis><property>crudapp</property></emphasis> and
<emphasis><property>crudapp-test</property></emphasis>.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Last Step of New Seam Project Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_14.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Have a look to the created projects. You can
expand <property>WEB_CONTENT</property> folder and open
<property>home.xhtml</property> or
<property>login.xhtml</property> with <property>JBoss Visual
Editor</property>.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>CRUDAPP Seam Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_15.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Switch to <property>Database
Development</property> perspective with
<emphasis><property>Window->Open
Perspective->Other...</property></emphasis> and connect to the
<emphasis><property>cruddb</property></emphasis>
database.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Connecting to the CRUDDB database</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_16.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Expand
<emphasis><property>cruddb</property></emphasis> nodes to view its
<emphasis><property>Schemas</property></emphasis>,
<emphasis><property>Tables</property></emphasis>,
<emphasis><property>Columns</property></emphasis>
etc.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>CRUDDB Database</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_17.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Switch back to the
<property>Seam</property> perspective. From the toolbar select
<emphasis><property>New->Seam Generate
Entities</property></emphasis> to create necessary entity classes and web
pages.
+ In the <emphasis><property>Generete Seam
Entities</property></emphasis> dialog keep everything by default and press
<emphasis><property>Finish</property></emphasis>.
+ </para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Generete Seam Entities</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_18.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>Under
<emphasis><property>WebContent</property></emphasis> folder you
can find a lot of generated <property>xhtml</property>
files:</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Entities Web Pages</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_19.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem><para>And under
<emphasis><property>src</property></emphasis> folder java classes
are created.</para></listitem>
+ </itemizedlist>
+ <figure>
+ <title>Entities Java Classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_20.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Switch to <property>Hibernate</property> perspective
with <emphasis><property>Window->Open
Perspective->Other...</property></emphasis>. On <property>Hibernate
Configurations</property> view expand the
<emphasis><property>crudapp</property></emphasis> configuration.
Right click on <property>Customers</property> and select
<emphasis><property>Open Mapping Diagram</property></emphasis>
from the popup menu.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Hibernate Configurations View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_21.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Observe that <property>Mapping Diagram</property> is
opened in the editor. Here you can see the relations between models and database tables.
Select <property>Customers</property> entity model, right click and select
<emphasis><property>Open Source
File</property></emphasis>.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Mapping Diagram</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_22.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>This will open the
<property>Customers.java</property> file in the java editor.</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Entity class from Mapping Diagram</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/crud_database_application/crud_database_application_23.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>After that you are ready to deploy your application to J2EE
application server. This is described in the next chapter.</para>
+
+ </section>
+
+</chapter>
+