Implementing IPipe

To implement the IPipe interface, perform the following procedure:

  1. Open the XmlInboundPipe.cs file.
  2. Add the following properties:
    public virtual PipeSettings PipeSettings
    {
        get;
        set;
    }
     
    public virtual string PublishingProviderName
    {
        get
        {
            if (string.IsNullOrEmpty(this.publishingProviderName))
            {
                this.publishingProviderName = Config.Get<PublishingConfig>().DefaultProvider;
            }
            return this.publishingProviderName;
        }
        set
        {
            this.publishingProviderName = value;
        }
    }
     
    public virtual string Name { get { return XmlInboundPipe.PipeName; } }
     
    public virtual IDefinitionField[] Definition
    {
        get
        {
            if (this.definition == null)
            {
                this.definition = PublishingSystemFactory.GetPipeDefinitions(this.Name);
            }
            return this.definition;
        }
    }
     
    public virtual Type PipeSettingsType
    {
        get
        {
            return typeof( PipeSettings );
        }
    }
  3. Add the following methods:
    public virtual IEnumerable<WrapperObject> GetConvertedItemsForMapping(params object[] items)
    {
        throw new NotImplementedException();
    }
     
    public void Initialize(PipeSettings pipeSettings)
    {
        this.PipeSettings = pipeSettings;
        this.publishingPoint = PublishingSystemFactory.GetPublishingPoint(this.PipeSettings.PublishingPoint);
    }
     
    public virtual bool CanProcessItem(object item)
    {
        return false;
    }
     
    public virtual PipeSettings GetDefaultSettings()
    {
        return PublishingSystemFactory.CreatePipeSettings(this.Name, PublishingManager.GetManager(this.PublishingProviderName));
    }
     
    public virtual string GetPipeSettingsShortDescription(PipeSettings initSettings)
    {
        return "Short description of xml inbound pipe";
    }
     
    public virtual void CleanUp( string transactionName )
    {
        throw new NotImplementedException();
    }

Next steps

+1-888-365-2779
sales@sitefinity.com

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK