if (sortBy <= 0 && browseIndex.isMetadataIndex()) { String dataType = browseIndex.getDataType(); String type = ("date".equals(dataType) ? "date" : "text"); sortOption = new SortOption(0, browseIndex.getName(), browseIndex.getMetadata(0), type); } else { sortOption = browseIndex.getSortOption();
@Override public void setTable(String table) { if (table.equals(BrowseIndex.getWithdrawnBrowseIndex().getTableName())) { itemsWithdrawn = true; } else if (table.equals(BrowseIndex.getPrivateBrowseIndex().getTableName())) { itemsDiscoverable = false; } facetField = table; }
/** * Is this a browse on a list of items, or unique metadata values? * * @param info * @return */ private boolean isItemBrowse(BrowseInfo info) { return info.getBrowseIndex().isItemIndex() || info.isSecondLevel(); }
/** * @return array of tables * @throws BrowseException if browse error * @deprecated */ public static String[] tables() throws BrowseException { BrowseIndex[] bis = getBrowseIndices(); String[] returnTables = new String[bis.length]; for (int i = 0; i < bis.length; i++) { returnTables[i] = bis[i].getTableName(); } return returnTables; }
/** * 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; }
/** * 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); } }
if (type != null && !"".equals(type)) bi = BrowseIndex.getBrowseIndex(type); bi = BrowseIndex.getBrowseIndex(SortOption.getSortOption(sortBy)); bi = BrowseIndex.getBrowseIndex(SortOption.getDefaultSortOption()); SortOption so = bi.getSortOption(); if (so != null) else if (bi != null && bi.isItemIndex() && !bi.isInternalIndex()) SortOption bso = bi.getSortOption(); SortOption so = SortOption.getSortOption(sortBy); if ( bso != null && bso.equals(so)) BrowseIndex newBi = BrowseIndex.getBrowseIndex(so); if (newBi != null) type = bi.getName(); order = bi.getDefaultOrder(); if (bi != null && bi.isMetadataIndex() && scope.isSecondLevel() && scope.getSortBy() <= 0)
browseListLine = ConfigurationManager.getProperty("webui.itemlist.browse." + bix.getName() + ".sort." + so.getName() + ".columns"); browseWidthLine = ConfigurationManager.getProperty("webui.itemlist.browse." + bix.getName() + ".sort." + so.getName() + ".widths"); so = bix.getSortOption(); browseListLine = ConfigurationManager.getProperty("webui.itemlist.browse." + bix.getName() + ".columns"); browseWidthLine = ConfigurationManager.getProperty("webui.itemlist.browse." + bix.getName() + ".widths"); browseListLine = ConfigurationManager.getProperty("webui.itemlist." + bix.getName() + ".columns"); browseWidthLine = ConfigurationManager.getProperty("webui.itemlist." + bix.getName() + ".widths"); viewFull[colIdx] = BrowseIndex.getBrowseIndex(browseType[colIdx]).isItemIndex();
bis = BrowseIndex.getBrowseIndices(); } catch (BrowseException e) { log.error(e.getMessage(), e); + bi.getTableName()); if (bi.isMetadataIndex()) { bi.generateMdBits(); for (int mdIdx = 0; mdIdx < bi.getMetadataCount(); mdIdx++) { String[] md = bi.getMdBits(mdIdx); List<MetadataValue> values = itemService.getMetadata(item, md[0], md[1], md[2], Item.ANY); .getInstance() .getConfigurationService() .getPropertyAsType("discovery.browse.authority.ignore." + bi.getName(), DSpaceServicesFactory.getInstance() .getConfigurationService() ); } else { if (bi.isAuthorityIndex() && (values.get(x).getAuthority() == null || values.get(x) .getConfidence() < if ((ignoreAuthority && !bi.isAuthorityIndex()) || (values.get(x).getAuthority() != null && values.get(x)
if (bix.isMetadataIndex()) trailMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.trail.metadata." + bix.getName()) .parameterize(scopeName); trailMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.trail.item." + bix.getSortOption().getName()) .parameterize(scopeName);
sb.append("in index: " + browseIndex.getName() + " (data type: " + browseIndex.getDataType() + ", display type: " + browseIndex.getDisplayType() + ") "); if (browseIndex.isItemIndex()) { sb.append("Listing over " + Integer.toString(config.numCols()) + " columns: "); for (int k = 1; k <= config.numCols(); k++) { sb.append(" sort column focus: ").append(focus); } else if (browseIndex.isMetadataIndex()) { sb.append("Listing single column: ").append(browseIndex.getMetadata()); if (isStartsWith()) { sb.append(" sort column starting with: ").append(focus); if (browseIndex.isMetadataIndex() && !isSecondLevel()) { sb.append(valueListingString()); } else if (browseIndex.isItemIndex() || isSecondLevel()) { sb.append(fullListingString(config));
if (info.hasValue()) if (bix.isAuthorityIndex()) String fk = cm.makeFieldKey(bix.getMetadata(0)); value = "\""+cm.getLabel(fk, info.getValue(), null)+"\""; if (bix.isMetadataIndex()) titleMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata." + bix.getName()) .parameterize(scopeName, value); titleMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.title.item." + bix.getSortOption().getName()) .parameterize(scopeName, value);
/** * Get the browse index from configuration with the specified name. * The name is the first part of the browse configuration * * @param name the name to retrieve * @return the specified browse index * @throws BrowseException if browse error */ public static BrowseIndex getBrowseIndex(String name) throws BrowseException { for (BrowseIndex bix : BrowseIndex.getBrowseIndices()) { if (bix.getName().equals(name)) { return bix; } } return null; }
displayType = matcher.group(2); if (isMetadataIndex()) { metadataAll = matcher.group(3); datatype = matcher.group(4); tableBaseName = getItemBrowseIndex().tableBaseName; } else if (isItemIndex()) { String sortName = matcher.group(3); tableBaseName = getItemBrowseIndex().tableBaseName; } else { valid = false;
String tableName = BrowseIndex.getTableName(i, false, false, false, false); String distinctTableName = BrowseIndex.getTableName(i, false, false, true, false); String distinctMapName = BrowseIndex.getTableName(i, false, false, false, true); String sequence = BrowseIndex.getSequenceName(i, false, false); String mapSequence = BrowseIndex.getSequenceName(i, false, true); String distinctSequence = BrowseIndex.getSequenceName(i, true, false); String colViewName = BrowseIndex.getTableName(i, false, true, false, false); String comViewName = BrowseIndex.getTableName(i, true, false, false, false); String distinctColViewName = BrowseIndex.getTableName(i, false, true, false, true); String distinctComViewName = BrowseIndex.getTableName(i, true, false, false, true); dropItemTables(connection, BrowseIndex.getItemBrowseIndex()); dropItemTables(connection, BrowseIndex.getWithdrawnBrowseIndex()); dropItemTables(connection, BrowseIndex.getPrivateBrowseIndex());
/** * @param idx index * @return Returns the mdBits. */ public String[] getMdBits(int idx) { if (isMetadataIndex()) { return mdBits[idx]; } return null; }
BrowseIndex bix = BrowseIndex.getItemBrowseIndex(); if (bix == null)
if (scope.getBrowseIndex() == null || scope.getBrowseIndex().isItemIndex()) scope.setBrowseIndex(BrowseIndex.getWithdrawnBrowseIndex());
BrowseIndex bi = BrowseIndex.getWithdrawnBrowseIndex(); SortOption so = bi.getSortOption(); if (so != null)
Map<String, String> getCommonParameters() throws UIException { Map<String, String> paramMap = new HashMap<String, String>(); paramMap.put(BrowseParams.TYPE, scope.getBrowseIndex().getName()); if (scope.getFilterValue() != null) { paramMap.put(scope.getAuthorityValue() != null? BrowseParams.FILTER_VALUE[1]:BrowseParams.FILTER_VALUE[0], scope.getFilterValue()); } if (scope.getFilterValueLang() != null) { paramMap.put(BrowseParams.FILTER_VALUE_LANG, scope.getFilterValueLang()); } return paramMap; }