com.uwyn.rife.cmf.dam.contentstores
Class DatabaseTextStore

java.lang.Object
  extended by com.uwyn.rife.database.DbQueryManager
      extended by com.uwyn.rife.cmf.dam.contentstores.DatabaseContentStore
          extended by com.uwyn.rife.cmf.dam.contentstores.DatabaseTextStore
All Implemented Interfaces:
ContentStore, Cloneable

public abstract class DatabaseTextStore
extends DatabaseContentStore


Constructor Summary
DatabaseTextStore(Datasource datasource)
           
 
Method Summary
protected  boolean _storeContentData(Insert storeContent, int id, Content content, ContentTransformer transformer)
           
protected
<ResultType>
ResultType
_useContentData(Select retrieveContent, int id, ContentDataUser user)
           
 String getContentForHtml(int id, ContentInfo info, ElementSupport element, String serveContentExitName)
          Retrieves a content data representation for use in html.
 String getContentType(ContentInfo contentInfo)
          Generates the HTTP content type that corresponds best to the information in the provided ContentInfo.
 Formatter getFormatter(MimeType mimeType, boolean fragment)
          Returns a Formatter instance that will be used to load and to format the content data.
protected  void outputContentColumn(ResultSet resultSet, OutputStream os)
           
protected  boolean storeContent(Insert storeContent, int id, String data)
           
 
Methods inherited from class com.uwyn.rife.cmf.dam.contentstores.DatabaseContentStore
_deleteContentData, _getSize, _hasContentData, _install, _remove, _serveContentData, addMimeType, getContentSizeColumnName, getSupportedMimeTypes
 
Methods inherited from class com.uwyn.rife.database.DbQueryManager
clone, executeFetchAll, executeFetchAll, executeFetchAllBeans, executeFetchAllBeans, executeFetchFirst, executeFetchFirst, executeFetchFirstBean, executeFetchFirstBean, executeGetFirstBoolean, executeGetFirstBoolean, executeGetFirstByte, executeGetFirstByte, executeGetFirstBytes, executeGetFirstBytes, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDouble, executeGetFirstDouble, executeGetFirstFloat, executeGetFirstFloat, executeGetFirstInt, executeGetFirstInt, executeGetFirstLong, executeGetFirstLong, executeGetFirstShort, executeGetFirstShort, executeGetFirstString, executeGetFirstString, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeHasResultRows, executeHasResultRows, executeQuery, executeQuery, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUseFirstAsciiStream, executeUseFirstAsciiStream, executeUseFirstBinaryStream, executeUseFirstBinaryStream, executeUseFirstCharacterStream, executeUseFirstCharacterStream, fetch, fetch, fetchAll, getConnection, getDatasource, inTransaction, reserveConnection
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.uwyn.rife.cmf.dam.ContentStore
deleteContentData, getSize, hasContentData, install, remove, serveContentData, storeContentData, useContentData
 

Constructor Detail

DatabaseTextStore

public DatabaseTextStore(Datasource datasource)
Method Detail

getContentType

public String getContentType(ContentInfo contentInfo)
Description copied from interface: ContentStore
Generates the HTTP content type that corresponds best to the information in the provided ContentInfo.

Parameters:
contentInfo - the content info instance for which the content type has to be generated
Returns:
the generated content type

getFormatter

public Formatter getFormatter(MimeType mimeType,
                              boolean fragment)
Description copied from interface: ContentStore
Returns a Formatter instance that will be used to load and to format the content data.

Parameters:
mimeType - the mime type for which the formatter will be returned
fragment - true if the content that has to be formatter is a fragment; or

false otherwise

Returns:
the corresponding formatter

_storeContentData

protected boolean _storeContentData(Insert storeContent,
                                    int id,
                                    Content content,
                                    ContentTransformer transformer)
                             throws ContentManagerException
Throws:
ContentManagerException

storeContent

protected boolean storeContent(Insert storeContent,
                               int id,
                               String data)
                        throws ContentManagerException
Throws:
ContentManagerException

_useContentData

protected <ResultType> ResultType _useContentData(Select retrieveContent,
                                                  int id,
                                                  ContentDataUser user)
                              throws ContentManagerException
Throws:
ContentManagerException

getContentForHtml

public String getContentForHtml(int id,
                                ContentInfo info,
                                ElementSupport element,
                                String serveContentExitName)
                         throws ContentManagerException
Description copied from interface: ContentStore
Retrieves a content data representation for use in html.

This is mainly used to integrate content data inside a html document. For instance, html content will be displayed as-is, while image content will cause an image tag to be generated with the correct source URL to serve the image.

Parameters:
id - the id of the content whose data will be displayed
info - the content info instance for which the html content has to be generated
element - an active element instance
serveContentExitName - the exit namet that leads to a ServeContent element. This will be used to generate URLs for content that can't be directly displayed in-line.
Returns:
the html content representation
Throws:
ContentManagerException - if an unexpected error occurred

outputContentColumn

protected void outputContentColumn(ResultSet resultSet,
                                   OutputStream os)
                            throws SQLException
Specified by:
outputContentColumn in class DatabaseContentStore
Throws:
SQLException


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.