Package com.appspot.finajjarane.framework.entities

Examples of com.appspot.finajjarane.framework.entities.Tool


  IToolDao toolDao;

  @Override
  public boolean toolCreateNew(ToolModelForDao toolModel) throws Exception {

    Tool tool = ToolModelForDaoToTool(toolModel);
    return toolDao.add(tool);

  }
View Full Code Here


  }

  @Override
  public boolean toolUpdate(ToolModelForDao toolModel) throws Exception {
    Tool tool = ToolModelForDaoToTool(toolModel);
    try {
      toolDao.merge(tool);
      return true;
    } catch (Exception e) {
      return false;
View Full Code Here

  }

  @Override
  public ToolModel getTool(Long idthrows Exception{

    Tool tool = this.toolDao.findByKey(id);
    return ToolToToolModel(tool);

  }
View Full Code Here

   * @param toolModelForDao
   * @return Tool
   */
  private Tool ToolModelForDaoToTool(ToolModelForDao toolModelForDao){

    Tool tool = new Tool();

    List<Category> tags = new ArrayList<Category>();
    List<MapDescription> description = new ArrayList<MapDescription>();

    MapDescription descriptionAr = new MapDescription();
    MapDescription descriptionEn = new MapDescription();
    MapDescription descriptionFr = new MapDescription();

    descriptionAr.setLang(ApplicationConstants.LANG_AR_AR);
    descriptionAr.setText(toolModelForDao.getDescription().get(ApplicationConstants.LANG_AR_AR));

    descriptionEn.setLang(ApplicationConstants.LANG_EN_US);
    descriptionEn.setText(toolModelForDao.getDescription().get(ApplicationConstants.LANG_EN_US));

    descriptionFr.setLang(ApplicationConstants.LANG_FR_FR);
    descriptionFr.setText(toolModelForDao.getDescription().get(ApplicationConstants.LANG_FR_FR));

    for(String tag : toolModelForDao.getTags()){
      tags.add(new Category(tag));
    }

    tool.setId(toolModelForDao.getId());
    tool.setTitle(toolModelForDao.getTitle());
    tool.setTags(tags);
    tool.setDescription(description);
    tool.setPublishedDate(new Date());
    tool.setImage(toolModelForDao.getImage());


    return tool;

  }
View Full Code Here

TOP

Related Classes of com.appspot.finajjarane.framework.entities.Tool

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.