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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
_deleteContentData
(Delete deleteContentInfo, Delete deleteContentChunk, int id) protected int
protected boolean
_hasContentData
(Select hasContentData, int id) protected boolean
_install
(CreateTable createTableContentInfo, CreateTable createTableContentChunk) protected boolean
protected 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 void
addMimeType
(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 DbPreparedStatement
getStreamPreparedStatement
(Query query, DbConnection connection) Returns the collection of mime types that the content store supports.protected void
serveChunks
(DbResultSet resultset, OutputStream os, int size) protected int
storeChunks
(Insert storeContentChunk, int id, InputStream data) protected int
storeChunksNoStream
(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, reserveConnection
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:ContentStore
Returns the collection of mime types that the content store supports.- Specified by:
getSupportedMimeTypes
in interfaceContentStore
- Returns:
- the collection of supported mime types
-
getContentType
Description copied from interface:ContentStore
Generates the HTTP content type that corresponds best to the information in the providedContentInfo
.- Specified by:
getContentType
in 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: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.
- Specified by:
getContentForHtml
in 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.ServeContent
element- 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
-