Package ag.ion.bion.officelayer.document

Examples of ag.ion.bion.officelayer.document.DocumentException


        if (message == null || message.length() == 0)
          message = Messages.getString("PersistenceService.error_io_message", String.valueOf(((ErrorCodeIOException) throwable).ErrCode)); //$NON-NLS-1$
      }
      else if (message == null || message.length() == 0)
        message = ERROR_MESSAGE;
      throw new DocumentException(message, throwable);
    }
  }
View Full Code Here


   *
   * @author Andreas Br�ker
   */
  public void store(String url) throws DocumentException {
    if (url == null)
      throw new DocumentException(Messages.getString("PersistenceService.error_url_invalid_message")); //$NON-NLS-1$

    try {
      url = URLAdapter.adaptURL(url);
      PropertyValue[] initialPropertyValues = document.getInitialProperties();
      String filterDefinition = null;
      for (int i = 0; i < initialPropertyValues.length; i++) {
        if (initialPropertyValues[i].Name.equalsIgnoreCase("FilterName"))
          filterDefinition = initialPropertyValues[i].Value.toString();
      }
      boolean useFilter = filterDefinition != null && filterDefinition.length() > 0;
      if (useFilter) {
        PropertyValue[] propertyValues = new PropertyValue[1];
        propertyValues[0] = new PropertyValue();
        propertyValues[0].Name = "FilterName"; //$NON-NLS-1$   
        propertyValues[0].Value = filterDefinition;
        xStorable.storeAsURL(url, propertyValues);
      }
      else {
        xStorable.storeAsURL(url, new PropertyValue[0]);
      }
      document.setModified(false);
    }
    catch (Throwable throwable) {
      String message = throwable.getMessage();
      if (throwable instanceof ErrorCodeIOException) {
        if (message == null || message.length() == 0)
          message = Messages.getString("PersistenceService.error_io_message", String.valueOf(((ErrorCodeIOException) throwable).ErrCode)); //$NON-NLS-1$
      }
      else if (message == null || message.length() == 0)
        message = ERROR_MESSAGE;
      throw new DocumentException(message, throwable);
    }
  }
View Full Code Here

        if (message == null || message.length() == 0)
          message = Messages.getString("PersistenceService.error_io_message", String.valueOf(((ErrorCodeIOException) throwable).ErrCode)); //$NON-NLS-1$
      }
      else if (message == null || message.length() == 0)
        message = ERROR_MESSAGE;
      throw new DocumentException(message, throwable);
    }
    document.fireDocumentEvent(IDocument.EVENT_ON_SAVE_DONE);
    document.fireDocumentEvent(IDocument.EVENT_ON_SAVE_FINISHED);
  }
View Full Code Here

   *
   * @author Andreas Br�ker
   */
  public void export(String url, IFilter filter) throws DocumentException {
    if (url == null)
      throw new DocumentException(Messages.getString("PersistenceService.error_url_invalid_message")); //$NON-NLS-1$

    if (filter == null)
      throw new DocumentException(Messages.getString("PersistenceService.error_filter_invalid_message")); //$NON-NLS-1$

    String filterDefinition = filter.getFilterDefinition(document);

    PropertyValue[] properties = new PropertyValue[1];

    if (filterDefinition != null) {
      properties[0] = new PropertyValue();
      properties[0].Name = "FilterName"; //$NON-NLS-1$
      properties[0].Value = filterDefinition;
    }
    //TODO set compression mode for pdf   

    if (!filter.isExternalFilter())
      document.fireDocumentEvent(IDocument.EVENT_ON_SAVE_AS);
    try {
      url = URLAdapter.adaptURL(url);
      xStorable.storeToURL(url, properties);
    }
    catch (Throwable throwable) {
      String message = throwable.getMessage();
      if (throwable instanceof ErrorCodeIOException) {
        message = ErrorCodeTranslator.getErrorCodeMessage(((ErrorCodeIOException) throwable).ErrCode);
        if (message == null)
          message = Messages.getString("PersistenceService.error_io_message", String.valueOf(((ErrorCodeIOException) throwable).ErrCode)); //$NON-NLS-1$
      }
      else if (message == null || message.length() == 0)
        message = ERROR_MESSAGE;
      throw new DocumentException(message, throwable);
    }
    if (!filter.isExternalFilter())
      document.fireDocumentEvent(IDocument.EVENT_ON_SAVE_AS_DONE);
  }
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.document.DocumentException

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.