cmsContext.setRetailers(retailers);
}
private void buildLocalization(CmsContextPojo cmsContext, MarketAreaPojo selectedMarketArea, LocalizationPojo selectedLocalization){
List<LocalizationPojo> localizations = new ArrayList<LocalizationPojo>();
LocalizationPojo localization = new LocalizationPojo();
localization.setCode("MASTER_LOCALIZATION");
localization.setName("Master Localization");
if(selectedLocalization == null){
localization.setSelected(true);
}
localizations.add(localization);
if(selectedMarketArea != null){
List<LocalizationPojo> localizationsByMarketAreaCode = localizationPojoService.findLocalizationsByMarketAreaCode(selectedMarketArea.getCode());
for (Iterator<LocalizationPojo> iterator = localizationsByMarketAreaCode.iterator(); iterator.hasNext();) {
LocalizationPojo localizationPojo = (LocalizationPojo) iterator.next();
if(selectedLocalization != null
&& localizationPojo.getCode().equals(selectedLocalization.getCode())){
localizationPojo.setSelected(true);
}
localizations.add(localizationPojo);
}
}