コード例 #1
0
  private TIPDetailsDto edit(
      TIP tip,
      UserAccount userAccount,
      TIPtype type,
      String name,
      String description,
      String infoUrl,
      String address,
      String photoUrl)
      throws InstanceNotFoundException, InvalidTIPUrlException {
    tip.setType(type);
    tip.setName(name);
    tip.setDescription(description);
    tip.setInfoUrl(infoUrl);
    tip.setAddress(address);
    tip.setPhotoUrl(photoUrl);

    URLvalidator.checkURLs(tip);

    tipDao.save(tip);
    return dtoService.TIP2TIPDetailsDto(tip, userAccount);
  }
コード例 #2
0
  private TIPDetailsDto create(
      TIPtype tipType,
      String name,
      String description,
      String photoUrl,
      String infoUrl,
      Geometry geom,
      Long osmId,
      boolean reviewed,
      boolean getAddress,
      Long facebookUserId)
      throws TIPLocationException, InvalidTIPUrlException, InstanceNotFoundException {
    TIP tip = new TIP();
    tip.setType(tipType);
    tip.setName(name);
    tip.setDescription(description);
    tip.setGeom(geom);
    tip.setPhotoUrl(photoUrl);
    tip.setInfoUrl(infoUrl);
    tip.setOsmId(osmId);
    tip.setReviewed(reviewed);
    tip.setCreationDate(Calendar.getInstance());
    tip.setUserAccount(userAccountDao.findByFBUserID(facebookUserId));

    if (getAddress) {
      Coordinate coordinate = tip.getGeom().getCoordinate();
      tip.setGoogleMapsUrl(gMapsServiceForUsers.getTIPGoogleMapsUrl(coordinate));
      tip.setAddress(getAddress(gMapsServiceForUsers, coordinate));
    }

    City city = cityService.getCityFromLocation(geom);
    tip.setCity(city);

    URLvalidator.checkURLs(tip);

    tipDao.save(tip);
    return dtoService.TIP2TIPDetailsDto(tip, null);
  }