Exemple #1
0
        internal static CMSFile CreateTemporaryFile(IDataStore dataStore, int applicationId, IUserBasic fileOwner, byte[] content, Random random)
        {
            CMSFileManager manager = new CMSFileManager(dataStore);

            CMSFile file = new CMSFile(applicationId, fileOwner, FileType.PostAttachment);

            file.IsTemporary = true;

            file.CMSHeight = random.Next(10, 1000);
            file.CMSWidth  = random.Next(10, 1000);

            file.Content          = content;
            file.ContentSize      = file.Content.Length;
            file.ContentType      = "TEXT " + random.Next(1000, 10000);
            file.FileName         = "Some Name " + random.Next(1000000, 10000000);
            file.FriendlyFileName = "Some Name " + random.Next(1000000, 10000000);
            file.IsTemporary      = false;

            BusinessObjectActionReport <DataRepositoryActionStatus> report = manager.CreateTemporaryFile(file);

            Assert.AreEqual(DataRepositoryActionStatus.Success, report.Status);

            return(file);
        }
Exemple #2
0
 public BusinessObjectActionReport <DataRepositoryActionStatus> CreateTemporaryFile(ArticleAttachment articleAttachment)
 {
     return(_CMSFileManager.CreateTemporaryFile(articleAttachment.CMSFile));
 }
 /// <summary>
 /// Creates the temporary image.
 /// </summary>
 /// <param name="profileImage">The profile image.</param>
 /// <returns></returns>
 public BusinessObjectActionReport <DataRepositoryActionStatus> CreateTemporaryImage(ProfileImage profileImage)
 {
     return(_CMSFileManager.CreateTemporaryFile(profileImage.CMSFile));
 }