|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface that represents a document, or more specifically, a collection of metadata about a Collaboration document.
To retrieve an existing document, use IDocumentManager.getDocument
.
To insert a new document, first obtain a new empty IDocument
using
IDocumentManager.createNewDocument
, set some of the
metadata such as author, then call IDocumentManager.insertNewDocument
.
To retrieve the actual content of a saved document, call getContentAsInputStream()
Any modification of a document will not be stored permanently until store
is called.
Method Summary | |
AccessLevel |
getAccessLevel(RoleType roleType)
Returns document access level for a given role type. |
java.lang.String |
getAuthor()
Returns a string representing the author of the document. |
java.util.Date |
getCheckedOutDate()
Returns the date on which the document was last checked out. |
IDocumentFolder |
getContainingFolder()
Returns an IDocumentFolder object representing the document folder that this document is stored in. |
IProject |
getContainingProject()
Returns An IProject instance representing the project to which this document belongs. |
java.io.InputStream |
getContentAsInputStream()
Returns an InputStream for reading the contents of the current version of the document. |
java.io.InputStream |
getContentAsInputStream(int version)
Returns an InputStream for reading the contents of the current version of the document. |
java.lang.String |
getContentType()
Returns a string representing the content type of the document. |
java.lang.String |
getContentURL()
Returns the URL at which the document can be downloaded. |
java.util.Date |
getCreatedDate()
Returns the creation date. |
java.lang.String |
getDescription()
Returns the document description. |
java.lang.String |
getDetailsURL()
Returns the URL at which the document details can be viewed. |
int |
getID()
Returns the document ID. |
java.util.Date |
getLastModifiedDate()
Returns the last modified date. |
java.lang.String |
getName()
Returns the document name. |
IObjectReference[] |
getObjectReferences()
Returns an array of IObjectReference . |
int |
getOwnerUserID()
Returns the user ID of the owner of this document. |
java.lang.String |
getPath(java.lang.String pathSeparationString)
Returns a string representation of the path of a document. |
int |
getPublishedPortalDocumentID()
Returns the corresponding document ID of the portal document to which the document has been published. |
IDocumentVersion[] |
getVersionHistory()
Returns an array of IDocumentVersion. |
boolean |
hasCheckedOutDate()
Returns true if the date of the last check-out is available, otherwise false . |
boolean |
hasCreatedDate()
Returns true if the created date is available, otherwise false . |
boolean |
hasLastModifiedDate()
Returns true if last modified date is available, otherwise false . |
boolean |
isActionAllowed(DocumentPermission permission)
Returns whether or not a given DocumentPermission is allowed for this document. |
boolean |
isCheckedOut()
Returns a boolean indicating whether or not the document is currently checked out. |
boolean |
isDefaultSecurity()
Indicates whether this document uses project-default security. |
boolean |
isPublishedToPortal()
Returns a boolean value indicating whether or not the document has been published to the portal Knowledge Directory. |
void |
setAccessLevel(RoleType roleType,
AccessLevel accessLevel)
Set document access level for a given role type. |
void |
setAuthor(java.lang.String author)
Sets the document author. |
void |
setContentType(java.lang.String contentType)
Sets the document content type, which is a MIME type, such as text/plain , text/xml;charset=utf-8" , etc. |
void |
setDefaultSecurity(boolean isDefaultSecurity)
Enables or disables this document's use of project default security. |
void |
setDescription(java.lang.String description)
Sets the document description. |
void |
setName(java.lang.String name)
Sets the document name. |
void |
store()
Stores properties or metadata of a document. |
Method Detail |
public AccessLevel getAccessLevel(RoleType roleType)
roleType
- the role type for which to get the access level ; cannot be null
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic java.lang.String getAuthor()
java.lang.IllegalStateException
- if the document has already been removedpublic java.util.Date getCheckedOutDate()
java.lang.IllegalStateException
- if the document has not yet been inserted, has already been removed, or has not been
checked outpublic IDocumentFolder getContainingFolder() throws CollaborationException, java.rmi.RemoteException
IDocumentFolder
object representing the document folder that this document is stored in.
CollaborationException
- if the method call resulted in an error
java.lang.IllegalStateException
- if the document has already been removed
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic IProject getContainingProject() throws CollaborationException, java.rmi.RemoteException
IProject
instance representing the project to which this document belongs.
CollaborationException
- if the method call resulted in an error
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic java.io.InputStream getContentAsInputStream() throws CollaborationException, java.rmi.RemoteException
InputStream
for reading the contents of the current version of the document.
WARNING: It is essential the the client call close()
on the input stream once
finished reading from it. It is recommended to put a call to close()
in a
finally
block.
InputStream
that can be used to read the document contents
CollaborationException
- if the method call resulted in an error
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic java.io.InputStream getContentAsInputStream(int version) throws CollaborationException, java.rmi.RemoteException
InputStream
for reading the contents of the current version of the document.
WARNING: It is essential the the client call close()
on the input stream once
finished reading from it. It is recommended to put a call to close()
in a
finally
block.
version
- a valid document version
InputStream
that can be used to read the document contents
CollaborationException
- if the method call resulted in an error
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed, or if the version number does not exist.
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic java.lang.String getContentType()
text/plain
.
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic java.lang.String getContentURL()
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic java.util.Date getCreatedDate()
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic java.lang.String getDescription()
java.lang.IllegalStateException
- if the document has already been removedpublic java.lang.String getDetailsURL()
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic int getID()
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic java.util.Date getLastModifiedDate()
java.lang.IllegalStateException
- if the
document has not yet been inserted or has already been removedpublic java.lang.String getName()
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic IObjectReference[] getObjectReferences() throws CollaborationException, java.rmi.RemoteException
IObjectReference
.
For documents, object references include attached task lists and discussions.
IObjectReference
for the current document
CollaborationException
- if the method call resulted in an error
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed, or if the version number does not exist.
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic int getOwnerUserID()
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic java.lang.String getPath(java.lang.String pathSeparationString)
pathSeparationString
- the string to insert between path components; cannot be null
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic int getPublishedPortalDocumentID() throws PermissionDeniedException, CollaborationException, java.rmi.RemoteException
java.lang.IllegalStateException
- if the document has not been published to the portal, has not
yet been inserted, or has already been removed
PermissionDeniedException
- if the user does not have the permission to edit the document
CollaborationException
- if the method call resulted in an error
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic IDocumentVersion[] getVersionHistory() throws CollaborationException, java.rmi.RemoteException
IDocumentVersion
for the current document
CollaborationException
- if the method call resulted in an error
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed, or if the version number does not exist.
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic boolean hasCheckedOutDate()
true
if the date of the last check-out is available, otherwise false
.
true
if the date of the last check-out is available, else false
java.lang.IllegalStateException
- if the document has already been removedpublic boolean hasCreatedDate()
true
if the created date is available, otherwise false
.
true
if the created date is available, else false
java.lang.IllegalStateException
- if the document has already been removedpublic boolean hasLastModifiedDate()
true
if last modified date is available, otherwise false
.
true
if last modified date is available, else false
java.lang.IllegalStateException
- if the document has already been removedpublic boolean isActionAllowed(DocumentPermission permission) throws CollaborationException, java.rmi.RemoteException
DocumentPermission
is allowed for this document.
This method can be used to determine if a user can perform a given action within the context of a document such
as editing a document, copying a document, editing document security, etc. See the enumeration type
DocumentPermission
for details about specific document permissions.
permission
- the document permission; cannot be null
true
if the user can perform the given action, else false
java.rmi.RemoteException
- if there is a communication problem during the execution of the remote method call.
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed
CollaborationException
- if the call resulted in an errorpublic boolean isCheckedOut()
java.lang.IllegalStateException
- if the document has already been removedpublic boolean isDefaultSecurity()
true
, modifying security on the current document will not be possible.
setDefaultSecurity
must be set to false
in order to modify
security for an individual document. Default value for isDefaultSecurity
is true
.
true
if the document uses project-default security, false
if the document is
enabled to use its own security
java.lang.IllegalStateException
- if the document has already been removedpublic boolean isPublishedToPortal() throws PermissionDeniedException, CollaborationException, java.rmi.RemoteException
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been
removed
CollaborationException
- if the method call resulted in an error
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method call
PermissionDeniedException
public void setAccessLevel(RoleType roleType, AccessLevel accessLevel)
false
by calling
setDefaultSecurity(false)
.
roleType
- the role type for which access level will be setaccessLevel
- the access level
java.lang.IllegalStateException
- if the document has not yet been inserted, has already been removed, or is set to
use default securitypublic void setAuthor(java.lang.String author)
author
- a string containing the author; cannot be null
java.lang.IllegalStateException
- if the document has already been removed.public void setContentType(java.lang.String contentType)
text/plain
, text/xml;charset=utf-8"
, etc.
When uploading a document that contains non-ASCII characters (particularly, European accented
letters), this method must be called to set the content type to text/xml;charset=iso-8859-1
prior to calling IDocumentManager.insertNewDocument
.
contentType
- a string containing the content type; cannot be null
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removedpublic void setDefaultSecurity(boolean isDefaultSecurity)
true
will enable defaultSecurity
,
calling it with false
will disable defaultSecurity
. defaultSecurity
set to true
.
To modify security on an individual document, the document must have defaultSecurity
disabled before modification. After this method is called, any project-level security modification will not be applied to the
document, and only the individual document's security will be used.isDefaultSecurity
, which would indicate if the current document has defaultSecurity
enabled.
isDefaultSecurity
- true
if it uses default security, otherwise false
java.lang.IllegalStateException
- if the document has already been removedpublic void setDescription(java.lang.String description)
description
- the description; cannot be null
java.lang.IllegalStateException
- if the document has already been removedpublic void setName(java.lang.String name)
name
- the document name; cannot be null
java.lang.IllegalStateException
- if the document has already been removedpublic void store() throws PermissionDeniedException, CollaborationException, java.rmi.RemoteException
IDocumentManager.checkInDocument
.
PermissionDeniedException
- if the user does not have the permission to edit the document
CollaborationException
- if the method call resulted in an error
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method call
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©2010 Oracle® Corporation. All Rights Reserved.