Example #1
0
        public static List <FluentJdf.Transmission.FileTransmissionItem> GetFileTransmissionItem(string encoderId)
        {
            var message = GetMessage();

            string name = string.Format("JMF{0}", Infrastructure.Core.Helpers.MimeTypeHelper.JmfExtension);
            var    transmissionPartCollection = new TransmissionPartCollection();

            transmissionPartCollection.Add(new MessageTransmissionPart(message, name));
            transmissionPartCollection.AddRange(message.AdditionalParts);

            var encoder = FluentJdf.Configuration.FluentJdfLibrary.Settings.EncodingSettings.FileTransmitterEncoders
                          .FirstOrDefault(item => item.Value.Id.Equals(encoderId, StringComparison.OrdinalIgnoreCase)).Value;

            return(encoder.PrepareTransmission(transmissionPartCollection, new TransmissionPartFactory(), new EncodingFactory(), new TransmissionLogger()).OrderBy(item => item.Order).ToList());
        }
Example #2
0
        /// <summary>
        /// Transmit this ticket to the given url.
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public IJmfResult Transmit(Uri url)
        {
            try {
                //todo: add packaging options

                string name = string.Format("JMF{0}", MimeTypeHelper.JmfExtension);
                using (var transmissionPartCollection = new TransmissionPartCollection()) {
                    transmissionPartCollection.Add(new MessageTransmissionPart(this, name));
                    transmissionPartCollection.AddRange(additionalParts);
                    return(transmitterFactory.GetTransmitterForUrl(url).Transmit(url, transmissionPartCollection));
                }
            }
            catch (Exception err) {
                logger.Error(string.Format(Messages.Ticket_Transmit_Failed, url), err);
                throw;
            }
        }
Example #3
0
 /// <summary>
 /// Creates an empty success result
 /// </summary>
 public JmfResult()
 {
     Details = new List <IJmfResultDetail>();
     TransmissionPartCollection = new TransmissionPartCollection();
 }