Class SynchronizeComponent

    • Field Detail

      • ROLE

        public static final String ROLE
        Avalon Role
    • Method Detail

      • isHierarchyValid

        public boolean isHierarchyValid​(Page page,
                                        Session liveSession)
                                 throws RepositoryException
        Returns true if the hierarchy of the given Page is valid, ie if all its ancestors are valid and synchronized in the live workspace.
        Parameters:
        page - the source page.
        liveSession - the live Session.
        Returns:
        the hierarchy validity status.
        Throws:
        RepositoryException - if failed to check page hierarchy
      • isPageValid

        public boolean isPageValid​(Page page,
                                   Skin skin)
        Returns true if the given page should be synchronized in the live workspace.
        Parameters:
        page - the page to test.
        skin - the skin of the page's site.
        Returns:
        true if the page is valid
      • isDateValid

        public boolean isDateValid​(Page page)
        Returns true if the publication date of the given page are valid.
        Parameters:
        page - the page to test.
        Returns:
        true if the publication dates are valid
      • addNodeWithUUID

        public Node addNodeWithUUID​(Node srcNode,
                                    Node parentNode,
                                    String nodeName)
                             throws RepositoryException
        Adds a node to a parent node using a source node for name, type and potential UUID.
        Parameters:
        srcNode - the source node.
        parentNode - the parent node for the newly created node.
        nodeName - the node name to use.
        Returns:
        the created node.
        Throws:
        RepositoryException - if an error occurs.
      • synchronizeContent

        public void synchronizeContent​(Content content,
                                       Session liveSession)
                                throws RepositoryException
        Will copy the LIVE version of the content into the LIVE workspace. Works only with JCRAmetysObject. This method DO NOT save the liveSession.
        Parameters:
        content - The content to copy
        liveSession - The session for live
        Throws:
        RepositoryException - If an error occurred
      • cloneEligiblePage

        public void cloneEligiblePage​(Page page,
                                      Skin skin,
                                      Session liveSession)
                               throws RepositoryException
        Clones a page and its eligible child pages, recursively. It is assumed that parent page already exist in the live workspace
        Parameters:
        page - the page to clone.
        skin - the skin of the page's site.
        liveSession - the session to the live workspace.
        Throws:
        RepositoryException - if an error occurs.
      • orderNode

        public void orderNode​(Node parentNode,
                              String nodeName,
                              Node liveNode)
                       throws RepositoryException
        Reorder a node, mirroring the order in the default workspace.
        Parameters:
        parentNode - the parent of the source Node in the default workspace.
        nodeName - the node name.
        liveNode - the node in the live workspace to be reordered.
        Throws:
        RepositoryException - if an error occurs.
      • synchronizePage

        public void synchronizePage​(Page page,
                                    Skin skin,
                                    Session liveSession)
                             throws RepositoryException
        Synchronizes a page with the live workspace. Also synchronizes hierarchy.
        Parameters:
        page - the page.
        skin - the skin of the page's site.
        liveSession - the session to the live workspace.
        Throws:
        RepositoryException - if an error occurs.
      • synchronizeACL

        public void synchronizeACL​(Node node,
                                   Session liveSession)
        Synchronize a node ACL information with node in live session if available This method does NOT save live session
        Parameters:
        node - The trunk node in default workspace
        liveSession - The live session