public abstract class CSFormatItem extends CSItem
The CSFormatItem
class is the base class for all classes that need to be able to query and store a
single iCM item and also to manipulate text (replace any swear words, for example) before it is saved to the database
via the update
method.
Refer to the relevant derived class for more information, CSForumMessage
for example.
ACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSFormatItem()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCensorString()
Returns a
String with which inoffensive words will be replaced, providing the censorship string is
not empty. |
java.lang.String |
getEmoticonDirectory()
Get the directory being used for emoticon images.
|
int |
getEmoticonHeight()
Get the height (in pixels) of the emoticon to be used to replace text patterns.
|
int |
getEmoticonWidth()
Get the width (in pixels) of the emoticon to be used to replace text patterns.
|
boolean |
getFilterSwearWords()
Find out if swear word filtering is turned on or off.
|
boolean |
getReplaceEmoticons()
Find out if emoticon replacement is turned on or off.
|
boolean |
getStripTags()
Find out if tag stripping is turned on or off.
|
void |
setCensorString(java.lang.String strCensorString)
Sets the Censorship
String with which offensive words will be replaced, providing the censorship
string is not empty. |
void |
setEmoticonDirectory(java.lang.String strDir)
Set the directory to be used for emoticon images.
|
void |
setEmoticonHeight(int nHeight)
Set the height (in pixels) of the emoticon to be used to replace text patterns.
|
void |
setEmoticonWidth(int nWidth)
Set the width (in pixels) of the emoticon to be used to replace text patterns.
|
void |
setFilterSwearWords(boolean bFilter)
Turn on/off swear word filtering.
|
void |
setReplaceEmoticons(boolean bReplace)
Turn on/off Emoticon replacement.
|
void |
setStripTags(boolean bStrip)
Turn on/off tag stripping.
|
java.lang.String |
toString()
Provides debug information on the contents of the
CSFormatItem object. |
delete, equals, exist, get, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, unset, update
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setDetailLevel, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public void setStripTags(boolean bStrip)
If tag stripping is turned on, then a message being added/modified on the database by a call to
get
will have html tags stripped from the username, the subject and the message body.
Tag stripping is accomplished by globally replacing the less that character '<' with the pattern "<" and similarly replacing '>' with ">".
bStrip
- should be set to true
to enable tag stripping, false
to disable it.public boolean getStripTags()
setStripTags(boolean)
.public void setFilterSwearWords(boolean bFilter)
If filtering is turned on, then a message being added/modified on the database by a call to get
will have swear words replaced by inoffensive strings of characters in the username, the subject and the message
body.
The list of offensive words for the swear word filtering are loaded from the database and are configurable within iCM's HOUSEKEEPING section.
bFilter
- should be set to true
to enable swear word filtering, false
to allow
swearing.public boolean getFilterSwearWords()
setFilterSwearWords(boolean)
.public void setEmoticonWidth(int nWidth)
nWidth
- The emoticon width in pixels.public int getEmoticonWidth()
public void setEmoticonHeight(int nHeight)
nHeight
- The emoticon height in pixelspublic int getEmoticonHeight()
public void setReplaceEmoticons(boolean bReplace)
If replacement is turned on, then a message being added/modified on the database by a call to get
will have emoticon patterns, e.g. ":)" replaced by appropriate images in the username, the subject and the
message body.
The list of recognised emoticon patterns are loaded from the iCM database.
bReplace
- should be set to true
to enable emoticon replacement, false
otherwise.public boolean getReplaceEmoticons()
setFilterSwearWords(boolean)
.public void setEmoticonDirectory(java.lang.String strDir)
strDir
- the directory in which to find emoticon images.public java.lang.String getEmoticonDirectory()
String
containing the directory for emoticon images, previously set with
setEmoticonDirectory
.public java.lang.String getCensorString()
String
with which inoffensive words will be replaced, providing the censorship string is
not empty. If the censorship string is empty then offensive words will be replaced with random non-alphanumeric
characters.
Currently used by the CSForumMessage
and CSForumThread
classes only.
String
for censorship of offensive words.public void setCensorString(java.lang.String strCensorString)
String
with which offensive words will be replaced, providing the censorship
string is not empty. If the censorship string is empty then offensive words will be replaced with random
non-alphanumeric characters.
Currently used by the CSForumMessage
and CSForumThread
classes only.
strCensorString
- A String
for censorship of offensive words.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.