<%@ page contentType="text/html"
	 import="olstore.entity.*"
     import="olstore.session.helper.*"
	 import="olstore.framework.EJBHomeFactory"
     import="java.util.Collection"
         %>

<%-- Get the home item --%>
<%
    EJBHomeFactory factory = EJBHomeFactory.getInstance();
    ItemLocalHome home = (ItemLocalHome)factory.getLocalHome (EJBHomeFactory.ITEM);
    PropertyLocalHome propHome = (PropertyLocalHome)factory.getLocalHome (EJBHomeFactory.PROP);
    PictureLocalHome picHome = (PictureLocalHome)factory.getLocalHome (EJBHomeFactory.PIC);
    ItemHelperLocalHome helperHome = (ItemHelperLocalHome)factory.getLocalHome (EJBHomeFactory.ITEM_HELPER);
    TypeLocalHome typeHome = (TypeLocalHome)factory.getLocalHome (EJBHomeFactory.TYPE);
%>

<h2> Populating Items</h2>
<p> Connecting to ItemLocalHome </p>
<%

if ( true ) {
        //if statement just for scope
        TypeLocal type = null ;
        try {
            type = typeHome.findByName ( "CDs" );
    %>      <p> type EXISTS! moving on </p> <%
        } catch (Exception e) {
    %>      <p> Type does not exist, creating it </p> <%
        }
                                                                                                                                                             
        if ( type == null ) {
            type = typeHome.create("CDs");
            Collection props = type.getProperties();
            props.add ( propHome.create ( "Genre", null ) );
            props.add ( propHome.create ( "Record Label", null ) );
            props.add ( propHome.create ( "Artist", null ) );
            props.add ( propHome.create ( "Recorded By", null ) );
            props.add ( propHome.create ( "Album", null ) );
	    props.add ( propHome.create ( "Total mins", null ) );
            props.add ( propHome.create ( "Highest Chart Ranking", null ) );
            props.add ( propHome.create ( "Year released", null ) );
            props.add ( propHome.create ( "Lyrics included", null ) );
            props.add ( propHome.create ( "Mixed By", null ) );


            type.setProperties ( props );
        }
    }




%>

<p> Adding  new items to the database</p>

<!-- TO FIX: Need to figure out the proper way to handle transactions here.
If we fail to add a property or a picture, we need to fail on the whole add
item. The easiest way to do this is if the item add command is on method
then an failure inside the method will automatically rollback everything else
However, then the method signiture would become obscenly long.
Any way to do this with getting and using UserTransaction? -->

    <!-- Adding a Computer -->
<%



    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Little Flower", "12.99",
                                "The best new sound in ages!",
                                "Amazing new Piano sound! Great Artist!",
                                "CDs");
	item.setMainPage(Boolean.TRUE);
	item.setSpecialOffer(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd2.jpg","Little Flower", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Intrumental Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Shadow Man") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
	props.add ( propHome.create ( "Album", "Little Flower" ) );
        props.add ( propHome.create ( "Total mins", "69:14"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "4" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );

        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Pink Petals", "12.99",
                                "The best new sound in ages!",
                                "Amazing violin sounds.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd3.jpg", "Pink Petals", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Instrumental Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Shadow Man") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "Pink Petals" ) );
        props.add ( propHome.create ( "Total mins", "65"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "2" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included","Yes" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "The Airport", "11.99",
                                "Hailed as the best new Jazz in decades.",
                                "Beautiful harmony and foot tapping rhythm.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd4.jpg", "The Airport", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Jazz") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Shadow and Tux Jazz") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "The Airport" ) );
        props.add ( propHome.create ( "Total mins", "61"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "4" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "yes" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "White Tiger", "14.99",
                                "Wonderful rhythm and melody.",
                                "The best Blues album in ages!",
                                "CDs");
        item.setMainPage(Boolean.TRUE);
	Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd5.jpg", "White Tiger", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Blues") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "RHAPS Blues") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "White Tiger" ) );
        props.add ( propHome.create ( "Total mins", "67"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "1" ) );
        props.add ( propHome.create ( "Year released", "2002" ) );
        props.add ( propHome.create ( "Lyrics included", "yes" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
                                                                                                                  
<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Palm Trees", "11.99",
                                "Revolutionary new Reggae Sound.",
                                "Revolutionary new Reggae Sound, recorded live in Concert!",
                                "CDs");
	item.setMainPage(Boolean.TRUE);
	item.setSpecialOffer(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd6.jpg", "Palm Trees", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Reggae") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "RHAPSamuffin") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "Palm Trees" ) );
        props.add ( propHome.create ( "Total mins", "72"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "1" ) );
        props.add ( propHome.create ( "Year released", "2002" ) );
        props.add ( propHome.create ( "Lyrics included", "yes" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Paris", "11.99",
                                "Authentic French Instrumental Music.",
                                "Authentic French Instrumental Music.",
                                "CDs");
	item.setMainPage(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd7.jpg", "Paris", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Instrumental Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Assortment of French Artists") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "Paris" ) );
        props.add ( propHome.create ( "Total mins", "72"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "10" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Streets", "11.99",
                                "Assortment of Street Music from around the world.",
                                "Assortment of Street Music from around the world.",
                                "CDs");
	item.setSpecialOffer(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd8.jpg", "Streets of the world", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Folk Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Assortment of Street Artists") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "Streets of the world" ) );
        props.add ( propHome.create ( "Total mins", "72"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "10" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "The Pond", "11.99",
                                "The most soothing of natural sounds.",
                                "The sounds of a calm, serene lake recorded digitally.",
                                "CDs");
	item.setMainPage(Boolean.TRUE);
	item.setSpecialOffer(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd9.jpg", "The Pond", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Nature") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "N/A") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "The Pond" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "6" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

                                                                                                                                                             
<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Spring", "11.99",
                                "New age Violin.",
                                "New age Violin.",
                                "CDs");
        Collection pics = item.getPictures();
	item.setMainPage(Boolean.TRUE);
	item.setSpecialOffer(Boolean.TRUE);
        pics.add ( picHome.create ( "images/cd10.jpg", "Spring", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Instrumental Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Viola Tux") );
        props.add ( propHome.create ( "Recorded By", "Tux") );
        props.add ( propHome.create ( "Album", "Spring" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "4" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Natural Music", "11.99",
                                "Tropical Natural Sounds.",
                                "Tropical Natural Sounds.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd11.jpg", "Natural Music", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Nature") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tuxamatic") );
        props.add ( propHome.create ( "Recorded By", "Shadow Dude") );
        props.add ( propHome.create ( "Album", "Natural Music" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "5" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "War!", "11.99",
                                "Your favourite peace songs of the 60s and 70s.",
                                "The biggest artists of the 60s and 70s" + 
				" produced some of their best music for the anti-war movement.",
                                "CDs");
	item.setSpecialOffer(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd12.jpg", "War!", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Rock") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Various Rock Artists") );
        props.add ( propHome.create ( "Recorded By", "Shadow Dude") );
        props.add ( propHome.create ( "Album", "War!" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "1" ) );
        props.add ( propHome.create ( "Year released", "2000" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Destiny", "14.99",
                                "Brand new Rock Album.",
                                "Rock out to the tunes of this critically acclaimed album.",
                                "CDs");
	item.setSpecialOffer(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd13.jpg", "Destiny", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Rock") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux Rocker") );
        props.add ( propHome.create ( "Recorded By", "Shadow Dude") );
        props.add ( propHome.create ( "Album", "Destiny" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "1" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Lonely Tunes", "14.99",
                                "Brand new chart-topping album.",
                                "Amazing artists, exquisite musicians and romantic songs.",
                                "CDs");
	item.setSpecialOffer(Boolean.TRUE);
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd14.jpg","Songs for the lonely" , 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Blues") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux Blue") );
        props.add ( propHome.create ( "Recorded By", "Shadow Dude") );
        props.add ( propHome.create ( "Album", "Songs for the lonely" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "1" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>


<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Outback", "14.99",
                                "Songs from remote corners of Australia.",
                                "Songs from remote corners of Australia.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd15.jpg","The Sounds of the Outback", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Folk Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tuxaroo") );
        props.add ( propHome.create ( "Recorded By", "Shadowareedoo") );
        props.add ( propHome.create ( "Album", "The Sounds of the Outback" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "7" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>


<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "The Solitary Candle", "14.99",
                                "Ancient Japanese Folk songs.",
                                "Ancient Japanese Folk songs sung by the leading Japanese Pop artists.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd16.jpg", "The Solitary Candle", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "World Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux-San and others") );
        props.add ( propHome.create ( "Recorded By", "Shadow-San") );
        props.add ( propHome.create ( "Album", "The Solitary Candle" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "1" ) );
        props.add ( propHome.create ( "Year released", "2003" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>


<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Bach", "14.99",
                                "Bach compositions.",
                                "Bach compositions performed by the leading orchestras of the world.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd17.jpg", "Bach", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Classical Music") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux and others") );
        props.add ( propHome.create ( "Recorded By", "Shadow-San") );
        props.add ( propHome.create ( "Album", "Bach" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "5" ) );
        props.add ( propHome.create ( "Year released", "2003" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%--
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Life as a cavas", "14.99",
                                "Most memorable melodies of yore",
                                "The most famous songs of the early 20th century",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd18.jpg", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Jazz") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux and others") );
        props.add ( propHome.create ( "Recorded By", "Shadow") );
        props.add ( propHome.create ( "Album", "Bach" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "2" ) );
        props.add ( propHome.create ( "Year released", "2003" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
--%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Life as a canvas", "14.99",
                                "Most memorable melodies of yore.",
                                "The most famous songs of the early 20th century.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd18.jpg", "Life as a canvas", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Jazz") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux and others") );
        props.add ( propHome.create ( "Recorded By", "Shadow") );
        props.add ( propHome.create ( "Album", "Life as a canvas" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "2" ) );
        props.add ( propHome.create ( "Year released", "2003" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Our Heroes", "14.99",
                                "Best country music album in years!",
                                "A tribute to heroes from the best country musicians around.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd19.jpg", "Our Heroes", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Country") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tuxan ") );
        props.add ( propHome.create ( "Recorded By", "Shadow Raider") );
        props.add ( propHome.create ( "Album", "Our Heroes" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "2" ) );
        props.add ( propHome.create ( "Year released", "2003" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>

<%
                                                                                                                                                             
                                                                                                                                                             
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Just a game", "14.99",
                                "Great Tennis Players singing for charity.",
                                "All earnings will be donated to charities around the world.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd20.jpg", "It is just a game", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "General") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux ") );
        props.add ( propHome.create ( "Recorded By", "Shadow") );
        props.add ( propHome.create ( "Album", "It is just a game" ) );
        props.add ( propHome.create ( "Total mins", "71"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "10" ) );
        props.add ( propHome.create ( "Year released", "2003" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>


<%
                                                                                                                                                             
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Electricity", "14.99",
                                "Heavily charged rock and roll music.",
                                "Loud, exciting, electric! Just what Rock and Roll is supposed to be.",
                                "CDs");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/cd21.jpg", "Electricity", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "Genre", "Rock") );
        props.add ( propHome.create ( "Record Label", "Open Music") );
        props.add ( propHome.create ( "Artist", "Tux Electric") );
        props.add ( propHome.create ( "Recorded By", "Shadow") );
        props.add ( propHome.create ( "Album", "Electricity" ) );
        props.add ( propHome.create ( "Total mins", "70"  ) );
        props.add ( propHome.create ( "Highest Chart Ranking", "3" ) );
        props.add ( propHome.create ( "Year released", "2004" ) );
        props.add ( propHome.create ( "Lyrics included", "No" ) );
        props.add ( propHome.create ( "Mixed By", "Tux" ) );
                                                                                                                                                             
        item.setProperties ( props );
                                                                                                                                                             
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>




