Class MDOProviderBase
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Inheritance
Inherited Members
Namespace: SuperOffice.CRM.Lists
Assembly: SoDataBase.dll
Syntax
public abstract class MDOProviderBase : ISoListProvider, ISoList, IEnumerable<ISoListItem>, IEnumerable
Constructors
MDOProviderBase()
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected MDOProviderBase()
Fields
_declaredListName
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected string _declaredListName
Field Value
Type | Description |
---|---|
string |
_forceFlatList
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected bool _forceFlatList
Field Value
Type | Description |
---|---|
bool |
_headingCollection
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected List<ISoListHeading> _headingCollection
Field Value
Type | Description |
---|---|
List<ISoListHeading> |
_historyCollection
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected List<ISoListItem> _historyCollection
Field Value
Type | Description |
---|---|
List<ISoListItem> |
_historyIds
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected int[] _historyIds
Field Value
Type | Description |
---|---|
int[] |
_listInfo
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected ListInfo _listInfo
Field Value
Type | Description |
---|---|
ListInfo |
_listName
The name of the list. Used to identify mdo-list entries in the UserPreference-table.
Declaration
protected string _listName
Field Value
Type | Description |
---|---|
string |
_nodeType
Explains what kind the current object is. MDOListElementType
Declaration
protected MDOListElementType _nodeType
Field Value
Type | Description |
---|---|
MDOListElementType |
_rootCollection
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected List<ISoListItem> _rootCollection
Field Value
Type | Description |
---|---|
List<ISoListItem> |
_searchValue
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected string _searchValue
Field Value
Type | Description |
---|---|
string |
_tableListInfo
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected TableInfo _tableListInfo
Field Value
Type | Description |
---|---|
TableInfo |
_tableName
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected string _tableName
Field Value
Type | Description |
---|---|
string |
_tableRows
ListTableRows list with items and headings
Declaration
protected ListTableRows _tableRows
Field Value
Type | Description |
---|---|
ListTableRows |
Properties
HeadingItems
list of headings
Declaration
public List<ISoListHeading> HeadingItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListHeading> |
HistoryInfo
History information for the supported list
Declaration
public abstract HistoryInfo HistoryInfo { get; }
Property Value
Type | Description |
---|---|
HistoryInfo |
HistoryItems
list of history items
Declaration
public List<ISoListItem> HistoryItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListItem> |
IncludeDeletedItems
Should items with the Deleted flag be included in the search. Default is false. Must be set before running the queries!
Declaration
public bool IncludeDeletedItems { get; set; }
Property Value
Type | Description |
---|---|
bool |
InhibitResortOnFlattening
If a heading-grouped list becomes flattened, it is usually resorted according to the current list preference. Some providers may not want that, if they already have made some evaluations of what is going on. Setting this properties will cause the resorting to be skipped.
Declaration
public bool InhibitResortOnFlattening { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsFinalListFlat
After population, this property will tell us if the final list is actually flat or not
Declaration
protected bool IsFinalListFlat { get; }
Property Value
Type | Description |
---|---|
bool |
RootItems
list of root-level items (items not under any heading)
Declaration
public List<ISoListItem> RootItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListItem> |
Methods
AcceptHistoryRow(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual bool AcceptHistoryRow(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
bool |
AddGroupLinkJoin(int[], CustomSearch)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual void AddGroupLinkJoin(int[] selectedIds, ListTableRows.CustomSearch query)
Parameters
Type | Name | Description |
---|---|---|
int[] | selectedIds | |
ListTableRows.CustomSearch | query |
AddSimpleListOrderBy(CustomSearch)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual void AddSimpleListOrderBy(ListTableRows.CustomSearch query)
Parameters
Type | Name | Description |
---|---|---|
ListTableRows.CustomSearch | query |
BuildMdoCollections()
Convert rows object to ISoList collections
Declaration
protected virtual void BuildMdoCollections()
Construct(string, string, int[], bool, string, bool)
Initializes all class members.
Declaration
public virtual void Construct(string tableName, string additionalInfo, int[] historyIDs, bool onlyReadHistory, string searchValue, bool forceFlatList)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Name of the table holding the MDO list values, like Category, Business, etc. Note that this really has to be a valid table name. |
string | additionalInfo | |
int[] | historyIDs | List of history id's (primary keys of the table holding the MDO list values). |
bool | onlyReadHistory | Only read history nodes. |
string | searchValue | Search value (case insensetive string used like '%[searchValue]%'. The result when using this is allways a flat list without hisotry elements. |
bool | forceFlatList | State that a forced flat list should be returned. |
FillList()
Fills the MDO-list with data.
Declaration
protected virtual void FillList()
GetGroupingAllowedForList()
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual bool GetGroupingAllowedForList()
Returns
Type | Description |
---|---|
bool |
GetHeadingIconHint(ListTableRow)
Get a value for the field IconHint in ISoList for a heading element
Declaration
protected virtual 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 |
GetHeadingType(ListTableRow)
Get a value for the field Type in ISoList for a heading element
Declaration
protected virtual string GetHeadingType(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row | The actual row for which the item is created |
Returns
Type | Description |
---|---|
string |
GetHistoryCollection()
Builds the history-node collection.
Declaration
protected virtual ListTableRows.CustomSearch GetHistoryCollection()
Returns
Type | Description |
---|---|
ListTableRows.CustomSearch |
GetHistoryIconHint(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual string GetHistoryIconHint(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
string |
GetItemColor(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual int GetItemColor(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
int |
GetItemDeleted(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual bool GetItemDeleted(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
bool |
GetItemExtraInfo(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual string GetItemExtraInfo(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
string |
GetItemIconHint(ListTableRow)
Get a value for the field IconHint in ISoList for an item element
Declaration
protected virtual 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 |
GetItemId(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual int GetItemId(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
int |
GetItemName(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual string GetItemName(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
string |
GetItemRank(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual short GetItemRank(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
short |
GetItemStyleHint(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual string GetItemStyleHint(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
string |
GetItemTooltip(ListTableRow)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual string GetItemTooltip(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row |
Returns
Type | Description |
---|---|
string |
GetItemType(ListTableRow)
Get a value for the field Type in ISoList for an item element
Declaration
protected virtual string GetItemType(ListTableRow row)
Parameters
Type | Name | Description |
---|---|---|
ListTableRow | row | The actual row for which the item is created |
Returns
Type | Description |
---|---|
string | The type of the list item |
GetItemsAndHeadingsQuery()
Create a query for for reading the items and headings of a list.
Declaration
protected virtual ListTableRows.CustomSearch GetItemsAndHeadingsQuery()
Returns
Type | Description |
---|---|
ListTableRows.CustomSearch | Query for reading the items and headdings of a list. |
Remarks
A search string that is not empty will result in a flattened list.
GetItemsAndHeadingsQuery(bool, params int[])
Create a query for for reading the items and headings of a list.
Declaration
protected virtual ListTableRows.CustomSearch GetItemsAndHeadingsQuery(bool bFlattened, params int[] selectedIds)
Parameters
Type | Name | Description |
---|---|---|
bool | bFlattened | Force the list to be flattened. |
int[] | selectedIds | Id's in the list that will be forced to be included, regardless of other filtering. |
Returns
Type | Description |
---|---|
ListTableRows.CustomSearch | Query for reading the items and headdings of a list. |
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).
GetListLowerLimit()
How many items must there be in the list before we go into MDO-list mode?
Declaration
protected virtual int GetListLowerLimit()
Returns
Type | Description |
---|---|
int | the lower limit for this list |
GetPreferredSortOrder()
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual MDOSortOrder GetPreferredSortOrder()
Returns
Type | Description |
---|---|
MDOSortOrder |
GetSimpleListQuery()
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual ListTableRows.CustomSearch GetSimpleListQuery()
Returns
Type | Description |
---|---|
ListTableRows.CustomSearch |
OnAddHeadingElementToCollection(SoListHeading)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual void OnAddHeadingElementToCollection(SoListHeading heading)
Parameters
Type | Name | Description |
---|---|---|
SoListHeading | heading |
OnAddHistoryElementToCollection(SoListItem)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual void OnAddHistoryElementToCollection(SoListItem item)
Parameters
Type | Name | Description |
---|---|---|
SoListItem | item |
OnAddRootElementToCollection(SoListItem)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual void OnAddRootElementToCollection(SoListItem item)
Parameters
Type | Name | Description |
---|---|---|
SoListItem | item |
OnAddSubItemToCollection(SoListItem, List<ISoListItem>)
Base class for MDO List providers. This class knows about MDO lists and History, in addition to the knowledge provided by the FilteredListProviderBase base class.
Declaration
protected virtual void OnAddSubItemToCollection(SoListItem item, List<ISoListItem> headingItemsCollection)
Parameters
Type | Name | Description |
---|---|---|
SoListItem | item | |
List<ISoListItem> | headingItemsCollection |
ReadItemsAndHeadings()
Read all mdo items with heading information
Declaration
protected virtual void ReadItemsAndHeadings()
ReadSimpleList()
ReadSimpleList reads the root-nodes and adds them to the list. A simple list has no grouping or heading.
Declaration
protected virtual void ReadSimpleList()
ResortFlattenedList()
Resort a list that has been flattened.
Declaration
protected virtual void ResortFlattenedList()