@RequestMapping(value = "/order/" + ORDER_GUID_PATH_VARIABLE_PATTERN, method = RequestMethod.GET) public String order(@PathVariable("orderGUID") final String orderGUID, final Model model) throws CMSItemNotFoundException { try { storeCmsPageInModel(model, getContentPageForLabelOrId(ORDER_DETAIL_CMS_PAGE)); model.addAttribute("metaRobots", "no-index,no-follow"); setUpMetaDataForContentPage(model, getContentPageForLabelOrId(ORDER_DETAIL_CMS_PAGE)); final OrderData orderDetails = orderFacade.getOrderDetailsForGUID(orderGUID); model.addAttribute("orderData", orderDetails); } catch (final UnknownIdentifierException e) { LOG.warn("Attempted to load a order that does not exist or is not visible", e); return ControllerConstants.Views.Pages.Guest.GuestOrderErrorPage; } return ControllerConstants.Views.Pages.Guest.GuestOrderPage; }
@RequestMapping(value = "/orders", method = RequestMethod.GET) @RequireHardLogIn public String orders( @RequestParam(value = "page", defaultValue = "0") final int page, @RequestParam(value = "show", defaultValue = "Page") final ShowMode showMode, @RequestParam(value = "sort", required = false) final String sortCode, final Model model) throws CMSItemNotFoundException { // Handle paged search results final PageableData pageableData = createPageableData(page, 5, sortCode, showMode); final SearchPageData<OrderHistoryData> searchPageData = orderFacade.getPagedOrderHistoryForStatuses(pageableData); populateModel(model, searchPageData, showMode); storeCmsPageInModel(model, getContentPageForLabelOrId(ORDER_HISTORY_CMS_PAGE)); setUpMetaDataForContentPage(model, getContentPageForLabelOrId(ORDER_HISTORY_CMS_PAGE)); model.addAttribute( "breadcrumbs", accountBreadcrumbBuilder.getBreadcrumbs("text.account.orderHistory")); model.addAttribute("metaRobots", "no-index,no-follow"); return ControllerConstants.Views.Pages.Account.AccountOrderHistoryPage; }
@RequestMapping(value = "/order/" + ORDER_CODE_PATH_VARIABLE_PATTERN, method = RequestMethod.GET) @RequireHardLogIn public String order(@PathVariable("orderCode") final String orderCode, final Model model) throws CMSItemNotFoundException { try { final OrderData orderDetails = orderFacade.getOrderDetailsForCode(orderCode); model.addAttribute("orderData", orderDetails); final List<Breadcrumb> breadcrumbs = accountBreadcrumbBuilder.getBreadcrumbs(null); breadcrumbs.add( new Breadcrumb( "/my-account/orders", getMessageSource() .getMessage( "text.account.orderHistory", null, getI18nService().getCurrentLocale()), null)); breadcrumbs.add( new Breadcrumb( "#", getMessageSource() .getMessage( "text.account.order.orderBreadcrumb", new Object[] {orderDetails.getCode()}, "Order {0}", getI18nService().getCurrentLocale()), null)); model.addAttribute("breadcrumbs", breadcrumbs); } catch (final UnknownIdentifierException e) { LOG.warn("Attempted to load a order that does not exist or is not visible", e); return REDIRECT_MY_ACCOUNT; } storeCmsPageInModel(model, getContentPageForLabelOrId(ORDER_DETAIL_CMS_PAGE)); model.addAttribute("metaRobots", "no-index,no-follow"); setUpMetaDataForContentPage(model, getContentPageForLabelOrId(ORDER_DETAIL_CMS_PAGE)); return ControllerConstants.Views.Pages.Account.AccountOrderPage; }