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 void_serveContentData(Select retrieveContentChunks, Context context, int id, long start, long end) 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, long skip, long count) abstract voidserveContentData(Context context, int id, long start, long end) Serves a range of the content data for a certain content id through the provided context.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
public abstract void serveContentData(Context context, int id, long start, long end) throws ContentManagerException Serves a range of the content data for a certain content id through the provided context.This takes over the complete handling of the request, like
ContentStore.serveContentData(Context, int), apart from the status and theContent-Rangeheader.An
endbeyond the last byte serves the data up to its last byte, as does a negativeend.- Parameters:
context- an active web engine contextid- the id of the content whose data will be servedstart- the position of the first byte that will be servedend- the position of the last byte that will be served, inclusive- Throws:
IllegalArgumentException- ifstartis negative, orendisn't negative and lies beforestartContentManagerException- if an unexpected error occurred- Since:
- 1.11.0
-
_serveContentData
protected void _serveContentData(Select retrieveContentChunks, Context context, int id) throws ContentManagerException - Throws:
ContentManagerException
-
_serveContentData
protected void _serveContentData(Select retrieveContentChunks, Context context, int id, long start, long end) throws ContentManagerException - Throws:
ContentManagerException
-
serveChunks
protected void serveChunks(DbResultSet resultset, OutputStream os, long skip, long count) throws SQLException - Throws:
SQLException
-