public Boolean canViewAsset(WebPageRequest inReq) { // String orderid = inReq.getRequestParameter("orderid"); // if (orderid == null) // { // return false; // } Order order = loadOrder(inReq); if (order == null) { order = (Order) inReq.getSessionValue("vieworder"); } if (order == null) { return false; } Asset asset = getAsset(inReq); if (asset == null) { log.info("Asset not found"); return false; } String catalogid = inReq.findValue("catalogid"); HitTracker assets = getOrderManager().findOrderItems(inReq, catalogid, order); int found = assets.findRow("assetid", asset.getId()); if (found > -1 && !order.isExpired()) { return true; } return false; }
public Order loadOrderForVisitor(WebPageRequest inReq) { Order order = loadOrder(inReq); // check the expriation if (order.isExpired()) { inReq.putPageValue("expired", Boolean.TRUE); } else { inReq.putPageValue("expired", Boolean.FALSE); } // load up hits and select all the items. HitTracker hits = loadAssets(inReq); hits.selectAll(); inReq.putPageValue("hits", hits); inReq.putSessionValue("vieworder", order); return order; }