Beispiel #1
0
        private string GetSolictZipFile(List <KeyValuePair <string, DateTime> > docPaths)
        {
            if ((docPaths.Count == 1) &&
                (CommonContentAndFormatProvider.GetFileTypeFromName(docPaths[0].Key) == CommonContentType.ZIP))
            {
                AppendAuditLogEvent("Added document \"{0}\" to solicit request",
                                    docPaths[0].Key);
                return(docPaths[0].Key); // Single file and already zipped
            }
            ISettingsProvider  settingsProvider;
            ICompressionHelper compressionHelper;

            GetServiceImplementation(out settingsProvider);
            GetServiceImplementation(out compressionHelper);

            List <string> files = new List <string>(docPaths.Count);

            foreach (KeyValuePair <string, DateTime> pair in docPaths)
            {
                AppendAuditLogEvent("Added document \"{0}\" to solicit request",
                                    pair.Key);
                files.Add(pair.Key);
            }
            string tempFile = settingsProvider.NewTempFilePath(".zip");

            compressionHelper.CompressFiles(tempFile, files);
            return(tempFile);
        }
Beispiel #2
0
        protected virtual string AddDocument(string transactionId, CommonTransactionStatusCode status,
                                             string statusDetail, string filePath, bool dontAutoCompress)
        {
            string   docName = Path.GetFileName(filePath);
            Document doc     =
                new Document(docName, CommonContentAndFormatProvider.GetFileTypeFromName(docName),
                             File.ReadAllBytes(filePath));

            doc.DontAutoCompress = dontAutoCompress;
            return(AddDocument(transactionId, status, statusDetail, doc));
        }
Beispiel #3
0
        public string[] DownloadByName(string flow, string transactionId, params string[] documentNames)
        {
            if (CollectionUtils.IsNullOrEmpty(documentNames))
            {
                throw new ArgumentException("documentNames cannot be empty");
            }
            Windsor.Node.Proxy11.WSDL.NodeDocument[] documents = new Windsor.Node.Proxy11.WSDL.NodeDocument[documentNames.Length];

            for (int i = 0; i < documentNames.Length; ++i)
            {
                Windsor.Node.Proxy11.WSDL.NodeDocument document = new Windsor.Node.Proxy11.WSDL.NodeDocument();
                document.name = documentNames[i];
                CommonContentType type = CommonContentAndFormatProvider.GetFileTypeFromName(document.name);
                if (type == CommonContentType.OTHER)
                {
                    type = CommonContentType.XML;   // Assume XML
                }
                document.type = type.ToString();
                documents[i]  = document;
            }
            _requestor.Download(Authenticate(), transactionId, flow, ref documents);
            return(SaveDownloadedDocuments(documents, null));
            //throw new InvalidOperationException("DownloadByName() is not a valid method call for Client11");
        }
 public PaginatedContentResult(string filePath) :
     this(0, -1, true, CommonContentAndFormatProvider.GetFileTypeFromName(filePath),
          File.ReadAllBytes(filePath))
 {
 }