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

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


   
    /**
     *
     */
    public AssetViewBean buildViewBeanAsset(final RequestData requestData, final Asset asset) throws Exception {
        final AssetViewBean assetViewBean = new AssetViewBean();
        assetViewBean.setName(asset.getName());
        assetViewBean.setDescription(asset.getDescription());
        assetViewBean.setScope(asset.getScope());
        assetViewBean.setType(asset.getType());
        assetViewBean.setPath(asset.getPath());
        assetViewBean.setSize(asset.getSize());
        if(asset.getFileSize() != null){
            assetViewBean.setFileSize(asset.getFileSize().toString());
        }
        assetViewBean.setIsDefault(asset.isDefault());

        final String path = engineSettingService.getProductMarketingImageWebPath(asset);
        assetViewBean.setRelativeWebPath(path);
        assetViewBean.setAbsoluteWebPath(path);

        return assetViewBean;
    }
View Full Code Here


    /**
     * @throws Exception
     *
     */
    public AssetViewBean buildViewBeanAsset(final RequestData requestData, final Asset asset) throws Exception {
        AssetViewBean assetViewBean = new AssetViewBean();
        assetViewBean.setName(asset.getName());
        assetViewBean.setDescription(asset.getDescription());
        assetViewBean.setPath(asset.getPath());
        if (asset.getScope() != null) {
            assetViewBean.setScope(asset.getScope());
        }
        if (asset.getType() != null) {
            assetViewBean.setType(asset.getType());
        }
        if (asset.getSize() != null) {
            assetViewBean.setSize(asset.getSize());
        }
        assetViewBean.setFileSize("" + asset.getFileSize());
        assetViewBean.setIsDefault(asset.isDefault());

        assetViewBean.setAbsoluteWebPath(engineSettingService.getProductMarketingImageWebPath(asset));

        DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
        Date createdDate = asset.getDateCreate();
        if (createdDate != null) {
            assetViewBean.setDateCreate(dateFormat.format(createdDate));
        } else {
            assetViewBean.setDateCreate(Constants.NOT_AVAILABLE);
        }
        Date updatedDate = asset.getDateUpdate();
        if (updatedDate != null) {
            assetViewBean.setDateUpdate(dateFormat.format(updatedDate));
        } else {
            assetViewBean.setDateUpdate(Constants.NOT_AVAILABLE);
        }

        assetViewBean.setDetailsUrl(backofficeUrlService.generateUrl(BoUrls.ASSET_DETAILS, requestData, asset));
        assetViewBean.setEditUrl(backofficeUrlService.generateUrl(BoUrls.ASSET_EDIT, requestData, asset));

        return assetViewBean;
    }
View Full Code Here

TOP

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

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.