Documentation

Audit

This object contains information about the published status, creation and modified dates, as well as ownership information about the page to which it is a member of.


OpenRoad.ThoughtFarmer.Core.Content.Composable.Audit

Properties

Name Type Description
InheritedIsPublished boolean Returns a boolean indicating if this page is published by means of inheritance or not (e.g. if the parent is private then this page must be private as well and this property will be true).
IsPublished boolean Returns a boolean indicating if this page is published.
InheritedIsArchived boolean Returns a boolean indicating if this page is archived by means of inheritance or not.
IsArchived boolean Returns a boolean indicating if this page is archived. 
PublishedDate DateTime Returns a DateTime representing when the page was published. Typically used on all News\Blog\Forum pages. 
ModifiedDate DateTime Returns a DateTime representing when the page was last modified.
CreatedDate DateTime Returns a DateTime representing when the page was created.
VersionModifiedDate DateTime Returns a DateTime representing when the page body was last modified. ModifiedDate may be different if only page settings were last changed and not body copy (i.e. a new version was not created in version history).
ModifiedById int Returns an int representing the id of the user who last modified the page.
CreatorId int Returns an int representing the id of the user who created the page.
OwnerId int Returns an int representing the id of the user who currently owns the page.
VersionModifiedById int Returns an int representing the id of the user who last made page edit changes and created a new version (same difference as VersionModifiedDate).
LastUpdatedByUserId int If there have been no edits or versions of the page then simply returns the CreatorId. Otherwise, gets the appropriate latest VersionModifiedById or ModifiedById.
PublishedStatus PublishedStatus (enum) The flag enum with properties Public, Private, InheritedPrivate, Future, New, Updated, Archived, or InheritedArchived.
InheritedArchivedContentId int Returns an int of the page that this page gets its inherited status from. Null if not archived. 
IsPrivateStatus boolean Returns true if the PublishedStatus has Private or InheritedPrivate.
IsArchivedStatus boolean Returns true if the PublishedStatus has Archived or InheritedArchived.
IsNewStatus boolean Returns true if the PublishedStatus has New. Tied to the configuration setting dates.maxAge.newItem.
IsUpdatedStatus boolean Returns true if the PublishedStatus has Updated. Tied to the configuration setting dates.maxAge.updatedItem.
IsFutureStatus boolean Returns true if the PublishedStatus has Future. 


Methods

Name Return type Description
RelativeDate(TimeZoneInfo timeZone, IContext context) string Gets the date last updated as a relative date string. For example, if posted date and modified date are equal or modified date is null then it will return "Added 2 days ago". If the modified date is after the published date then "Updated 22 hrs ago". After the max age for relative dates configured time period it will return actual dates.

Example usage:
@{
var owner = this.Api.User.Get(this.Model.Context.Page.Audit.OwnerId); var lastModifiedUser = this.Api.User.Get(this.Model.Context.Page.Audit.LastUpdatedByUserId); }

<div> Last modified by: <a href="/content/@lastModifiedUser.ContentId">@lastModifiedUser.FullName</a><br /> Owned by: <a href="/content/@owner.ContentId">@owner .FullName</a><br /> </div>