Class RepositoryClientBase
Provides a base class for all repository clients, and implements several helper methods.
Implements
Inherited Members
Namespace: Algenta.Colectica.Model.Repository
Assembly: Algenta.Colectica.Model.dll
Syntax
public abstract class RepositoryClientBase : IDisposable
Constructors
RepositoryClientBase()
Initializes a new instance of the RepositoryClientBase class.
Declaration
protected RepositoryClientBase()
RepositoryClientBase(RepositoryConnectionInfo)
Initializes a new instance of the RepositoryClientBase class.
Declaration
protected RepositoryClientBase(RepositoryConnectionInfo connectionInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositoryConnectionInfo | connectionInfo | The connection information. |
Properties
ClientType
Gets the type of the client.
Declaration
public abstract ClientType ClientType { get; }
Property Value
| Type | Description |
|---|---|
| ClientType |
ConnectionInfo
Gets or sets the connection information.
Declaration
public RepositoryConnectionInfo ConnectionInfo { get; set; }
Property Value
| Type | Description |
|---|---|
| RepositoryConnectionInfo |
Name
Gets the name of the repository.
Declaration
public abstract string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
AddItemsToTransactionAsync(RepositoryTransactionAddItemsRequest)
Add items to a transaction to be registered
Declaration
public abstract Task<RepositoryTransaction> AddItemsToTransactionAsync(RepositoryTransactionAddItemsRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositoryTransactionAddItemsRequest | request | transaction identifier and repository items |
Returns
| Type | Description |
|---|---|
| Task<RepositoryTransaction> | Transaction metadata |
AddPermissions(RepositorySecurityContext)
Adds the specified permissions to the repository.
Declaration
public abstract void AddPermissions(RepositorySecurityContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositorySecurityContext | context | The context defining the permissions. |
AdvancedSearchAsync(AdvancedSearchRequest)
Searches the specified the repository for items, according to the provided search options.
Declaration
public abstract Task<AdvancedSearchResponse> AdvancedSearchAsync(AdvancedSearchRequest facet)
Parameters
| Type | Name | Description |
|---|---|---|
| AdvancedSearchRequest | facet | The parameters for the search. |
Returns
| Type | Description |
|---|---|
| Task<AdvancedSearchResponse> | A search response, which includes the matching results and summary information. |
BatchGetRepositoryItems(Collection<IdentifierTriple>)
Gets multiple items from the repository, requesting the items in batches.
Declaration
public Collection<RepositoryItem> BatchGetRepositoryItems(Collection<IdentifierTriple> ids)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | ids | The identifiers of the items to get from the repository. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryItem> | A collection of repository items. |
BatchRegisterItems(Collection<RepositoryItem>, CommitOptions)
Registers multiple items in the repository, sending the items in batches.
Declaration
public Collection<RepositoryConflict> BatchRegisterItems(Collection<RepositoryItem> items, CommitOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<RepositoryItem> | items | The items to register. |
| CommitOptions | options | The options to be passed to the repository. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryConflict> |
CancelTransactionAsync(RepositoryTransactionCancelOptions)
Cancel a transaction
Declaration
public abstract Task<RepositoryTransaction> CancelTransactionAsync(RepositoryTransactionCancelOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositoryTransactionCancelOptions | options | Transaction cancelation options |
Returns
| Type | Description |
|---|---|
| Task<RepositoryTransaction> | Transaction metadata |
CommitTransactionAsync(RepositoryTransactionCommitOptions)
Register the items in the transaction
Declaration
public abstract Task<RepositoryTransactionResult> CommitTransactionAsync(RepositoryTransactionCommitOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositoryTransactionCommitOptions | options | Specify version updating and progagation rules |
Returns
| Type | Description |
|---|---|
| Task<RepositoryTransactionResult> | Transaction metadata |
CreateComment(Guid, string, long, string)
Adds a comment to the specified item.
Declaration
public abstract void CreateComment(Guid identifier, string agency, long version, string comment)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | identifier | The identifier of the item to which the comment will be added. |
| string | agency | The agency of the item to which the comment will be added. |
| long | version | The version of the item to which the comment will be added. |
| string | comment | The comment. |
CreateRepository(string, string)
Marks the repository as authoritative for the specified agency.
Declaration
public abstract void CreateRepository(string agency, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | agency | The agency for which the repository will be marked as authoritative. |
| string | name | The name of the agency. |
CreateTag(IdentifierTriple, string)
Applies a tag to an item in the repository.
Declaration
public void CreateTag(IdentifierTriple compositeId, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | compositeId | The identifier of the item to which the tag will be applied. |
| string | name | The tag to be applied. |
CreateTag(Guid, string, long, string)
Applies a tag to an item in the repository.
Declaration
public abstract void CreateTag(Guid id, string agency, long version, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to which the tag will be applied. |
| string | agency | The agency of the item to which the tag will be applied. |
| long | version | The version of the item to which the tag will be applied. |
| string | name | The tag to be applied. |
CreateTransactionAsync()
Create a new Repository transaction
Declaration
public abstract Task<RepositoryTransaction> CreateTransactionAsync()
Returns
| Type | Description |
|---|---|
| Task<RepositoryTransaction> | Transaction metadata |
DeleteItemsAsync(DeleteItems)
Removes items from the Repository
Declaration
public abstract Task<DeleteResult> DeleteItemsAsync(DeleteItems deleteItems)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteItems | deleteItems | Specify the items to delete |
Returns
| Type | Description |
|---|---|
| Task<DeleteResult> | The results of the deletion operation, and lists of items not removed due to relationships |
DeprecateAllItemVersions(Guid, string)
Deprecates all versions of an item.
Declaration
public abstract void DeprecateAllItemVersions(Guid id, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to deprecate. |
| string | agency | The agency of the item to deprecate. |
DeprecateItem(Guid, string, long)
Deprecates the specified item.
Declaration
public abstract void DeprecateItem(Guid id, string agency, long version)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to deprecate. |
| string | agency | The agency of the item to deprectate. |
| long | version | The version of the item to deprecate. |
DeserializeRepositoryItem(RepositoryItem, ChildReferenceProcessing, ItemCache)
Deserializes the repository item into a IVersionable object.
Declaration
public IVersionable DeserializeRepositoryItem(RepositoryItem item, ChildReferenceProcessing processing, ItemCache cache = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositoryItem | item | The item to be deserialized. |
| ChildReferenceProcessing | processing | The method used to process children of the deserialized item. |
| ItemCache | cache | An optional item cache for sharing instantiated items |
Returns
| Type | Description |
|---|---|
| IVersionable |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | No formatter exists for the given repository item type. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
|
GetComments(Guid, string)
Gets the comments for all versions of an item.
Declaration
public abstract Collection<UserComment> GetComments(Guid identifier, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | identifier | The identifier of the item for which to retrieve comments. |
| string | agency | The agency of the item for which to retrieve comments. |
Returns
| Type | Description |
|---|---|
| Collection<UserComment> | All comments about the item. |
GetCommentsCollection(Collection<IdentifierTriple>)
Gets the comments for all versions of a set of items.
Declaration
public abstract Collection<UserComment> GetCommentsCollection(Collection<IdentifierTriple> ids)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | ids | The identifiers of the items for which to retrieve comments. |
Returns
| Type | Description |
|---|---|
| Collection<UserComment> | All comments about the set of items. |
GetItem(IdentifierTriple)
Gets an item from the repository.
Declaration
public virtual IVersionable GetItem(IdentifierTriple id)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | id | The identifier of the item to retrieve. |
Returns
| Type | Description |
|---|---|
| IVersionable | The deserialized, IVersionable item. |
GetItem(IdentifierTriple, ChildReferenceProcessing)
Gets an item from the repository.
Declaration
public virtual IVersionable GetItem(IdentifierTriple id, ChildReferenceProcessing processing)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | id | The identifier of the item to retrieve. |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable item. |
Returns
| Type | Description |
|---|---|
| IVersionable | The deserialized, IVersionable item. |
GetItem(Guid, string, long)
Gets an item from the repository.
Declaration
public virtual IVersionable GetItem(Guid id, string agency, long version)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to retrieve. |
| string | agency | The agency of the item to retrieve. |
| long | version | The version of the item to retrieve. |
Returns
| Type | Description |
|---|---|
| IVersionable | The deserialized, IVersionable item. |
GetItem(Guid, string, long, ChildReferenceProcessing)
Gets an item from the repository.
Declaration
public virtual IVersionable GetItem(Guid id, string agency, long version, ChildReferenceProcessing processing)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to retrieve. |
| string | agency | The agency of the item to retrieve. |
| long | version | The version of the item to retrieve. |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable item. |
Returns
| Type | Description |
|---|---|
| IVersionable | The deserialized, IVersionable item. |
GetItem(Guid, string, long, bool, ChildReferenceProcessing)
Gets an item from the repository.
Declaration
public virtual IVersionable GetItem(Guid id, string agency, long version, bool useLatest, ChildReferenceProcessing processing)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to retrieve. |
| string | agency | The agency of the item to retrieve. |
| long | version | The version of the item to retrieve. |
| bool | useLatest | Indicates whether the latest version of the item should be retrieved. If |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable item. |
Returns
| Type | Description |
|---|---|
| IVersionable | The deserialized, IVersionable item. |
GetItems(Collection<IdentifierTriple>, ChildReferenceProcessing)
Gets multiple items from the repository.
Declaration
public Collection<IVersionable> GetItems(Collection<IdentifierTriple> identifiers, ChildReferenceProcessing processing = ChildReferenceProcessing.Instantiate)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | identifiers | The identifiers of the items to retrieve. |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable items. |
Returns
| Type | Description |
|---|---|
| Collection<IVersionable> | A collection of IVersionable items. |
GetItemsAsync(Collection<IdentifierTriple>, ChildReferenceProcessing)
Gets multiple items from the repository.
Declaration
[Obsolete("This method is for a future version of the client library and is currently untested.")]
public Task<Collection<IVersionable>> GetItemsAsync(Collection<IdentifierTriple> identifiers, ChildReferenceProcessing processing = ChildReferenceProcessing.Instantiate)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | identifiers | The identifiers of the items to retrieve. |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable items. |
Returns
| Type | Description |
|---|---|
| Task<Collection<IVersionable>> | A collection of IVersionable items. |
GetItemsInTransactionAsync(long)
Retrieve the current items in a transaction
Declaration
public abstract Task<Collection<RepositoryItem>> GetItemsInTransactionAsync(long transactionId)
Parameters
| Type | Name | Description |
|---|---|---|
| long | transactionId | transaction identifier |
Returns
| Type | Description |
|---|---|
| Task<Collection<RepositoryItem>> | Items to be registered in the transaction |
GetLatestItem(Guid, string)
Gets the latest version of an item from the repository.
Declaration
public IVersionable GetLatestItem(Guid id, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to retrieve. |
| string | agency | The agency of the item to retrieve. |
Returns
| Type | Description |
|---|---|
| IVersionable | The deserialized, IVersionable item. |
GetLatestItem(Guid, string, ChildReferenceProcessing)
Gets the latest version of an item from the repository.
Declaration
public IVersionable GetLatestItem(Guid id, string agency, ChildReferenceProcessing processing)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to retrieve. |
| string | agency | The agency of the item to retrieve. |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable item. |
Returns
| Type | Description |
|---|---|
| IVersionable | The deserialized, IVersionable item. |
GetLatestRepositoryItem(Guid, string)
Gets the latest version of an undeserialized item from the repository. To retrieve a deserialized IVersionable object, use the GetLatestItem(Guid, string) method.
Declaration
public abstract RepositoryItem GetLatestRepositoryItem(Guid id, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to retrieve. |
| string | agency | The agency of the item to retrieve. |
Returns
| Type | Description |
|---|---|
| RepositoryItem |
GetLatestRepositoryItems(Collection<IdentifierTriple>)
Gets a list of the latest versions of undeserialized items from the repository.
To retrieve deserialized
IVersionable objects, use the GetLatestItems method.
Declaration
public abstract Collection<RepositoryItem> GetLatestRepositoryItems(Collection<IdentifierTriple> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | identifiers | The identifiers of the items to retrieve. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryItem> | A list of undeserialized repository items. |
GetLatestSet(IdentifierTriple)
Gets the set of items defined by the specified root. Each item in the set will have the latest version number for that item.
Declaration
public abstract Collection<IdentifierTriple> GetLatestSet(IdentifierTriple rootItem)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | rootItem | The root item that defines the set. |
Returns
| Type | Description |
|---|---|
| Collection<IdentifierTriple> | A list of identifiers of all items in the set. |
GetLatestVersionNumber(Guid, string)
Gets the latest version number of a repository item.
Declaration
public abstract long GetLatestVersionNumber(Guid id, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item. |
| string | agency | The agency of the item. |
Returns
| Type | Description |
|---|---|
| long | The latest version number of the item. |
GetLatestVersionNumberOfTag(Guid, string, string)
Gets the latest version number of the specified repository item that has the specified tag.
Declaration
public abstract long GetLatestVersionNumberOfTag(Guid id, string agency, string tag)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item. |
| string | agency | The agency of the item. |
| string | tag | The tag. |
Returns
| Type | Description |
|---|---|
| long | The latest version number of the repository item with the tag. |
GetLatestVersionNumbers(Collection<IdentifierTriple>)
Gets the latest version numbers of multiple items.
Declaration
public abstract Collection<IdentifierTriple> GetLatestVersionNumbers(Collection<IdentifierTriple> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | identifiers | The identifiers of the items. |
Returns
| Type | Description |
|---|---|
| Collection<IdentifierTriple> | A collection of identifiers containing the full identification, including latest version number, of the latest versions of the requested items. |
GetPermissions(Collection<IdentifierTriple>, Collection<Guid>)
Gets all permissions that apply to the specified items and item types.
Declaration
public abstract RepositorySecurityContext GetPermissions(Collection<IdentifierTriple> identifiers, Collection<Guid> itemTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | identifiers | The identifiers of the items for which permissions are retrieved. |
| Collection<Guid> | itemTypes | The item types for which permissions are retrieved. |
Returns
| Type | Description |
|---|---|
| RepositorySecurityContext | The permissions that apply to the requested items and types. |
GetRelationshipByObject(GraphSearchFacet)
Gets a list of items that reference the specified item, according to the provided search options.
Declaration
public abstract Collection<TypedIdTriple> GetRelationshipByObject(GraphSearchFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphSearchFacet | facet | The parameters for the relationship search. |
Returns
| Type | Description |
|---|---|
| Collection<TypedIdTriple> | A list of matching items. |
GetRelationshipBySubject(GraphSearchFacet)
Gets a list of items referenced by the specified item, according to the provided search options.
Declaration
public abstract Collection<TypedIdTriple> GetRelationshipBySubject(GraphSearchFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphSearchFacet | facet | The parameters for the relationship search. |
Returns
| Type | Description |
|---|---|
| Collection<TypedIdTriple> | A list of matching items. |
GetRelationships(IdentifierTriple)
Gets a matrix representing all items in a set and the relationships among those items.
Declaration
public AdjacencyMatrix GetRelationships(IdentifierTriple rootItem)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | rootItem | The root item that defines the set. |
Returns
| Type | Description |
|---|---|
| AdjacencyMatrix | A matrix representing all items in the set and the relationships among those items. |
GetRelationships(IdentifierTriple, RelationshipFacet)
Gets a matrix representing all items in a set and the relationships among those items.
Declaration
public AdjacencyMatrix GetRelationships(IdentifierTriple rootItem, RelationshipFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | rootItem | The root item that defines the set. |
| RelationshipFacet | facet | The facet describing how the search should be performed. |
Returns
| Type | Description |
|---|---|
| AdjacencyMatrix | A matrix representing all items in the set and the relationships among those items. |
GetRelationships(Collection<IdentifierTriple>)
Gets a matrix representing all items in a set and the relationships among those items.
Declaration
public AdjacencyMatrix GetRelationships(Collection<IdentifierTriple> rootItems)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | rootItems | The root items that define the set. |
Returns
| Type | Description |
|---|---|
| AdjacencyMatrix | A matrix representing all items in the set and the relationships among those items. |
GetRelationships(Collection<IdentifierTriple>, RelationshipFacet)
Gets a matrix representing all items in a set and the relationships among those items.
Declaration
public abstract AdjacencyMatrix GetRelationships(Collection<IdentifierTriple> rootItems, RelationshipFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | rootItems | The root items that define the set. |
| RelationshipFacet | facet | The facet describing how the search should be performed. |
Returns
| Type | Description |
|---|---|
| AdjacencyMatrix | A matrix representing all items in the set and the relationships among those items. |
GetRepositoryInfo()
Gets the inforation about the repository and the items it contains.
Declaration
public abstract RepositoryInfo GetRepositoryInfo()
Returns
| Type | Description |
|---|---|
| RepositoryInfo | An object containing information about the repository and the items it contains. |
GetRepositoryItem(Guid, string, long)
Gets an undeserialized item from the repository. To retrieve a deserialized IVersionable object, use the GetItem(Guid, string, long) method.
Declaration
public abstract RepositoryItem GetRepositoryItem(Guid id, string agency, long version)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to retrieve. |
| string | agency | The agency of the item to retrieve. |
| long | version | The version of the item to retrieve. |
Returns
| Type | Description |
|---|---|
| RepositoryItem | The repository item. |
GetRepositoryItemDescription(Guid, string, long)
Gets a description of a repository item. The RepositoryItemMetadata description contains identification, naming, and summary information, but not the entire contents of the item.
Declaration
public abstract RepositoryItemMetadata GetRepositoryItemDescription(Guid id, string agency, long version)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item for which a description will be retrieved. |
| string | agency | The agency of the item for which a description will be retrieved. |
| long | version | The version of the item for which a description will be retrieved. |
Returns
| Type | Description |
|---|---|
| RepositoryItemMetadata | A description of the repository item. |
Examples
// Search for all VariableStatistics related to the PhysicalInstance.
var facet = new GraphSearchFacet();
facet.TargetItem = physicalInstanceIdentifier;
facet.UseDistinctTargetItem = true;
facet.UseDistinctResultItem = true;
facet.ItemTypes.Add(DdiItemType.VariableStatistic);
// Perform the search.
var results = client.GetRepositoryItemDescriptionsBySubject(facet);
// Write a line for each result.
foreach (var result in results)
{
Console.WriteLine(result.Label["en-US"]);
}
GetRepositoryItemDescriptions(Collection<IdentifierTriple>)
Gets descriptions of multiple repository items. The RepositoryItemMetadata descriptions contain identification, naming, and summary information, but not the entire contents of the item.
Declaration
public abstract Collection<RepositoryItemMetadata> GetRepositoryItemDescriptions(Collection<IdentifierTriple> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | identifiers | The identifiers for which descriptions will be retrieved. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryItemMetadata> | A collection of descriptions of the repository items. |
GetRepositoryItemDescriptionsByObject(GraphSearchFacet)
Gets the repository item descriptions for items that match the specified relationship search parameters. The search will query for items that reference the target item specified in the search facet.
Declaration
public abstract Collection<RepositoryItemMetadata> GetRepositoryItemDescriptionsByObject(GraphSearchFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphSearchFacet | facet | The relationship search parameters. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryItemMetadata> | A collection of descriptions of the repository items that match the search parameters. |
GetRepositoryItemDescriptionsBySubject(GraphSearchFacet)
Gets the repository item descriptions for items that match the specified relationship search parameters. The search will query for items referenced by the target item specified in the search facet.
Declaration
public abstract Collection<RepositoryItemMetadata> GetRepositoryItemDescriptionsBySubject(GraphSearchFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphSearchFacet | facet | The relationship search parameters. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryItemMetadata> | A collection of descriptions of the repository items that match the search parameters. |
GetRepositoryItems(Collection<IdentifierTriple>)
Gets a list of undeserialized items from the repository. To retrieve deserialized IVersionable objects, use the GetItems(Collection<IdentifierTriple>, ChildReferenceProcessing) method.
Declaration
public abstract Collection<RepositoryItem> GetRepositoryItems(Collection<IdentifierTriple> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | identifiers | The identifiers to retrieve. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryItem> | A list of repository items |
GetRepositorySetting(string)
Gets the repository setting with the specified name.
Declaration
public abstract RepositorySetting GetRepositorySetting(string settingName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | settingName | The name of the repository setting. |
Returns
| Type | Description |
|---|---|
| RepositorySetting | The repository setting. |
GetRepositorySettings()
Gets all the repository settings.
Declaration
public abstract Collection<RepositorySetting> GetRepositorySettings()
Returns
| Type | Description |
|---|---|
| Collection<RepositorySetting> | A list of all repository settings. |
GetRepositoryStatistics()
Gets information about the items in the repository.
Declaration
public abstract RepositoryStatistics GetRepositoryStatistics()
Returns
| Type | Description |
|---|---|
| RepositoryStatistics |
GetRepresentation(IVersionable, Guid)
Gets the XML representation of the item.
Declaration
public string GetRepresentation(IVersionable item, Guid format)
Parameters
| Type | Name | Description |
|---|---|---|
| IVersionable | item | The item for which an XML representation is generated. |
| Guid | format | The XML format to be generated, generally taken from RepositoryFormats. |
Returns
| Type | Description |
|---|---|
| string |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | No formatter exists for the given repository item type. |
GetSchemeItems(IdentifierTriple, int, int)
Gets the items contained in a scheme.
Declaration
public Collection<IVersionable> GetSchemeItems(IdentifierTriple schemeId, int pageNumber, int itemsPerPage)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | schemeId | The identifier of the scheme. |
| int | pageNumber | The page number that should be retrieved. |
| int | itemsPerPage | The number of items per page. |
Returns
| Type | Description |
|---|---|
| Collection<IVersionable> | A collection of members of the scheme. |
GetSet(IdentifierTriple)
Gets the set of all items under the specified root.
Declaration
public abstract Collection<IdentifierTriple> GetSet(IdentifierTriple rootItem)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | rootItem | The root item. |
Returns
| Type | Description |
|---|---|
| Collection<IdentifierTriple> | The set of all items under the specified root. |
GetTags(IdentifierTriple)
Gets the tags applied to the specified item in the repository.
Declaration
public Collection<string> GetTags(IdentifierTriple compositeId)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | compositeId | The identifier of the item for which tags will be retrieved. |
Returns
| Type | Description |
|---|---|
| Collection<string> | A list of tags applied to the item in the repository. |
GetTags(Guid, string, long)
Gets the tags applied to the specified item in the repository.
Declaration
public abstract Collection<string> GetTags(Guid id, string agency, long version)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item for which tags will be retrieved. |
| string | agency | The agency of the item for which tags will be retrieved. |
| long | version | The version of the item for which tags will be retrieved. |
Returns
| Type | Description |
|---|---|
| Collection<string> | A list of tags applied to the item in the repository. |
GetTransactionsAsync(Collection<long>)
Get Transaction metadata
Declaration
public abstract Task<Collection<RepositoryTransaction>> GetTransactionsAsync(Collection<long> transactionIds)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<long> | transactionIds | Transactions to request |
Returns
| Type | Description |
|---|---|
| Task<Collection<RepositoryTransaction>> | Transaction metadata |
GetTypedRelationships(IdentifierTriple)
Gets a matrix representing all items in a set and the relationships among those items.
Declaration
public TypedAdjacencyMatrix GetTypedRelationships(IdentifierTriple rootItem)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | rootItem | The root item that defines the set. |
Returns
| Type | Description |
|---|---|
| TypedAdjacencyMatrix | A matrix representing all items in the set and the relationships among those items. |
GetTypedRelationships(Collection<IdentifierTriple>)
Gets a matrix representing all items in a set and the relationships among those items.
Declaration
public TypedAdjacencyMatrix GetTypedRelationships(Collection<IdentifierTriple> rootItems)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | rootItems | The root items that define the set. |
Returns
| Type | Description |
|---|---|
| TypedAdjacencyMatrix | A matrix representing all items in the set and the relationships among those items. |
GetTypedRelationships(Collection<IdentifierTriple>, RelationshipFacet)
Gets a matrix representing all items in a set and the relationships among those items.
Declaration
public abstract TypedAdjacencyMatrix GetTypedRelationships(Collection<IdentifierTriple> rootItems, RelationshipFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | rootItems | The root items that defines the set. |
| RelationshipFacet | facet | The facet describing how the search should be performed. |
Returns
| Type | Description |
|---|---|
| TypedAdjacencyMatrix | A matrix representing all items in the set and the relationships among those items. |
GetVersionHistory(Guid, string)
Gets the version history of an item.
Declaration
public abstract Collection<RepositoryItemMetadata> GetVersionHistory(Guid id, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item for which version history will be retrieved. |
| string | agency | The agency of the item for which version history will be retrieved. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryItemMetadata> | A collection containing a description for each version of a repository item. |
GetVersions(Guid, string)
Gets a list of all versions of the specified item.
Declaration
public abstract Collection<IdentifierTriple> GetVersions(Guid id, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item for which version history will be returned. |
| string | agency | The agency of the item for which version history will be returned. |
Returns
| Type | Description |
|---|---|
| Collection<IdentifierTriple> | A list of all versions of the specified item. |
GetWorkflowReplicationTargetsAsync()
Get a list of workflow replication targets for this Repository
Declaration
public abstract Task<Collection<Target>> GetWorkflowReplicationTargetsAsync()
Returns
| Type | Description |
|---|---|
| Task<Collection<Target>> |
ListTransactionsAsync(RepositoryTransactionListOptions)
Get a list of current transactions
Declaration
public abstract Task<Collection<RepositoryTransaction>> ListTransactionsAsync(RepositoryTransactionListOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositoryTransactionListOptions | options | Transaction listing options |
Returns
| Type | Description |
|---|---|
| Task<Collection<RepositoryTransaction>> | A collection of Transaction metadata |
LogEvent(LoggedEvent)
Send a logged event
Declaration
public abstract void LogEvent(LoggedEvent loggedEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| LoggedEvent | loggedEvent |
PopulateItem(IVersionable)
Populates an unpopulated item with the full item contents, as retrieved from the repository.
Declaration
public PopulationResult PopulateItem(IVersionable item)
Parameters
| Type | Name | Description |
|---|---|---|
| IVersionable | item | The item to be populated. |
Returns
| Type | Description |
|---|---|
| PopulationResult | The result of the population. |
PopulateItem(IVersionable, bool)
Populates an unpopulated item with the full item contents, as retrieved from the repository.
Declaration
public PopulationResult PopulateItem(IVersionable item, bool useLatestVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| IVersionable | item | The item to be populated. |
| bool | useLatestVersion | Indicates whether the latest version of the item should be retrieved. If |
Returns
| Type | Description |
|---|---|
| PopulationResult | The result of the population. |
PopulateItem(IVersionable, bool, ChildReferenceProcessing)
Populates an unpopulated item with the full item contents, as retrieved from the repository.
Declaration
public PopulationResult PopulateItem(IVersionable item, bool useLatestVersion, ChildReferenceProcessing processing)
Parameters
| Type | Name | Description |
|---|---|---|
| IVersionable | item | The item to be populated. |
| bool | useLatestVersion | Indicates whether the latest version of the item should be retrieved. If |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable item. |
Returns
| Type | Description |
|---|---|
| PopulationResult | The result of the population. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Already Populated or No populator exists for the given Repository Item type |
PopulateItem(IVersionable, bool, ItemCache, ChildReferenceProcessing)
Populates an unpopulated item with the full item contents, as retrieved from the item cache and repository.
Declaration
public virtual PopulationResult PopulateItem(IVersionable item, bool useLatestVersion, ItemCache cache, ChildReferenceProcessing processing)
Parameters
| Type | Name | Description |
|---|---|---|
| IVersionable | item | The item to be populated. |
| bool | useLatestVersion | Indicates whether the latest version of the item should be retrieved. If |
| ItemCache | cache | A cache of current, populated items |
| ChildReferenceProcessing | processing | The method used to process children of the IVersionable item. |
Returns
| Type | Description |
|---|---|
| PopulationResult | The result of the population. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Already Populated or No populator exists for the given Repository Item type |
RegisterItem(IVersionable, CommitOptions)
Registers the speified item with the repository.
Declaration
public void RegisterItem(IVersionable item, CommitOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| IVersionable | item | The item to register. |
| CommitOptions | options | The options passed to the repository. |
RegisterItem(RepositoryItem, CommitOptions)
Registers the item in the repository.
Declaration
public abstract void RegisterItem(RepositoryItem item, CommitOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositoryItem | item | The item to register. |
| CommitOptions | options | The options to pass to the repository. |
RegisterItems(IEnumerable<IVersionable>, CommitOptions)
Registers the specified items with the repository.
Declaration
public Collection<RepositoryConflict> RegisterItems(IEnumerable<IVersionable> items, CommitOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IVersionable> | items | The items to register. |
| CommitOptions | options | The options passed to the repository. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryConflict> |
RegisterItems(Collection<RepositoryItem>, CommitOptions)
Registers the items in the repository.
Declaration
public abstract Collection<RepositoryConflict> RegisterItems(Collection<RepositoryItem> items, CommitOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<RepositoryItem> | items | The items to register. |
| CommitOptions | options | The options to pass to the repository. |
Returns
| Type | Description |
|---|---|
| Collection<RepositoryConflict> |
RemovePermissions(Collection<long>)
Removes the specified permissions from the repository.
Declaration
public abstract void RemovePermissions(Collection<long> permissionIds)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<long> | permissionIds | The identifiers of the permissions to remove. |
RemoveRepository(string)
Marks the repository as no longer authoritative for the specified agency.
Declaration
public abstract void RemoveRepository(string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| string | agency | The agency for which the repository will no longer be marked as authoritative. |
RemoveRepositorySetting(string)
Removes the repository setting with the specified name.
Declaration
public abstract void RemoveRepositorySetting(string settingName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | settingName | Name of the setting. |
RemoveTag(IdentifierTriple, string)
Removes a tag from an item in the repository.
Declaration
public void RemoveTag(IdentifierTriple compositeId, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | compositeId | The identifier of the item from which the tag will be removed. |
| string | name | The tag to be removed. |
RemoveTag(Guid, string, long, string)
Removes a tag from an item in the repository
Declaration
public abstract void RemoveTag(Guid id, string agency, long version, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item from which the tag will be removed. |
| string | agency | The agency of the item from which the tag will be removed. |
| long | version | The version of the item from which the tag will be removed. |
| string | name | The tag to be removed. |
RequestReplicationAsync(IdentifierTriple, string, string)
Request replication of a set of items to a target repository
Declaration
public abstract Task RequestReplicationAsync(IdentifierTriple rootItem, string repositoryId, string requesterEmail)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | rootItem | Set to replicate |
| string | repositoryId | The repository server id to replicate the set to |
| string | requesterEmail | Optional email for notifications |
Returns
| Type | Description |
|---|---|
| Task |
RestoreAllItemVersions(Guid, string)
Makes all versions of a item no longer deprecated.
Declaration
public abstract void RestoreAllItemVersions(Guid id, string agency)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to restore. |
| string | agency | The agency of the item to restore. |
RestoreItem(Guid, string, long)
Makes an item no longer deprecated.
Declaration
public abstract void RestoreItem(Guid id, string agency, long version)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The identifier of the item to restore. |
| string | agency | The agency of the item to restore. |
| long | version | The version of the item to restore. |
Search(SearchFacet)
Searches the specified the repository for items, according to the provided search options.
Declaration
public abstract SearchResponse Search(SearchFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchFacet | facet | The parameters for the search. |
Returns
| Type | Description |
|---|---|
| SearchResponse | A search response, which includes the matching results and summary information. |
Examples
// Search the entire repository for all variables with the word
// "age".
var facet = new SearchFacet();
facet.ItemTypes.Add(DdiItemType.Variable);
facet.SearchTerms.Add("age");
// Perform the search.
var response = client.Search(facet);
// Show a summary of the search results. How many items were found
// and how long the search took.
Console.WriteLine(string.Format(
"Displaying {0} of {1} results. Search took {2}.",
response.ReturnedResults,
response.TotalResults,
response.RepositoryTime));
// Write a line for each result.
foreach (var result in response.Results)
{
Console.WriteLine(result.Label["en-US"]);
}
SearchTypedSet(IdentifierTriple, SetSearchFacet)
Searches the specified set of items according to the provided search options.
Declaration
public abstract Collection<TypedIdTriple> SearchTypedSet(IdentifierTriple rootItem, SetSearchFacet facet)
Parameters
| Type | Name | Description |
|---|---|---|
| IdentifierTriple | rootItem | The root item that defines the set to search. |
| SetSearchFacet | facet | The parameters for the set search. |
Returns
| Type | Description |
|---|---|
| Collection<TypedIdTriple> | A list of matching items. |
Examples
// Search for all Categories in the DataRelationship's set.
var facet = new SetSearchFacet();
facet.ItemTypes.Add(DdiItemType.Category);
var resultIdentifiers = client.SearchTypedSet(
dataRelationshipIdentifier,
facet);
// The set search only returns the identifiers of items.
// Request the description of each result here.
var results = client.GetRepositoryItemDescriptions(
resultIdentifiers.ToIdentifierCollection());
// Write a line for each result.
foreach (var result in results)
{
Console.WriteLine(result.Label["en-US"]);
}
SetRepositorySetting(RepositorySetting)
Adds or updates a repository setting.
Declaration
public abstract void SetRepositorySetting(RepositorySetting setting)
Parameters
| Type | Name | Description |
|---|---|---|
| RepositorySetting | setting | The setting to add or update. |
UpdateDeprecatedState(Collection<IdentifierTriple>, bool, bool)
Updates the Deprecated State of a set of items
Declaration
public abstract void UpdateDeprecatedState(Collection<IdentifierTriple> ids, bool deprecatedState, bool applyToAllVersions)
Parameters
| Type | Name | Description |
|---|---|---|
| Collection<IdentifierTriple> | ids | Set of identifiers to update |
| bool | deprecatedState | The deprecation state to set |
| bool | applyToAllVersions | Apply the state to all versions of the items |
Events
ConnectionInfoChanged
Occurs when connection information changed.
Declaration
public event EventHandler ConnectionInfoChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
ProgressChanged
Occurs when progress of an operation has changed.
Declaration
public event EventHandler<ProgressChangedEventArgs> ProgressChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<ProgressChangedEventArgs> |