/** * @return Returns the number of metadata fields for this index */ public int getMetadataCount() { if (isMetadataIndex()) { return metadata.length; } return 0; }
/** * @param idx index * @return Returns the mdBits. */ public String[] getMdBits(int idx) { if (isMetadataIndex()) { return mdBits[idx]; } return null; }
/** * Populate the internal array containing the bits of metadata, for * ease of use later */ public void generateMdBits() { try { if (isMetadataIndex()) { mdBits = new String[metadata.length][]; for (int i = 0; i < metadata.length; i++) { mdBits[i] = interpretField(metadata[i], null); } } } catch (IOException e) { // it's not obvious what we really ought to do here //log.error("caught exception: ", e); } }
/** * Get the field for sorting associated with this index. * * @param isSecondLevel whether second level browse * @return sort field * @throws BrowseException if browse error */ public String getSortField(boolean isSecondLevel) throws BrowseException { String focusField; if (isMetadataIndex() && !isSecondLevel) { focusField = "sort_value"; } else { if (sortOption != null) { focusField = "sort_" + sortOption.getNumber(); } else { focusField = "sort_1"; // Use the first sort column } } return focusField; }
/** * 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 getOffsetForDistinctValue(String value) throws BrowseException { if (!browseIndex.isMetadataIndex()) { throw new IllegalArgumentException("getOffsetForDistinctValue called when not a metadata index"); } // 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.doDistinctOffsetQuery("sort_value", value, scope.isAscending()); }
displayType = matcher.group(2); if (isMetadataIndex()) { metadataAll = matcher.group(3); datatype = matcher.group(4);
sb.append(" sort column focus: ").append(focus); } else if (browseIndex.isMetadataIndex()) { sb.append("Listing single column: ").append(browseIndex.getMetadata()); if (isStartsWith()) { if (browseIndex.isMetadataIndex() && !isSecondLevel()) { sb.append(valueListingString()); } else if (browseIndex.isItemIndex() || isSecondLevel()) {
/** * Perform a standard browse, which will return a BrowseInfo * object that represents the results for the current page, the * total number of results, the range, and information to construct * previous and next links on any web page * * @param bs the scope of the browse * @return the results of the browse * @throws BrowseException if browse error */ public BrowseInfo browse(BrowserScope bs) throws BrowseException { log.debug(LogManager.getHeader(context, "browse", "")); // first, load the browse scope into the object this.scope = bs; // since we use it so much, get the browse index out of the // scope and store as a member browseIndex = scope.getBrowseIndex(); // now make the decision as to how to browse if (browseIndex.isMetadataIndex() && !scope.isSecondLevel()) { // this is a single value browse type that has not gone to // the second level (i.e. authors, not items by a given author) return browseByValue(scope); } else { // this is the full browse type or a browse that has gone to // the second level return browseByItem(scope); } }
if (bi.isMetadataIndex() && !scope.isSecondLevel())
if (bi.isMetadataIndex()) {
if (bi != null && bi.isMetadataIndex() && scope.isSecondLevel() && scope.getSortBy() <= 0)
if (sortBy <= 0 && browseIndex.isMetadataIndex()) {