Skip to content

I1252 XSL file selection for HTML scoreboard generation - #1298

Open
johnbrvc wants to merge 4 commits into
pc2ccs:Regional2026-RC1from
johnbrvc:i1252_xsl_selection
Open

johnbrvc wants to merge 4 commits into
pc2ccs:Regional2026-RC1from
johnbrvc:i1252_xsl_selection

Conversation

@johnbrvc

Copy link
Copy Markdown
Collaborator

Description of what the PR does

Allows configuration of which XSL files to use for scoreboard webpage generation. This can be done from the configuration files (system.pc2.yaml) as well as the GUI via a new tab (Scoreboard XSL) on the administrator's "Configure Contest" tab.

In addition, this PR allows a descriptive comment to be placed in a XSL file so it will appear next to the XSL file name on the new Scoreboard XSL tab. The comment must appear within the first 5 lines of the XSL file (that number of lines is a build-time constant). In order to be recognized as a description, the comment must match the following regular expression:

^<!--.+(?i:Description):\s+(.+)\s+-->$

For example:

<!-- DeScriPTION:   This would be the description text! -->

The capture group in the RE would be: This would be the description text!

The new tab looks like this:

image

Issue which the PR addresses

Fixes #1252

Environment in which the PR was developed (OS,IDE, Java version, etc.)

java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)

Test suite 1 - GUI:

  1. Load a clean copy of the clics_sumithello contest.
  2. Start an administrator1 client
  3. Notice the new Scoreboard XSL tab on the Configure Contest tab.
  4. Click on the new Scoreboard XSL tab. Note that all the XSL files in the normal data/xsl folder are checked and they all say "No description" in the Description column.
  5. Observe which buttons are greyed out: Apply, Revert, Select All. This means those buttons are not applicable at the current time.
  6. Make a copy of the pc2v9/data/xsl folder since you'll be extracting some test files over this folder.
  7. Extract test-xslfiles.zip in the pc2v9/data/xsl folder. This will replace 4 xsl files: full.xsl, fullps.xml, index.xsl, index_mobile.xsl with versions that have the new Description comment in them as described above in the PR description.
  8. Click the Refresh button on the Scoreboard XSL tab. Notice that the Description column populates for those 4 xsl files:
image
  1. Press the Deselect All button, then select index.xsl and full.xsl. Watch which buttons become enabled/disabled while doing this.
  2. Press the Revert button to restore the selection to the originals.
  3. Press the Deselect All button again, and select index.xsl and full.xsl again.
  4. Press the Apply button to save the settings to the contest model. Note that the Apply and Revert buttons are now grayed out.
  5. Start a the board1 scoreboard client. Wait for it to load.
  6. Now check the pc2v9/public_html folder. Note that onlyindex.htmland full.html were generated.
  7. You can try other tests if you want. For example, Deselect All, then Apply, then Refresh the scoreboard board1 client. Note that no files are updated in the public_html folder (check the dates on the files).

Test suite 2 - Loading from `system.pc2.yaml`:

  1. Clean the contest (we want to start from scratch).
  2. Edit the system.pc2.yaml file in the sample clics_sumithello/config folder. Add the line scoreboard-xsl-files: index.xsl,full.xsl,summary.xsl to the file (you can put it at the beginning of the file if you like, or the end)
  3. Load the contest.
  4. Start the administrator1 client.
  5. Go to the Scoreboard XSL tab and notice that the 3 files you specified in the system.pc2.yaml file are selected.
  6. Start the board1 scoreboard client.
  7. Note that the three web pages index.html, full.html and summary.html are generated.
image
  1. You can now perform other GUI based tests if you like.

Be sure to restore the original data/xsl files that were overwritten when you extract the ZIP file.
Be sure to restore the state of system.pc2.yaml in the sample contest to its original content. (Delete the line you added).

Add ability to configure which XSL files are used for scoreboard HTML generation in the system.pc2.yaml at contest configuration.
Add ability to configure which XSL files is used for the Standings HTML pane on the Administrator view in the system.pc2.yaml at contest configuration.
If neither are specified, the legacy defaults are used.
Add pane to allow editing of which XSL files are used to generate scoreboards.
There are still a couple of TODO's in here.
Add method to StringUtilities to company 2 string arrays to see if they have the same strings (in no particular order).
Add button enabling code based on selections.
@johnbrvc johnbrvc added this to the 9.11.0 milestone Sep 16, 2026
@johnbrvc johnbrvc self-assigned this Sep 16, 2026
Use ADD_SETTING permission to control whether an account can modify the xsl file list for scoreboard generation.
Add AccountListener to ScoreboardXSLPane to update permissions if they change.
Add ScoreboardXSLPaneto PluginLoadPane.
Add ScoreboardXSLPaneto scoreboard client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant