KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: mtoon on May 09, 2008, 07:23:38 pm

Title: Creating a new engine
Post by: mtoon on May 09, 2008, 07:23:38 pm
Is it possible to descend from the com.konakart.app.KKEng class and update the konakart_app.properties to reflect that?

i.e.:
konakart.app.engineclass=com.my.engine.class

would the kkEng variable in all the JSPs be updated from this change?

Thank you!
Title: Re: Creating a new engine
Post by: mtoon on May 09, 2008, 08:36:13 pm
I actually figured this out... 

1) Created a new class that descended from KKEng
import com.konakart.app.*;

public class FDKKEng extends KKEng  {
   
    public FDKKEng() throws com.konakart.app.KKException {
        System.out.println("FDKKEng Constructor");
    }
   
    public FDKKEng(String value) throws com.konakart.app.KKException {
        System.out.println("FDKKEng Value Constructor: "+value);
    }
   
    public String getTestValue() {
        return "Test Value";
    }

}

2) Changed the konakart.app.engineclass to the new class.
3) Added the following to the JSPs..
        <bean:define id="fdEng" name="kkEng" property="eng" type="com.myclass.FDKKEng"/>

4) New instance can be accessed in the JSP like:
        <%=fdEng.getTestValue() %>