Add related media to WrapperObject, Custom RSSInboundPipe

Posted by Community Admin on 04-Aug-2018 17:24

Add related media to WrapperObject, Custom RSSInboundPipe

All Replies

Posted by Community Admin on 01-Aug-2014 00:00

Hi,

I’m importing news items from external RSS feed (SF site) which has thumbnail URL in it. I have implemented custom RSSInboundPipe and overridden ConvertToWraperObject method. Here I need
to add image to the WrapperObject which will fill related media field in News module.

public override WrapperObject ConvertToWraperObject(System.ServiceModel.Syndication.SyndicationItem item)
    WrapperObject obj = new WrapperObject(null);
    obj.MappingSettings = this.PipeSettings.Mappings;
    obj.Language = this.PipeSettings.LanguageIds.FirstOrDefault();
    // Need to do something like this
    // obj.CreateRelation(image, "Thumbnail");

Posted by Community Admin on 02-Aug-2014 00:00

Anyone?

Posted by Community Admin on 11-Aug-2014 00:00

Hello Saad,

As we have discussed in the support thread you had opened, in the ConvertToWraperObject() method you need to add the properties using obj.AddProperty() method. You may refer to the following article for more details on this.

In addition to this, you will need also to override the ContentOutboundPipe class and to override the SetPropertiesThroughPropertyDescriptor() method where you can set the properties through the property descriptor. You can call the base method and after that you can add your custom logic for setting your custom properties:

public class ContentOutboundPipeCustom : ContentOutboundPipe
    
        protected override void SetPropertiesThroughPropertyDescriptor(Telerik.Sitefinity.Model.IContent item, Telerik.Sitefinity.Publishing.WrapperObject wrapperObj)
        
            base.SetPropertiesThroughPropertyDescriptor(item, wrapperObj);
   
                    // your custom logic goes here
        
    


Regards,
Sabrie Nedzhip
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed