DEPRECATED

# com.bea.p13n.content.document
Document Interface

public interface Document
extends `com.bea.p13n.content.Content`

The public interface for a Document.

This is the base interface for Document objects.

Documents are a specialized type of Content which are generally controlled by a Document Management System (DMS). The Document interface contains explicit attributes common to most types of documents and DMS's. Additionally, the Document interface has a method to retrieve the raw bytes of the actualy document itself (e.g. the images data of a GIF, the text of an HTML document). Documents inherit the identifier and mimeType attribute from the Content interface. Also, all other implicit attributes (i.e. metadata) about the document will be available.

The reference implementation document management system included in the PersonalizationServer does not support creation or modification of Documents via the EJB interfaces. However, other implementations might.

Attribute: `description```

- Containment: By Value
- Multiplicity: 1:1
- This is the text description of the doucment from the DMS.

Attribute: `size```

- Containment: By Value
- Multiplicity: 1:1
- This is the size of the document's files in bytes. If this is 0 or less, than the document doesn't have bytes and is represented entirely within the metadata.

Attribute: `modifiedBy```

- Containment: By Value
- Multiplicity: 1:1
- This is the identifier of who last modified the document.

Attribute: `modifiedDate```

- Containment: By Value
- Multiplicity: 1:1
- This is the time/date of when the document was last modified.

Attribute: `creationDate```

- Containment: By Value
- Multiplicity: 1:1
- The date upon which the document was created.

Attribute: `version```

- Containment: By Value
- Multiplicity: 1:1
- The version number of the document.

Attribute: `author```

- Containment: By Value
- Multiplicity: 1:1
- The identifier the author of the Document.

Attribute: `lockedBy```

- Containment: By Value
- Multiplicity: 1:1
- The identifier of who has the document locked in the DMS.

Attribute: `comments```

- Containment: By Value
- Multiplicity: 1:1
- Any comments associated with the document.

Attribute: `name```

- Containment: By Value
- Multiplicity: 1:1
- The name of the document, which generally corresponds to the original file name.

When constructing queries for Documents, the above property/attribute names will compare against the explicit attributes on the Document interface. For example, to find document whose size is less than 1024 bytes, you could use a query string like "size < 1024".

Related Topics

``DocumentManager``
``ExpressionHelper``

All Known Implementing Classes
  `com.bea.p13n.content.adapter.NodeDocument`

All Superinterfaces
  `com.bea.p13n.property.ConfigurableEntity`, `com.bea.p13n.content.Content`, `Serializable`

## Field Summary

Fields from interface com.bea.p13n.property`.`com.bea.p13n.property.ConfigurableEntity``
``RESERVED_PROPERTY_SET``

## Method Summary

`public `String`` | `getAuthor`() Get the identifier of the invididual who created the document.
`public `String`` | `getComments`() Get any text comments about the document.
`public byte[]` | `getContent`() Return the bytes of the document's content.
`public byte[]` | `getContentBlock`(long start, long size) Get a block of the bytes of the document's content.
`public `Timestamp`` | `getCreationDate`() Get the time/date of when the document was created.
`public `String`` | `getDescription`() Get the text description of the document.
`public `DocumentValue`` | `getDocumentByValue`() Get all of Document's attributes.
`public `String`` | `getLockedBy`() Get the identifier of the individual who has a lock on the document.
`public `String`` | `getModifiedBy`() Get the identifier of the individual who last modified the document.
`public `Timestamp`` | `getModifiedDate`() Get time and date of when the document was last modified.
`public `String`` | `getName`() Get the name of the document.
`public long` | `getSize`() Get the size of the document in bytes.
`public long` | `getVersion`() Get the version number of the document.
`public void` | `setAuthor`(`String` author) Set the author of the document.
`public void` | `setComments`(`String` comments) Set the comments about the document.
`public void` | `setCreationDate`(`Timestamp` creationDate) Set the time/date of when the document was created.
`public void` | `setDescription`(`String` description) Set the document description.
`public void` | `setDocumentByValue`(`DocumentValue` value) Set all of Document's attributes to the passed in value.
`public void` | `setLockedBy`(`String` lockedBy) Set the who has a lock on the document.
`public void` | `setModifiedBy`(`String` modifiedBy) Set the identifier of the individual who last modified the document.
`public void` | `setModifiedDate`(`Timestamp` modifiedDate) Set the time/date of when the document was last modified.
`public void` | `setName`(`String` name) Set the name of the document.
`public void` | `setSize`(long size) Set the size of the document.
`public void` | `setVersion`(long version) Set the version number.

Methods from interface `com.bea.p13n.property.`com.bea.p13n.property.ConfigurableEntity``
``getJndiName`, `getPkString`, `getProperty`, `getPropertyAsString`, `getPropertyNoDefault`, `getUniqueId`, `removeProperty`, `setProperty``

Methods from interface `com.bea.p13n.content.`com.bea.p13n.content.Content``
``getContentByValue`, `getIdentifier`, `getMimeType`, `setContentByValue`, `setMimeType``

## Method Detail

### getAuthor() Method

    public String getAuthor()
         throws RemoteException

Get the identifier of the invididual who created the document.

#### Returns

the author, or null if unknown.

#### Exceptions

``RemoteException``
  thrown on an error.

### getComments() Method

    public String getComments()
         throws RemoteException

Get any text comments about the document.

#### Returns

the comments, or null if none.

#### Exceptions

``RemoteException``
  thrown on an error.

### getContent() Method

    public byte[] getContent()
         throws RemoteException

Return the bytes of the document's content.

This currently doesn't support files larger than 2^31 bytes.

#### Exceptions

``RemoteException``
  thrown on an error.

### getContentBlock(long, long) Method

    public byte[] getContentBlock(long start,
                                long size)
         throws RemoteException

Get a block of the bytes of the document's content.

This currently just calls getContent() and returns a subarray. However, this will support retrieving large files when large files are supported.

#### Parameters

start
  the starting index in the byte array.

size
  the number of bytes to retrieve.

#### Exceptions

``RemoteException``
  thrown on an error.

### getCreationDate() Method

    public Timestamp getCreationDate()
         throws RemoteException

Get the time/date of when the document was created.

#### Returns

the creation date, or null if unknown.

#### Exceptions

``RemoteException``
  thrown on an error.

### getDescription() Method

    public String getDescription()
         throws RemoteException

Get the text description of the document.

#### Returns

the description or null if none.

#### Exceptions

``RemoteException``
  thrown on an error.

### getDocumentByValue() Method

DEPRECATED No longer needed - use Document object instead.

    public DocumentValue getDocumentByValue()
         throws RemoteException

Get all of Document's attributes.

#### Returns

DocumentValue the Document value object

#### Exceptions

``RemoteException``
  thrown on an error.

### getLockedBy() Method

    public String getLockedBy()
         throws RemoteException

Get the identifier of the individual who has a lock on the document.

#### Returns

the locker's identifier, or null if unknown.

#### Exceptions

``RemoteException``
  thrown on an error.

### getModifiedBy() Method

    public String getModifiedBy()
         throws RemoteException

Get the identifier of the individual who last modified the document.

#### Returns

the identifier of the modifier, null if none.

#### Exceptions

``RemoteException``
  thrown on an error.

### getModifiedDate() Method

    public Timestamp getModifiedDate()
         throws RemoteException

Get time and date of when the document was last modified.

#### Returns

the modified date, or null if unknown.

#### Exceptions

``RemoteException``
  thrown on an error.

### getName() Method

    public String getName()
         throws RemoteException

Get the name of the document.

In general, this should correspond to the original filename of the document, but is not guarenteed to. Additionally, the document's mimeType is not guarenteed to correspond to any extension on the filename.

This value should be used when prompting a user to save the file.

#### Returns

the name, or null if unknown.

#### Exceptions

``RemoteException``
  thrown on an error.

### getSize() Method

    public long getSize()
         throws RemoteException

Get the size of the document in bytes.

For now, since the document content itself is represented a byte array, the size returned should not be larger than Integer.MAX_VALUE. However, in the future, larger documents will be supported.

#### Returns

the size, 0 or less if no bytes associated with the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### getVersion() Method

    public long getVersion()
         throws RemoteException

Get the version number of the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### setAuthor(String) Method

    public void setAuthor(String author)
         throws RemoteException

Set the author of the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### setComments(String) Method

    public void setComments(String comments)
         throws RemoteException

Set the comments about the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### setCreationDate(Timestamp) Method

    public void setCreationDate(Timestamp creationDate)
         throws RemoteException

Set the time/date of when the document was created.

#### Exceptions

``RemoteException``
  thrown on an error.

### setDescription(String) Method

    public void setDescription(String description)
         throws RemoteException

Set the document description.

#### Parameters

description
  description to be added

#### Exceptions

``RemoteException``
  thrown on an error.

### setDocumentByValue(DocumentValue) Method

DEPRECATED Not implemented.

    public void setDocumentByValue(DocumentValue value)
         throws RemoteException

Set all of Document's attributes to the passed in value. Note: Primary key attributes are not set.

#### Parameters

value
  the Document value object

#### Exceptions

``RemoteException``
  thrown on an error.

### setLockedBy(String) Method

    public void setLockedBy(String lockedBy)
         throws RemoteException

Set the who has a lock on the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### setModifiedBy(String) Method

    public void setModifiedBy(String modifiedBy)
         throws RemoteException

Set the identifier of the individual who last modified the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### setModifiedDate(Timestamp) Method

    public void setModifiedDate(Timestamp modifiedDate)
         throws RemoteException

Set the time/date of when the document was last modified.

#### Exceptions

``RemoteException``
  thrown on an error.

### setName(String) Method

    public void setName(String name)
         throws RemoteException

Set the name of the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### setSize(long) Method

    public void setSize(long size)
         throws RemoteException

Set the size of the document.

#### Exceptions

``RemoteException``
  thrown on an error.

### setVersion(long) Method

    public void setVersion(long version)
         throws RemoteException

Set the version number.

#### Exceptions

``RemoteException``
  thrown on an error.