Class MetadataUpdateBuilder
Tracks changes to IVersionable items. This allows tracking changes for manual version propagation, and creating a human-readable change log.
Inherited Members
Namespace: Algenta.Colectica.Model.Ddi.Utility
Assembly: Algenta.Colectica.Model.Ddi.dll
Syntax
public class MetadataUpdateBuilder
Properties
IncrementVersionOnUpdate
Determines whether the MarkItemAsUpdated method increments the version of the updated item.
Declaration
public bool IncrementVersionOnUpdate { get; set; }
Property Value
Type | Description |
---|---|
bool |
Log
Gets the human-readable list of changes.
Declaration
public StringBuilder Log { get; }
Property Value
Type | Description |
---|---|
StringBuilder |
NewAndUpdatedItems
Gets the list of new and updated items.
Declaration
public HashSet<IVersionable> NewAndUpdatedItems { get; }
Property Value
Type | Description |
---|---|
HashSet<IVersionable> |
Methods
EnsureCustomFieldExists(IVersionable, string, bool)
Ensures the CustomField with the specified title exists, creating it if necessary.
Declaration
public void EnsureCustomFieldExists(IVersionable item, string title, bool value)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | title | |
bool | value |
EnsureCustomFieldExists(IVersionable, string, string)
Ensures the CustomField with the specified title exists, creating it if necessary.
Declaration
public void EnsureCustomFieldExists(IVersionable item, string title, string value)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | title | |
string | value |
EnsureCustomFieldExists(IVersionable, string, string, Type)
Ensures the CustomField with the specified title exists, creating it if necessary.
Declaration
public void EnsureCustomFieldExists(IVersionable item, string title, string value, Type valueType)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | title | |
string | value | |
Type | valueType |
EnsureDublinCoreIdentifierExists(IVersionable, DublinCore, string)
Ensures the specified ID exists on the citation, creating it if necessary.
Declaration
public void EnsureDublinCoreIdentifierExists(IVersionable item, DublinCore dublinCoreMetadata, string idStr)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
DublinCore | dublinCoreMetadata | |
string | idStr |
EnsureUserIdExists(IVersionable, string, string)
Ensures the UserID with the specified type exists, creating it if necessary.
Declaration
public void EnsureUserIdExists(IVersionable item, string type, string identifier)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | type | |
string | identifier |
MarkItemAsNew(IVersionable)
Marks an item as newly created.
Declaration
public void MarkItemAsNew(IVersionable item)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item |
MarkItemAsRemoved(IVersionable)
Marks an item as removed.
Declaration
public void MarkItemAsRemoved(IVersionable item)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item |
MarkItemAsUpdated(IVersionable, string)
Marks an item as updated.
Declaration
public void MarkItemAsUpdated(IVersionable item, string message = "")
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | message |
MarkItemPartAsRemoved(IVersionable, string, string)
Marks the item as removed, along with a message to be added to the change log.
Declaration
public void MarkItemPartAsRemoved(IVersionable item, string type, string label)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | type | |
string | label |
UpdateOtherMaterial(IVersionable, string, string)
Ensures the OtherMaterial with the specified key/title exists, creating it if necessary.
Declaration
public void UpdateOtherMaterial(IVersionable item, string key, string value)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | key | |
string | value |
UpdateProperty(IVersionable, CodeValue, string)
Updates a property, if the value is different than the existing value.
Declaration
public void UpdateProperty(IVersionable item, CodeValue property, string value)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
CodeValue | property | |
string | value |
UpdateProperty(IVersionable, MultilingualString, MultilingualString)
Updates a property, if the value is different than the existing value.
Declaration
public void UpdateProperty(IVersionable item, MultilingualString x, MultilingualString y)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
MultilingualString | x | |
MultilingualString | y |
UpdateProperty(IVersionable, MultilingualString, string, string)
Updates a property, if the value is different than the existing value.
Declaration
public void UpdateProperty(IVersionable item, MultilingualString mlstr, string language, string newValue)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
MultilingualString | mlstr | |
string | language | |
string | newValue |
UpdateProperty(IVersionable, decimal?, Action<decimal?>, decimal?)
Updates a property, if the value is different than the existing value.
Declaration
public void UpdateProperty(IVersionable item, decimal? existingValue, Action<decimal?> propertySetter, decimal? newValue)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
decimal? | existingValue | |
Action<decimal?> | propertySetter | |
decimal? | newValue |
UpdateProperty(IVersionable, int?, Action<int?>, int?)
Updates a property, if the value is different than the existing value.
Declaration
public void UpdateProperty(IVersionable item, int? existingValue, Action<int?> propertySetter, int? newValue)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
int? | existingValue | |
Action<int?> | propertySetter | |
int? | newValue |
UpdateProperty(IVersionable, Uri, Action<Uri>, Uri)
Updates a property, if the value is different than the existing value.
Declaration
public void UpdateProperty(IVersionable item, Uri existingValue, Action<Uri> propertySetter, Uri newValue)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
Uri | existingValue | |
Action<Uri> | propertySetter | |
Uri | newValue |
UpdateUserAttribute(IVersionable, string, string)
Ensures the OtherMaterial with the specified key/title exists, creating it if necesseary.
Declaration
public void UpdateUserAttribute(IVersionable item, string key, string value)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | |
string | key | |
string | value |