Class RepositoryClientBase
Provides a base class for all repository clients, and implements several helper methods.
Inheritance
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 |
---|---|
System.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. |
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<RepositoryTransaction> CommitTransactionAsync(RepositoryTransactionCommitOptions options)
Parameters
Type | Name | Description |
---|---|---|
RepositoryTransactionCommitOptions | options | Specify version updating and progagation rules |
Returns
Type | Description |
---|---|
Task<RepositoryTransaction> | Transaction metadata |
CreateComment(Guid, String, Int64, 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. |
System.String | agency | The agency of the item to which the comment will be added. |
System.Int64 | version | The version of the item to which the comment will be added. |
System.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 |
---|---|---|
System.String | agency | The agency for which the repository will be marked as authoritative. |
System.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. |
System.String | name | The tag to be applied. |
CreateTag(Guid, String, Int64, 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. |
System.String | agency | The agency of the item to which the tag will be applied. |
System.Int64 | version | The version of the item to which the tag will be applied. |
System.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 |
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. |
System.String | agency | The agency of the item to deprecate. |
DeprecateItem(Guid, String, Int64)
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. |
System.String | agency | The agency of the item to deprectate. |
System.Int64 | 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 |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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. |
System.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, Int64)
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. |
System.String | agency | The agency of the item to retrieve. |
System.Int64 | version | The version of the item to retrieve. |
Returns
Type | Description |
---|---|
IVersionable | The deserialized, IVersionable item. |
GetItem(Guid, String, Int64, 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. |
System.String | agency | The agency of the item to retrieve. |
System.Int64 | 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, Int64, Boolean, 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. |
System.String | agency | The agency of the item to retrieve. |
System.Int64 | version | The version of the item to retrieve. |
System.Boolean | 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. |
GetItemsInTransactionAsync(Int64)
Retrieve the current items in a transaction
Declaration
public abstract Task<Collection<RepositoryItem>> GetItemsInTransactionAsync(long transactionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | 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. |
System.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. |
System.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. |
System.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. |
System.String | agency | The agency of the item. |
Returns
Type | Description |
---|---|
System.Int64 | 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. |
System.String | agency | The agency of the item. |
System.String | tag | The tag. |
Returns
Type | Description |
---|---|
System.Int64 | 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, Int64)
Gets an undeserialized item from the repository. To retrieve a deserialized IVersionable object, use the GetItem(Guid, String, Int64) 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. |
System.String | agency | The agency of the item to retrieve. |
System.Int64 | version | The version of the item to retrieve. |
Returns
Type | Description |
---|---|
RepositoryItem | The repository item. |
GetRepositoryItemDescription(Guid, String, Int64)
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. |
System.String | agency | The agency of the item for which a description will be retrieved. |
System.Int64 | 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 |
---|---|---|
System.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. |
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 |
---|---|
System.String |
GetSchemeItems(IdentifierTriple, Int32, Int32)
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. |
System.Int32 | pageNumber | The page number that should be retrieved. |
System.Int32 | 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<System.String> | A list of tags applied to the item in the repository. |
GetTags(Guid, String, Int64)
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. |
System.String | agency | The agency of the item for which tags will be retrieved. |
System.Int64 | version | The version of the item for which tags will be retrieved. |
Returns
Type | Description |
---|---|
Collection<System.String> | A list of tags applied to the item in the repository. |
GetTransactionsAsync(Collection<Int64>)
Get Transaction metadata
Declaration
public abstract Task<Collection<RepositoryTransaction>> GetTransactionsAsync(Collection<long> transactionIds)
Parameters
Type | Name | Description |
---|---|---|
Collection<System.Int64> | 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. |
System.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. |
System.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. |
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, Boolean)
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. |
System.Boolean | useLatestVersion | Indicates whether the latest version of the item should be retrieved. If |
Returns
Type | Description |
---|---|
PopulationResult | The result of the population. |
PopulateItem(IVersionable, Boolean, 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. |
System.Boolean | 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. |
PopulateItem(IVersionable, Boolean, 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. |
System.Boolean | 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. |
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(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> |
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> |
RemovePermissions(Collection<Int64>)
Removes the specified permissions from the repository.
Declaration
public abstract void RemovePermissions(Collection<long> permissionIds)
Parameters
Type | Name | Description |
---|---|---|
Collection<System.Int64> | 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 |
---|---|---|
System.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 |
---|---|---|
System.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. |
System.String | name | The tag to be removed. |
RemoveTag(Guid, String, Int64, 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. |
System.String | agency | The agency of the item from which the tag will be removed. |
System.Int64 | version | The version of the item from which the tag will be removed. |
System.String | name | The tag to be removed. |
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. |
System.String | agency | The agency of the item to restore. |
RestoreItem(Guid, String, Int64)
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. |
System.String | agency | The agency of the item to restore. |
System.Int64 | 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>, Boolean, Boolean)
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 |
System.Boolean | deprecatedState | The deprecation state to set |
System.Boolean | 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> |