Class ArchiveProviderFactory
This is the class factory for Archive Providers. It uses the SuperOffice.Factory.PluginFactory class together with the ArchiveProviderAttribute to identify classes that implement the IArchiveProvider interface. These are ordered by priority, the lowest value wins for any particular provider name. The system-standard providers all have priority int.MaxValue/2 so they are in the middle of the possible range.
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
[ClassFactory]
public class ArchiveProviderFactory : Object, IPrivateFactory
Constructors
ArchiveProviderFactory()
This is the class factory for Archive Providers. It uses the SuperOffice.Factory.PluginFactory class together with the ArchiveProviderAttribute to identify classes that implement the IArchiveProvider interface. These are ordered by priority, the lowest value wins for any particular provider name. The system-standard providers all have priority int.MaxValue/2 so they are in the middle of the possible range.
Declaration
public ArchiveProviderFactory()
Fields
DefaultPageSize
This is the class factory for Archive Providers. It uses the SuperOffice.Factory.PluginFactory class together with the ArchiveProviderAttribute to identify classes that implement the IArchiveProvider interface. These are ordered by priority, the lowest value wins for any particular provider name. The system-standard providers all have priority int.MaxValue/2 so they are in the middle of the possible range.
Declaration
public const int DefaultPageSize = 50
Field Value
Type | Description |
---|---|
Int32 |
Properties
KnownArchiveProviders
Returns an array of information about all known archive providers. This array reflects the state after prioritization and duplicate elimination, so that only 'surviving' providers are present.
Declaration
public static PluginInfo[] KnownArchiveProviders { get; }
Property Value
Type | Description |
---|---|
PluginInfo[] |
Methods
AddExtendersToProvider(IArchiveProviderExtensible)
Scans the available plugins to determine if there exist extenders to the given provider, and instantiates and links up each such extender.
Declaration
public static void AddExtendersToProvider(IArchiveProviderExtensible provider)
Parameters
Type | Name | Description |
---|---|---|
IArchiveProviderExtensible | provider | Extensible provider (parent) |
Remarks
The parent provider (target) for the extension is identified through the provider name declared by its ArchiveProvider attribute. If the target has no such attribute, then the unqualified class name is used instead. The fallback for missing attribute is not likely to be used as long as this method is called from within the Provider factory.
AddExtensionsToProvider(IArchiveProvider)
Given a provider, use reflection to discover subproviders and extensions, and instantiate & wire-up any such
Declaration
public static void AddExtensionsToProvider(IArchiveProvider result)
Parameters
Type | Name | Description |
---|---|---|
IArchiveProvider | result |
AddSubQueriesToMultiProvider(IArchiveMultiQueryProvider)
Scans the available plugins to determine if there exist subproviders intended for the given multi query provider, and instantiates and links up any such subproviders.
Declaration
public static void AddSubQueriesToMultiProvider(IArchiveMultiQueryProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IArchiveMultiQueryProvider | provider | Multi query provider (parent) |
Remarks
The parent provider (target) for the extension is identified through the provider name declared by its ArchiveProvider attribute. If the target has no such attribute, then the unqualified class name is used instead. The fallback for missing attribute is not likely to be used as long as this method is called from within the Provider factory.
Create(String)
Create a provider for the given provider name, and hook up any plugins registered for it.
Declaration
public static IArchiveProvider Create(string providerName)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Name of provider. Possibly including a string parameter, like name:parameter |
Returns
Type | Description |
---|---|
IArchiveProvider | Provider class, if at least one provider has registered for the name |
Remarks
Providers can be extended - subqueries added to multiqueryproviders, and extensions added to normal query providers. The hookup is done by the factory, not by each individual provider.
Create(String, String)
This is the class factory for Archive Providers. It uses the SuperOffice.Factory.PluginFactory class together with the ArchiveProviderAttribute to identify classes that implement the IArchiveProvider interface. These are ordered by priority, the lowest value wins for any particular provider name. The system-standard providers all have priority int.MaxValue/2 so they are in the middle of the possible range.
Declaration
public static IArchiveProvider Create(string providerName, string context)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | |
String | context |
Returns
Type | Description |
---|---|
IArchiveProvider |
Create(String, String, Boolean)
Create a provider for the given provider name, and hook up any plugins registered for it.
Declaration
public static IArchiveProvider Create(string providerName, string context, bool blockAggregationWrapper)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Name of provider. Possibly including a string parameter, like name:parameter |
String | context | Contextual information to pass on to providers' constructor; non-blank/non-null
values require the provider to have a public constructor taking the actual parameter type as its only parameter.
|
Boolean | blockAggregationWrapper | If true, then the |
Returns
Type | Description |
---|---|
IArchiveProvider | Provider class, if at least one provider has registered for the name |
Remarks
Providers can be extended - subqueries added to multiqueryproviders, and extensions added to normal query providers. The hookup is done by the factory, not by each individual provider.
An additional hookup is performed to add theFlush()
Reset all cached data - plugins created by factory, stock providers and cached column infos
Declaration
public static void Flush()
GetActualProvider(Type)
Determine the actual provider to create, given a known provider
Declaration
public static Type GetActualProvider(Type internalProvider)
Parameters
Type | Name | Description |
---|---|---|
Type | internalProvider | The original provider, usually something created by SuperOffice |
Returns
Type | Description |
---|---|
Type | The current provider class that fulfills this role. If the original type does not exist, does not have a valid attribute or does not have an implementation, the original, incoming type is returned. |
Remarks
Some internal multi-query providers hard-code what inner providers should be used. In this case it may still be useful to be able to override the standard providers with partner-defined ones. This method will extract the provider name attribute from the original provider, and determine what actual type corresponds to this name - taking any overrides into account.
GetAvailableColumns(String, String)
Get the available column list for the given provider. This method provides FAST, CACHED access to the column list, which is an order of magnitude faster than instantiating the provider just to get the same list.
Declaration
public static List<ArchiveColumnInfo> GetAvailableColumns(string providerName, string context = "")
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Case-insensitive name of provider |
String | context |
Returns
Type | Description |
---|---|
List<ArchiveColumnInfo> | List of available columns; the column objects are clones and may be mistreated in any way you desire :-) |
GetAvailableEntities(String, String)
Get the available entity list for the given provider. This method provides FAST, CACHED access to the entity list, which is an order of magnitude faster than instantiating the provider just to get the same list.
Declaration
public static List<ArchiveRowTypeInfo> GetAvailableEntities(string providerName, string context = "")
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Case-insensitive name of provider |
String | context |
Returns
Type | Description |
---|---|
List<ArchiveRowTypeInfo> | List of available entities; the entity objects are clones and may be mistreated in any way you desire :-) |
HandlesCustomObject(String, String)
This is the class factory for Archive Providers. It uses the SuperOffice.Factory.PluginFactory class together with the ArchiveProviderAttribute to identify classes that implement the IArchiveProvider interface. These are ordered by priority, the lowest value wins for any particular provider name. The system-standard providers all have priority int.MaxValue/2 so they are in the middle of the possible range.
Declaration
public static bool HandlesCustomObject(string providerName, string context = "")
Parameters
Type | Name | Description |
---|---|---|
String | providerName | |
String | context |
Returns
Type | Description |
---|---|
Boolean |