Class FilterPublished
Filter to remove pages based on published status.
Inherited Members
Namespace: EPiServer.Filters
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class FilterPublished : PageFilterBase, IPageFilter, IContentFilter
Constructors
FilterPublished()
Default constructor.
Declaration
public FilterPublished()
Remarks
Will create a filter with filter condition PagePublishedStatus.Published.
FilterPublished(IPublishedStateAssessor)
Initializes a new instance of the FilterPublished class.
Declaration
public FilterPublished(IPublishedStateAssessor publishedStateAssessor)
Parameters
Type | Name | Description |
---|---|---|
IPublishedStateAssessor | publishedStateAssessor | The publish status validator used to validate the published state. |
FilterPublished(PagePublishedStatus)
Create filter with the given filter condition.
Declaration
public FilterPublished(PagePublishedStatus publishedStatus)
Parameters
Type | Name | Description |
---|---|---|
PagePublishedStatus | publishedStatus | The published status that pages should have to remain after this filter has executed. |
FilterPublished(PagePublishedStatus, IContentRepository)
Create filter with the given filter condition.
Declaration
[Obsolete("Use another constructor without the content repository dependency.")]
public FilterPublished(PagePublishedStatus publishedStatus, IContentRepository contentRepository)
Parameters
Type | Name | Description |
---|---|---|
PagePublishedStatus | publishedStatus | The published status that pages should have to remain after this filter has executed. |
IContentRepository | contentRepository | The IContentRepository instance to use |
FilterPublished(IContentRepository)
Default constructor.
Declaration
[Obsolete("Use another constructor without the content repository dependency.")]
public FilterPublished(IContentRepository contentRepository)
Parameters
Type | Name | Description |
---|---|---|
IContentRepository | contentRepository | The IContentRepository instance to use |
Remarks
Will create a filter with filter condition PagePublishedStatus.Published.
Properties
PublishedStatus
Gets or sets the filter condition to use.
Declaration
public PagePublishedStatus PublishedStatus { get; set; }
Property Value
Type | Description |
---|---|
PagePublishedStatus |
Methods
CheckPublishedStatus(IContent, PagePublishedStatus)
Indicates whether the page should be displayed based on publish date.
Declaration
[Obsolete("Use class PublishedStateAssessor or IPublishedStateAssessor to check the published state of content.")]
public static bool CheckPublishedStatus(IContent content, PagePublishedStatus status)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The content. |
PagePublishedStatus | status | The type of publish status to check against. |
Returns
Type | Description |
---|---|
System.Boolean | True if the content should be displayed. |
Remarks
Used internally to filter pages in listings. You should usually not need to refer to this method directly.
CheckPublishedStatus(IContent, PagePublishedStatus, IContentLoader, Nullable<DateTime>)
Indicates whether the content should be displayed based on publish date.
Declaration
[Obsolete("Use class PublishedStateAssessor or IPublishedStateAssessor to check the published state of content.")]
public static bool CheckPublishedStatus(IContent content, PagePublishedStatus status, IContentLoader contentLoader, DateTime? requestTime)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The content. |
PagePublishedStatus | status | The type of publish status to check against. |
IContentLoader | contentLoader | The IContentLoader instance to use |
System.Nullable<System.DateTime> | requestTime | The request time. |
Returns
Type | Description |
---|---|
System.Boolean | True if the page should be displayed. |
Remarks
Used internally to filter pages in listings. You should usually not need to refer to this method directly.
CheckPublishedStatus(IContent, PagePublishedStatus, IContentRepository, Nullable<DateTime>)
Indicates whether the content should be displayed based on publish date.
Declaration
[Obsolete("Use class PublishedStateAssessor or IPublishedStateAssessor to check the published state of content.")]
public static bool CheckPublishedStatus(IContent content, PagePublishedStatus status, IContentRepository contentRepository, DateTime? requestTime)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The content. |
PagePublishedStatus | status | The type of publish status to check against. |
IContentRepository | contentRepository | The IContentRepository instance to use |
System.Nullable<System.DateTime> | requestTime | The request time. |
Returns
Type | Description |
---|---|
System.Boolean | True if the page should be displayed. |
Remarks
Used internally to filter pages in listings. You should usually not need to refer to this method directly.
CheckPublishedStatus(PageData, PagePublishedStatus)
Declaration
[Obsolete("Use class PublishedStateAssessor or IPublishedStateAssessor to check the published state of content.")]
public static bool CheckPublishedStatus(PageData pageData, PagePublishedStatus status)
Parameters
Type | Name | Description |
---|---|---|
PageData | pageData | |
PagePublishedStatus | status |
Returns
Type | Description |
---|---|
System.Boolean |
Filter(PageDataCollection)
Filters the specified pages.
Declaration
public override void Filter(PageDataCollection pages)
Parameters
Type | Name | Description |
---|---|---|
PageDataCollection | pages | The pages that should be filtered. |
Overrides
Remarks
Will remove all pages in e.Pages that do not fulfill the PublishedStatus criteria. If the page points to other page via PageShortcutType.FetchData PageShortcutType then the fetched page should fulfill the PublishedStatus criteria.
ShouldFilter(IContent)
If the content should be filtered.
Declaration
public override bool ShouldFilter(IContent content)
Parameters
Type | Name | Description |
---|---|---|
IContent | content |
Returns
Type | Description |
---|---|
System.Boolean | True if the filter will remove the content; otherwise false. |
Overrides
ShouldFilter(PageData)
If the page should be filtered.
Declaration
public override bool ShouldFilter(PageData page)
Parameters
Type | Name | Description |
---|---|---|
PageData | page | The page that you want to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the filter will remove the page; otherwise false. |