Example usage for org.springframework.ui Model containsAttribute

List of usage examples for org.springframework.ui Model containsAttribute

Introduction

In this page you can find the example usage for org.springframework.ui Model containsAttribute.

Prototype

boolean containsAttribute(String attributeName);

Source Link

Document

Does this model contain an attribute of the given name?

Usage

From source file:com.exxonmobile.ace.hybris.storefront.controllers.pages.BusinessUnitManagementPageController.java

@RequestMapping(value = "/create", method = RequestMethod.GET)
@RequireHardLogIn/*from  w  ww .  j a  v  a2s  .  c om*/
public String createUnit(@RequestParam("unit") final String unit, final Model model,
        final HttpServletRequest request) throws CMSItemNotFoundException {
    storeCmsPageInModel(model, getContentPageForLabelOrId(MANAGE_UNITS_CMS_PAGE));
    setUpMetaDataForContentPage(model, getContentPageForLabelOrId(MANAGE_UNITS_CMS_PAGE));
    final List<Breadcrumb> breadcrumbs;
    final B2BUnitData unitData;
    String parentUnit = "";
    if (StringUtils.isNotBlank(unit)) {
        unitData = companyB2BCommerceFacade.getUnitForUid(unit);
        breadcrumbs = myCompanyBreadcrumbBuilder.createManageUnitsDetailsBreadcrumbs(unit);
        model.addAttribute("cancelUrl",
                String.format("%s/my-company/organization-management/manage-units/details/?unit=%s",
                        request.getContextPath(), urlEncode(unit)));
    } else {
        breadcrumbs = myCompanyBreadcrumbBuilder.createManageUnitsBreadcrumbs();
        unitData = companyB2BCommerceFacade.getParentUnit();
        parentUnit = unitData == null ? "" : unitData.getName();
    }
    breadcrumbs.add(new Breadcrumb("/my-company/organization-management/manage-units/create?unit=",
            getMessageSource().getMessage("text.company.manage.units.createUnit.breadcrumb",
                    new Object[] { StringUtils.isEmpty(parentUnit) ? unit : parentUnit },
                    "Create Child Unit for Unit: {0}", getI18nService().getCurrentLocale()),
            null));
    model.addAttribute("breadcrumbs", breadcrumbs);
    model.addAttribute("unitName", (unitData == null ? "" : unitData.getName()));

    if (!model.containsAttribute("b2BUnitForm")) {
        final B2BUnitForm b2BUnitForm = new B2BUnitForm();
        b2BUnitForm.setParentUnit((unitData == null ? "" : unitData.getUid()));
        model.addAttribute(b2BUnitForm);
    }
    model.addAttribute("branchSelectOptions",
            getBranchSelectOptions(this.companyB2BCommerceFacade.getBranchNodes()));
    model.addAttribute("metaRobots", "no-index,no-follow");
    return ControllerConstants.Views.Pages.MyCompany.MyCompanyManageUnitCreatePage;
}

From source file:com.exxonmobile.ace.hybris.storefront.controllers.pages.checkout.SingleStepCheckoutController.java

@RequestMapping(value = "/summary", method = RequestMethod.GET)
@RequireHardLogIn// w ww. ja  va  2  s.  c  o  m
public String checkoutSummary(final Model model) throws CMSItemNotFoundException {

    if (!b2bUserGroupProvider.isCurrentUserAuthorizedToCheckOut()) {
        GlobalMessages.addErrorMessage(model, "checkout.error.invalid.accountType");
        return FORWARD_PREFIX + "/cart";
    }

    if (!hasItemsInCart()) {
        // no items in the cart
        return FORWARD_PREFIX + "/cart";
    }

    getCheckoutFlowFacade().setDeliveryAddressIfAvailable();
    getCheckoutFlowFacade().setDeliveryModeIfAvailable();
    getCheckoutFlowFacade().setPaymentInfoIfAvailable();
    getCheckoutFlowFacade().setDefaultPaymentTypeForCheckout();

    final CartData cartData = getCheckoutFlowFacade().getCheckoutCart();
    if (cartData.getEntries() != null && !cartData.getEntries().isEmpty()) {
        for (final OrderEntryData entry : cartData.getEntries()) {
            final String productCode = entry.getProduct().getCode();
            final ProductData product = productFacade.getProductForCodeAndOptions(productCode,
                    Arrays.asList(ProductOption.BASIC, ProductOption.PRICE));
            entry.setProduct(product);
        }
    }

    // Try to set default delivery address and delivery mode
    if (cartData.getPaymentType() == null) {
        getCheckoutFlowFacade().setPaymentTypeSelectedForCheckout(CheckoutPaymentType.ACCOUNT.getCode());
    }

    model.addAttribute("cartData", cartData);
    model.addAttribute("allItems", cartData.getEntries());
    model.addAttribute("deliveryAddress", cartData.getDeliveryAddress());
    model.addAttribute("deliveryMode", cartData.getDeliveryMode());
    model.addAttribute("paymentInfo", cartData.getPaymentInfo());
    model.addAttribute("costCenter", cartData.getCostCenter());
    model.addAttribute("quoteText", new B2BCommentData());
    // TODO:Make configuration hmc driven than hardcoding in controllers
    model.addAttribute("nDays", getNumberRange(1, 30));
    model.addAttribute("nthDayOfMonth", getNumberRange(1, 31));
    model.addAttribute("nthWeek", getNumberRange(1, 12));

    model.addAttribute(new AddressForm());
    model.addAttribute(new PaymentDetailsForm());
    if (!model.containsAttribute("placeOrderForm")) {
        final PlaceOrderForm placeOrderForm = new PlaceOrderForm();
        // TODO: Make setting of default recurrence enum value hmc driven rather hard coding in controller
        placeOrderForm.setReplenishmentRecurrence(B2BReplenishmentRecurrenceEnum.MONTHLY);
        placeOrderForm.setnDays("14");
        final List<DayOfWeek> daysOfWeek = new ArrayList<DayOfWeek>();
        daysOfWeek.add(DayOfWeek.MONDAY);
        placeOrderForm.setnDaysOfWeek(daysOfWeek);
        model.addAttribute("placeOrderForm", placeOrderForm);
    }
    storeCmsPageInModel(model, getContentPageForLabelOrId(SINGLE_STEP_CHECKOUT_SUMMARY_CMS_PAGE));
    setUpMetaDataForContentPage(model, getContentPageForLabelOrId(SINGLE_STEP_CHECKOUT_SUMMARY_CMS_PAGE));
    model.addAttribute("metaRobots", "no-index,no-follow");
    return ControllerConstants.Views.Pages.SingleStepCheckout.CheckoutSummaryPage;
}

From source file:com.jnj.b2b.storefront.controllers.pages.checkout.SingleStepCheckoutController.java

@RequestMapping(value = "/summary", method = { RequestMethod.GET, RequestMethod.POST })
@RequireHardLogIn/*www  . j a  v a2s .  c o m*/
public String checkoutSummary(final Model model) throws CMSItemNotFoundException {

    if (!b2bUserGroupProvider.isCurrentUserAuthorizedToCheckOut()) {
        GlobalMessages.addErrorMessage(model, "checkout.error.invalid.accountType");
        return FORWARD_PREFIX + "/cart";
    }

    if (!hasItemsInCart()) {
        // no items in the cart
        return FORWARD_PREFIX + "/cart";
    }

    getCheckoutFacade().setDeliveryAddressIfAvailable();
    getCheckoutFacade().setDeliveryModeIfAvailable();
    getCheckoutFacade().setPaymentInfoIfAvailable();

    // Set to default payment type
    final B2BPaymentTypeData paymentTypeData = new B2BPaymentTypeData();
    paymentTypeData.setCode(CheckoutPaymentType.ACCOUNT.getCode());

    final CartData tempCartData = new CartData();
    tempCartData.setPaymentType(paymentTypeData);

    final CartData cartData = getB2BCheckoutFacade().updateCheckoutCart(tempCartData);

    //final CartData cartData = getCheckoutFacade().getCheckoutCart();
    if (cartData.getEntries() != null && !cartData.getEntries().isEmpty()) {
        for (final OrderEntryData entry : cartData.getEntries()) {
            final String productCode = entry.getProduct().getCode();
            final ProductData product = productFacade.getProductForCodeAndOptions(productCode,
                    Arrays.asList(ProductOption.BASIC, ProductOption.PRICE));
            entry.setProduct(product);
        }
    }

    model.addAttribute("cartData", cartData);
    model.addAttribute("allItems", cartData.getEntries());
    model.addAttribute("deliveryAddress", cartData.getDeliveryAddress());
    model.addAttribute("deliveryMode", cartData.getDeliveryMode());
    model.addAttribute("paymentInfo", cartData.getPaymentInfo());
    model.addAttribute("costCenter", cartData.getCostCenter());
    model.addAttribute("quoteText", new B2BCommentData());
    // TODO:Make configuration hmc driven than hardcoding in controllers
    model.addAttribute("nDays", getNumberRange(1, 30));
    model.addAttribute("nthDayOfMonth", getNumberRange(1, 31));
    model.addAttribute("nthWeek", getNumberRange(1, 12));

    model.addAttribute(new AddressForm());
    model.addAttribute(new PaymentDetailsForm());
    if (!model.containsAttribute("placeOrderForm")) {
        final PlaceOrderForm placeOrderForm = new PlaceOrderForm();
        // TODO: Make setting of default recurrence enum value hmc driven rather hard coding in controller
        placeOrderForm.setReplenishmentRecurrence(B2BReplenishmentRecurrenceEnum.MONTHLY);
        placeOrderForm.setnDays("14");
        final List<DayOfWeek> daysOfWeek = new ArrayList<DayOfWeek>();
        daysOfWeek.add(DayOfWeek.MONDAY);
        placeOrderForm.setnDaysOfWeek(daysOfWeek);
        model.addAttribute("placeOrderForm", placeOrderForm);
    }
    storeCmsPageInModel(model, getContentPageForLabelOrId(SINGLE_STEP_CHECKOUT_SUMMARY_CMS_PAGE));
    setUpMetaDataForContentPage(model, getContentPageForLabelOrId(SINGLE_STEP_CHECKOUT_SUMMARY_CMS_PAGE));
    model.addAttribute("metaRobots", "no-index,no-follow");
    return ControllerConstants.Views.Pages.SingleStepCheckout.CheckoutSummaryPage;
}

From source file:com.mitre.storefront.controllers.pages.checkout.SingleStepCheckoutController.java

@RequestMapping(value = "/summary", method = { RequestMethod.GET, RequestMethod.POST })
@RequireHardLogIn/*from ww w  . j  a  v  a  2  s  .  c o  m*/
public String checkoutSummary(final Model model) throws CMSItemNotFoundException {

    if (!b2bUserGroupProvider.isCurrentUserAuthorizedToCheckOut()) {
        GlobalMessages.addErrorMessage(model, "checkout.error.invalid.accountType");
        return FORWARD_PREFIX + "/cart";
    }

    if (!hasItemsInCart()) {
        // no items in the cart
        return FORWARD_PREFIX + "/cart";
    }

    getCheckoutFacade().setDeliveryAddressIfAvailable();
    getCheckoutFacade().setDeliveryModeIfAvailable();
    getCheckoutFacade().setPaymentInfoIfAvailable();

    // Set to default payment type
    final B2BPaymentTypeData paymentTypeData = new B2BPaymentTypeData();
    paymentTypeData.setCode(CheckoutPaymentType.ACCOUNT.getCode());

    final CartData tempCartData = new CartData();
    tempCartData.setPaymentType(paymentTypeData);

    final CartData cartData = getB2BCheckoutFacade().updateCheckoutCart(tempCartData);

    //final CartData cartData = getCheckoutFacade().getCheckoutCart();
    if (cartData.getEntries() != null && !cartData.getEntries().isEmpty()) {
        for (final OrderEntryData entry : cartData.getEntries()) {
            final String productCode = entry.getProduct().getCode();
            final ProductData product = productFacade.getProductForCodeAndOptions(productCode,
                    Arrays.asList(ProductOption.BASIC, ProductOption.PRICE, ProductOption.PRICE_RANGE,
                            ProductOption.VARIANT_MATRIX));
            entry.setProduct(product);
        }
    }

    model.addAttribute("cartData", cartData);
    model.addAttribute("allItems", cartData.getEntries());
    model.addAttribute("deliveryAddress", cartData.getDeliveryAddress());
    model.addAttribute("deliveryMode", cartData.getDeliveryMode());
    model.addAttribute("paymentInfo", cartData.getPaymentInfo());
    model.addAttribute("costCenter", cartData.getCostCenter());
    model.addAttribute("quoteText", new B2BCommentData());
    // TODO:Make configuration hmc driven than hardcoding in controllers
    model.addAttribute("nDays", getNumberRange(1, 30));
    model.addAttribute("nthDayOfMonth", getNumberRange(1, 31));
    model.addAttribute("nthWeek", getNumberRange(1, 12));

    model.addAttribute(new AddressForm());
    model.addAttribute(new PaymentDetailsForm());
    if (!model.containsAttribute("placeOrderForm")) {
        final PlaceOrderForm placeOrderForm = new PlaceOrderForm();
        // TODO: Make setting of default recurrence enum value hmc driven rather hard coding in controller
        placeOrderForm.setReplenishmentRecurrence(B2BReplenishmentRecurrenceEnum.MONTHLY);
        placeOrderForm.setnDays("14");
        final List<DayOfWeek> daysOfWeek = new ArrayList<DayOfWeek>();
        daysOfWeek.add(DayOfWeek.MONDAY);
        placeOrderForm.setnDaysOfWeek(daysOfWeek);
        model.addAttribute("placeOrderForm", placeOrderForm);
    }
    storeCmsPageInModel(model, getContentPageForLabelOrId(SINGLE_STEP_CHECKOUT_SUMMARY_CMS_PAGE));
    setUpMetaDataForContentPage(model, getContentPageForLabelOrId(SINGLE_STEP_CHECKOUT_SUMMARY_CMS_PAGE));
    model.addAttribute("metaRobots", "no-index,no-follow");
    return ControllerConstants.Views.Pages.SingleStepCheckout.CheckoutSummaryPage;
}

From source file:eu.europa.ec.eci.oct.webcommons.controller.HttpGetController.java

protected void setState(Model model, HttpServletRequest request) throws OCTException {
    if (request.getParameter("initiativeLang") != null) {
        request.getSession().setAttribute(CommonControllerConstants.SESSION_ATTR_INITIATIVE_LANGUAGE,
                request.getParameter("initiativeLang"));
    }//ww  w .  j  a  v  a  2  s .  c o m

    if (!getSessionCache(request).containsKey(CommonControllerConstants.MODEL_ATTRIBUTE_LANGUAGES)) {
        getSessionCache(request).put(CommonControllerConstants.MODEL_ATTRIBUTE_LANGUAGES,
                systemManager.getAllLanguages());
    }

    @SuppressWarnings("unchecked")
    List<Language> ll = (List<Language>) getSessionCache(request)
            .get(CommonControllerConstants.MODEL_ATTRIBUTE_LANGUAGES);
    processLanguageList(request, ll);

    if (!getSessionCache(request).containsKey(CommonControllerConstants.MODEL_ATTRIBUTE_COUNTRIES)) {
        getSessionCache(request).put(CommonControllerConstants.MODEL_ATTRIBUTE_COUNTRIES,
                systemManager.getAllCountries());
    }

    SystemPreferences prefs = systemManager.getSystemPreferences();

    InitiativeDescription description = null;
    String langCode = (String) request.getSession()
            .getAttribute(CommonControllerConstants.SESSION_ATTR_INITIATIVE_LANGUAGE);
    try {
        if (langCode == null) {
            langCode = LocaleUtils.getCurrentLanguage(request);
        }
        Language lang = systemManager.getLanguageByCode(langCode);

        logger.debug("fetching description for language " + lang);
        description = initiativeService.getDescriptionByLang(lang);
        if (description == null) {
            logger.debug("trying to fetch default description...");
            description = prefs.getDefaultDescription();

            if (description == null) {
                logger.warn("initiative description for language " + lang.getCode() + " not found");
                throw new OCTException("initiative description for language " + lang.getCode() + " not found");
            } else {
                logger.debug("default description found! id: " + description.getId());
                request.getSession().setAttribute(CommonControllerConstants.SESSION_ATTR_INITIATIVE_LANGUAGE,
                        description.getLanguage().getCode());
            }
        }
    } catch (OCTException e) {
        logger.warn("problem occured while fetching initiative description. obtaining default description", e);
        try {
            description = initiativeService.getDefaultDescription();
            langCode = description.getLanguage().getCode();
        } catch (OCTException e2) {
            logger.warn("default initiative description not found", e2);

        }
    }
    model.addAttribute("initiativeLang", langCode);

    if (!model.containsAttribute("oct_cert")) {
        try {
            Certificate cert = systemManager.getCertificate();
            model.addAttribute("oct_cert", cert);
        } catch (OCTMissingCertificateException e) {
            // ignore
        }
    }

    // sanitize urls
    try {
        if (prefs != null) {
            new URL(prefs.getCommissionRegisterUrl());
        }
    } catch (MalformedURLException e) {
        prefs.setCommissionRegisterUrl("");
    }

    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_PATH, request.getAttribute(
            org.springframework.web.servlet.HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE));
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_LANGUAGES, ll);
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_COUNTRIES,
            getSessionCache(request).get(CommonControllerConstants.MODEL_ATTRIBUTE_COUNTRIES));
    model.addAttribute("currentLanguage", LocaleUtils.getCurrentLanguage(request));
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_SYSTEM_PREFS, prefs);
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_INITIATIVE_DESC, description);
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_SYSTEM_STATE, prefs.getState());
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_COLLECTOR_STATE, prefs.isCollecting());
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_UID, System.currentTimeMillis());
    model.addAttribute(CommonControllerConstants.MODEL_ATTRIBUTE_SHOW_MAP, Boolean.valueOf(
            configurationService.getConfigurationParameter(Parameter.SHOW_DISTRIBUTION_MAP).getValue()));
}

From source file:com.octanner.controllers.AbstractProductConfigController.java

protected void populateConfigurationModel(final KBKeyData kbKey, final String configId,
        final String selectedGroup, final Model model, final UiStatus uiStatus,
        final String cartEntryHandleFromRequest) {
    if (model.containsAttribute(Octsapproductconfigb2baddonConstants.CONFIG_ATTRIBUTE)) {
        return;/*from   ww  w.ja  v  a 2  s.c om*/
    }

    final ConfigurationData configData;
    if (configId != null) {
        configData = reloadConfiguration(kbKey, configId, selectedGroup, uiStatus);
    } else {
        configData = loadNewConfiguration(kbKey, selectedGroup);
    }

    if (cartEntryHandleFromRequest == null) {
        setCartItemPk(configData);
    } else {
        configData.setCartItemPK(cartEntryHandleFromRequest);
    }

    model.addAttribute(Octsapproductconfigb2baddonConstants.CONFIG_ATTRIBUTE, configData);

    final BindingResult errors = getBindingResultForConfig(configData);
    model.addAttribute(BindingResult.MODEL_KEY_PREFIX + Octsapproductconfigb2baddonConstants.CONFIG_ATTRIBUTE,
            errors);

}

From source file:com.sap.sapbasket.storefront.controllers.pages.CartPageController.java

@Override
protected void prepareDataForPage(final Model model) throws CMSItemNotFoundException {
    super.prepareDataForPage(model);

    if (!model.containsAttribute(VOUCHER_FORM)) {
        model.addAttribute(VOUCHER_FORM, new VoucherForm());
    }/*  w w w.j a v a2s  .  com*/

    model.addAttribute(WebConstants.BREADCRUMBS_KEY,
            resourceBreadcrumbBuilder.getBreadcrumbs("breadcrumb.cart"));
    model.addAttribute("pageType", PageType.CART.name());
}

From source file:de.hybris.platform.b2bacceleratoraddon.controllers.pages.checkout.steps.SummaryCheckoutStepController.java

@RequestMapping(value = "/view", method = RequestMethod.GET)
@RequireHardLogIn//  www .  j a v a2  s. co m
@Override
@PreValidateCheckoutStep(checkoutStep = SUMMARY)
public String enterStep(final Model model, final RedirectAttributes redirectAttributes)
        throws CMSItemNotFoundException, CommerceCartModificationException {
    final CartData cartData = getCheckoutFacade().getCheckoutCart();
    if (cartData.getEntries() != null && !cartData.getEntries().isEmpty()) {
        for (final OrderEntryData entry : cartData.getEntries()) {
            final String productCode = entry.getProduct().getCode();
            final ProductData product = getProductFacade().getProductForCodeAndOptions(productCode,
                    Arrays.asList(ProductOption.BASIC, ProductOption.PRICE, ProductOption.VARIANT_MATRIX_BASE,
                            ProductOption.PRICE_RANGE));
            entry.setProduct(product);
        }
    }

    model.addAttribute("cartData", cartData);
    model.addAttribute("allItems", cartData.getEntries());
    model.addAttribute("deliveryAddress", cartData.getDeliveryAddress());
    model.addAttribute("deliveryMode", cartData.getDeliveryMode());
    model.addAttribute("paymentInfo", cartData.getPaymentInfo());
    // TODO:Make configuration hmc driven than hardcoding in controllers
    model.addAttribute("nDays", getNumberRange(1, 30));
    model.addAttribute("nthDayOfMonth", getNumberRange(1, 31));
    model.addAttribute("nthWeek", getNumberRange(1, 12));
    model.addAttribute("daysOfWeek", getB2BCheckoutFacade().getDaysOfWeekForReplenishmentCheckoutSummary());

    // Only request the security code if the SubscriptionPciOption is set to Default.
    final boolean requestSecurityCode = (CheckoutPciOptionEnum.DEFAULT
            .equals(getCheckoutFlowFacade().getSubscriptionPciOption()));
    model.addAttribute("requestSecurityCode", Boolean.valueOf(requestSecurityCode));

    if (!model.containsAttribute("placeOrderForm")) {
        final PlaceOrderForm placeOrderForm = new PlaceOrderForm();
        // TODO: Make setting of default recurrence enum value hmc driven rather hard coding in controller
        placeOrderForm.setReplenishmentRecurrence(B2BReplenishmentRecurrenceEnum.MONTHLY);
        placeOrderForm.setnDays("14");
        final List<DayOfWeek> daysOfWeek = new ArrayList<DayOfWeek>();
        daysOfWeek.add(DayOfWeek.MONDAY);
        placeOrderForm.setnDaysOfWeek(daysOfWeek);
        model.addAttribute("placeOrderForm", placeOrderForm);
    }

    storeCmsPageInModel(model, getContentPageForLabelOrId(MULTI_CHECKOUT_SUMMARY_CMS_PAGE_LABEL));
    setUpMetaDataForContentPage(model, getContentPageForLabelOrId(MULTI_CHECKOUT_SUMMARY_CMS_PAGE_LABEL));
    model.addAttribute(WebConstants.BREADCRUMBS_KEY,
            getResourceBreadcrumbBuilder().getBreadcrumbs("checkout.multi.summary.breadcrumb"));
    model.addAttribute("metaRobots", "noindex,nofollow");
    setCheckoutStepLinksForModel(model, getCheckoutStep());
    return B2bacceleratoraddonControllerConstants.Views.Pages.MultiStepCheckout.CheckoutSummaryPage;
}

From source file:de.hybris.platform.b2bacceleratoraddon.controllers.pages.MyQuotesController.java

@RequestMapping(value = "/my-quote/" + ORDER_CODE_PATH_VARIABLE_PATTERN, method = RequestMethod.GET)
@RequireHardLogIn//  w w w . j av a  2  s. c  om
public String quotesDetails(@PathVariable("orderCode") final String orderCode, final Model model)
        throws CMSItemNotFoundException {
    try {
        final OrderData orderDetails = orderFacade.getOrderDetailsForCode(orderCode);

        model.addAttribute("orderData", orderDetails);

        final List<B2BOrderHistoryEntryData> orderHistoryEntries = orderFacade
                .getOrderHistoryEntryData(orderCode);
        model.addAttribute("orderHistoryEntryData", orderHistoryEntries);

        model.addAttribute(new ReorderForm());

        if (!model.containsAttribute("quoteOrderDecisionForm")) {
            model.addAttribute("quoteOrderDecisionForm", new QuoteOrderForm());
        }

        final List<Breadcrumb> breadcrumbs = accountBreadcrumbBuilder.getBreadcrumbs(null);
        breadcrumbs.add(new Breadcrumb("/my-account/my-quotes", getMessageSource().getMessage(
                "text.account.manageQuotes.breadcrumb", null, getI18nService().getCurrentLocale()), null));
        breadcrumbs.add(new Breadcrumb("/my-account/my-quotes/" + orderDetails.getCode(),
                getMessageSource().getMessage("text.account.manageQuotes.details.breadcrumb",
                        new Object[] { orderDetails.getCode() }, "Quote Details {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(QUOTE_DETAIL_CMS_PAGE));
    setUpMetaDataForContentPage(model, getContentPageForLabelOrId(QUOTE_DETAIL_CMS_PAGE));
    model.addAttribute(ThirdPartyConstants.SeoRobots.META_ROBOTS,
            ThirdPartyConstants.SeoRobots.NOINDEX_NOFOLLOW);
    return getViewForPage(model);
}

From source file:de.hybris.platform.b2bacceleratoraddon.controllers.pages.OrderApprovalController.java

@RequestMapping(value = "/orderApprovalDetails/"
        + WORKFLOW_ACTION_CODE_PATH_VARIABLE_PATTERN, method = RequestMethod.GET)
@RequireHardLogIn// w  w w .  j a v  a  2 s. c  o m
public String orderApprovalDetails(@PathVariable("workflowActionCode") final String workflowActionCode,
        final Model model) throws CMSItemNotFoundException {
    try {
        final B2BOrderApprovalData orderApprovalDetails = orderFacade
                .getOrderApprovalDetailsForCode(workflowActionCode);
        model.addAttribute("orderApprovalData", orderApprovalDetails);
        model.addAttribute("orderData", orderApprovalDetails.getB2bOrderData());
        model.addAttribute("displayQuoteInfo", true);

        if (!model.containsAttribute("orderApprovalDecisionForm")) {
            model.addAttribute("orderApprovalDecisionForm", new OrderApprovalDecisionForm());
        }

        final List<Breadcrumb> breadcrumbs = accountBreadcrumbBuilder.getBreadcrumbs(null);
        breadcrumbs.add(new Breadcrumb("/my-account/approval-dashboard", getMessageSource().getMessage(
                "text.account.orderApprovalDashboard", null, getI18nService().getCurrentLocale()), null));
        breadcrumbs.add(new Breadcrumb("#",
                getMessageSource().getMessage("text.account.order.orderBreadcrumb",
                        new Object[] { orderApprovalDetails.getB2bOrderData().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_APPROVAL_DETAIL_CMS_PAGE));
    setUpMetaDataForContentPage(model, getContentPageForLabelOrId(ORDER_APPROVAL_DETAIL_CMS_PAGE));
    model.addAttribute(ThirdPartyConstants.SeoRobots.META_ROBOTS,
            ThirdPartyConstants.SeoRobots.NOINDEX_NOFOLLOW);
    return getViewForPage(model);
}