|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.browse.BrowseCreateDAOOracle
public class BrowseCreateDAOOracle
This class implements the BrowseCreateDAO interface for the Oracle database
as associated with the default DSpace installation. This class should not be
instantiated directly, but should be obtained via the BrowseDAOFactory:
Context context = new Context();
BrowseCreateDAO dao = BrowseDAOFactory.getCreateInstance(context);
This class will then be loaded if the appropriate configuration is made.
| Constructor Summary | |
|---|---|
BrowseCreateDAOOracle(Context context)
Required constructor for classes implementing the BrowseCreateDAO interface. |
|
| Method Summary | |
|---|---|
String |
createCollectionView(String table,
String view,
boolean execute)
Create the View of the full item index as seen from a collection. |
String |
createCommunityView(String table,
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. |
String[] |
createDatabaseIndices(String table,
List<Integer> sortCols,
boolean value,
boolean execute)
Create any indices that the implementing DAO sees fit to maximise performance. |
String |
createDistinctMap(String table,
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). |
String |
createDistinctTable(String table,
boolean execute)
Create the table which will hold the distinct metadata values that appear in multiple items. |
String[] |
createMapIndices(String disTable,
String mapTable,
boolean execute)
Create any indices that the implementing DAO sees fit to maximise performance. |
String |
createPrimaryTable(String table,
List<Integer> sortCols,
boolean execute)
Create the main index table. |
String |
createSequence(String sequence,
boolean execute)
Create the sequence with the given name. |
void |
deleteByItemID(String table,
int itemID)
Delete the record for the given item id from the specified table. |
void |
deleteCommunityMappings(int itemID)
|
List<Integer> |
deleteMappingsByItemID(String mapTable,
int itemID)
|
String |
dropIndexAndRelated(String table,
boolean execute)
Drop the given table name, and all other resources that are attached to it. |
String |
dropSequence(String sequence,
boolean execute)
Drop the given sequence name. |
String |
dropView(String view,
boolean execute)
Drop the given view name. |
int |
getDistinctID(String table,
String value,
String authority,
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(String table,
String value,
String authority,
String sortValue)
Insert the given value and sort value into the distinct index table. |
void |
insertIndex(String table,
int itemID,
Map<Integer,String> sortCols)
Insert an index record into the given table for the given item id. |
void |
pruneDistinct(String table,
String map,
List<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(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(String map,
boolean withdrawn,
List<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(String table)
Find out of a given table exists. |
void |
updateCommunityMappings(int itemID)
|
org.dspace.browse.MappingResults |
updateDistinctMappings(String table,
int itemID,
Set<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(String table,
int itemID,
Map<Integer,String> sortCols)
Updates an index record into the given table for the given item id. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BrowseCreateDAOOracle(Context context)
throws BrowseException
context - the DSpace context
BrowseException| Method Detail |
|---|
public String createCollectionView(String table,
String view,
boolean execute)
throws BrowseException
BrowseCreateDAO
createCollectionView in interface BrowseCreateDAOtable - the table to create the view onview - the name of the view to createexecute - whether to action the create or not
BrowseException
public String createCommunityView(String table,
String view,
boolean execute)
throws BrowseException
BrowseCreateDAO
createCommunityView in interface BrowseCreateDAOtable - the table to create the view onview - the name of the view to createexecute - whether to action the create or not
BrowseException
public String[] createDatabaseIndices(String table,
List<Integer> sortCols,
boolean value,
boolean execute)
throws BrowseException
BrowseCreateDAO
createDatabaseIndices in interface BrowseCreateDAOtable - the table upon which to create indicessortCols - TODOexecute - whether to action the create or not
BrowseException
public String[] createMapIndices(String disTable,
String mapTable,
boolean execute)
throws BrowseException
BrowseCreateDAO
createMapIndices in interface BrowseCreateDAOdisTable - the distinct table upon which to create indicesmapTable - the mapping table upon which to create indicesexecute - whether to action the create or not
BrowseException
public String createDistinctMap(String table,
String map,
boolean execute)
throws BrowseException
BrowseCreateDAO
createDistinctMap in interface BrowseCreateDAOtable - 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 not
BrowseException
public org.dspace.browse.MappingResults updateDistinctMappings(String table,
int itemID,
Set<Integer> distinctIDs)
throws BrowseException
BrowseCreateDAO
updateDistinctMappings in interface BrowseCreateDAOtable - the mapping tableitemID - the item iddistinctIDs - the id of the distinct record
BrowseException
public String createDistinctTable(String table,
boolean execute)
throws BrowseException
BrowseCreateDAO
createDistinctTable in interface BrowseCreateDAOtable - the table to createexecute - whether to action the create or not
BrowseException
public String createPrimaryTable(String table,
List<Integer> sortCols,
boolean execute)
throws BrowseException
BrowseCreateDAO
List list = new ArrayList();
list.add(new Integer(1));
list.add(new Integer(2));
BrowseCreateDAO dao = BrowseDAOFactory.getCreateInstance();
dao.createPrimaryTable("index_1", list, true);
createPrimaryTable in interface BrowseCreateDAOtable - the raw table to createsortCols - a List of Integers numbering the sort columns requiredexecute - whether to action the create or not
BrowseException
public String createSequence(String sequence,
boolean execute)
throws BrowseException
BrowseCreateDAO
createSequence in interface BrowseCreateDAOsequence - the sequence to createexecute - whether to action the create or not
BrowseException
public void deleteByItemID(String table,
int itemID)
throws BrowseException
BrowseCreateDAO
deleteByItemID in interface BrowseCreateDAOtable - the browse table to remove the index fromitemID - the database id of the item to remove the index for
BrowseException
public void deleteCommunityMappings(int itemID)
throws BrowseException
deleteCommunityMappings in interface BrowseCreateDAOBrowseException
public String dropIndexAndRelated(String table,
boolean execute)
throws BrowseException
BrowseCreateDAO
dropIndexAndRelated in interface BrowseCreateDAOtable - The table to dropexecute - Whether to action the removal or not
BrowseException
public String dropSequence(String sequence,
boolean execute)
throws BrowseException
BrowseCreateDAO
dropSequence in interface BrowseCreateDAOsequence - the sequence to dropexecute - whether to action the removal or not
BrowseException
public String dropView(String view,
boolean execute)
throws BrowseException
BrowseCreateDAO
dropView in interface BrowseCreateDAOview - the view to dropexecute - whether to action the removal or not
BrowseException
public int getDistinctID(String table,
String value,
String authority,
String sortValue)
throws BrowseException
BrowseCreateDAO
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.
getDistinctID in interface BrowseCreateDAOtable - 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 create
BrowseException
public void updateCommunityMappings(int itemID)
throws BrowseException
updateCommunityMappings in interface BrowseCreateDAOBrowseException
public int insertDistinctRecord(String table,
String value,
String authority,
String sortValue)
throws BrowseException
BrowseCreateDAO
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 exception
insertDistinctRecord in interface BrowseCreateDAOtable - the table into which to insert the recordvalue - the value to insertsortValue - the sort value to insert
BrowseException
public void insertIndex(String table,
int itemID,
Map<Integer,String> sortCols)
throws BrowseException
BrowseCreateDAO
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);
insertIndex in interface BrowseCreateDAOtable - 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 values
BrowseException
public boolean updateIndex(String table,
int itemID,
Map<Integer,String> sortCols)
throws BrowseException
BrowseCreateDAO
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);
updateIndex in interface BrowseCreateDAOtable - 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 values
BrowseException
public List<Integer> deleteMappingsByItemID(String mapTable,
int itemID)
throws BrowseException
deleteMappingsByItemID in interface BrowseCreateDAOBrowseException
public void pruneDistinct(String table,
String map,
List<Integer> distinctIds)
throws BrowseException
BrowseCreateDAO
pruneDistinct in interface BrowseCreateDAOtable - the name of the distinct index tablemap - the name of the associated distinct mapping table.
BrowseException
public void pruneExcess(String table,
boolean withdrawn)
throws BrowseException
BrowseCreateDAO
pruneExcess in interface BrowseCreateDAOtable - the index table to checkwithdrawn - TODO
BrowseException
public void pruneMapExcess(String map,
boolean withdrawn,
List<Integer> distinctIds)
throws BrowseException
BrowseCreateDAO
pruneMapExcess in interface BrowseCreateDAOmap - the name of the associated distinct mapping tablewithdrawn - TODO
BrowseException
public boolean testTableExistence(String table)
throws BrowseException
BrowseCreateDAO
testTableExistence in interface BrowseCreateDAOtable - the table to test
BrowseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||