Publish details
From ImageVault 5.3 you can trace your published media. You can add a url and/or text that identifies the place where the published file is being used. You can also define a group id to group the publishes of a media in ImageVault.
Note
Old publishes will be shown as "Unknown publishing place". They wont either have a date of publish.
Add Publish details
Normally when using the sdk client to get media you will get a public url but without possability to trace it more than by the publish identifier. By adding PublishDetailsData you can describe where you will use the public url.
// Get public sdk client
var client = ImageVault.Client.ClientFactory.GetSdkClient();
// Fictive content id for place of usage
var contentId = Guid.NewGuid();
// Create a query with publish details
var query = new ImageVault.Common.Data.Query.MediaItemQuery
{
Filter =
{
// Id for media
Id = {27236}
},
Populate =
{
// Original format
MediaFormats =
{
new OriginalFormat()
},
// Add publish info with publish details
PublishInfo = new PublishInfo(client.PublishIdentifier, new PublishDetailsData
{
GroupId = contentId.ToString(),
Text = "Startpage slider images",
Url = "http://mysimplewebsite.com/start"
})
}
};
// Create media service
var mediaService = client.CreateChannel<ImageVault.Common.Services.IMediaService>();
// Execute query
var mediaItem = mediaService.Find(query).Single();
UsedOn query method
UsedOn is an extension for the Query method and can be used for Media or MediaItem. This will set the PublishDetailsData and PublishIdentifier in PublishInfo.
// Get public sdk client
var client = ImageVault.Client.ClientFactory.GetSdkClient();
// Fictive content id for place of usage
var contentId = Guid.NewGuid();
// Get mediaitem
var mediaItem = client.Query<ImageFormat.GalleryImage>().UsedOn(new PublishDetailsData
{
GroupId = contentId.ToString(),
Text = "Startpage slider images",
Url = "http://mysimplewebsite.com/start"
}).FirstOrDefault(mi => mi.Id == 27236);
Get publish details
You can get publish details for a MediaItem by setting PublishDetails to true.
// Get public sdk client
var client = ImageVault.Client.ClientFactory.GetSdkClient();
// Create a query with publish details
var publishDetailsQuery = new ImageVault.Common.Data.Query.MediaItemQuery
{
Filter =
{
// Id for media
Id = {27236}
},
Populate =
{
// Set publish details to true to return publish details
PublishDetails = true
}
};
// Create media service
var mediaService = client.CreateChannel<ImageVault.Common.Services.IMediaService>();
// Execute query
var mediaItemWithPublishDetails = mediaService.Find(publishDetailsQuery).Single();