Package org.dspace.browse
Class BrowseIndex
java.lang.Object
org.dspace.browse.BrowseIndex
- Direct Known Subclasses:
DSpaceControlledVocabularyIndex
This class holds all the information about a specifically configured
BrowseIndex. It is responsible for parsing the configuration, understanding
about what sort options are available, and what the names of the database
tables that hold all the information are actually called. Hierarchical browse
indexes also contain information about the vocabulary they're using, see:
DSpaceControlledVocabularyIndex- Author:
- Richard Jones
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBrowseIndex(String baseName) Constructor for creating generic / internal index objects -
Method Summary
Modifier and TypeMethodDescriptionvoidPopulate the internal array containing the bits of metadata, for ease of use laterstatic BrowseIndexgetBrowseIndex(String name) Get the browse index from configuration with the specified name.static BrowseIndexGet the configured browse index that is defined to use this sort option.static BrowseIndex[]Get an array of all the browse indices for the current configurationGet the default name of the distinct table.Get the name of the primary key index columnstatic BrowseIndexGet the internally defined browse index for archived items.Get the default name of the distinct map table.String[]getMdBits(int idx) getMetadata(int idx) intgetName()static BrowseIndexgetSequenceName(boolean isDistinct, boolean isMap) Get the name of the sequence that will be used in the given circumstancesstatic StringgetSequenceName(int number, boolean isDistinct, boolean isMap) Get the name of the sequence that will be used in the given circumstancesgetSortField(boolean isSecondLevel) Get the field for sorting associated with this index.Get the SortOption associated with this index.Get the default index table name.getTableName(boolean isCommunity, boolean isCollection) Deprecated.1.5getTableName(boolean isDistinct, boolean isCommunity, boolean isCollection) Deprecated.1.5getTableName(boolean isCommunity, boolean isCollection, boolean isDistinct, boolean isMap) Deprecated.1.5static StringgetTableName(int number, boolean isCommunity, boolean isCollection, boolean isDistinct, boolean isMap) Deprecated.1.5static BrowseIndexGet the internally defined browse index for withdrawn items.String[]interpretField(String mfield, String init) Take a string representation of a metadata field, and return it as an array.booleanIs the browse index authority value?booleanbooleanDoes this browse index represent one of the internal item indexes?booleanIs the browse index of display type full?booleanIs the browse index of display type single?booleanIs tag cloud enabledstatic String[]tables()Deprecated.
-
Constructor Details
-
BrowseIndex
Constructor for creating generic / internal index objects- Parameters:
baseName- The base of the table name
-
-
Method Details
-
getDefaultOrder
- Returns:
- Default order for this index, null if not specified
-
getDataType
- Returns:
- Returns the datatype.
-
getDisplayType
- Returns:
- Returns the displayType.
-
getMetadataCount
public int getMetadataCount()- Returns:
- Returns the number of metadata fields for this index
-
getMdBits
- Parameters:
idx- index- Returns:
- Returns the mdBits.
-
getMetadata
- Returns:
- Returns the metadata.
-
getMetadata
- Parameters:
idx- index- Returns:
- metadata
-
getName
- Returns:
- Returns the name.
-
getSortOption
Get the SortOption associated with this index.- Returns:
- SortOption
-
isDisplayFrequencies
public boolean isDisplayFrequencies()- Returns:
- true or false
-
generateMdBits
public void generateMdBits()Populate the internal array containing the bits of metadata, for ease of use later -
getSequenceName
Get the name of the sequence that will be used in the given circumstances- Parameters:
isDistinct- is a distinct tableisMap- is a map table- Returns:
- the name of the sequence
-
getSequenceName
Get the name of the sequence that will be used in the given circumstances- Parameters:
number- the index configuration numberisDistinct- is a distinct tableisMap- is a map table- Returns:
- the name of the sequence
-
getTableName
@Deprecated public static String getTableName(int number, boolean isCommunity, boolean isCollection, boolean isDistinct, boolean isMap) Deprecated.1.5Get the name of the table for the given set of circumstances This is provided solely for cleaning the database, where you are trying to create table names that may not be reflected in the current index- Parameters:
number- the index configuration numberisCommunity- whether this is a community constrained index (view)isCollection- whether this is a collection constrained index (view)isDistinct- whether this is a distinct tableisMap- whether this is a distinct map table- Returns:
- the name of the table
-
getTableName
@Deprecated public String getTableName(boolean isCommunity, boolean isCollection, boolean isDistinct, boolean isMap) Deprecated.1.5Get the name of the table in the given circumstances- Parameters:
isCommunity- whether this is a community constrained index (view)isCollection- whether this is a collection constrained index (view)isDistinct- whether this is a distinct tableisMap- whether this is a distinct map table- Returns:
- the name of the table
-
getTableName
Deprecated.1.5Get the name of the table in the given circumstances. This is the same as callinggetTableName(isCommunity, isCollection, false, false);- Parameters:
isCommunity- whether this is a community constrained index (view)isCollection- whether this is a collection constrained index (view)- Returns:
- the name of the table
-
getTableName
Get the default index table name. This is the same as callinggetTableName(false, false, false, false);- Returns:
- table name
-
getTableName
@Deprecated public String getTableName(boolean isDistinct, boolean isCommunity, boolean isCollection) Deprecated.1.5Get the table name for the given set of circumstances. This is the same as calling:getTableName(isCommunity, isCollection, isDistinct, false);- Parameters:
isCommunity- whether this is a community constrained index (view)isCollection- whether this is a collection constrained index (view)isDistinct- whether this is a distinct table- Returns:
- table name
-
getMapTableName
Get the default name of the distinct map table. This is the same as callinggetTableName(false, false, false, true);- Returns:
- table name
-
getDistinctTableName
Get the default name of the distinct table. This is the same as callinggetTableName(false, false, true, false);- Returns:
- table name
-
getIndexColumn
Get the name of the primary key index column- Returns:
- the name of the primary key index column
-
isMetadataIndex
public boolean isMetadataIndex()Is the browse index of display type single?- Returns:
- true if single, false if not
-
isAuthorityIndex
public boolean isAuthorityIndex()Is the browse index authority value?- Returns:
- true if authority, false if not
-
isItemIndex
public boolean isItemIndex()Is the browse index of display type full?- Returns:
- true if full, false if not
-
getSortField
Get the field for sorting associated with this index.- Parameters:
isSecondLevel- whether second level browse- Returns:
- sort field
- Throws:
BrowseException- if browse error
-
tables
Deprecated.- Returns:
- array of tables
- Throws:
BrowseException- if browse error
-
getBrowseIndices
Get an array of all the browse indices for the current configuration- Returns:
- an array of all the current browse indices
- Throws:
BrowseException- if browse error
-
getBrowseIndex
Get the browse index from configuration with the specified name. The name is the first part of the browse configuration- Parameters:
name- the name to retrieve- Returns:
- the specified browse index
- Throws:
BrowseException- if browse error
-
getBrowseIndex
Get the configured browse index that is defined to use this sort option.- Parameters:
so- sort option- Returns:
- browse index
- Throws:
BrowseException- if browse error
-
getItemBrowseIndex
Get the internally defined browse index for archived items.- Returns:
- browse index
-
getWithdrawnBrowseIndex
Get the internally defined browse index for withdrawn items.- Returns:
- browse index
-
getPrivateBrowseIndex
- Returns:
- browse index
-
interpretField
Take a string representation of a metadata field, and return it as an array. This is just a convenient utility method to basically break the metadata representation up by its delimiter (.), and stick it in an array, inserting the value of the init parameter when there is no metadata field part.- Parameters:
mfield- the string representation of the metadatainit- the default value of the array elements- Returns:
- a three element array with schema, element and qualifier respectively
- Throws:
IOException- if IO error
-
isInternalIndex
public boolean isInternalIndex()Does this browse index represent one of the internal item indexes?- Returns:
- true or false
-
isTagCloudEnabled
public boolean isTagCloudEnabled()Is tag cloud enabled- Returns:
- true or false
-