Interface AuthorPersistentHighlight
-
- All Superinterfaces:
AuthorPersistentHighlightConstants
@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface AuthorPersistentHighlight extends AuthorPersistentHighlightConstants
Defines the Author Persistent Highlight which get serialized in the XML as processing instruction. The Author Persistent Highlight has one of the following types defined inAuthorPersistentHighlight.PersistentHighlightType
:-
AuthorPersistentHighlight.PersistentHighlightType.CUSTOM_HIGHLIGHT
represents theCustom defined highlights
that can be managed by using theAuthorPersistentHighlighter
. The name of the processing instruction markers corresponding to this type of highlight areoxy_custom_start
andoxy_custom_end
-
AuthorPersistentHighlight.PersistentHighlightType.COMMENT
represents theComment highlights
which get serialized using theoxy_comment_start
andoxy_comment_end
processing instruction names. -
AuthorPersistentHighlight.PersistentHighlightType.CHANGE_INSERT
represents theInsert highlight from Change Tracking
, with theoxy_insert_start
andoxy_insert_end
corresponding processing instruction names. -
AuthorPersistentHighlight.PersistentHighlightType.CHANGE_DELETE
represents theDelete highlight from Change Tracking
, which get serialized by using theoxy_delete
processing instruction name.
Comment
,Insert
andDelete
persistent highlights can be accessed and customized by using theAuthorReviewController
.- Since:
- 12
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AuthorPersistentHighlight.PersistentHighlightType
TheAuthor Persistent Highlight
type.
-
Field Summary
-
Fields inherited from interface ro.sync.ecss.extensions.api.highlights.AuthorPersistentHighlightConstants
ATTR_NAME_ATTRIBUTE, AUTHOR_NAME_ATTRIBUTE, COMMENT_ATTRIBUTE, COMMENT_ID, COMMENT_PARENT_ID, CONTENT_ATTRIBUTE, DONE_ATTRIBUTE_VALUE, EMPTY_MARKER_ATTRIBUTE, FLAG_ATTRIBUTE, MID_ATTRIBUTE, MODIFICATION_TIME, TYPE_ATTRIBUTE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AuthorPersistentHighlight
clone(Content content)
Clone the highlight to a new content.java.util.LinkedHashMap<java.lang.String,java.lang.String>
getClonedProperties()
Returns a copy of the internal properties map.int
getEndOffset()
Get the highlight end offset.java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>>
getPropertiesIterator()
Provides an iterator over the current properties map.java.lang.String
getProperty(java.lang.String key)
Get the value of a propertyint
getStartOffset()
Get the highlight start offset.AuthorPersistentHighlight.PersistentHighlightType
getType()
The persistent highlight type.boolean
isEmpty()
Check if the marker is over content.
-
-
-
Method Detail
-
getStartOffset
int getStartOffset()
Get the highlight start offset.- Returns:
- The start offset (inclusive).
-
getEndOffset
int getEndOffset()
Get the highlight end offset.Note: empty persistent highlights have
startOffset == endOffset & isEmpty() == true
- Returns:
- The end offset (inclusive).
-
getClonedProperties
java.util.LinkedHashMap<java.lang.String,java.lang.String> getClonedProperties()
Returns a copy of the internal properties map. The properties can contain details about the highlight author or the highlight modification timestamp, depending on the highlight type:
- The properties names for change tracking highlights are:
AuthorPersistentHighlightConstants.AUTHOR_NAME_ATTRIBUTE
,AuthorPersistentHighlightConstants.MODIFICATION_TIME
- For comment highlights the properties names are:
AuthorPersistentHighlightConstants.AUTHOR_NAME_ATTRIBUTE
,AuthorPersistentHighlightConstants.MODIFICATION_TIME
,AuthorPersistentHighlightConstants.COMMENT_ATTRIBUTE
andAuthorPersistentHighlightConstants.COMMENT_PARENT_ID
(if it is a reply) - Both comment highlights and insert and delete highlights
can also have the
AuthorPersistentHighlightConstants.COMMENT_ID
property set - The properties for custom persistent highlights are specified
when the highlight is added (@see
AuthorPersistentHighlighter.addHighlight(int, int, LinkedHashMap)
) and can be changed using theAuthorPersistentHighlighter.setProperties(AuthorPersistentHighlight, LinkedHashMap)
method.
- Returns:
- The copy of highlight properties.
- The properties names for change tracking highlights are:
-
getType
AuthorPersistentHighlight.PersistentHighlightType getType()
The persistent highlight type.- Returns:
- The
AuthorPersistentHighlight.PersistentHighlightType
corresponding to this author persistent highlight.
-
isEmpty
boolean isEmpty()
Check if the marker is over content.- Returns:
true
if the marker is not over any content.
-
clone
AuthorPersistentHighlight clone(Content content) throws java.lang.CloneNotSupportedException
Clone the highlight to a new content.- Parameters:
content
- The new content in which to clone the current highlight.- Returns:
- The clone of the hightlight. Never
null
- Throws:
java.lang.CloneNotSupportedException
- If various errors are encountered during the cloning procedure- Since:
- 21.1
-
getPropertiesIterator
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> getPropertiesIterator()
Provides an iterator over the current properties map.- Returns:
- iterator over the current properties map.
- Since:
- 24
-
getProperty
java.lang.String getProperty(java.lang.String key)
Get the value of a property- Parameters:
key
- The property key.- Returns:
- The property value or
null
. - Since:
- 24
-
-