Package solysombra.domain

Examples of solysombra.domain.PlaceList


  }
 
  //a�adimos datos para el test en el repositorio
  private void initialize(){
    //TODO METODO INITIALIZE
    PlaceList favoritos = new PlaceList();
    favoritos.setName("Favoritos");
    favoritos.setDescription("Lista de favoritos");
  }
View Full Code Here


 
  @Get
  @Produces("application/json")
  public PlaceList getPlaceListFav(){
    String name = "Favoritos";
    PlaceList list = repository.get(name);
    if(list==null){
      throw new NotFoundException("La lista "+name+" no ha sido encontrada");
    }
    return list;
  }
View Full Code Here

  @GET
  @Produces("application/json")
  public List<Place> getAllPlaces(@PathParam("user") String user)
  {
    List<Place> result=null;
    PlaceList placelist = PlaceListResource.getInstance().getPlaces(user);
    if(placelist!=null){
      result=placelist.getPlaces();
    }else
      throw new NotFoundException("placelist"+user+" not found");
   
    return result;
    // TODO: Implement method
View Full Code Here

  }
 
  //a�adimos datos para el test en el repositorio
  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
  @Produces("application/json")
  @Path("/{user}")
  public PlaceList getPlaces(@PathParam("user")String user){
    PlaceList list = repository.get(user);
    if (list == null) {
      throw new NotFoundException("El "+user+" no ha sido encontrado");
    }
    return list;
  }
View Full Code Here

  //Si
  @PUT
  @Path("/{user}")
  @Consumes("application/json")
  public Response updatePlacelist(@PathParam("user") String user, PlaceList placelist) {
    PlaceList oldplacelist = repository.get(user);
    if (oldplacelist == null) {
      throw new NotFoundException("El usuario "+user+" no fue encontrado");     
    }
   
    if (!oldplacelist.getName().equals(placelist.getName())) {
      return Response.status(javax.ws.rs.core.Response.Status.CONFLICT).build();
    }
   
    repository.put(placelist);
   
View Full Code Here

 
  //Si
  @DELETE
  @Path("/{user}")
  public void removePlacelist(@PathParam("user") String name) {
    PlaceList toberemoved=repository.get(name);
    if (toberemoved == null)
      throw new NotFoundException("El usuario "+name+" no fue encontrado");
    else
      repository.remove(toberemoved);
  }
View Full Code Here

TOP

Related Classes of solysombra.domain.PlaceList

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.