Interface LiveRelationshipManager


public interface LiveRelationshipManager
  • Method Details

    • hasLiveRelationship

      boolean hasLiveRelationship(Resource resource)
      Checks if the given Resource is target of a LiveRelationship.
      Parameters:
      resource - the resource to check
      Returns:
      true if 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:
      true if the resource is a blueprint
    • getLiveRelationships

      Collection<LiveRelationship> getLiveRelationships(Page source, RolloutManager.Trigger trigger, String[] targets, boolean advancedStatus) throws WCMException
      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 page
      trigger - filter for triggers
      targets - filter for targets
      advancedStatus - True if advanced status (time consuming) must be computed for relationships
      Returns:
      the relationships
      Throws:
      WCMException - if an error occurs
    • getLiveRelationships

      Collection<LiveRelationship> getLiveRelationships(Resource source, RolloutManager.Trigger trigger, String[] targets, boolean advancedStatus) throws WCMException
      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 a LiveCopy root .
      Parameters:
      source - resource
      trigger - filter for triggers
      targets - filter for targets
      advancedStatus - 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, 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 inspect
      targetPathFilter - absolute path the LiveRelationships should be searched in, null indicates root The path filter matches always self and descendants
      triggerFilter - the Trigger the LiveRelationships must have LiveRelationship.isTrigger(com.day.cq.wcm.msm.api.RolloutManager.Trigger). null argument indicates any
      Returns:
      hits
      Throws:
      WCMException - in case of an error
      See Also:
    • getLiveRelationship

      LiveRelationship getLiveRelationship(Resource target, boolean advancedStatus) throws WCMException
      Returns a LiveRelationship of the given LiveCopy Resource
      Parameters:
      target - the LiveCopy target Resource
      advancedStatus - True if advanced status must be computed for relationship
      Returns:
      the relationship or null if 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 for
      resourceResolver - to use to access the resources with
      Returns:
      the combined set of LiveRelationships
      Throws:
      WCMException - in case of an error
      See Also:
    • 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 copy
      copy - the page to receive the changes from the source
      deep - if false the LiveCopy of this relation ship will only be valid for the Page given as copy argument
      autoSave - if the changes should be committed
      rolloutConfig - 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 the LiveRelationship of the given Resource.
      The Resource has to be part of a LiveCopy As indicated by hasLiveRelationship 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 the cancelRelationship method
      Parameters:
      resource - to detach from LiveRelationship
      autoSave - if true changes are committed immediately
      Throws:
      WCMException - in case an error occurs on detachment
      See Also:
    • cancelRelationship

      void cancelRelationship(ResourceResolver resolver, LiveRelationship relation, boolean deep, boolean autoSave) throws WCMException
      Cancel the relationship of the given relation.
      Parameters:
      resolver - resource resolver
      relation - relation
      deep - if true all child relations are canceled, too
      autoSave - 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 resolver
      relation - relation to re-enable
      autoSave - Save modifications
      Throws:
      WCMException - if an error occurs
    • cancelPropertyRelationship

      void cancelPropertyRelationship(ResourceResolver resolver, LiveRelationship relation, String[] names, boolean autoSave) throws WCMException
      Cancel the relationship of the given relation.
      Parameters:
      resolver - resource resolver
      relation - relation
      names - list of property names for which inheritance is canceled
      autoSave - Save modifications
      Throws:
      WCMException - if an error occurs
    • reenablePropertyRelationship

      void reenablePropertyRelationship(ResourceResolver resolver, LiveRelationship relation, String[] names, boolean autoSave) throws WCMException
      Re-enable the relationship of a canceled one.
      Parameters:
      resolver - resource resolver
      relation - relation to re-enable
      names - list of property names for which inheritance is reenabled
      autoSave - Save modifications
      Throws:
      WCMException - if an error occurs
    • getSkippedSourcePages

      @Deprecated Map<String,Page> getSkippedSourcePages(Page parentTargetPage) throws WCMException
      Deprecated.
      since 5.7 use LiveCopy.getExclusions() instead
      Returns 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, String[] childName, boolean autoSave) throws WCMException
      Deprecated.
      since 5.7 use LiveCopy.addExclusion(String) instead
      Adds several pages to the skipped pages list (stored on parent page).
      Parameters:
      parentPage - Parent page
      childName - names of the pages to be skipped
      autoSave - Save modifications
      Throws:
      WCMException - if an error occurs
      See Also:
    • removeSkippedPages

      @Deprecated void removeSkippedPages(Page parentPage, String[] childName, boolean autoSave) throws WCMException
      Deprecated.
      since 5.7 use LiveCopy.removeExclusion(String) instead
      Removes several pages from the skipped pages list (stored on parent page).
      Parameters:
      parentPage - Parent page
      childName - names of the Pages to be unskipped
      autoSave - Save modifications
      Throws:
      WCMException - if an error occurs
      See Also:
    • getLiveCopies

      @Deprecated Map<String,LiveCopy> getLiveCopies() throws WCMException
      Returns 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
      Returns the closest Live Copy corresponding the target resource.
      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)
      Checks if the given source is in a blueprint tree.
      Parameters:
      source - the resource to check
      Returns:
      true if the resource is a blueprint
    • isLiveCopy

      @Deprecated boolean isLiveCopy(Resource target)
      Checks if the given sync target is part of a Live Copy relationship.
      Parameters:
      target - the resource to check
      Returns:
      true if the resource is live synced
    • detach

      @Deprecated void detach(Resource resource, boolean autoSave) throws WCMException
      Deprecated.
      since 5.5 use endRelationship()
      Ends the LiveRelationship of the given Resource.
      The Resource has to be part of a LiveCopy As indicated by hasLiveRelationship 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 the method
      Parameters:
      resource - to detach from LiveRelationship
      autoSave - if true changes are committed immediately
      Throws:
      WCMException - in case an error occurs on detachment
      See Also: