/**
*
*/
public CurrencyReferentialViewBean buildViewBeanCurrencyReferential(final RequestData requestData, final CurrencyReferential currencyReferential) throws Exception {
final CurrencyReferentialViewBean currencyReferentialViewBean = new CurrencyReferentialViewBean();
if (currencyReferential != null) {
currencyReferentialViewBean.setName(currencyReferential.getName());
currencyReferentialViewBean.setDescription(currencyReferential.getDescription());
currencyReferentialViewBean.setCode(currencyReferential.getCode());
currencyReferentialViewBean.setSign(currencyReferential.getSign());
currencyReferentialViewBean.setAbbreviated(currencyReferential.getAbbreviated());
DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
if (currencyReferential.getDateCreate() != null) {
currencyReferentialViewBean.setDateCreate(dateFormat.format(currencyReferential.getDateCreate()));
}
if (currencyReferential.getDateUpdate() != null) {
currencyReferentialViewBean.setDateUpdate(dateFormat.format(currencyReferential.getDateUpdate()));
}
// CLONE THE CURRENT REQUEST DATE TO BUILD THE CHANGE CONTEXT URL (MENU)
RequestData requestDataChangecontext = new RequestData();
BeanUtils.copyProperties(requestData, requestDataChangecontext);
requestDataChangecontext.setMarketAreaCurrency(currencyReferential);
currencyReferentialViewBean.setChangeContextUrl(urlService.buildChangeContextUrl(requestDataChangecontext));
currencyReferentialViewBean.setHomeUrl(urlService.generateUrl(FoUrls.HOME, requestDataChangecontext));
}
return currencyReferentialViewBean;
}