KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: bharatkasodariya on May 29, 2013, 02:01:50 pm

Title: To call one custom api from another api using adminengine obj
Post by: bharatkasodariya on May 29, 2013, 02:01:50 pm
Is it possible to call one custom method from another custom method with custom admin engine.

Below is sample of two custom class. I tried with kkAdminEng.getAdminEng()....  but didn't work

@SuppressWarnings("all")
public class DeleteProduct
{
    KKAdmin kkAdminEng = null;

    /**
     * Constructor
     */
     public DeleteProduct(KKAdmin _kkAdminEng)
     {
         kkAdminEng = _kkAdminEng;
     }

  public void deleteProduct(String sessionId, int productId) throws KKAdminException
     {               
      Sysout("deleteProduct");
                //Logic
               //Here I want to call another method deleteMiscItem which is also custom.
     }
}

@SuppressWarnings("all")
public class DeleteMiscItem
{
    KKAdmin kkAdminEng = null;

    /**
     * Constructor
     */
     public DeleteMiscItem(KKAdmin _kkAdminEng)
     {
         kkAdminEng = _kkAdminEng;
     }

     public void deleteMiscItem(String sessionId, int miTypeId) throws KKAdminException
     {               
      Sysout("deleteMiscItem");
                //Logic
     }
}
Title: Re: To call one custom api from another api using adminengine obj
Post by: ming on June 04, 2013, 04:59:37 pm
You can step back a level to achieve that.

Take a look at "C:\Program Files\KonaKart\custom\adminengine\gensrc\com\konakartadmin\app\KKAdminCustomEng.java"

This is the class that calls the individual API classes in a custom engine...

So you can modify how they get called in there...