/** * 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(); }
/** * Get the default name of the distinct map table. This is the same as calling * * <code> * getTableName(false, false, false, true); * </code> * * @return table name */ public String getMapTableName() { return getTableName(false, false, false, true); }
/** * @param resultsPerPage The resultsPerPage to set. */ public void setResultsPerPage(int resultsPerPage) { if (resultsPerPage > -1 || (browseIndex != null && browseIndex.isTagCloudEnabled())) { this.resultsPerPage = resultsPerPage; } }
/** * Is this browse sorted by date? * @param info * @return */ private boolean isSortedByDate(BrowseInfo info) { return info.getSortOption().isDate() || (info.getBrowseIndex().isDate() && info.getSortOption().isDefault()); }
/** * @return Returns the order. */ public String getOrder() { if (order != null) { return order; } BrowseIndex bi = getBrowseIndex(); if (bi != null) { return bi.getDefaultOrder(); } return SortOption.ASCENDING; }
/** * @param idx index * @return Returns the mdBits. */ public String[] getMdBits(int idx) { if (isMetadataIndex()) { return mdBits[idx]; } return null; }
/** * @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 name of the sequence that will be used in the given circumstances * * @param number the index configuration number * @param isDistinct is a distinct table * @param isMap is a map table * @return the name of the sequence */ public static String getSequenceName(int number, boolean isDistinct, boolean isMap) { return BrowseIndex.getSequenceName(makeTableBaseName(number), isDistinct, isMap); }
/** * Get the name of the column that is used to store the default value column * * @return the name of the value column */ public String getValueColumn() { if (!isDate()) { return "sort_text_value"; } else { return "text_value"; } }
/** * True if these are the last results from the browse. * * @return True if these are the last results from the browse */ public boolean isLast() { return (overallPosition + getResultCount()) == total; }
/** * @param fileName The fileName to set. */ public void setFileName(String fileName) { this.fileName = fileName; setAppend(false); }
/** * We don't need to use the language parameter, so map this to * the standard sort string filter * * @param str string * @param lang language * @return string */ @Override public String filter(String str, String lang) { return filter(str); }
/** * Get the total number of results for the browse. This is the same as * calling getTotalResults(false) * * @return total * @throws SQLException if database error * @throws BrowseException if browse error */ private int getTotalResults() throws SQLException, BrowseException { return getTotalResults(false); }
/** * Get the name of the sequence that will be used in the given circumstances * * @param isDistinct is a distinct table * @param isMap is a map table * @return the name of the sequence */ public String getSequenceName(boolean isDistinct, boolean isMap) { if (isDistinct || isMap) { return BrowseIndex.getSequenceName(number, isDistinct, isMap); } return BrowseIndex.getSequenceName(tableBaseName, isDistinct, isMap); }
/** * 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(); }
/** * Is this browse sorted by date? * @param info * @return */ private boolean isSortedByDate(BrowseInfo info) { return info.getSortOption().isDate() || (info.getBrowseIndex().isDate() && info.getSortOption().isDefault()); }
/** * @return Returns the number of metadata fields for this index */ public int getMetadataCount() { if (isMetadataIndex()) { return metadata.length; } return 0; }
/** * Get the default index table name. This is the same as calling * * <code> * getTableName(false, false, false, false); * </code> * * @return table name */ public String getTableName() { return getTableName(false, false, false, false); }
/** * Get the default name of the distinct table. This is the same as calling * * <code> * getTableName(false, false, true, false); * </code> * * @return table name */ public String getDistinctTableName() { return getTableName(false, false, true, false); }
/** * Get the name of the table in the given circumstances. This is the same as calling * * <code> * getTableName(isCommunity, isCollection, false, false); * </code> * * @param isCommunity whether this is a community constrained index (view) * @param isCollection whether this is a collection constrained index (view) * @return the name of the table * @deprecated 1.5 */ public String getTableName(boolean isCommunity, boolean isCollection) { return getTableName(isCommunity, isCollection, false, false); }