C# Class Examples.ClientCreatingMetadata

This example class has a number of methods that demonstrate the creation of metadata using the Diffusion Unified API. Metadata is normally created by a control client in order to create topics, but a standard client could create metadata to interpret content (however, it would make much more sense to get the details of the topic which would include its metadata). This example shows the creation of various types of metadata in different methods. Content metadata is used by record type topics. Record metadata is used by paged record topics and field metadata is used by single value topics. Note that no client session is required in order to create metadata.
显示文件 Open project: pushtechnology/diffusion-examples

Public Methods

Method Description
CreateContent ( ) : IMContent

A simple example of creating content metadata with two records.

CreateContentRepeating ( ) : IMContent

An example of how to use a content builder to create content metadat with a single record type that can occur zero to n times.

CreateCurrentRecord ( ) : IMRecord

This creates a record with two fields, a string called "Currency" and a single decimal string called "Rate" with a default value of 1.00.

CreateDecimal ( string name, int scale, double value ) : IMDecimalString

Example of using a decimal field builder. This is purely to demonstrate the use of a builder as in most cases one of the factory convenience methods would be much easier to use to create a new field metadata definition.

CreateMultipleRateCurrencyRecord ( string name, int occurs ) : IMRecord

This creates a record with two fields, a string called "Currency" and a decimal string called "Rate" with a default value of 1.00 which repeats a specified number of times.

CreateNameAndAddressRecord ( ) : IMRecord

Creates a simple name and address record definition with fixed name single multiplicity fields.

Method Details

CreateContent() public method

A simple example of creating content metadata with two records.
public CreateContent ( ) : IMContent
return IMContent

CreateContentRepeating() public method

An example of how to use a content builder to create content metadat with a single record type that can occur zero to n times.
public CreateContentRepeating ( ) : IMContent
return IMContent

CreateCurrentRecord() public method

This creates a record with two fields, a string called "Currency" and a single decimal string called "Rate" with a default value of 1.00.
public CreateCurrentRecord ( ) : IMRecord
return IMRecord

CreateDecimal() public method

Example of using a decimal field builder. This is purely to demonstrate the use of a builder as in most cases one of the factory convenience methods would be much easier to use to create a new field metadata definition.
public CreateDecimal ( string name, int scale, double value ) : IMDecimalString
name string The field name.
scale int The scale of the decimal value, that is, the number of digits to the right of the /// decimal point.
value double The default value.
return IMDecimalString

CreateMultipleRateCurrencyRecord() public method

This creates a record with two fields, a string called "Currency" and a decimal string called "Rate" with a default value of 1.00 which repeats a specified number of times.
public CreateMultipleRateCurrencyRecord ( string name, int occurs ) : IMRecord
name string The record name.
occurs int The number of occurrences of the "Rate" field.
return IMRecord

CreateNameAndAddressRecord() public method

Creates a simple name and address record definition with fixed name single multiplicity fields.
public CreateNameAndAddressRecord ( ) : IMRecord
return IMRecord