Package uk.org.woodcraft.bookings.persistence

Source Code of uk.org.woodcraft.bookings.persistence.VillageAction

package uk.org.woodcraft.bookings.persistence;

import org.apache.struts2.interceptor.validation.SkipValidation;

import uk.org.woodcraft.bookings.auth.Operation;
import uk.org.woodcraft.bookings.auth.SecurityModel;
import uk.org.woodcraft.bookings.datamodel.Village;

import com.google.appengine.api.datastore.Key;

public class VillageAction extends BasePersistenceAction<Village>{

  private static final long serialVersionUID = 1L;
 

  @SkipValidation
  public String list() {
    SecurityModel.checkGlobalOperationAllowed(Operation.READ);
    setModelList(CannedQueries.villagesForEvent(getCurrentEvent()));
    return SUCCESS;
  }

  @Override
  public void prepare() throws Exception {
   
    Key key = getWebKeyAsKey();
    if (key != null)
    {
      setModel(CannedQueries.villageByKey(key));
    } else {
      setModel(new Village(getCurrentEvent()));
    }
  }
}
TOP

Related Classes of uk.org.woodcraft.bookings.persistence.VillageAction

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.