Package controllers.residences

Source Code of controllers.residences.SecureResidence

package controllers.residences;

import com.google.appengine.api.NamespaceManager;

import models.Residence;
import play.Logger;
import play.i18n.Messages;
import play.mvc.Before;
import controllers.Secure;

public class SecureResidence extends Secure {
  @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);
  }
 
}
TOP

Related Classes of controllers.residences.SecureResidence

TOP
Copyright © 2018 www.massapi.com. 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.