Difference between revisions of "Creating group web pages"

From PC2wiki
Jump to: navigation, search
(initial article)
(No difference)

Revision as of 10:01, 27 January 2013

Group web pages are standings pages that are generated per group/region. These are automatically updated when any Scoreboard HTML is generated (See When HTML pages are created).

This documentation does not contain the steps to create a region/group web pages - send e-mail to the PC² Team pc2@ecs.csus.edu.



  1. Create group#.xml file (samples are under samps\web\xsl in the distribution)
  2. For Region 3, copy group3.xml file to the data/xsl directory on scoreboard machine.
  3. Update the group xsl file (see section below)

Once groups have been assigned to teams, a group XSL file will need to be created on the computer where the scoreboard is run.

Once the group XSL files are in place, the group#.html files will automatically be created as the other Scoreboard HTML files are generated, see When HTML pages are created.

Update group xsl file

To create the web page for each group a groupN.xml file needs to be created for each group web page.

For the example below, for site 4, the 1 on the following line

<xsl:variable name="group" select="'1'" />

needs to change to 4, like this

<xsl:variable name="group" select="'4'" />

<!-- $Id: group1.xsl 1964 2009-11-25 03:58:14Z boudreat $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:decimal-format decimal-separator="." grouping-separator="," />
<!-- change group to match the group id -->
<xsl:variable name="group" select="'1'" />
   Below here does not need to change.
<xsl:template match="contestStandings">
	<xsl:for-each select="standingsHeader/groupList/group[@id = $group]">
<xsl:value-of select="@title"/> Full Info - <xsl:value-of select="/contestStandings/standingsHeader/@title"/>
<link rel="stylesheet" type="text/css" href="standings.css"/>
	    <font face="verdana, arial, helvetica" align="right">
		<IMG SRC="acm-icpc.gif" align="left" width="130" height="120"/><IMG SRC="acm.gif" align="right" width="100" height="100"/>
		    <h2><xsl:value-of select="/contestStandings/standingsHeader/@title"/></h2>
		    <h3><xsl:value-of select="/contestStandings/standingsHeader/groupList/group[@id = $group]/@title"/> per Site Standings</h3>
		    <!-- XXX probably can remove these with the full title -->
		    <!-- hmm, these comment add the ^M to the output -->
		    Standings as of 1 hour to go.  Scoreboard is now frozen.<br/>
        <a href="index.html">Overall Standings</a><br/><br/>
            <TABLE cellspacing='0'>
                <tr><th><strong><u>Group Rank</u></strong></th><th><strong><u>Name</u></strong></th><th><strong><u>Solved</u></strong></th><th><strong><u>Time</u></strong></th></tr>
                <xsl:call-template name="teamStanding"/>
<div class="tail">

<span class="right">
       <A HREF="http://www.ecs.csus.edu/pc2/">PC^2 Homepage</A><br/>
       CSS by Tomas Cerny and Ray Holder
Created by <A HREF="http://www.ecs.csus.edu/pc2">CSUS PC^2</A> version <xsl:value-of select="/contestStandings/standingsHeader/@systemVersion"/>
Last updated
<xsl:value-of select="/contestStandings/standingsHeader/@currentDate"/>

        <xsl:template name="teamStanding">
            <xsl:for-each select="teamStanding[@teamGroupId = $group]">
<td><xsl:value-of select="@groupRank"/></td>
<td><xsl:value-of select="@teamName"/></td>
<xsl:attribute name="class">center</xsl:attribute>
<xsl:value-of select="@solved"/></td>
<xsl:attribute name="class">right</xsl:attribute>
<xsl:value-of select="@points"/></td>

See Also