Package org.mifosplatform.infrastructure.documentmanagement.domain

Examples of org.mifosplatform.infrastructure.documentmanagement.domain.Image


    @Override
    public CommandProcessingResult deleteClientImage(final Long clientId) {

        final Client client = this.clientRepositoryWrapper.findOneWithNotFoundDetection(clientId);

        final Image image = client.getImage();
        // delete image from the file system
        if (image != null) {
            final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(StorageType.fromInt(image
                    .getStorageType()));
            contentRepository.deleteImage(clientId, image.getLocation());
            client.setImage(null);
            this.imageRepository.delete(image);
            this.clientRepositoryWrapper.save(client);
        }
View Full Code Here


        return new CommandProcessingResult(clientId);
    }

    private void deletePreviousClientImage(final Client client) {
        final Image image = client.getImage();
        if (image != null) {
            final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(StorageType.fromInt(image
                    .getStorageType()));
            contentRepository.deleteImage(client.getId(), image.getLocation());
        }
    }
View Full Code Here

            contentRepository.deleteImage(client.getId(), image.getLocation());
        }
    }

    private CommandProcessingResult updateClientImage(final Client client, final String imageLocation, final StorageType storageType) {
        Image image = client.getImage();
        if (image == null) {
            image = new Image(imageLocation, storageType);
        } else {
            image.setLocation(imageLocation);
            image.setStorageType(storageType.getValue());
        }
        this.imageRepository.save(image);
        client.setImage(image);
        this.clientRepositoryWrapper.save(client);
        return new CommandProcessingResult(client.getId());
View Full Code Here

TOP

Related Classes of org.mifosplatform.infrastructure.documentmanagement.domain.Image

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.