|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.repository.RecordDataService
public class 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
Field Summary | |
---|---|
static int |
QUERY_BOTH
Use to query within both other and the same collection |
static int |
QUERY_OTHER
Use to query within a other collection |
static int |
QUERY_SAME
Use to query within a the same collection |
Constructor Summary | |
---|---|
RecordDataService(String dbUrl,
MetadataVocab vocab,
String collBaseDir,
String annotationPathwaysSchemaUrl)
Constructor for a RecordDataService that has access to an MmdRec Query service. |
Method Summary | |
---|---|
void |
closeIdMapper()
Closes the local Query Object, releasing it's resources. |
void |
closeIdMapperQueryObject(Query queryObject)
Closes an IDMapper Query object, releasing its resources. |
String |
getAccessionStatus(MmdRec[] mmdRecs)
Gets the accession status of the given records or, if multiple resources get all statuses separated by spaces. |
ArrayList |
getAnnoFormatsFromResultDocs(ResultDocList annoResultDocs)
Gets the annotation formats from the anno result docs. |
ArrayList |
getAnnoPathwaysFromResultDocs(ResultDocList annoResultDocs)
Gets all annotation pathways in the given set of DleseAnnoDocReaders, or null if none exist. |
ArrayList |
getAnnoStatusFromResultDocs(ResultDocList annoResultDocs)
Gets the annoStatusFromReaders attribute of the RecordDataService object |
ArrayList |
getAnnoTypesFromResultDocs(ResultDocList annoResultDocs)
Gets all annotation types in the given set of DleseAnnoDocReaders, or null if none exist. |
String[] |
getAssociatedIDs(String id,
MmdRec[] associatedMmdRecs)
Gets the IDs for records that catalog the same resource, not including the ID that is given. |
MmdRec[] |
getAssociatedMMDRecs(int queryType,
String IDs,
String collectionKeys)
Gets the associated MMD records for the given IDs, records that catalog the same resource, or null if none exist, using the local Query Object. |
MmdRec[] |
getAssociatedMMDRecs(int queryType,
String IDs,
String collectionKeys,
Query qo)
Gets the associated MMD records for the given IDs, records that catalog the same resource, or null if none exist, using the given Query Object. |
String |
getCollectCollectionID()
Returns the value of collectCollectionID. |
ArrayList |
getCollectionKeysFromResultDocs(ResultDocList collectionResults)
Gets all collection keys encoded by Vocab Mgr, for example {06, 08}, for the given records. |
ArrayList |
getCompletedAnnoCollectionKeysFromResultDocs(ResultDocList annoResultDocs)
Gets a list of keys, for example {06, 04}, for each of the annotation collections that have at least one status completed record. |
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. |
ResultDocList |
getDisplayableItemResultDocs(String[] itemIds)
Gets the item result docs for each of the ids listed regardless, returning only those that should be displayed in discovery. |
ResultDocList |
getDleseAnnoResultDocs(String[] ids)
Gets the DLESEAnno docs that annotate the given ids, or null if none. |
File |
getFileForId(MmdRec rec)
Gets the fileForId attribute of the RecordDataService object |
String |
getFilePathForId(MmdRec rec)
Gets the filePathForId attribute of the RecordDataService object |
String[] |
getIdentifiedErrors(MmdRec[] mmdRecs)
Gets all errors identified by the ID mapper service for the given records, or null if none exist. |
Query |
getIdMapperQueryObject()
Gets a IDMapper Query Object to use in getMmdRec(String, String, Query) or getAssociatedMMDRecs(int, String, String, Query) . |
SimpleLuceneIndex |
getIndex()
Gets the index used by this RecordData service to retrieve data. |
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. |
ResultDocList |
getItemResultDocs(String[] itemIds)
Gets the item result docs for each of the ids listed regardless of their status. |
MmdRec |
getMmdRec(String id,
String collectionKey)
Gets the ID mapper record for the given ID using the local Query Object. |
MmdRec |
getMmdRec(String id,
String collectionKey,
Query qo)
Gets the ID mapper record for the given ID using the given Query Object. |
MetadataVocab |
getVocab()
Gets the vocab attribute of the RecordDataService object |
static boolean |
hasDRCAnnotation(ResultDocList annoResultDocs)
Return true if there is an annotation present that is part of the DRC. |
static boolean |
hasDRCItem(ResultDocList itemResultDocs)
Return true if there is an item present that is part of the DRC as determined by the items collection. |
void |
init(RepositoryManager rm)
Initialize the RecordDataService. |
void |
initIdMapper()
Initializes the local Query Object. |
boolean |
isIdMapperDisabled()
Gets the idMapperDisabled attribute of the RecordDataService object |
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. |
void |
setCollectCollectionID(String collectCollectionID)
Sets the value of collectCollectionID. |
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 |
Field Detail |
---|
public static int QUERY_OTHER
public static int QUERY_SAME
public static int QUERY_BOTH
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
- URL to the annotation pathways schemaQuery
Method Detail |
---|
public void updateVocab(MetadataVocab newVocab)
newVocab
- The new MetadataVocab that will be used.public void init(RepositoryManager rm)
rm
- The RepositoryManagerpublic SimpleLuceneIndex getIndex()
public String getCollectCollectionID()
public void setCollectCollectionID(String collectCollectionID)
collectCollectionID
- The value to assign collectCollectionID.public Query getIdMapperQueryObject()
getMmdRec(String, String, Query)
or getAssociatedMMDRecs(int, String, String, Query)
. The Query may be used multiple times. After use, the
caller must be sure to close the Query using the closeIdMapperQueryObject(Query)
.
public void closeIdMapperQueryObject(Query queryObject)
queryObject
- The Query Object to closepublic void initIdMapper()
public void closeIdMapper()
public boolean isIdMapperDisabled()
public String getFilePathForId(MmdRec rec)
rec
- Description of the Parameter
public File getFileForId(MmdRec rec)
rec
- Description of the Parameter
public String[] getAssociatedIDs(String id, MmdRec[] associatedMmdRecs)
id
- The id to the item-level record - will be ommitted from the list of
associatedIDsassociatedMmdRecs
- An array of MmdRecs
public String[] getIdentifiedErrors(MmdRec[] mmdRecs)
mmdRecs
- An array of MmdRecords
public MmdRec[] getAssociatedMMDRecs(int queryType, String IDs, String collectionKeys, Query qo)
IDs
- An ID(s) to an item-level resource, separated by spaces - the first is usedcollectionKeys
- The collection keys for the collection of files, for example "dcc" or "comet",
separated by spaces - the first is usedqueryType
- Specify to look in other or the same collectionqo
- The IDMapper Query Object to use
public MmdRec[] getAssociatedMMDRecs(int queryType, 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.queryType
- Specify to look in other or the same collection
public MmdRec getMmdRec(String id, String collectionKey, Query qo)
id
- The ID of a given record, for example DLESE-000-000-000-001.collectionKey
- The collection in which the given record resides, for example dcc.qo
- The Query Object to use
public MmdRec getMmdRec(String id, String collectionKey)
id
- The ID of a given record, for example DLESE-000-000-000-001.collectionKey
- The collection in which the given record resides, for example dcc.
public String getAccessionStatus(MmdRec[] mmdRecs)
mmdRecs
- The MmdRecords
public ResultDoc getDisplayableItemResultDoc(String itemId)
itemId
- The ID to a given item-level record.
public ResultDocList getDisplayableItemResultDocs(String[] itemIds)
itemIds
- An array of IDs.
public ResultDoc getItemResultDoc(String itemId)
itemId
- The ID to a given item-level record.
public ResultDocList getItemResultDocs(String[] itemIds)
itemIds
- An array of IDs.
public ResultDocList getDleseAnnoResultDocs(String[] ids)
ids
- Ids for records in the repository.
public ArrayList getAnnoTypesFromResultDocs(ResultDocList annoResultDocs)
annoResultDocs
- An array of ResultDocs
public ArrayList getAnnoStatusFromResultDocs(ResultDocList annoResultDocs)
annoResultDocs
- An array of ResultDocs
public ArrayList getAnnoFormatsFromResultDocs(ResultDocList annoResultDocs)
annoResultDocs
- An array of ResultDocs
public ArrayList getCompletedAnnoCollectionKeysFromResultDocs(ResultDocList annoResultDocs)
annoResultDocs
- An array of ResultDocs of annotation records
public ArrayList getAnnoPathwaysFromResultDocs(ResultDocList annoResultDocs)
annoResultDocs
- An array of ResultDocs
public static boolean hasDRCAnnotation(ResultDocList annoResultDocs)
annoResultDocs
- Annotation records.
public static boolean hasDRCItem(ResultDocList itemResultDocs)
itemResultDocs
- Array of Item result docs.
public ArrayList getCollectionKeysFromResultDocs(ResultDocList collectionResults)
collectionResults
- ResultDocs of records
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.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |