Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.MetadataFileUploadRepository


     * @param context
     * @param metadataId
     * @param fileName
     */
    private void storeFileUploadDeleteRequest(ServiceContext context, int metadataId, String fileName) {
        MetadataFileUploadRepository repo = context.getBean(MetadataFileUploadRepository.class);

        try {
            MetadataFileUpload metadataFileUpload = repo.findByMetadataIdAndFileNameNotDeleted(metadataId, fileName);
            metadataFileUpload.setDeletedDate(new ISODate().toString());

            repo.save(metadataFileUpload);

        } catch (org.springframework.dao.EmptyResultDataAccessException ex) {
            Log.warning(Geonet.RESOURCES, "Delete file upload request: No upload request for (metadataid, file): (" + metadataId + "," + fileName + ")");
        }
    }
View Full Code Here


     * @param context
     * @param metadataId
     * @param fileName
     */
    private void storeFileUploadRequest(ServiceContext context, int metadataId, String fileName, double fileSize) {
        MetadataFileUploadRepository repo = context.getBean(MetadataFileUploadRepository.class);

        MetadataFileUpload metadataFileUpload = new MetadataFileUpload();

        metadataFileUpload.setMetadataId(metadataId);
        metadataFileUpload.setFileName(fileName);
        metadataFileUpload.setFileSize(fileSize);
        metadataFileUpload.setUploadDate(new ISODate().toString());
        metadataFileUpload.setUserName(context.getUserSession().getUsername());

        repo.save(metadataFileUpload);
    }
View Full Code Here

        // Process metadata results for the report
        Element response = new Element(Jeeves.Elem.RESPONSE);


        MetadataFileUploadRepository uploadRepo = context.getBean(MetadataFileUploadRepository.class);
        for (MetadataFileDownload fileDownload : records) {
            // User should be the user that uploaded the file
            int fileUploadId = fileDownload.getFileUploadId();
            MetadataFileUpload metadataFileUpload = uploadRepo.findOne(MetadataFileUploadSpecs.hasId(fileUploadId));

            User user = context.getBean(UserRepository.class).findOneByUsername(metadataFileUpload.getUserName());

            String username = user.getUsername();
            String name = (user.getName() != null?user.getName():"");
View Full Code Here

TOP

Related Classes of org.fao.geonet.repository.MetadataFileUploadRepository

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.