|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.f1j.ss.Document
This class contains an single workbook document, and maintains the
appropriate locks on any associated files. The release()
method closes the document and releases any associated file locks.
Calling the release() method is mandatory for any code using
this class. If the release() method is not called, this class
will not release its lock on the file(s) associated with the document.
Creating an instance of this class will either (1) create a new workbook, or (2) open an existing workbook. Existing workbooks may come from the filesystem, an input stream, a network resource, or a byte array.
When a file is opened from the filesystem, it is normally locked and may be
saved over itself using the fileSave() method. Or the file
may be opened read-only, in which case the fileSaveAs() method must
be used.
An open workbook document is always associated with a specific file type. For new workbooks, this is the most current Acuate workbook format. For existing workbooks, it is the format of the existing data. The format may be overridden when the document is saved.
For any workbook document there are several options such as password and
encryption settings, which affect how the document is saved. These are
options retrieved and set using the getDocumentSaveOptions() and
setDocumentSaveOptions() methods.
| Constructor Summary | |
Document(Group group)
Create an empty workbook document and attach it to the specified group. |
|
Document(Group group,
byte[] byteArray,
DocumentOpenCallback openCallback)
Open an existing workbook document and attach it to the specified group. |
|
Document(Group group,
java.io.File file,
boolean forceReadOnly,
DocumentOpenCallback openCallback)
Open an existing workbook document and attach it to the specified group. |
|
Document(Group group,
java.io.File file,
DocumentOpenCallback openCallback)
Open an existing workbook document and attach it to the specified group. |
|
Document(Group group,
java.io.InputStream stream,
DocumentOpenCallback openCallback)
Open an existing workbook document and attach it to the specified group. |
|
Document(Group group,
java.net.URL url,
DocumentOpenCallback openCallback)
Open an existing workbook document and attach it to the specified group. |
|
| Method Summary | |
int |
addRef()
Increments the reference count for this document. |
void |
fileSave(DocumentSaveCallback saveCallback)
Saves the document to the same location from which it was opened. |
void |
fileSaveAs(java.io.File outputFile,
DocumentType docType,
DocumentSaveCallback saveCallback)
Saves the document to a different location than that from which it was opened. |
void |
fileSaveAs(java.io.OutputStream stream,
DocumentType docType,
DocumentSaveCallback saveCallback)
Saves the document to a different location than that from which it was opened. |
void |
fileSaveCopyAs(java.io.File outputFile,
DocumentType docType,
DocumentSaveCallback saveCallback)
Saves the a copy of the document to a different location than that from which it was opened. |
void |
fileSaveCopyAs(java.io.OutputStream stream,
DocumentType docType,
DocumentSaveCallback saveCallback)
Saves the a copy of the document to a different location than that from which it was opened. |
byte[] |
fileSaveCopyAsByteArray(DocumentType docType,
DocumentSaveCallback saveCallback)
Saves the a copy of the document to a byte array. |
Book |
getBook()
Returns the Book object of this document. |
DocumentSaveOptions |
getDocumentSaveOptions()
Returns an object representing the "save" options for this document. |
DocumentType |
getDocumentType()
Returns the file format currently associated with this document. |
java.io.File |
getFile()
Returns the File object associated with this document, or null if none. |
java.lang.String |
getFileGUID()
Returns the string representation of the globally unique identifier for the file. |
java.lang.String |
getInstanceGUID()
Returns the string representation of a globally unique identifier for this instance of the Document class. |
boolean |
isReadOnly()
Returns true if this document is opened as read-only. |
int |
release()
Decrements the reference count for this document. |
void |
setDocumentSaveOptions(DocumentSaveOptions options)
Sets the "save" options for this document according to the state of the specified object. |
| Constructor Detail |
public Document(Group group)
group - The group to which this document will be attached, or null to create a new group.
public Document(Group group,
java.io.File file,
DocumentOpenCallback openCallback)
throws java.io.IOException,
F1Exception
group - The group to which this document will be attached, or null to create a new group.file - The file to be opened.openCallback - An object providing the information needed to open the document.DocumentOpenCallback.
public Document(Group group,
java.io.File file,
boolean forceReadOnly,
DocumentOpenCallback openCallback)
throws java.io.IOException,
F1Exception
group - The group to which this document will be attached, or null to create a new group.file - The file to be opened.forceReadOnly - true if the file is to be opened read-only regardless of user privileges and file status.openCallback - An object providing the information needed to open the document.DocumentOpenCallback.
public Document(Group group,
java.io.InputStream stream,
DocumentOpenCallback openCallback)
throws java.io.IOException,
F1Exception
group - The group to which this document will be attached, or null to create a new group.stream - The stream containing the workbook.openCallback - An object providing the information needed to open the document.DocumentOpenCallback.
public Document(Group group,
java.net.URL url,
DocumentOpenCallback openCallback)
throws java.io.IOException,
F1Exception
group - The group to which this document will be attached, or null to create a new group.url - The URL to be opened.openCallback - An object providing the information needed to open the document.DocumentOpenCallback.
public Document(Group group,
byte[] byteArray,
DocumentOpenCallback openCallback)
throws java.io.IOException,
F1Exception
group - The group to which this document will be attached, or null to create a new group.byteArray - The byte array containing the workbook.openCallback - An object providing the information needed to open the document.DocumentOpenCallback.| Method Detail |
public void fileSaveAs(java.io.OutputStream stream,
DocumentType docType,
DocumentSaveCallback saveCallback)
throws java.io.IOException,
F1Exception
stream - The stream into which the workbook will be saved.docType - The file format to be used.saveCallback - An object to handle special conditions that occur during save.DocumentSaveCallback.
public void fileSave(DocumentSaveCallback saveCallback)
throws java.io.IOException,
F1Exception
saveCallback - An object to handle special conditions that occur during save.DocumentSaveCallback.
public void fileSaveAs(java.io.File outputFile,
DocumentType docType,
DocumentSaveCallback saveCallback)
throws java.io.IOException,
F1Exception
outputFile - The file to be saved.docType - The file format to be used.saveCallback - An object to handle special conditions that occur during save.DocumentSaveCallback.
public void fileSaveCopyAs(java.io.File outputFile,
DocumentType docType,
DocumentSaveCallback saveCallback)
throws java.io.IOException,
F1Exception
outputFile - The file to be saved.docType - The file format to be used.saveCallback - An object to handle special conditions that occur during save.DocumentSaveCallback.
public void fileSaveCopyAs(java.io.OutputStream stream,
DocumentType docType,
DocumentSaveCallback saveCallback)
throws java.io.IOException,
F1Exception
stream - The stream into which the workbook will be saved.docType - The file format to be used.saveCallback - An object to handle special conditions that occur during save.DocumentSaveCallback.
public byte[] fileSaveCopyAsByteArray(DocumentType docType,
DocumentSaveCallback saveCallback)
throws java.io.IOException,
F1Exception
docType - The file format to be used.saveCallback - An object to handle special conditions that occur during save.DocumentSaveCallback.public Book getBook()
public java.io.File getFile()
null if none.null if none.public boolean isReadOnly()
true if this document is opened as read-only.true if this document is opened as read-only.public DocumentType getDocumentType()
public DocumentSaveOptions getDocumentSaveOptions()
setDocumentSaveOptions(DocumentSaveOptions)public void setDocumentSaveOptions(DocumentSaveOptions options)
options - An object containing save options for the document.getDocumentSaveOptions()public int addRef()
release() method before discarding the reference. If
release() is not called, then any associated file locks
will not be released.
public int release()
throws java.io.IOException
public java.lang.String getInstanceGUID()
public java.lang.String getFileGUID()
Returns the string representation of the globally unique identifier for the file. This GUID changes each time the file is saved.
This method may return null if this is a newly created
document that has never been saved, or if this document was read from
a file that did not contain a GUID.
null if there is none.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||