• Welcome to KonaKart Community Forum. Please login or sign up.
 
April 19, 2024, 07:34:09 pm

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - ssharma

1
hi,
       I am getting description field value null for all the products "PRODUCTS" table. Here is the sample code. Please let me know ASAP whats wrong with this code?

ProductsIf kkProducts = null;
           
CategoryIf[] categories = eng.getCategoryTree(DEFAULT_LANGUAGE, true);
for(int catNum = 0 ; catNum < categories.length ; catNum++)
{
    if(categories[catNum].getName().equalsIgnoreCase("services"))
    {
        CategoryIf[] subCategories = categories[catNum].getChildren();
        for(int subCatNum=0;subCatNum<subCategories.length;subCatNum++)
        {
            if(subCategories[subCatNum].getName().equalsIgnoreCase("new"))
            {
                CategoryIf[] subSubCategories = subCategories[subCatNum].getChildren();
                //The following loop will parse through all the Master products under new
                for(int subSubCatNum = 0; subSubCatNum<subSubCategories.length; subSubCatNum++)
                {
                    System.out.println(subSubCategories[subSubCatNum].getName());
                    System.out.println(subSubCategories[subSubCatNum].getNumberOfProducts());
                    kkProducts = eng.getProductsPerCategory(sessionId, dataDesc, subSubCategories[subSubCatNum].getId(), true, DEFAULT_LANGUAGE);
                }
            }
        }
    }
}

ProductIf[] products = kkProducts.getProductArray();
for(ProductIf prd : products){
    System.out.println("Description = " + prd.getDescription());
}

It gives "Description = null" for all products, why? Anybody, let me know quick. Thanks.
2
hi ,
     i am using konakart's import export utility. I am successfully update the fields of existing products_id.
But when i am creating new products_id and all the fields  in exportedDataEng.txt  and run ImportToKKUsingEng.bat The new products are not inserted into the database.
      please guide me for resolving this problem.
regards
Sangeeta sharma
3
Hi,
      I want to develop code which returns price according to cutomer and its
Group. I insert price1,price2,price 3 and  also in products table and  in products_attribute table OPTIONS_VALUES_PRICE_1, OPTIONS_VALUES_PRICE_2, OPTIONS_VALUES_PRICE_3.
                I also passed that customer in baseapiexample for connection but I am geeting 
The price1 instead of price1 and price2.
I wrie this code
package org.argus.konakart;

import com.konakart.app.Basket;
import com.konakart.app.OrderStatusHistory;
import com.konakart.appif.BasketIf;
import com.konakart.appif.OptionIf;
import com.konakart.appif.OrderIf;
import com.konakart.appif.OrderStatusHistoryIf;
import com.konakart.appif.PaymentDetailsIf;
import com.konakart.appif.ProductIf;
import com.konakart.appif.ShippingQuoteIf;

/**
* This class shows how to call the KonaKart API to insert an order. Before running you may
* have to edit BaseApiExample.java to change the username and password used to log into the engine.
* The default values are root@localhost / password .
*/
public class InsertOrder extends BaseApiExample
{
   
    private static int PROD_WITH_OPTIONS_ID = 72057;

    private static int PROD_ID = 70840;

    private static int PENDING = 1;

    private static int PROCESSING = 2;

    public static void main(String[] args)
    {
        try
        {
            init();
           
            ProductIf prod = eng.getProduct(sessionId, PROD_WITH_OPTIONS_ID, DEFAULT_LANGUAGE);

            if (prod.getOpts() != null && prod.getOpts().length >= 5)
            {
               
                BasketIf item = new Basket();

                item.setProductId(PROD_WITH_OPTIONS_ID);
               
                item.setQuantity(1);
             
                //item.setOpts(opts);

                eng.addToBasket(sessionId, 0, item);
               
            }

            BasketIf item1 = new Basket();
            item1.setProductId(PROD_ID);
            item1.setQuantity(1);
            eng.addToBasket(sessionId, 0, item1);
            BasketIf[] items = eng.getBasketItemsPerCustomer(sessionId, 0, DEFAULT_LANGUAGE);
           
            System.out.println("Yhe length is :;" +items.length);
           
            OrderIf order = eng.createOrder(sessionId, items, DEFAULT_LANGUAGE);
            //System.out.println("The id isd ::" +order.getId());
           //order.getOrderProducts()[0].getProduct().setPriceExTax(arg0);
            ShippingQuoteIf[] sQuotes = eng.getShippingQuotes(order, DEFAULT_LANGUAGE);
            if (sQuotes != null && sQuotes.length > 0)
            {
                order.setShippingQuote(sQuotes[0]);
            }

            PaymentDetailsIf[] pGateways = eng.getPaymentGateways(order, DEFAULT_LANGUAGE);
            if (pGateways != null && pGateways.length > 0)
            {
                order.setPaymentDetails(pGateways[0]);
            }
            order = eng.getOrderTotals(order, DEFAULT_LANGUAGE);

           
            order.setStatus(PENDING);

           
            OrderStatusHistoryIf status = new OrderStatusHistory();
            status.setOrderStatusId(PENDING);
            status.setComments("Waiting for Payment");

            OrderStatusHistoryIf[] statusArray = new OrderStatusHistoryIf[]
            { status };
            order.setStatusTrail(statusArray);

            order.setCustom1("custom1");
            order.setCustom5("custom5");

         
            int orderId = eng.saveOrder(sessionId, order, DEFAULT_LANGUAGE);
            System.out.println("<<<<<<<<<<<<<<<<The order id is :: " +orderId);
           
            eng.changeOrderStatus(sessionId, orderId, PROCESSING,false,
            "We've got the dosh, now let's ship it");
   
            order = eng.getOrder(sessionId, orderId, DEFAULT_LANGUAGE);
           // order.setCouponCode("001");
            System.out.println(order.toString());
      } catch (Exception e)
        {
            e.printStackTrace();
        }

    }

}


4
hi
     i have one doubt merchandising like upsell products related information stored where in database.
5
hi i used com.konakart.app.DataDescConstants.ORDER_BY_PRICE_ASCENDING but i am not getting products sorted by price .Please help me to resolve this problem
package org.argus.konakart;

import org.medicalert.website.idm.entities.Product;

import com.konakart.app.DataDescriptor;
import com.konakart.app.ProductSearch;
import com.konakart.appif.ProductIf;
import com.konakart.appif.ProductSearchIf;
import com.konakart.appif.ProductsIf;

public class sort_Byprice extends BaseApiExample
{

   public static void main(String[] args)
   {
      try
      {
         init();
         int i;
         ProductsIf output;
         ProductIf data[];
         
         DataDescriptor dataDesc = new DataDescriptor();
         //DataDescriptorIf dataDesc = new DataDescriptorIf();
         dataDesc.setOffset(0);
         dataDesc.setLimit(50);
         dataDesc.setOrderBy_1(com.konakart.app.DataDescConstants.ORDER_BY_PRICE_DESCENDING);
         //dataDesc.setOrderBy_1(com.konakart.app.DataDescConstants.ORDER_BY_NAME_ASCENDING );
         
         output=eng.getAllProducts(sessionId,dataDesc,-1);         
         data=output.getProductArray();
         System.out.println("\n\n\n\n\n\n\n\n\n");
         
         System.out.println("=====Total no of product is : "+output.getTotalNumProducts()+" ===========");
         //output.getTotalNumProducts()
         for(i=0;i<output.getTotalNumProducts();i++)
         {
            System.out.println("Product name is ::" +data.getPriceExTax());
         }
          
         
      }
      catch(Exception e)
      {
         System.out.println("The exception is ::" +e);
      }
      
   }

}



::::::output:::::


=====Total no of product is : 13 ===========
Product price is ::299.9900
Product price is ::499.9999
Product price is ::29.9900
Product price is ::32.0000
Product price is ::54.9900
Product price is ::79.9900
Product price is ::89.9900
Product price is ::99.9900
Product price is ::123.0000
Product price is ::100.0000
Product price is ::113.0000
Product price is ::311.0000
Product price is ::500.0000
6
hi
i want to fetch products sort byprice and sort by datewise.Is there any method available in konakart API ??
please guide me as son as possible.
7
hi
i have confision about ,konakart gives the facility that any one can add the products into the cart without logging.\where is the all product information which is added by user into the basket is stored before checkout?is there any temprory table??? or anything else.i want to access that info from api.Can i do this???please help me
8
hi,
    I want to edit and the update products attributes and the values are read from the cvs file .the following is my code for that that is working right for insert bt nt for edit.the new values for option is not edited and price prrfix also not edited.can u please verify mu code and guide me.


package org.argus.konakart;

import java.math.BigDecimal;
import java.util.*;
import com.konakart.app.KKException;
import com.konakart.app.DataDescriptor;
import com.konakartadmin.app.*;
import com.konakart.appif.ProductsIf;
import com.konakart.appif.ProductIf;
import com.konakart.appif.OptionIf;
import com.konakart.appif.DataDescriptorIf;
import com.konakart.al.ProdOption;
import java.io.FileReader;
import au.com.bytecode.opencsv.CSVReader;

public class importProductAttribute extends BaseApiExample
{
   private static final String ATTRIBUTE_FILE="example/attributes.csv";
   static int flag;
   
   public static void main(String[] args)
   {
      try
      {
         init();
         ProductsIf output;
         ProductIf data;
         
         
         OptionIf options[];
         
         DataDescriptor dataDesc = new DataDescriptor();
         dataDesc.setOffset(0);
         dataDesc.setLimit(1);
         
         output=eng.getAllProducts(sessionId,dataDesc,-1);
         
         CSVReader csvreader = new CSVReader(new FileReader(ATTRIBUTE_FILE));
         String[] nextLine;
         
            while ((nextLine = csvreader.readNext()) != null)
               {
                  int pid = Integer.parseInt(nextLine[1]);
                  data=eng.getProduct(sessionId,pid ,-1);
                  options=data.getOpts();
                  int flag = 0;
                  for(int i=0;i<options.length;i++)
                  {
                     System.out.println("\n\n\n\n");
                     System.out.println("the option id ::" +options.getId());
                     System.out.println("The option value id is :::" +options.getValueId());
                     System.out.println("The option value id is :::" +options.getValue());
                     int opt_id = options.getId();
                     int opt_valid = options.getValueId();
                     if(opt_id == (Integer.parseInt(nextLine[2])) && opt_valid == (Integer.parseInt(nextLine[3])))
                     {
                        //System.out.println("the attribute for updation.");
                        flag = 1;
                     }
            
                  }
                  System.out.println("The flag is ::" +flag);
                  if(flag == 1)
                  {
                     System.out.println("for updation");
                     AdminProductAttribute adminproductattribute = new AdminProductAttribute();
                       adminproductattribute.setId(Integer.parseInt(nextLine[0]));
                       //adminproductattribute.setProductId(14);
                       adminproductattribute.setProductId(Integer.parseInt(nextLine[1]));
                       adminproductattribute.setOptionId(Integer.parseInt(nextLine[2]));
                       adminproductattribute.setOptionValueId(Integer.parseInt(nextLine[3]));
                       adminproductattribute.setPricePrefix(nextLine[4]);
                       adminproductattribute.setPrice(new BigDecimal(Integer.parseInt(nextLine[5])));
                       System.out.println("the price is ::" +(Integer.parseInt(nextLine[5])));
                       kkadmin.editProductAttribute(sessionId,adminproductattribute);
                     
                  }
                  else
                  {
                     System.out.println("for insert");
                     AdminProductAttribute adminproductattribute = new AdminProductAttribute();
                     adminproductattribute.setId(Integer.parseInt(nextLine[0]));
                     //adminproductattribute.setProductId(14);
                     adminproductattribute.setProductId(Integer.parseInt(nextLine[1]));
                     adminproductattribute.setOptionId(Integer.parseInt(nextLine[2]));
                     adminproductattribute.setOptionValueId(Integer.parseInt(nextLine[3]));
                     adminproductattribute.setPricePrefix(nextLine[4]);
                     adminproductattribute.setPrice(new BigDecimal(Integer.parseInt(nextLine[5])));
                     int newattributeid = kkadmin.insertProductAttribute(sessionId, adminproductattribute);
                     System.out.println("the data is sucessfullu inserted.");
                     System.out.println("The new attribute id is ::" +newattributeid);
                  }
               }
            
         
      
         
         
            /*for(int i=0;i<options.length;i++)
               {
                  System.out.println("\n\n\n\n");
                  System.out.println("the option id ::" +options.getId());
                  System.out.println("The option value id is :::" +options.getValueId());
                  System.out.println("The option value id is :::" +options.getValue());
            
               }*/
         
       
                          
                          /*{
                             System.out.println("updated.");
                             AdminProductAttribute adminproductattribute = new AdminProductAttribute();
                               adminproductattribute.setId(Integer.parseInt(nextLine[0]));
                               //adminproductattribute.setProductId(14);
                               adminproductattribute.setProductId(Integer.parseInt(nextLine[1]));
                               adminproductattribute.setOptionId(Integer.parseInt(nextLine[2]));
                               adminproductattribute.setOptionValueId(Integer.parseInt(nextLine[3]));
                               adminproductattribute.setPricePrefix(nextLine[4]);
                               adminproductattribute.setPrice(new BigDecimal(Integer.parseInt(nextLine[5])));
                               kkadmin.editProductAttribute(sessionId,adminproductattribute);
                               break;
                               
                          }
                       else
                          {
                             AdminProductAttribute adminproductattribute = new AdminProductAttribute();
                             adminproductattribute.setId(Integer.parseInt(nextLine[0]));
                             //adminproductattribute.setProductId(14);
                             adminproductattribute.setProductId(Integer.parseInt(nextLine[1]));
                             adminproductattribute.setOptionId(Integer.parseInt(nextLine[2]));
                             adminproductattribute.setOptionValueId(Integer.parseInt(nextLine[3]));
                             adminproductattribute.setPricePrefix(nextLine[4]);
                             adminproductattribute.setPrice(new BigDecimal(Integer.parseInt(nextLine[5])));
                             int newattributeid = kkadmin.insertProductAttribute(sessionId, adminproductattribute);
                             System.out.println("the data is sucessfullu inserted.");
                             System.out.println("The new attribute id is ::" +newattributeid);
                             break;
                             
                          }
                       */
                       

                    
                 
              
         
      }
      catch(Exception e)
      {
         System.out.println("The exception is ::" +e);
      }
      
         

   }
   
   
}
9
hi,
i want to import products'attributes options  in to the konakart? can it possible .If yes please guide me.
10
hi,
i am using ImportToKKUsingEng for importing data from the text file .I want to export the data into exel file .will it possible.if please guide me how?
11
hi
     i set class path for ImportToKKUsingEng.txt still i am getting following exception

PropertyFileFinder.findProperties() Could not find exportedDataEng on the classpath
Exception in thread "main" com.konakart.app.KKException: Could not find exported
DataEng on the classpath
        at com.konakart.util.PropertyFileFinder.findProperties(Unknown Source)
        at com.konakart.importer.ImportController.init(Unknown Source)
        at com.konakart.importer.ImportController.doImport(Unknown Source)
        at com.konakart.importer.ImportRunner.main(Unknown Source)
please help me for solving this problem
12
hi
please help me how to import data from the text in konakart
13
hi  konakart team ,
i want to import database in konakart i just execute ExportFromKKUsingEng.bat file and got the following errors. and i am getting proper help for - how to import database can u help me and sending proper steps for this. i read pdf also bt geeting to much.please see the errors and help me.




================================================================================
======================
Send a file containing product data to the KonaKart database using the KK Engine

================================================================================
======================
Properties file found = /C:/Program%20Files/KonaKart/import_export/classes/kkImp
orter.properties
log4j:WARN No appenders could be found for logger (org.apache.commons.configurat
ion.ConfigurationUtils).
log4j:WARN Please initialize the log4j system properly.
21-Apr 11:14:38 INFO  (?:init:?) Finished Initialising Log4j
21-Apr 11:14:38 INFO  (?:init:?) The configuration file being used is /C:/Progra
m%20Files/KonaKart/import_export/classes/konakartadmin.properties
21-Apr 11:14:38 INFO  (?:init:?) Initialising KKAdmin
21-Apr 11:14:38 INFO  (?:initKonakart:?) KonaKart Admin V2.2.4.0 built 11:00AM 1
8-Mar-2008 GMT
21-Apr 11:14:38 INFO  (?:init:?) Finished Initialising KonaKartAdmin
21-Apr 11:14:38 INFO  (?:init:?) Initialising Torque
21-Apr 11:14:38 INFO  (?:init:?) Initialising KonaKart-Torque for org.apache.tor
que.adapter.DBMM
21-Apr 11:14:38 INFO  (?:init:?) Finished Initialising Torque
21-Apr 11:14:38 INFO  (?:login:?) User 'admin@konakart.com' has just logged in t
o the Admin App
PropertyFileFinder.findProperties() Could not find exportedDataEng on the classp
ath
21-Apr 11:14:38 ERROR (?:doImport:?) Could not find exportedDataEng on the class
path
Exception in thread "main" com.konakart.app.KKException: Could not find exported
DataEng on the classpath
        at com.konakart.util.PropertyFileFinder.findProperties(Unknown Source)
        at com.konakart.importer.ImportController.init(Unknown Source)
        at com.konakart.importer.ImportController.doImport(Unknown Source)
        at com.konakart.importer.ImportRunner.main(Unknown Source)
14
hi
    i stored 
<?xml version="1.0" encoding="UTF-8"?>
<neclace>
   <material>gold</material>
   <carat>24</carat>
</neclace>
and i want to access this comparision data thorogh API . Can i ? And where the neclace xml file stored.Please help me to solve this problem.
15
hi,
   thanks for new version of konakart. i want to do product comparison and for this konakart added a new "comparison" attribute to the Product object. The purpose of this attribute is to store structured data such as xml that can be used to compare features with other products.

i want to ask is there any pre xml tags are defined or not ?and can u help me for this in detail.
16
hi
    i want to search product's detaills according to category wise but for gettng product description i have to include this line          

      forDesc=eng.getProduct(sessionId,relProduct.getId(),-1);


because by using this code i am not able to get products description

                                products=eng.searchForProducts(null, dataDesc, prodSearch, -1);
            relProduct=products.getProductArray();

and for this databsse call inincreased  and it is not sufficient so please help me for solving that problem

package org.argus.konakart;
import java.math.BigDecimal;
import java.util.*;

import org.medicalert.website.idm.entities.Product;
import org.medicalert.website.idm.entities.impl.ProductImpl;

import com.konakart.app.DataDescriptor;
import com.konakart.app.Products;
import com.konakart.appif.ProductIf;
import com.konakart.appif.ProductsIf;
import com.konakart.app.ProductSearch;
import com.konakart.appif.CategoryIf;


public class GetCategory_Detaila extends BaseApiExample
{   
    public static void main(String[] args)
    {
        try
        {
           // Initialize the connection with konakart and acquire session Id
      
      GetCategoryInfo();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    public static void GetCategoryInfo()
    {
       Date senddt = new Date();
      long d1 = senddt.getTime();
       init();
       if(sessionId == null)
       {
          System.out.println("not exist");
       }
       try
       {
      int i;
      CategoryIf category[]=eng.getCategoryTree(-1,true);
      CategoryIf subcategory[];
      
      int no_sub,j,l;

      // Create Data Desc object
      DataDescriptor dataDesc = new DataDescriptor();
      dataDesc.setOffset(0);
      // Set maximum no of row fetched from database at a time.
      dataDesc.setLimit(50);
      
      ProductSearch prodSearch = new ProductSearch();
      
        ProductsIf products =null;
       // eng.getProduct(sessionId,product_id,-1);
      //eng.searchForProducts(null, dataDesc, prodSearch, -1);
      
      
      ProductIf relProduct[];
      ProductIf output;
      
      int total_category;
      total_category = category.length;
      System.out.println("The total categoies are :::" +total_category);
      System.out.println("\n =================================================== \n");   
      
      HashMap<String,List> temp = new HashMap<String,List>();
      
      for(j=0;j<total_category;j++)
      {
         subcategory=category[j].getChildren();      
         no_sub=category[j].getNumberOfProducts();
         System.out.println("\n\nCategory :"+category[j].getName()+ "("+no_sub +")");
         List productList = new ArrayList();
         ProductIf forDesc;
         for(l=0;l<subcategory.length;l++){
            prodSearch.setCategoryId(subcategory[l].getId());               
            prodSearch.setSearchInSubCats(true);
            products=eng.searchForProducts(null, dataDesc, prodSearch, -1);
            relProduct=products.getProductArray();
            //output=eng.getProduct(sessionId,relProduct[l].getId(),-1);
            
            Product product = null;
            
            
            for(i=0;i<relProduct.length;i++){
               
               //System.out.println("Products name is :;" +relProduct);
               product = new ProductImpl();
               product.setProductId(String.valueOf(relProduct.getId()));
               product.setProductName(relProduct.getName());
               product.setPrice(relProduct.getPriceExTax().doubleValue());
               product.setDiscountedPrice(0.0);
      
               //product.setProductDescription(relProduct.getDescription());
               product.setProductImage(relProduct.getImage());
               forDesc=eng.getProduct(sessionId,relProduct.getId(),-1);
               product.setProductDescription(forDesc.getDescription());
               System.out.println("Desc is "+product.getProductDescription());
               productList.add(product);
         
               
            }
            
         }
         System.out.println("Size of List :: "+productList.size());
         temp.put(category[j].getName(), productList);
      }
      
      /*
      System.out.println("----------------------------------");
      List<Product> l1 = null;
      for(String keyStr : temp.keySet()){
         System.out.println(keyStr);
         l1 = temp.get(keyStr);
         for(Product p : l1){
            System.out.println(p.getProductId());
         }
      }
      System.out.println("----------------------------------");
      List tempList = temp.get("Software");
      
      System.out.println(tempList.size());
      */
      /*for(int t=0;t<temp.size();t++)
      {
         temp.get(key)
      }*/
      Date recdt = new Date();
      long d2 = recdt.getTime();
      long diff=d2-d1;
      System.out.println("Time to execute progrma in miliseconds :  "+ diff);
   }
       catch(Exception e)
       {
             System.out.println("Error is"+e);
       }
     }
}
17
hi ,
i want to add fedex shipping module in konakart. Can you help me for this .
And ,can you list down all the places where it requires change.
18
hi,
   i want to search product details according to manufacturer . i got all the manufacturer -name bt i didnt get product details.And there is no method available in konakart API to get total number of products so please help me .
package org.argus.konakart;

import com.konakart.app.DataDescriptor;
import com.konakart.app.Manufacturer;
import com.konakart.app.ProductSearch;
import com.konakart.appif.ManufacturerIf;
import com.konakart.appif.ProductIf;
import com.konakart.appif.ProductsIf;

public class price extends BaseApiExample
{

   public static void main(String[] args)
   {
      try
      {
         Search_Criteria();
      }
      catch(Exception e)
      {
         e.printStackTrace();
      }
   }
   public static void Search_Criteria()
   {
      init();
      try
         {   
            ManufacturerIf manufacturer[];
            DataDescriptor datadesc = new DataDescriptor();
            datadesc.setOffset(0);
            datadesc.setLimit(0);
            ProductSearch prodsearch = new ProductSearch();
            eng.searchForProducts(null, datadesc, prodsearch, -1);
            manufacturer = eng.getAllManufacturers();
            ProductIf product_list[];
            System.out.println("The total number of manufacturer are ::" +manufacturer.length);
            
                     for(int i=0;i<manufacturer.length;i++)
                     {
                           ProductsIf products;
                           System.out.println("The name of manufacturer is :::: " +manufacturer.getName());
                           prodsearch.setManufacturerId(manufacturer.getId());
                           products = eng.getAllProducts(sessionId,datadesc, -1);
                           product_list = products.getProductArray();
                           //System.out.println("The name eof product is ::: "  +product_list.getManufacturerName());
                           //prodsearch.setSearchInSubCats(true);
                           products = eng.searchForProducts(null, datadesc, prodsearch, -1);
                           //product_list = products.getProductArray();
                                 for(int j=0;j<5;j++ )
                                    {
                                       System.out.println("The name of product is :::" +product_list.getName());
                                    }   
                     }
         }
      catch(Exception e)
      {
         e.printStackTrace();
      }
      
   }
}



19
hi
i am getting the method from which i will get the total number of categories in root.
20
hi ,
     I want to fetch product_attributes through konakart API bt i found null pointer exception. Can anybody help me to found products_attributes. i am posting the code also.
import java.util.*;
import java.io.*;
import com.konakart.app.KKException;
import com.konakart.app.DataDescriptor;
import com.konakartadmin.app.*;
import com.konakart.appif.ProductsIf;
import com.konakart.appif.ProductIf;
import com.konakart.appif.OptionIf;
public class FetchProductPrice4 extends BaseApiExample
{
   
    public static void main(String[] args)
    {
        try
        {
      init(); 
      int i;
      ProductsIf output;
      ProductIf data[];
      OptionIf option_data[];
      DataDescriptor dataDesc = new DataDescriptor();
      //DataDescriptorIf dataDesc = new DataDescriptorIf();
      dataDesc.setOffset(0);
      dataDesc.setLimit(50);
      output=eng.getAllProducts(sessionId,dataDesc,-1);
      data=output.getProductArray();
      System.out.println("\n\n\n\n\n\n\n\n\n");
      for(i=0;i<output.getTotalNumProducts();i++)
      {
            
            option_data = data.getOpts();
            System.out.println("\nAfter the getopts method");
            System.out.println("The value of i is :: " +option_data);
            System.out.println("The price is  ::: " +option_data.getValueId());
         
      }
   
      
      
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}