Examples of PetstoreLocal


Examples of xpetstore.services.petstore.interfaces.PetstoreLocal

                                       HttpServletResponse response )
        throws Exception
    {
        CategoryForm  frm = ( CategoryForm ) form;
        String        categoryId = frm.getCategoryId(  );
        PetstoreLocal petstore = getPetstore(  );

        /* Category*/
        CategoryValue category = petstore.getCategory( categoryId );
        frm.setCategoryValue( category );

        /* Items */
        Collection products = petstore.getProducts( categoryId, 0, Integer.MAX_VALUE ).getList(  );
        frm.setProductValues( products );

        return mapping.findForward( SUCCESS );
    }
View Full Code Here

Examples of xpetstore.services.petstore.interfaces.PetstoreLocal

        throws Exception
    {
        SignonForm    frm = ( SignonForm ) form;
        AccountValue  account = frm.getAccountValue(  );
        String        redirectUri = frm.getRedirectUri(  );
        PetstoreLocal petstore = getPetstore(  );

        if ( petstore.authenticate( account.getUserId(  ), account.getPassword(  ) ) )
        {
            CustomerValue cust = petstore.getCustomer( account.getUserId(  ) );
            initSession( cust, request );

            if ( ( redirectUri == null ) || ( redirectUri.length(  ) == 0 ) )
            {
                return mapping.findForward( SUCCESS );
View Full Code Here

Examples of xpetstore.services.petstore.interfaces.PetstoreLocal

                                       HttpServletResponse response )
        throws Exception
    {
        OrderForm     frm = ( OrderForm ) form;
        String        userId = ( String ) request.getSession(  ).getAttribute( USERID_KEY );
        PetstoreLocal petstore = getPetstore(  );

        /* Proceed the order */
        HashMap items = new HashMap(  );

        for ( int i = 0, len = frm.getItemId(  ).length; i < len; i++ )
        {
            items.put( frm.getItemId(  )[ i ], new Integer( frm.getQuantity(  )[ i ] ) );
        }

        Integer orderUId = petstore.createOrder( userId, new Date(  ), items );
        frm.getOrderValue(  ).setOrderUId( orderUId );

        /* Invalidating the current cart */
        CartLocal cart = getCart( false, request );

View Full Code Here

Examples of xpetstore.services.petstore.interfaces.PetstoreLocal

                                       HttpServletResponse response )
        throws Exception
    {
        ItemForm      frm = ( ItemForm ) form;
        String        itemId = frm.getItemId(  );
        PetstoreLocal petstore = getPetstore(  );

        /* Item */
        ItemValue item = petstore.getItem( itemId );
        frm.setItemValue( item );

        /* Product */
        ProductValue product = petstore.getProductByItem( itemId );
        frm.setProductValue( product );

        return mapping.findForward( SUCCESS );
    }
View Full Code Here

Examples of xpetstore.services.petstore.interfaces.PetstoreLocal

                                       HttpServletResponse response )
        throws Exception
    {
        ProductForm   frm = ( ProductForm ) form;
        String        productId = frm.getProductId(  );
        PetstoreLocal petstore = getPetstore(  );

        /* Product */
        ProductValue product = petstore.getProduct( productId );
        frm.setProductValue( product );

        /* Items */
        Collection items = petstore.getItems( productId, 0, Integer.MAX_VALUE ).getList(  );
        frm.setItemValues( items );

        return mapping.findForward( SUCCESS );
    }
View Full Code Here

Examples of xpetstore.services.petstore.interfaces.PetstoreLocal

                                       HttpServletResponse response )
        throws Exception
    {
        SearchForm    frm = ( SearchForm ) form;
        String        keyword = frm.getKeyword(  );
        PetstoreLocal petstore = getPetstore(  );

        Collection    products = petstore.searchProducts( keyword, 0, Integer.MAX_VALUE ).getList(  );
        frm.setProductValues( products );

        return mapping.findForward( SUCCESS );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.