3

ECL folders are represented by the IContentLibraryItem interface. When you open the ECL folder properties in the CME a MetadataXml object is retrieved. Reading the API documentation of the IContentLibraryItem.MetadatXml and IContentLibraryItem.MetadataXmlSchema methods it looks like ECL folders can have metadata.

When I implement the MetadataXml and MetadataXmlSchema, the CME only shows metadata on ECL file items (IContentLibraryMultimediaItem), not on ECL folder items.

Edit:

I did try this in debug, attached to Tcmservicehost. The methods mentioned above are not called when opening a folder, only when opening a file. So metadata is not implemented for folders, unless I missed something like CanGetMetadata or so but I don't see that in the API doc.

3 Answers 3

3

The Tridion.ExternalContentLibrary.V2 API indeed allows you to add Metadata to IContentLibraryItem (folders), but as you found it doesn't look like the UI extension implements this.

Have you tried to report that as a defect?

4
  • I did not report a defect yet. Wanted to give it some more investigation first. it could be intentionally not implemented or so but the documentation does not reveal that.
    – Jan H
    Oct 17, 2013 at 17:01
  • As far as I remember, this was intentionally. :) But certainly a valid enhancement request. Oct 17, 2013 at 18:31
  • Ok, issue report is submitted.
    – Jan H
    Oct 18, 2013 at 6:48
  • Like Yuri mentioned already. Metadata for folders is designed for in the API but not implemented. The reason why the MetadataXml and MetadataXmlSchema are implemented in IContentLibraryItem and not in IContentLibraryMultimediaItem is to keep the option to implement this in a future release.
    – Jan H
    Oct 30, 2013 at 15:33
2

From an API point of view, as you state in your question, those methods are available for implementation. I just added the following metadata to my ECL Connector on the IContentLibraryItem (Folder) class:

public string MetadataXml
    {
        get
        {
            XNamespace ns = "ecl:FileSystemProvider";
            XElement metadata = new XElement(ns + "FileSystemMetadata");
            metadata.Add(new XElement(ns + "FilePathInServer", FullPath));
            metadata.Add(new XElement(ns + "Size", new FileInfo(FullPath).Length));
            metadata.Add(new XElement(ns + "Extension", "N/A"));

            return metadata.ToString();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    /// <summary>
    /// The metadata Schema definition
    /// </summary>
    public ISchemaDefinition MetadataXmlSchema
    {
        get
        {
            ISchemaDefinition schemaDefinition = FileSystemLibrary.HostServices.CreateSchemaDefinition("FileSystemMetadata", "ecl:FileSystemProvider");
            schemaDefinition.Fields.Add(FileSystemLibrary.HostServices.CreateSingleLineTextFieldDefinition("FilePathInServer", "Original File Path"));
            schemaDefinition.Fields.Add(FileSystemLibrary.HostServices.CreateSingleLineTextFieldDefinition("Size", "Size in Bytes"));
            schemaDefinition.Fields.Add(FileSystemLibrary.HostServices.CreateSingleLineTextFieldDefinition("Extension", "File Extension"));
            return schemaDefinition;
        }
    }

However the UI doesn't seem to call those. You should report that back as Bart recommends.

2

Unfortunately external metadata on a folder is not supported by the current version of ECL

We will definitely think about this for future releases.

1
  • Thanks for your reply Yuri. And congrats on your first answer, I hope many more will follow.
    – Jan H
    Oct 19, 2013 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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