• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Estrelica
    • Core
    • CoreConfig
    • CoreConfig.Settings
  • Estrelica.Archer.AccessControl
    • AccessControlEdit
    • AccountStatus
    • ContactSubType
    • ContactType
    • IArcherGroup
    • IArcherGroupEdit
    • IArcherRole
    • IArcherRoleEdit
    • IArcherUser
    • IArcherUserEdit
    • ISecurityParameter
    • IUserContact
    • IUserProvider
    • UserType
  • Estrelica.Archer.Content
    • ArcherContentExtensions
    • ContentFilterHelper
    • ContentReportOptions
    • ContentSearchOptions
    • ContentSource
    • ContentType
    • CurrentDateOperator
    • DatafeedHistoryStatus
    • DatafeedStatus
    • DatafeedType
    • DateOffsetOperator
    • DateValueOperator
    • DisplayFieldExtensions
    • EqualityOperator
    • FieldHistoryAuditType
    • HistoryAuditType
    • IAdvancedWorkflowAudit
    • IArcherContent
    • IArcherContentAccess
    • IArcherContentEdit
    • IArcherContentIdQuery
    • IArcherDateFieldQuery
    • IArcherDocument
    • IArcherMembershipQuery<T>
    • IArcherNumericFieldQuery
    • IArcherRecord
    • IArcherRecordQuery
    • IArcherReport
    • IArcherTextFieldQuery
    • IArcherUserGroupFieldQuery
    • IArcherValuesListQuery
    • IContentHistory
    • IContentInformation
    • IContentReport
    • IContentReportOptions
    • IContentUpdateInformation
    • ICrossReferencedRecordsSelectionEdit
    • IDatafeed
    • IDatafeedHistory
    • IDatafeedHistoryMessage
    • IDatafeedRecordCount
    • IDateValueEdit
    • IDisplayField
    • IDocumentSelectionEdit
    • IEditableField
    • IExternalLink
    • IExternalLinkEdit
    • IExternalLinksSelectionEdit
    • IFieldAudit
    • IFieldHistory
    • IFieldHistoryEx
    • IFieldQuery
    • IFieldValueEdit<T>
    • IHistoryAudit
    • INumericValueEdit
    • IObjectValue
    • IReferencedRecordsSelection
    • IReferencedRecordsSelectionEdit
    • ISearchDisplayFieldOptions
    • ISearchOptions
    • ISignatureAudit
    • IStatisticsReport
    • ISubEditableField
    • ISystemUpdateInformation
    • ITextValueEdit
    • IUserGroupListSelection
    • IUserGroupListSelectionEdit
    • IValuesListBaseSelection
    • IValuesListBaseSelectionEdit
    • IValuesListSelection
    • IValuesListSelectionEdit
    • IValuesListSingleSelection
    • IValuesListSingleSelectionEdit
    • IWorkflowAction
    • IWorkflowNode
    • LastUpdatedPreference
    • NumericRangeOperator
    • RecordCountType
    • RecordStatus
    • ReportSource
    • SortField
    • SortType
    • ValueOperator
    • ValuesOperator
    • WorkflowAuditActionType
  • Estrelica.Archer.Entity
    • ArcherEntityExtensions
    • ASOStatus
    • EntityType
    • IArcherAliasableEntity
    • IArcherAliasedEntity
    • IArcherASOEntity
    • IArcherASONamedEntity
    • IArcherBase
    • IArcherContentUpdateInfoEntity
    • IArcherDescribableEntity
    • IArcherDescribedEntity
    • IArcherEntity
    • IArcherEntityBase
    • IArcherGuidEntity
    • IArcherNameableEntity
    • IArcherNamedEntity
    • IArcherUpdateInfoEntity
    • IEditableArcherEntity
    • IUpdateInformation
    • SourceAttribute
    • UpstreamPropertyAttribute
  • Estrelica.Archer.Events
    • EventActionLayoutType
    • EventActionType
    • EventDateActionType
    • EventItemActionType
    • EventSectionActionType
    • IEventAction
    • IEventRule
    • ISetDateOption
  • Estrelica.Archer.Layouts
    • ILayout
    • ILayoutEntity
    • ILayoutItem
    • ILayoutSection
    • ILayoutTab
    • LayoutItemType
    • LayoutMemberType
    • LayoutSectionType
    • LayoutTabType
  • Estrelica.Archer.Metadata
    • ArcherMetadataExtensions
    • FilterConditionType
    • FilterCriteriaOperatorType
    • IArcherApplication
    • IArcherLevel
    • IArcherModule
    • IArcherQuestionnaire
    • IArcherSolution
    • IArcherSubForm
    • IArcherValuesList
    • IArcherValuesListValue
    • IFilterCondition
    • IFilterCriteria
    • ILevelFilter
    • ILevelFilterValue
    • IModuleOwner
    • IModuleOwnerGroup
    • IModuleOwnerUser
    • IModuleReference
    • INumericRange
    • INumericRangeValue
    • IQuestionnaireRule
    • ModuleClass
    • ModuleStatus
    • ModuleType
    • QuestionnaireRuleType
    • ReportType
    • Timezone
    • ValuesListType
    • ValueSortType
  • Estrelica.Archer.Metadata.Field
    • ArcherFieldExtensions
    • DefaultDateType
    • ExternalLinkProtocol
    • FieldEncryptionState
    • FieldType
    • IArcherField
    • IAssetResponsibilitiesField
    • IAttachmentField
    • IAvailableUserGroupSelections
    • IBaseDateField
    • ICalculatedValuesListField
    • IContentAccessHistoryField
    • ICrossApplicationStatusTrackingField
    • ICrossModuleStatusTrackingField
    • ICrossReferenceField
    • IDateField
    • IDiscussionField
    • IDocumentField
    • IExternalLinksField
    • IFirstPublishedField
    • IGroupPermission
    • IHistoryLogField
    • IImageField
    • IIPAddressField
    • ILastUpdatedField
    • IMatrixField
    • ImplementsAPIKey
    • ImplementsFieldTypeAttribute
    • IMultipleReferenceDisplayField
    • INumericField
    • IPermissionInheritance
    • IQuestionnaireReferenceField
    • IRecordStatusField
    • IReferenceField
    • IRelatedRecordsField
    • IRiskAssessmentField
    • ISchedulerField
    • ISubformField
    • ITechnologiesListField
    • ITechnologyVersionsListField
    • ITextField
    • ITrackingIDField
    • IUserGroupListField
    • IUserPermission
    • IValuesListField
    • IVotingField
    • SystemFieldType
    • UserGroupType
    • VotingType
  • Estrelica.Archer.Metadata.Field.Properties
    • DisplayControl
    • FieldLayoutFormat
    • IAdvancedDisplayOption
    • IAdvancedDisplayProperty
    • IAllowLookupProperty
    • IAllowSortingProperty
    • IColumnCountProperty
    • IDisplayControlProperty
    • IDisplayInHeaderProperty
    • IEncryptionStateProperty
    • IFieldValidationTypeProperty
    • IHeightWidthProperty
    • IIncludeTimeInformationProperty
    • IIncludeUserInformationProperty
    • IIsAuditEnabledProperty
    • IIsBulkCreateEnabledProperty
    • IIsBulkUpdateEnabledProperty
    • IIsCalculatedProperty
    • IIsEditableGridDisplayProperty
    • IIsEditableInSearchProperty
    • IIsEncryptedProperty
    • IIsFindEnabledProperty
    • IIsKeyProperty
    • IIsQuestionProperty
    • IIsRequiredProperty
    • IIsRestrictedToLevelProperty
    • IIsSupressedProperty
    • IIsTrendingEnabledProperty
    • IIsUniqueProperty
    • ILinkProperty
    • ILookupReportProperty
    • IMaxAttachmentsAllowedProperty
    • IMaxFileSizeProperty
    • IMaximumSelectionProperty
    • IMaxIntValueProperty
    • IMaxLongValueProperty
    • IMinAttachmentsAllowedProperty
    • IMinimumSelectionProperty
    • IMinIntValueProperty
    • IMinLongValueProperty
    • IMinMaxSelectionProperty
    • IPrefixProperty
    • ISuffixProperty
    • ITrendingDurationProperty
    • ITrendingDurationTypeProperty
    • MatrixAxis
    • NegativeDisplayType
  • Estrelica.Archer.Metadata.Properties
    • IIsDeprecatedProperty
    • IIsDirectToEditEnabledProperty
    • IIsMobileEnabledProperty
    • IIsNotificationProperty
    • IIsTaskManagementEnabledProperty
    • IIsWaveEnabledProperty
    • IKeepLicensedProperty
    • ISearchViewProperty
  • Estrelica.Archer.Utility
    • APIExceptionExtensions
    • APIPreference
    • APISource
    • ArcherAPIException
    • ArcherEntitySerializer
    • BaseDataWrapper<K>
    • CachedResolver
    • DictionaryDataWrapper<K>
    • DomainFormat
    • EditUtilities
    • ExtensionsUnavailableException
    • FilterCriteriaHelper
    • IAccessResolver
    • IAPIFacade
    • IArcherRestAPI
    • IArcherSoapAPI
    • IArcherUndocumentedAPI
    • ICastleHillExtendedAPI
    • IContentResolver
    • ILayoutResolver
    • IMetadataResolver
    • IReportResolver
    • IValueAccessor
    • ObjectDataWrapper<T, K>
    • ObjectKeyAttribute
    • ValuesListChangeEvent
    • ValuesListChangeEventArgs
  • Estrelica.Interfaces
    • IArcherAuthProvider
    • ICacheProvider
    • IClearable
    • IDatabaseAuthProvider
    • IEditable
    • IEditable<V>
    • IEditableCollection<V>
    • IEditableEnumerable<V>
    • IEditableFieldSelection<V>
    • IEditableInterface<I>
    • IEntityResolver
    • IExtendedAPIAuthProvider
    • IHttpClientAccessor
    • ILogCleanup
    • ILogSubscriber
    • InvalidateEntity<K>
    • InvalidateEntityEventArgs<K>
    • IRecordAccess
    • IRecordAccess<T>
    • IResolverProvider
    • ISessionProvider
    • ISystemUpdateable
    • ITrafficCounter
    • LogLevel
  • Estrelica.Logging
    • BaseLogger
    • ConsoleLogger
    • FileLogger
    • FileLogger.TimestampFormat
    • Logger
    • TraceLogger
  • Estrelica.Utility
    • Arguments
    • BaseRecordAccess
    • DataReaderExtensions
    • DateTimeExtensions
    • Debouncer
    • DebugLog
    • DeferEnumerable<T>
    • DeferValue<V>
    • DictionaryExtensions
    • EnumHelper
    • ExceptionExtensions
    • GuidUtility
    • HandledException
    • HashSetExtensions
    • ICacheHandler
    • ICollectionExtensions
    • IDeferrable
    • IDeferredValue
    • IEnumerableExtensions
    • IgnoreDefaultValuesDictionary<K, V>
    • JsonDictionary<V>
    • OperationExtensions
    • Resource
    • SqlConnectionExtensions
    • SqlUtilities
    • StreamExtensions
    • StringExtensions
    • TableMapper
    • TimeoutDictionary<K, V>
    • TypeExtensions
    • XElementExtensions

Interface IContentResolver

IContentResolver provides access to Archer content via the webservice Search API, returning Archer content records as either XElement objects (from the Archer web services Search API) or as IArcherContent dictionary objects (via the REST API). Returned content may be further converted into IArcherContentAccess results for simplified access via the ArcherContentExtensions.ContentAccess extension method.

IArcherContentAccess records in turn may be edited by calling the ForEdit() method on that interface, returning an IArcherContentEdit which allows the values in each editable field of the record to be modified. The resulting changes can be persisted back to the Archer instance by passing the modified IArcherContentEdit record to the [IContentResolver.Update()][xref:Estrelica.Archer.Utility.IContentResolver.Update*] method.

Inherited Members
ICacheProvider.CacheTimeoutMinutes
ICacheProvider.ClearCache()
ICacheProvider.TimeoutChanged
ICacheProvider.CreateCache<K, V>()
ICacheProvider.UnregisterCache<K, V>(IDictionary<K, V>)
Namespace: Estrelica.Archer.Utility
Assembly: Estrelica.Interfaces.dll
Syntax
[StayPublic]
[DoNotObfuscateType]
public interface IContentResolver : ICacheProvider

Properties

CallbackInterval

Sets the number of records that will be loaded during a search before each invocation of the Action<RecordCountType.Current, int> recordCountCallback method. Defaults to 100.

Declaration
int CallbackInterval { get; set; }
Property Value
int

DefaultPageSize

Sets the default page size for all Archer webservice Search API content activities performed by this IContentResolver instance. This value may be overridden on a per-call basis by passing a different value to any of the GetContent() methods via the (optional) pageSizeOverride parameter.

PageSize affects how search results are "split up" by the server in order to ensure the successful and timely return to the caller. For example, a search that results in a large return set of 50,000 records, each averaging 500kb in size, represents 25gb of data. Requesting this result set all at once will overwhelm the Archer server (both in terms of memory consumption and the time it takes for the server to assemble and transmit the results), so instead this search will be performed incrementally by requesting the results in multiple pages. At a page size of 100 (the default) this will require 500 separate requests to the server, but each page will only be 250mb in size and will be returned relatively quickly.

This property defaults to an aribtrary value of 100 but may be adjusted upward to optimize searches for cases involving few fields with relatively small individual records (e.g. cases involving mostly atomic Field types like numeric, date, IP address, etc.) or may be adjusted downward to avoid unnecessary retries for cases involving large numbers of fields returning large amounts of data (e.g. multiple text fields with thousands of characters per record).

An optimal page size would be one that allows the entire XML result of each page of records to be returned in a single HTTP call to Archer's search engine, while still requiring the fewest number of HTTP requests. This is influenced by a number of factors, including the field counts and content sizes mentioned above, as well as increased loads on the Archer server which may lead to HTTP request timeouts, "out of memory" server errors, and/or any HTTP response size limits that may be imposed on the Archer IIS server. Since these factors may vary from one call to the next, there is no "ideal" page size that fits all situations.

In all cases, smaller page sizes are safer, but will increase the number of HTTP calls required to return all expected results. Conversely, larger page sizes will require fewer requests, making the search operation faster, but may lead to the errors described above.

Should these errors occcur, the IContentResolver will adjust the page size on the fly to attempt a successful recovery, but this will necessarily result in more HTTP requests than would otherwise be required with a "correct" page size. Therefore it is advisable to determine a "best" page size empirically during development in order to optimize its value for each search.

Declaration
int DefaultPageSize { get; set; }
Property Value
int

SearchXmlPreview

If set to an action in your code, the ContentResolver will send its search XML to this action before sending it to Archer. This is helpful in debugging searches which don't return results as expected.

Declaration
Action<string> SearchXmlPreview { get; set; }
Property Value
Action<string>

Methods

CreateContent(IArcherLevel, ISubformField)

Returns a new empty IArcherContentEdit record ready for modification and eventual insertion into Archer via a subsequent call to Update().

Declaration
IArcherContentEdit CreateContent(IArcherLevel level, ISubformField subformField = null)
Parameters
IArcherLevel level

The IArcherLevel where the content will be saved

ISubformField subformField

Required if IArcherLevel is a subform level, specify the ISubformField of the "parent" level where the subform content will be referenced. Otherwise null (default).

Returns
IArcherContentEdit

An IArcherContentEdit record prepared for insertion into the IArcherLevel after edits have been made. The content does not actually exist until a subsequent call is made to IContentResolver.Update(record), passing this IArcherContentEdit in the record parameter.

Delete(IArcherContent)

Declaration
bool Delete(IArcherContent record)
Parameters
IArcherContent record

Returns
bool

Delete(int)

Declaration
bool Delete(int contentId)
Parameters
int contentId

Returns
bool

ExecuteSearch(string, Action<RecordCountType, int>)

Declaration
IEnumerable<XElement> ExecuteSearch(string searchOptionsXml, Action<RecordCountType, int> recordCountCallback)
Parameters
string searchOptionsXml

Action<RecordCountType, int> recordCountCallback

Returns
IEnumerable<XElement>

ExecuteSearch(XDocument, Action<RecordCountType, int>)

Declaration
IEnumerable<XElement> ExecuteSearch(XDocument searchOptions, Action<RecordCountType, int> recordCountCallback)
Parameters
XDocument searchOptions

Action<RecordCountType, int> recordCountCallback

Returns
IEnumerable<XElement>

ExtractDisplayFields(string)

Declaration
IEnumerable<IDisplayField> ExtractDisplayFields(string searchOptionsXml)
Parameters
string searchOptionsXml

Returns
IEnumerable<IDisplayField>

GetAttachment(int, bool)

Declaration
(string Filename, byte[] Data) GetAttachment(int fileId, bool treatResourceNotFoundAsNull = true)
Parameters
int fileId

bool treatResourceNotFoundAsNull

Returns
(string Filename, byte[] Data)

GetContent(ContentSearchOptions)

Retrieves all available content from a specific module or level based on options configured by the caller on a ContentSearchOptions object.

Declaration
IEnumerable<XElement> GetContent(ContentSearchOptions searchOptions)
Parameters
ContentSearchOptions searchOptions

Returns
IEnumerable<XElement>

GetContent(IArcherModule, IArcherLevel, Action<RecordCountType, int>, int?, Func<IArcherField, bool>, IEnumerable<int>, HashSet<int>, IEnumerable<XElement>, string, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>>, IEnumerable<SortField>, Action<string>, bool)

Retrieves all available content from an IArcherModule module and/or IArcherLevel level. If module is specified with no level, all level content from the module will be returned. If level is specified (with or without a module), content will only be returned from that specific level. While both parameters are nullable, at least one of the two must be provided in order to perform a content search.

Declaration
IEnumerable<XElement> GetContent(IArcherModule module = null, IArcherLevel level = null, Action<RecordCountType, int> recordCountCallback = null, int? pageSizeOverride = null, Func<IArcherField, bool> includeFieldCallback = null, IEnumerable<int> includeFieldIds = null, HashSet<int> expectedIds = null, IEnumerable<XElement> filterConditions = null, string filterOperatorLogic = null, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields = null, IEnumerable<SortField> sortFields = null, Action<string> searchXmlPreview = null, bool includeXmlComments = false)
Parameters
IArcherModule module

The module from which to retrieve content. Optional if level is specified, otherwise required if level is null.

IArcherLevel level

A specific level from that module from which content should be retrieved. If null, content from all levels in the module will be returned.

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

int? pageSizeOverride

Optional override value for the search page size. See the DefaultPageSize property for details.

Func<IArcherField, bool> includeFieldCallback

Optional Func<IArcherField, bool> callback method which can be used to limit the fields returned for each record. If provided, the method will be called for each field in the module/level and should return true for those that should be included, false for those that should not. If null, all fields will be included (assuming includeFieldIds is also null).

IEnumerable<int> includeFieldIds

Similar to includeFieldCallback, except instead of requiring a callback evaluation, this simply represents an IEnumerable<int> of integer field Ids that should be included in the results. If provided, only those fields whose Ids are present in the enumeration will be included. If null, all fields will be included (assuming includeFieldCallback is also null).

HashSet<int> expectedIds

Optional Hashset<int> of content Ids to be returned by the search. If not null/empty, the search will be filtered to return only the content having the Ids present in this hashset. Upon return the hashset will only contain Ids that were NOT returned by the search, with the expectation that the hashset will be empty if all of the expectedIds were found.

IEnumerable<XElement> filterConditions

Optional IEnumerable of XElement filter conditions node that will be applied to the search criteria. If non-null, these conditions will override any values passed in expectedIds. See the Archer Web Services API Reference Guide documentation for details on format.

string filterOperatorLogic

Optional string defining the grouping and order of filter conditions to be applied (e.g. "1 OR (2 AND 3)"). Optional and irrelevant if filterConditions are not provided. See the Archer Web Services API Reference Guide documentation for details on format.

Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields

An optional callback method allowing "contained display fields" to be specified for each applicable field in the results.

IEnumerable<SortField> sortFields

An optional set of SortField objects defining the order in which results should be returned. If null, the results will be ordered by Tracking Id or First Published date (if either field is available).

Action<string> searchXmlPreview

An optional callback that will allow you to preview the generated search xml before it is sent to the Archer server

bool includeXmlComments

If searchXmlPreview is not null, setting this to true will add XML comments for each referenced module/field in the search XML to assist with debugging

Returns
IEnumerable<XElement>

All available records from the specified Module/Level, limited to whatever fields are filtered by includeFieldCallback (if not null) and whose field Ids are present in includeFieldIds (if not null)

GetContent(Action<ContentSearchOptions>)

Retrieves all available content based on values set on the ContentSearchOptions object during searchOptionsCallback

Declaration
IEnumerable<XElement> GetContent(Action<ContentSearchOptions> searchOptionsCallback)
Parameters
Action<ContentSearchOptions> searchOptionsCallback

A required action which will be called by IContentResolver with a ContentSearchOptions object. The implementor is responsible for setting options on that object during the callback Action.

Returns
IEnumerable<XElement>

All available records as defined by the resulting ContentSearchOptions settings

GetContent(Guid?, Guid?, Action<RecordCountType, int>, int?, Func<IArcherField, bool>, IEnumerable<int>, HashSet<int>, IEnumerable<XElement>, string, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>>, IEnumerable<SortField>, Action<string>, bool)

Retrieves all available content from a specific module, by its Guid Id and/or a specific level, by its Guid Id. If moduleGuid is specified with no levelGuid, all level content from the module will be returned. If levelGuid is specified (with or without a moduleGuid), content will only be returned from that specific level. While both parameters are nullable, at least one of the two must be provided in order to perform a content search.

Declaration
IEnumerable<XElement> GetContent(Guid? moduleGuid, Guid? levelGuid = null, Action<RecordCountType, int> recordCountCallback = null, int? pageSizeOverride = null, Func<IArcherField, bool> includeFieldCallback = null, IEnumerable<int> includeFieldIds = null, HashSet<int> expectedIds = null, IEnumerable<XElement> filterConditions = null, string filterOperatorLogic = null, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields = null, IEnumerable<SortField> sortFields = null, Action<string> searchXmlPreview = null, bool includeXmlComments = false)
Parameters
Guid? moduleGuid

The Guid Id of a module from which to retrieve content

Guid? levelGuid

The Guid Id of a specific level from that module from which content should be retrieved. If null, content from all levels in the module will be returned.

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

int? pageSizeOverride

Optional override value for the search page size. See the DefaultPageSize property for details.

Func<IArcherField, bool> includeFieldCallback

Optional Func<IArcherField, bool> callback method which can be used to limit the fields returned for each record. If provided, the method will be called for each field in the module/level and should return true for those that should be included, false for those that should not. If null, all fields will be included (assuming includeFieldIds is also null).

IEnumerable<int> includeFieldIds

Similar to includeFieldCallback, except instead of requiring a callback evaluation, this simply represents an IEnumerable<int> of integer field Ids that should be included in the results. If provided, only those fields whose Ids are present in the enumeration will be included. If null, all fields will be included (assuming includeFieldCallback is also null).

HashSet<int> expectedIds

Optional Hashset<int> of content Ids to be returned by the search. If not null/empty, the search will be filtered to return only the content having the Ids present in this hashset. Upon return the hashset will only contain Ids that were NOT returned by the search, with the expectation that the hashset will be empty if all of the expectedIds were found.

IEnumerable<XElement> filterConditions

Optional IEnumerable of XElement filter conditions node that will be applied to the search criteria. If non-null, these conditions will override any values passed in expectedIds. See the Archer Web Services API Reference Guide documentation for details on format.

string filterOperatorLogic

Optional string defining the grouping and order of filter conditions to be applied (e.g. "1 OR (2 AND 3)"). Optional and irrelevant if filterConditions are not provided. See the Archer Web Services API Reference Guide documentation for details on format.

Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields

An optional callback method allowing "contained display fields" to be specified for each applicable field in the results.

IEnumerable<SortField> sortFields

An optional set of SortField objects defining the order in which results should be returned. If null, the results will be ordered by Tracking Id or First Published date (if either field is available).

Action<string> searchXmlPreview

An optional callback that will allow you to preview the generated search xml before it is sent to the Archer server

bool includeXmlComments

If searchXmlPreview is not null, setting this to true will add XML comments for each referenced module/field in the search XML to assist with debugging

Returns
IEnumerable<XElement>

All available records from the specified Module/Level, limited to whatever fields are filtered by includeFieldCallback (if not null) and whose field Ids are present in includeFieldIds (if not null)

GetContent(int?, int?, Action<RecordCountType, int>, int?, Func<IArcherField, bool>, IEnumerable<int>, HashSet<int>, IEnumerable<XElement>, string, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>>, IEnumerable<SortField>, Action<string>, bool)

Retrieves all available content from a specific module, by its integer Id and/or a specific level, by its integer Id. If moduleId is specified with no levelId, all level content from the module will be returned. If levelId is specified (with or without a moduleId), content will only be returned from that specific level. While both parameters are nullable, at least one of the two must be provided in order to perform a content search.

Declaration
IEnumerable<XElement> GetContent(int? moduleId, int? levelId = null, Action<RecordCountType, int> recordCountCallback = null, int? pageSizeOverride = null, Func<IArcherField, bool> includeFieldCallback = null, IEnumerable<int> includeFieldIds = null, HashSet<int> expectedIds = null, IEnumerable<XElement> filterConditions = null, string filterOperatorLogic = null, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields = null, IEnumerable<SortField> sortFields = null, Action<string> searchXmlPreview = null, bool includeXmlComments = false)
Parameters
int? moduleId

The integer Id of a module from which to retrieve content

int? levelId

The integer Id of a specific level from that module from which content should be retrieved. If null, content from all levels in the module will be returned.

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

int? pageSizeOverride

Optional override value for the search page size. See the DefaultPageSize property for details.

Func<IArcherField, bool> includeFieldCallback

Optional Func<IArcherField, bool> callback method which can be used to limit the fields returned for each record. If provided, the method will be called for each field in the module/level and should return true for those that should be included, false for those that should not. If null, all fields will be included (assuming includeFieldIds is also null).

IEnumerable<int> includeFieldIds

Similar to includeFieldCallback, except instead of requiring a callback evaluation, this simply represents an IEnumerable<int> of integer field Ids that should be included in the results. If provided, only those fields whose Ids are present in the enumeration will be included. If null, all fields will be included (assuming includeFieldCallback is also null).

HashSet<int> expectedIds

Optional Hashset<int> of content Ids to be returned by the search. If not null/empty, the search will be filtered to return only the content having the Ids present in this hashset. Upon return the hashset will only contain Ids that were NOT returned by the search, with the expectation that the hashset will be empty if all of the expectedIds were found.

IEnumerable<XElement> filterConditions

Optional IEnumerable of XElement filter conditions node that will be applied to the search criteria. If non-null, these conditions will override any values passed in expectedIds. See the Archer Web Services API Reference Guide documentation for details on format.

string filterOperatorLogic

Optional string defining the grouping and order of filter conditions to be applied (e.g. "1 OR (2 AND 3)"). Optional and irrelevant if filterConditions are not provided. See the Archer Web Services API Reference Guide documentation for details on format.

Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields

An optional callback method allowing "contained display fields" to be specified for each applicable field in the results.

IEnumerable<SortField> sortFields

An optional set of SortField objects defining the order in which results should be returned. If null, the results will be ordered by Tracking Id or First Published date (if either field is available).

Action<string> searchXmlPreview

An optional callback that will allow you to preview the generated search xml before it is sent to the Archer server

bool includeXmlComments

If searchXmlPreview is not null, setting this to true will add XML comments for each referenced module/field in the search XML to assist with debugging

Returns
IEnumerable<XElement>

All available records from the specified Module/Level, limited to whatever fields are filtered by includeFieldCallback (if not null) and whose field Ids are present in includeFieldIds (if not null)

GetContent(string, string, Action<RecordCountType, int>, int?, Func<IArcherField, bool>, IEnumerable<int>, HashSet<int>, IEnumerable<XElement>, string, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>>, IEnumerable<SortField>, Action<string>, bool)

Retrieves all available content from a specific named module, and optionally a specific named level within that module. If moduleName is specified with no levelName, all level content from the module will be returned. If levelName is specified in addition to moduleName, content will only be returned from that specific level within the module. Since level names are not unique system-wide, but only within a particular module, moduleName is always required in order to perform a content search.

Declaration
IEnumerable<XElement> GetContent(string moduleName, string levelName = null, Action<RecordCountType, int> recordCountCallback = null, int? pageSizeOverride = null, Func<IArcherField, bool> includeFieldCallback = null, IEnumerable<int> includeFieldIds = null, HashSet<int> expectedIds = null, IEnumerable<XElement> filterConditions = null, string filterOperatorLogic = null, Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields = null, IEnumerable<SortField> sortFields = null, Action<string> searchXmlPreview = null, bool includeXmlComments = false)
Parameters
string moduleName

The name of a module from which to retrieve content

string levelName

The name of a specific level from that module from which content should be retrieved. If null, content from all levels in the module will be returned.

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

int? pageSizeOverride

Optional override value for the search page size. See the DefaultPageSize property for details.

Func<IArcherField, bool> includeFieldCallback

Optional Func<IArcherField, bool> callback method which can be used to limit the fields returned for each record. If provided, the method will be called for each field in the module/level and should return true for those that should be included, false for those that should not. If null, all fields will be included (assuming includeFieldIds is also null).

IEnumerable<int> includeFieldIds

Similar to includeFieldCallback, except instead of requiring a callback evaluation, this simply represents an IEnumerable<int> of integer field Ids that should be included in the results. If provided, only those fields whose Ids are present in the enumeration will be included. If null, all fields will be included (assuming includeFieldCallback is also null).

HashSet<int> expectedIds

Optional Hashset<int> of content Ids to be returned by the search. If not null/empty, the search will be filtered to return only the content having the Ids present in this hashset. Upon return the hashset will only contain Ids that were NOT returned by the search, with the expectation that the hashset will be empty if all of the expectedIds were found.

IEnumerable<XElement> filterConditions

Optional IEnumerable of XElement filter conditions node that will be applied to the search criteria. If non-null, these conditions will override any values passed in expectedIds. See the Archer Web Services API Reference Guide documentation for details on format.

string filterOperatorLogic

Optional string defining the grouping and order of filter conditions to be applied (e.g. "1 OR (2 AND 3)"). Optional and irrelevant if filterConditions are not provided. See the Archer Web Services API Reference Guide documentation for details on format.

Func<IArcherField, IEnumerable<IArcherField>, IEnumerable<IArcherField>> filterContainedDisplayFields

An optional callback method allowing "contained display fields" to be specified for each applicable field in the results.

IEnumerable<SortField> sortFields

An optional set of SortField objects defining the order in which results should be returned. If null, the results will be ordered by Tracking Id or First Published date (if either field is available).

Action<string> searchXmlPreview

An optional callback that will allow you to preview the generated search xml before it is sent to the Archer server

bool includeXmlComments

If searchXmlPreview is not null, setting this to true will add XML comments for each referenced module/field in the search XML to assist with debugging

Returns
IEnumerable<XElement>

All available records from the specified Module/Level, limited to whatever fields are filtered by includeFieldCallback (if not null) and whose field Ids are present in includeFieldIds (if not null)

GetContentById(int, bool)

Returns a single IArcherContent content record containing all available fields for the record. This is essentially an IDictionary<string, object> result with additional properties to identify it as a unit of Archer content.

Declaration
IArcherContent GetContentById(int contentId, bool treatResourceNotFoundAsNull = true)
Parameters
int contentId

The internal database content_id of the record to be returned

bool treatResourceNotFoundAsNull

If true, null will be returned for and invalid contentId. Otherwise an exception will be raised.

Returns
IArcherContent

An IArcherContent record if the record is available

GetContentById(int, IEnumerable<IArcherField>, bool)

Returns a single IArcherContent content record, optionally projected to a limited set of fields from the record. This is essentially an IDictionary<string, object> result with additional properties to identify it as a unit of Archer content.

Declaration
IArcherContent GetContentById(int contentId, IEnumerable<IArcherField> fieldsToReturn, bool treatResourceNotFoundAsNull = true)
Parameters
int contentId

The internal database content_id of the record to be returned

IEnumerable<IArcherField> fieldsToReturn

And optional set of IArcherFields representing the fields to be returned for each record.

bool treatResourceNotFoundAsNull

If true, null will be returned for an invalid contentId. Otherwise an exception will be raised.

Returns
IArcherContent

An IArcherContent record if the record is available

GetContentById(int, IEnumerable<int>, bool)

Returns a single IArcherContent content record, optionally projected to a limited set of fields from the record. This is essentially an IDictionary<string, object> result with additional properties to identify it as a unit of Archer content.

Declaration
IArcherContent GetContentById(int contentId, IEnumerable<int> fieldsToReturn, bool treatResourceNotFoundAsNull = true)
Parameters
int contentId

The internal database content_id of the record to be returned

IEnumerable<int> fieldsToReturn

And optional set of ids for the fields to be returned for each record.

bool treatResourceNotFoundAsNull

If true, null will be returned for and invalid contentId. Otherwise an exception will be raised.

Returns
IArcherContent

An IArcherContent record if the record is available

GetContentByIds(IEnumerable<int>, Action<RecordCountType, int>, bool)

Returns an enumerable result of IArcherContent records matching a requested set of content Ids.

Declaration
IEnumerable<IArcherContent> GetContentByIds(IEnumerable<int> contentIds, Action<RecordCountType, int> recordCountCallback = null, bool treatResourceNotFoundAsEmptyResult = true)
Parameters
IEnumerable<int> contentIds

An IEnumerable of integer Ids representing the internal database content_id of each record to be returned

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

bool treatResourceNotFoundAsEmptyResult

If true, an empty IEnumerable<IArcherContent> if contentIds are invalid, otherwise an exception will be raised.

Returns
IEnumerable<IArcherContent>

An IEnumerable<IArcherContent> of records returned for the specified content Ids

GetContentByIds(IEnumerable<int>, IEnumerable<IArcherField>, Action<RecordCountType, int>, bool)

Returns an enumerable result of IArcherContent records matching a requested set of content Ids.

Declaration
IEnumerable<IArcherContent> GetContentByIds(IEnumerable<int> contentIds, IEnumerable<IArcherField> fieldsToReturn, Action<RecordCountType, int> recordCountCallback = null, bool treatResourceNotFoundAsEmptyResult = true)
Parameters
IEnumerable<int> contentIds

An IEnumerable of integer Ids representing the internal database content_id of each record to be returned

IEnumerable<IArcherField> fieldsToReturn

An optional IEnumerable of IArcherField references indicating the desired fields to be included for each record in the result. If null, all available fields will be returned.

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

bool treatResourceNotFoundAsEmptyResult

If true, an empty IEnumerable<IArcherContent> if contentIds or fieldsToReturn are invalid, otherwise an exception will be raised.

Returns
IEnumerable<IArcherContent>

An IEnumerable<IArcherContent> of records returned for the specified content Ids and fields

GetContentByIds(IEnumerable<int>, IEnumerable<int>, Action<RecordCountType, int>, bool)

Returns an enumerable result of IArcherContent records matching a requested set of content Ids.

Declaration
IEnumerable<IArcherContent> GetContentByIds(IEnumerable<int> contentIds, IEnumerable<int> fieldsToReturn, Action<RecordCountType, int> recordCountCallback = null, bool treatResourceNotFoundAsEmptyResult = true)
Parameters
IEnumerable<int> contentIds

An IEnumerable of integer Ids representing the internal database content_id of each record to be returned

IEnumerable<int> fieldsToReturn

An optional IEnumerable of integer field Ids indicating the desired fields to be included for each record in the result. If null, all available fields will be returned.

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

bool treatResourceNotFoundAsEmptyResult

If true, an empty IEnumerable<IArcherContent> if contentIds or fieldsToReturn are invalid, otherwise an exception will be raised.

Returns
IEnumerable<IArcherContent>

An IEnumerable<IArcherContent> of records returned for the specified content Ids and fields

GetContentHistory(int)

Returns tracked history from all available History Log fields for a given Archer content record

Declaration
IEnumerable<IContentHistory> GetContentHistory(int contentId)
Parameters
int contentId

The content Id of the record

Returns
IEnumerable<IContentHistory>

A collection of IContentHistory results, one for each History Log field in the content's level.

Remarks

Returns an empty set if no History Log fields are accessible for the record or level. See IArcherContentAccess.ContentHistory and related methods for other ways to access this information.

GetContentHistory(int, IHistoryLogField)

Returns tracked history from a single history log field for a given Archer content record

Declaration
IContentHistory GetContentHistory(int contentId, IHistoryLogField historyLogField)
Parameters
int contentId

The content Id of the record

IHistoryLogField historyLogField

The IHistoryLog field responsible for tracking the changes

Returns
IContentHistory

An IContentHistory result containing all the changes tracked by the History Log field

GetContentHistory(int, int)

Returns tracked history from a single history log field for a given Archer content record

Declaration
IContentHistory GetContentHistory(int contentId, int historyLogFieldId)
Parameters
int contentId

The content Id of the record

int historyLogFieldId

The integer Id of the History Log field responsible for tracking the changes

Returns
IContentHistory

An IContentHistory result containing all the changes tracked by the History Log field

GetFieldAuditInfo(int, int)

Declaration
IDictionary<int, IDictionary<string, dynamic>> GetFieldAuditInfo(int levelId, int contentId)
Parameters
int levelId

int contentId

Returns
IDictionary<int, IDictionary<string, dynamic>>

GetFieldAuditInfo(int, int, int)

Declaration
IDictionary<string, dynamic> GetFieldAuditInfo(int levelId, int contentId, int fieldId)
Parameters
int levelId

int contentId

int fieldId

Returns
IDictionary<string, dynamic>

GetLevelForContent(int)

Declaration
IArcherLevel GetLevelForContent(int contentId)
Parameters
int contentId

Returns
IArcherLevel

GetReportContent(Guid, Action<RecordCountType, int>, Action<IEnumerable<IArcherField>>)

Returns all records for a given Archer report. Requires extended method capability in order to resolve the report's Id via its Guid.

Declaration
IEnumerable<XElement> GetReportContent(Guid reportGuid, Action<RecordCountType, int> recordCountCallback = null, Action<IEnumerable<IArcherField>> fieldMetadataCallback = null)
Parameters
Guid reportGuid

The Guid Id of the report to be queried

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

Action<IEnumerable<IArcherField>> fieldMetadataCallback

Optional Action<IEnumerable<IArcherField>> callback that will be invoked for each field discovered in the returned metadata.

Returns
IEnumerable<XElement>

An IEnumerable<XElement> of records returned for the specified report Guid

GetReportContent(int, Action<RecordCountType, int>, Action<IEnumerable<IArcherField>>)

Returns all records for a given Archer report.

Declaration
IEnumerable<XElement> GetReportContent(int reportId, Action<RecordCountType, int> recordCountCallback = null, Action<IEnumerable<IArcherField>> fieldMetadataCallback = null)
Parameters
int reportId

The integer Id of the report to be queried

Action<RecordCountType, int> recordCountCallback

Optional Action<RecordCountType, int> callback method which will be invoked periodically to provide progress information about the search. See the RecordCountType enumeration for details

Action<IEnumerable<IArcherField>> fieldMetadataCallback

Optional Action<IEnumerable<IArcherField>> callback that will be invoked for each field discovered in the returned metadata.

Returns
IEnumerable<XElement>

An IEnumerable<XElement> of records returned for the specified report Id

GetStatisticsReportContent(Guid, Action<RecordCountType, int>, Action<IEnumerable<IArcherField>>)

Declaration
IEnumerable<string> GetStatisticsReportContent(Guid statisticsReportGuid, Action<RecordCountType, int> recordCountCallback = null, Action<IEnumerable<IArcherField>> fieldMetadataCallback = null)
Parameters
Guid statisticsReportGuid

Action<RecordCountType, int> recordCountCallback

Action<IEnumerable<IArcherField>> fieldMetadataCallback

Returns
IEnumerable<string>

GetStatisticsReportContent(int, Action<RecordCountType, int>, Action<IEnumerable<IArcherField>>)

Declaration
IEnumerable<string> GetStatisticsReportContent(int statisticsReportId, Action<RecordCountType, int> recordCountCallback = null, Action<IEnumerable<IArcherField>> fieldMetadataCallback = null)
Parameters
int statisticsReportId

Action<RecordCountType, int> recordCountCallback

Action<IEnumerable<IArcherField>> fieldMetadataCallback

Returns
IEnumerable<string>

GetWorkflowNode(int)

Gets a workflow node representing the current workflow state and applicable actions for a given Archer content record

Declaration
IWorkflowNode GetWorkflowNode(int contentId)
Parameters
int contentId

The content Id of the Archer record to be queried

Returns
IWorkflowNode

An IWorkflowNode representing the record's workflow state and actions, or null if the record is not enrolled in workflow

PerformWorkflowAction(int, IWorkflowAction)

Performs a given IWorkflowAction on an Archer content record

Declaration
bool PerformWorkflowAction(int contentId, IWorkflowAction action)
Parameters
int contentId

The content Id of the record on which to perform the IWorkflowAction

IWorkflowAction action

The IWorkflowAction to be performed

Returns
bool

True if the action was successfully performed, otherwise False

Update(IArcherContentEdit)

Pushes an edited IArcherContentEdit record to the REST API for insert or update.

Declaration
int Update(IArcherContentEdit record)
Parameters
IArcherContentEdit record

The record to be inserted or updated.

Returns
int

The content Id of the inserted or updated record

Exceptions
AggregateException

An Aggregate exception describing each constraint violation returned by the Archer REST API separately as InnerExceptions

UploadAttachment(string, string, bool)

Declaration
int UploadAttachment(string sourceFilename, string attachmentName = null, bool encryptBeforeSaving = false)
Parameters
string sourceFilename

string attachmentName

bool encryptBeforeSaving

Returns
int

Extension Methods

EnumHelper.In<TEnum>(TEnum, params TEnum[])
IEnumerableExtensions.ToEnumerable<T>(T)
StringExtensions.AssertNotNull<T>(T, string)
TypeExtensions.WithDispose<T, V>(T, Func<T, V>)
EnumHelper.CastNullable<TEnum>(object)
TypeExtensions.ConvertTo<V>(object)
TypeExtensions.TryConvert<V>(object, out V)
Back to top Copyright 2019-2023 by CastleHill Software LLC