Interface LiveRelationshipManager


  • public interface LiveRelationshipManager
    • Method Detail

      • 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

        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 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:
        RangeIterator
      • 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:
        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 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:
        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 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,
                                        java.lang.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,
                                          java.lang.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
        java.util.Map<java.lang.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,
                             java.lang.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:
        Page.getName()
      • removeSkippedPages

        @Deprecated
        void removeSkippedPages​(Page parentPage,
                                java.lang.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:
        Page.getName()
      • 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
      • 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:
        isLiveCopy(Resource)