public void ScheduleReparentAndReorderArtifactsCheck(SqlDraftAndLatestItem item, ISet <int> artifactIds)
        {
            if (!IsArtifact(item))
            {
                return;
            }

            // need to verify parent
            if (item.DraftParentId != item.DraftProjectId &&
                !artifactIds.Contains(item.DraftParentId) &&
                (IsNew(item) || IsParentChanged(item)))
            {
                ICollection <SqlDraftAndLatestItem> dependencies;
                if (!_checkParents.TryGetValue(item.DraftParentId, out dependencies))
                {
                    dependencies = new List <SqlDraftAndLatestItem>();
                    _checkParents.Add(item.DraftParentId, dependencies);
                }
                dependencies.Add(item);
            }

            if (item.DraftOrderIndex != -1.0 &&
                (IsNew(item) || IsOrderIndexChanged(item)))
            {
                _checkOrderIndex.Add(item, item.DraftParentId);
            }
        }
Beispiel #2
0
 private bool IsChanged(SqlDraftAndLatestItem item)
 {
     return(item.LatestVersionId.HasValue == false || // new item
            item.DraftItemTypeId != item.LatestItemTypeId ||
            item.DraftParentId != item.LatestParentId ||
            item.DraftOrderIndex != item.LatestOrderIndex ||
            item.DraftDeleted ||
            item.DraftName != item.LatestName ||
            item.DraftWorkflowStateId != item.LatestWorkflowStateId);
 }
 private bool IsArtifact(SqlDraftAndLatestItem item)
 {
     return(item.ArtifactId == item.ItemId);
 }
 private bool IsNew(SqlDraftAndLatestItem item)
 {
     return(!item.LatestVersionId.HasValue);
 }
 private bool IsParentChanged(SqlDraftAndLatestItem item)
 {
     return(item.LatestVersionId.HasValue &&
            item.LatestParentId != item.DraftParentId);
 }
 private bool IsOrderIndexChanged(SqlDraftAndLatestItem item)
 {
     return(item.LatestVersionId.HasValue &&
            item.LatestOrderIndex != item.DraftOrderIndex);
 }
Beispiel #7
0
 private void RegisterItemModification(ReuseSensitivityCollector sensitivityCollector, SqlDraftAndLatestItem item)
 {
     if (IsSubArtifactChange(item))
     {
         sensitivityCollector.RegisterArtifactModification(item.ArtifactId,
                                                           ItemTypeReuseTemplateSetting.Subartifacts);
     }
 }