}
@Override
public String addToQueue() {
try {
INewsletterManager newsletterManager = this.getNewsletterManager();
Set<String> contentIds = this.getContentIds();
if (contentIds!=null && contentIds.size()>0) {
List<String> newsletterQueue = newsletterManager.getContentQueue();
for (String contentId : contentIds) {
Content content = this.getContentManager().loadContent(contentId, true);
if (this.checkContent(content)) {
if (newsletterQueue.contains(contentId)) {
this.addActionError(this.getText("Errors.newsletter.contentAlreadyAdded", new String[] { content.getDescr() }));
} else {
newsletterManager.addContentToQueue(contentId);
this.addActionMessage(this.getText("Messages.newsletter.addedContent", new String[] { content.getDescr() }));
}
}
}
}