| com.uwyn.rife.cmf.dam.ContentStore
All known Subclasses: com.uwyn.rife.cmf.dam.contentstores.DatabaseRawStore, com.uwyn.rife.cmf.dam.contentstores.DatabaseContentStore,
ContentStore | public interface ContentStore (Code) | | A ContentStore stores the actual content data and is
responsible for managing it.
The store doesn't work with paths, but with content ids. Each id
identifies a specific content instance at a certain location and with a
certain version number.
Each store is only capable of storing content with certain mime types.
The store is optimized for a certain kind of content and will maybe not be
able to correctly handle other types.
author: Geert Bevin (gbevin[remove] at uwyn dot com)i version: $Revision: 3634 $ since: 1.0 |
Method Summary | |
public boolean | deleteContentData(int id) Deletes the content data for a certain content id. | public String | getContentForHtml(int id, ContentInfo info, ElementSupport element, String serveContentExitName) Retrieves a content data representation for use in html.
This is mainly used to integrate content data inside a html
document. | public String | getContentType(ContentInfo contentInfo) Generates the HTTP content type that corresponds best to the
information in the provided ContentInfo . | public Formatter | getFormatter(MimeType mimeType, boolean fragment) Returns a Formatter instance that will be used to load and
to format the content data. | public int | getSize(int id) Retrieves the size of the content data for a certain content id.
Note that the result is specific to the data store. | public Collection<MimeType> | getSupportedMimeTypes() Returns the collection of mime types that the content store supports. | public boolean | hasContentData(int id) Checks whether content data is available for a certain content id. | public boolean | install() Installs a content store. | public boolean | remove() Removes a content store. | public void | serveContentData(ElementSupport element, int id) Serves content data for a certain content id through the provided
element. | public boolean | storeContentData(int id, Content content, ContentTransformer transformer) Stores the content data for a certain content id. | public ResultType | useContentData(int id, ContentDataUser user) Use the data of a certain content id.
Some content data will only be available during this method call due
to their volatile nature (certain streams for instance). |
deleteContentData | public boolean deleteContentData(int id) throws ContentManagerException(Code) | | Deletes the content data for a certain content id.
Parameters: id - the id of the content whose data will be deleted true if the deletion was successfully; orfalse if it wasn't. exception: ContentManagerException - if an unexpected error occurred since: 1.0
|
getContentForHtml | public String getContentForHtml(int id, ContentInfo info, ElementSupport element, String serveContentExitName) throws ContentManagerException(Code) | | 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 Parameters: info - the content info instance for which the html contenthas to be generated Parameters: element - an active element instance Parameters: serveContentExitName - the exit namet that leads to a com.uwyn.rife.cmf.elements.ServeContent ServeContent element. This willbe used to generate URLs for content that can't be directly displayedin-line. the html content representation exception: ContentManagerException - if an unexpected error occurred since: 1.0 |
getContentType | public String getContentType(ContentInfo contentInfo)(Code) | | 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 typehas to be generated the generated content type since: 1.0 |
getFormatter | public Formatter getFormatter(MimeType mimeType, boolean fragment)(Code) | | 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 Parameters: fragment - true if the content that has to beformatter is a fragment; orfalse otherwise the corresponding formatter since: 1.0
|
getSize | public int getSize(int id) throws ContentManagerException(Code) | | Retrieves the size of the content data for a certain content id.
Note that the result is specific to the data store. For instance,
text data could return the number of characters, while image data could
return the number of bytes.
Parameters: id - the id of the content whose data size will be returned -1 if no data is available for the providedcontent id; or the requested content data size. exception: ContentManagerException - if an unexpected error occurred since: 1.0 |
getSupportedMimeTypes | public Collection<MimeType> getSupportedMimeTypes()(Code) | | Returns the collection of mime types that the content store supports.
the collection of supported mime types since: 1.0 |
hasContentData | public boolean hasContentData(int id) throws ContentManagerException(Code) | | Checks whether content data is available for a certain content id.
Parameters: id - the id of the content whose data availability will be checked true if content data is available; orfalse if it isn't. exception: ContentManagerException - if an expected error occurred since: 1.0
|
serveContentData | public void serveContentData(ElementSupport element, int id) throws ContentManagerException(Code) | | Serves content data for a certain content id through the provided
element.
This is intended to take over the complete handling of the request,
so no other content should be output and no headers manipulated in the
element if this method is called.
Parameters: element - an active element instance Parameters: id - the id of the content whose data will be served exception: ContentManagerException - if an unexpected error occurred since: 1.0 |
storeContentData | public boolean storeContentData(int id, Content content, ContentTransformer transformer) throws ContentManagerException(Code) | | Stores the content data for a certain content id.
Parameters: id - the id of the content whose data will be stored Parameters: content - the content whose data has to be stored Parameters: transformer - a transformer that will modify the content data; ornull if the content data should stay intact true if the storing was successfully; or
false if it wasn't. exception: ContentManagerException - if an unexpected error occurred since: 1.0
|
useContentData | public ResultType useContentData(int id, ContentDataUser user) throws ContentManagerException(Code) | | Use the data of a certain content id.
Some content data will only be available during this method call due
to their volatile nature (certain streams for instance). Therefore, one
has to be careful when trying to move the data that is provided to the
content user outside this method. The behaviour is undefined.
Parameters: id - the id of the content whose data will be used Parameters: user - the content user instance that will be called to usecontent data the data that the ContentDataUser.useContentData(Object)returns after its usage exception: ContentManagerException - if an unexpected error occurred since: 1.0 |
|
|