Package rife.cmf.dam.contentstores
Class DatabaseRawStore
java.lang.Object
rife.database.DbQueryManager
rife.cmf.dam.contentstores.DatabaseRawStore
- All Implemented Interfaces:
Cloneable,ContentStore
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean_deleteContentData(Delete deleteContentInfo, Delete deleteContentChunk, int id) protected intprotected boolean_hasContentData(Select hasContentData, int id) protected boolean_install(CreateTable createTableContentInfo, CreateTable createTableContentChunk) protected booleanprotected void_serveContentData(Select retrieveContentChunks, Context context, int id) protected boolean_storeContentData(Insert storeContentInfo, Insert storeContentChunk, int id, Content content, ContentTransformer transformer) protected void_useContentData(Select retrieveContentChunks, int id, ContentDataUserWithoutResult user) protected <ResultType>
ResultType_useContentDataResult(Select retrieveContentChunks, int id, ContentDataUser<ResultType> user) protected voidaddMimeType(MimeType mimeType) getContentForHtml(int id, ContentInfo info, Context context, Route route) Retrieves a content data representation for use in html.getContentType(ContentInfo contentInfo) Generates the HTTP content type that corresponds best to the information in the providedContentInfo.protected DbPreparedStatementgetStreamPreparedStatement(Query query, DbConnection connection) Returns the collection of mime types that the content store supports.protected voidserveChunks(DbResultSet resultset, OutputStream os, int size) protected intstoreChunks(Insert storeContentChunk, int id, InputStream data) protected intstoreChunksNoStream(Insert storeContentChunk, int id, InputStream data) Methods inherited from class rife.database.DbQueryManager
clone, executeFetchAll, executeFetchAll, executeFetchAll, executeFetchAll, executeFetchAllBeans, executeFetchAllBeans, executeFetchFirst, executeFetchFirst, 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, executeResultQuery, executeUpdate, executeUpdate, executeUpdate, executeUseFirstAsciiStream, executeUseFirstAsciiStream, executeUseFirstBinaryStream, executeUseFirstBinaryStream, executeUseFirstCharacterStream, executeUseFirstCharacterStream, fetch, fetch, fetch, fetchAll, fetchAll, getConnection, getDatasource, inTransaction, inTransaction, reserveConnectionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rife.cmf.dam.ContentStore
deleteContentData, getFormatter, getSize, hasContentData, install, remove, serveContentData, storeContentData, useContentData, useContentDataResult
-
Constructor Details
-
DatabaseRawStore
-
-
Method Details
-
addMimeType
-
getSupportedMimeTypes
Description copied from interface:ContentStoreReturns the collection of mime types that the content store supports.- Specified by:
getSupportedMimeTypesin interfaceContentStore- Returns:
- the collection of supported mime types
-
getContentType
Description copied from interface:ContentStoreGenerates the HTTP content type that corresponds best to the information in the providedContentInfo.- Specified by:
getContentTypein interfaceContentStore- Parameters:
contentInfo- the content info instance for which the content type has to be generated- Returns:
- the generated content type
-
getContentForHtml
public String getContentForHtml(int id, ContentInfo info, Context context, Route route) throws ContentManagerException Description copied from interface:ContentStoreRetrieves 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.
- Specified by:
getContentForHtmlin interfaceContentStore- Parameters:
id- the id of the content whose data will be displayedinfo- the content info instance for which the html content has to be generatedcontext- an active web engine contextroute- a route that leads to arife.cmf.elements.ServeContentelement- Returns:
- the html content representation
- Throws:
ContentManagerException- if an unexpected error occurred
-
_install
protected boolean _install(CreateTable createTableContentInfo, CreateTable createTableContentChunk) throws ContentManagerException - Throws:
ContentManagerException
-
_remove
protected boolean _remove(DropTable dropTableContentInfo, DropTable dropTableContentChunk) throws ContentManagerException - Throws:
ContentManagerException
-
_deleteContentData
protected boolean _deleteContentData(Delete deleteContentInfo, Delete deleteContentChunk, int id) throws ContentManagerException - Throws:
ContentManagerException
-
_getSize
- Throws:
ContentManagerException
-
_hasContentData
- Throws:
ContentManagerException
-
_storeContentData
protected boolean _storeContentData(Insert storeContentInfo, Insert storeContentChunk, int id, Content content, ContentTransformer transformer) throws ContentManagerException - Throws:
ContentManagerException
-
storeChunks
- Throws:
IOException
-
storeChunksNoStream
protected int storeChunksNoStream(Insert storeContentChunk, int id, InputStream data) throws IOException - Throws:
IOException
-
_useContentData
protected void _useContentData(Select retrieveContentChunks, int id, ContentDataUserWithoutResult user) throws ContentManagerException - Throws:
ContentManagerException
-
_useContentDataResult
protected <ResultType> ResultType _useContentDataResult(Select retrieveContentChunks, int id, ContentDataUser<ResultType> user) throws ContentManagerException - Throws:
ContentManagerException
-
getStreamPreparedStatement
-
_serveContentData
protected void _serveContentData(Select retrieveContentChunks, Context context, int id) throws ContentManagerException - Throws:
ContentManagerException
-
serveChunks
- Throws:
SQLException
-