Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013

ag.ion.bion.officelayer.internal.document
Class DocumentService

java.lang.Object
  extended by ag.ion.bion.officelayer.internal.document.DocumentService
All Implemented Interfaces:
IDocumentService, IDisposeable

public class DocumentService
extends java.lang.Object
implements IDocumentService

Service for documents.


Constructor Summary
DocumentService(IOfficeConnection officeConnection, IServiceProvider serviceProvider)
          Constructs new DocumentService.
 
Method Summary
 IDocument constructNewDocument(IFrame frame, java.lang.String documentType, IDocumentDescriptor documentDescriptor)
          Constructs new document in the submitted frame.
 IDocument constructNewDocument(java.lang.String documentType, IDocumentDescriptor documentDescriptor)
          Constructs new document.
 IDocument constructNewHiddenDocument(java.lang.String documentType)
          Constructs new hidden document of the submitted type.
 void dispose()
          Disposes all allocated resources.
 IDocument[] getCurrentDocuments()
          Returns current documents of an application.
 IDocument loadDocument(IFrame frame, java.io.InputStream inputStream, IDocumentDescriptor documentDescriptor)
          Loads document on the basis of the submitted stream.
 IDocument loadDocument(IFrame frame, java.lang.String url)
          Loads document into the submitted frame.
 IDocument loadDocument(IFrame frame, java.lang.String url, IDocumentDescriptor documentDescriptor)
          Loads document into the submitted frame.
 IDocument loadDocument(java.io.InputStream inputStream, IDocumentDescriptor documentDescriptor)
          Loads document on the basis of the submitted stream.
 IDocument loadDocument(IOfficeProgressMonitor officeProgressMonitor, IFrame frame, java.io.InputStream inputStream, IDocumentDescriptor documentDescriptor)
          Loads document on the basis of the submitted stream.
 IDocument loadDocument(IOfficeProgressMonitor officeProgressMonitor, java.io.InputStream inputStream, IDocumentDescriptor documentDescriptor)
          Loads document on the basis of the submitted stream.
 IDocument loadDocument(java.lang.String url)
          Loads document on the basis of the submitted URL.
 IDocument loadDocument(java.lang.String url, IDocumentDescriptor documentDescriptor)
          Loads document on the basis of the submitted URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentService

public DocumentService(IOfficeConnection officeConnection,
                       IServiceProvider serviceProvider)
                throws java.lang.IllegalArgumentException
Constructs new DocumentService.

Parameters:
officeConnection - office connection to be used
serviceProvider - the service provider to be used
Throws:
java.lang.IllegalArgumentException - if the submitted office connection is not valid
Method Detail

constructNewDocument

public IDocument constructNewDocument(java.lang.String documentType,
                                      IDocumentDescriptor documentDescriptor)
                               throws NOAException
Constructs new document.

Specified by:
constructNewDocument in interface IDocumentService
Parameters:
documentType - document type to be used
documentDescriptor - document descriptor to be used
Returns:
new constructed document
Throws:
NOAException - if the new document can not be constructed

constructNewDocument

public IDocument constructNewDocument(IFrame frame,
                                      java.lang.String documentType,
                                      IDocumentDescriptor documentDescriptor)
                               throws NOAException
Constructs new document in the submitted frame.

Use one of the types:

IDocument.WRITER
IDocument.CALC
IDocument.IMPRESS
IDocument.DRAW
IDocument.MATH
IDocument.WEB
IDocument.BASE
IDocument.GLOBAL

Specified by:
constructNewDocument in interface IDocumentService
Parameters:
frame - frame to be used
documentType - document type to be used
documentDescriptor - document descriptor to be used
Returns:
new constructed document
Throws:
NOAException - if the new document can not be constructed

constructNewHiddenDocument

public IDocument constructNewHiddenDocument(java.lang.String documentType)
                                     throws NOAException
Constructs new hidden document of the submitted type.

Use one of the types:

IDocument.WRITER
IDocument.CALC
IDocument.IMPRESS
IDocument.DRAW
IDocument.MATH
IDocument.WEB
IDocument.BASE
IDocument.GLOBAL

Specified by:
constructNewHiddenDocument in interface IDocumentService
Parameters:
documentType - document type to be constructed
Returns:
new constructed document of the submitted type
Throws:
NOAException - if the document can not be contructed

loadDocument

public IDocument loadDocument(java.lang.String url)
                       throws DocumentException
Loads document on the basis of the submitted URL.

Specified by:
loadDocument in interface IDocumentService
Parameters:
url - URL of the document
Returns:
loaded document
Throws:
DocumentException - if the document can not be loaded or the URL does not locate an OpenOffice.org document

loadDocument

public IDocument loadDocument(java.lang.String url,
                              IDocumentDescriptor documentDescriptor)
                       throws NOAException
Loads document on the basis of the submitted URL.

Specified by:
loadDocument in interface IDocumentService
Parameters:
url - URL of the document
documentDescriptor - document descriptor to be used
Returns:
loaded document
Throws:
NOAException - if the document can not be loaded or the URL does not locate an OpenOffice.org document

loadDocument

public IDocument loadDocument(java.io.InputStream inputStream,
                              IDocumentDescriptor documentDescriptor)
                       throws DocumentException
Loads document on the basis of the submitted stream.

Specified by:
loadDocument in interface IDocumentService
Parameters:
inputStream - input stream to be used
documentDescriptor - document descriptor to be used
Returns:
loaded document
Throws:
DocumentException - if the document can not be loaded

loadDocument

public IDocument loadDocument(IFrame frame,
                              java.io.InputStream inputStream,
                              IDocumentDescriptor documentDescriptor)
                       throws DocumentException
Loads document on the basis of the submitted stream. The document has no location and can not be stored with the store() method of the IPersistenceService. Furthermore OpenOffice.org can not recognize if the document is already open - therefore the document will be never opened in ReadOnly mode.

Specified by:
loadDocument in interface IDocumentService
Parameters:
frame - frame to be used for the document
inputStream - input stream to be used
documentDescriptor - document descriptor to be used
Returns:
loaded document
Throws:
DocumentException - if the document can not be loaded

loadDocument

public IDocument loadDocument(IOfficeProgressMonitor officeProgressMonitor,
                              java.io.InputStream inputStream,
                              IDocumentDescriptor documentDescriptor)
                       throws DocumentException
Loads document on the basis of the submitted stream.

Specified by:
loadDocument in interface IDocumentService
Parameters:
officeProgressMonitor - office progress monitor to be used
inputStream - input stream to be used
documentDescriptor - document descriptor to be used
Returns:
loaded document
Throws:
DocumentException - if the document can not be loaded

loadDocument

public IDocument loadDocument(IOfficeProgressMonitor officeProgressMonitor,
                              IFrame frame,
                              java.io.InputStream inputStream,
                              IDocumentDescriptor documentDescriptor)
                       throws DocumentException
Loads document on the basis of the submitted stream. The document has no location and can not be stored with the store() method of the IPersistenceService. Furthermore OpenOffice.org can not recognize if the document is already open - therefore the document will be never opened in ReadOnly mode.

Specified by:
loadDocument in interface IDocumentService
Parameters:
officeProgressMonitor - office progress monitor to be used
frame - frame to be used for the document
inputStream - input stream to be used
documentDescriptor - document descriptor to be used
Returns:
loaded document
Throws:
DocumentException - if the document can not be loaded

loadDocument

public IDocument loadDocument(IFrame frame,
                              java.lang.String url)
                       throws DocumentException
Loads document into the submitted frame.

Specified by:
loadDocument in interface IDocumentService
Parameters:
frame - frame to be used for the document
url - URL of the document (must start with file:///)
Returns:
loaded document
Throws:
DocumentException - if the document can not be loaded, the URL does not locate an OpenOffice.org document of the submitted frame or URL is not valid

loadDocument

public IDocument loadDocument(IFrame frame,
                              java.lang.String url,
                              IDocumentDescriptor documentDescriptor)
                       throws DocumentException
Loads document into the submitted frame.

Specified by:
loadDocument in interface IDocumentService
Parameters:
frame - frame to be used for the document
url - URL of the document
documentDescriptor - document descriptor to be used
Returns:
loaded document
Throws:
DocumentException - if the document can not be loaded, the URL does not locate an OpenOffice.org document or the submitted frame or URL is not valid

getCurrentDocuments

public IDocument[] getCurrentDocuments()
                                throws DocumentException
Returns current documents of an application.

Specified by:
getCurrentDocuments in interface IDocumentService
Returns:
documents of an application
Throws:
DocumentException - if the documents cannot be provided

dispose

public void dispose()
Disposes all allocated resources.

Specified by:
dispose in interface IDisposeable

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013