Map<String, IArticlesDto> articles = new HashMap<String, IArticlesDto>();
if (input.getTag() != null) {
Tag tag = model.find(Tag.class, input.getTag().name());
if (tag != null) {
for (Product product : tag.getProducts()) {
IArticlesDto dto = getIArticlesDto(product, false, email);
articles.put(dto.getKeyHash(), dto);
}
log.info("Getting " + articles.size() + " articles for tag "
+ input.getTag());
}
}
if (input.getIdKey() != null) {
Product product = model.find(Product.class, input.getIdKey());
if (product != null) {
IArticlesDto dto = getIArticlesDto(product, true, email);
articles.put(dto.getKeyHash(), dto);
}
}
return articles;
}