|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lenya.cms.publication.DefaultDocument org.apache.lenya.cms.publication.CollectionImpl
public class CollectionImpl
Implementation of a Collection.
Field Summary |
---|
Fields inherited from interface org.apache.lenya.cms.publication.Collection |
---|
ATTRIBUTE_ID, DEFAULT_PREFIX, ELEMENT_COLLECTION, ELEMENT_DOCUMENT, NAMESPACE |
Constructor Summary | |
---|---|
CollectionImpl(Publication publication,
java.lang.String id,
java.lang.String area)
Ctor. |
|
CollectionImpl(Publication publication,
java.lang.String id,
java.lang.String area,
java.lang.String language)
Ctor. |
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. |
protected org.w3c.dom.Element |
createDocumentElement(Document document,
NamespaceHelper helper)
Creates an element to store a document. |
protected java.util.List |
documents()
Returns the list that holds the documents. |
Document[] |
getDocuments()
Returns the documents in this collection. |
int |
getFirstPosition(Document document)
Returns the first position of this document in the collection. |
protected NamespaceHelper |
getNamespaceHelper()
Returns the namespace helper for the XML source. |
protected void |
load()
Loads the collection from its XML source. |
protected Document |
loadDocument(org.w3c.dom.Element documentElement)
Loads a document from an XML element. |
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 class org.apache.lenya.cms.publication.DefaultDocument |
---|
equals, exists, existsInAnyLanguage, getArea, getCompleteInfoURL, getCompleteURL, getCompleteURLWithoutLanguage, getDocumentURL, getDublinCore, getExtension, getFile, getId, getLabel, getLanguage, getLanguages, getLastModified, getName, getNodeId, getPublication, hashCode, setArea, setDocumentURL, setExtension, setLanguage, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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 |
Constructor Detail |
---|
public CollectionImpl(Publication publication, java.lang.String id, java.lang.String area) throws DocumentException
publication
- A publication.id
- The document ID.area
- The area the document belongs to.
DocumentException
- when something went wrong.public CollectionImpl(Publication publication, java.lang.String id, java.lang.String area, java.lang.String language) throws DocumentException
publication
- A publication.id
- The document ID.area
- The area the document belongs to.language
- The language of the document.
DocumentException
- when something went wrong.Method Detail |
---|
protected java.util.List documents() throws DocumentException
DocumentException
- when something went wrong.public Document[] getDocuments() throws DocumentException
Collection
getDocuments
in interface Collection
DocumentException
- when something went wrong.Collection.getDocuments()
public void add(Document document) throws DocumentException
Collection
add
in interface Collection
document
- A document.
DocumentException
- when an error occurs.Collection.add(org.apache.lenya.cms.publication.Document)
public void add(int position, Document document) throws DocumentException
Collection
add
in interface Collection
position
- The position of the document after insertion,
starting with 0.document
- A document.
DocumentException
- when something went wrong.Collection.add(int, org.apache.lenya.cms.publication.Document)
public void remove(Document document) throws DocumentException
Collection
remove
in interface Collection
document
- A document.
DocumentException
- when the document is not contained
or another error occurs.Collection.remove(org.apache.lenya.cms.publication.Document)
protected void load() throws DocumentException
DocumentException
- when something went wrong.protected Document loadDocument(org.w3c.dom.Element documentElement) throws DocumentBuildException
documentElement
- The XML element.
DocumentBuildException
- when something went wrong.public void save() throws DocumentException
save
in interface Collection
DocumentException
- when something went wrong.protected org.w3c.dom.Element createDocumentElement(Document document, NamespaceHelper helper) throws DocumentException
helper
- The namespace helper of the document.document
- The document.
DocumentException
- when something went wrong.protected NamespaceHelper getNamespaceHelper() throws DocumentException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
DocumentException
- when something went wrong.
javax.xml.parsers.ParserConfigurationException
- when something went wrong.
org.xml.sax.SAXException
- when something went wrong.
java.io.IOException
- when something went wrong.public boolean contains(Document document) throws DocumentException
Collection
contains
in interface Collection
document
- The document to check.
DocumentException
- when something went wrong.Collection.contains(org.apache.lenya.cms.publication.Document)
public void clear() throws DocumentException
Collection
clear
in interface Collection
DocumentException
- when something went wrong.Collection.clear()
public int getFirstPosition(Document document) throws DocumentException
Collection
getFirstPosition
in interface Collection
document
- The document.
DocumentException
- when the document is not contained.Collection.getFirstPosition(org.apache.lenya.cms.publication.Document)
public int size() throws DocumentException
Collection
size
in interface Collection
DocumentException
- when something went wrong.Collection.size()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |