Transformer SDK For C  6.2.11.309924
Publishing News Data

Macros

#define NEWS_AUTHSTR_FIELDNUM   5
 Definition of the authorisation string field number. More...
 
#define NEWS_COMPANY_CODE_FIELDNUM   102
 Definition of the company code field number. More...
 
#define NEWS_DATETIME_FIELDNUM   2
 Definition of the date time field number. More...
 
#define NEWS_HEADLINE_FIELDNUM   0
 Definition of the headline field number. More...
 
#define NEWS_PRODUCT_CODE_FIELDNUM   100
 Definition of the product code field number. More...
 
#define NEWS_STORYCODE_FIELDNUM   1
 Definition of the storycode field number. More...
 
#define NEWS_TOPIC_CODE_FIELDNUM   101
 Definition of the topic code field number. More...
 
#define NEWS_USER_CODE_FIELDNUM   200
 Definition of the user code starting field number. More...
 
#define NEWS_USER_CODE_MAX   10
 Maximum number of user codes. More...
 

Detailed Description

Both news stories and headlines may be streamed. Conventionally, the streaming of stories has been thought not to have been beneficial. However, if the data can be arranged such that story corrections are transmitted on the same symbol names as the original story, then the end user will obtain an updated story without having to re-request the story. This is particularly useful for news articles that provide market summaries.

Publishing News Headlines

A news headline update should contain as a minimum the headline of the the story and the time of the story. To uniquely identify the story a story code should be added using the ds_add_news_storycode() function.

To facilitate efficient story searching, topic codes can be added to the headline update using the ds_add_news_product_code(), ds_add_news_topic_code() and ds_add_news_user_code() functions.

Example: Send to all interested peers a news headline on the /NEWS symbol and store the headline in the cache.

ds_data_t *dsdata;
dsdata = ds_init_news("/NEWS",F_CREATEPARENT|F_CREATEOBJECT);
ds_add_news_headline(dsdata,"This is a headline");
ds_add_news_datetime(dsdata,"Oct 14 16:39");
ds_add_news_storycode(dsdata,"1");
  \par Publishing News Stories

Depending on your data requirements, stories may be sent to the Liberator as either broadcast (using the F_NONACTIVE flag), or active.

Story updates should be created using ds_init_data() with the DS_STORY_TYPE object type flag. These updates contain a single field with the fieldnumber 0 which contains the story text.

The story text may be broken across multiple datasource update packets, to indicate that a subsequent update is a continuation and not a replacement, the text should be inserted with the fieldnumber 1.

Example: Send a complete story in one datasource packet.

ds_data_t *dsdata;
dsdata = ds_init_data("/STORY/1",DS_STORY_TYPE,F_CREATEOBJECT|F_CREATEPARENT)(;
ds_add_data(dsdata,0,"Complete story text");

Example: Send a story in a multiple datasource packets.

ds_data_t *dsdata;
dsdata = ds_init_data("/STORY/1",DS_STORY_TYPE,F_CREATEOBJECT|F_CREATEPARENT)(;
ds_add_data(dsdata,0,"First part of story text");
dsdata = ds_init_data("/STORY/1",DS_STORY_TYPE,F_CREATEOBJECT|F_CREATEPARENT)(;
ds_add_data(dsdata,1,"Second part of story text");

Example: Send a story and then send a correction.

ds_data_t *dsdata;
dsdata = ds_init_data("/STORY/1",DS_STORY_TYPE,F_CREATEOBJECT|F_CREATEPARENT)(;
ds_add_data(dsdata,0,"Complete story");
dsdata = ds_init_data("/STORY/1",DS_STORY_TYPE,F_CREATEOBJECT|F_CREATEPARENT)(;
ds_add_data(dsdata,0,"Story correction");
See also
Data Object Flags
Creating Data Objects
Sending DataSource Objects to Peers

Macro Definition Documentation

#define NEWS_AUTHSTR_FIELDNUM   5

Definition of the authorisation string field number.

#define NEWS_COMPANY_CODE_FIELDNUM   102

Definition of the company code field number.

#define NEWS_DATETIME_FIELDNUM   2

Definition of the date time field number.

#define NEWS_HEADLINE_FIELDNUM   0

Definition of the headline field number.

#define NEWS_PRODUCT_CODE_FIELDNUM   100

Definition of the product code field number.

#define NEWS_STORYCODE_FIELDNUM   1

Definition of the storycode field number.

#define NEWS_TOPIC_CODE_FIELDNUM   101

Definition of the topic code field number.

#define NEWS_USER_CODE_FIELDNUM   200

Definition of the user code starting field number.

#define NEWS_USER_CODE_MAX   10

Maximum number of user codes.


Generated on Sat Aug 26 2017 12:36:32 for Transformer SDK For C