Custom Content Provider Media

Vote:
 

I'm planning to develop a custom content provider that will expose media located at an external source. I think the media will be only documents and you should be able to navigate the complete tree structure from the external source and see eventual documents located in each folder.

Is the best approach to inherit MediaRepositoryDescriptor and the Documents to inherit MediaData? And also to use base("epi-cms/widget/HierarchicalList") for the component?

I would like for the documents to be able to be dragged-and-dropped from the widget as well as being selected from the content selector-dialog.

Another issue I'm not sure of is how to handle if the media is removed from the external source, will the broken link be caught by the link validator job or do you need to implement something to take care of this? 

#184441
Edited, Oct 26, 2017 20:58
Vote:
 

I have done a test where the type Document inherits from MediaData. When I open up the Content Selector I can see the documents but it's not possible to select any.

If I drag-and-drop the document into a list with link items the href is relative and it thinks it's located in Media. So it will return a 404-page.

What am I missing?

Thanks in advance!

#184531
Oct 30, 2017 16:13
Vote:
 

Did you figure this out?
I am looking to do something similar just for product images.

I have been looking at writing a content provider: https://world.episerver.com/blogs/Per-Magne-Skuseth/Dates/2014/11/content-providers-101--part-i-introduction-initialization-ui--identity-mapping/ 

#185250
Nov 13, 2017 15:36
Vote:
 

You should check out the local media provider: https://world.episerver.com/blogs/Johan-Bjornfot/Dates1/2014/8/LocalMediaProvider/

#185271
Nov 14, 2017 7:50
Vote:
 

The document in episerver edit mode says that it's not published yet, even though I'm doing this in code:

versionable.Status = VersionStatus.Published;

versionable.IsPendingPublish = false;

versionable.StartPublish = createdDate;

I'm suspecting that this is the reason why it's not selectable?

#185288
Nov 14, 2017 15:01
Vote:
 

The reason that the items weren't selectable in dialogs where that parentlink was wrong.

I'm using MediaRepositoryDescriptor

Component base("epi-cms/component/Media") 

My custom class inherits MediaData.

#185329
Nov 15, 2017 13:59
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.