5

I'm trying to replace all the multimedia items uploaded in Tridion for same images stored in an External Content Repository.

We made a WS that we call with the name of the image stored in tridion (f.e. "zzz.jpg") and it returns a XML with the same data that we are receiving in our ECL Provider. With this info, we want to create a new ECL Component in Tridion using Core Service and replace the original multimedia component for the new created.

But I don't know how to create it. I tried to "copy" a stub component created with the ECL provider, but in the url, I saw a .ecl file and I don't know how I can generate it.

Any idea?

Thank you!

8

You should not attempt to create stubs manually though the core service.

The EclService (hosted in the same process as the Core Service) expose the method:

public IDictionary<string, string> CreateOrGetStubUris(IEnumerable<string> eclItemUris)

It will create the Tridion stub components for you (if needed) and return the TCM URIs.

The EclService is a WCF SOAP service like the Core Service, and you can find a generated .net client in your Tridion installation - or create your own client.

  • Thank you. I'll try this. Do you have an example of the client config? I found the dll for ECL client but I cannot find the WS client definition. – Guskermitt Oct 15 '15 at 11:12
  • I do not have a working example, but one of the web.config files in the SDL Tridion\web folder structure must have it (sorry, can remember which one). Look for an endpoint with a name starting with "Ecl". – Lars Møllebjerg Oct 15 '15 at 13:30
  • The url: net.tcp://localhost:2660/ExternalContentLibrary/2012/netTcp – Guskermitt Oct 27 '15 at 11:29
  • @Guskermitt Did you able to create Stubs using ECL service.I am facing the same problem and let me know if you are facing the same problem. – Rahul Kumar Singh Feb 28 '17 at 13:26
  • Yes. I created it using: IEclSession eclSession = SessionFactory.CreateEclSession("MTSUser"); String eclItemID = "ecl:" + pubId + "-bccf-" + hImg.image.id + "-bchi-file"; tcmUri = eclSession.GetOrCreateTcmUriFromEclUri(eclSession.HostServices.CreateEclUri(eclItemID)); – Guskermitt Mar 2 '17 at 15:31
0

To respond Rahul's comment, I used this:

IEclSession eclSession = SessionFactory.CreateEclSession("MTSUser");
String eclItemID = "ecl:" + pubId + "-bccf-" + hImg.image.id + "-bchi-file";
tcmUri = eclSession.GetOrCreateTcmUriFromEclUri(eclSession.HostServices.CreateEclUri(eclItemID));

You have to build an eclItemID that matches with the integration that you made for ECL.

Best regards,

Gustavo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.