/**
* @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;
}