public ListItem(IEclUri ecluri, S3Info info) { Info = info; if (Info.ContentType == "Folder") { string itemId = Info.Name; String.Format(itemId); _id = S3Provider.HostServices.CreateEclUri(ecluri.PublicationId, S3Provider.MountPointId, itemId, DisplayTypeId, EclItemTypes.Folder); } else { string itemId = Info.Name; _id = S3Provider.HostServices.CreateEclUri(ecluri.PublicationId, S3Provider.MountPointId, itemId, DisplayTypeId, EclItemTypes.File); } }
public IFolderContent Search(IEclUri contextUri, string searchTerm, int pageIndex, int numberOfItems) { if (searchTerm != null) { List <IContentLibraryListItem> items = new List <IContentLibraryListItem>(); InfoList = S3Provider.S3.SearchInS3(contextUri, contextUri.ItemType, searchTerm); foreach (S3Info info in InfoList) { Info = info; items.Add(new ListItem(contextUri, info)); } return(S3Provider.HostServices.CreateFolderContent(contextUri, items, CanGetUploadMultimediaItemsUrl(contextUri.PublicationId), true)); } throw new NotSupportedException(); }
public IFolderContent GetFolderContent(IEclUri parentFolderUri, int pageIndex, EclItemTypes itemTypes) { bool canSearch = false; if (parentFolderUri.ItemId == "root") { canSearch = true; } List <IContentLibraryListItem> items = new List <IContentLibraryListItem>(); InfoList = S3Provider.S3.GetDirectories(parentFolderUri, itemTypes); foreach (S3Info info in InfoList) { Info = info; items.Add(new ListItem(parentFolderUri, info)); } return(S3Provider.HostServices.CreateFolderContent(parentFolderUri, items, CanGetUploadMultimediaItemsUrl(parentFolderUri.PublicationId), canSearch)); }
/// <summary> /// Setup the S3 Client with the user credentials and the correct S3 Configuation. /// </summary> /// <param name="accessKeyID"></param> /// <param name="secretAccessKey"></param> //public void Setup(string accessKeyID, string secretAccessKey) //{ // _s3Config = new AmazonS3Config() { RegionEndpoint = Amazon.RegionEndpoint.EUWest1 }; // s3Client = AWSClientFactory.CreateAmazonS3Client(accessKeyID, secretAccessKey, _s3Config); // _accessKeyID = accessKeyID; // _secretAccessKey = secretAccessKey; //} public void Setup(S3Info s3) { try { // enable clock skew correction since it defaults to false (should always be true though) if (!AWSConfigs.CorrectForClockSkew) { AWSConfigs.CorrectForClockSkew = true; } // set the standard us region endpoint. _s3Config = new AmazonS3Config(); _s3Config.ProgressUpdateInterval = 2 * 100 * 1024; // fire progress update event every 200 KB. _s3Config.RegionEndpoint = Amazon.RegionEndpoint.GetBySystemName(s3.Region); s3Client = new AmazonS3Client(s3.TokenAccessKey, s3.TokenSecretKey, s3.TokenSession, _s3Config); } catch (Exception) { throw; } }
public S3MediaSet(IEclUri ecluri, S3Info info) : base(ecluri, info) { // if info needs to be fully loaded, do so here }
public S3Media(IEclUri ecluri, S3Info info) : base(ecluri, info) { }