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

<%-- Get the home item --%>
<%
    EJBHomeFactory factory = EJBHomeFactory.getInstance();
%>

<h2> Populating Items</h2>
<p> Connecting to ItemLocalHome </p>
<%
    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);
%>


<p> Adding new type Computers to the database</p>
<%
    if ( true ) {
        //if statement just for scope
        TypeLocal type = null ;
        try {
            type = typeHome.findByName ( "Laptops" );
    %>      <p> type EXISTS! moving on </p> <%
        } catch (Exception e) {
    %>      <p> Type does not exist, creating it </p> <%
        } 

        if ( type == null ) {
            type = typeHome.create("Laptops");
            Collection props = type.getProperties();
            props.add ( propHome.create ( "CPU Speed", null ) );
            props.add ( propHome.create ( "CPU Type", null ) );
            props.add ( propHome.create ( "Cache", null ) );
            props.add ( propHome.create ( "Hard Drive", null ) );
            props.add ( propHome.create ( "RAM", null ) );
            props.add ( propHome.create ( "Optical Drives", null ) );
            props.add ( propHome.create ( "Sound Card", null ) );
            props.add ( propHome.create ( "Video Card", null ) );
            props.add ( propHome.create ( "System Bus", null ) );
            props.add ( propHome.create ( "Screen Size", null ) );
            props.add ( propHome.create ( "Weight", null ) );
            props.add ( propHome.create ( "Thickness", null ) );
            type.setProperties ( props );
        }
    }
%>

    <!-- Adding Laptop 1-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Value Laptop", "1500.00",
                                "A great all around bundle.",
                                "This Laptop is great value for your money. Featuring advanced power management for" + 
                                " a battery life of 3 hours, a brilliant 15 inch display and all the power you'd need" + 
                                "to run your favourite Linux operating system.",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        item.setMainPage ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/computer_upfront.jpg","A laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2000+ XP") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );
	} catch (CreateException e) {
		out.println("Create exception: " + e.getMessage());
	} catch (NamingException e) {
		out.println("Naming exception: " + e.getMessage());
    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }


%>
    <!-- Adding Computer 2-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Multimedia Solution", "1800.00",
                                "Your complete multimedia solution.",
                                "All the power you need to watch your " +
                                "favourite movies and record your favourite TV programs with the built in" + 
                                " TV tuner card" + 
                                ".",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        item.setMainPage ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_angled.jpg", "A Laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2.0 GHz") );
        props.add ( propHome.create ( "CPU Type", "Intel Pentium 4") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "60 GB") );
        props.add ( propHome.create ( "RAM", "512 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM, 24x DVD-ROM") );
        props.add ( propHome.create ( "Sound Card", "5 channel") );
        props.add ( propHome.create ( "Video Card", "128 MB") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch Widescreen") );
        props.add ( propHome.create ( "Weight", "8 lbs") );
        props.add ( propHome.create ( "Thickness", "1.6 inch") );
        item.setProperties ( props );

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

    <!-- Adding Computer 3-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Gamer's laptop", "2800.00",
                                "Play the latest games right on your laptop.",
                                "Bored in a waiting room? pretending to pay attention in class? tired of your gameboy?"+ 
                                " Then this laptop is for you, with all the power to play the latest games right on " + 
                                " your laptop." + 
                                "",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_front.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2.0 GHz") );
        props.add ( propHome.create ( "CPU Type", "Intel Pentium") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "60 GB") );
        props.add ( propHome.create ( "RAM", "1024 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD Burner, 24 DVD-RW") );
        props.add ( propHome.create ( "Sound Card", "5 channel") );
        props.add ( propHome.create ( "Video Card", "128 MB") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch widescreen") );
        props.add ( propHome.create ( "Weight", "8 lbs") );
        props.add ( propHome.create ( "Thickness", "2.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding Computer 4-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Mobile Professional", "2400.00",
                                "The perfect mobile system for the professional on the go.",
                                "This great looking, slim and light Laptop is _the_ perfect solution" + 
                                " for the mobile professional. Do your work on the go and increase your" + 
                                " productivity without breaking your back.",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop.jpg", "A Laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "1.4 GHz") );
        props.add ( propHome.create ( "CPU Type", "Intel Pentium") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "12 inch") );
        props.add ( propHome.create ( "Weight", "4 lbs") );
        props.add ( propHome.create ( "Thickness", "1 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 5-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Super Mobile", "3000.00",
                                "The smallest, neatest laptop anywhere.",
                                "This tiny laptop is the ultimate mobile solution. Sleek, light and packed " + 
                                "with some serious power, its sure to impress" + 
                                ".",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_power_view.jpg", "A laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "1.2 GHz") );
        props.add ( propHome.create ( "CPU Type", "Intel Pentium") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "30 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "10 inch") );
        props.add ( propHome.create ( "Weight", "3 lbs") );
        props.add ( propHome.create ( "Thickness", "0.9 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 6-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Linux Compatible", "1500.00",
                                "Perfectly compatible with all major linux distros.",
                                "This sweet machine has been tested with over 50 of the most popular linux" + 
                                " distributions and guaranteed to be compatible with dozens of them." + 
                                "",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_side.jpg", "A Laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2000+ XP") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 7-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Name Brand", "3500.00",
                                "An expensive name brand.",
                                "Want to pay hundreds of dollars extra just for the name? This pc is for you!" + 
                                " A modest computer with a big name label, and corresponding price tag" + 
                                ".",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/lonely_laptop.jpg","A Laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2.0 GHz") );
        props.add ( propHome.create ( "CPU Type", "Intel Pentium M") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "512 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "5 channel") );
        props.add ( propHome.create ( "Video Card", "128 MB") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 8-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Student Special", "1200.00",
                                "A great laptop for students.",
                                "Get all the power your school work demands (ie watch great movies when goofing off!)" + 
                                " without emptying your wallet. Also, see our great warranties for protection against" + 
                                " all sorts of party-related damages.",  
                                "Laptops");
        item.setSpecialOffer ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/tabletop_laptop.jpg", "A laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "1.2 GHz") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "50 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "400 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 9-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Internet Special", "900.00",
                                "A super value deal for light-use computing.",
                                "Just want to surf the internet, send some emails and chat with your friends? " + 
                                "Then this is the laptop for you! Don't pay for the power you won't use " + 
                                ".",  
                                "Laptops");
        item.setMainPage ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/white_laptop.jpg", "A Laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "1 GHz") );
        props.add ( propHome.create ( "CPU Type", "Intel") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "24x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "16 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 10 -->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "No Name Special", "800.00",
                                "A feature packed super deal.",
                                "Get all the power you could ever use, with the lowest price tag. " + 
                                "Take advantage of the no name cpu architecture and save a bundle!" + 
                                "",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/computer_upfront.jpg", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "1 GHz ") );
        props.add ( propHome.create ( "CPU Type", "No Name") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "30 GB") );
        props.add ( propHome.create ( "RAM", "128 MB") );
        props.add ( propHome.create ( "Optical Drives", "24x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 11-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Destop Replacement", "1300.00",
                                "A full-featured desktop replacement.",
                                "Never forget that important file at home again. This power packed laptop " + 
                                "will do away with your need for a desktop at all! " + 
                                "",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_angled.jpg", "A Laptop", 0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2000+ XP") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

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

%>
    <!-- Adding a Computer 12-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Yet another laptop", "1300.00",
                                "Another exciting laptop.",
                                "Between you and me, they are all pretty much the same. So why not check out another " + 
                                "one! Its not like you are going to remember it anyway!" + 
                                "",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_front.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2000+ XP") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 13-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Suspiciously Cheap", "700.00",
                                "Believe the price!",
                                "You're not going to believe the price tag on this machine! its insane! A super hot " + 
                                "deal? or clearly a lemon? You decide, because we won't tell you. Got the guts to " +
                                "purchase this?",  
                                "Laptops");
        item.setMainPage ( Boolean.TRUE );
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "1 GHz") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "20 GB") );
        props.add ( propHome.create ( "RAM", "128 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 14 -->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Love at first sight", "1500.00",
                                "You can not help but fall in love.",
                                "This beautiful machine will capture you heart, mind and soul. (If you beleive in souls)" +
                                "  Gorgeous, sleek and stylish with all the power today's mobile professionals demands, " + 
                                "this perfect little thing can not dissapoint." + 
                                "",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_power_view.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2600+ XP") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "30 GB") );
        props.add ( propHome.create ( "RAM", "512 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "3 channel") );
        props.add ( propHome.create ( "Video Card", "128 MB") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "12 inch") );
        props.add ( propHome.create ( "Weight", "4 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 15-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Value Edition Laptop", "1200.00",
                                "Looks, power and affordibility.",
                                "Looks, power and affordibility, the only thing this little guy can't do, is " + 
                                "dissapoint. Take one home with you today!" +
                                ".",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/laptop_side.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2000+ XP") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "128 MB") );
        props.add ( propHome.create ( "Optical Drives", "32x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "5 channel") );
        props.add ( propHome.create ( "Video Card", "128 Mb") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 16-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Refurbished Deal", "800.00",
                                "It was once broke, no longer.",
                                "Get this great laptop at a super deal! and there's nothing wrong with it! (anymore)" +
                                " Its still covered by all our warranties (mostly) (Not as shown)" + 
                                ".",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/lonely_laptop.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2.0 GHz") );
        props.add ( propHome.create ( "CPU Type", "Intel Pentium") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "40 GB") );
        props.add ( propHome.create ( "RAM", "512 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "5 channel") );
        props.add ( propHome.create ( "Video Card", "64 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 17-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Clearly a ripoff", "2500.00",
                                "Don't even bother checking this out.",
                                "You know sometimes you walk into a store and see a computer that is CLEARLY a ripoff?" +
                                " Well, here's our version. There really is no good reason to justify this exuberant" +
                                " price, but we are confident someone somewhere will buy it. Maybe it could be you?",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/tabletop_laptop.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "2000+ XP") );
        props.add ( propHome.create ( "CPU Type", "AMD Athlon") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "60 GB") );
        props.add ( propHome.create ( "RAM", "256 MB") );
        props.add ( propHome.create ( "Optical Drives", "48x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "5 channel") );
        props.add ( propHome.create ( "Video Card", "64 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "800 MHz") );
        props.add ( propHome.create ( "Screen Size", "15 inch") );
        props.add ( propHome.create ( "Weight", "6 lbs") );
        props.add ( propHome.create ( "Thickness", "1.2 inch") );
        item.setProperties ( props );

    } catch (Exception e) {
        out.println("Cannot create Item: " + e.getMessage() );
    }
%>
    <!-- Adding a Computer 18-->
<%
    try {
        ItemHelperLocal Helper = helperHome.create();
        ItemLocal item = Helper.createItem(
                                "Legacy Hardware", "400.00",
                                "What a beast!",
                                "This clunky beast weighs a ton, and can barely run any modern software. But its"+ 
                                " classic and makes a great conversation piece! Come on, a true geek would buy it" +
                                ".",  
                                "Laptops");
        Collection pics = item.getPictures();
        pics.add ( picHome.create ( "images/white_laptop.jpg","A Laptop",  0 ) );
        item.setPictures ( pics );
        Collection props = item.getProperties ();
        props.add ( propHome.create ( "CPU Speed", "750 MHz") );
        props.add ( propHome.create ( "CPU Type", "Intel Pentium") );
        props.add ( propHome.create ( "Cache", "512 Kb") );
        props.add ( propHome.create ( "Hard Drive", "20 GB") );
        props.add ( propHome.create ( "RAM", "64 MB") );
        props.add ( propHome.create ( "Optical Drives", "12x CD-ROM") );
        props.add ( propHome.create ( "Sound Card", "none") );
        props.add ( propHome.create ( "Video Card", "32 MB Onboard") );
        props.add ( propHome.create ( "System Bus", "333 MHz") );
        props.add ( propHome.create ( "Screen Size", "14 inch") );
        props.add ( propHome.create ( "Weight", "10 lbs") );
        props.add ( propHome.create ( "Thickness", "2 inch") );
        item.setProperties ( props );

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