|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ContentManager
A ContentManager manages content that is stored in a back-end
data store.
Content is isolated in repositories that should have unique names. The installation of a content manager creates an initial default repository. If others are needed, they have to be created explicitly.
All content is identified by a unique location. The
location is formatted like this:
repository:path
If the repository: prefix is omitted, the content will be
stored in the default repository (see ContentRepository.DEFAULT).
The path should start with a slash that makes it 'absolute', this is completely analogue to file system paths.
| Method Summary | ||
|---|---|---|
boolean |
containsRepository(String name)
Checks if the content manager contains a certain repository. |
|
boolean |
createRepository(String name)
Creates a new repository. |
|
boolean |
deleteContent(String location)
Delete the content at a certain location. |
|
String |
getContentForHtml(String location,
ElementSupport element,
String serveContentExitName)
Retrieves a content representation for use in html. |
|
ContentInfo |
getContentInfo(String location)
Retrieves the content info from a certain location. |
|
boolean |
hasContentData(String location)
Checks whether content data is available at a certain location. |
|
boolean |
install()
Installs a content manager. |
|
boolean |
remove()
Removes a content manager. |
|
void |
serveContentData(ElementSupport element,
String location)
Serves content data from a certain location through the provided element. |
|
boolean |
storeContent(String location,
Content content,
ContentTransformer transformer)
Store content at a certain location. |
|
|
useContentData(String location,
ContentDataUser user)
Use the data of content at a certain location. |
|
| Method Detail |
|---|
boolean install()
throws ContentManagerException
true if the installation was successful; or
false if it wasn't.
ContentManagerException - if an unexpected error occurred
boolean remove()
throws ContentManagerException
true if the removal was successful; or
false if it wasn't.
ContentManagerException - if an unexpected error occurred
boolean createRepository(String name)
throws ContentManagerException
name - the name of the repository to create
true if the creation was successful; or
false if it wasn't.
ContentManagerException - if an unexpected error occurred
boolean containsRepository(String name)
throws ContentManagerException
name - the name of the repository to check
true if the repository exists; or
false if it doesn't.
ContentManagerException - if an unexpected error occurred
boolean storeContent(String location,
Content content,
ContentTransformer transformer)
throws ContentManagerException
If content is already present at this location, the new content will become the current version and the old content remains available as an older version.
location - the location where the content has to be stored.content - the content that has to be storedtransformer - a transformer that will modify the content data; or
null if the content data should stay intact
true if the storing was successfully; or
false if it wasn't.
ContentManagerException - if an unexpected error occurred
boolean deleteContent(String location)
throws ContentManagerException
This will delete all versions of the content at that location.
location - the location where the content has to be deleted
true if the deletion was successfully; or
false if it wasn't.
ContentManagerException - if an unexpected error occurred
<ResultType> ResultType useContentData(String location,
ContentDataUser user)
throws ContentManagerException
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.
location - the location whose content will be useduser - the content user instance that will be called to use
content data
ContentDataUser.useContentData(Object)
returns after its usage
ContentManagerException - if an unexpected error occurred
boolean hasContentData(String location)
throws ContentManagerException
location - the location that has to be checked
true if content data is available; or
false if it isn't.
ContentManagerException - if an expected error occurred
ContentInfo getContentInfo(String location)
throws ContentManagerException
location - the location whose content info has to be retrieved
ContentInfo; or
null if no content is present at the location
ContentManagerException - if an expected error occurred
void serveContentData(ElementSupport element,
String location)
throws ContentManagerException
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.
element - an active element instancelocation - the location whose content data has to be served
ContentManagerException - if an expected error occurred
String getContentForHtml(String location,
ElementSupport element,
String serveContentExitName)
throws ContentManagerException
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.
location - the location whose content will be displayedelement - an active element instanceserveContentExitName - 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.
ContentManagerException - if an expected error occurred
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||