Exemple #1
0
        private static GenericContent CreateNodeInMemory(ApprovingType approvingType, VersioningType versioningType)
        {
            var content = Content.CreateNew("SystemFolder", Repository.Root, "SystemFolder1");
            var gc      = (GenericContent)content.ContentHandler;

            gc.ApprovingMode  = approvingType;
            gc.VersioningMode = versioningType;
            return(gc);
        }
        private static GenericContent CreateNodeInMemory(ApprovingType approvingType, VersioningType versioningType)
        {
            // do not save the content in this test
            // do not change the parent to TestRoot
            var content = Content.CreateNew("Car", Repository.Root, "car");
            var gc      = content.ContentHandler as GenericContent;

            gc.ApprovingMode  = approvingType;
            gc.VersioningMode = versioningType;

            return(gc);
        }
        public override void SetProperty(string name, object value)
        {
            switch (name)
            {
            case "VersioningMode":
                this.VersioningMode = (VersioningType)value;
                break;

            case "ApprovingMode":
                this.ApprovingMode = (ApprovingType)value;
                break;

            case WORKFLOWSTATUS:
                this.WorkflowStatus = (WorkflowStatusEnum)value;
                break;

            case WORKFLOWDEFINITIONVERSION:
                this.WorkflowDefinitionVersion = (string)value;
                break;

            case WORKFLOWINSTANCEGUID:
                this.WorkflowInstanceGuid = (string)value;
                break;

            case RELATEDCONTENT:
                this.RelatedContent = (Node)value;
                break;

            case RELATEDCONTENTTIMESTAMP:
                this.RelatedContentTimestamp = (long)value;
                break;

            case SYSTEMMESSAGES:
                this.SystemMessages = (string)value;
                break;

            case CONTENTWORKFLOW:
                this.ContentWorkflow = (bool)value;
                break;

            case ABORTONRELATEDCONTENTCHANGE:
                this.AbortOnRelatedContentChange = (bool)value;
                break;

            default:
                base.SetProperty(name, value);
                break;
            }
        }
        public async Task Test_Versioning(VersioningType versioningType, ApprovingType approvingType,
                                          Func <File, Task> action, string expectedEventLog, string subscribedEvents = null)
        {
            File file = null;

            await Test_WebHook(() =>
            {
                file = CreateFile(versioningType, approvingType);
                return(Task.CompletedTask);
            },
                               async() =>
            {
                await action(file);
                return(file);
            },
                               (result, client, subscription) =>
            {
                var eventLog = string.Join(",", client.Requests.Select(r => r.EventName));

                Assert.AreEqual(expectedEventLog, eventLog);
            },
                               subscribedEvents);
        }
 public override void SetProperty(string name, object value)
 {
     switch (name)
     {
         case "VersioningMode":
             this.VersioningMode = (VersioningType)value;
             break;
         case "ApprovingMode":
             this.ApprovingMode = (ApprovingType) value;
             break;
         case WORKFLOWSTATUS:
             this.WorkflowStatus = (WorkflowStatusEnum) value;
             break;
         case WORKFLOWDEFINITIONVERSION:
             this.WorkflowDefinitionVersion = (string)value;
             break;
         case WORKFLOWINSTANCEGUID:
             this.WorkflowInstanceGuid = (string)value;
             break;
         case RELATEDCONTENT:
             this.RelatedContent = (Node)value;
             break;
         case RELATEDCONTENTTIMESTAMP:
             this.RelatedContentTimestamp = (long)value;
             break;
         case SYSTEMMESSAGES:
             this.SystemMessages = (string)value;
             break;
         case CONTENTWORKFLOW:
             this.ContentWorkflow = (bool)value;
             break;
         case ABORTONRELATEDCONTENTCHANGE:
             this.AbortOnRelatedContentChange = (bool)value;
             break;
         default:
             base.SetProperty(name, value);
             break;
     }
 }
        private File CreateFile(VersioningType versioningType = VersioningType.Inherited, ApprovingType approvingType = ApprovingType.False)
        {
            var parent = (RepositoryTools.CreateStructure("/Root/Content/Docs", "DocumentLibrary")
                          ?? Content.Load("/Root/Content/Docs")).ContentHandler;
            var file = new File(parent)
            {
                VersioningMode = versioningType,
                ApprovingMode  = approvingType
            };

            file.Save();

            return(file);
        }
        private static GenericContent CreateNodeInMemory(ApprovingType approvingType, VersioningType versioningType)
        {
            // do not save the content in this test
            // do not change the parent to TestRoot
            var content = Content.CreateNew("Car", Repository.Root, "car");
            var gc = content.ContentHandler as GenericContent;
            gc.ApprovingMode = approvingType;
            gc.VersioningMode = versioningType;

            return gc;
        }