Package org.hoteia.qalingo.core.web.mvc.viewbean

Examples of org.hoteia.qalingo.core.web.mvc.viewbean.DeliveryMethodViewBean


     * @throws Exception
     *
     */
    @Override
    public DeliveryMethodViewBean buildViewBeanDeliveryMethod(final RequestData requestData, final DeliveryMethod deliveryMethod) throws Exception {
        final DeliveryMethodViewBean deliveryMethodViewBean = super.buildViewBeanDeliveryMethod(requestData, deliveryMethod);

        deliveryMethodViewBean.setDetailsUrl(backofficeUrlService.generateUrl(BoUrls.DELIVERY_METHOD_DETAILS, requestData, deliveryMethod));
        deliveryMethodViewBean.setEditUrl(backofficeUrlService.generateUrl(BoUrls.DELIVERY_METHOD_EDIT, requestData, deliveryMethod));

        return deliveryMethodViewBean;
    }
View Full Code Here


        final String deliveryMethodCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_DELIVERY_METHOD_CODE);
        if(StringUtils.isNotEmpty(deliveryMethodCode)){
            // EDIT MODE
            final DeliveryMethod deliveryMethod = deliveryMethodService.getDeliveryMethodByCode(deliveryMethodCode, FetchPlanGraphDeliveryMethod.fullDeliveryMethodFetchPlan());

            DeliveryMethodViewBean deliveryMethodViewBean = backofficeViewBeanFactory.buildViewBeanDeliveryMethod(requestData, deliveryMethod);
            request.setAttribute(ModelConstants.DELIVERY_METHOD_VIEW_BEAN, deliveryMethodViewBean);

            Object[] params = {deliveryMethod.getName() + " (" + deliveryMethod.getCode() + ")"};
            overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.DELIVERY_METHOD_EDIT.getKey(), params);
View Full Code Here

    /**
     * @throws Exception
     *
     */
    public DeliveryMethodViewBean buildViewBeanDeliveryMethod(final RequestData requestData, final DeliveryMethod deliveryMethod) throws Exception {
        final DeliveryMethodViewBean deliveryMethodViewBean = new DeliveryMethodViewBean();
        deliveryMethodViewBean.setId(deliveryMethod.getId());

        deliveryMethodViewBean.setVersion(deliveryMethod.getVersion());
        deliveryMethodViewBean.setName(deliveryMethod.getName());
        deliveryMethodViewBean.setDescription(deliveryMethod.getDescription());
        deliveryMethodViewBean.setCode(deliveryMethod.getCode());
       
        final Set<DeliveryMethodPrice> prices = deliveryMethod.getPrices();
        if(Hibernate.isInitialized(prices) && prices != null){
            for (DeliveryMethodPrice deliveryMethodPrice : prices) {
               
                // TODO : denis : fix the context
               
               
//                if(deliveryMethodPrice.getMarketAreaId().equals(marketArea.getId()) && deliveryMethodPrice.getRetailerId().equals(retailer.getId())) {
//                }
                deliveryMethodViewBean.setCatalogPrice(deliveryMethodPrice.getPrice().toString());
                deliveryMethodViewBean.setSalePrice(deliveryMethodPrice.getSalePrice().toString());
                deliveryMethodViewBean.setPriceWithCurrencySign(deliveryMethodPrice.getPriceWithStandardCurrencySign());
               
                deliveryMethodViewBean.setCurrencySign(deliveryMethodPrice.getCurrency().getSign());
                deliveryMethodViewBean.setCurrencyAbbreviated(deliveryMethodPrice.getCurrency().getAbbreviated());
   
                break;

            }
        }

        DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
        if (deliveryMethod.getDateCreate() != null) {
            deliveryMethodViewBean.setDateCreate(dateFormat.format(deliveryMethod.getDateCreate()));
        }
        if (deliveryMethod.getDateUpdate() != null) {
            deliveryMethodViewBean.setDateUpdate(dateFormat.format(deliveryMethod.getDateUpdate()));
        }

        // TODO : CMS page to describe Delivery Methods
//        deliveryMethodViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.DELIVERY_METHOD_DETAILS, requestData, deliveryMethod));
//        deliveryMethodViewBean.setEditUrl(urlService.generateUrl(FoUrls.DELIVERY_METHOD_EDIT, requestData, deliveryMethod));
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.mvc.viewbean.DeliveryMethodViewBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.