Class RestrictionCriteriaStorage
Concrete criteria storage class for handling search/find/selection/... restrictions - generally all restriction storage except for the Reporter panel
Implements
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
[RestrictionStoragePlugin("Criteria")]
[RestrictionStorageSentry("ContactDynamicSelection", "selection", "selection")]
public sealed class RestrictionCriteriaStorage : RestrictionStorageBase, IRestrictionStorage, IPlugin
Remarks
This class implements saving in a way that is compatible with the Windows client, so that saved dynamic selections work in exactly the same way.
By using the RestrictionStorageSentryAttribute, it is possible to declaratively force Sentry checks for certain combinations of previder name and storage key. Otherwise, no security restrictions are applied.
Constructors
RestrictionCriteriaStorage()
Declaration
public RestrictionCriteriaStorage()
Fields
StorageType
Declaration
public const string StorageType = "Criteria"
Field Value
Type | Description |
---|---|
String |
Methods
ConvertDateTimeOperators(ArchiveRestrictionInfo)
Declaration
public static bool ConvertDateTimeOperators(ArchiveRestrictionInfo restriction)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo | restriction |
Returns
Type | Description |
---|---|
Boolean |
CopyCriteria(Int32, Int32, Int32)
Declaration
public override void CopyCriteria(int sourceSearchCriteriaId, int ownerTable, int ownerId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sourceSearchCriteriaId | |
Int32 | ownerTable | |
Int32 | ownerId |
Overrides
DeleteCriteria(String, String, Int32)
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 override 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 |
Int32 | groupRank |
Overrides
DeleteRestrictionGroup(String, String, Int32)
Declaration
public override void DeleteRestrictionGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | |
String | storageKey | |
Int32 | rank |
Overrides
Flush()
Flush all cached information - the main purpose is to regenerate Saint statuses and Udef fields
Declaration
public static void Flush()
GetHandledColumns(String)
Declaration
public override string[] GetHandledColumns(string providerName)
Parameters
Type | Name | Description |
---|---|---|
String | providerName |
Returns
Type | Description |
---|---|
String[] |
Overrides
GetRestrictionGroup(String, String, Int32)
Declaration
public override ArchiveRestrictionGroup GetRestrictionGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | |
String | storageKey | |
Int32 | rank |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup |
Overrides
GetRestrictionGroups(String, String)
Declaration
public override ArchiveRestrictionGroup[] GetRestrictionGroups(string providerName, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | |
String | storageKey |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup[] |
Overrides
GetRestrictions(String, String)
Declaration
public override ArchiveRestrictionInfo[] GetRestrictions(string providerName, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | |
String | storageKey |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] |
Overrides
GetRestrictionsForGroup(String, String, Int32)
Get specified restrictions (no defaults), based on the provider name and storage key
Declaration
public override ArchiveRestrictionInfo[] GetRestrictionsForGroup(string providerName, string storageKey, int groupRank)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Name of archive list provider who owns/supplies/processes the columns. Note: The name may be of the from providerName|guiName, where the guiName is a secondary key that must also be matched by get/save/delete operations. If there is no pipe/guiName, then a blank guiName is used. |
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 generally requires the keys to be valid table names, since it has to translate them into table numbers for the actual storage |
Int32 | groupRank |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Array of restrictions found, or empty array if nothing was found |
Overrides
GetSpecifiedRestrictionsWithDefaults(String, String, String[])
Get the specified restrictions from the database; create and populate with defaults those that are not present in the database
Declaration
public override ArchiveRestrictionInfo[] GetSpecifiedRestrictionsWithDefaults(string providerName, string storageKey, params string[] requestedRestrictions)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Name of archive list provider who owns/supplies/processes the columns. Note: The name may be of the from providerName|guiName, where the guiName is a secondary key that must also be matched by get/save/delete operations. If there is no pipe/guiName, then a blank guiName is used. |
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 |
String[] | requestedRestrictions | Names of desired restrictions, using the format returned by GetUniqueRestrictionKey() (same as restriction name when there are no subretrictions, so you can safely use the restriction/column name directly if you are sure that subrestrictions will not be present). |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] |
Overrides
Remarks
Restrictions with subrestrictions have somewhat complicated behaviour. The key point to keep in mind is that such restrictions have a unique restriction key, defined in GetUniqueRestrictionKey(). This key is equal to the name if there are no subrestrictions, and contains subrestriction names and value if there are subrestrictions. Available columns in a provider NEVER contain such subrestriction specifications, while clients of this method WILL be using subrestrictions. We therefore have to accept any restriction whose base name matches an available restriction column; then we have to filter and match the retrieved restrictions to correctly identify them with any specified subrestrictions. If a subrestriction-qualified restriction is specified and not found, a restriction with the same base name and default subrestrictions will be returned, instead of the values specified.
GetStrippedProviderName(String)
Extract the actual provider name from a possible providerName|guiName composite name string
Declaration
public static string GetStrippedProviderName(string rawProviderName)
Parameters
Type | Name | Description |
---|---|---|
String | rawProviderName | raw provider name, may contain a pipe symbol and a gui name |
Returns
Type | Description |
---|---|
String | Provider name; what is in front of the optional pipe, or everything if no pipe is present |
SaveRestrictionGroup(String, String, ArchiveRestrictionGroup)
Declaration
public override void SaveRestrictionGroup(string providerName, string storageKey, ArchiveRestrictionGroup restrictionGroup)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | |
String | storageKey | |
ArchiveRestrictionGroup | restrictionGroup |
Overrides
SaveRestrictions(String, String, 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 override 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. Note: The name may be of the from providerName|guiName, where the guiName is a secondary key that must also be matched by get/save/delete operations. If there is no pipe/guiName, then a blank guiName is used. |
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. |
Overrides
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. |