Package models

Examples of models.Residence


      SienaFixtures.deleteAllModels();
      SienaFixtures.loadModels("subscriber_B.yml");
      assertTrue("En total tiene que haber 1 residencia ", Residence.count()==1);
      assertTrue("La residencia kirikiño tiene registrados 6 usuarios.  ",
          User.findAll().size()==6);
      Residence residence = Residence.findByName("kirikiño");
      assertTrue(residence.name.equals("kirikiño"));
      assertTrue(Profile.findAll().size()==3);
      /*Configuracion del administrador*/
      addProfileToUser("laura.garcia", Profile.ProfileType.ADMIN);
      assertTrue("Debe existir un administrador para la residencia Kirikiño",
View Full Code Here


      Subscriber subscriber = Subscriber.findByName("A");
      assertTrue(subscriber.name.equals("A"));
      NamespaceManager.set(String.valueOf(subscriber.name));
      SienaFixtures.deleteAllModels();
      SienaFixtures.loadModels("subscriber_A.yml");
      Residence residence = Residence.findByName("egaña");
      assertTrue(residence.name.equals("egaña"));
      assertTrue(Profile.findAll().size()==3);
      assertTrue("El número de usuarios debe ser 7", User.findAll().size()==7);
      //Eduardo Perrino (eduardo.perrino) es administrador de la residencia A
      addProfileToUser("eduardo.perrino", Profile.ProfileType.ADMIN);
View Full Code Here

    UserResidenceJSON admin = (UserResidenceJSON) get("admin");
    return admin;
  }
 
  public Residence getResidence() {
    Residence residence = new Residence();
    residence.id = (Long) get("id");
    residence.name = (String) get("name");
   
    return residence;
  }
View Full Code Here

import exceptions.ValidationException;

public class Residences extends BaseController {
 
  public static void get() {
    Residence residence = Residence.findAll().get(0);
    renderJSON(gson().toJson(residence));
  }
View Full Code Here

    Residence residence = Residence.findAll().get(0);
    renderJSON(gson().toJson(residence));
  }
 
  public static void edit(Long id,  JsonObject body) {
    Residence residence = new Gson().fromJson(body, Residence.class);
    if(residence==null) {
      response.status = StatusCode.NOT_FOUND;
      return;
    }
    residence.update();
    response.status = StatusCode.OK;
    String url = Router.reverse("api.Residences.get").url;// GET /api/residence/
    response.setHeader("location", url);
  }
View Full Code Here

  @Before
  public static void checkResidence() {
    Logger.debug("---------------- checkResidence() ------------------------");
    String name = params.get("residenceName");
    if(name == null || ("").equals(name)) notFound();
    Residence residence = Residence.findByName(name);
    if(residence == null) notFound();
    Logger.debug("---------------- Namespace: %s ------------------------", name);
    flash.put("residenceName", name);
    NamespaceManager.set(String.valueOf(residence.id));
    renderArgs.put("residence", residence);
View Full Code Here

TOP

Related Classes of models.Residence

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.