public class SynchronizeComponent extends AbstractLogEnabled implements Component, Serviceable, Initializable
Modifier and Type | Field and Description |
---|---|
private CloneComponent |
_cloneComponent |
private I18nUtils |
_i18nUtils |
private static SynchronizeComponent |
_instance |
private AmetysObjectResolver |
_resolver |
private SkinsManager |
_skinsManager |
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
SynchronizeComponent() |
Modifier and Type | Method and Description |
---|---|
private Page |
_getPageRedirection(Page page) |
private boolean |
_isContainerPageValid(Page page,
Skin skin) |
private boolean |
_isInfiniteRedirection(Page page,
List<String> pagesSequence) |
private boolean |
_isLinkPageValid(Page page) |
private boolean |
_isNodePageValid(Page page,
Skin skin) |
private boolean |
_isZoneItemValid(ZoneItem zoneItem) |
private void |
_sendErrorMailForInfiniteRedirection(Page page) |
Node |
addNodeWithUUID(Node srcNode,
Node parentNode,
String nodeName)
Adds a node to a parent node using a source node for name, type
and potential UUID.
|
Node |
cloneAncestorsAndPreserveUUID(Node srcNode,
Session liveSession)
Clones ancestors of a node by preserving the source node UUID.
|
void |
cloneContentNodeAndPreserveUUID(Node srcNode,
Node clonedNode,
Predicate propertyPredicate,
Predicate nodePredicate)
Clones a node by preserving the source node UUID for a content.
|
void |
cloneContentProperties(Node srcNode,
Node clonedNode,
Predicate propertyPredicate)
Clones properties of a content node
|
void |
cloneEligiblePage(Page page,
Skin skin,
Session liveSession)
Clones a page and its eligible child pages, recursively.
|
void |
cloneNodeAndPreserveUUID(Node srcNode,
Node clonedNode,
Predicate propertyPredicate,
Predicate nodePredicate)
Clones a node by preserving the source node UUID.
|
void |
cloneProperties(Node srcNode,
Node clonedNode,
Predicate propertyPredicate)
Clones properties of a node
|
void |
cloneZones(Node pageNode,
Page page,
Node liveNode)
Clones the zones of a page.
|
static SynchronizeComponent |
getInstance()
Deprecated.
|
void |
initialize() |
void |
invalidateHierarchy(Page page,
Skin skin,
Session liveSession)
Invalidates the hierarchy of a page if needed
|
boolean |
isDateValid(Page page)
Returns true if the publication date of the given page are valid.
|
boolean |
isHierarchyValid(Page page,
Session liveSession)
Returns true if the hierarchy of the given Page is valid, ie if all its ancestors are valid and synchronized in the live workspace.
|
boolean |
isPageValid(Page page,
Skin skin)
Returns true if the given page should be synchronized in the live workspace.
|
void |
orderNode(Node parentNode,
String nodeName,
Node liveNode)
Reorder a node, mirroring the order in the default workspace.
|
void |
service(ServiceManager smanager) |
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
|
void |
synchronizeContent(Content content,
Session liveSession)
Will copy the LIVE version of the content into the LIVE workspace.
|
void |
synchronizePage(Page page,
Skin skin,
Session liveSession)
Synchronizes a page with the live workspace.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static SynchronizeComponent _instance
private CloneComponent _cloneComponent
private AmetysObjectResolver _resolver
private SkinsManager _skinsManager
private I18nUtils _i18nUtils
public SynchronizeComponent()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
@Deprecated public static SynchronizeComponent getInstance()
public boolean isHierarchyValid(Page page, Session liveSession) throws RepositoryException
page
- the source page.liveSession
- the live Session.RepositoryException
- if failed to check page hierarchypublic boolean isPageValid(Page page, Skin skin)
page
- the page to test.skin
- the skin of the page's site.public boolean isDateValid(Page page)
page
- the page to test.private boolean _isInfiniteRedirection(Page page, List<String> pagesSequence)
private Page _getPageRedirection(Page page)
private boolean _isLinkPageValid(Page page)
private boolean _isNodePageValid(Page page, Skin skin)
private boolean _isContainerPageValid(Page page, Skin skin)
private boolean _isZoneItemValid(ZoneItem zoneItem)
public Node addNodeWithUUID(Node srcNode, Node parentNode, String nodeName) throws RepositoryException
srcNode
- the source node.parentNode
- the parent node for the newly created node.nodeName
- the node name to use.RepositoryException
- if an error occurs.public void cloneProperties(Node srcNode, Node clonedNode, Predicate propertyPredicate) throws RepositoryException
srcNode
- the source node.clonedNode
- the cloned node.propertyPredicate
- the property selector.RepositoryException
- if an error occurs.public void cloneContentNodeAndPreserveUUID(Node srcNode, Node clonedNode, Predicate propertyPredicate, Predicate nodePredicate) throws RepositoryException
srcNode
- the source node.clonedNode
- the cloned node.propertyPredicate
- the property selector.nodePredicate
- the node selector.RepositoryException
- if an error occurs.public void cloneContentProperties(Node srcNode, Node clonedNode, Predicate propertyPredicate) throws RepositoryException
srcNode
- the source node.clonedNode
- the cloned node.propertyPredicate
- the property selector.RepositoryException
- if an error occurs.public void cloneNodeAndPreserveUUID(Node srcNode, Node clonedNode, Predicate propertyPredicate, Predicate nodePredicate) throws RepositoryException
srcNode
- the source node.clonedNode
- the cloned node.propertyPredicate
- the property selector.nodePredicate
- the node selector.RepositoryException
- if an error occurs.public void synchronizeContent(Content content, Session liveSession) throws RepositoryException
content
- The content to copyliveSession
- The session for liveRepositoryException
- If an error occurredpublic Node cloneAncestorsAndPreserveUUID(Node srcNode, Session liveSession) throws RepositoryException
srcNode
- the source node.liveSession
- the session to the live workspace.RepositoryException
- if an error occurs.public void cloneEligiblePage(Page page, Skin skin, Session liveSession) throws RepositoryException
page
- the page to clone.skin
- the skin of the page's site.liveSession
- the session to the live workspace.RepositoryException
- if an error occurs.public void orderNode(Node parentNode, String nodeName, Node liveNode) throws RepositoryException
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.RepositoryException
- if an error occurs.public void cloneZones(Node pageNode, Page page, Node liveNode) throws RepositoryException
pageNode
- the JCR Node of the page.page
- the page.liveNode
- the node in the live workspace.RepositoryException
- if an error occurs.public void invalidateHierarchy(Page page, Skin skin, Session liveSession) throws RepositoryException
page
- the page.skin
- the skin of the page's site.liveSession
- the session to the live workspace.RepositoryException
- if an error occurs.public void synchronizePage(Page page, Skin skin, Session liveSession) throws RepositoryException
page
- the page.skin
- the skin of the page's site.liveSession
- the session to the live workspace.RepositoryException
- if an error occurs.private void _sendErrorMailForInfiniteRedirection(Page page)
public void synchronizeACL(Node node, Session liveSession)
node
- The trunk node in default workspaceliveSession
- The live session