KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: rkonakart on July 17, 2012, 06:04:43 pm

Title: Get logged in admin user in custom panels
Post by: rkonakart on July 17, 2012, 06:04:43 pm
Dears,

I need to get logged in user and language in admin through web application used in custom panels.

To be more clear: I will use the admin custom panels to show some features for admin depending on logged in user also depending on selected admin language.

Appreciate your help
Title: Re: Get logged in admin user in custom panels
Post by: ming on July 17, 2012, 06:31:23 pm
The custom panels are called with the sessionId added as a parameter to the URL (See User Guide).   You can use the Engine to get a Customer object from the sessionId...   the Customer has a locale.

public CustomerIf getCustomer(String sessionId) throws KKException;
Title: Re: Get logged in admin user in custom panels
Post by: Asset on July 18, 2012, 01:34:14 pm
Dear ming,

Thanks for your clarification but I have problem in creating new KKAppEng. I got this exception :

Caused by: java.lang.NullPointerException
   at com.konakart.al.KKAppEng.getEngConfCopy(Unknown Source)
   at com.konakart.al.KKAppEng.getAServerEngineInstance(Unknown Source)

Remark: I have my own project not "kkEclipse" project and I added all konakart jars and properties file in my own project.
Title: Re: Get logged in admin user in custom panels
Post by: ming on July 21, 2012, 06:50:57 am
Not sure what you're trying to achieve there... instantiating a client engine on an Admin Panel.  Normally the client engine is used for the storefront.

Depending on your objectives you might want to try defining your EngineConfig which appears to be null?    Also you should probably be using this constructor if you aren't already:

public KKAppEng(EngineConfigIf engConf)