View Source
Class DocumentRepository
Represents a repository for doing CRUD operations for IContent.
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
Syntax
public class DocumentRepository : ContentRepositoryBase<int, IContent, DocumentRepository>, IDocumentRepository, IContentRepository<int, IContent>, IReadWriteQueryRepository<int, IContent>, IReadRepository<int, IContent>, IWriteRepository<IContent>, IQueryRepository<IContent>, IReadRepository<Guid, IContent>, IRepository
Constructors
View Source
DocumentRepository(IScopeAccessor, AppCaches, ILogger<DocumentRepository>, ILoggerFactory, IContentTypeRepository, ITemplateRepository, ITagRepository, ILanguageRepository, IRelationRepository, IRelationTypeRepository, PropertyEditorCollection, DataValueReferenceFactoryCollection, IDataTypeService, IJsonSerializer, IEventAggregator)
Declaration
public DocumentRepository(IScopeAccessor scopeAccessor, AppCaches appCaches, ILogger<DocumentRepository> logger, ILoggerFactory loggerFactory, IContentTypeRepository contentTypeRepository, ITemplateRepository templateRepository, ITagRepository tagRepository, ILanguageRepository languageRepository, IRelationRepository relationRepository, IRelationTypeRepository relationTypeRepository, PropertyEditorCollection propertyEditors, DataValueReferenceFactoryCollection dataValueReferenceFactories, IDataTypeService dataTypeService, IJsonSerializer serializer, IEventAggregator eventAggregator)
Parameters
Properties
View Source
EnsureUniqueNaming
Default is to always ensure all documents have unique names
Declaration
protected virtual bool EnsureUniqueNaming { get; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
NodeObjectTypeId
Declaration
protected override Guid NodeObjectTypeId { get; }
Property Value
View Source
RecycleBinId
Declaration
public override int RecycleBinId { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
This
Declaration
protected override DocumentRepository This { get; }
Property Value
Methods
View Source
AddOrUpdatePermissions(ContentPermissionSet)
Used to add/update a permission for a content item
Declaration
public void AddOrUpdatePermissions(ContentPermissionSet permission)
Parameters
View Source
ApplySystemOrdering(ref Sql<ISqlContext>, Ordering)
Declaration
protected override string ApplySystemOrdering(ref Sql<ISqlContext> sql, Ordering ordering)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
AssignEntityPermission(IContent, Char, IEnumerable<Int32>)
Assigns a single permission to the current content item for the specified group ids
Declaration
public void AssignEntityPermission(IContent entity, char permission, IEnumerable<int> groupIds)
Parameters
Type |
Name |
Description |
IContent |
entity |
|
System.Char |
permission |
|
IEnumerable<System.Int32> |
groupIds |
|
View Source
ClearSchedule(DateTime)
Declaration
public void ClearSchedule(DateTime date)
Parameters
Type |
Name |
Description |
DateTime |
date |
|
View Source
ClearSchedule(DateTime, ContentScheduleAction)
Declaration
public void ClearSchedule(DateTime date, ContentScheduleAction action)
Parameters
View Source
CountPublished(String)
Declaration
public int CountPublished(string contentTypeAlias = null)
Parameters
Type |
Name |
Description |
System.String |
contentTypeAlias |
|
Returns
Type |
Description |
System.Int32 |
|
View Source
DeleteVersion(Int32)
Declaration
public override void DeleteVersion(int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
versionId |
|
View Source
DeleteVersions(Int32, DateTime)
Declaration
public override void DeleteVersions(int nodeId, DateTime versionDate)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
DateTime |
versionDate |
|
View Source
EnsureUniqueNodeName(Int32, String, Int32)
Declaration
protected override string EnsureUniqueNodeName(int parentId, string nodeName, int id = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
nodeName |
|
System.Int32 |
id |
|
Returns
Type |
Description |
System.String |
|
View Source
Exists(Guid)
Declaration
public bool Exists(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
Get(Guid)
Declaration
public IContent Get(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
View Source
GetAllVersions(Int32)
Declaration
public override IEnumerable<IContent> GetAllVersions(int nodeId)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
Returns
View Source
GetAllVersionsSlim(Int32, Int32, Int32)
Declaration
public override IEnumerable<IContent> GetAllVersionsSlim(int nodeId, int skip, int take)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
System.Int32 |
skip |
|
System.Int32 |
take |
|
Returns
View Source
GetBaseQuery(Boolean)
Declaration
protected override Sql<ISqlContext> GetBaseQuery(bool isCount)
Parameters
Type |
Name |
Description |
System.Boolean |
isCount |
|
Returns
View Source
GetBaseQuery(QueryType)
Declaration
protected override Sql<ISqlContext> GetBaseQuery(QueryType queryType)
Parameters
Returns
View Source
GetBaseQuery(QueryType, Boolean)
Declaration
protected Sql<ISqlContext> GetBaseQuery(QueryType queryType, bool current)
Parameters
Type |
Name |
Description |
QueryType |
queryType |
|
System.Boolean |
current |
|
Returns
View Source
GetBaseWhereClause()
Declaration
protected override string GetBaseWhereClause()
Returns
Type |
Description |
System.String |
|
View Source
GetContentForExpiration(DateTime)
Declaration
public IEnumerable<IContent> GetContentForExpiration(DateTime date)
Parameters
Type |
Name |
Description |
DateTime |
date |
|
Returns
View Source
GetContentForRelease(DateTime)
Declaration
public IEnumerable<IContent> GetContentForRelease(DateTime date)
Parameters
Type |
Name |
Description |
DateTime |
date |
|
Returns
View Source
GetContentSchedule(Int32)
Gets publish/unpublish schedule for a content node.
Declaration
public ContentScheduleCollection GetContentSchedule(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
View Source
GetDeleteClauses()
Declaration
protected override IEnumerable<string> GetDeleteClauses()
Returns
Type |
Description |
IEnumerable<System.String> |
|
View Source
GetPage(IQuery<IContent>, Int64, Int32, out Int64, IQuery<IContent>, Ordering)
Declaration
public override IEnumerable<IContent> GetPage(IQuery<IContent> query, long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter, Ordering ordering)
Parameters
Returns
View Source
GetPermissionsForEntity(Int32)
Declaration
public EntityPermissionCollection GetPermissionsForEntity(int entityId)
Parameters
Type |
Name |
Description |
System.Int32 |
entityId |
|
Returns
View Source
GetVersion(Int32)
Declaration
public override IContent GetVersion(int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
versionId |
|
Returns
View Source
HasContentForExpiration(DateTime)
Declaration
public bool HasContentForExpiration(DateTime date)
Parameters
Type |
Name |
Description |
DateTime |
date |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
HasContentForRelease(DateTime)
Declaration
public bool HasContentForRelease(DateTime date)
Parameters
Type |
Name |
Description |
DateTime |
date |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
IsPathPublished(IContent)
Declaration
public bool IsPathPublished(IContent content)
Parameters
Returns
Type |
Description |
System.Boolean |
|
View Source
Declaration
protected override void PerformDeleteVersion(int id, int versionId)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.Int32 |
versionId |
|
View Source
Declaration
protected override IContent PerformGet(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
Declaration
protected override IEnumerable<IContent> PerformGetAll(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
View Source
PerformGetByQuery(IQuery<IContent>)
Declaration
protected override IEnumerable<IContent> PerformGetByQuery(IQuery<IContent> query)
Parameters
Returns
View Source
PersistContentSchedule(IContent, ContentScheduleCollection)
Persists publish/unpublish schedule for a content node.
Declaration
public void PersistContentSchedule(IContent content, ContentScheduleCollection contentSchedule)
Parameters
View Source
PersistDeletedItem(IContent)
Declaration
protected override void PersistDeletedItem(IContent entity)
Parameters
View Source
PersistNewItem(IContent)
Declaration
protected override void PersistNewItem(IContent entity)
Parameters
View Source
PersistUpdatedItem(IContent)
Declaration
protected override void PersistUpdatedItem(IContent entity)
Parameters
View Source
RecycleBinSmells()
Declaration
public bool RecycleBinSmells()
Returns
Type |
Description |
System.Boolean |
|
View Source
ReplaceContentPermissions(EntityPermissionSet)
Declaration
public void ReplaceContentPermissions(EntityPermissionSet permissionSet)
Parameters