Exemple #1
0
        public void Process(GetContentEditorWarningsArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (args.Item != null)
            {
                IExportExecuter exportExecuter = MediaFrameworkContext.GetExportExecuter(args.Item);
                if (exportExecuter != null && exportExecuter.IsNew(args.Item))
                {
                    args.Add(Translate.Text(Translations.NotExportedWarningTitle), Translate.Text(Translations.NotExportedWarningText));
                }
            }
        }
        public static bool ExportUpdate(this Item item, SaveArgs.SaveItem saveItem = null)
        {
            if (item == null)
            {
                return(false);
            }

            IExportExecuter executer = MediaFrameworkContext.GetExportExecuter(item);

            if (executer != null && !item.ExportCreate() && (saveItem == null || executer.NeedToUpdate(saveItem)))
            {
                ExportQueueManager.Add(new ExportOperation(item, ExportOperationType.Update));
                return(true);
            }
            return(false);
        }
        public static bool ExportDelete(this Item item)
        {
            if (item == null)
            {
                return(false);
            }

            IExportExecuter executer = MediaFrameworkContext.GetExportExecuter(item);

            if (executer != null && !executer.IsNew(item))
            {
                ExportQueueManager.Add(new ExportOperation(item, ExportOperationType.Delete));
                return(true);
            }
            return(false);
        }
        public static bool ExportCreate(this Item item)
        {
            if (item == null)
            {
                return(false);
            }

            IExportExecuter executer = MediaFrameworkContext.GetExportExecuter(item);

            if (executer != null && executer.IsNew(item))
            {
                executer.Export(new ExportOperation(item, ExportOperationType.Create));
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Ingests items
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        public override void Process(MediaItemExportArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Operation, "args.Operation");

            try
            {
                IExportExecuter executer = MediaFrameworkContext.GetExportExecuter(args.Operation.Item);
                if (executer != null)
                {
                    executer.Export(args.Operation);
                }
                else
                {
                    args.AbortPipeline();
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error("Sync failed.", this, ex);
                args.AbortPipeline();
            }
        }