Class ArchiveConfigurationHelper
This class provides functionality for fetching and saving the current configuration of a particular archive gui control and its parent data provider. It is the standard, but not mandatory, source and sink of such configuration data. It is also the sink for the result of the archive configuration dialog (both the display and orderby tabs).
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public static class ArchiveConfigurationHelper
Methods
GetChosenColumns(string, string, string, int)
Get the current configuration for a given archive
Declaration
public static List<ArchiveColumnInfo> GetChosenColumns(string guiControlName, string archiveName, string context = "", int selectionId = 0)
Parameters
Type | Name | Description |
---|---|---|
string | guiControlName | Gui name of the archive control |
string | archiveName | Archive data provider name, will be passed to the ArchiveProviderFactory. |
string | context | |
int | selectionId |
Returns
Type | Description |
---|---|
List<ArchiveColumnInfo> | List of column information. The list is sorted according to the order in which columns have been configured by the user, and all percentage widths are rescaled so they add up to exactly 100 (or 0 if there are no percentage-width columns). |
GetChosenColumns(string, string, out string, string, int)
This class provides functionality for fetching and saving the current configuration of a particular archive gui control and its parent data provider. It is the standard, but not mandatory, source and sink of such configuration data. It is also the sink for the result of the archive configuration dialog (both the display and orderby tabs).
Declaration
public static List<ArchiveColumnInfo> GetChosenColumns(string guiControlName, string archiveName, out string ownerKeys, string context = "", int selectionId = 0)
Parameters
Type | Name | Description |
---|---|---|
string | guiControlName | |
string | archiveName | |
string | ownerKeys | |
string | context | |
int | selectionId |
Returns
Type | Description |
---|---|
List<ArchiveColumnInfo> |
GetChosenEntities(string, string)
Retrieve a list of entities, marking each as chosen or not
Declaration
public static List<ArchiveRowTypeInfo> GetChosenEntities(string guiControlName, string archiveName)
Parameters
Type | Name | Description |
---|---|---|
string | guiControlName | GUI name of control |
string | archiveName | Archive provider |
Returns
Type | Description |
---|---|
List<ArchiveRowTypeInfo> | List of chosen entities, including mandatory ones |
GetOrderBy(string, int)
Retrieve the current orderby configuration for a given archive
Declaration
public static List<ArchiveOrderByInfo> GetOrderBy(string guiControlName, int selectionId = 0)
Parameters
Type | Name | Description |
---|---|---|
string | guiControlName | The gui name of the archive control |
int | selectionId |
Returns
Type | Description |
---|---|
List<ArchiveOrderByInfo> | List of orderby information, sorted according to the rank of the orderby criteria |
SaveColumnWidths(string, Dictionary<string, string>, string, int)
Save the current column widths for the indicated columns
Declaration
public static void SaveColumnWidths(string guiControlName, Dictionary<string, string> columnNameWidths, string context = "", int selectionId = 0)
Parameters
Type | Name | Description |
---|---|---|
string | guiControlName | Gui name of the archive control |
Dictionary<string, string> | columnNameWidths | Dictionary of widths. The key is the column programmatic name, as defined in Name, the width is either 'n%' or 'nc', indicating a percentage or number of characters. |
string | context | |
int | selectionId |
SetChosenColumns(string, List<ISelectableListItem>, string, int)
Based on a list of properly formatted ISelectableListItem items and a gui control name, save the current configuration of that archive in the database on behalf of the current user.
Declaration
public static void SetChosenColumns(string guiControlName, List<ISelectableListItem> columns, string context = "", int selectionId = 0)
Parameters
Type | Name | Description |
---|---|---|
string | guiControlName | Name of the archive gui control |
List<ISelectableListItem> | columns | List of items. The Selected property of each item determines whether the corresponding column (found in ISelectableListItem.Type) is selected for display. The ISelectableListItem.ExtraInfo property determines whether the column is part of the orderby criteria. A value of 'n:A' or 'n:D' where n is a 1-based integer defines the corresponding column as the n'th orderby criterion, Ascending or Descending order. |
string | context | |
int | selectionId |
SetChosenEntities(string, string, List<ISelectableListItem>, string, int)
Store a list of chosen (or not) entities in the database.
Declaration
public static void SetChosenEntities(string providerName, string guiControlName, List<ISelectableListItem> entities, string context = "", int selectionId = 0)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | guiControlName | GUI name of control |
List<ISelectableListItem> | entities | List of entities |
string | context | |
int | selectionId |
Remarks
All entities get rows, regardless of choice, so we can differentiate between intentionally disabled and those that simply have not been seen before, thereby enabling a default of 'show' for optional entities. ///