Package com.day.cq.wcm.msm.api
Interface LiveRelationshipManager
-
public interface LiveRelationshipManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddSkippedPages(Page parentPage, java.lang.String[] childName, boolean autoSave)Deprecated.since 5.7 useLiveCopy.addExclusion(String)insteadvoidcancelPropertyRelationship(ResourceResolver resolver, LiveRelationship relation, java.lang.String[] names, boolean autoSave)Cancel the relationship of the given relation.voidcancelRelationship(ResourceResolver resolver, LiveRelationship relation, boolean deep, boolean autoSave)Cancel the relationship of the given relation.voiddetach(Resource resource, boolean autoSave)Deprecated.since 5.5 use endRelationship()voidendRelationship(Resource resource, boolean autoSave)Ends theLiveRelationshipof the given Resource.
The Resource has to be part of aLiveCopyAs indicated byhasLiveRelationship method
A detached Resource is treated as any other Resource that is created in the LiveCopy tree.
NOTE: this means especially that any history of this relation is gone.LiveRelationshipestablishRelationship(Page source, Page copy, boolean deep, boolean autoSave, RolloutConfig... rolloutConfig)Puts a Page under the control of a LiveCopyRangeIteratorgetChildren(LiveRelationship relationship, ResourceResolver resourceResolver)Get the children of the given LiveRelationship
This is the combined set of the Blueprint's and the LiveRelationship's children Resources.java.util.Map<java.lang.String,LiveCopy>getLiveCopies()Deprecated.since 5.5 usegetLiveRelationships(org.apache.sling.api.resource.Resource, com.day.cq.wcm.msm.api.RolloutManager.Trigger, String[], boolean)to search for LiveCopiesLiveCopygetLiveCopy(Resource target)Deprecated.LiveRelationshipgetLiveRelationship(Resource target, boolean advancedStatus)Returns aLiveRelationshipof the givenLiveCopyResourcejava.util.Collection<LiveRelationship>getLiveRelationships(Page source, RolloutManager.Trigger trigger, java.lang.String[] targets, boolean advancedStatus)java.util.Collection<LiveRelationship>getLiveRelationships(Resource source, RolloutManager.Trigger trigger, java.lang.String[] targets, boolean advancedStatus)RangeIteratorgetLiveRelationships(Resource source, java.lang.String targetPathFilter, RolloutManager.Trigger triggerFilter)Find all LiveRelationships, that have the given Resource as Blueprint.java.util.Map<java.lang.String,Page>getSkippedSourcePages(Page parentTargetPage)Deprecated.since 5.7 useLiveCopy.getExclusions()insteadbooleanhasLiveRelationship(Resource resource)Checks if the given Resource is target of a LiveRelationship.booleanisInBlueprint(Resource source)Deprecated.useBlueprintManager.getContainingBlueprint(String)to checkbooleanisLiveCopy(Resource target)Deprecated.since 5.5 usehasLiveRelationship(org.apache.sling.api.resource.Resource)insteadbooleanisSource(Resource resource)Checks if the given source is the source of a Live Copy relationship.voidreenablePropertyRelationship(ResourceResolver resolver, LiveRelationship relation, java.lang.String[] names, boolean autoSave)Re-enable the relationship of a canceled one.voidreenableRelationship(ResourceResolver resolver, LiveRelationship relation, boolean autoSave)Re-enable the relationship of a canceled one.voidremoveSkippedPages(Page parentPage, java.lang.String[] childName, boolean autoSave)Deprecated.since 5.7 useLiveCopy.removeExclusion(String)instead
-
-
-
Method Detail
-
hasLiveRelationship
boolean hasLiveRelationship(Resource resource)
Checks if the given Resource is target of a LiveRelationship.- Parameters:
resource- the resource to check- Returns:
trueif the Resource is controlled by a LiveCopy
-
isSource
boolean isSource(Resource resource)
Checks if the given source is the source of a Live Copy relationship.- Parameters:
resource- the resource to check- Returns:
trueif the resource is a blueprint
-
getLiveRelationships
java.util.Collection<LiveRelationship> getLiveRelationships(Page source, RolloutManager.Trigger trigger, java.lang.String[] targets, boolean advancedStatus) throws WCMException
Deprecated.Returns a Collection of LiveRelationships of the given LiveCopy source Page to its targets. The search can be limited by trigger or target by specifying the respective parameters. The given source page does not need to be a LiveCopy root.- Parameters:
source- source pagetrigger- filter for triggerstargets- filter for targetsadvancedStatus- True if advanced status (time consuming) must be computed for relationships- Returns:
- the relationships
- Throws:
WCMException- if an error occurs
-
getLiveRelationships
java.util.Collection<LiveRelationship> getLiveRelationships(Resource source, RolloutManager.Trigger trigger, java.lang.String[] targets, boolean advancedStatus) throws WCMException
Deprecated.Returns a collection of LiveRelationships of the given LiveCopy's source to its targets. The search can be limited by trigger or target by specifying the respective parameters. The given source resource does not need to be aLiveCopy root.- Parameters:
source- resourcetrigger- filter for triggerstargets- filter for targetsadvancedStatus- True if advanced status (time consuming) must be computed for relationships- Returns:
- the relationships
- Throws:
WCMException- if an error occurs
-
getLiveRelationships
RangeIterator getLiveRelationships(Resource source, java.lang.String targetPathFilter, RolloutManager.Trigger triggerFilter) throws WCMException
Find all LiveRelationships, that have the given Resource as Blueprint. The result can be filtered to match a branch with giving a target filter and further an optional filter for the Trigger.
The result is a RangeIterator that contains the matching LiveRelationships.- Parameters:
source- to inspecttargetPathFilter- absolute path the LiveRelationships should be searched in, null indicates root The path filter matches always self and descendantstriggerFilter- the Trigger the LiveRelationships must haveLiveRelationship.isTrigger(com.day.cq.wcm.msm.api.RolloutManager.Trigger). null argument indicates any- Returns:
- hits
- Throws:
WCMException- in case of an error- See Also:
RangeIterator
-
getLiveRelationship
LiveRelationship getLiveRelationship(Resource target, boolean advancedStatus) throws WCMException
Returns aLiveRelationshipof the givenLiveCopyResource- Parameters:
target- the LiveCopy target ResourceadvancedStatus- True if advanced status must be computed for relationship- Returns:
- the relationship or
nullif the resource is not a LiveCopy - Throws:
WCMException- if an error occurs
-
getChildren
RangeIterator getChildren(LiveRelationship relationship, ResourceResolver resourceResolver) throws WCMException
Get the children of the given LiveRelationship
This is the combined set of the Blueprint's and the LiveRelationship's children Resources. Thus the result contains the Relationships for Resources that only exists in Blueprint, that only exists in LiveCopy and that exists in both.
The order of result is not specific.- Parameters:
relationship- to access the children forresourceResolver- to use to access the resources with- Returns:
- the combined set of LiveRelationships
- Throws:
WCMException- in case of an error- See Also:
RangeIterator
-
establishRelationship
LiveRelationship establishRelationship(Page source, Page copy, boolean deep, boolean autoSave, RolloutConfig... rolloutConfig) throws WCMException
Puts a Page under the control of a LiveCopy- Parameters:
source- the source to be synced to the copycopy- the page to receive the changes from the sourcedeep- if false the LiveCopy of this relation ship will only be valid for the Page given as copy argumentautoSave- if the changes should be committedrolloutConfig- the configuration to be use for the synchronization- Returns:
- the established LiveRelationship
- Throws:
WCMException- in case of error establishing the relationship
-
endRelationship
void endRelationship(Resource resource, boolean autoSave) throws WCMException
Ends theLiveRelationshipof the given Resource.
The Resource has to be part of aLiveCopyAs indicated byhasLiveRelationship method
A detached Resource is treated as any other Resource that is created in the LiveCopy tree.
NOTE: this means especially that any history of this relation is gone. If you want to maintain this history or just want to keep the current version of the Resource use thecancelRelationship method- Parameters:
resource- to detach from LiveRelationshipautoSave- if true changes are committed immediately- Throws:
WCMException- in case an error occurs on detachment- See Also:
hasLiveRelationship(Resource)
-
cancelRelationship
void cancelRelationship(ResourceResolver resolver, LiveRelationship relation, boolean deep, boolean autoSave) throws WCMException
Cancel the relationship of the given relation.- Parameters:
resolver- resource resolverrelation- relationdeep- iftrueall child relations are canceled, tooautoSave- Save modifications- Throws:
WCMException- if an error occurs
-
reenableRelationship
void reenableRelationship(ResourceResolver resolver, LiveRelationship relation, boolean autoSave) throws WCMException
Re-enable the relationship of a canceled one.- Parameters:
resolver- resource resolverrelation- relation to re-enableautoSave- Save modifications- Throws:
WCMException- if an error occurs
-
cancelPropertyRelationship
void cancelPropertyRelationship(ResourceResolver resolver, LiveRelationship relation, java.lang.String[] names, boolean autoSave) throws WCMException
Cancel the relationship of the given relation.- Parameters:
resolver- resource resolverrelation- relationnames- list of property names for which inheritance is canceledautoSave- Save modifications- Throws:
WCMException- if an error occurs
-
reenablePropertyRelationship
void reenablePropertyRelationship(ResourceResolver resolver, LiveRelationship relation, java.lang.String[] names, boolean autoSave) throws WCMException
Re-enable the relationship of a canceled one.- Parameters:
resolver- resource resolverrelation- relation to re-enablenames- list of property names for which inheritance is reenabledautoSave- Save modifications- Throws:
WCMException- if an error occurs
-
getSkippedSourcePages
@Deprecated java.util.Map<java.lang.String,Page> getSkippedSourcePages(Page parentTargetPage) throws WCMException
Deprecated.since 5.7 useLiveCopy.getExclusions()insteadReturns a map of pairs: Live Copy skipped page's path / Blueprint page. Each Live Copy skipped page's path is the path of a skipped child of the provided page and returned map contains its corresponding Blueprint page.- Parameters:
parentTargetPage- Parent target page- Returns:
- the map
- Throws:
WCMException- if an error occurs
-
addSkippedPages
@Deprecated void addSkippedPages(Page parentPage, java.lang.String[] childName, boolean autoSave) throws WCMException
Deprecated.since 5.7 useLiveCopy.addExclusion(String)insteadAdds several pages to the skipped pages list (stored on parent page).- Parameters:
parentPage- Parent pagechildName- names of the pages to be skippedautoSave- Save modifications- Throws:
WCMException- if an error occurs- See Also:
Page.getName()
-
removeSkippedPages
@Deprecated void removeSkippedPages(Page parentPage, java.lang.String[] childName, boolean autoSave) throws WCMException
Deprecated.since 5.7 useLiveCopy.removeExclusion(String)insteadRemoves several pages from the skipped pages list (stored on parent page).- Parameters:
parentPage- Parent pagechildName- names of the Pages to be unskippedautoSave- Save modifications- Throws:
WCMException- if an error occurs- See Also:
Page.getName()
-
getLiveCopies
@Deprecated java.util.Map<java.lang.String,LiveCopy> getLiveCopies() throws WCMException
Deprecated.since 5.5 usegetLiveRelationships(org.apache.sling.api.resource.Resource, com.day.cq.wcm.msm.api.RolloutManager.Trigger, String[], boolean)to search for LiveCopiesReturns all live copies. the Live Copy path is used as key of the map.- Returns:
- all live copies.
- Throws:
WCMException- in case of error accessing the LiveCopy
-
getLiveCopy
@Deprecated LiveCopy getLiveCopy(Resource target) throws WCMException
Deprecated.Returns the closest Live Copy corresponding thetargetresource.- Parameters:
target- resource- Returns:
- Live Copy or null if no Live Copy found.
- Throws:
WCMException- in case of error accessing the LiveCopy
-
isInBlueprint
@Deprecated boolean isInBlueprint(Resource source)
Deprecated.useBlueprintManager.getContainingBlueprint(String)to checkChecks if the given source is in a blueprint tree.- Parameters:
source- the resource to check- Returns:
trueif the resource is a blueprint
-
isLiveCopy
@Deprecated boolean isLiveCopy(Resource target)
Deprecated.since 5.5 usehasLiveRelationship(org.apache.sling.api.resource.Resource)insteadChecks if the given sync target is part of a Live Copy relationship.- Parameters:
target- the resource to check- Returns:
trueif the resource is live synced
-
detach
@Deprecated void detach(Resource resource, boolean autoSave) throws WCMException
Deprecated.since 5.5 use endRelationship()Ends theLiveRelationshipof the given Resource.
The Resource has to be part of aLiveCopyAs indicated byhasLiveRelationship method
A detached Resource is treated as any other Resource that is created in the LiveCopy tree.
NOTE: this means especially that any history of this relation is gone. If you want to maintain this history or just want to keep the current version of the Resource use themethod- Parameters:
resource- to detach from LiveRelationshipautoSave- if true changes are committed immediately- Throws:
WCMException- in case an error occurs on detachment- See Also:
isLiveCopy(Resource)
-
-