• Welcome to KonaKart Community Forum. Please login or sign up.
 

Configuration of Konakart Portlet for Liferay

Started by gmi, August 07, 2010, 08:47:24 am

Previous topic - Next topic

gmi

Hi,

I have just installed the KonaKart Portlet and the KonaKart Admin Portlet for Liferay and I have two questions:

1. Single sign-on is possible for the admin portlet, the configuration for that is explained in the Installation.pdf of KonaKart and I have also done so.

But is it also possible that Liferay users are already logged in automatically in the KonaKart shop with the Liferay login and they not even need to register in the KonaKart shop again and log in again?

2. I also want to know whether it is possible to configure the Liferay-Search to find for example products in the KonaKart shop?


Thanks in advance!

trevor

Quote1. Single sign-on is possible for the admin portlet, the configuration for that is explained in the Installation.pdf of KonaKart and I have also done so.

But is it also possible that Liferay users are already logged in automatically in the KonaKart shop with the Liferay login and they not even need to register in the KonaKart shop again and log in again?


Yes. You have to write some code in the login integration manager to interface with Liferay. If all user information is contained within Liferay then it's probably best to register the customer in KonaKart as a temporary customer behind the scenes (using name, address etc. read from Liferay) whenever he needs to checkout .

Quote2. I also want to know whether it is possible to configure the Liferay-Search to find for example products in the KonaKart shop?


All KonaKart functionality is available through the APIs so I assume that this should be possible.

dnavarro

Quote from: gmi on August 07, 2010, 08:47:24 am
Hi,

I have just installed the KonaKart Portlet and the KonaKart Admin Portlet for Liferay and I have two questions:

1. Single sign-on is possible for the admin portlet, the configuration for that is explained in the Installation.pdf of KonaKart and I have also done so.

But is it also possible that Liferay users are already logged in automatically in the KonaKart shop with the Liferay login and they not even need to register in the KonaKart shop again and log in again?



Thanks in advance!



1.1 Implement something like
com.isoco.shop.util.ShopingCartLoginHandler


package com.isoco.shop.util;

import org.apache.log4j.Logger;

import com.konakart.app.KKException;
import com.konakart.bl.LoginIntegrationMgrInterface;

/**
* Checks credentials
*
* More information:
* http://www.konakart.com/docs/CustomCredentialChecking.html
*
*/
public class ShopingCartLoginHandler implements LoginIntegrationMgrInterface {

private final Logger log = Logger.getLogger(ShopingCartLoginHandler.class);
    /* (non-Javadoc)
     * @see com.konakart.bl.LoginIntegrationMgrInterface#checkCredentials(java.lang.String, java.lang.String)
     */
   
    /**
     * The checkCredentials() method can return the following values:
     *
     * A negative number in order for the login attempt to fail.
     * The KonaKart login() method will return a null sessionId.
     *
     * Zero, to signal that this method is not implemented.
     * The KonaKart login() method will perform the credential check.
     *
     * A positive number for the login attempt to pass.
     * The KonaKart login() will not check credentials,
     * and will log in the customer, returning a valid session id.
     *
     * @param login
     * @param password
     * @return int
     */
    public int checkCredentials(String arg0, String arg1) throws KKException {
        /**
         * Returns always 1. Liferay will make the work.
         *
         */
    if (log.isDebugEnabled()){
    log.debug("The KonaKart login() will not check credentials, " +
    "and will log in the customer, returning a valid session id.");
    }
   
        return 1;
    }

}



1.1 Goes to konakartadmin:  Setting > Security and ..  > "Login Integration Class" = com.isoco.shop.util.ShopingCartLoginHandler


This is the begining. If your shop uses just one Portlet, may be it will work, if you "portletize" the Konakart actions (i.e. one action, one portlet), then... you will have big big big problems with contexts.



To register a user in Liferay and Konakart at same time you will need:
1. to reimplement   com.liferay.portlet.login.action.CreateAccountAction
to create your new konakart user, and insert the new data.

2. save the Konakart ID in Liferay DB. (I did it in a expando value.)

3. triggers for updates in Liferay, because a user can change his/her personal data, and Konakart must be updated.

4...  Lots of work.




Luck.