use of io.github.zutherb.appstash.shop.service.product.model.ProductInfo in project the-app by devops-dojo.
the class ProductItemListPanel method productList.
private DataView<ProductInfo> productList(final String parentTag) {
DataView<ProductInfo> productsView = new DataView<ProductInfo>("products", productsProvider()) {
@Override
protected void populateItem(Item<ProductInfo> item) {
item.add(newProductItemPanel("product", parentTag, item.getModel()));
}
};
productsView.add(new HighLightBehavior());
return productsView;
}
use of io.github.zutherb.appstash.shop.service.product.model.ProductInfo in project the-app by devops-dojo.
the class InMemoryCartFulfillmentProviderImplTest method setUp.
@Before
public void setUp() throws Exception {
cart = new InMemoryCartFulfillmentProviderImpl();
cart.addItem(new ProductInfo(new ObjectId().toString(), "A1", "Salami", SeoUtils.urlFriendly("Salami"), "", ProductType.HANDY, 10.0, "category"));
}
use of io.github.zutherb.appstash.shop.service.product.model.ProductInfo in project the-app by devops-dojo.
the class DirectBuyRequestCycleListener method onBeginRequest.
@Override
public void onBeginRequest(RequestCycle cycle) {
StringValue directBuyParameterValue = cycle.getRequest().getRequestParameters().getParameterValue(DIRECT_BUY_PARAMETER);
if (!directBuyParameterValue.isEmpty()) {
try {
ProductInfo productInfo = productService.findByQuery(ProductQuery.create().withUrlname(directBuyParameterValue.toString()));
if (productInfo != null) {
cart.addItem(productInfo);
} else {
ShopSession.get().error(String.format("Das Product '%s' konnte nicht gefunden werden.", directBuyParameterValue));
}
Url urlWithoutDirectBuy = removeDirectBuyFromUrl(cycle);
redirectTo(cycle, urlWithoutDirectBuy);
} catch (Exception e) {
ShopSession.get().error(DIRECT_BUY_PROCESSING_FAILED_MESSAGE);
LOGGER.error(DIRECT_BUY_PROCESSING_FAILED_MESSAGE, e);
}
}
}
Aggregations