Class RestrictionStorageBase
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Implements
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public abstract class RestrictionStorageBase : IRestrictionStorage
Constructors
RestrictionStorageBase()
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
protected RestrictionStorageBase()
Properties
Context
Contextual information to pass on to providers involved.
Declaration
public string Context { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
CopyCriteria(int, int, int)
Finds the search criteria and copies it into a new row, with input owner table and owner id, with new rows also propogating down for associated search criteria group, search criterion and search criterion value. This will delete existing rows with associated owner table and owner ID.
Declaration
public virtual void CopyCriteria(int sourceSearchCriteriaId, int ownerTable, int ownerId)
Parameters
Type | Name | Description |
---|---|---|
int | sourceSearchCriteriaId | The search criteria to copy. |
int | ownerTable | The owner table. |
int | ownerId | The owner ID. |
CreateDefaultRestrictionInfo(string, ArchiveColumnInfo)
Create an empty restriction information object for the given provider and column. This base implementation does not differentiate between providers - but a derived class might.
Declaration
protected ArchiveRestrictionInfo CreateDefaultRestrictionInfo(string providerName, ArchiveColumnInfo defaultColumn)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of archive provider |
ArchiveColumnInfo | defaultColumn | Column to make restriction for |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo | Populated restriction information object |
CreateDefaultRestrictionInfo(string, ArchiveColumnInfo, string)
Create an empty restriction information object for the given provider and column. This base implementation does not differentiate between providers - but a derived class might.
Declaration
protected ArchiveRestrictionInfo CreateDefaultRestrictionInfo(string providerName, ArchiveColumnInfo defaultColumn, string defaultRestrictionOperator)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of archive provider |
ArchiveColumnInfo | defaultColumn | Column to make restriction for |
string | defaultRestrictionOperator | Set a specific operator for the default restriction |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo | Populated restriction information object |
DeleteCriteria(string, string, int)
Delete all criteria associate with the given provider and storage key. Multiple searchCriteria rows will be deleted, and all dependent criteriaGroup, criterion and criterionValue rows
Declaration
public virtual void DeleteCriteria(string providerName, string storageKey, int groupRank = 0)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of provider |
string | storageKey | Storage key identifying the criteria to be deleted |
int | groupRank | Rank of the search criteria group. -1 will delete all groups. |
DeleteRestrictionGroup(string, string, int)
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
public virtual void DeleteRestrictionGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
int | rank |
GetHandledColumns(string)
Get the names of all columns handled for the given combination of provider name and storage type. These are the only valid column names for the other methods in this interface.
Declaration
public abstract string[] GetHandledColumns(string providerName)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Provider name to check for |
Returns
Type | Description |
---|---|
string[] | Array of column names. This array may be empty if no columns are handled. |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if there is no handler for the given storageType. |
GetRestrictionColumns(string, string)
Get the available columns from the archive provider, and keep only those marked with CanRestrict == true. Return a dictionary of column info indexed by name
Declaration
protected static Dictionary<string, ArchiveColumnInfo> GetRestrictionColumns(string providerName, string context)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of archive provider |
string | context |
Returns
Type | Description |
---|---|
Dictionary<string, ArchiveColumnInfo> | Dictionary<column name, column info> of columns |
GetRestrictionGroup(string, string, int)
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
public virtual ArchiveRestrictionGroup GetRestrictionGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
int | rank |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup |
GetRestrictionGroups(string, string)
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
public virtual ArchiveRestrictionGroup[] GetRestrictionGroups(string providerName, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup[] |
GetRestrictions(string, string)
Retrieve previously saved restrictions according to the given keys The ArchiveRestrictionInfo objects are fully populated, including the ArchiveColumnInfo part.
Declaration
public abstract ArchiveRestrictionInfo[] GetRestrictions(string providerName, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of archive list provider who owns/supplies/processes the columns |
string | storageKey | Key information to pass to storage handler, for distinguishing multiple criteria sets. For Find dialogs, this would be the 'associateId=<id>', since they are stored per associate; for reports, this would be 'publishId=<id>&associateId=<id>' since criteria sets for reports are stored per report and associate. This string can actually be anything that the handlers is prepared to accept and the examples here are guidelines. |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Array of restrictions. This array may be empty if no restrictions corresponded to the given key. |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if there is no handler for the given storageType. |
GetRestrictionsForGroup(string, string, int)
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
public virtual ArchiveRestrictionInfo[] GetRestrictionsForGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
int | rank |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] |
GetSpecifiedRestrictionsWithDefaults(string, string, params string[])
Retrieve previously saved restrictions, returning exactly those columns that have been specified. If the columns have valid saved values, those will be returned; otherwise, default values for operator and value will be created. The ArchiveRestrictionInfo objects are fully populated, including the ArchiveColumnInfo part.
Declaration
public abstract ArchiveRestrictionInfo[] GetSpecifiedRestrictionsWithDefaults(string providerName, string storageKey, params string[] columnNames)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of archive list provider who owns/supplies/processes the columns |
string | storageKey | Key information to pass to storage handler, for distinguishing multiple criteria sets. For Find dialogs, this would be the 'associateId=<id>', since they are stored per associate; for reports, this would be 'publishId=<id>&associateId=<id>' since criteria sets for reports are stored per report and associate. This string can actually be anything that the handlers is prepared to accept and the examples here are guidelines. |
string[] | columnNames | Array of column names, specifying the columns for which we want the ArchiveRestrictionInfo objects |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Array of restrictions. This array may be empty if no restrictions corresponded to the given key. |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if there is no handler for the given storageType. |
IsSaintColumn(string)
Determine whether a certain column name is a saint column or not (statuses are parsed only for the saintStatus prefix, which is not bomb-proof but generally good enough)
Declaration
protected bool IsSaintColumn(string columnName)
Parameters
Type | Name | Description |
---|---|---|
string | columnName |
Returns
Type | Description |
---|---|
bool | true if the column is a saint column |
IsStorageKeyNegativeOrZero(string)
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
protected bool IsStorageKeyNegativeOrZero(string storageKey)
Parameters
Type | Name | Description |
---|---|---|
string | storageKey |
Returns
Type | Description |
---|---|
bool |
IsStorageKeyZero(string)
Determine if the storage key is either empty, or only contains zero-valued id's
Declaration
protected bool IsStorageKeyZero(string storageKey)
Parameters
Type | Name | Description |
---|---|---|
string | storageKey | Storage key |
Returns
Type | Description |
---|---|
bool | true if there are no non-zero id's |
MapSaintColumn(Columns, out CounterType, out MainType, out int)
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
protected void MapSaintColumn(SaintRestrictionExtenderBase.Columns saintColumn, out SaintRestrictionExtenderBase.CounterType counterType, out SaintRestrictionExtenderBase.MainType mainType, out int skipValues)
Parameters
Type | Name | Description |
---|---|---|
SaintRestrictionExtenderBase.Columns | saintColumn | |
SaintRestrictionExtenderBase.CounterType | counterType | |
SaintRestrictionExtenderBase.MainType | mainType | |
int | skipValues |
SaveRestrictionGroup(string, string, ArchiveRestrictionGroup)
Base class for restriction storage providers, containing useful common methods. Inheriting from this class is useful but not mandatory for a storage provider.
Declaration
public virtual void SaveRestrictionGroup(string providerName, string storageKey, ArchiveRestrictionGroup restrictionGroup)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
ArchiveRestrictionGroup | restrictionGroup |
SaveRestrictions(string, string, params ArchiveRestrictionInfo[])
Save an array of restrictions for later use. The ColumnInfo member of the archive restriction info objects is not used and can be null.
Declaration
public abstract void SaveRestrictions(string providerName, string storageKey, params ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of archive list provider who owns/supplies/processes the columns |
string | storageKey | Key information to pass to storage handler, for distinguishing multiple criteria sets. For Find dialogs, this would be the 'associate=<id>', since they are stored per associate; for reports, this would be 'publish=<id>&associate=<id>' since criteria sets for reports are stored per report and associate. This string can actually be anything that the handlers is prepared to accept and the examples here are guidelines. The criteria storage provider genereally requires the keys to be valid table names, since it has to translate them into table numbers for the actual storage |
ArchiveRestrictionInfo[] | restrictions | Array of restrictions to be saved. Values, operators etc are also saved. |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if there is no handler for the given storageType, or if there were columns that could not be handled in the incoming array of restrictions. |