Пример #1
0
 public override void Process(ImportItemsArgs args)
 {
     Errors = new List <string>();
     foreach (var item in args.ImportItems)
     {
         ValidateName(item);
     }
     if (Errors.Any())
     {
         args.AddMessage("Invalid item name(s) in import data.");
         args.ErrorDetail = string.Join("\n\n", Errors);
         args.AbortPipeline();
     }
 }
Пример #2
0
        public override void Process(ImportItemsArgs args)
        {
            Log.Info("Sitecore.Foundation.Import:Validating input...", this);
            var argsValid = true;

            if (args.FileStream == null)
            {
                Log.Error("Sitecore.Foundation.Import:Input file not found.", this);
                argsValid = false;
            }
            if (!argsValid)
            {
                args.AddMessage("Error: Input file not found.");
                args.ErrorDetail = "FileStream = null";
                args.AbortPipeline();
            }
        }