Examples of PhotoUpload


Examples of cloudinary.models.PhotoUpload

        }
    }

    @RequestMapping(value = "/upload_form", method = RequestMethod.GET)
    public String uploadPhotoForm(ModelMap model) {
        model.addAttribute("photoUpload", new PhotoUpload());
        return "upload_form";
    }
View Full Code Here

Examples of cloudinary.models.PhotoUpload

        return "upload_form";
    }

    @RequestMapping(value = "/direct_upload_form", method = RequestMethod.GET)
    public String directUploadPhotoForm(ModelMap model) {
        model.addAttribute("photoUpload", new PhotoUpload());
        model.addAttribute("unsigned", false);
        return "direct_upload_form";
    }
View Full Code Here

Examples of cloudinary.models.PhotoUpload

    }
   
    @SuppressWarnings("unchecked")
  @RequestMapping(value = "/direct_unsigned_upload_form", method = RequestMethod.GET)
    public String directUnsignedUploadPhotoForm(ModelMap model) throws Exception {
        model.addAttribute("photoUpload", new PhotoUpload());
        model.addAttribute("unsigned", true);
        Cloudinary cld = Singleton.getCloudinary();
        String preset = "sample_" + cld.apiSignRequest(Cloudinary.asMap("api_key", cld.getStringConfig("api_key")), cld.getStringConfig("api_secret")).substring(0, 10);
        model.addAttribute("preset", preset);
        try {
View Full Code Here

Examples of cloudinary.models.PhotoUpload

        return PhotoUpload.class.equals(clazz);
    }

    public void validate(Object obj, Errors e) {
        ValidationUtils.rejectIfEmpty(e, "title", "title.empty");
        PhotoUpload pu = (PhotoUpload) obj;
        if (pu.getFile() == null || pu.getFile().isEmpty()) {
            if (!pu.validSignature()) {
                e.rejectValue("signature", "signature.mismatch");
            }
        }
    }
View Full Code Here

Examples of cloudinary.models.PhotoUpload

      DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
      Key photoKey = KeyFactory.createKey("photos", "album");
      List<Entity> photoEntities = datastore.prepare(new Query("photo", photoKey)).asList(FetchOptions.Builder.withDefaults());
      List<PhotoUpload> photos = new java.util.ArrayList<PhotoUpload>();
    for(int i = 0, n = photoEntities.size(); i < n; i++) { 
        photos.add(new PhotoUpload(photoEntities.get(i)));
      }
        model.addAttribute("photos", photos);
        return "photos";
    }
View Full Code Here

Examples of cloudinary.models.PhotoUpload

        }
    }

    @RequestMapping(value = "/upload_form", method = RequestMethod.GET)
    public String uploadPhotoForm(ModelMap model) {
        model.addAttribute("photo", new PhotoUpload());
        return "upload_form";
    }
View Full Code Here

Examples of cloudinary.models.PhotoUpload

        return "upload_form";
    }

    @RequestMapping(value = "/direct_upload_form", method = RequestMethod.GET)
    public String directUploadPhotoForm(ModelMap model) {
        model.addAttribute("photo", new PhotoUpload());
        return "direct_upload_form";
    }
View Full Code Here
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.