Try our conversational search powered by Generative AI!

Class ContentSoftLinkRepository

Repository for working with SoftLink instances.

Inheritance
System.Object
ContentSoftLinkRepository
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[ServiceConfiguration]
public class ContentSoftLinkRepository

Constructors

ContentSoftLinkRepository()

Initializes a new instance of the ContentSoftLinkRepository class.

Declaration
public ContentSoftLinkRepository()

ContentSoftLinkRepository(IPermanentLinkMapper, ServiceAccessor<ContentSoftLinkDB>)

Initializes a new instance of the ContentSoftLinkRepository class.

Declaration
public ContentSoftLinkRepository(IPermanentLinkMapper permanentLinkMapper, ServiceAccessor<ContentSoftLinkDB> softLinkDataAccess)
Parameters
Type Name Description
IPermanentLinkMapper permanentLinkMapper

The permanent link mapper that should be used by this instance and any loaded links.

ServiceAccessor<ContentSoftLinkDB> softLinkDataAccess

An accessor method that retrieves the soft link data access instance that should be used by this instance.

Methods

Appends all the specified SoftLink instances with the same owner page link.

Declaration
public virtual void Append(ContentReference ownerContent, CultureInfo ownerLanguage, IList<SoftLink> links)
Parameters
Type Name Description
ContentReference ownerContent

The owner content link.

System.Globalization.CultureInfo ownerLanguage

The language, specify null to re-save links for all languages

System.Collections.Generic.IList<SoftLink> links

The collection of SoftLink instances.

Delete all softlink references for ownerContent with specific language.

Declaration
public virtual void DeleteLinks(ContentReference ownerContent, string language)
Parameters
Type Name Description
ContentReference ownerContent

The content reference

System.String language

The language

Gets broken links from the database

Declaration
public virtual IEnumerable<SoftLink> GetBrokenLinks(ContentReference root, int skipCount, int maxResults)
Parameters
Type Name Description
ContentReference root

The root item.

System.Int32 skipCount

The skip count.

System.Int32 maxResults

The max results.

Returns
Type Description
System.Collections.Generic.IEnumerable<SoftLink>

GetBrokenLinksCount(ContentReference)

Gets total number of broken links from the database

Declaration
public virtual int GetBrokenLinksCount(ContentReference root)
Parameters
Type Name Description
ContentReference root

The root item.

Returns
Type Description
System.Int32

Number of broken link

Get Unchecked links from the database

Declaration
public virtual IList<SoftLink> GetUncheckedLinks(DateTime lastCheckedDate, TimeSpan ignoreWorkingLinksInterval, int maxNumberOfLinks)
Parameters
Type Name Description
System.DateTime lastCheckedDate

Date when the links were last checked

System.TimeSpan ignoreWorkingLinksInterval

The time back in history where we don't want to recheck working links.

System.Int32 maxNumberOfLinks

Maximum number of links that should be returnd

Returns
Type Description
System.Collections.Generic.IList<SoftLink>

Links that has not been checked prior to the start date

Load(ContentReference)

Loads the links that are being referenced by an content item.

Declaration
public virtual IList<SoftLink> Load(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content item

Returns
Type Description
System.Collections.Generic.IList<SoftLink>

A list of SoftLink instances

Load(ContentReference, Boolean)

Loads the links that are being referenced by or references an content item.

Declaration
public virtual IList<SoftLink> Load(ContentReference contentLink, bool reversed)
Parameters
Type Name Description
ContentReference contentLink

The content item

System.Boolean reversed

If when check should be performed on links pointing to an item instead

Returns
Type Description
System.Collections.Generic.IList<SoftLink>

A list of SoftLink instances

Load(Guid, Boolean)

Loads the links that are being referenced by or references an content item.

Declaration
public virtual IList<SoftLink> Load(Guid contentGuid, bool reversed)
Parameters
Type Name Description
System.Guid contentGuid

The unique id of the content item.

System.Boolean reversed

If when check should be performed on links pointing to an item instead

Returns
Type Description
System.Collections.Generic.IList<SoftLink>

A list of SoftLink instances

Load(String)

Loads the links that reference the file specified with a path.

Declaration
public virtual IList<SoftLink> Load(string path)
Parameters
Type Name Description
System.String path

The path.

Returns
Type Description
System.Collections.Generic.IList<SoftLink>

A collection of SoftLink instances that will contain information about all links that point to the file specified in path.

Load(String, Boolean)

Loads the links that reference the file specified with a path.

Declaration
public virtual IList<SoftLink> Load(string path, bool exactMatch)
Parameters
Type Name Description
System.String path

The path.

System.Boolean exactMatch

if set to true an exact match is required. If set to false only the beginning of the path needs to match.

Returns
Type Description
System.Collections.Generic.IList<SoftLink>

A collection of SoftLink instances that will contain information about all links that point to the file specified in path.

Saves all the specified SoftLink instances with the same owner page link.

Declaration
public virtual void Save(ContentReference ownerContent, CultureInfo ownerLanguage, IList<SoftLink> links)
Parameters
Type Name Description
ContentReference ownerContent

The owner content link.

System.Globalization.CultureInfo ownerLanguage

The language, specify null to re-save links for all languages

System.Collections.Generic.IList<SoftLink> links

The collection of SoftLink instances.

Save softlink status

Declaration
public virtual void SaveLinkStatus(IEnumerable<SoftLink> links)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<SoftLink> links

A list of SoftLink instances

Extension Methods