Interface IRestrictionStorage
This interface defines the operations for storing and retrieving arrays of restrictions. Such functionality is used to save search criteria on the Find dialogs; Dynamic Selection, and Reporter. The actual storage operations require a mapping between the provider and columns names, and whatever keying system is used by the storage provider. This mapping is internal to the storage providers, which are implemented as plugins with their own mapping system. The SuperOffice.CRM.Services.Implementation.DCF.ArchiveLists.IRestrictionStorage.GetHandledColumns method can be used to retrieve the list of columns handled by a particular provider, if filtering is needed.
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public interface IRestrictionStorage
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Examples
An outline implementation of a plugin may look like this:
[RestrictionStoragePlugin( StorageType )]
public class RestrictionCriteriaStorage : RestrictionStorageBase
{
const string StorageType = "Criteria";
public override void SaveRestrictions( string providerName, string storageKey, ArchiveRestrictionInfo[] restrictions )
{
throw new Exception( "The method or operation is not implemented." );
}
public override ArchiveRestrictionInfo[] GetRestrictions( string providerName, string storageKey )
{
throw new Exception( "The method or operation is not implemented." );
}
public override string[] GetHandledColumns( string providerName )
{
throw new Exception( "The method or operation is not implemented." );
}
}
Properties
Context
Contextual information to pass on to providers involved.
Declaration
string Context { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.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
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. |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.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
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. |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.DeleteRestrictionGroup(string, string, int)
This interface defines the operations for storing and retrieving arrays of restrictions. Such functionality is used to save search criteria on the Find dialogs; Dynamic Selection, and Reporter. The actual storage operations require a mapping between the provider and columns names, and whatever keying system is used by the storage provider. This mapping is internal to the storage providers, which are implemented as plugins with their own mapping system. The SuperOffice.CRM.Services.Implementation.DCF.ArchiveLists.IRestrictionStorage.GetHandledColumns method can be used to retrieve the list of columns handled by a particular provider, if filtering is needed.
Declaration
void DeleteRestrictionGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
int | rank |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Examples
An outline implementation of a plugin may look like this:
[RestrictionStoragePlugin( StorageType )]
public class RestrictionCriteriaStorage : RestrictionStorageBase
{
const string StorageType = "Criteria";
public override void SaveRestrictions( string providerName, string storageKey, ArchiveRestrictionInfo[] restrictions )
{
throw new Exception( "The method or operation is not implemented." );
}
public override ArchiveRestrictionInfo[] GetRestrictions( string providerName, string storageKey )
{
throw new Exception( "The method or operation is not implemented." );
}
public override string[] GetHandledColumns( string providerName )
{
throw new Exception( "The method or operation is not implemented." );
}
}
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
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. |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if there is no handler for the given storageType. |
GetRestrictionGroup(string, string, int)
This interface defines the operations for storing and retrieving arrays of restrictions. Such functionality is used to save search criteria on the Find dialogs; Dynamic Selection, and Reporter. The actual storage operations require a mapping between the provider and columns names, and whatever keying system is used by the storage provider. This mapping is internal to the storage providers, which are implemented as plugins with their own mapping system. The SuperOffice.CRM.Services.Implementation.DCF.ArchiveLists.IRestrictionStorage.GetHandledColumns method can be used to retrieve the list of columns handled by a particular provider, if filtering is needed.
Declaration
ArchiveRestrictionGroup GetRestrictionGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
int | rank |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Examples
An outline implementation of a plugin may look like this:
[RestrictionStoragePlugin( StorageType )]
public class RestrictionCriteriaStorage : RestrictionStorageBase
{
const string StorageType = "Criteria";
public override void SaveRestrictions( string providerName, string storageKey, ArchiveRestrictionInfo[] restrictions )
{
throw new Exception( "The method or operation is not implemented." );
}
public override ArchiveRestrictionInfo[] GetRestrictions( string providerName, string storageKey )
{
throw new Exception( "The method or operation is not implemented." );
}
public override string[] GetHandledColumns( string providerName )
{
throw new Exception( "The method or operation is not implemented." );
}
}
GetRestrictionGroups(string, string)
This interface defines the operations for storing and retrieving arrays of restrictions. Such functionality is used to save search criteria on the Find dialogs; Dynamic Selection, and Reporter. The actual storage operations require a mapping between the provider and columns names, and whatever keying system is used by the storage provider. This mapping is internal to the storage providers, which are implemented as plugins with their own mapping system. The SuperOffice.CRM.Services.Implementation.DCF.ArchiveLists.IRestrictionStorage.GetHandledColumns method can be used to retrieve the list of columns handled by a particular provider, if filtering is needed.
Declaration
ArchiveRestrictionGroup[] GetRestrictionGroups(string providerName, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup[] |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Examples
An outline implementation of a plugin may look like this:
[RestrictionStoragePlugin( StorageType )]
public class RestrictionCriteriaStorage : RestrictionStorageBase
{
const string StorageType = "Criteria";
public override void SaveRestrictions( string providerName, string storageKey, ArchiveRestrictionInfo[] restrictions )
{
throw new Exception( "The method or operation is not implemented." );
}
public override ArchiveRestrictionInfo[] GetRestrictions( string providerName, string storageKey )
{
throw new Exception( "The method or operation is not implemented." );
}
public override string[] GetHandledColumns( string providerName )
{
throw new Exception( "The method or operation is not implemented." );
}
}
GetRestrictions(string, string)
Retrieve previously saved restrictions according to the given keys The ArchiveRestrictionInfo objects are fully populated, including the ArchiveColumnInfo part.
Declaration
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. |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if there is no handler for the given storageType. |
GetRestrictionsForGroup(string, string, int)
This interface defines the operations for storing and retrieving arrays of restrictions. Such functionality is used to save search criteria on the Find dialogs; Dynamic Selection, and Reporter. The actual storage operations require a mapping between the provider and columns names, and whatever keying system is used by the storage provider. This mapping is internal to the storage providers, which are implemented as plugins with their own mapping system. The SuperOffice.CRM.Services.Implementation.DCF.ArchiveLists.IRestrictionStorage.GetHandledColumns method can be used to retrieve the list of columns handled by a particular provider, if filtering is needed.
Declaration
ArchiveRestrictionInfo[] GetRestrictionsForGroup(string providerName, string storageKey, int rank)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
int | rank |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Examples
An outline implementation of a plugin may look like this:
[RestrictionStoragePlugin( StorageType )]
public class RestrictionCriteriaStorage : RestrictionStorageBase
{
const string StorageType = "Criteria";
public override void SaveRestrictions( string providerName, string storageKey, ArchiveRestrictionInfo[] restrictions )
{
throw new Exception( "The method or operation is not implemented." );
}
public override ArchiveRestrictionInfo[] GetRestrictions( string providerName, string storageKey )
{
throw new Exception( "The method or operation is not implemented." );
}
public override string[] GetHandledColumns( string providerName )
{
throw new Exception( "The method or operation is not implemented." );
}
}
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
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. |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if there is no handler for the given storageType. |
SaveRestrictionGroup(string, string, ArchiveRestrictionGroup)
This interface defines the operations for storing and retrieving arrays of restrictions. Such functionality is used to save search criteria on the Find dialogs; Dynamic Selection, and Reporter. The actual storage operations require a mapping between the provider and columns names, and whatever keying system is used by the storage provider. This mapping is internal to the storage providers, which are implemented as plugins with their own mapping system. The SuperOffice.CRM.Services.Implementation.DCF.ArchiveLists.IRestrictionStorage.GetHandledColumns method can be used to retrieve the list of columns handled by a particular provider, if filtering is needed.
Declaration
void SaveRestrictionGroup(string providerName, string storageKey, ArchiveRestrictionGroup restrictionGroup)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | |
string | storageKey | |
ArchiveRestrictionGroup | restrictionGroup |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.Examples
An outline implementation of a plugin may look like this:
[RestrictionStoragePlugin( StorageType )]
public class RestrictionCriteriaStorage : RestrictionStorageBase
{
const string StorageType = "Criteria";
public override void SaveRestrictions( string providerName, string storageKey, ArchiveRestrictionInfo[] restrictions )
{
throw new Exception( "The method or operation is not implemented." );
}
public override ArchiveRestrictionInfo[] GetRestrictions( string providerName, string storageKey )
{
throw new Exception( "The method or operation is not implemented." );
}
public override string[] GetHandledColumns( string providerName )
{
throw new Exception( "The method or operation is not implemented." );
}
}
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
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. |
Remarks
The methods in this interface are context-free, i.e., a call to one methods use and leaves no state that influences the outcome or validity of any future call - except for the obvious consequence of being able to retrieve a previously saved set of restrictions. The factory instantiates ONE instance of each plugin when first referenced, and this instance is used for all future operations. Implementations should therefore have the external semantics of stateless singletons.
Each class that implements this interface handles one storageType. Storage types initially include 'Criteria' and 'Reporter', but the system is in principle extensible with any number of types. The RestrictionStorageFactory takes a storage type as its parameter and returns the plugin that handles the given type. Plugins declare their storage type using the RestrictionStoragePluginAttribute attribute. The RestrictionStorageBase class provides various helper methods that can be useful.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. |