示例#1
0
 /**
  * Utility method to set a KKCookie when we have the customerUuid
  *
  * @param customerUuid
  * @param attrId
  * @param attrValue
  * @param kkAppEng
  * @throws KKException
  */
 protected void setKKCookie(
     String customerUuid, String attrId, String attrValue, KKAppEng kkAppEng) throws KKException {
   if (customerUuid != null) {
     KKCookieIf kkCookie = new KKCookie();
     kkCookie.setCustomerUuid(customerUuid);
     kkCookie.setAttributeId(attrId);
     kkCookie.setAttributeValue(attrValue);
     kkAppEng.getEng().setCookie(kkCookie);
   }
 }
示例#2
0
 /**
  * Utility method to read a KKCookie when we have the CustomerUuid
  *
  * @param customerUuid
  * @param attrId
  * @param kkAppEng
  * @return the value of the cookie
  * @throws KKException
  */
 protected String getKKCookie(String customerUuid, String attrId, KKAppEng kkAppEng)
     throws KKException {
   if (customerUuid == null) {
     return null;
   }
   KKCookieIf kkCookie = kkAppEng.getEng().getCookie(customerUuid, attrId);
   if (kkCookie != null) {
     return kkCookie.getAttributeValue();
   }
   return null;
 }
 /**
  * Utility method to set a KKCookie when we have the customerUuid
  *
  * @param customerUuid customer uuid
  * @param attrId the id of the attribute
  * @param attrValue the value to save
  * @param kkAppEng the konakart engine
  * @throws org.hippoecm.hst.core.component.HstComponentException .
  */
 private void setKKCookie(String customerUuid, String attrId, String attrValue, KKAppEng kkAppEng)
     throws HstComponentException {
   KKCookieIf kkCookie = new KKCookie();
   kkCookie.setCustomerUuid(customerUuid);
   kkCookie.setAttributeId(attrId);
   kkCookie.setAttributeValue(attrValue);
   try {
     kkAppEng.getEng().setCookie(kkCookie);
   } catch (KKException e) {
     throw new HstComponentException(e);
   }
 }
  /**
   * Utility method to read a KKCookie when we have the CustomerUuid
   *
   * @param customerUuid the customer UUID
   * @param attrId the attribute to save
   * @param kkAppEng the konakart engine.
   * @return the value of the cookie
   * @throws org.hippoecm.hst.core.component.HstComponentException .
   */
  @Nullable
  private String getKKCookie(String customerUuid, String attrId, KKAppEng kkAppEng)
      throws HstComponentException {
    try {
      KKCookieIf kkCookie = kkAppEng.getEng().getCookie(customerUuid, attrId);
      if (kkCookie != null) {
        return kkCookie.getAttributeValue();
      }

      return null;
    } catch (KKException e) {
      throw new HstComponentException(e);
    }
  }