Show / Hide Table of Contents

Class AppointmentNotificationProvider

Inheritance
object
InMemoryProviderBase<ArchiveRow>
AppointmentNotificationProvider
Implements
IArchiveProvider
IArchiveProviderHasRows
IArchiveProviderHasColumns
IArchiveProviderHasEntities
Inherited Members
InMemoryProviderBase<ArchiveRow>._entityHelper
InMemoryProviderBase<ArchiveRow>.Visible
InMemoryProviderBase<ArchiveRow>.Invisible
InMemoryProviderBase<ArchiveRow>.AllowOrderBy
InMemoryProviderBase<ArchiveRow>.DenyOrderBy
InMemoryProviderBase<ArchiveRow>.Options
InMemoryProviderBase<ArchiveRow>.RegisterEntity(ArchiveRowTypeInfo)
InMemoryProviderBase<ArchiveRow>.GetReaderAsync(string, CancellationToken)
InMemoryProviderBase<ArchiveRow>.GetRowsAsync(string, CancellationToken)
InMemoryProviderBase<ArchiveRow>.GetResultInformationAsync()
InMemoryProviderBase<ArchiveRow>.SortData(List<ArchiveRow>)
InMemoryProviderBase<ArchiveRow>.EntityHelper
InMemoryProviderBase<ArchiveRow>.ColumnHelper
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.BusinessLogic.dll
Syntax
[ArchiveProvider("AppointmentNotification", 1073741823)]
public class AppointmentNotificationProvider : InMemoryProviderBase<ArchiveRow>, IArchiveProvider, IArchiveProviderHasRows, IArchiveProviderHasColumns, IArchiveProviderHasEntities

Constructors

AppointmentNotificationProvider()

Declaration
public AppointmentNotificationProvider()

Fields

C_APPOINTMENT_ACCEPTED_ENTITY_NAME

Declaration
public const string C_APPOINTMENT_ACCEPTED_ENTITY_NAME = "appointmentAccepted"
Field Value
Type Description
string

C_APPOINTMENT_CANCELLED_ENTITY_NAME

Declaration
public const string C_APPOINTMENT_CANCELLED_ENTITY_NAME = "appointmentCancelled"
Field Value
Type Description
string

C_APPOINTMENT_HIDDEN_ENTITY_NAME

Declaration
public const string C_APPOINTMENT_HIDDEN_ENTITY_NAME = "appointmentHidden"
Field Value
Type Description
string

C_APPOINTMENT_NEW_ENTITY_NAME

Declaration
public const string C_APPOINTMENT_NEW_ENTITY_NAME = "appointmentNew"
Field Value
Type Description
string

C_APPOINTMENT_REJECTED_BY_ASSOCIATE_ENTITY_NAME

Declaration
public const string C_APPOINTMENT_REJECTED_BY_ASSOCIATE_ENTITY_NAME = "appointmentRejectedByAssociate"
Field Value
Type Description
string

C_APPOINTMENT_REJECTED_ENTITY_NAME

Declaration
public const string C_APPOINTMENT_REJECTED_ENTITY_NAME = "appointmentRejected"
Field Value
Type Description
string

C_APPOINTMENT_UPDATED_ENTITY_NAME

Declaration
public const string C_APPOINTMENT_UPDATED_ENTITY_NAME = "appointmentUpdated"
Field Value
Type Description
string

ProviderName

Declaration
public const string ProviderName = "AppointmentNotification"
Field Value
Type Description
string

Properties

AddConflicts

Declaration
protected bool AddConflicts { get; set; }
Property Value
Type Description
bool

BaseClassShouldFilterColumns

Subclass contract: Return true if the base class should filter columns according to SetDesiredColumns. If this property is false, the actual ArchiveRow objects are returned; otherwise a typed copy is made and ColumnData are populated accoprding to DesiredColumns.

Declaration
protected override bool BaseClassShouldFilterColumns { get; }
Property Value
Type Description
bool
Overrides
InMemoryProviderBase<ArchiveRow>.BaseClassShouldFilterColumns
Remarks

If columns are cheap to get, the subclass can save code by leaving the filtering to this base class. Conversely, if somecolumns are expensive to calculate, the subclass should do the filtering itself to improve performance.

BaseClassShouldFilterEntities

Subclass contract: Return true if the base class should filter columns according to SetDesiredColumns. If this property is false, the actual ArchiveRow objects are returned; otherwise a typed copy is made and ColumnData are populated accoprding to DesiredColumns.

Declaration
protected override bool BaseClassShouldFilterEntities { get; }
Property Value
Type Description
bool
Overrides
InMemoryProviderBase<ArchiveRow>.BaseClassShouldFilterEntities
Remarks

If columns are cheap to get, the subclass can save code by leaving the filtering to this base class. Conversely, if somecolumns are expensive to calculate, the subclass should do the filtering itself to improve performance.

BaseClassShouldPage

Subclass contract: Return true if the base class should perform filter entities according to SetDesiredEntities. If this property is false, the result set is assumed to represent the chosen entities only.

Declaration
protected override bool BaseClassShouldPage { get; }
Property Value
Type Description
bool
Overrides
InMemoryProviderBase<ArchiveRow>.BaseClassShouldPage
Remarks

If rows are cheap to get, the subclass can save code by leaving the filtering to this base class. Conversely, if rows are expensive to calculate, the subclass should do the entity filtering itself to improve performance.

BaseClassShouldSort

Subclass contract: Return true if the base class should perform sorting according to SetOrderBy. If this property is false, the result set is assumed to be correctly ordered.

Declaration
protected override bool BaseClassShouldSort { get; }
Property Value
Type Description
bool
Overrides
InMemoryProviderBase<ArchiveRow>.BaseClassShouldSort

Methods

AddConflictColumnValueAsync(IAsyncEnumerable<ArchiveRow>, CancellationToken)

Declaration
protected IAsyncEnumerable<ArchiveRow> AddConflictColumnValueAsync(IAsyncEnumerable<ArchiveRow> rows, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncEnumerable<ArchiveRow> rows
CancellationToken cancellationToken
Returns
Type Description
IAsyncEnumerable<ArchiveRow>

Close()

Call this method after the last desired row has been read; this gives the provider the chance to close and free any underlying queries

Declaration
public override void Close()
Overrides
InMemoryProviderBase<ArchiveRow>.Close()

CreateRowHistory(ArchiveRow)

Generate a RowHistory object for the provided row.

Declaration
protected AppointmentNotificationProvider.RowHistory CreateRowHistory(ArchiveRow row)
Parameters
Type Name Description
ArchiveRow row
Returns
Type Description
AppointmentNotificationProvider.RowHistory

FilterRecurringRowsAsync(IAsyncEnumerable<ArchiveRow>)

We want to show as few notifications for appointments in a recurring series as possible, so we try to mitigate as many as we can by following these rules: 1. If an appointment is the first in its recurring series, we keep it. 2. If an appointment is of a different type than the previous in the series (C_APPOINTMENT_NEW_ENTITY_NAME, C_APPOINTMENT_CANCELLED_ENTITY_NAME etc.), we keep it. 3. If an appointment has a time that diverges from already seen times. 4. If an appointment has a ModifiedAppointmentFields flag-combination that diverges from already seen rows. 5. If an appointment has a notifyDateTime (registered or updated datetime) that diverges from already seen rows.

In addition, we add the RecurrenceUpdateMode that we think is appropriate for the notification based on our analysis of the appointment. The rule is simple: - If the next appointment in the series is of the same type, we assume the change that caused it was of the forward-propagating variety.

Remove all recurring appointments of the same series, except for divergent appointments in the series.

Declaration
protected IAsyncEnumerable<ArchiveRow> FilterRecurringRowsAsync(IAsyncEnumerable<ArchiveRow> rows)
Parameters
Type Name Description
IAsyncEnumerable<ArchiveRow> rows
Returns
Type Description
IAsyncEnumerable<ArchiveRow>

GetAvailableColumns()

Get the list of columns handled by this provider

Declaration
public override List<ArchiveColumnInfo> GetAvailableColumns()
Returns
Type Description
List<ArchiveColumnInfo>
Overrides
InMemoryProviderBase<ArchiveRow>.GetAvailableColumns()

GetAvailableEntities()

Get the list of entities supported by this provider

Declaration
public override List<ArchiveRowTypeInfo> GetAvailableEntities()
Returns
Type Description
List<ArchiveRowTypeInfo>
Overrides
InMemoryProviderBase<ArchiveRow>.GetAvailableEntities()

GetResultDataAsync(CancellationToken)

Subclass contract: Return a list of ArchiveRow items that are the current result

Declaration
protected override IAsyncEnumerable<ArchiveRow> GetResultDataAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
IAsyncEnumerable<ArchiveRow>

result list, which may be paged, sorted and column-filtered, or not, according to the abstract properties

Overrides
InMemoryProviderBase<ArchiveRow>.GetResultDataAsync(CancellationToken)

SetDesiredColumns(params string[])

Set which columns should actually be returned, must be a subset of the GetAvailableColumns result

Declaration
public override void SetDesiredColumns(params string[] columnIds)
Parameters
Type Name Description
string[] columnIds

Array of column ID's representing the desired columns

Overrides
InMemoryProviderBase<ArchiveRow>.SetDesiredColumns(params string[])

SetDesiredEntities(params string[])

Declaration
public override void SetDesiredEntities(params string[] entities)
Parameters
Type Name Description
string[] entities

Array of entity names, semantically equivalent to ArchiveEntityInfo.Name fields.

Overrides
InMemoryProviderBase<ArchiveRow>.SetDesiredEntities(params string[])

SetOrderBy(params ArchiveOrderByInfo[])

Declaration
public override void SetOrderBy(params ArchiveOrderByInfo[] orderBy)
Parameters
Type Name Description
ArchiveOrderByInfo[] orderBy

Array of order by items

Overrides
InMemoryProviderBase<ArchiveRow>.SetOrderBy(params ArchiveOrderByInfo[])

SetPagingInfo(int, int)

Set the paging properties of the provider. The default is to fetch page zero, of one thousand (1000) rows. A more reasonable page size is probably around 100. Note that the query processing strategy may change for very large pages (more than 1000) and give significantly longer response times. Performance is improved by setting the page size low, as long as you don't set it lower than what you realistically expect to need (fetching multiple pages is more expensive than fetching one).

Declaration
public override void SetPagingInfo(int pageSize, int pageNumber)
Parameters
Type Name Description
int pageSize

Desired page size

int pageNumber

Desired page number to return

Overrides
InMemoryProviderBase<ArchiveRow>.SetPagingInfo(int, int)

SetRestriction(params ArchiveRestrictionInfo[])

Set query restriction globally, supersedes previous restrictions

Declaration
public override bool SetRestriction(params ArchiveRestrictionInfo[] restrictions)
Parameters
Type Name Description
ArchiveRestrictionInfo[] restrictions

Array of restrictions, with an implicit AND between them

Returns
Type Description
bool

true if at least one of the restrictions matched one of the available columns of the provider

Overrides
InMemoryProviderBase<ArchiveRow>.SetRestriction(params ArchiveRestrictionInfo[])

Implements

IArchiveProvider
IArchiveProviderHasRows
IArchiveProviderHasColumns
IArchiveProviderHasEntities

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
IArchiverProviderHasRowsExtensions.GetRowsAsync(IArchiveProviderHasRows, CancellationToken)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top