Interface NewsMessage
- All Superinterfaces:
Message
An instance of NewsMessage
defines the headline text that provides a brief
description of a news story (see StoryMessage
).
An object implementing this interface cannot be instantiated directly, but can be constructed
using the
MessageFactory.createNewsMessage(String, String, String, String)
method of the MessageFactory
that is available on the
Publisher
interface.
If this NewsMessage
has a corresponding story for the headline, call the
setStoryReference(String)
method to uniquely identify that story. To record any keywords
that can be used to locate the story in a search result call getTags()
. This method
returns a reference to a list of the keywords (if any) in the NewsMessage
. You can
then add additional keywords to the list.
Note: After publishing a message, do not reuse the message (e.g. change the content, republish) as this can cause issues.
-
Method Summary
Modifier and TypeMethodDescriptionGets a custom field from a news messageGets the headline of the news message.Gets the date and time that the headline was created.Gets a permission string relating to this news message.Gets a reference that identifies the story associated with the headline.getTags()
Gets a reference to the set of keywords or terms that describe the news item.void
Sets a custom field on this news messagevoid
setPermission
(String permission) Sets a permission string relating to this news message.void
setStoryReference
(String reference) Sets a reference that identifies the story associated with the headline.Methods inherited from interface com.caplin.datasource.messaging.Message
getMessageType, getSubject, isImage, setImage
-
Method Details
-
getTags
Gets a reference to the set of keywords or terms that describe the news item.- Returns:
- The keywords. This is a modifiable list to which you can add additional keywords if required.
-
getHeadline
String getHeadline()Gets the headline of the news message.- Returns:
- The headline.
-
getStoryReference
String getStoryReference()Gets a reference that identifies the story associated with the headline.- Returns:
- The reference.
-
setStoryReference
Sets a reference that identifies the story associated with the headline.- Parameters:
reference
- The reference.
-
getNewsDateTime
String getNewsDateTime()Gets the date and time that the headline was created.- Returns:
- A String representation of the date and time.
-
getPermission
String getPermission()Gets a permission string relating to this news message.
Liberator can use the contents of this property to determine whether this headline should be sent to a client.
- Returns:
- The permission string.
-
setPermission
Sets a permission string relating to this news message.
Liberator can use the contents of this property to determine whether this headline should be sent to a client.
- Parameters:
permission
- The permission string.
-
setField
Sets a custom field on this news message
- Parameters:
fieldName
- the name of the field - does not need to be specified in fields.confvalue
- value for the field
-
getField
Gets a custom field from a news message
- Parameters:
fieldName
- the name of the field- Returns:
- The custom field corresponding to the field name. If field doesn't exist, then null.
-