@Logued
public ArticlesAddResult execute(@Valid ArticlesAddAction arg0,
ExecutionContext arg1) throws ActionException {
// TODO add language in product
log.info("Adding " + arg0);
ArticlesAddResult result = null;
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
ArticlesOAM oam = provider.get();
Product product = null;
if (arg0.getKeyHash() == null) {
product = oam.insertArticle(arg0, user.getEmail());
} else {
product = oam.updateArticle(arg0, user.getEmail());
}
result = new ArticlesAddResult(KeyFactory.keyToString(product.getKey()), Tags.valueOf(product.getTag().getTagId()));
return result;
}