org.apache.lenya.cms.repository
Class SourceWrapper

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.repository.SourceWrapper
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled
Direct Known Subclasses:
ContentSourceWrapper, MetaSourceWrapper

public class SourceWrapper
extends org.apache.avalon.framework.logger.AbstractLogEnabled

Provide access to a source.


Field Summary
protected static java.lang.String CONTEXT_PREFIX
           
protected static java.lang.String FILE_PREFIX
           
protected  org.apache.avalon.framework.service.ServiceManager manager
           
 
Constructor Summary
SourceWrapper(SourceNode node, java.lang.String sourceUri, org.apache.avalon.framework.service.ServiceManager manager, org.apache.avalon.framework.logger.Logger logger)
          Ctor.
 
Method Summary
protected static java.lang.String computeRealSourceUri(org.apache.avalon.framework.service.ServiceManager manager, org.apache.lenya.cms.repository.Session session, java.lang.String sourceUri, org.apache.avalon.framework.logger.Logger logger)
           
protected  void delete()
           
 void deleteTransactionable()
           
 boolean exists()
           
 long getContentLength()
           
 java.io.InputStream getInputStream()
           
 long getLastModified()
           
protected  int getLoadRevision()
           
 java.lang.String getMimeType()
           
protected  SourceNode getNode()
           
 java.io.OutputStream getOutputStream()
           
protected  java.lang.String getRealSourceUri()
          Returns the URI of the actual source which is used.
 java.lang.String getSourceUri()
           
protected  void loadData()
          Loads the data from the real source.
protected  void saveTransactionable()
           
protected  void saveTransactionable(java.lang.String realSourceUri)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected org.apache.avalon.framework.service.ServiceManager manager

FILE_PREFIX

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

CONTEXT_PREFIX

protected static final java.lang.String CONTEXT_PREFIX
See Also:
Constant Field Values
Constructor Detail

SourceWrapper

public SourceWrapper(SourceNode node,
                     java.lang.String sourceUri,
                     org.apache.avalon.framework.service.ServiceManager manager,
                     org.apache.avalon.framework.logger.Logger logger)
Ctor.

Parameters:
node -
sourceUri -
manager -
logger -
Method Detail

getNode

protected SourceNode getNode()

getRealSourceUri

protected java.lang.String getRealSourceUri()
Returns the URI of the actual source which is used.

Returns:
A string.

computeRealSourceUri

protected static final java.lang.String computeRealSourceUri(org.apache.avalon.framework.service.ServiceManager manager,
                                                             org.apache.lenya.cms.repository.Session session,
                                                             java.lang.String sourceUri,
                                                             org.apache.avalon.framework.logger.Logger logger)

deleteTransactionable

public void deleteTransactionable()
                           throws org.apache.lenya.cms.repository.RepositoryException
Throws:
RepositoryException - if an error occurs.
See Also:
Transactionable.deleteTransactionable()

getInputStream

public java.io.InputStream getInputStream()
                                   throws org.apache.lenya.cms.repository.RepositoryException
Returns:
An input stream.
Throws:
RepositoryException - if an error occurs.
See Also:
ContentHolder.getInputStream()

exists

public boolean exists()
               throws org.apache.lenya.cms.repository.RepositoryException
Returns:
A boolean value.
Throws:
RepositoryException - if an error occurs.
See Also:
Node.exists()

delete

protected void delete()

loadData

protected void loadData()
                 throws org.apache.lenya.cms.repository.RepositoryException
Loads the data from the real source.

Throws:
RepositoryException - if an error occurs.

saveTransactionable

protected void saveTransactionable()
                            throws org.apache.lenya.cms.repository.RepositoryException
Throws:
RepositoryException - if an error occurs.
See Also:
Transactionable.saveTransactionable()

saveTransactionable

protected void saveTransactionable(java.lang.String realSourceUri)
                            throws org.apache.lenya.cms.repository.RepositoryException
Throws:
org.apache.lenya.cms.repository.RepositoryException

getContentLength

public long getContentLength()
                      throws org.apache.lenya.cms.repository.RepositoryException
Returns:
The content length.
Throws:
RepositoryException - if an error occurs.
See Also:
ContentHolder.getContentLength()

getLastModified

public long getLastModified()
                     throws org.apache.lenya.cms.repository.RepositoryException
Returns:
The last modification date.
Throws:
RepositoryException - if an error occurs.
See Also:
ContentHolder.getLastModified()

getMimeType

public java.lang.String getMimeType()
                             throws org.apache.lenya.cms.repository.RepositoryException
Returns:
A string.
Throws:
RepositoryException - if an error occurs.
See Also:
ContentHolder.getMimeType()

getSourceUri

public java.lang.String getSourceUri()
Returns:
The source URI.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws org.apache.lenya.cms.repository.RepositoryException
Returns:
An output stream.
Throws:
RepositoryException - if an error occurs.
See Also:
Node.getOutputStream()

getLoadRevision

protected int getLoadRevision()


Copyright © $ Apache Software Foundation. All Rights Reserved.