org.apache.lenya.cms.publication
Interface Collection

All Superinterfaces:
Document
All Known Implementing Classes:
CollectionImpl, XlinkCollection

public interface Collection
extends Document

A document representing a collection of documents. This class is in prototyping stage.


Field Summary
static java.lang.String ATTRIBUTE_ID
           
static java.lang.String DEFAULT_PREFIX
           
static java.lang.String ELEMENT_COLLECTION
           
static java.lang.String ELEMENT_DOCUMENT
           
static java.lang.String NAMESPACE
           
 
Method Summary
 void add(Document document)
          Adds a document to the collection.
 void add(int position, Document document)
          Inserts a document into the collection at a specific position.
 void clear()
          Removes all documents from this collection.
 boolean contains(Document document)
          Checks if this collection contains a specific document.
 Document[] getDocuments()
          Returns the documents in this collection.
 int getFirstPosition(Document document)
          Returns the first position of this document in the collection.
 void remove(Document document)
          Removes a document from the collection.
 void save()
          Saves the XML source of this collection.
 int size()
          Returns the number of documents in this collection.
 
Methods inherited from interface org.apache.lenya.cms.publication.Document
exists, existsInAnyLanguage, getArea, getCompleteInfoURL, getCompleteURL, getCompleteURLWithoutLanguage, getDocumentURL, getDublinCore, getExtension, getFile, getId, getLabel, getLanguage, getLanguages, getLastModified, getName, getNodeId, getPublication
 

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

ELEMENT_COLLECTION

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

ELEMENT_DOCUMENT

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

ATTRIBUTE_ID

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

getDocuments

Document[] getDocuments()
                        throws DocumentException
Returns the documents in this collection.

Returns:
An array of documents.
Throws:
DocumentException - when something went wrong.

add

void add(Document document)
         throws DocumentException
Adds a document to the collection.

Parameters:
document - A document.
Throws:
DocumentException - when an error occurs.

add

void add(int position,
         Document document)
         throws DocumentException
Inserts a document into the collection at a specific position.

Parameters:
document - A document.
position - The position of the document after insertion, starting with 0.
Throws:
DocumentException - when something went wrong.

remove

void remove(Document document)
            throws DocumentException
Removes a document from the collection.

Parameters:
document - A document.
Throws:
DocumentException - when the document is not contained or another error occurs.

clear

void clear()
           throws DocumentException
Removes all documents from this collection.

Throws:
DocumentException - when something went wrong.

contains

boolean contains(Document document)
                 throws DocumentException
Checks if this collection contains a specific document.

Parameters:
document - The document to check.
Returns:
A boolean value.
Throws:
DocumentException - when something went wrong.

getFirstPosition

int getFirstPosition(Document document)
                     throws DocumentException
Returns the first position of this document in the collection.

Parameters:
document - The document.
Returns:
An integer.
Throws:
DocumentException - when the document is not contained.

size

int size()
         throws DocumentException
Returns the number of documents in this collection.

Returns:
An integer value.
Throws:
DocumentException - when something went wrong.

save

void save()
          throws DocumentException
Saves the XML source of this collection.

Throws:
DocumentException - when something went wrong.


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