public interface BrowseCreateDAO
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
createCollectionView(java.lang.String table,
java.lang.String view,
boolean execute)
Create the View of the full item index as seen from a collection.
|
java.lang.String |
createCommunityView(java.lang.String table,
java.lang.String view,
boolean execute)
Create the View of the full item index as seen from a community
If the boolean execute is true this operation should be carried out, and if it is false
it should not.
|
java.lang.String[] |
createDatabaseIndices(java.lang.String table,
java.util.List<java.lang.Integer> sortCols,
boolean value,
boolean execute)
Create any indices that the implementing DAO sees fit to maximise performance.
|
java.lang.String |
createDistinctMap(java.lang.String table,
java.lang.String map,
boolean execute)
Create a table to hold a mapping between an item and a distinct metadata value that can appear
across multiple items (for example, author names).
|
java.lang.String |
createDistinctTable(java.lang.String table,
boolean execute)
Create the table which will hold the distinct metadata values that appear in multiple
items.
|
java.lang.String[] |
createMapIndices(java.lang.String disTable,
java.lang.String mapTable,
boolean execute)
Create any indices that the implementing DAO sees fit to maximise performance.
|
java.lang.String |
createPrimaryTable(java.lang.String table,
java.util.List<java.lang.Integer> sortCols,
boolean execute)
Create the main index table.
|
java.lang.String |
createSequence(java.lang.String sequence,
boolean execute)
Create the sequence with the given name.
|
void |
deleteByItemID(java.lang.String table,
int itemID)
Delete the record for the given item id from the specified table.
|
void |
deleteCommunityMappings(int itemID) |
java.util.List<java.lang.Integer> |
deleteMappingsByItemID(java.lang.String mapTable,
int itemID) |
java.lang.String |
dropIndexAndRelated(java.lang.String table,
boolean execute)
Drop the given table name, and all other resources that are attached to it.
|
java.lang.String |
dropSequence(java.lang.String sequence,
boolean execute)
Drop the given sequence name.
|
java.lang.String |
dropView(java.lang.String view,
boolean execute)
Drop the given view name.
|
int |
getDistinctID(java.lang.String table,
java.lang.String value,
java.lang.String authority,
java.lang.String sortValue)
Get the browse index's internal id for the location of the given string
and sort value in the given table.
|
int |
insertDistinctRecord(java.lang.String table,
java.lang.String value,
java.lang.String authority,
java.lang.String sortValue)
Insert the given value and sort value into the distinct index table.
|
void |
insertIndex(java.lang.String table,
int itemID,
java.util.Map<java.lang.Integer,java.lang.String> sortCols)
Insert an index record into the given table for the given item id.
|
void |
pruneDistinct(java.lang.String table,
java.lang.String map,
java.util.List<java.lang.Integer> distinctIds)
So that there are no distinct values indexed which are no longer referenced from the
map table, this method checks for values which are not referenced from the map,
and removes them.
|
void |
pruneExcess(java.lang.String table,
boolean withdrawn)
So that any left over indices for items which have been deleted can be assured to have
been removed, this method checks for indices for items which are not in the item table.
|
void |
pruneMapExcess(java.lang.String map,
boolean withdrawn,
java.util.List<java.lang.Integer> distinctIds)
So that any left over indices for items which have been deleted can be assured to have
been removed, this method checks for indices for items which are not in the item table.
|
boolean |
testTableExistence(java.lang.String table)
Find out of a given table exists.
|
void |
updateCommunityMappings(int itemID) |
org.dspace.browse.MappingResults |
updateDistinctMappings(java.lang.String table,
int itemID,
java.util.Set<java.lang.Integer> distinctIDs)
Update a mapping between an item id and a distinct metadata field such as an author,
who can appear in multiple items.
|
boolean |
updateIndex(java.lang.String table,
int itemID,
java.util.Map<java.lang.Integer,java.lang.String> sortCols)
Updates an index record into the given table for the given item id.
|
void deleteByItemID(java.lang.String table,
int itemID)
throws BrowseException
table - the browse table to remove the index fromitemID - the database id of the item to remove the index forBrowseExceptionvoid deleteCommunityMappings(int itemID)
throws BrowseException
BrowseExceptionvoid updateCommunityMappings(int itemID)
throws BrowseException
BrowseExceptionvoid insertIndex(java.lang.String table,
int itemID,
java.util.Map<java.lang.Integer,java.lang.String> sortCols)
throws BrowseException
Map map = new HashMap();
map.put(new Integer(1), "the title");
map.put(new Integer(2), "the subject");
BrowseCreateDAO dao = BrowseDAOFactory.getCreateInstance();
dao.insertIndex("index_1", 21, map);
table - the browse table to insert the index initemID - the database id of the item being indexedsortCols - an Integer-String map of sort column numbers and valuesBrowseExceptionboolean updateIndex(java.lang.String table,
int itemID,
java.util.Map<java.lang.Integer,java.lang.String> sortCols)
throws BrowseException
Map map = new HashMap();
map.put(new Integer(1), "the title");
map.put(new Integer(2), "the subject");
BrowseCreateDAO dao = BrowseDAOFactory.getCreateInstance();
dao.updateIndex("index_1", 21, map);
table - the browse table to insert the index initemID - the database id of the item being indexedsortCols - an Integer-String map of sort column numbers and valuesBrowseExceptionint getDistinctID(java.lang.String table,
java.lang.String value,
java.lang.String authority,
java.lang.String sortValue)
throws BrowseException
BrowseCreateDAO dao = BrowseDAOFactory.getCreateInstance();
dao.createDistinctMapping("index_1_distinct_map", 21,
dao.getDistinctID("index_1_distinct", "Human Readable", "human readable"));
When it creates a distinct record, it would usually do so through insertDistinctRecord
defined below.table - the table in which to look for/create the idvalue - the value on which to searchsortValue - the sort value to use in case of the need to createBrowseExceptionint insertDistinctRecord(java.lang.String table,
java.lang.String value,
java.lang.String authority,
java.lang.String sortValue)
throws BrowseException
BrowseCreateDAO dao = BrowseDAOFactory.getCreateInstance();
dao.createDistinctMapping("index_1_distinct_map", 21,
dao.insertDistinctRecord("index_1_distinct", "Human Readable", "human readable"));
This is less good than using getDistinctID defined above, as if there is
already a distinct value in the table it may throw an exceptiontable - the table into which to insert the recordvalue - the value to insertsortValue - the sort value to insertBrowseExceptionorg.dspace.browse.MappingResults updateDistinctMappings(java.lang.String table,
int itemID,
java.util.Set<java.lang.Integer> distinctIDs)
throws BrowseException
table - the mapping tableitemID - the item iddistinctIDs - the id of the distinct recordBrowseExceptionboolean testTableExistence(java.lang.String table)
throws BrowseException
table - the table to testBrowseExceptionjava.lang.String dropIndexAndRelated(java.lang.String table,
boolean execute)
throws BrowseException
table - The table to dropexecute - Whether to action the removal or notBrowseExceptionjava.lang.String dropSequence(java.lang.String sequence,
boolean execute)
throws BrowseException
sequence - the sequence to dropexecute - whether to action the removal or notBrowseExceptionjava.lang.String dropView(java.lang.String view,
boolean execute)
throws BrowseException
view - the view to dropexecute - whether to action the removal or notBrowseExceptionjava.lang.String createSequence(java.lang.String sequence,
boolean execute)
throws BrowseException
sequence - the sequence to createexecute - whether to action the create or notBrowseExceptionjava.lang.String createPrimaryTable(java.lang.String table,
java.util.List<java.lang.Integer> sortCols,
boolean execute)
throws BrowseException
List list = new ArrayList();
list.add(new Integer(1));
list.add(new Integer(2));
BrowseCreateDAO dao = BrowseDAOFactory.getCreateInstance();
dao.createPrimaryTable("index_1", list, true);
table - the raw table to createsortCols - a List of Integers numbering the sort columns requiredexecute - whether to action the create or notBrowseExceptionjava.lang.String[] createDatabaseIndices(java.lang.String table,
java.util.List<java.lang.Integer> sortCols,
boolean value,
boolean execute)
throws BrowseException
table - the table upon which to create indicessortCols - TODOexecute - whether to action the create or notBrowseExceptionjava.lang.String[] createMapIndices(java.lang.String disTable,
java.lang.String mapTable,
boolean execute)
throws BrowseException
disTable - the distinct table upon which to create indicesmapTable - the mapping table upon which to create indicesexecute - whether to action the create or notBrowseExceptionjava.lang.String createCollectionView(java.lang.String table,
java.lang.String view,
boolean execute)
throws BrowseException
table - the table to create the view onview - the name of the view to createexecute - whether to action the create or notBrowseExceptionjava.lang.String createCommunityView(java.lang.String table,
java.lang.String view,
boolean execute)
throws BrowseException
table - the table to create the view onview - the name of the view to createexecute - whether to action the create or notBrowseExceptionjava.util.List<java.lang.Integer> deleteMappingsByItemID(java.lang.String mapTable,
int itemID)
throws BrowseException
BrowseExceptionjava.lang.String createDistinctTable(java.lang.String table,
boolean execute)
throws BrowseException
table - the table to createexecute - whether to action the create or notBrowseExceptionjava.lang.String createDistinctMap(java.lang.String table,
java.lang.String map,
boolean execute)
throws BrowseException
table - the name of the distinct table which holds the target of the mappingmap - the name of the mapping table itselfexecute - whether to execute the query or notBrowseExceptionvoid pruneExcess(java.lang.String table,
boolean withdrawn)
throws BrowseException
table - the index table to checkwithdrawn - TODOBrowseExceptionvoid pruneMapExcess(java.lang.String map,
boolean withdrawn,
java.util.List<java.lang.Integer> distinctIds)
throws BrowseException
map - the name of the associated distinct mapping tablewithdrawn - TODOBrowseExceptionvoid pruneDistinct(java.lang.String table,
java.lang.String map,
java.util.List<java.lang.Integer> distinctIds)
throws BrowseException
table - the name of the distinct index tablemap - the name of the associated distinct mapping table.BrowseExceptionCopyright © 2013 DuraSpace. All Rights Reserved.