Package com.gcrm.domain

Examples of com.gcrm.domain.Attachment


                input = new byte[stream.available()];
                stream.read(input);
            } finally {
                stream.close();
            }
            Attachment attachment = null;
            attachment = document.getAttachment();
            if (attachment == null) {
                attachment = new Attachment();
                document.setAttachment(attachment);
            }
            attachment.setName(this.uploadFileName);
            document.setFileName(this.uploadFileName);
            attachment.setContent(input);
        }

        if ("Account".equals(this.getRelationKey())) {
            Account account = accountService.getEntityById(Account.class,
                    Integer.valueOf(this.getRelationValue()));
View Full Code Here


                input = new byte[stream.available()];
                stream.read(input);
            } finally {
                stream.close();
            }
            Attachment attachment = null;
            attachment = contact.getAttachment();
            if (attachment == null) {
                attachment = new Attachment();
                contact.setAttachment(attachment);
            }
            attachment.setName(this.uploadFileName);
            contact.setFileName(this.uploadFileName);
            attachment.setContent(input);
        }

        if ("Opportunity".equals(this.getRelationKey())) {
            Opportunity opportunity = opportunityService
                    .getEntityById(Opportunity.class,
View Full Code Here

    public InputStream getInputStream() throws Exception {
        byte[] fileBytes = null;
        if (this.getId() != null) {
            Contact contact = baseService.getEntityById(Contact.class,
                    this.getId());
            Attachment attachment = contact.getAttachment();
            if (attachment != null) {
                fileBytes = attachment.getContent();
            }
        }
        InputStream in = new ByteArrayInputStream(fileBytes);
        return in;
    }
View Full Code Here

    public InputStream getInputStream() throws Exception {
        byte[] fileBytes = null;
        if (this.getId() != null) {
            Document document = baseService.getEntityById(Document.class,
                    this.getId());
            Attachment attachment = document.getAttachment();
            if (attachment != null) {
                fileBytes = attachment.getContent();
            }
        }
        InputStream in = new ByteArrayInputStream(fileBytes);
        return in;
    }
View Full Code Here

TOP

Related Classes of com.gcrm.domain.Attachment

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.