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

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


    /**
     *
     */
    public WarehouseViewBean buildViewBeanWarehouse(final RequestData requestData, final Warehouse warehouse) throws Exception {
        final WarehouseViewBean warehouseViewBean = new WarehouseViewBean();
        if (warehouse != null) {
            warehouseViewBean.setCode(warehouse.getCode());
            warehouseViewBean.setName(warehouse.getName());
            warehouseViewBean.setDescription(warehouse.getDescription());

            warehouseViewBean.setAddress1(warehouse.getAddress1());
            warehouseViewBean.setAddress2(warehouse.getAddress2());
            warehouseViewBean.setAddressAdditionalInformation(warehouse.getAddressAdditionalInformation());
            warehouseViewBean.setPostalCode(warehouse.getPostalCode());

            // I18n values
            warehouseViewBean.setCity(warehouse.getCity());
            warehouseViewBean.setStateCode(warehouse.getStateCode());
            warehouseViewBean.setCountry(warehouse.getCountryCode());
            warehouseViewBean.setCountryCode(warehouse.getCountryCode());
            warehouseViewBean.setLongitude(warehouse.getLongitude());
            warehouseViewBean.setLatitude(warehouse.getLatitude());
           
            DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
            Date dateCreate = warehouse.getDateCreate();
            if (dateCreate != null) {
                warehouseViewBean.setDateCreate(dateFormat.format(dateCreate));
            } else {
                warehouseViewBean.setDateCreate(Constants.NOT_AVAILABLE);
            }

            Date dateUpdate = warehouse.getDateUpdate();
            if (dateUpdate != null) {
                warehouseViewBean.setDateUpdate(dateFormat.format(dateUpdate));
            } else {
                warehouseViewBean.setDateUpdate(Constants.NOT_AVAILABLE);
            }

            warehouseViewBean.setDetailsUrl(backofficeUrlService.generateUrl(BoUrls.WAREHOUSE_DETAILS, requestData, warehouse));
            warehouseViewBean.setEditUrl(backofficeUrlService.generateUrl(BoUrls.WAREHOUSE_EDIT, requestData, warehouse));
        }
        return warehouseViewBean;
    }
View Full Code Here


        final String warehouseCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_WAREHOUSE_CODE);
        if(StringUtils.isNotEmpty(warehouseCode)){
            // EDIT MODE
            final Warehouse warehouse = warehouseService.getWarehouseByCode(warehouseCode);

            WarehouseViewBean warehouseViewBean = backofficeViewBeanFactory.buildViewBeanWarehouse(requestData, warehouse);
            request.setAttribute(ModelConstants.WAREHOUSE_VIEW_BEAN, warehouseViewBean);

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

TOP

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

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.