/** * Get the configured browse index that is defined to use this sort option. * * @param so sort option * @return browse index * @throws BrowseException if browse error */ public static BrowseIndex getBrowseIndex(SortOption so) throws BrowseException { for (BrowseIndex bix : BrowseIndex.getBrowseIndices()) { if (bix.getSortOption() == so) { return bix; } } return null; }
/** * Convert the value into an offset into the table for this browse * * @param value value * @return the focus value to use * @throws BrowseException if browse error */ private int getOffsetForValue(String value) throws BrowseException { // we need to make sure that we select from the correct column. If the sort option // is the 0th option then we use sort_value, but if it is one of the others we have // to select from that column instead. Otherwise, we end up missing the focus value // to do comparisons in other columns. The use of the focus value needs to be consistent // across the browse SortOption so = scope.getSortOption(); if (so == null || so.getNumber() == 0) { if (browseIndex.getSortOption() != null) { so = browseIndex.getSortOption(); } } String col = "sort_1"; if (so.getNumber() > 0) { col = "sort_" + Integer.toString(so.getNumber()); } // now get the DAO to do the query for us, returning the highest // string value in the given column in the given table for the // item (I think) return dao.doOffsetQuery(col, value, scope.isAscending()); }
if (browseIndex.getSortOption() != null) { so = browseIndex.getSortOption();
so = bix.getSortOption();
SortOption so = bi.getSortOption(); if (so != null) SortOption bso = bi.getSortOption(); SortOption so = SortOption.getSortOption(sortBy); if ( bso != null && bso.equals(so))
sortOption = browseIndex.getSortOption();
SortOption so = bi.getSortOption(); if (so != null)
SortOption so = bi.getSortOption(); if (so != null) SortOption bso = bi.getSortOption(); SortOption so = SortOption.getSortOption(sortBy); if ( bso != null && bso.equals(so))
trailMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.trail.item." + bix.getSortOption().getName()) .parameterize(scopeName);
trailMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.trail.item." + bix.getSortOption().getName()) .parameterize(scopeName);
titleMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.title.item." + bix.getSortOption().getName()) .parameterize(scopeName, value);
titleMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.title.item." + bix.getSortOption().getName()) .parameterize(scopeName, value);