# com.bea.p13n.content.adapter
NodeDocument Class

public class NodeDocument
extends `Object`
implements `Document`

A Document implementation backed by a content Node.

This is really only designed to be used by the pz_compat_taglib.jar versions of the pz: tags in conjunction with the 7.0 ContentManager adapter to 8.1 content management.

Hierarchy
  `Object`
  `NodeDocument`

All Implemented Interfaces
  `ConfigurableEntity`, `Content`, `Document`, `Serializable`

## Constructor Summary

NodeDocument(`Node` node) Constructor.

## Method Summary

`public `String`` | `getAuthor`() Get the author of the document.
`public `String`` | `getComments`() Get the document comments.
`public byte[]` | `getContent`() Return the bytes of the document's content.
`public byte[]` | `getContentBlock`(long start, long length) Get a block of the bytes of the document's content.
`public `ContentValue`` | `getContentByValue`() Return the content value object.
`public `Timestamp`` | `getCreationDate`() Get the date the document was created.
`public `String`` | `getDescription`() Get the description.
`public `DocumentValue`` | `getDocumentByValue`() Get the document value for this.
`public `String`` | `getIdentifier`() Get the identifier for the content object.
`public `String`` | `getJndiName`() Retrieve the jndi name for an entity.
`public `String`` | `getLockedBy`() Get the locker of the document.
`public `String`` | `getMimeType`() Get the mime type of the content object.
`public `String`` | `getModifiedBy`() Get last modifier of the document.
`public `Timestamp`` | `getModifiedDate`() Get the date the document was last modified.
`public `String`` | `getName`() Get the document name.
`public `String`` | `getPkString`() Retrieve the pk string for an entity.
`public `Object`` | `getProperty`(`String` propertySet, `String` propertyName) Retrieves a property value.
`public `String`` | `getPropertyAsString`(`String` propertySet, `String` propertyName) Retrieves a property value as a string.
`public `Object`` | `getPropertyNoDefault`(`String` propertySet, `String` name) Retrieves a property value without using a default value.
`public long` | `getSize`() Get the size of the document.
`public long` | `getUniqueId`() Retrieve the unique identifier generated for this ConfigurableEntity.
`public long` | `getVersion`() Get the document version number.
`public `Object`` | `removeProperty`(`String` propertySet, `String` propertyName) Remove the property associated with the named key in the specified property set.
`public void` | `setAuthor`(`String` author) This method does nothing
`public void` | `setComments`(`String` s) This method does nothing
`public void` | `setContentByValue`(`ContentValue` val) This method does nothing.
`public void` | `setCreationDate`(`Timestamp` date) This method does nothing
`public void` | `setDescription`(`String` s) This method does nothing
`public void` | `setDocumentByValue`(`DocumentValue` val) This method does nothing
`public void` | `setLockedBy`(`String` s) This method does nothing
`public void` | `setMimeType`(`String` mimeType) Set the mime type of the document object.
`public void` | `setModifiedBy`(`String` s) This method does nothing
`public void` | `setModifiedDate`(`Timestamp` d) This method does nothing
`public void` | `setName`(`String` s) This method does nothing
`public void` | `setProperty`(`String` propertySet, `String` propertyName, `Object` value) Associate the specified value with the named key in the specified property set.
`public void` | `setSize`(long size) This method does nothing
`public void` | `setVersion`(long ver) This method does nothing
`public static `Timestamp`` | `toTimestamp`(`Calendar` c)

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

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

Methods from interface `com.bea.p13n.content.document.`Document``
``getAuthor`, `getComments`, `getContent`, `getContentBlock`, `getCreationDate`, `getDescription`, `getDocumentByValue`, `getLockedBy`, `getModifiedBy`, `getModifiedDate`, `getName`, `getSize`, `getVersion`, `setAuthor`, `setComments`, `setCreationDate`, `setDescription`, `setDocumentByValue`, `setLockedBy`, `setModifiedBy`, `setModifiedDate`, `setName`, `setSize`, `setVersion``

## Constructor Detail

### NodeDocument

    public NodeDocument(Node node)

  Constructor.

## Method Detail

### getAuthor() Method

    public String getAuthor()
         throws RemoteException

Get the author of the document.

#### Returns

the author, or null if unknown.

#### Exceptions

``RemoteException``

### getComments() Method

    public String getComments()
         throws RemoteException

Get the document comments.

#### Returns

the comments, or null if none.

#### Exceptions

``RemoteException``

### getContent() Method

    public byte[] getContent()
         throws RemoteException

Description copied from `Document.getContent()`
Return the bytes of the document's content.

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

#### Exceptions

``RemoteException``

### getContentBlock(long, long) Method

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

Description copied from `Document.getContentBlock(long, long)`
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.

length
  the number of bytes to retrieve.

#### Exceptions

``RemoteException``

### getContentByValue() Method

DEPRECATED No longer needed - Use Content object instead.

    public ContentValue getContentByValue()
         throws RemoteException

Return the content value object.

#### Returns

ContentValue the Content value object.

#### Exceptions

``RemoteException``

### getCreationDate() Method

    public Timestamp getCreationDate()
         throws RemoteException

Get the date the document was created.

#### Returns

the creation date, or null if unknown.

#### Exceptions

``RemoteException``

### getDescription() Method

    public String getDescription()
         throws RemoteException

Get the description.

#### Returns

the description or null if none.

#### Exceptions

``RemoteException``

### getDocumentByValue() Method

DEPRECATED No longer needed - use Document object instead.

    public DocumentValue getDocumentByValue()
         throws RemoteException

Get the document value for this.

#### Returns

DocumentValue the Document value object

#### Exceptions

``RemoteException``

### getIdentifier() Method

    public String getIdentifier()
         throws RemoteException

Get the identifier for the content object.

#### Exceptions

``RemoteException``

### getJndiName() Method

    public String getJndiName()

Retrieve the jndi name for an entity. A combination of pk string and jndi name is always unique between entities.

#### Returns

the jndi name for this entity

### getLockedBy() Method

    public String getLockedBy()
         throws RemoteException

Get the locker of the document.

#### Returns

the locker's identifier, or null if unknown.

#### Exceptions

``RemoteException``

### getMimeType() Method

    public String getMimeType()
         throws RemoteException

Get the mime type of the content object.

#### Returns

mimeType.

#### Exceptions

``RemoteException``

### getModifiedBy() Method

    public String getModifiedBy()
         throws RemoteException

Get last modifier of the document.

#### Returns

the identifier of the modifier, null if none.

#### Exceptions

``RemoteException``

### getModifiedDate() Method

    public Timestamp getModifiedDate()
         throws RemoteException

Get the date the document was last modified.

#### Returns

the modified date, or null if unknown.

#### Exceptions

``RemoteException``

### getName() Method

    public String getName()
         throws RemoteException

Get the document name.

#### Returns

the name, or null if unknown.

#### Exceptions

``RemoteException``

### getPkString() Method

    public String getPkString()
         throws RemoteException

Retrieve the pk string for an entity. A combination of pk string and jndi name is always unique between entities.

#### Returns

the primary key string identifier for this entity

#### Exceptions

``RemoteException``

### getProperty(String, String) Method

    public Object getProperty(String propertySet,
                              String propertyName)
         throws RemoteException

Retrieves a property value.

This is the driving get method. All other getters should call this one.

#### Parameters

propertySet
  The name of the property set to look in

propertyName
  The name of the property to retrieve.

#### Returns

the property value, or null if not set

#### Exceptions

``RemoteException``

### getPropertyAsString(String, String) Method

    public String getPropertyAsString(String propertySet,
                                      String propertyName)
         throws RemoteException

Retrieves a property value as a string.

#### Parameters

propertySet
  The name of the property set to look in

propertyName
  The name of the property to retrieve.

#### Returns

the property value as a string, or null if not set

#### Exceptions

``RemoteException``

### getPropertyNoDefault(String, String) Method

    public Object getPropertyNoDefault(String propertySet,
                                       String name)
         throws RemoteException

Retrieves a property value without using a default value.

This is the driving get method. All other getters should call this one.

#### Parameters

propertySet
  The name of the property set

name
  The name of the property to retrieve.

#### Returns

the property value, or null if not set

#### Exceptions

``RemoteException``

### getSize() Method

    public long getSize()
         throws RemoteException

Get the size of the document.

#### Returns

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

#### Exceptions

``RemoteException``

### getUniqueId() Method

    public long getUniqueId()

Retrieve the unique identifier generated for this ConfigurableEntity. The unique identifier is used by the EntityPropertyManager to optimize the foreign keys in the persistent storage. This method may not be implemented in a lightweight implementation of ConfigurableEntity.

#### Returns

this entity's unique id

### getVersion() Method

    public long getVersion()
         throws RemoteException

Get the document version number.

#### Exceptions

``RemoteException``

### removeProperty(String, String) Method

    public Object removeProperty(String propertySet,
                                 String propertyName)

Remove the property associated with the named key in the specified property set.

This method does nothing.

#### Parameters

propertySet
  The name of the property set.

propertyName
  The name of the property to remove.

#### Returns

the old value of the property, or null if there was none.

### setAuthor(String) Method

    public void setAuthor(String author)

This method does nothing

### setComments(String) Method

    public void setComments(String s)

This method does nothing

### setContentByValue(ContentValue) Method

DEPRECATED Not implemented.

    public void setContentByValue(ContentValue val)

This method does nothing.

#### Parameters

val
  the Content value object

### setCreationDate(Timestamp) Method

    public void setCreationDate(Timestamp date)

This method does nothing

### setDescription(String) Method

    public void setDescription(String s)

This method does nothing

#### Parameters

s
  description to be added

### setDocumentByValue(DocumentValue) Method

DEPRECATED Not implemented.

    public void setDocumentByValue(DocumentValue val)

This method does nothing

#### Parameters

val
  the Document value object

### setLockedBy(String) Method

    public void setLockedBy(String s)

This method does nothing

### setMimeType(String) Method

    public void setMimeType(String mimeType)

Set the mime type of the document object.

#### Parameters

mimeType
  mimeType to be added

### setModifiedBy(String) Method

    public void setModifiedBy(String s)

This method does nothing

### setModifiedDate(Timestamp) Method

    public void setModifiedDate(Timestamp d)

This method does nothing

### setName(String) Method

    public void setName(String s)

This method does nothing

### setProperty(String, String, Object) Method

    public void setProperty(String propertySet,
                            String propertyName,
                            Object value)

Associate the specified value with the named key in the specified property set.

This method does nothing.

#### Parameters

propertySet
  The name of the property set.

propertyName
  The name of the property to assign

value
  The value to associate with the property name

### setSize(long) Method

    public void setSize(long size)

This method does nothing

### setVersion(long) Method

    public void setVersion(long ver)

This method does nothing

### toTimestamp(Calendar) Method

    public static Timestamp toTimestamp(Calendar c)