Package solysombra.domain

Examples of solysombra.domain.Place


  private void initialize(){
    //TODO METODO INITIALIZE
    PlaceList favoritos = new PlaceList();
    favoritos.setName("Default");
    favoritos.setDescription("Lista de favoritos por defecto");
    Place p1 = new Place(-2354.4654, 13.5984);
    p1.setEtiqueta("lugar1");
    Place p2 = new Place(589.15,354.446);
    p2.setEtiqueta("lugar2");
    favoritos.addPlace(p1);
    favoritos.addPlace(p2);
    repository.put(favoritos);
   
    PlaceList admin = new PlaceList();
    admin.setName("Admin");
    admin.setDescription("Lista de favoritos de Admin");
    Place p11 = new Place(4564.65846,153.21);
    p11.setEtiqueta("lugar_abandonado");
    Place p12 = new Place(-654654.5345,-65465.353543,Calendar.getInstance(),5);
    p12.setEtiqueta("playa_cristalina");
    Place p13 = new Place(45456.654,4564.654,Calendar.getInstance(),9);
    p13.setEtiqueta("monumento_importante");
    admin.addPlace(p11);
    admin.addPlace(p12);
    admin.addPlace(p13);
    repository.put(admin);
  }
View Full Code Here


  //Si
  @GET
  @Path("/{user}/{etiqueta}")
  @Produces("application/json")
  public Place getPlace(@PathParam("user") String user, @PathParam("etiqueta")String etiqueta){
    Place res = null;
    for(Place p: getPlaces(user).getPlaces()){
      if(p.getEtiqueta().equals(etiqueta)){
        res = p;
      }
    }
View Full Code Here

  @Path("/{user}/{etiqueta}")
  @Consumes("application/json")
  @Produces("application/json")
  public Response updatePlace(@Context UriInfo uriInfo,@PathParam("user") String user, @PathParam("etiqueta") String PlaceEtiqueta,Place Place)
  {
    Place oldPlace = getPlace(user, PlaceEtiqueta);
    if(Place == null){
      throw new NotFoundException(PlaceEtiqueta+"no fue encontrado en "+user);
    }
    if(! oldPlace.getEtiqueta().equals(Place.getEtiqueta())){
      return Response.status(javax.ws.rs.core.Response.Status.CONFLICT).build();
    }
    oldPlace.setDia(Place.getDia());
    oldPlace.setHora(Place.getHora());
    oldPlace.setCoordX(Place.getCoordX());
    oldPlace.setCoordY(Place.getCoordY());
   
    return Response.noContent().build();
    // TODO: Implement method
  }
View Full Code Here

 
  // Si
  @DELETE
  @Path("/{user}/{etiqueta}")
  public void removePlace(@PathParam("user") String user, @PathParam("etiqueta") String etiqueta){
    Place s= getPlace(user, etiqueta);
    getPlaces(user).getPlaces().remove(s);
    // TODO: Implement method
  }
View Full Code Here

TOP

Related Classes of solysombra.domain.Place

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.