Package com.day.cq.wcm.api
Class PageModification
java.lang.Object
com.day.cq.wcm.api.PageModification
- All Implemented Interfaces:
Serializable
This class encapsulates the information coming along with a page
modification.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The modification type. -
Method Summary
Modifier and TypeMethodDescriptionstatic PageModification
Create a newPageModification
that represents a page creation.static PageModification
Create a newPageModification
that represents a page deletion.final boolean
Overridden to alter the preconditions when two modifications are considered equal.static PageModification
fromEventProperties
(Map<String, Object> props) Create a page modification from properties.getAbove()
Get a dictionary with all event properties.Get the list of changes for a modification of the page.getPath()
The path of the page.getType()
int
hashCode()
Returns a hash code value for the object.static PageModification
Create a newPageModification
that represents a page modification.static PageModification
Create a newPageModification
that represents a page moval.static PageModification
pageInvalid
(String path, long time) Create a newPageModification
that represents that the page became invalid due to an off-time reached.static PageModification
pageRestored
(String path, String vid, String userId) Create a newPageModification
that represents a version created.static PageModification
Create a newPageModification
that represents that the page became valid due to an on-time reached.static PageModification
Create a newPageModification
that represents a version deleted.toEvent()
Convert a single modification to an event.toString()
Return a string representation of this objectstatic PageModification
versionCreated
(String path, String vid, String userId) Create a newPageModification
that represents a version created.
-
Method Details
-
created
Create a newPageModification
that represents a page creation.- Parameters:
path
- path to new pageabove
- label of successor siblinguserId
- the id of the user that caused this modification.- Returns:
- modification
-
modified
public static PageModification modified(String path, String vid, String userId, Set<String> changes) Create a newPageModification
that represents a page modification.- Parameters:
path
- path of pagevid
- the version nameuserId
- the id of the user that caused this modification.changes
- A set of changes (paths) - optional- Returns:
- modification
-
moved
Create a newPageModification
that represents a page moval.- Parameters:
path
- path of pagedestination
- new page destination, may benull
above
- label of successor sibling, may benull
userId
- the id of the user that caused this modification.- Returns:
- modification
-
deleted
Create a newPageModification
that represents a page deletion.- Parameters:
path
- path of pageuserId
- the id of the user that caused this modification.- Returns:
- modification
-
versionCreated
Create a newPageModification
that represents a version created.- Parameters:
path
- path of pagevid
- the versio nameuserId
- the id of the user that caused this modification.- Returns:
- modification
-
pageRestored
Create a newPageModification
that represents a version created.- Parameters:
path
- path of pagevid
- the vesion nameuserId
- the id of the user that caused this modification.- Returns:
- modification
-
pageValid
Create a newPageModification
that represents that the page became valid due to an on-time reached.- Parameters:
path
- path of pagetime
- the on-time- Returns:
- modification
-
pageInvalid
Create a newPageModification
that represents that the page became invalid due to an off-time reached.- Parameters:
path
- path of pagetime
- the off-time- Returns:
- modification
-
rolledout
Create a newPageModification
that represents a version deleted.- Parameters:
path
- path of pageuserId
- the id of the user that caused this modification.- Returns:
- modification
-
getPath
The path of the page.- Returns:
- The path of the page.
-
getDestination
-
getAbove
-
getType
-
getVersionId
-
getUserId
-
getModificationDate
-
getModificationPaths
Get the list of changes for a modification of the page.- Returns:
- A set of relative paths or null.
-
equals
Overridden to alter the preconditions when two modifications are considered equal. -
hashCode
public int hashCode()Returns a hash code value for the object. Replaced in order to return the same hashcode for two objects that are considered equal according to theequals(java.lang.Object)
method implemented above. -
toString
Return a string representation of this object -
getEventProperties
Get a dictionary with all event properties.- Returns:
- an map of event properties
-
fromEventProperties
Create a page modification from properties.- Parameters:
props
- the event properties- Returns:
- a page modification object
-
toEvent
Convert a single modification to an event.- Returns:
- a page event
-