Package javango.http

Examples of javango.http.Http404


   
    if (response != null) {
      return response;
    }
       
    throw new Http404("No URLs matched: '" + path + "'");
  }
View Full Code Here


  }
 
  public HttpResponse search(HttpRequest request, String model) throws HttpException {
    Class pc = options.getClassMapping(model);
    if (pc == null) {
      throw new Http404("Class not found");
    }
    ModelAdmin ma = options.getModelAdmin(pc);
   
    if (!ma.isReader(request.getUser())) {
      throw new Http404("Class not found, or not authorized");
    }
   
    String[] property_list = ma.getListSearchFields();     

    Form form = ma.getSearchForm();
View Full Code Here

 
  public HttpResponse changeList(HttpRequest request, String model) throws HttpException {
    try {
      Class pc = options.getClassMapping(model);
      if (pc == null) {
        throw new Http404("Class not found");
      }
      ModelAdmin ma = options.getModelAdmin(pc);
     
      if (!ma.isReader(request.getUser())) {
        throw new Http404("Class not found, or not authorized");
      }
     
      Manager<?> manager = findManager(pc, ma);

      String[] property_list = ma.getListDisplay();
View Full Code Here

      object_id = object_id == null ? null : URLDecoder.decode(object_id, settings.getDefaultCharset());
     
      // TODO Changet object_id to an Object and figure out the correct datatype from the dao. dont' think this is necessary
      Class pc = options.getClassMapping(model);
      if (pc == null) {
        throw new Http404("Class not found");
      }
      ModelAdmin ma = options.getModelAdmin(pc);
     
      if (object_id != null && !ma.isEditor(request.getUser())) {
        throw new Http404("Class not found, or not authorized");
      } else if (!ma.isAuthor(request.getUser())) {
        throw new Http404("Class not found, or not authorized");
      }
     
      Manager manager = findManager(pc, ma);
     
      Object object = null;
View Full Code Here

    try {
      object_id = object_id == null ? null : URLDecoder.decode(object_id, settings.getDefaultCharset());

      Class pc = options.getClassMapping(model);
      if (pc == null) {
        throw new Http404("Class not found");
      }
      ModelAdmin ma = options.getModelAdmin(pc);
     
      Manager manager = findManager(pc, ma);

      Object object = manager.get(object_id);
      if (object == null) {
        throw new Http404("Not found"); // TODO 404
      }
 
//      if (!bl.canDelete(object)) {
//        throw new HttpException("Unauthorized to delete");
//      }
View Full Code Here

  public <T> T getObjectOr404(Class<T> model, Serializable key) throws HttpException {
    try {
      T object = getObject(model, key);
      if (object == null) {
        //   TODO Make the error message a little cleaner,  maybe don't use the full class name.
        throw new Http404(String.format("Unable to find '%s' instance with key '%s'", model.getName(), key));     
      }
      return object;
    } catch (ManagerException e) {
      throw new Http500(e.getMessage());
    }
View Full Code Here

   
    try {
      T object = manager.filter(field, value).get();
      if (object == null) {
        //   TODO Make the error message a little cleaner,  maybe don't use the full class name.
        throw new Http404(String.format("Unable to find '%s' instance with '%s' of '%s'", model.getName(), field, value));     
      }
      return object;
    } catch (ManagerException e) {
      throw new Http500(e.getMessage());
    }
View Full Code Here

TOP

Related Classes of javango.http.Http404

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.