I'm trying to create an S3 ECL Provider...But I'm not sure how to create the connection. I'm on .NET Framework 4.5.2 and SDL Web8.1
I have two possible ways:
1)
AmazonS3Config config = new AmazonS3Config()
{
ServiceURL = serviceUrl,
};
S3 = new AmazonS3Client(
mountpointConfig.Element(S3AccessId).Value,
mountpointConfig.Element(S3SecretKey).Value,
amazonS3Config
);
2)
AmazonS3Client S3 = new Amazon.S3.AmazonS3Client(
config.Element(S3BucketName).Value,
config.Element(S3SecretKey).Value,
config.Element(S3AccessId).Value)
config.Element(FullBucketUrl).Value
);
I'm trying to follow the article here but there are errors and empty gaps...like
In S3Item.cs I see something that seems to be a constructor but named S3MediaSet, Is that intended to be a constructor (and should be named S3Item) or a method that should have return type?
Also in S3Provider I don’t get S3 propery (in Initialize method) of what type is it, AmazonS3Client? If so then S3Content.GetViewItemUrl has a call to S3Provider.S3.GetMediaUrl which doesn’t exist in AmazonS3Client.
Does someone has a complete sample code on how to create an S3 ECL Provider for Tridion that can share please?
Thanks in advance.
UPDATE
This is the log I'm getting
2017-07-19 16:29:38,960 [37] DEBUG UI.DataExtenders - Process response for command 'GetListActivityInstances' id=''
2017-07-19 16:29:38,960 [37] DEBUG UI.DataExtenders - Updating element 'tcm:ListActivityInstances'
2017-07-19 16:29:42,621 [37] DEBUG UI.DataExtenders - Process request for command 'GetList' id='tcm:0-287-1'
2017-07-19 16:29:43,379 [37] DEBUG UI.DataExtenders - Process responce for command 'GetList' id='tcm:0-287-1'
2017-07-19 16:29:46,219 [36] DEBUG UI.DataExtenders - Process request for command 'GetList' id='ecl:287-s3-root-mp-mountpoint'
2017-07-19 16:29:46,715 [37] DEBUG UI.DataExtenders - Process request for command 'GetList' id='ecl:287-s3-root-mp-mountpoint'
2017-07-19 16:29:46,755 [37] ERROR UI.Model -
System.Exception: Unable to get the list of items ---> System.ServiceModel.FaultException1[System.ServiceModel.ExceptionDetail]: Failed initializing the External Content Library with id s3.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Tridion.ExternalContentLibrary.Service.Client.ISessionAwareEclService.GetList(String parentItemUri, Int32 pageIndex, EclItemTypes itemTypes, IEnumerable
1 basedOnSchema)
at Tridion.ExternalContentLibrary.UI.Model.Services.GeneralImpl.GetList(String id, Int32 pageIndex, Filter filter, Int32 columns)
--- End of inner exception stack trace ---
at Tridion.ExternalContentLibrary.UI.Model.Services.GeneralImpl.GetList(String id, Int32 pageIndex, Filter filter, Int32 columns)
at Tridion.ExternalContentLibrary.UI.Model.Services.General.GetList(String id, Int32 pageIndex, Filter filter, Int32 columns)
at SyncInvokeGetList(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Tridion.Web.UI.Core.Extensibility.DataExtenderOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
2017-07-19 16:29:46,756 [36] ERROR UI.Model -
System.Exception: Unable to get the list of items ---> System.ServiceModel.FaultException1[System.ServiceModel.ExceptionDetail]: Failed initializing the External Content Library with id s3.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Tridion.ExternalContentLibrary.Service.Client.ISessionAwareEclService.GetList(String parentItemUri, Int32 pageIndex, EclItemTypes itemTypes, IEnumerable
1 basedOnSchema)
at Tridion.ExternalContentLibrary.UI.Model.Services.GeneralImpl.GetList(String id, Int32 pageIndex, Filter filter, Int32 columns)
--- End of inner exception stack trace ---
at Tridion.ExternalContentLibrary.UI.Model.Services.GeneralImpl.GetList(String id, Int32 pageIndex, Filter filter, Int32 columns)
at Tridion.ExternalContentLibrary.UI.Model.Services.General.GetList(String id, Int32 pageIndex, Filter filter, Int32 columns)
at SyncInvokeGetList(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Tridion.Web.UI.Core.Extensibility.DataExtenderOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
2017-07-19 16:29:47,125 [36] DEBUG UI.DataExtenders - Process response for command 'GetListActivityInstances' id=''
2017-07-19 16:29:47,125 [36] DEBUG UI.DataExtenders - Updating element 'tcm:ListActivityInstances'
2017-07-19 16:29:53,854 [36] DEBUG UI.DataExtenders - Process response for command 'GetListActivityInstances' id=''
2017-07-19 16:29:53,854 [36] DEBUG UI.DataExtenders - Updating element 'tcm:ListActivityInstances'