|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.exist.cocoon.XMLDBSource
This class implements the xmldb:// pseudo-protocol and allows to get XML content from an XML:DB enabled XML database.
This class starts on XMLDBSource from Cocoon project. Some improvments may be useful for Cocoon, some others may be Exist specific. Interesting new features :
| Field Summary | |
Collection |
collection
|
java.lang.String |
encoding
default encoding to write outputStream |
java.lang.String |
password
The supplied password |
static java.lang.String |
PREFIX
Source prefix |
Resource |
resource
|
static java.lang.String |
URI
Source namespace |
java.lang.String |
url
The requested URL |
java.lang.String |
user
The supplied user |
| Constructor Summary | |
XMLDBSource(org.apache.avalon.framework.logger.Logger logger,
java.lang.String user,
java.lang.String password,
java.lang.String srcUrl)
The constructor. |
|
| Method Summary | |
boolean |
canCancel(java.io.OutputStream stream)
Can the data sent to an OutputStream returned by
getOutputStream() be cancelled ? |
void |
cancel(java.io.OutputStream stream)
Cancel the data sent to an OutputStream returned by
getOutputStream(). |
java.lang.String |
createId()
Create a new identifier for a resource within a collection. |
void |
delete()
Delete the source |
boolean |
exists()
|
java.io.OutputStream |
getBinaryOutputStream()
Return an OutputStream to write data to a binary resource. |
org.apache.excalibur.source.Source |
getChild(java.lang.String name)
|
java.util.Collection |
getChildren()
|
Collection |
getCollection()
A getter for the xmldb Collection object for this Source |
org.w3c.dom.Node |
getContentAsDOM()
get content as DOM |
long |
getContentLength()
|
java.lang.String |
getEncoding()
Set a default encoding for outputStream |
java.io.InputStream |
getInputStream()
Get an InputSource for the given URL. |
long |
getLastModified()
|
java.lang.String |
getMimeType()
|
java.lang.String |
getName()
|
java.io.OutputStream |
getOutputStream()
Return an OutputStream to write to. |
org.apache.excalibur.source.Source |
getParent()
|
java.lang.String |
getPassword()
A getter for the password configured in cocoon.xconf for the connection |
Resource |
getResource()
A getter for the xmldb Resource object for this Source |
java.lang.String |
getScheme()
|
java.lang.String |
getURI()
|
java.lang.String |
getUser()
A getter for the user login configured in cocoon.xconf |
org.apache.excalibur.source.SourceValidity |
getValidity()
|
boolean |
isCollection()
|
void |
makeCollection()
|
void |
refresh()
|
void |
setContentAsDOM(org.w3c.dom.Node doc)
set content as DOM |
void |
setEncoding(java.lang.String s)
Set a default encoding for outputStream |
void |
toSAX(org.xml.sax.ContentHandler handler)
Stream SAX events to a given ContentHandler. |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String URI
public static final java.lang.String PREFIX
public java.lang.String encoding
public java.lang.String url
public java.lang.String user
public java.lang.String password
public Collection collection
public Resource resource
| Constructor Detail |
public XMLDBSource(org.apache.avalon.framework.logger.Logger logger,
java.lang.String user,
java.lang.String password,
java.lang.String srcUrl)
logger - the Logger instance.user - password - srcUrl - the URL being queried.| Method Detail |
public Collection getCollection()
throws org.apache.excalibur.source.SourceException,
XMLDBException
org.apache.excalibur.source.SourceException
XMLDBException
public Resource getResource()
throws org.apache.excalibur.source.SourceException,
XMLDBException
org.apache.excalibur.source.SourceException
XMLDBExceptionpublic java.lang.String getUser()
public java.lang.String getPassword()
public void toSAX(org.xml.sax.ContentHandler handler)
throws org.xml.sax.SAXException
toSAX in interface org.apache.excalibur.xml.sax.XMLizableorg.xml.sax.SAXExceptionpublic java.lang.String getURI()
getURI in interface org.apache.excalibur.source.Sourcepublic long getContentLength()
getContentLength in interface org.apache.excalibur.source.Sourcepublic long getLastModified()
getLastModified in interface org.apache.excalibur.source.Sourcepublic boolean exists()
exists in interface org.apache.excalibur.source.Sourcepublic java.lang.String getMimeType()
getMimeType in interface org.apache.excalibur.source.Sourcepublic java.lang.String getScheme()
getScheme in interface org.apache.excalibur.source.Sourcepublic org.apache.excalibur.source.SourceValidity getValidity()
getValidity in interface org.apache.excalibur.source.Sourcepublic void refresh()
refresh in interface org.apache.excalibur.source.Source
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface org.apache.excalibur.source.Sourcejava.io.IOException
public java.io.OutputStream getOutputStream()
throws java.io.IOException,
java.net.MalformedURLException
OutputStream to write to. This method expects an XML document to be
written in that stream. To create a binary resource, use getBinaryOutputStream().
getOutputStream in interface org.apache.excalibur.source.ModifiableSourcejava.io.IOException
java.net.MalformedURLException
public void setContentAsDOM(org.w3c.dom.Node doc)
throws java.io.IOException,
java.net.MalformedURLException
java.io.IOException
java.net.MalformedURLException
public org.w3c.dom.Node getContentAsDOM()
throws java.io.IOException,
java.net.MalformedURLException
java.io.IOException
java.net.MalformedURLException
public java.io.OutputStream getBinaryOutputStream()
throws java.io.IOException,
java.net.MalformedURLException
OutputStream to write data to a binary resource.
java.io.IOException
java.net.MalformedURLException
public java.lang.String createId()
throws org.apache.excalibur.source.SourceException
org.apache.excalibur.source.SourceExceptionpublic void setEncoding(java.lang.String s)
public java.lang.String getEncoding()
public void delete()
throws org.apache.excalibur.source.SourceException
delete in interface org.apache.excalibur.source.ModifiableSourceorg.apache.excalibur.source.SourceExceptionpublic boolean canCancel(java.io.OutputStream stream)
OutputStream returned by
getOutputStream() be cancelled ?
canCancel in interface org.apache.excalibur.source.ModifiableSource
public void cancel(java.io.OutputStream stream)
throws java.io.IOException
OutputStream returned by
getOutputStream().
After cancelling, the stream should no longer be used.
cancel in interface org.apache.excalibur.source.ModifiableSourcejava.io.IOException
public void makeCollection()
throws org.apache.excalibur.source.SourceException
makeCollection in interface org.apache.excalibur.source.ModifiableTraversableSourceorg.apache.excalibur.source.SourceExceptionpublic boolean isCollection()
isCollection in interface org.apache.excalibur.source.TraversableSource
public java.util.Collection getChildren()
throws org.apache.excalibur.source.SourceException
getChildren in interface org.apache.excalibur.source.TraversableSourceorg.apache.excalibur.source.SourceException
public org.apache.excalibur.source.Source getChild(java.lang.String name)
throws org.apache.excalibur.source.SourceException
getChild in interface org.apache.excalibur.source.TraversableSourceorg.apache.excalibur.source.SourceExceptionpublic java.lang.String getName()
getName in interface org.apache.excalibur.source.TraversableSource
public org.apache.excalibur.source.Source getParent()
throws org.apache.excalibur.source.SourceException
getParent in interface org.apache.excalibur.source.TraversableSourceorg.apache.excalibur.source.SourceException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||