Package com.changestuffs.shared.actions

Examples of com.changestuffs.shared.actions.ArticlesAddResult


  @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;
  }
View Full Code Here

TOP

Related Classes of com.changestuffs.shared.actions.ArticlesAddResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.