Class DdiItemFormatter
Provides methods to get information about DDI item, and to serialize and deserialize items of that particular type.
Inheritance
Namespace: Algenta.Colectica.Model.Ddi
Assembly: Algenta.Colectica.Model.Ddi.dll
Syntax
public class DdiItemFormatter : object, IItemFormatter
Methods
AddMultilingualString(IdentifierTriple, Guid, MultilingualString, DdiStringType, Collection<ItemTextExtract>)
Adds the multilingual string to the provided collection of text extracts.
Declaration
public void AddMultilingualString(IdentifierTriple triple, Guid itemType, MultilingualString mstring, DdiStringType stringType, Collection<ItemTextExtract> texts)
Parameters
Type | Name | Description |
---|---|---|
IdentifierTriple | triple | The identifier of the item to which the multilingual string belongs. |
Guid | itemType | The type of item to which the multilingual string belongs. |
MultilingualString | mstring | The multilingual string. |
DdiStringType | stringType | The type of content represented by the multilingual string. |
Collection<ItemTextExtract> | texts | The collection of text extracts to which the new extracts will be added. |
GetImageNameForItemType16(Guid, out String)
Gets the image name for a 16x16 image representing items of the specified type.
Declaration
public bool GetImageNameForItemType16(Guid itemType, out string imageName)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item. |
System.String | imageName | The name of the 16x16 image. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetImageNameForItemType32(Guid, out String)
Gets the image name for a 32x32 image representing items of the specified type.
Declaration
public bool GetImageNameForItemType32(Guid itemType, out string imageName)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item. |
System.String | imageName | The name of the 32x32 image. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetItem(Guid, String, Collection<Note>, ItemCache, Guid)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(Guid itemType, string representation, Collection<Note> itemNotes, ItemCache itemCache = null, Guid format = null)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item to be created. |
System.String | representation | The representation: usually an xml element. |
Collection<Note> | itemNotes | The item notes. |
ItemCache | itemCache | The item cache. |
Guid | format | The format of the representation to be created, generally taken from RepositoryFormats. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetItem(Guid, XElement, Ddi32Deserializer)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(Guid itemType, XElement element, Ddi32Deserializer deserializer)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item to be created. |
XElement | element | The XML element to be deserialized. |
Ddi32Deserializer | deserializer | The deserializer. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetItem(Guid, XElement, Ddi33Deserializer)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(Guid itemType, XElement element, Ddi33Deserializer deserializer)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item to be created. |
XElement | element | The XML element to be deserialized. |
Ddi33Deserializer | deserializer | The deserializer. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetItem(Guid, XmlNode, Collection<Note>)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(Guid itemType, XmlNode element, Collection<Note> itemNotes)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item to be created. |
XmlNode | element | The XML element to be deserialized. |
Collection<Note> | itemNotes | The item notes. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetItem(Guid, XmlNode, Collection<Note>, DDIWorkflowDeserializer)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(Guid itemType, XmlNode element, Collection<Note> notes, DDIWorkflowDeserializer deserializer)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item to be created. |
XmlNode | element | The XML element to be deserialized. |
Collection<Note> | notes | The notes. |
DDIWorkflowDeserializer | deserializer | The deserializer. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetItem(XElement, Ddi32Deserializer)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(XElement fragment, Ddi32Deserializer deserializer)
Parameters
Type | Name | Description |
---|---|---|
XElement | fragment | The XML element to be deserialized. |
Ddi32Deserializer | deserializer | The deserializer. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetItem(XElement, Ddi33Deserializer)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(XElement fragment, Ddi33Deserializer deserializer)
Parameters
Type | Name | Description |
---|---|---|
XElement | fragment | The XML element to be deserialized. |
Ddi33Deserializer | deserializer | The deserializer. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetItem(XmlNode, DDIWorkflowDeserializer)
Instantiates an IVersionable item by deserializing the provided representantation.
Declaration
public IVersionable GetItem(XmlNode fragment, DDIWorkflowDeserializer deserializer)
Parameters
Type | Name | Description |
---|---|---|
XmlNode | fragment | The XML element to be deserialized. |
DDIWorkflowDeserializer | deserializer | The deserializer. |
Returns
Type | Description |
---|---|
IVersionable | The instantiated IVersionable item. |
GetLabelForItemType(Guid)
Gets a singular label for the specified type of item.
Declaration
public string GetLabelForItemType(Guid itemType)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of item. |
Returns
Type | Description |
---|---|
System.String | A label for the specified item type. |
GetPluralLabelForItemType(Guid)
Gets the type of the plural label for item.
Declaration
public string GetPluralLabelForItemType(Guid itemType)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | Type of the item. |
Returns
Type | Description |
---|---|
System.String |
GetReferencedTypes(Guid)
Gets an array of item types that can be referenced from the specified item type.
Declaration
public Guid[] GetReferencedTypes(Guid itemType)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item. |
Returns
Type | Description |
---|---|
Guid[] | An array of item types that can be referenced from the specified item type. |
GetRepresentation(IVersionable, Guid)
Gets the XML representation for the specified item.
Declaration
public string GetRepresentation(IVersionable item, Guid format)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | The item for which a representation should be created. |
Guid | format | The format of the representation to be created, generally taken from RepositoryFormats. |
Returns
Type | Description |
---|---|
System.String |
GetSortOrder(Guid)
Gets the sort order of the specified item type. Lower numbers are sorted before higher numbers.
Declaration
public int GetSortOrder(Guid itemType)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | Type of the item. |
Returns
Type | Description |
---|---|
System.Int32 | The sort order of the specified item type. |
GetTextExtract(IVersionable)
Gets a list of the ItemTextExtract extracts from the specified item. These extracts are used for full text indexing.
Declaration
public Collection<ItemTextExtract> GetTextExtract(IVersionable item)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | item | The item from which extracts are created. |
Returns
Type | Description |
---|---|
Collection<ItemTextExtract> | A list of extracts. |
GetTypeForItemType(Guid)
Gets the .NET type for the specified item type.
Declaration
public Type GetTypeForItemType(Guid itemType)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item. |
Returns
Type | Description |
---|---|
Type | The .NET type for the specified item type. |
SupportedItems()
Gets a list of item types about which this class can provide information.
Declaration
public List<Guid> SupportedItems()
Returns
Type | Description |
---|---|
List<Guid> | The list of item types about which this class can provide information. |
SupportsItem(Guid)
Determines whether this class can provide information about an item with the specified type.
Declaration
public bool SupportsItem(Guid itemType)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item for which information is being queried. |
Returns
Type | Description |
---|---|
System.Boolean |
|