Examples of ERDatabaseAttachment


Examples of er.attachment.model.ERDatabaseAttachment

    }
    if (smallDataStr != null) {
      smallData = Boolean.parseBoolean(smallDataStr);
    }

    ERDatabaseAttachment attachment = ERDatabaseAttachment.createERDatabaseAttachment(editingContext, Boolean.TRUE, new NSTimestamp(), mimeType, recommendedFileName, Boolean.TRUE, Integer.valueOf((int) uploadedFile.length()), webPath);
    if (delegate() != null) {
      delegate().attachmentCreated(this, attachment);
    }
    try {
      attachment.setWebPath(ERAttachmentProcessor._parsePathTemplate(attachment, webPath, recommendedFileName));
      NSData data = new NSData(uploadedFile.toURI().toURL());
      if (smallData) {
        attachment.setSmallData(data);
      }
      else {
        ERAttachmentData attachmentData = ERAttachmentData.createERAttachmentData(editingContext);
        attachmentData.setData(data);
        attachment.setAttachmentDataRelationship(attachmentData);
      }
      if (delegate() != null) {
        delegate().attachmentAvailable(this, attachment);
      }
    }
    catch (IOException e) {
      attachment.delete();
      throw e;
    }
    catch (RuntimeException e) {
      attachment.delete();
      throw e;
    }
    finally {
      if (pendingDelete) {
        uploadedFile.delete();
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.