src/ca/rmen/pdm/xls2html/main/Xls2Html.java
/**
     * Read the "page" sheet in the Excel file which contains the data about each page (excluding the poem content).
     */
Read the "page" sheet in the Excel file which contains the data about each page (excluding the poem content).
Read the " page " sheet in the Excel file which contains the data about each page ( excluding the poem content ) .
private static Map<String, Webpage> readPageMeta(Workbook wb) {
        Map<String, Webpage> result = new HashMap<String, Webpage>();
        Sheet pageSheet = wb.getSheet("page");
        if(pageSheet == null)
            return result;
        List<String> columnNames = readColumnNames(pageSheet);
        int rowCount = pageSheet.getRows();
        for (int r = 1; r < rowCount; r++) {
            Map<String, String> values = readRow(pageSheet, r, columnNames);
            String pageNumber = values.get(Webpage.Column.PAGE_NUMBER.name());
            Webpage webpage = new Webpage(pageNumber);
            String date = values.get(Webpage.Column.DATE.name());
            String paintingCaption = values.get(Webpage.Column.PAINTING_CAPTION.name());
            String songTitle = values.get(Webpage.Column.SONG_TITLE.name());
            String songLink = values.get(Webpage.Column.SONG_LINK.name());
            String prevPageNumber = values.get(Webpage.Column.PREV_PAGE_NUMBER.name());
            String nextPageNumber = values.get(Webpage.Column.NEXT_PAGE_NUMBER.name());
            webpage.setDate(date);
            webpage.setPaintingCaption(paintingCaption);
            webpage.setSongTitle(songTitle);
            webpage.setSongLink(songLink);
            webpage.setPrevPageNumber(prevPageNumber);
            webpage.setNextPageNumber(nextPageNumber);
            result.put(pageNumber, webpage);
        }
        return result;
    }
private static Map < String , Webpage > readPageMeta ( Workbook wb ) { Map < String , Webpage > result = new HashMap < String , Webpage > ( ) ; Sheet pageSheet = wb . getSheet ( "page" ) ; if ( pageSheet == null ) return result ; List < String > columnNames = readColumnNames ( pageSheet ) ; int rowCount = pageSheet . getRows ( ) ; for ( int r = 1 ; r < rowCount ; r ++ ) { Map < String , String > values = readRow ( pageSheet , r , columnNames ) ; String pageNumber = values . get ( Webpage . Column . PAGE_NUMBER . name ( ) ) ; Webpage webpage = new Webpage ( pageNumber ) ; String date = values . get ( Webpage . Column . DATE . name ( ) ) ; String paintingCaption = values . get ( Webpage . Column . PAINTING_CAPTION . name ( ) ) ; String songTitle = values . get ( Webpage . Column . SONG_TITLE . name ( ) ) ; String songLink = values . get ( Webpage . Column . SONG_LINK . name ( ) ) ; String prevPageNumber = values . get ( Webpage . Column . PREV_PAGE_NUMBER . name ( ) ) ; String nextPageNumber = values . get ( Webpage . Column . NEXT_PAGE_NUMBER . name ( ) ) ; webpage . setDate ( date ) ; webpage . setPaintingCaption ( paintingCaption ) ; webpage . setSongTitle ( songTitle ) ; webpage . setSongLink ( songLink ) ; webpage . setPrevPageNumber ( prevPageNumber ) ; webpage . setNextPageNumber ( nextPageNumber ) ; result . put ( pageNumber , webpage ) ; } return result ; }
Read the "page" sheet in the Excel file which contains the data about each page (excluding the poem content).
Read the " page " sheet in the Excel file which contains the data about each page ( excluding the poem content ) .