Package com.appspot.finajjarane.framework.models

Examples of com.appspot.finajjarane.framework.models.ToolModel


   * @param tool
   * @return ToolModel
   */
  private ToolModel ToolToToolModel(Tool tool){

    ToolModel toolModel = new ToolModel();
    List<String> tagsModels = new ArrayList<String>();

    for(Category tag : tool.getTags()){
      tagsModels.add(tag.getCategory());
    }

    toolModel.setId(tool.getId());
    toolModel.setTitle(tool.getTitle());
    for (MapDescription description : tool.getDescription()) {
      if(description.getLang() == Utils.getLanguage()){
        toolModel.setBody(description.getText().getValue());
        break;
      }
    }
    toolModel.setTags(tagsModels);
    toolModel.setImage(tool.getImage());
    toolModel.setPublishedDate(Utils.dateToDateDetailsModel(tool.getPublishedDate(),Utils.getLanguage() ));

    return toolModel;

  }
View Full Code Here


  }

  @RequestMapping(value="/edit/{id}")
  public ModelAndView edit(@PathVariable int id){
    Map<String, Object> data = new HashMap<String, Object>();
    ToolModel tool;
    try {
      tool = this.iToolService.getTool(new Long(id));
      data.put("tool", tool);
    } catch (Exception e) {
      data.put(ApplicationConstants.VELOCITY_MESSAGE_HANDLER, e.getLocalizedMessage());
View Full Code Here

    ToolModelForDao toolModelFroDao = new ToolModelForDao();

    try {
      Map<String, Text> description = new HashMap<String, Text>();
      ToolModel toolModel = iToolService.getTool(toolId);

      description.put("ar_AR", new Text(toolDescription_ar_AR));
      description.put("en_US", new Text(toolDescription_en_US));
      description.put("fr_FR", new Text(toolDescription_fr_FR));


      toolModelFroDao.setId(toolId);
      toolModelFroDao.setTitle(toolTitle.trim());
      toolModelFroDao.setDescription(description);
      toolModelFroDao.setTags(toolTags);

      String keyImage = iImageService.getImageKeyUploaded(httpServletRequest, "toolImage");



      if(toolDeleteImage){
        toolModelFroDao.setImage(null);
      }
      else if(null!=keyImage && !keyImage.isEmpty()){
        toolModelFroDao.setImage(keyImage);
      }
      else{
        toolModelFroDao.setImage(this.iToolService.getTool(toolModel.getId()).getImage());
      }

      iToolService.toolUpdate(toolModelFroDao);

    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.appspot.finajjarane.framework.models.ToolModel

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.