Difference between revisions of "Creating group web pages"

From PC2wiki
Jump to: navigation, search
m (Update group xsl file: updated steps and description)
m (removed contact pc2 info, now article has step by step directions)
 
Line 2: Line 2:
 
These are automatically updated when any [[Scoreboard HTML]] is generated  
 
These are automatically updated when any [[Scoreboard HTML]] is generated  
 
(See [[Scoreboard_HTML#When_HTML_pages_are_created| When HTML pages are created]]).
 
(See [[Scoreboard_HTML#When_HTML_pages_are_created| 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]] [mailto:pc2@ecs.csus.edu| pc2@ecs.csus.edu].
 
  
 
==Directions==
 
==Directions==

Latest revision as of 16:33, 12 September 2016

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).

Directions

Steps

  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.

Create new group xsl file

To create the web page for each group a group##.xml file needs to be created for each group web page. Where ## is the number of the group found in the Scoreboard XML teamStanding XML element teamGroupId attribute.

From the example below (also in samps/xsl/groupN.xsl ), for site 4 do two steps:

  1. Create a file named group4.xsl
  2. Change the N on the following line to a 4.
<xsl:variable name="group" select="'N'" />

Change N to 4 like this:

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

File: samps/xsl/groupN.xsl


<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 
     copy to new file, ex group2.xsl group3.xsl updating group in each
  -->
<xsl:variable name="group" select="'N'" />
<!--
   Below here does not need to change.
 -->
<xsl:template match="contestStandings">
    <HTML>
        <HEAD>
<TITLE>
	<xsl:for-each select="standingsHeader/groupList/group[@id = $group]">
<xsl:value-of select="@title"/> Full Info - <xsl:value-of select="/contestStandings/standingsHeader/@title"/>
</xsl:for-each>
</TITLE>
<link rel="stylesheet" type="text/css" href="standings.css"/>
  	<META HTTP-EQUIV="REFRESH" CONTENT="60;"/>
<META HTTP-EQUIV="EXPIRES" CONTENT="0"/>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"/>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"/>
        </HEAD>
        <BODY>
	    <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"/>
		<center>
		    <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 -->
		    <br/>
		    <!-- hmm, these comment add the ^M to the output -->
		    <xsl:comment>
		    Standings as of 1 hour to go.  Scoreboard is now frozen.<br/>
		    </xsl:comment>
	    </center>
	</font>
	    <center>
        <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"/>
            </TABLE>
	    </center>
<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
</span>
Created by <A HREF="http://www.ecs.csus.edu/pc2">CSUS PC^2</A> version <xsl:value-of select="/contestStandings/standingsHeader/@systemVersion"/>
<br/>
Last updated
<xsl:value-of select="/contestStandings/standingsHeader/@currentDate"/>
</div>
        </BODY>
    </HTML>
</xsl:template>

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

See Also