diff --git a/src/main/java/com/marsspiders/ukwa/controllers/CategoryController.java b/src/main/java/com/marsspiders/ukwa/controllers/CategoryController.java index b4b59af..8632199 100644 --- a/src/main/java/com/marsspiders/ukwa/controllers/CategoryController.java +++ b/src/main/java/com/marsspiders/ukwa/controllers/CategoryController.java @@ -77,6 +77,8 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { } mapCollectionDTO = new HashMap<>(); + Random random = new Random(); + //all collections for (Map.Entry> pivotEntry : pivotEntryList) { Iterator iterator; //Iterator @@ -84,7 +86,7 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { for (int y=0; y < pivotEntry.getValue().size();y++) { if (pivotEntry.getValue().get(y).getPivot() != null) { - log.info("List [" + y + "] Pivot size = " + pivotEntry.getValue().get(y).getPivot().size()); + log.debug("List [" + y + "] Pivot size = " + pivotEntry.getValue().get(y).getPivot().size()); indx_deep = 0; charSet = new HashSet<>(); @@ -112,10 +114,10 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { // log.info("matcher : index = " + k++ +", group = " + m.group(2)); // log.info("matcher : index = " + k++ +", group = " + m.group(3)); - mapCollectionDTO.put( //add only collectionArea ID, title cannot be extracted from SOLR query - pivotEntry.getValue().get(y).getPivot().get(indx_deep).getValue().toString(), + //13+Id: all collection list must contain unique collections, so starting part remains the same i.e. 13 + 13 + pivotEntry.getValue().get(y).getPivot().get(indx_deep).getValue().toString(), new CollectionDTO( pivotEntry.getValue().get(y).getPivot().get(indx_deep).getValue().toString(), @@ -131,7 +133,6 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { indx_deep++; } else iterator.next(); - log.info("mapCollectionDTO size = "+mapCollectionDTO.size()); } //add all collections that belong to category // && TODO: sub-collections? - Need to concentrate on lists from ACT in JSON @@ -139,9 +140,7 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { } //List>> - //Final add map of - } map3 = new HashMap<>(); @@ -152,7 +151,6 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { Map.Entry::getKey, Map.Entry::getValue, (a, b) -> a, LinkedHashMap::new))); listOfMapsOfItemsOfCategories3.add(map3); - //collection areas for (Map.Entry> pivotEntry : pivotEntryList) { @@ -192,7 +190,8 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { mapCollectionDTO.put( //add only collectionArea ID, title cannot be extracted from SOLR query - pivotEntry.getValue().get(y).getPivot().get(indx_deep).getValue().toString(), + //random + Id: collection list must contai unique collections, so starting part remains unique i.e. random + (random.nextInt(90)+10) + pivotEntry.getValue().get(y).getPivot().get(indx_deep).getValue().toString(), new CollectionDTO( pivotEntry.getValue().get(y).getPivot().get(indx_deep).getValue().toString(), @@ -224,8 +223,6 @@ public ModelAndView rootCategoriesPagev2(HttpServletRequest request) { .sorted(Comparator.comparing(collDTO -> collDTO.getValue().getName())) .collect(Collectors.toMap( Map.Entry::getKey, Map.Entry::getValue, (a, b) -> a, LinkedHashMap::new))); - - log.info("count [" + pivotEntry.getValue().get(y).getValue().toString() + "]" + mapCollectionDTO.entrySet().stream().count()); //Final add map of listOfMapsOfItemsOfCategories3.add(map3); listOfAlphabetical.add(charSet); diff --git a/src/main/webapp/WEB-INF/jsp/speccoll.jsp b/src/main/webapp/WEB-INF/jsp/speccoll.jsp index ec48256..310aaca 100644 --- a/src/main/webapp/WEB-INF/jsp/speccoll.jsp +++ b/src/main/webapp/WEB-INF/jsp/speccoll.jsp @@ -119,21 +119,21 @@