CMSLiteService¶
-
public interface
CMSLiteService
¶ CMS Lite is a lightweight content management system based on MDS storage. It supports storing and retrieving of stream / text content along with custom metadata for each language.
Methods¶
addContent¶
-
void
addContent
(Content content)¶ Add content to the CMS data-store.
Parameters: - content – the content to add
See also:
org.motechproject.cmslite.model.StreamContent
,org.motechproject.cmslite.model.StringContent
getAllContents¶
-
List<Content>
getAllContents
()¶ Retrieves a list of all String and Stream contents. Returned list is defined as a list of generic Content instances, containing basic information such as language, name and metadata. To make better use of instances retrieved this way an
instanceof
check should be performed, followed by a cast to eitherStringContent
orStreamContent
Returns: list of all contents See also:
org.motechproject.cmslite.model.StringContent
,org.motechproject.cmslite.model.StreamContent
getStreamContent¶
-
StreamContent
getStreamContent
(String language, String name)¶ Get stream content with the given name and language.
Parameters: - language – the language of the content
- name – the name of the content
Throws: - ContentNotFoundException – if no such content exists
Returns: StreamContent that matches the parameters
getStreamContent¶
-
StreamContent
getStreamContent
(long streamContentId)¶ Retrieved
StreamContent
by its ID.Parameters: - streamContentId – ID of a StreamContent to retrieved
Returns: StreamContent of a given ID
getStringContent¶
-
StringContent
getStringContent
(String language, String name)¶ Get text content for given name and language.
Parameters: - language – the language of the content
- name – the name of the content
Throws: - ContentNotFoundException – if no such content exists
Returns: StringContent that matches the parameters
getStringContent¶
-
StringContent
getStringContent
(long stringContentId)¶ Retrieved
StringContent
by its ID.Parameters: - stringContentId – ID of a StringContent to retrieved
Returns: StringContent of a given ID
isStreamContentAvailable¶
isStringContentAvailable¶
removeStreamContent¶
-
void
removeStreamContent
(String language, String name)¶ Remove stream content for given name and language.
Parameters: - language – the language of the content to remove
- name – the name of the content to remove
Throws: - ContentNotFoundException – if no such content exists
removeStringContent¶
-
void
removeStringContent
(String language, String name)¶ Remove text content for given name and language.
Parameters: - language – the language of the content to remove
- name – the name of the content to remove
Throws: - ContentNotFoundException – if no such content exists
retrieveStreamContentData¶
-
Byte[]
retrieveStreamContentData
(StreamContent instance)¶ Helper method, retrieving data of a
StreamContent
. The data is returned as a byte array.Parameters: - instance – Instance of a StreamContent
Returns: byte array, containing data of a StreamContent