Show / Hide Table of Contents

Class LocationListProvider

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Inheritance
object
MDOProviderBase
LocationListProvider
Implements
IEnumerable<ISoListItem>
IEnumerable
ISoListProvider
ISoList
Inherited Members
MDOProviderBase._historyIds
MDOProviderBase._searchValue
MDOProviderBase._forceFlatList
MDOProviderBase._rootCollection
MDOProviderBase._historyCollection
MDOProviderBase._headingCollection
MDOProviderBase._declaredListName
MDOProviderBase._tableRows
MDOProviderBase._nodeType
MDOProviderBase._listName
MDOProviderBase._tableName
MDOProviderBase._tableListInfo
MDOProviderBase._listInfo
MDOProviderBase.FillListAsync(CancellationToken)
MDOProviderBase.GetHistoryCollectionAsync(CancellationToken)
MDOProviderBase.ReadSimpleListAsync(CancellationToken)
MDOProviderBase.ReadItemsAndHeadingsAsync(CancellationToken)
MDOProviderBase.AddSimpleListOrderByAsync(ListTableRows.CustomSearch, CancellationToken)
MDOProviderBase.GetItemsAndHeadingsQueryAsync(CancellationToken)
MDOProviderBase.AddGroupLinkJoin(int[], ListTableRows.CustomSearch)
MDOProviderBase.GetItemType(ListTableRow)
MDOProviderBase.GetHeadingType(ListTableRow)
MDOProviderBase.GetItemId(ListTableRow)
MDOProviderBase.AcceptHistoryRow(ListTableRow)
MDOProviderBase.GetHistoryIconHint(ListTableRow)
MDOProviderBase.GetItemRank(ListTableRow)
MDOProviderBase.GetItemDeleted(ListTableRow)
MDOProviderBase.GetItemColor(ListTableRow)
MDOProviderBase.GetItemStyleHint(ListTableRow)
MDOProviderBase.GetGroupingAllowedForListAsync(CancellationToken)
MDOProviderBase.OnAddHeadingElementToCollection(SoListHeading)
MDOProviderBase.OnAddHistoryElementToCollection(SoListItem)
MDOProviderBase.GetListLowerLimitAsync(CancellationToken)
MDOProviderBase.GetPreferredSortOrderAsync(CancellationToken)
MDOProviderBase.BuildMdoCollectionsAsync(CancellationToken)
MDOProviderBase.ResortFlattenedListAsync(CancellationToken)
MDOProviderBase.ClearHistoryItems()
MDOProviderBase.IncludeDeletedItems
MDOProviderBase.InhibitResortOnFlattening
MDOProviderBase.IsFinalListFlat
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Lists
Assembly: SoDataBase.BusinessLogic.dll
Syntax
[MDOProviderPlugin("location")]
[MDOAdditionalInfoSeparator(";")]
[MDOAdditionalInfo("ownercontactid", "Mandatory: id of the contact for the owner of the appointment.", 2)]
[MDOAdditionalInfo("currentassociate", "Mandatory: id of the currently logged in associate.", 2)]
[MDOAdditionalInfo("appointmentcontactid", "id of the contact in the appointment.", 2)]
[MDOAdditionalInfo("appointmentpersonid", "id of the person in the appointment.", 2)]
[MDOAdditionalInfo("appointmentid", "id of existing appointment.", 2)]
[MDOAdditionalInfo("startdate", "startdate used for conflict resolution.", 2)]
[MDOAdditionalInfo("enddate", "enddate used for conflict resolution.", 2)]
[MDOAdditionalInfo("participantpersonidlist", "comma separated list of existing participant person ids", "2,34")]
[MDOAdditionalInfo("participantassociateidlist", "comma separated list of existing participant associate ids(resources)", "2")]
[MDOAdditionalInfo("skipresourcelocation", "Skip resource locations", false)]
public class LocationListProvider : MDOProviderBase, IEnumerable<ISoListItem>, IEnumerable, ISoListProvider, ISoList

Constructors

LocationListProvider()

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Declaration
public LocationListProvider()

Fields

ProviderName

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

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

Properties

HistoryInfo

History information for the supported list. This list does not have history items.

Declaration
public override HistoryInfo HistoryInfo { get; }
Property Value
Type Description
HistoryInfo
Overrides
MDOProviderBase.HistoryInfo

Methods

ConstructAsync(string, string, int[], bool, string, bool, CancellationToken)

Phase two of two-stage list construction. To be called right after the constructor, at which point all constructors have run, and the class hierarchy is initialized.

Declaration
public override Task ConstructAsync(string listName, string additionalInfo, int[] historyIDs, bool onlyReadHistory, string searchValue, bool forceFlatList, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string listName

List name (though note that as implemented by MDOProviderBase, this actually has to be a real table name, so subclasses should override and convert from their list name to a real table name) (yes it's a bit messy)

string additionalInfo

Additional information to provider: ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment
participantassociateidlist commaseparated list of persons (by their personid) participating in the current appointment. participantpersonidlist commaseparated list of resources (by their associateid) participating in the current appointment.
appointmentid Identifier of the appointment. 0 if the appointment is new. Used for conflict detection startdate start of the appointment if it is new enddate end of the appointment if it is new

int[] historyIDs

Ignored. Location does not have history.

bool onlyReadHistory

Ignored. Location does not have history

string searchValue

Ignored. Location does not have search

bool forceFlatList

Ignored, this list is always flat

CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
MDOProviderBase.ConstructAsync(string, string, int[], bool, string, bool, CancellationToken)

GetHeadingIconHint(ListTableRow)

Get a value for the field IconHint in ISoList for a heading element

Declaration
protected override string GetHeadingIconHint(ListTableRow row)
Parameters
Type Name Description
ListTableRow row

The actual row for which the item is created

Returns
Type Description
string

An icon hint text

Overrides
MDOProviderBase.GetHeadingIconHint(ListTableRow)

GetHeadingItemsAsync(CancellationToken)

list of headings

Declaration
public Task<List<ISoListHeading>> GetHeadingItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<List<ISoListHeading>>

GetHistoryItemsAsync(CancellationToken)

History items for the list. Shall return an empty array, since the location mdo provider does not have history

Declaration
public Task<List<ISoListItem>> GetHistoryItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<List<ISoListItem>>

GetItemExtraInfo(ListTableRow)

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Declaration
protected override string GetItemExtraInfo(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
string
Overrides
MDOProviderBase.GetItemExtraInfo(ListTableRow)

GetItemIconHint(ListTableRow)

Get a value for the field IconHint in ISoList for an item element

Declaration
protected override string GetItemIconHint(ListTableRow row)
Parameters
Type Name Description
ListTableRow row

The actual row for which the item is created

Returns
Type Description
string

An icon hint text

Overrides
MDOProviderBase.GetItemIconHint(ListTableRow)

GetItemName(ListTableRow)

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Declaration
protected override string GetItemName(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
string
Overrides
MDOProviderBase.GetItemName(ListTableRow)

GetItemTooltip(ListTableRow)

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Declaration
protected override string GetItemTooltip(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
string
Overrides
MDOProviderBase.GetItemTooltip(ListTableRow)

GetItemsAndHeadingsQueryAsync(bool, CancellationToken, params int[])

Create a query for for reading the items and headings of a list.

Declaration
protected override Task<ListTableRows.CustomSearch> GetItemsAndHeadingsQueryAsync(bool bFlattened, CancellationToken cancellationToken, params int[] selectedIds)
Parameters
Type Name Description
bool bFlattened

Force the list to be flattened.

CancellationToken cancellationToken
int[] selectedIds

Id's in the list that will be forced to be included, regardless of other filtering.

Returns
Type Description
Task<ListTableRows.CustomSearch>

Query for reading the items and headdings of a list.

Overrides
MDOProviderBase.GetItemsAndHeadingsQueryAsync(bool, CancellationToken, params int[])
Remarks

The _listInfo is populated.

The resulting query will contain an OR clause in the grouplink join if selectedIds != null:
select distinct c.* from crm5.category c inner join crm5.categorygrouplink cg
on c.category_id = cg.category_id and
(cg.group_id = 1 or cg.category_id in (1,2,3))
This works as long as we do not fetch any of the fields from the grouplink table (that would break the distinct clause and cause unwanted row multiplication).

GetRootItemsAsync(CancellationToken)

Root items (e.g. items) for the "MDO List".

Declaration
public Task<List<ISoListItem>> GetRootItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<List<ISoListItem>>

GetSimpleListQueryAsync(CancellationToken)

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Declaration
protected override Task<ListTableRows.CustomSearch> GetSimpleListQueryAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<ListTableRows.CustomSearch>
Overrides
MDOProviderBase.GetSimpleListQueryAsync(CancellationToken)

OnAddRootElementToCollection(SoListItem)

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Declaration
protected override void OnAddRootElementToCollection(SoListItem item)
Parameters
Type Name Description
SoListItem item
Overrides
MDOProviderBase.OnAddRootElementToCollection(SoListItem)

OnAddSubItemToCollection(SoListItem, List<ISoListItem>)

Implements the mdo provider for the list of avaiable locations. This list aggregates elements from different sources like contact, person, associate, participants and resources to build a list that represents all the relevant, available locations that can be used when creating a new appointment.

The provider uses a set of name/value pairs in the additionalinfo parameter used in the construct() function. The available names are:

ownercontactid (mandatory): id of the contact for the owner of the appointment currentassociate (mandatory): currently logged in associate appointmentcontactid: id of the contact in the appointment appointmentpersonid: id of the person in the appointment appointmentid: id of existing appointment startdate: startdate used for conflict resolution enddate: enddate used for conflict resolution participantpersonidlist: comma separated list of existing participant person ids participantassociateidlist: comma separated list of existing participant associate ids(resources) skipresourcelocation: Skip resource locations

Declaration
protected override void OnAddSubItemToCollection(SoListItem item, List<ISoListItem> headingItemsCollection)
Parameters
Type Name Description
SoListItem item
List<ISoListItem> headingItemsCollection
Overrides
MDOProviderBase.OnAddSubItemToCollection(SoListItem, List<ISoListItem>)

Implements

IEnumerable<T>
IEnumerable
ISoListProvider
ISoList

Extension Methods

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