November Happy Hour will be moved to Thursday December 5th.

ImageVault 4 MetaData

Vote:
 

How can you retrieve MetaData when using the property MediaReferenceList in Episerver CMS 7 MVC

#75640
Oct 02, 2013 10:34
Vote:
 

I would recommend to use a custom class where you define all metadata and formats you would like to retrieve.

public class MyMedia : MediaItem {
[Metadata("Title")] public string Title { getset; } [ResizeEffect(150,150,ResizeMode.ScaleToFill)] public Thumbnail Thumbnail { getset; } }

Then I would use this class to retrieve the media based on the selected data in the MediaReferenceList.

var client = ClientFactory.GetSdkClient();
var
 mediaList = client.Load<MyMedia>(mediaReferenceList.Select(m => m.Id)).ToList();

You can see more examples at

http://imagevault.se/en/documentation/api-documentation/?page=csharp/examples/querying-mediaitems/metadata/retrieving.html

http://imagevault.se/en/documentation/api-documentation/?page=csharp/examples/querying-mediaitems/formats/webmediaformat.html

http://imagevault.se/en/documentation/api-documentation/?page=episerverplugin/propertymedialist.html

/Dan

 

#75644
Edited, Oct 02, 2013 11:57
Vote:
 

For further questions about ImageVault you can access the ImageVault forum here at episerver world

http://world.episerver.com/Modules/Forum/Pages/Forum.aspx?id=73302&epslanguage=en

You'll get better attention there.

/Dan

#75645
Oct 02, 2013 11:59
Vote:
 

When i try to implement the class i get this error message

"cannot access protected constructor 'MetaData' here"

 

any ideas?

#75646
Oct 02, 2013 12:07
Vote:
 

You have to use the following using statements

 

using ImageVault.Client;
using ImageVault.Client.Descriptors;
using ImageVault.Client.Descriptors.Effects;
using ImageVault.Common.Data;
#75649
Oct 02, 2013 13:18
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.