org.apache.lenya.cms.publication
Interface Document

All Known Subinterfaces:
Collection
All Known Implementing Classes:
CollectionImpl, DefaultDocument, XlinkCollection

public interface Document

A CMS document.


Field Summary
static java.lang.String DEFAULT_PREFIX
           
static java.lang.String NAMESPACE
           
 
Method Summary
 boolean exists()
          Check if a document with the given document-id, language and in the given area actually exists.
 boolean existsInAnyLanguage()
          Check if a document exists with the given document-id and the given area independently of the given language.
 java.lang.String getArea()
          Returns the area this document belongs to.
 java.lang.String getCompleteInfoURL()
          Returns the complete URL of this document in the info area:
/{publication-id}/info-{area}{document-id}{language-suffix}.
 java.lang.String getCompleteURL()
          Returns the complete URL of this document:
/{publication-id}/{area}{document-id}{language-suffix}.
 java.lang.String getCompleteURLWithoutLanguage()
          Returns the complete URL of this document without the language-suffix: /{publication-id}/{area}{document-id}.
 java.lang.String getDocumentURL()
          Returns the URL of this document: {document-id}{language-suffix}.
 DublinCore getDublinCore()
          Returns the dublin core class for this document.
 java.lang.String getExtension()
          Returns the extension in the URL.
 java.io.File getFile()
          Returns the file for this document.
 java.lang.String getId()
          Returns the document ID of this document.
 java.lang.String getLabel()
          Get the navigation label associated with this document for the language.
 java.lang.String getLanguage()
          Returns the language of this document.
 java.lang.String[] getLanguages()
          Returns all the languages this document is available in.
 java.util.Date getLastModified()
          Returns the date of the last modification of this document.
 java.lang.String getName()
          Returns the document name of this document.
 java.lang.String getNodeId()
          Instead of returning the full document-id for this document it just returns the id of the particular node, basically the basename of the document-id.
 Publication getPublication()
          Returns the publication this document belongs to.
 

Field Detail

NAMESPACE

static final java.lang.String NAMESPACE
See Also:
Constant Field Values

DEFAULT_PREFIX

static final java.lang.String DEFAULT_PREFIX
See Also:
Constant Field Values
Method Detail

getId

java.lang.String getId()
Returns the document ID of this document.

Returns:
the document-id of this document.

getName

java.lang.String getName()
Returns the document name of this document.

Returns:
the document-name of this document.

getNodeId

java.lang.String getNodeId()
Instead of returning the full document-id for this document it just returns the id of the particular node, basically the basename of the document-id.

Returns:
the node id, i.e. the basename of the document-id

getPublication

Publication getPublication()
Returns the publication this document belongs to.

Returns:
A publication object.

getCompleteInfoURL

java.lang.String getCompleteInfoURL()
Returns the complete URL of this document in the info area:
/{publication-id}/info-{area}{document-id}{language-suffix}.{extension}

Returns:
A string.

getCompleteURL

java.lang.String getCompleteURL()
Returns the complete URL of this document:
/{publication-id}/{area}{document-id}{language-suffix}.{extension}

Returns:
A string.

getCompleteURLWithoutLanguage

java.lang.String getCompleteURLWithoutLanguage()
Returns the complete URL of this document without the language-suffix: /{publication-id}/{area}{document-id}.{extension} The URL always starts with a slash (/).

Returns:
A string.

getDocumentURL

java.lang.String getDocumentURL()
Returns the URL of this document: {document-id}{language-suffix}.{extension} The URL always starts with a slash (/).

Returns:
A string.

getDublinCore

DublinCore getDublinCore()
Returns the dublin core class for this document.

Returns:
A DublinCore object.

getLanguage

java.lang.String getLanguage()
Returns the language of this document. Each document has one language associated to it.

Returns:
A string denoting the language.

getLanguages

java.lang.String[] getLanguages()
                                throws DocumentException
Returns all the languages this document is available in. A document has one associated language (@see Document#getLanguage) but there are possibly a number of other languages for which a document with the same document-id is also available in.

Returns:
An array of strings denoting the languages.
Throws:
DocumentException - if an error occurs

getLabel

java.lang.String getLabel()
                          throws DocumentException
Get the navigation label associated with this document for the language.

Returns:
the label String
Throws:
DocumentException - if an error occurs

getLastModified

java.util.Date getLastModified()
Returns the date of the last modification of this document.

Returns:
A date denoting the date of the last modification.

getArea

java.lang.String getArea()
Returns the area this document belongs to.

Returns:
The area.

getFile

java.io.File getFile()
Returns the file for this document.

Returns:
A file object.

getExtension

java.lang.String getExtension()
Returns the extension in the URL.

Returns:
A string.

exists

boolean exists()
               throws DocumentException
Check if a document with the given document-id, language and in the given area actually exists.

Returns:
true if the document exists, false otherwise
Throws:
DocumentException - if an error occurs

existsInAnyLanguage

boolean existsInAnyLanguage()
                            throws DocumentException
Check if a document exists with the given document-id and the given area independently of the given language.

Returns:
true if a document with the given document-id and area exists, null otherwise
Throws:
DocumentException - if an error occurs


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.