Package ag.ion.bion.officelayer.document

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


   * @author Andreas Br�ker
   */
  public IDocument loadDocument(IFrame frame, String url,
      IDocumentDescriptor documentDescriptor) throws DocumentException {
    if (frame == null)
      throw new DocumentException("The submitted frame is not valid."); //$NON-NLS-1$

    if (url == null)
      throw new DocumentException("The submitted url is not valid."); //$NON-NLS-1$

    try {
      url = URLAdapter.adaptURL(url);
      IDocument document = DocumentLoader
          .loadDocument(
              serviceProvider,
              frame.getXFrame(),
              url,
              FrameSearchFlag.ALL,
              DocumentDescriptorTransformer
                  .documentDescriptor2PropertyValues(documentDescriptor));
      if (document != null)
        return document;
      else
        throw new DocumentException(Messages
            .getString("DocumentService_exception_url_invalid")); //$NON-NLS-1$
    } catch (Exception exception) {
      DocumentException documentException = new DocumentException(
          exception.getMessage());
      documentException.initCause(exception);
      throw documentException;
    }
  }
View Full Code Here


      }
      IDocument[] documents = new IDocument[arrayList.size()];
      documents = (IDocument[]) arrayList.toArray(documents);
      return documents;
    } catch (Exception exception) {
      throw new DocumentException(exception);
    }
  }
View Full Code Here

        aktComponents.nextElement();
        i++;
      }
      return i;
    } catch (Exception exception) {
      throw new DocumentException(exception);
    }
  }
View Full Code Here

        }
      } else
        printOpts = new PropertyValue[0];
      xPrintable.print(printOpts);
    } catch (Throwable throwable) {
      throw new DocumentException(throwable);
    }
  }
View Full Code Here

      else {
        xComponent = xComponentLoader.loadComponentFromURL(factoryURL, "_blank", 0, props); //$NON-NLS-1$
      }
      IDocument document = DocumentLoader.getDocument(xComponent, serviceProvider, props);
      if (document == null)
        throw new DocumentException("The new document can not be constructed."); //$NON-NLS-1$
      return document;
    }
    catch (Throwable throwable) {
      throw new NOAException(throwable);
    }
View Full Code Here

      url = URLAdapter.adaptURL(url);
      IDocument document = DocumentLoader.loadDocument(serviceProvider, url);
      if (document != null)
        return document;
      else
        throw new DocumentException(Messages.getString("DocumentService_exception_url_invalid")); //$NON-NLS-1$
    }
    catch (Throwable throwable) {
      DocumentException documentException = new DocumentException(throwable.getMessage());
      documentException.initCause(throwable);
      throw documentException;
    }
  }
View Full Code Here

      InputStream inputStream, IDocumentDescriptor documentDescriptor) throws DocumentException {
    XComponent xComponent = null;
    PropertyValue[] properties = new PropertyValue[1];
    try {
      if (inputStream == null)
        throw new DocumentException("The submitted input stream is not valid."); //$NON-NLS-1$

      if (xComponentLoader == null || !officeConnection.isConnected())
        xComponentLoader = constructComponentLoader();

      checkMaxOpenDocuments(serviceProvider);

      //begin task is done in class ByteArrayXInputStreamAdapter
      //if(officeProgressMonitor != null)
      //  officeProgressMonitor.beginTask(Messages.getString("DocumentService_monitor_message_preparing_loading"), IOfficeProgressMonitor.WORK_UNKNOWN); //$NON-NLS-1$

      ByteArrayXInputStreamAdapter byteArrayToXInputStreamAdapter = new ByteArrayXInputStreamAdapter(inputStream,
          officeProgressMonitor);
      properties[0] = new PropertyValue("InputStream", -1, byteArrayToXInputStreamAdapter, PropertyState.DIRECT_VALUE); //$NON-NLS-1$
      properties = DocumentDescriptorTransformer.documentDescriptor2PropertyValues(properties,
          documentDescriptor);

      if (frame == null)
        xComponent = xComponentLoader.loadComponentFromURL("private:stream", "_blank", 0, properties); //$NON-NLS-1$ //$NON-NLS-2$
      else
        xComponent = xComponentLoader.loadComponentFromURL("private:stream", frame.getXFrame().getName(), FrameSearchFlag.ALL, properties); //$NON-NLS-1$

    }
    catch (Throwable throwable) {
      throw new DocumentException(throwable);
    }

    if (officeProgressMonitor != null)
      officeProgressMonitor.beginSubTask(Messages.getString("DocumentService_monitor_investigating")); //$NON-NLS-1$
    IDocument document = DocumentLoader.getDocument(xComponent, serviceProvider, properties);
    if (document != null) {
      if (officeProgressMonitor != null) {
        officeProgressMonitor.beginSubTask(Messages.getString("DocumentService_monitor_loading_completed")); //$NON-NLS-1$
        officeProgressMonitor.done();
      }
      return document;
    }
    throw new DocumentException("The document can not be loaded."); //$NON-NLS-1$
  }
View Full Code Here

   * @author Andreas Br�ker
   */
  public IDocument loadDocument(IFrame frame, String url, IDocumentDescriptor documentDescriptor)
      throws DocumentException {
    if (frame == null)
      throw new DocumentException("The submitted frame is not valid."); //$NON-NLS-1$

    if (url == null)
      throw new DocumentException("The submitted url is not valid."); //$NON-NLS-1$

    try {
      url = URLAdapter.adaptURL(url);
      IDocument document = DocumentLoader.loadDocument(serviceProvider,
          frame.getXFrame(),
          url,
          FrameSearchFlag.ALL,
          DocumentDescriptorTransformer.documentDescriptor2PropertyValues(documentDescriptor));
      if (document != null)
        return document;
      else
        throw new DocumentException(Messages.getString("DocumentService_exception_url_invalid")); //$NON-NLS-1$
    }
    catch (Exception exception) {
      DocumentException documentException = new DocumentException(exception.getMessage());
      documentException.initCause(exception);
      throw documentException;
    }
  }
View Full Code Here

      IDocument[] documents = new IDocument[arrayList.size()];
      documents = (IDocument[]) arrayList.toArray(documents);
      return documents;
    }
    catch (Exception exception) {
      throw new DocumentException(exception);
    }
  }
View Full Code Here

        i++;
      }
      return i;
    }
    catch (Exception exception) {
      throw new DocumentException(exception);
    }
  }
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.