Click or drag to resize

Title Class

A Title is the fundamentally important entity (record or document) in the collections database. A Title represents a single identifiable object in the collections database. It may represent a typical multimedia item such as an audio CD, a video DVD, etc. It may also represent other collectible items such as books, magazines, model cars, stamps, mineral samples or vintage toasters (anything you might consider collecting).

Inheritance Hierarchy
SystemObject
  Orthogonal.Hoarder.StdLib.EntityTitle

Namespace: Orthogonal.Hoarder.StdLib.Entity
Assembly: Orthogonal.Hoarder.StdLib (in Orthogonal.Hoarder.StdLib.dll) Version: 8.0.9
Syntax
C#
[SerializableAttribute]
public class Title : IHoarderDocument

The Title type exposes the following members.

Constructors
 NameDescription
Public methodTitle Constructs a Title. This empty constructor only exists to allow serialization as JSON over the Hoarder Web API.
Public methodTitle(String, String, String) Constructs a Title with basic required property values.
Top
Properties
 NameDescription
Public propertyCatalog Catalogue identifier associated with the title.
Public propertyComment Longer comment for the title.
Public propertyCompany Company name associated with the title.
Public propertyContributors A non-null array of Contributor documents associated with the title
Public propertyCreated UTC time the title was created.
Public propertyEditionYear Year that this edition of the title was published.
Public propertyFiles A non-null array of File documents associated with the title
Public propertyGenres A non-null array of Genre documents associated with the title
Public propertyid

The id uniquely identifies a Title in the collection database. The id is used as the database primary key. The id string has the format T-XXXXXXXXXXXX where the 12 X characters are strongly random and taken from a pool of 34 easily identifiable alphanumeric uppercase characters. There are therefore about 2.4×1018 possible Ids assuming a flat distribution, which is about 61 bits of entropy. The chance of a birthday collision rises to 0.1% at around 68 million, and rises to 1% at around 215 million. Since the total number of titles in the database is around 6700, the probability of a collision is about 10-11 (see Birthday Attack).

Note that the default id value is the special sentinel value UnassignedId so that this class can be passed into the web service and pass validation on the property. The service layer will recognise the special value and convert it into a valid random id before the Title is saved.

Public propertyInfoUri Uri for information about the title.
Public propertyIsDiscarded A flag indicating if a title has been discarded and is no longer physically present in the collection.
Public propertyIsHidden A flag indicating if a title is hidden from unauthorized access for privacy reasons.
Public propertyLegacyId A legacy SQL database IDENTITY Int32 primary key from a Title that was once stored in the Agate database.
Public propertyLegacyKey A legacy primary key from a Title that was once stored in the Nimbus datbase.
Public propertyLegacyUid A legacy SQL database GUID from a Title that was once stored in the Agate database.
Public propertyLocation The name of the location where the title is stored.
Public propertyMedia The required name of the media holding the title. The value is a short name like "CD", "Book", "Model Car", etc.
Public propertyName The public Name of the title. This important value is the commonly spoken and recognised name of the title.
Public propertyNote Short note for the title.
Public propertyOwner Name of the title's owner.
Public propertyPartCount Number of identifiable distinct parts inside the title. A typical example is a "boxed set" of audio discs where the whole box has a title, but it may contain multiple disc 'parts'.
Public propertyPictures A non-null array of Picture documents associated with the title
Public propertyPk The Partition Key is the fixed value "P1". The Partition Key is intended to be used in Cosmos databases for horizontal scaling of very large numbers of records to improve query performance. Since the Hoarder database only contains several thousand documents, the use of a Partition Key is of no value, so it's set to a fixed value.
Public propertyPrice Purchase price of the title ($AUD).
Public propertyPublishYear Year the title was originally published.
Public propertyPurchased Date the title was purchased.
Public propertySaveTime The UTC time the title document was last saved.
Public propertyScanHash Hash of the label, full file names and file lengths of a digital data disc with a file system.
Public propertyScanLabel Label detected by scanning a digital data disc.
Public propertySourceId The optional id of a 'Source Title' that can be used as the source of information to complete this title. The concept of a 'Source Title' exists to help avoid duplicating information in many possible duplicate entries in the collection. This is an experimental property and feature that is not recognised by an client applications yet.
Public propertyTags A non-null array of Tag documents associated with the title
Public propertyTracks A non-null array of Track documents associated with the title
Public propertyType Discriminates different types of documents in the database. There are currently only two types: Title document (Type=2) and Configuration document (Type=3).
Top
Methods
 NameDescription
Public methodStatic memberIsValidTitleId Validates a string as being a valid Title id.
Public methodStatic memberMakeTitleId Generates a random Title 'id' which acts as the database primary key. For more information see id.
Public methodToString
(Overrides ObjectToString)
Top
Fields
 NameDescription
Public fieldStatic memberIdRandChars The set of all possible characters that can be used to compose a Title key. The character set is chosen from digits and a reduced set of upper-case characters to avoid visual confusion between characters like '0' and 'O', and '1' and 'I'.
Public fieldStatic memberIdRandLen The length of a Title id (primary key) random characters that follow the prefix.
Public fieldStatic memberTitleIdPrefix The prefix of all title id (primary key) strings.
Public fieldStatic memberUnassignedId A special default value for the id property to indicate that it has not been assigned a value. Null can't be used because this project is compiled with nullable=true and an attempt to pass a null id into the web service generates a validation error. There is a [ValidateNever] attribute to workaround this problem, but it exists in the Microsoft.AspNetCore.App package which is too heavy for this shared library.
Top
Remarks

The Title class corresponds exactly to the schema of a Title document as it is stored in the Cosmos database. Cosmos DB internally stores documents as indexed serializable JSON documents, and the Title class is in fact serialized to-and-from a database JSON document.

A Title document can have collections of child documents associated with it, each providing additional information about the Title. Child documents include genres, contributor names and roles, tracks, files, pictures and arbitrary tags.

See Also