com.liferay.commerce.checkout.web.internal.display.context.DeliveryGroupDisplayContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.commerce.checkout.web
Show all versions of com.liferay.commerce.checkout.web
Liferay Commerce Checkout Web
/**
* SPDX-FileCopyrightText: (c) 2024 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.commerce.checkout.web.internal.display.context;
import com.liferay.commerce.model.CommerceAddress;
import com.liferay.commerce.service.CommerceAddressService;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.util.ParamUtil;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
/**
* @author Luca Pellizzon
*/
public class DeliveryGroupDisplayContext {
public DeliveryGroupDisplayContext(
CommerceAddressService commerceAddressService) {
_commerceAddressService = commerceAddressService;
}
public CommerceAddress getCommerceAddress(
HttpServletRequest httpServletRequest)
throws PortalException {
return _commerceAddressService.fetchCommerceAddress(
ParamUtil.getLong(httpServletRequest, "addressId"));
}
public Date getDeliveryGroupDate(HttpServletRequest httpServletRequest) {
return new Date(ParamUtil.getLong(httpServletRequest, "deliveryDate"));
}
private final CommerceAddressService _commerceAddressService;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy