IArchiveAgent is the common interface for the ArchiveAgent.
Methods
Following is a list of methods provided by the agent that helps us to manipulate the content of the Archives.
Activity filters are restrictions that help place restrictions on the output returned.
Example
The example below shows us how we may make use of theIArchiveAgent interface and its methods.
CS
GetArchiveListByColumns()
The method call itself is a simple statement. The difficult part is to create the parameters that should be passed to it.CS
GetArchiveListByColumns method requires 7 parameters.
- archiveProviderName - the name of the provider that will be used to retrieve the required information. In the example, the person provider will be created using the
ArchiveProviderFactoryfrom a plugin.
CS
- archiveColumns - the list of columns that needs to be returned by the method. The list is an array of string which can be declared as follows.
CS
The names of the columns differ from the names that have been given in the database. Use the
IArchiveProver to retrieve the columns that are available under a particular column.- archiveSrtOrd - the sort order in which the returned data should be sorted. Can be null, which indicates no particular order.
CS
ArchiveOrderByInfo is defined in SuperOffice.CRM.ArchiveLists.
- archiveRest - an array of
ArchiveRestrictionInfothat contains the restriction on which the retrieved archive list is based on.
CS
- desiredEntities - tells the method to include only the details of all the entities given in the array. Can be null, which indicates that all entities will be included.
CS
- page and pageSize - page (number) 0 is the first page; pageSize is the number of rows that should be contained in a page
CS
Result
Once all parameters have been created we may use them with theGetArchiveListByColumns method which returns an array of ArchiveListItem.
CS
archiveRow.ColumnData is a dictionary of column data items. Each column data item contains a display value, a tooltip hint, a link hint, and an ordinary value. The display values are encoded by the CultureDataFormatter and can be decoded/localized by that class. All other values are optional.
Tooltip hints can be passed into the TooltipProvider (Tooltip service) to be translated into an actual tooltip.
The second for-loop is the one that actually retrieves the data from the database.
CS
ArchiveRow.ColumnData’s DisplayValue property, which is the visible display value for an archive cell. This is always a String and any other data type should be converted to it according to the invariant culture.