|
DLESE Tools v1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.repository.RecordDataService
Provides data related to a given collection-level record such as its associated IDs
and annotations. This class is used by class ItemFileIndexingWriter
to insert data into the index for
each record at index creation time.
RecordData
,
Query
Constructor Summary | |
---|---|
RecordDataService(String dbUrl,
MetadataVocab vocab,
String collBaseDir,
String annotationPathwaysSchemaUrl)
Constructor for a RecordDataService that has access to an MmdRecord Query service. |
Method Summary | |
---|---|
void |
closeIdMapper()
Closes the Query API after use, releasing it's memory. |
String |
getAccessionStatus(String IDs,
String collectionKeys)
Gets the accession status of the given resource or, if multiple resources get all statuses separated by spaces. |
ArrayList |
getAnnoPathwaysFromResultDocs(ResultDoc[] annoResultDocs)
Gets all annotation pathways in the given set of DleseAnnoDocReaders, or null if none exist. |
ArrayList |
getAnnoStatusFromResultDocs(ResultDoc[] annoResultDocs)
Gets the annoStatusFromReaders attribute of the RecordDataService object |
SimpleLuceneIndex |
getAnnotationsIndex()
Gets the annotationssIndex attribute of the RecordDataService object |
ArrayList |
getAnnoTypesFromResultDocs(ResultDoc[] annoResultDocs)
Gets all annotation types in the given set of DleseAnnoDocReaders, or null if none exist. |
String[] |
getAssociatedCollections(String ID,
String collectionKey)
Gets an array of collection keys for collections that also catalog this same resource. |
String[] |
getAssociatedIDs(String IDs,
String collectionKeys)
Gets the associatedIDs for the given IDs, records that catalog the same resource, or null if none exist. |
MmdRecord[] |
getAssociatedMMDRecs(String IDs,
String collectionKeys)
Gets the associatedIDs for the given IDs, records that catalog the same resource, or null if none exist. |
ArrayList |
getCollectionKeysFromResultDocs(ResultDoc[] collectionResults)
Gets all collection keys for the given documents. |
protected static String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout: |
ResultDoc |
getDisplayableItemResultDoc(String itemId)
Gets the ResultDoc for the given item-level metata record id but only if it should be displayed in discovery. |
ResultDoc[] |
getDisplayableItemResultDocs(String[] itemIds)
Gets the item result docs for each of the ids listed regardless, returning only those that should be displayed in discovery. |
ResultDoc[] |
getDleseAnnoResultDocs(String[] ids)
Gets the dleseAnnoResultDocs attribute of the RecordDataService object |
File |
getFileForId(MmdRecord rec)
Gets the fileForId attribute of the RecordDataService object |
String |
getFilePathForId(MmdRecord rec)
Gets the filePathForId attribute of the RecordDataService object |
String[] |
getIdentifiedErrors(String IDs,
String collectionKeys)
Gets all errors identified by the ID mapper service for the given IDs, or null if none exist. |
ResultDoc |
getItemResultDoc(String itemId)
Gets the ResultDoc for the given item-level metata record id regardless of the records status, or null if none exists. |
ResultDoc[] |
getItemResultDocs(String[] itemIds)
Gets the item result docs for each of the ids listed regardless of their status. |
SimpleLuceneIndex |
getitmesIndex()
Gets the itmesIndex attribute of the RecordDataService object |
MmdRecord |
getMmdRecord(String id,
String collectionKey)
Gets the ID mapper record for the given ID. |
MetadataVocab |
getVocab()
Gets the vocab attribute of the RecordDataService object |
static boolean |
hasDRCAnnotation(ResultDoc[] annoResultDocs)
Return true if there is an annotation present that is part of the DRC. |
void |
init(SimpleLuceneIndex itmesIndex,
SimpleLuceneIndex annotationsIndex,
RepositoryManager rm)
Initialize the RecordDataService. |
void |
initIdMapper(String metadataFormat)
Initializes the Query service. |
protected static void |
prtln(String s)
Output a line of text to standard out, with datestamp, if debug is set to true. |
protected static void |
prtlnErr(String s)
Output a line of text to error out, with datestamp. |
static void |
setDebug(boolean db)
Sets the debug attribute of the object |
void |
updateVocab(MetadataVocab newVocab)
Updates the MetadataVocab being used by this service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RecordDataService(String dbUrl, MetadataVocab vocab, String collBaseDir, String annotationPathwaysSchemaUrl)
dbUrl
- URL of the database, or use the String
"useRandomIds" to generate random associated IDs, or null if not using the Query
API.vocab
- The MetadataVocab to use, or null if not needed.collBaseDir
- Description of the ParameterannotationPathwaysSchemaUrl
- DESCRIPTIONQuery
Method Detail |
public void updateVocab(MetadataVocab newVocab)
newVocab
- The new MetadataVocab that will be used.public void init(SimpleLuceneIndex itmesIndex, SimpleLuceneIndex annotationsIndex, RepositoryManager rm)
itmesIndex
- The index where the collections reside.annotationsIndex
- The index where the annotations reside.rm
- DESCRIPTIONpublic void initIdMapper(String metadataFormat) throws MmdException
metadataFormat
- The metadataFormat of the files that will be searched for
associated IDs.
MmdException
- Description of the Exceptionpublic void closeIdMapper()
public String getFilePathForId(MmdRecord rec)
rec
- Description of the Parameter
public File getFileForId(MmdRecord rec)
rec
- Description of the Parameter
public String[] getAssociatedIDs(String IDs, String collectionKeys)
IDs
- An ID(s) to an item-level resource, separated by spaces.collectionKeys
- The collection keys for the collection of files, for example
"dcc" or "comet", separated by spaces.
public String[] getIdentifiedErrors(String IDs, String collectionKeys)
IDs
- An ID(s) to an item-level resource, separated by spaces.collectionKeys
- The collection keys for the collection of files, for example
"dcc" or "comet", separated by spaces.
public MmdRecord[] getAssociatedMMDRecs(String IDs, String collectionKeys)
IDs
- An ID(s) to an item-level resource, separated by spaces.collectionKeys
- The collection keys for the collection of files, for example
"dcc" or "comet", separated by spaces.
public MmdRecord getMmdRecord(String id, String collectionKey) throws MmdException
id
- The ID of a given record.collectionKey
- The collection in wich the given record resides.
MmdException
- If error retrieving the record info.public String[] getAssociatedCollections(String ID, String collectionKey)
ID
- The ID of a given record.collectionKey
- The collection in wich the given record resides.
public SimpleLuceneIndex getitmesIndex()
public SimpleLuceneIndex getAnnotationsIndex()
public String getAccessionStatus(String IDs, String collectionKeys)
IDs
- An ID(s) to an item-level resource, separated by spaces. If
more than one, the first ID is the primary one.collectionKeys
- The collection keys for the collection of files, for example
"dcc" or "comet", separated by spaces.
public ResultDoc getDisplayableItemResultDoc(String itemId)
itemId
- The ID to a given item-level record.
public ResultDoc[] getDisplayableItemResultDocs(String[] itemIds)
itemIds
- An array of IDs.
public ResultDoc getItemResultDoc(String itemId)
itemId
- The ID to a given item-level record.
public ResultDoc[] getItemResultDocs(String[] itemIds)
itemIds
- An array of IDs.
public ResultDoc[] getDleseAnnoResultDocs(String[] ids)
ids
- Description of the Parameter
public ArrayList getAnnoTypesFromResultDocs(ResultDoc[] annoResultDocs)
annoResultDocs
- DESCRIPTION
public ArrayList getAnnoStatusFromResultDocs(ResultDoc[] annoResultDocs)
annoResultDocs
- DESCRIPTION
public ArrayList getAnnoPathwaysFromResultDocs(ResultDoc[] annoResultDocs)
annoResultDocs
- DESCRIPTION
public static boolean hasDRCAnnotation(ResultDoc[] annoResultDocs)
annoResultDocs
- Annotation records.
public ArrayList getCollectionKeysFromResultDocs(ResultDoc[] collectionResults)
collectionResults
- DESCRIPTION
public MetadataVocab getVocab()
protected static final String getDateStamp()
protected static final void prtlnErr(String s)
s
- The text that will be output to error out.protected static final void prtln(String s)
s
- The String that will be output.public static void setDebug(boolean db)
db
- The new debug value
|
DLESE Tools v1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |