Class TemplateLanguageProvider
Archive Provider for retriving the registered languages for a given document template. The provider will use the document plugin to get the languages registered.
Implements
Inherited Members
Namespace: SuperOffice.CRM.ArchiveLists.Archive___ListItems
Assembly: SoDataBase.dll
Syntax
[ArchiveProvider("TemplateLanguage", 1073741823)]
public class TemplateLanguageProvider : IArchiveProvider, IArchiveProviderHasRows, IArchiveProviderHasColumns, IArchiveProviderHasEntities
Constructors
TemplateLanguageProvider()
Archive Provider for retriving the registered languages for a given document template. The provider will use the document plugin to get the languages registered.
Declaration
public TemplateLanguageProvider()
Fields
ProviderName
Archive Provider for retriving the registered languages for a given document template. The provider will use the document plugin to get the languages registered.
Declaration
public const string ProviderName = "TemplateLanguage"
Field Value
Type | Description |
---|---|
string |
Methods
Close()
Call this method after the last desired row has been read; this gives the provider the chance to close and free any underlying queries
Declaration
public void Close()
GetAvailableColumns()
Get the list of columns handled by this provider
Declaration
public List<ArchiveColumnInfo> GetAvailableColumns()
Returns
Type | Description |
---|---|
List<ArchiveColumnInfo> |
GetAvailableEntities()
Get the list of entities supported by this provider
Declaration
public List<ArchiveRowTypeInfo> GetAvailableEntities()
Returns
Type | Description |
---|---|
List<ArchiveRowTypeInfo> |
GetReader(string)
Start the reader and return an IDataReader (which, as we remember, also inherits IDataRecord for access to individual data fields). This provides an alternative, more generic and more standards-based interface to data. Use either GetRows or GetReader on any particular archive provider instance.
Declaration
public IDataReader GetReader(string options)
Parameters
Type | Name | Description |
---|---|---|
string | options |
Returns
Type | Description |
---|---|
IDataReader |
GetResultInformation()
Get additional information about the result, such as row count or other optional items. This method should be called some time after GetRows, but before Close. Delaying calls to this method as long as possible will give its (asynchronous) internal counterpart more time to complete and lessen the response-time impact of calling it.
Declaration
public ArchiveResultInformation GetResultInformation()
Returns
Type | Description |
---|---|
ArchiveResultInformation |
GetRows(string)
Start the query and return an iterator. The .Current property will be a valid ArchiveRow containing one row, as long as a previous call to .MoveNext returned true. This is the standard semantics for an iterator. Do remember to call Close afterwards, to clean up all resources.
Declaration
public IEnumerable<ArchiveRow> GetRows(string options)
Parameters
Type | Name | Description | ||||
---|---|---|---|---|---|---|
string | options | A set of options, using the query string format (name=value&...). Can be null or empty.
|
Returns
Type | Description |
---|---|
IEnumerable<ArchiveRow> | An iterator, following the usual conventions. MoveNext will return false when there are no more rows, which can either be because the result set is exhausted, or because the page size has been reached |
Remarks
You can use the foreach keyword to iterate over rows, like this:
IArchiveProvider provider = ArchiveProviderFactory.Create("person");
// not shown - set desired columns, entities, restrictions, paging
foreach( ArchiveRow row in provider.GetRows() )
{
// process row here
}
provider.Close();
SetDesiredColumns(params string[])
Set which columns should actually be returned, must be a subset of the GetAvailableColumns result
Declaration
public void SetDesiredColumns(params string[] columnIds)
Parameters
Type | Name | Description |
---|---|---|
string[] | columnIds | Array of column ID's representing the desired columns |
SetDesiredEntities(params string[])
Archive Provider for retriving the registered languages for a given document template. The provider will use the document plugin to get the languages registered.
Declaration
public void SetDesiredEntities(params string[] entities)
Parameters
Type | Name | Description |
---|---|---|
string[] | entities | Array of entity names, semantically equivalent to ArchiveEntityInfo.Name fields. |
SetOrderBy(params ArchiveOrderByInfo[])
Archive Provider for retriving the registered languages for a given document template. The provider will use the document plugin to get the languages registered.
Declaration
public void SetOrderBy(params ArchiveOrderByInfo[] orderBy)
Parameters
Type | Name | Description |
---|---|---|
ArchiveOrderByInfo[] | orderBy | Array of order by items |
SetPagingInfo(int, int)
Set the paging properties of the provider. The default is to fetch page zero, of one thousand (1000) rows. A more reasonable page size is probably around 100. Note that the query processing strategy may change for very large pages (more than 1000) and give significantly longer response times. Performance is improved by setting the page size low, as long as you don't set it lower than what you realistically expect to need (fetching multiple pages is more expensive than fetching one).
Declaration
public void SetPagingInfo(int pageSize, int pageNumber)
Parameters
Type | Name | Description |
---|---|---|
int | pageSize | Desired page size |
int | pageNumber | Desired page number to return |
SetRestriction(params ArchiveRestrictionInfo[])
Set query restriction globally, supersedes previous restrictions
Declaration
public bool SetRestriction(params ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
ArchiveRestrictionInfo[] | restrictions | Array of restrictions, with an implicit AND between them |
Returns
Type | Description |
---|---|
bool | true if at least one of the restrictions matched one of the available columns of the provider |