Exemple #1
0
        /// <summary>
        /// Method to download uploaded xsn file.
        /// </summary>
        /// <param name="templateName">Stored template name.</param>
        /// <returns></returns>
        public async Task <BlobFileInfo> GetXsnBlobInfo(string templateName)
        {
            var templateRecord = GetTemplateRecord(templateName);

            if (templateRecord == null)
            {
                return(null);
            }

            var instanceId = templateRecord.CurrentInstanceId;

            var instanceRecord = TemplateStorageManager.GetInstanceRecord(templateRecord.TemplateId, instanceId);

            if (instanceRecord == null)
            {
                return(null);
            }

            var templateFileName = instanceRecord.TemplateFileName;

            var manifestBlobInfo = await TemplateStorageManager.GetTemplateFile(instanceId, templateFileName);

            if (manifestBlobInfo != null)
            {
                manifestBlobInfo.FileName = instanceRecord.XsnOrginalFileName;
            }

            return(manifestBlobInfo);
        }
Exemple #2
0
        public async Task <ManifestFileWithProperties> GetManifestForTemplateName(string templateName)
        {
            var templateRecord = GetTemplateRecord(templateName);

            if (templateRecord == null)
            {
                return(null);
            }

            var instanceId = templateRecord.CurrentInstanceId;

            var instanceRecord = TemplateStorageManager.GetInstanceRecord(templateRecord.TemplateId, instanceId);

            if (instanceRecord == null)
            {
                return(null);
            }

            var manifestFileName = instanceRecord.ManifestFileName;

            var manifestBlobInfo = await TemplateStorageManager.GetTemplateFile(instanceId, manifestFileName);

            var manifestContents = await GetFileContents(manifestBlobInfo.FileStream);

            var formProperties = new FormPropertyList();

            formProperties.Add("templateName", templateName);
            formProperties.Add("instanceId", instanceId);

            var manifest = new ManifestFileWithProperties(formProperties,
                                                          new FormFile(manifestFileName, manifestContents));

            return(manifest);
        }