org.alfresco.repo.avm
Class AVMSyncServiceImpl

java.lang.Object
  extended by org.alfresco.repo.avm.AVMSyncServiceImpl
All Implemented Interfaces:
AVMSyncService

public class AVMSyncServiceImpl
extends java.lang.Object
implements AVMSyncService

This implements APIs that allow comparison and synchronization of node trees as well as cumulative operations on layers to support various content production models.


Constructor Summary
AVMSyncServiceImpl()
          Do nothing constructor.
 
Method Summary
 java.util.List compare(int srcVersion, java.lang.String srcPath, int dstVersion, java.lang.String dstPath, org.alfresco.util.NameMatcher excluder)
          Get a difference list between two corresponding node trees.
 void flatten(java.lang.String layerPath, java.lang.String underlyingPath)
          Flattens a layer so that all all nodes under and including layerPath become translucent to any nodes in the corresponding location under and including underlyingPath that are the same version.
 void resetLayer(java.lang.String layerPath)
          Takes a layer, deletes it and recreates it pointing at the same underlying node.
 void setAvmRepository(AVMRepository avmRepository)
           
 void setAvmService(AVMService avmService)
          Set the AVM Service.
 void setPermissionService(org.alfresco.service.cmr.security.PermissionService service)
           
 void update(java.util.List diffList, org.alfresco.util.NameMatcher excluder, boolean ignoreConflicts, boolean ignoreOlder, boolean overrideConflicts, boolean overrideOlder, java.lang.String tag, java.lang.String description)
          Updates the destination nodes in the AVMDifferences with the source nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AVMSyncServiceImpl

public AVMSyncServiceImpl()
Do nothing constructor.

Method Detail

setAvmService

public void setAvmService(AVMService avmService)
Set the AVM Service. For Spring.

Parameters:
avmService - The AVMService reference.

setAvmRepository

public void setAvmRepository(AVMRepository avmRepository)

setPermissionService

public void setPermissionService(org.alfresco.service.cmr.security.PermissionService service)

compare

public java.util.List compare(int srcVersion,
                              java.lang.String srcPath,
                              int dstVersion,
                              java.lang.String dstPath,
                              org.alfresco.util.NameMatcher excluder)
Get a difference list between two corresponding node trees.

Specified by:
compare in interface AVMSyncService
Parameters:
srcVersion - The version id for the source tree.
srcPath - The avm path to the source tree.
dstVersion - The version id for the destination tree.
dstPath - The avm path to the destination tree.
excluder - A NameMatcher used to exclude files from consideration.
Returns:
A List of AVMDifference structs which can be used for the update operation.

update

public void update(java.util.List diffList,
                   org.alfresco.util.NameMatcher excluder,
                   boolean ignoreConflicts,
                   boolean ignoreOlder,
                   boolean overrideConflicts,
                   boolean overrideOlder,
                   java.lang.String tag,
                   java.lang.String description)
Updates the destination nodes in the AVMDifferences with the source nodes. Normally any conflicts or cases in which the source of an AVMDifference is older than the destination will cause the transaction to roll back.

Specified by:
update in interface AVMSyncService
Parameters:
diffList - A List of AVMDifference structs.
excluder - A possibly null name matcher to exclude unwanted updates.
ignoreConflicts - If this is true the update will skip those AVMDifferences which are in conflict with the destination.
ignoreOlder - If this is true the update will skip those AVMDifferences which have the source older than the destination.
overrideConflicts - If this is true the update will override conflicting AVMDifferences and replace the destination with the conflicting source.
overrideOlder - If this is true the update will override AVMDifferences
tag - Short update blurb.
description - Full update blurb. in which the source is older than the destination and overwrite the destination.

flatten

public void flatten(java.lang.String layerPath,
                    java.lang.String underlyingPath)
Flattens a layer so that all all nodes under and including layerPath become translucent to any nodes in the corresponding location under and including underlyingPath that are the same version.

Specified by:
flatten in interface AVMSyncService
Parameters:
layerPath - The overlying layer path.
underlyingPath - The underlying path.

resetLayer

public void resetLayer(java.lang.String layerPath)
Takes a layer, deletes it and recreates it pointing at the same underlying node. Any changes in the layer are lost (except to history if the layer has been snapshotted.) NB: fixed to respect permissions and allow reset end preview sandboxes by finding all direct children and flattening

Specified by:
resetLayer in interface AVMSyncService
Parameters:
layerPath -


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.