Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johannes Lantz 156 posts 839 karma points c-trib
    Nov 23, 2023 @ 09:06
    Johannes Lantz
    0

    Custom handler notification

    Hello!

    I am writing my own handler and I've been looking at the uSync-vender and uSync umbraco forms packages. It seems that the notifications are a bit different. uSync-vendr seems to use

     ExportDeletedItem(item, Path.Combine(rootFolder, DefaultFolder), DefaultConfig);
    

    And

    Export(item, Path.Combine(rootFolder, DefaultFolder), DefaultConfig);
    

    While uSync umbraco forms uses

            var filename = GetPath(Path.Combine(rootFolder, this.DefaultFolder), form,
                DefaultConfig.GuidNames, DefaultConfig.UseFlatStructure);
    
            var attempt = serializer.SerializeEmpty(form, SyncActionType.Delete, string.Empty);
            if (attempt.Success)
            {
                syncFileService.SaveXElement(attempt.Item, filename);
                this.CleanUp(form, filename, Path.Combine(rootFolder, DefaultFolder));
            }
    

    And

                var attempts = this.Export(form, Path.Combine(rootFolder, this.DefaultFolder), DefaultConfig);
                foreach (var attempt in attempts.Where(x => x.Success))
                {
                    this.CleanUp(form, attempt.FileName, Path.Combine(rootFolder, this.DefaultFolder));
                }
    

    Whats differs the two? And which one should I use?

    //Johannes

Please Sign in or register to post replies

Write your reply to:

Draft