Formatting in Vsporten

1. Export Formats 

2. Vsporten.ini 

2.1  Export

2.2  DateFormat

2.3  Folders

2.4  Header tokens 

2.5  Transferring export files over internet

2.6 Language

2.7 Match facts 

2.8 Odbc setup

2.9 Database platform

2.10 Standings

3. SpoFormat

3.1 Template names

3.2 Input file

3.3 Template


1. Export Formats in VSporten

 Formats in Vsporten are defined via the menue Administration->Export formats.

 An export format has the following attributes:

 

Parameter

 Description

Description

describing name of the format

Name

basename of the template file (used when formatting through WatchDogService)

StandingsFmt

basename of the standings format; used within the ini-file

FactsFmt

basename of the matchfacts format; used within the ini-file

Small

determines whether a so called small version is to be output (Yes or No)

Flg1

flag 1, can have value of Yes or No

Extended

determins whether a so called extended version is to be output (Yes or No)

Flg2

flag 2, can have value of Yes or No

Facts

determines whether a so called matchfacts version is to be output (Yes or No)

Track Goals

determines how goals are to be registered and output; can be Single goals, Goal time and Number of Goals

Track Scorers Only

determines whether to register goalscorers alone or with assists

Operator

Mbuilder

SingleMatchFormat

determines the default format on export from either  Match List or Match Facts

When the Export- or Collector-button is pressed down, Vsporten will format the objects defined by the Mbuilder according to the attributes of the chosen format and corresponding settings in the VSporten.ini file. Then the intermediate output file will be created in the export directory as defined in the Vsporten.ini file. 

If WatchDogService is activated then the created file will be forwarded to the SpoFormat-program, which in turn will create the final output files in the destination directory defined in the WatchDogService.ini-file.

 

 2. Vsporten.ini and Vsporten.inicache file

 Vsporten.ini contains vital parameters used by the client application upon start-up.

Even if the Vsporten.inicache is used mainly for storing of the format details – it is a good idea to keep the two files identical.

 Sections within the Vsporten.ini and Vsporten.inicache.

The most important parameters within the sections are explained below.

2.1. Export

2.1.1 Export directory

Defines the directory where export files will be created:

export directory=\\servername\subdir\VSporten\export

 2.1.2 Header token set name

Defines which set of header token names should be used within the export file.

The example below defines that the used header token set is TA

header_tokens=TA

 2.1.3 Internet transfer type

Defines the type of the file transfer. The value can be ftp or just empty.

”Ftp” means that the files are going to be transferred by using ftp. The ftp parameters are defined in the section Internettransfer.

The empty value means that the file will be created in the export directory.

internet transfer type=

 

2.2  DateFormat

2.2.1 Date format

Defines date format within VSporten. This should correspond to the windows locale

date format=YYYY-MM-DD

 

 2.2.2 Sqlserver date xstyle

Tokens value should correspond to the sql servers locale:

sqlserver date xstyle=DD.MM.YYYY

 

 2.2.3 SqlServer date style

Tokens value should correspond to the Windows locale:

sqlserver date style=120

  

2.3. Folders

In the section Folders some special settings for Vsporten can be modified.

2.3.1 Allow changing match date

This token enables/disables (value 1 respectively 0) changing match date within the Match Facts menu.

Allowchangemdate=1

 

2.3.2        Allow dragging and dropping tree nodes

This token enables/disables (value 1 respectively 0) possibility to drag and drop tree nodes.

treenodesdragdrop=1

 

2.3.3        Allow copying players between teams

This token enables/disables possibility to copy players between teams:

SeasonDivPersons=1

 

2.4      Header token sets

Each set is identified by a name of type headertokens.SETNAME. The set name can be referred to from the parameter 1.2 (header_tokens=)

Each set defines names of the so called header tokens. These are tokens used in the export file in the header section.

[Headertokens.tt]

category=KATEGORI=

datesent=DATESENT=

end_of_header=</HEADER>

filenr=BFILNR=

format=FORMAT=

levelcode=NIVAAKOD=

outputid=ID=

prio=PRIO=

productid=PRODID=

queue=EQ=

sex=SEX=

signature=SIGNATUR=

slugg=SLUGG=

sportarea=SPTAREA=

sportcode=SPORTKOD=

sporttype=SPTTYP=

start_of_header=<HEADER>

start_of_text=<TEXT>

status=STATUS=

table_name=TABELL=

timesent=TIMESENT=

xdatesent=XDATESENT=

xoutputid=XID=

xtimesent=XTIMESENT=

ydatesent=YDATESENT=

 

2.5. Transfrerring export files over internet

The section Internettransfer defines the parameters for ftp transfer.

password=PASSWORDCOMESHERE

url=ftp://servernname

username=USERNAMECOMESHERE

 

2.6. Language

This token defines the default language. The language is overwritten by the settings in the VSportens logon table.

language=eng

 

2.7. Match facts formats

Each match facts format is identified by its unique name of type matchfacts.FORMATNAME. FORMATNAME is referred to from the FactsFmt attribute of the export format in Vsporten.

This is the format used for formatting on output to a file (export).

 

The preview format for the FORMATNAME specified in the attribute FactsFmt is matchfacts.dflt_FORMATNAME.

 The default format is matchfacts.dflt. This format is used for formatting objects in the Collector (preview) if the matchfacts.dflt_FORMATNAME is not found in the ini-file.

Above it, if the matchfacts.FORMATNAME does not exists in the ini-file the default format matchfacts.dflt will be also used on output to a file (export).

 A match facts format may inherit parameters from another format. Only one level of inheritance is supported. Some of the parameters may not be inherited. The parent format is defined by the  ”inherit_format” parameter.

 The user can find below the descriptions of the most important parameters within match facts formats. In some of the parameters it is possible to use special tokens, which will be replaced with the real values on output. 

In some parameter strings square brackets ([]) may be used to surround a group of tokens. If all of the tokens within a bracket pair return empty strings then the entire string within the bracket pair will not be output. However, the square brackets may not be implemented in some of the parameters.   

Type of team name used in the export of top attendance listing.

att_team_name=l_team

 

Formatting string for the attendance numbers

audience_format=#,###

 

Automatic determining of period number and calculation of period results can be set by using autoset_periods

autoset_periods=NN 

NN can have values calculated by the following expression: X+64*Y

X=0 - disable automatic setting of period number in scores table in MatchFacts menu

X=1 - enable automatic setting of period numbers in scores table; period number of a goal/score will be set to the period number appearing on the line above; the user may manually edit period number directly in the score-table

X=2 - enable automatic setting of period numbers in scores table; period number is determined by the time of the goal/score and the length of the period.

Y=0 - disable automatic calculation of period results

Y=1 - enable automatic calculation of period results

The default value of autoset_periods is defined  in the sports-table (column AutosetFlag)

 

Opening string inserted before the comments-field (from the Match Facts menu)

comments_open=***

 

Closing string appended to the comments-field (from the Match Facts menu)

comments_close=***

 

Opening string inserted before beginning of a conference

conference_close=</h2>

 

Closing string appended at the end of conference

conference_open=<br><h2>

 

Event-formatting strings below are applied when group_events_by_teams is equal 0. Numbers in the names refers to event_type_id, that is 1 – yellow card, 2 – red card, 5 – double yellow card

event_format0=&nbsp;<FONT COLOR='orange' >%s_event%:{ %player%[ (%s_reason%)], %team% [(%min%[.%sec%])], }.</FONT>

event_format1=&nbsp;<FONT COLOR='orange' >%s_event%:{ %player%[ (%s_reason%)], %team% [(%min%[.%sec%])], }.</FONT>

event_format2=&nbsp;<FONT COLOR='red'>%s_event%:{ %player%[ (%s_reason%)], %team% [(%min%[.%sec%]), }.</FONT>

event_format5=&nbsp;<FONT COLOR='blue'>%s_event%:{ %player%[ (%s_reason%)], %team% %min%[.%sec%],}</FONT>

event_format11=&nbsp;<FONT COLOR='blue'>%s_event%:{ %player%[ (%s_reason%)][ - %player2%], %team% %min%[.%sec%],}</FONT>

 

Event-formatting strings below are applied when group_events_by_teams is equal 1

event_format0t=%s_event% - {%team%:{ %player%[ ([%min%[.%sec%]][-%s_reason%])],}.}&nbsp;

event_format1t=<FONT COLOR='orange' >%s_event% - {%team%:{ %player%[ ([%min%[.%sec%]][-%s_reason%])],}.}&nbsp;</FONT>

event_format2t=<FONT COLOR='red' >%s_event% - {%team%:{ %player%[ ([%min%[.%sec%]][-%s_reason%])],}.}&nbsp;</FONT>

event_format3t=<FONT COLOR='blue' >%s_event% - {%team%:{ %player%[ ([%min%[.%sec%]][-%s_reason%])],}.}&nbsp;</FONT>

event_format4t=<FONT COLOR='blue' >%s_event% - {%team%:{ %player%[ ([%min%[.%sec%]][-%s_reason%])],}.}&nbsp;</FONT>

event_format5t=<FONT COLOR='blue' >%s_event% - {%team%:{ %player%[ ([%min%[.%sec%]][-%s_reason%])],}.}&nbsp;</FONT>

event_format11t=<FONT COLOR='green'>%s_event% - {%team%:{ %player%[ ([%min%[.%sec%]][-%player2%])],}.}&nbsp;</FONT>

 

Strings below are used when event-formatting strings above are not defined

event_sep=&nbsp;

events_close=

events_open=

eventtype_chr=,&nbsp;

eventtype_close=

eventtype_open=

 

To allow automatic exporting of all matches in the current round the value of the token below should be 1. To allow exporting only matches played within the current date the value should be set to 0

export_entire_round=1

   

Normally a team's full time result is a sum of team's period results within a specific match. This can be overridden by the following parameter

full_time_result=X

where X can be 

0 - the default value meaning that a team's full time result is a sum of  its period results 

1 - meaning that a team's full time result is a sum of won periods

The default value of this parameter is set by the sport table (column FullTimeFlag).

 

Strings outputted around each match

game_close=

game_open=

 

Strings outputted around all matches

games_open=<div>

games_close=</div><br>

 

Additional format strings to be used in goal facts

goal_sep=&nbsp;

goals_close=

goals_open=

 

Opening and closing strings output around a group

group_open=<br><h3>

group_close=</h3><table cellpadding=1 cellspacing=1 border=0 bgcolor='lavender' width='540'>

 

This parameter tells VSporten to group events by teams:

group_events_by_teams=1

 

This parameter allows grouping of the matches by match date. 

group_matches_by_match_date=1

 

If the group_matches_by_match_date is set to 1 then the string below will be used to format the match date

group_matches_by_match_date_format=<br><u>%mdate%:</u><br>

 

The parameters below define strings around the headline as well as the format of the headline

headline_open=

headline_close=</h1>

headline_format=<h3>%sport%:</h3><h1>%division%</h1>&nbsp;Round: %round%

 

The parameters below define the output format of the lineups. Within the strings the following tokens can be used: %hteam% (home team's name),  %ateam% (away team's name), %hlines% (home team's lines), %alines% (away team's lines),  %players% (participating players), %player% (participating player), %shiftin% (time in minutes when the replacing player went in), %replacement% (name of the replacing player), %firstname%, %lastname%.

lineups_format=[<br>%hteam%:&nbsp;%hlines%<br>][<br>%ateam%:&nbsp;%alines%<br>]

lineups_line_format=%players% -\sp

lineups_player_format=%player%[ (%replacements%)]

lineups_player_replacements_format=[%shiftin%][. %replacement%]

lineups_player_name_format=[%firstname% ]%lastname%

 

The parameter below defines the overall format of the matchfacts. The match facts format string can contain tokens the following tokens %result%, %goals%, %events%, %referee%, %attendance%, %arena%, %freenotes% and %freetext%. The tokens correspond to the objects within the MatchFacts-menue in VSporten.

match_facts_format=%result%[[Goals: %goals%<br>][%events%<br>][[Referee: %referee%. ][Attendance:  %attendance%. ][Stadion: %arena%. ]<br>][%freenotes%][%freetext%]]

 

The parameters below define the size of the top scorers list.

max_nr_scorers_in_toplist=30

min_nr_goals_in_toplist=1

 

Strings formatting the next week program:

next_week_program_close=<br>

next_week_program_date_close=</i><br>

next_week_program_date_open=<i>

next_week_program_format=%h_team% - %a_team%&nbsp%time%<br>

next_week_program_headline=Next weeks matches

next_week_program_headline_close=</b><br>

next_week_program_headline_open=<b>

next_week_program_open=

 

Strings around notes:

note1_close=<br>

note1_open=

note2_close=<br>

note2_open=<br>

note3_close=<br>

note3_open=<br> *)

 

Strings below are used around ”number of goals” or ”goal time” when only goal time or number of goals are exported. The nrg_null_one_goal  determines whether to output 1 or nothing when a player has scored only 1 goal/point. 

nr_goals_close=)

nr_goals_open=(

nrgoals_format="[<br>%hteamgoals%.<br>][<br>%ateamgoals%.<br>]"

nrgoals_teamgoals="%team%: {%player%[ %nrgoals%][ (%nrpenalties%)][, ]}"

nrg_null_one_goal=1

 

Name used instead of the player name when the goal is own and playername_on_own_goal is equal 0. If playername_on_own_goal  is equal 1 the full name of the player who made the own goal will be output.

own_goal_name=own goal

playername_on_own_goal=1

 

Separator string between numbers in period results (1:2, 2:3)

per_result_sep=:

 

Separator string between period results (1:2, 2:3)

period_sep=,&nbsp;

 

Strings around periods

periods_close=)

periods_open=(

 

Strings around players when event-formatting strings are not used:

person_close=

person_open=

person_sep=&nbsp;-

 

Type of team name when exporting next weeks program:

prg_team_name=l_team

program_date_format=YYYY-MM-DD:

program_time_format=h:mm

 

Headline for the remaining matches list

rest_program_headline=Remaining matches

 

Headline for the remaining matches in the current round

rest_round_program_headline=Remaining matches in the current round

 

Result line format string. The string can contain following tokens: %h_team% (home team name), %a_team% (away team name), %h_goals% (goals won by home team), %a_goals% (goals won by away team), %comment% (the string from the comment field in the MatchFacts), %status% (status of the match).

result_line_format=<br><b>%h_team%&nbsp;-&nbsp;%a_team%&nbsp;[&nbsp;%h_goals%:%a_goals%]</b>[&nbsp;%comments%][%periods%][&nbsp;%status%]<br>

 

Separator between home and team goals in the result line when result_line_format is not used.

result_sep=-

 

Type of team names used in the result line:

result_team_name=long

 

Type of team names used in the top scorer listing:

sco_team_name=l_team

 

Strings defining the line separators within the standings table:

sep_line_1_close=

sep_line_1_open=<tr bgcolor='lavender'><td colspan=8><table></table></td></tr>

sep_line_2_close=

sep_line_2_open=<tr bgcolor='GhostWhite'><td colspan=8><table></table></td></tr>

sep_line_3_close=

sep_line_3_open=<tr bgcolor='Orange'><td colspan=8><table></table></td></tr>

sep_line_4_close=

sep_line_4_open=<tr bgcolor='Red'><td colspan=8><table></table></td></tr>

 

Single goal format strings (without or with assists). In the two format strings following tokens can be used: %h_goals% (home team's goals), %a_goals% (away team's goals),  %player% (scorer's name),  %min% and %sec% (goal time in minutes and seconds), %goaltype% (goal type), %notes% (goal notes), %player2% (assisting player's name),  %player3% (second assisting player's name). 

single_goal_format=%h_goals%:%a_goals% %player%[ ([%min%[.%sec%]][-%goaltype%][, %notes%])],

single_goal_with_assistance_format=%h_goals%:%a_goals%[ (%min%.%sec%)] %player%[ (%player2%[, %player3%])][ %notes%]

 

Single match headline format:

single_match_headline_format=%h_team% - %a_team%[ %h_goals%:%a_goals% %periods%][ %status%]

 

Strings around the standings table:

standings_close=</table><br>

standings_open=

 

Substitute strings (separated by a semicolon). The substitutions are applied after an entire match has been formatted. The substitutions can be used to remove or replace invalid string combinations like ",." and so on.

substitute=¤(/¤(¤;¤.,¤.¤;¤..¤.¤;¤(, ¤(¤;¤,<br>¤.<br>¤;¤, .¤.¤;¤ - <br>¤.<br>¤;¤,.¤.¤;

 

Summary format. A format for the special output (summary) of match facts and standings table can be defined here.  

summary_format=<br><br><FONT SIZE=-1 style='text-decoration:none'><b>Summary</b><br>[<br>%sport%: %name%: %summary_results%<br>]<br>%summary_table%<br></FONT>

summary_result_format=%h_team% - %a_team%[ %h_goals%:%a_goals%][ %periods%][ %status%].&nbsp;

summary_standings_format=%np%. %team% [%t_m%/]%points%[ ([%t_w_g%]:[%t_l_g%])].&nbsp;

summary_standings_review_format=%np%. %team% [%t_m%/]%points%[ (%t_w_g%:%t_l_g%)].&nbsp;

summary_table_format=Table[ (after round nr %roundnr%)]: %standings%<br>

 

Format strings below are used only when the event format strings are not used (that is when group_events_by_teams is equal 0 and strings  event_formatX are not defined).

team_open=

team_close=

 

Format strings below are used only when the team's event format strings are not used (that is when group_events_by_teams is equal 1 and strings  event_formatXt are not defined.)

team_goals_close=.<br>

team_goals_open=

team_goals_team_open=

team_goals_team_close=:&nbsp;

 

Type of team names used in standings tables

team_name_format={0,-20}

 

Strings around goal time when other formats are not used:

time_close=)

time_open=&nbsp;(

 

Format strings defining format of the top scorers list:

topscorers_open="<table border=0 bgcolor=ghostwhite>"

topscorers_close="</table>\nl"

topscorers_format="<tr bgcolor=white><td align='left'>%name%</td><td align='left'>%team%</td><td align='right'>%i_goals%</td><td align='right'><b>%t_goals%</b></td><td align='right'>%h_goals%</td><td align='right'>%a_goals%</td></tr>"

topscorers_headline_open="<tr bgcolor=khaki><td colspan=6><h3>Liga strzelców</h3></td></tr>"

topscorers_headline="<tr bgcolor=ghostwhite><td></td><td></td><td colspan=4 align='center'>Gole</td></tr>"

topscorers_headline_close="<tr bgcolor=ghostwhite><td align='left'>Zawodnik</td><td align='left'>Drużyna</td><td align='right'>W kolejce</td><td align='right'>Razem</td><td align='right'>U siebie</td><td align='right'>Na wyjeździe</td></tr>"

 

Format strings for the attendance top list:

topaudience_open="<br><br><table border=0 bgcolor=ghostwhite>"

topaudience_close="</table>\nl"

topaudience_format="<tr bgcolor=white><td align='left'>%team%</td><td align='right'><b>%t_audience%</b></td><td align='right'>%h_audience%</td><td align='right'>%a_audience%</td></tr>\nl"

topaudience_headline_open="<tr bgcolor=lavendel><td colspan=4><h3>Liga kibiców</h3></td></tr>"

topaudience_headline="<tr bgcolor=ghostwhite><td></td><td colspan=3 align='center'>Kibice</td></tr>"

topaudience_headline_close="<tr><td align='left'>Drużyna</td><td align='right'>Razem</td><td align='right'>U siebie</td><td align='right'>Na wyjezdzie</td></tr>\nl"

 

Parameters for the special sorting of matches. 

sort_matches_by_group_and_date_asc=0

mark_winning_team=0

mark_winning_team_format=<b><FONT COLOR='red'>%team%</FONT></b>

mark_winning_team_line_sep=<br>

 

String formats for formatting of the yellow cards top listing:

yellowcards_open="<br><br><table bgcolor=ghostwhite border=0>"

yellowcards_headline_open="<tr bgcolor=yellow><td colspan=4>Żółte kartki</td></tr>"

yellowcards_headline="<tr bgcolor=ghostwhite><td>Drużyna</td><td>Razem</td><td>U siebie</td><td>Na wyjeździe</td></tr>"

yellowcards_headline_close=""

yellowcards_format="<tr bgcolor=white><td>%team%</td><td><b>%t_y_cards%</b></td><td>%h_y_cards%</td><td>%a_y_cards%</td></tr>\nl"

yellowcards_close="</table>"

 

String formats for formatting the red cards top listing:

redcards_open="<br><br><table bgcolor=ghostwhite border=0>\nl"

redcards_headline_open="<tr bgcolor=orange><td colspan=5>Czerwone kartki</td></tr>"

redcards_headline="<tr bgcolor=ghostwhite><td>Zawodnik</td><td>Drużyna</td><td>Razem</td><td>U siebie</td><td>Na wyjeździe</td></tr>"

redcards_headline_close=""

redcards_format="<tr bgcolor=white><td>%name%</td><td>%team%</td><td><b>%t_r_cards%</b></td><td>%h_r_cards%</td><td>%a_r_cards%</td></tr>\nl"

redcards_close="</table>\nl"

 

Format for listing of the yellow and red cards in one table

rycards_open="<br><br><table bgcolor=ghostwhite border=0>"

rycards_headline_open="<tr bgcolor=blue><td colspan=4>Czerwone i żółte kartki</td></tr>\nl"

rycards_headline="<tr bgcolor=ghostwhite><td>Zawodnik</td><td>Drużyna</td><td>Czerwone</td><td>Żółte</td></tr>"

rycards_headline_close=""

rycards_format="<tr bgcolor=white><td>%name%</td><td>%team%</td><td>%t_r_cards%</td><td>%t_y_cards%</td></tr>\nl"

rycards_close="</table>\nl"

 

Inheriting parameters from another one can create a new format.

This can be accomplished by using the token inherit_format like in the example below.

 

[matchfacts.dflt_basketball]

; this format is inheriting parameters from the default format (matchfacts.dflt)

inherit_format=dflt

; enables automatic numbering of periods, also enables automatic recounting

; periodresults (=64)

autoset_periods=64

result_line_format=<br><b>%h_team%&nbsp;-&nbsp;%a_team%&nbsp;[&nbsp;%h_goals%:%a_goals%]</b>[&nbsp;%comments%][%periods%][&nbsp;%status%]<br>

match_facts_format=%result%[[Punkty: %goals%<br>][%events%<br>][[Sędziował %referee%. ][Widzów %attendance%. ]<br>]]

 

2.8 Odbc setup

dsn=DSNNAME

lock mfstrings=0

pwd=PASSWORD

uid=UID

DBOWNER=DBOWNER

 

2.9 Database platform

This parameter defines the type of the database (ex. oracle, sqlserver):

database=sqlserver

 

 2.10 Standings

This section contains the format strings referred to from Vsporten export format (attribute StandingsFmt). The StandingsFmt defines the basename of the standings table format. If the basename from the StandingsFmt is not found in this section the default format will be used (basename=dflt).

 

2.10.1 Format strings

For each basename there might be up to 6 different format strings:

basename_review_header_small

Format of the header of the small table on review (within the Collector)

basename_review_header_expanded

Format of the header of the expanded table on review

basename review_small

Format of the rows in the small table on review

basename review_expanded

Format of the rows in the expanded table on review 

basename_small

Format of the rows in the small table on export to a file

basename_expanded

Format of the rows in the expanded table on export to a file

 

2.10.2 Tokens

The following tokens can be used within each format for the table rows:

Token

Description

%npx%

Team’s rank with an appended dot.

The output rank will be empty if the team above has the same rank 

%npz%

Team’s rank. The output rank will be empty if the team above has the same rank

%np%

Team’s rank. The output rank will always be a number.

%team_id%

Team id

%team%

Team

%points%

Points

%t_m%

Total number of matches played

%t_w%

Total number of matches won

%t_t%

Total number of matches tied

%t_l%

Total number of matches lost

%t_w_g%

Total scored (won) goals

%t_l_g%

Total lost goals

%h_points%

Number of points scored home

%h_w%

Number of matches won home

%h_t%

Number of matches tied home

%h_l%

Number of matches lost home

%h_w_g%

Goals scored (won) home

%h_l_g%

Goals lost home

%a_points%

Number of points scored away

%a_w%

Number of matches won away

%a_t%

Number of matches tied away

%a_l%

Number of matches lost away

%a_w_g%

Goals scored (won) away

%a_l_g%

Goals lost away

%pynt%

Team mark

%penalty%

Penalty points

%bonus%

Bonus points

%t_wquote%

Ratio of won matches to total played matches;

to output the ratio with 3 decimals: %t_wquote:#0.000%

%t_hquote% Ratio of won home matches to total home matches
%t_aquote% Ratio of won away matches to total away matches

%t_sd_w%

Total number of matches won in sudden death

%t_sd_l%

Total number of matches lost in sudden death

%t_ps_w%

Total number of matches won by penalties

%t_ps_l%

Total number of matches lost by penalties

%t_sdps_w%

Total number of matches won either in sudden death or by penalties

%t_sdps_l%

Total number of matches lost either in sudden death or by penalties

Tokens can be combined with special formatting command @ (right justification) or !@ (left justification).

Examples:

- left justified string

%team:!@35% outputs team name left-justified in a 35-characters string field.

- right justified string

%a_points:@3% outputs points won away right-justified in a 3-characters string field.

 

2.10.3 Some examples of the standings formats

sifootball_review_header_small="<table cellpadding=1 cellspacing=1 border=0 bgcolor='lavender' width='540'><tr bgcolor='WhiteSmoke'><td width='30'></td><td width='180'>Klub</td><td align='right' width='30'>Mecze</td><td align='right'  width='30'>Wygrane</td><td align='right' width='30'>Remisy</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>Bramki</td><td align='right' width='30'>Punkty</td><td align='right' width='60'>Różnica</td></tr>"

;

sifootball_review_small="<tr bgcolor="White"><td width='30' align='right'>%npz%.&nbsp;</td><td width='180'>%team% %pynt%</td><td align='right' width='30'>%t_m%</td><td align='right' width='30'>%t_w%</td><td align='right' width='30'>%t_t%</td><td align='right' width='30'>%t_l%</td><td align='center' width='120'>%t_w_g%:%t_l_g%</td><td align='right' width='30'>%points%</td><td align='right'>[%+ t_l_g t_w_g -%]</td></tr>"

sifootball_expanded=B;%npx%;%np%;%team_id%;%team%;%points%;%t_m%;%t_w%;%t_t%;%t_l%;%t_w_g%:%t_l_g%;%h_points%;%h_w%;%h_t%;%h_l%;%h_w_g%:%h_l_g%;%a_points%;%a_w%;%a_t%;%a_l%;%a_w_g%:%a_l_g%;%pynt%;%penalty%;%bonus%\nl

;

sifootball_small=B;%npz%.;%np:@2%;%team_id%;%team:!@35%;%points:@3%;%t_m:@3%;%t_w:@3%;%t_t:@3%;%t_l:@3%;%t_w_g:@3%:%t_l_g:!@3%;%h_points:@3%;%h_w:@3%;%h_t:@3%;%h_l:@3%;%h_w_g:@3%:%h_l_g:!@3%;;%a_w:@3%;%a_t:@3%;%a_l:@3%;%a_w_g:@3%:%a_l_g:!@3%;%pynt%;%penalty%;%bonus%;\nl

;

basketball_review_header_small="<table cellpadding=1 cellspacing=1 border=0 bgcolor='lavender' width='540'><tr bgcolor='WhiteSmoke'><td width='30'></td><td width='180'>Klub</td><td align='right' width='30'>Mecze</td><td align='right' width='30'>Wygrane</td><td align='right' width='30'>Przegrane</td><td align='right' width='30'>Punkty</td><td align='right' width='60'>Kosze</td><td align='right' width='60'>Różnica</td></tr>"

basketball_review_small="<tr bgcolor="White"><td width='30' align='right'>%npz%.&nbsp;</td><td width='180'>%team% %pynt%</td><td align='right' width='30'>%t_m%</td><td align='right' width='30'>%t_w%</td><td align='right' width='30'>%t_l%</td><td align='right' width='30'>%points%</td><td align='center' width='120'>%t_w_g%:%t_l_g%</td><td align='right'>[%+ t_l_g t_w_g -%]</td></tr>"

;

basketball_expanded=B;%npx%;%np%;%team_id%;%team%;%points%;%t_m%;%t_w%;%t_t%;%t_l%;%t_w_g%:%t_l_g%;%h_points%;%h_w%;%h_t%;%h_l%;%h_w_g%:%h_l_g%;%a_points%;%a_w%;%a_t%;%a_l%;%a_w_g%:%a_l_g%;%pynt%;%penalty%;%bonus%\nl

;

basketball_small=B;%npz%.;%np:@2%;%team_id%;%team:!@35%;%points:@3%;%t_m:@3%;%t_w:@3%;%t_t:@3%;%t_l:@3%;%t_w_g:@3%:%t_l_g:!@3%;%h_points:@3%;%h_w:@3%;%h_t:@3%;%h_l:@3%;%h_w_g:@3%:%h_l_g:!@3%;%a_points:@3%;%a_w:@3%;%a_t:@3%;%a_l:@3%;%a_w_g:@3%:%a_l_g:!@3%;%pynt%;%penalty%;%bonus%;[%+ t_l_g t_w_g -%]\nl

;

basketball_review_header_expanded="<table cellpadding=1 cellspacing=1 border=0 bgcolor='lavender' width='1040'><tr bgcolor='WhiteSmoke'><td colspan='2'></td><td colspan='6' align='center'>Razem</td><td colspan='4' align='center'>U siebie</td><td colspan='4' align='center'>Na wyjezdzie</td></tr><tr bgcolor='WhiteSmoke'><td width='30'></td><td width='180'>Klub</td><td align='right' width='30'>Punkty</td><td align='right' width='30'>Mecze</td><td align='right' width='30'>Wygrane</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>M.punkty</td><td align='right' width='60'>Różnica</td><td align='right' width='30'>Wygrane</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>M.punkty</td><td align='right' width='60'>Różnica</td><td align='right' width='30'>Wygrane</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>M.punkty</td><td align='right' width='60'>Różnica</td></tr>"

;

basketball_review_expanded="<tr bgcolor='White'><td width='30' align='right'>%npz%.&nbsp;</td><td width='180'>%team% %pynt%</td><td align='right' width='30'>%points%</td><td align='right' width='30'>%t_m%</td><td align='right' width='30'>%t_w%</td><td align='right' width='30'>%t_l%</td><td align='center' width='120'>%t_w_g%:%t_l_g%</td><td align='right'>[%+ t_l_g t_w_g -%]</td><td align='right' width='30'>%h_w%</td><td align='right' width='30'>%h_l%</td><td align='center' width='120'>%h_w_g%:%h_l_g%</td><td align='right'>[%+ h_l_g h_w_g -%]</td><td align='right' width='30'>%a_w%</td><td align='right' width='30'>%a_l%</td><td align='center' width='120'>%a_w_g%:%a_l_g%</td><td align='right'>[%+ a_l_g a_w_g -%]</td></tr>"

;

dflt_review_header_small="<table cellpadding=1 cellspacing=1 border=0 bgcolor='lavender' width='540'><tr bgcolor='WhiteSmoke'><td width='30'></td><td width='180'>Klub</td><td align='right' width='30'>Mecze</td><td align='right'  width='30'>Wygrane</td><td align='right' width='30'>Remisy</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>Bramki</td><td align='right' width='30'>Punkty</td><td align='right' width='60'>Różnica</td></tr>"

;

dflt_review_small="<tr bgcolor='White'><td width='30' align='right'>%npz%.&nbsp;</td><td width='180'>%team% %pynt%</td><td align='right' width='30'>%t_m%</td><td align='right' width='30'>%t_w%</td><td align='right' width='30'>%t_t%</td><td align='right' width='30'>%t_l%</td><td align='center' width='120'>%t_w_g%:%t_l_g%</td><td align='right' width='30'>%points%</td><td align='right'>[%+ t_l_g t_w_g -%]</td></tr>"

;

dflt_small=B;%npz%.;%np:@2%;%team_id%;%team:!@35%;%points:@3%;%t_m:@3%;%t_w:@3%;%t_t:@3%;%t_l:@3%;%t_w_g:@3%:%t_l_g:!@3%;%h_points:@3%;%h_w:@3%;%h_t:@3%;%h_l:@3%;%h_w_g:@3%:%h_l_g:!@3%;%a_points:@3%;%a_w:@3%;%a_t:@3%;%a_l:@3%;%a_w_g:@3%:%a_l_g:!@3%;%pynt%;%penalty%;%bonus%;[%+ t_l_g t_w_g -%]\nl

dflt_review_header_expanded="<table cellpadding=1 cellspacing=1 border=0 bgcolor='lavender' width='1240'><tr bgcolor='WhiteSmoke'><td colspan='2'></td><td colspan='7' align='center'>Razem</td><td colspan='5' align='center'>U siebie</td><td colspan='5' align='center'>Na wyjezdzie</td></tr><tr bgcolor='WhiteSmoke'><td width='30'></td><td width='180'>Klub</td><td align='right' width='30'>Punkty</td><td align='right' width='30'>Mecze</td><td align='right' width='30'>Wygrane</td><td align='right' width='30'>Remisy</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>M.punkty</td><td align='right' width='60'>Różnica</td><td align='right' width='30'>Wygrane</td><td align='right' width='30'>Remisy</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>M.punkty</td><td align='right' width='60'>Różnica</td><td align='right' width='30'>Wygrane</td><td align='right' width='30'>Remisy</td><td align='right' width='30'>Przegrane</td><td align='center' width='120'>M.punkty</td><td align='right' width='60'>Różnica</td></tr>"

;

dflt_review_expanded="<tr bgcolor='White'><td width='30' align='right'>%npz%.&nbsp;</td><td width='180'>%team% %pynt%</td><td align='right' width='30'>%points%</td><td align='right' width='30'>%t_m%</td><td align='right' width='30'>%t_w%</td><td align='right' width='30'>%t_t%</td><td align='right' width='30'>%t_l%</td><td align='center' width='120'>%t_w_g%:%t_l_g%</td><td align='right'>[%+ t_l_g t_w_g -%]</td><td align='right' width='30'>%h_w%</td><td align='right' width='30'>%h_t%</td><td align='right' width='30'>%h_l%</td><td align='center' width='120'>%h_w_g%:%h_l_g%</td><td align='right'>[%+ h_l_g h_w_g -%]</td><td align='right' width='30'>%a_w%</td><td align='right' width='30'>%a_t%</td><td align='right' width='30'>%a_l%</td><td align='center' width='120'>%a_w_g%:%a_l_g%</td><td align='right'>[%+ a_l_g a_w_g -%]</td></tr>"

dflt_expanded=B;%npx%;%np%;%team_id%;%team%;%points%;%t_m%;%t_w%;%t_t%;%t_l%;%t_w_g%:%t_l_g%;%h_points%;%h_w%;%h_t%;%h_l%;%h_w_g%:%h_l_g%;%a_points%;%a_w%;%a_t%;%a_l%;%a_w_g%:%a_l_g%;%pynt%;%penalty%;%bonus%\nl

3. SpoFormat and templates

3.1 Template names

 The formatting program SpoFormat that is invoked by the WatchDogService uses template files. SpoFormat finds the templates names in the input file’s header field FORMAT and creates one output file per each specified template. The base name of a template file is specified by the name attribute in the export format definition.

Depending on the values of attributes Small, Extended and Facts up to three different output files can be created by SpoFormat via WatchDogService:

a) Small version

If Small equals ’yes’ then template file with name basenamesY will be used to create this version, where Y=0 (if flg1=no) or Y=p (if flg1=yes)

If Small equals ’no’ this version will not be created

b) Extended version

If Extended equals ’yes’ then template file with name basenamebY will be used to create this version, where Y=0 (if flg2=no) or Y=p (if flg2=yes)

If Extended equals ’no’ this version will not be created.

c) Facts version

If Facts equals ’yes’ then template file with name basenamem will be used to create this version.

If Facts equals ’no’ this version will not be created.

 

3.2 Input File

 The output file from the Vsporten is divided into 2 parts: the header section between <HEADER> and </HEADER> and the text section below <TEXT>. The output file from Vsporten will become the input file to the SpoFormat program if the WatchDogService is used.

SpoFormat opens the input file and finds out what template names are specified in the FORMAT-field in the header section of the file. Then, the program will produce one output file per each specified template.

 

3.2.1 Example of an output file from Vsporten

Example of an input file:

<HEADER>

TABELL=JERZYs Pierwsza liga

SLUGG=fotboll-liga1

STATUS=+

SIGNATUR=Administrator

PRIO=3

FORMAT=sitablesp sitablem

BFILNR=

XDATESENT=20050721

YDATESENT=2005-07-21

XTIMESENT=000143

DATESENT=21.07.2005

TIMESENT=00:01:43

EQ=VSPORT

PRODID=TAB

KATEGORI=SPT

ID=164

XID=0000164

SEX=M

SPTTYP=Futbol

SPTAREA=Krajowe ligi

SPORTKOD=

VSPVER=3.4.0.build06

</HEADER>

<TEXT>

r;JERZYs Pierwsza liga;6;10

o;<results>

t;Mittwoch (2005-07-20):

A;710B503AA;2005-07-20;5;2;Groclin;-;4;Wisla Kraków;2:2;(1:1) ;

W;1

q;</results>

o;

B;1;1;3;Amica;11;5;3;0;2;13:10;0;0;0;1;1:2;9;3;0;1;12:8;;1;3

C;;;;;---------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

B;7;7;2;Groclin;7;6;2;1;3;10:16;7;2;1;1;10:7;0;0;0;2;0:9;;0;0

B;8;8;7;Plock;6;5;1;2;2;5:7;1;0;1;2;3:6;4;1;1;0;2:1;;0;0

C;;;;;---------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

B;9;9;22;Zaglebie Lubin;4;3;1;1;1;5:4;0;0;0;1;1:2;4;1;1;0;4:2;;0;0

B;11;11;24;Lech Poznan;3;4;1;0;3;3:4;3;1;0;1;3:2;0;0;0;2;0:2;;0;0

B;12;12;27;Leczna;3;3;1;0;2;4:7;0;0;0;1;0:5;3;1;0;1;4:2;;0;0

Q;

o;

B;2;2;6;Cracovia;10;6;3;1;2;10:8;4;1;1;1;5:3;6;2;0;1;5:5;;0;0

B;3;3;25;Górnik Zabrze;9;4;3;0;1;7:2;9;3;0;1;7:2;0;0;0;0;0:0;;0;0

C;;;;;---------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

B;4;4;29;Polonia Warszawa;9;4;3;0;1;8:5;3;1;0;0;2:0;6;2;0;1;6:5;;0;0

C;;;;;---------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

B;5;5;1;Legia Warszawa;9;5;3;0;2;11:11;6;2;0;0;7:4;3;1;0;2;4:7;;0;0

B;6;6;23;MKS Pogon Szczecin;7;3;2;1;0;11:5;6;2;0;0;8:2;1;0;1;0;3:3;;0;0

B;10;10;28;GKS ;4;3;1;1;1;1:2;3;1;0;0;1:0;1;0;1;1;0:2;;0;0

B;13;13;26;Odra Wodzislaw;2;3;0;2;1;4:5;2;0;2;0;3:3;0;0;0;1;1:2;;0;0

B;14;14;4;Wisla Kraków;1;4;0;1;3;5:11;0;0;0;2;2:6;1;0;1;1;3:5;M;0;0

Q;  

3.3  Template

A template is build up of static text strings, commands and variable.

Commands are the words beginning with %. Variables are the words beginning with #.

Variables’ names and values must be defined in the header section of the input file. It is not allowed to use variable names not defined in the header section of the input file.

Special command %ROWDATA reads in contents of the input file and formats it according to variables and commands contained above the %ROWDATA-command. %EOT ends the template.

SpoFormat works line- and column-oriented. It determines the type of each line in the input file by investigating the beginning of the line. If a line begins with a letter followed by a field separator (semicolon) than this letter defines the type of this line.

A list of mandatory fields for a given line type is provided by the %RCOLSIN command. %RCOLSIN defines the field names, which can be used later in %RCOLSOUT.

The command %RCOLSOUT determines what fields and in what order will be outputted.

Some simple formatting commands can be applied on fields within %RCOLSIN.

A set of commands is available to output strings around a region of lines of the same type or around a line or around a field.

These commands are %RPREF and %RSUFF, %LPREF and %LSUFF, %CPREF and %CSUFF.

Field names defined in %RCOLSIN can be used in %CPREF and %CSUFF.

Command %XCLINES blocks output of the specified line types.

Command %INCLINES allows only output of the specified line types.

 SpoFormat tries to split a line of a given type into fields

 

3.3.1 Example of a template file

_SPO9999 3 SPO 999 S01#{XDATESENT}S99999%CCOFF

#SPTTYP-#SLUGG-#TIMESENT

_#SLUGG 

%DELIMITER="!"

%XCLINES=(E!F!G!H!J!K!R!V!W!p!b!g)

%CPREF=()

%CSUFF=()

%RPREF=()

%RSUFF=()

%LPREF=()

%LSUFF=()

%LPREF=(y,)

%LSUFF=(y, )

%RPREF=(B, )

%RSUFF=(B,)

%LPREF=(C,---------------------------------------------)

%LSUFF=(C, )

%RCOLSIN=(A!MATCHID!MDATE:%s:r,-,:!ROUND!HLAGID!HLAG!sep1!BLAGID!BLAG!RES:%s:r,:,:!PERSTAT!sep3!divid!hconfid!aconfid!hgrpid:%s:r,0,!agrpid:%s:r,0,!hscore!ascore)

%FMTCHR1="¤"

%RCOLSOUT=(A:%V:$HLAG$ - $BLAG$ $RES$ $PERSTAT$)

%FMTCHR1=":"

%RCOLSIN=(r!RUB!ROUND!TOTROUNDS)

%RCOLSOUT=(r:%V:$RUB$, $ROUND$ kolejka\nl)

%RCOLSIN=(B!cp!fp!tid!LAG!PT!SM!VM!OM!FM!GMIM!HP!HV!HO!HF!HGHI!BP!BV!BO!BF!BGBI!pynt!pu!bo!SERIEID!KONFID!GRUPPID)

%RCOLSOUT=(B:%V:$LAG$ $SM$ $VM$ $OM$ $FM$ $GMIM$ $PT$ $PT$\nl)

%RCOLSIN=(C!sep)

%RCOLSOUT=(C)

%RCOLSIN=(O!P)

%RCOLSOUT=(O:%V: )

%RCOLSIN=(p!P)

%RCOLSOUT=(p!P)

%RCOLSIN=(b!team!tot!home!away)

%RCOLSOUT=(b!team!tot)

%RCOLSIN=(g!MATCHID!MDATE:%s:r,-,:!ROUND)

%RCOLSOUT=(g:%V:Kolejka $ROUND$\nl)

%RCOLSIN=(h!H)

%RCOLSOUT=(h:%V:\nl)

%RCOLSIN=(z!Z)

%RCOLSIN=(t!text)

%RCOLSOUT=(t!text)

%RCOLSIN=(y!ytext)

%RCOLSOUT=(y:%V:$ytext$\nl)

%ROWDATA

%EOT