Package edu.wisc.game.rest

## Class BoardDisplayService

- java.lang.Object
- - edu.wisc.game.rest.BoardDisplayService

-     @Path("/BoardDisplayService")
      public class BoardDisplayService
      extends Object

  HTML display for user-upload boards (in JSON format), for use by the ML team (Shubham)

  The file upload technique is as per https://www.lkit.dev/jax-rs-single-file-upload-example/ , using the library jersey-media-multipart-2.34.jar from https://mvnrepository.com/artifact/org.glassfish.jersey.media/jersey-media-multipart/ Make sure not use version 3.*, because they jave switched from "json" naming to "jakarta" naming.

  See also https://stackoverflow.com/questions/56454397/jersey-formdataparam-to-read-multiple-inputstream-files for uploading multiple files

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `BoardDisplayService.BoardList` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BoardDisplayService()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `displayBoard​(String boardJsonText, int cellWidth)` |
    `String` | `displayBoardFile​(org.glassfish.jersey.media.multipart.FormDataBodyPart parts, int cellWidth)` |
    `String` | `displayBoardList​(String boardListJsonText, int cellWidth, int ncol)` |
    `String` | `displayBoardListFile​(InputStream file, org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDisposition, int cellWidth, int ncol)` |
    `static String` | `doBoard​(Board board, int cellWidth)` | Given a Board object, creates an HTML snippet containing a visual display of the board.
    `static String` | `doBoardAscii​(Board board)` | The ASCII-art alternative

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BoardDisplayService

          public BoardDisplayService()

  - ### Method Detail

    - #### displayBoard

          @POST
          @Path("/displayBoard")
          @Consumes("application/x-www-form-urlencoded")
          @Produces("text/html")
          public String displayBoard​(@FormParam("boardJson")
                                     String boardJsonText,
                                     @DefaultValue("80") @FormParam("cellWidth")
                                     int cellWidth)

    - #### doBoard

          public static String doBoard​(Board board,
                                       int cellWidth)

      Given a Board object, creates an HTML snippet containing a visual display of the board.

    - #### doBoardAscii

          public static String doBoardAscii​(Board board)

      The ASCII-art alternative

    - #### displayBoardFile

          @Path("/displayBoardFile")
          @POST
          @Consumes("multipart/form-data")
          @Produces("text/html")
          public String displayBoardFile​(org.glassfish.jersey.media.multipart.FormDataBodyPart parts,
                                         @DefaultValue("80")
                                         int cellWidth)

    - #### displayBoardList

          @POST
          @Path("/displayBoardList")
          @Consumes("application/x-www-form-urlencoded")
          @Produces("text/html")
          public String displayBoardList​(@FormParam("boardListJson")
                                         String boardListJsonText,
                                         @DefaultValue("40") @FormParam("cellWidth")
                                         int cellWidth,
                                         @DefaultValue("3") @FormParam("ncol")
                                         int ncol)

    - #### displayBoardListFile

          @Path("/displayBoardListFile")
          @POST
          @Consumes("multipart/form-data")
          @Produces("text/html")
          public String displayBoardListFile​(InputStream file,
                                             org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDisposition,
                                             @DefaultValue("40")
                                             int cellWidth,
                                             @DefaultValue("3")
                                             int ncol)