Exemple #1
0
        protected void ViewRenditions(string renditionDirectory, List <string> idsWithRenditions, bool openDocument)
        {
            int renditionNumber = 0;

            foreach (string objectId in idsWithRenditions)
            {
                renditionNumber++;
                Document doc = CurrentRepository.GetSysObjectById <Document>(objectId); //.getDocumentByQualification(
                //String.Format("dm_document where r_object_id = '{0}'", objectId), null);

                ContentMeta renditionMeta = doc.GetRenditionByModifier("Test");
                if (renditionMeta == null)
                {
                    WriteOutput("!!!!!!!!!!!!!!!!RENDITION VIEW TEST FAILURE!!!!!!!!!!!!!!!!!!!!");
                    return;
                }
                FileInfo downloadedContentFile = renditionMeta.DownloadContentMediaFile();
                if (!Directory.Exists(renditionDirectory))
                {
                    Directory.CreateDirectory(renditionDirectory);
                }
                downloadedContentFile.MoveTo(renditionDirectory + Path.DirectorySeparatorChar + objectId + "-" + renditionNumber + "-" + downloadedContentFile.Name);
                WriteOutput("\t\t[ViewRendition] - Rendition file is located: " + downloadedContentFile.FullName);
                if (openDocument)
                {
                    System.Diagnostics.Process.Start(downloadedContentFile.FullName);
                }
            }
        }
Exemple #2
0
        public void ViewDocument(String path, DocumentTracker tracker, bool openDocument)
        {
            Document doc = CurrentRepository.GetSysObjectById <Document>(tracker.DocumentId);

            ContentMeta contentMeta = doc.GetPrimaryContent(new SingleGetOptions {
                View = ":all"
            });

            if (contentMeta == null)
            {
                WriteOutput("!!!!!!!!!!!!!!!!VIEW TEST FAILURE!!!!!!!!!!!!!!!!!!!!");
                return;
            }
            FileInfo downloadedContentFile = contentMeta.DownloadContentMediaFile();

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            downloadedContentFile.MoveTo(path + Path.DirectorySeparatorChar + tracker.ChildId + "-" + downloadedContentFile.Name);
            WriteOutput("\t\t[GetFileForView] - RestDocument file is located: " + downloadedContentFile.FullName);
            if (openDocument)
            {
                System.Diagnostics.Process.Start(downloadedContentFile.FullName);
            }
        }