Examples of ERAttachment


Examples of er.attachment.model.ERAttachment

  @SuppressWarnings("unused")
  private static Logger log = Logger.getLogger(Company.class);
 
  @Override
  public void setLogo(ERAttachment value) {
    ERAttachment attachment = logo();
    if (attachment != null) {
      attachment.delete();
    }
    super.setLogo(value);
  }
View Full Code Here

Examples of er.attachment.model.ERAttachment

  public void appendToResponse(WOResponse response, WOContext context) {
   
    WOComponent component = context.component();
    response.appendContentString("<a ");
    String href = null;
    ERAttachment attachment = (ERAttachment)valueForBinding("attachment", component);

    if(valueForBinding("href", component) != null) {
      href = (String)valueForBinding("href", component);
    } else if(attachment != null) {
      href = ERAttachmentProcessor.processorForType(attachment).attachmentUrl(attachment, context.request(), context);
View Full Code Here

Examples of er.attachment.model.ERAttachment

      if (height == -1) {
        height = ERXProperties.intForKeyWithDefault("er.attachment.height", -1);
      }
    }
   
    ERAttachment attachment = ERAttachmentProcessor.processorForType(storageType).process(editingContext, uploadedFile, _filePath, mimeType, width, height, configurationName, ownerID);
    if (ERXComponentUtilities.booleanValueForBinding(this, "cleanup", false)) {
      ERAttachment oldAttachment = (ERAttachment) valueForBinding("attachment");
      if (oldAttachment != null) {
        oldAttachment.delete();
      }
    }
   
    setValueForBinding(attachment, "attachment");
    return attachment;
View Full Code Here

Examples of er.attachment.model.ERAttachment

    return (ERAttachment) valueForBinding("attachment");
  }

  public String attachmentUrl() {
    WOContext context = context();
    ERAttachment attachment = attachment();
    return ERAttachmentProcessor.processorForType(attachment).attachmentUrl(attachment, context.request(), context);
  }
View Full Code Here

Examples of er.attachment.model.ERAttachment

   * @return the class name of the viewer to use for the given mime type.
   */
  public String viewerClassName() {
    String viewerClassName = null;

    ERAttachment attachment = attachment();
    if (attachment != null) {
      if (attachment.available().booleanValue()) {
        ERMimeType mimeType = attachment.erMimeType();
        if (mimeType != null) {
          viewerClassName = ERXProperties.stringForKey("er.attachment.mimeType." +  mimeType.mimeType() +".viewer");
          if (viewerClassName == null) {
            viewerClassName = ERXProperties.stringForKey("er.attachment.mimeType." +  mimeType.globMimeType().mimeType() +".viewer");
          }
View Full Code Here

Examples of er.attachment.model.ERAttachment

        FileOutputStream os = null;
        try {
          File uploadedFile = File.createTempFile("DragAndDropUpload-", ".tmp");
          os = new FileOutputStream(uploadedFile);
          data.writeToStream(os);
          ERAttachment upload = ERAttachmentProcessor.processorForType(storageType()).process(editingContext(), uploadedFile, filename, mimetype, configurationName(), null);
          setValueForBinding(upload, "attachment");
          invokeAction = true;
          FileUtils.deleteQuietly(uploadedFile);
        } catch (IOException e) {
          throw NSForwardException._runtimeExceptionForThrowable(e);
View Full Code Here

Examples of er.attachment.model.ERAttachment

  }

  @Override
  public void appendToResponse(WOResponse response, WOContext context) {
    WOComponent component = context.component();
    ERAttachment attachment = (ERAttachment) _attachment.valueInComponent(component);
    String attachmentUrl = "#";
    if (attachment != null) {
      attachmentUrl = ERAttachmentProcessor.processorForType(attachment).attachmentUrl(attachment, context.request(), context);
      if (!attachment.available().booleanValue() || attachment.isNewObject()) {
        response.appendContentString("<span");
        ERXComponentUtilities.appendHtmlAttributes(_associations, response, component);
        response.appendContentString(">");
        super.appendToResponse(response, context);
        response.appendContentString("</span>");
View Full Code Here

Examples of er.attachment.model.ERAttachment

    return (ERAttachment) valueForBinding("attachment");
  }

  public String attachmentUrl() {
    WOContext context = context();
    ERAttachment attachment = attachment();
    return ERAttachmentProcessor.processorForType(attachment).attachmentUrl(attachment, context.request(), context);
  }
View Full Code Here

Examples of er.attachment.model.ERAttachment

          EOEditingContext editingContext = ERXEC.newEditingContext();
          editingContext.lock();

          try {
            ERAttachment attachment = fetchAttachmentFor(editingContext, requestedAttachmentID, requestedWebPath);
           
            if (_delegate != null && !_delegate.attachmentVisible(attachment, request, context)) {
              throw new SecurityException("You are not allowed to view the requested attachment.");
            }
            mimeType = attachment.mimeType();
            length = attachment.size().longValue();
            fileName = attachment.originalFileName();
            ERAttachmentProcessor<ERAttachment> attachmentProcessor = ERAttachmentProcessor.processorForType(attachment);
            if (!proxyAsAttachment) {
              proxyAsAttachment = attachmentProcessor.proxyAsAttachment(attachment);
            }
            InputStream rawAttachmentInputStream = attachmentProcessor.attachmentInputStream(attachment);
View Full Code Here

Examples of er.attachment.model.ERAttachment

   *
   * @author davendasora
   * @since Apr 25, 2014
   */
  public static ERAttachment fetchAttachmentFor(final EOEditingContext editingContext, final Integer attachmentPrimaryKey, final String requestedWebPath) {
    ERAttachment attachment;
    if (attachmentPrimaryKey != null) {
      final EOGlobalID gid = EOKeyGlobalID.globalIDWithEntityName(ERAttachment.ENTITY_NAME, new Object[] {(attachmentPrimaryKey)});
      attachment = (ERAttachment) ERXEOGlobalIDUtilities.fetchObjectWithGlobalID(editingContext, gid);

      /*
 
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.