Search in sources :

Example 6 with LabelManager

use of edu.stanford.muse.LabelManager.LabelManager in project epadd by ePADD.

the class ArchiveReaderWriter method readLabelManager.

/*
    This method reads the lable-info.json file and fills the data structure of the label manager. Note that in future more and more system labels
    might get added to ePADD. However, to make those labels visible for the collections which were ingested using earlier version of ePADD we need to
    do some trick here. Once labels get loaded the system should check if all the system labels are present in label-info.json file or not. If not then
    that label should be added in LabelManager so that the label becomes visible to the archivist. First time we encountered this situation when we
    added a label 'Transfer-only-to-delivery' to transfer a message from processing to delivery mode but not to discovery mode (a restriction on 'do-not-transfer'
    label).
     */
private static LabelManager readLabelManager(String archiveID, String labMapDirPath) {
    LabelManager labelManager = null;
    try {
        labelManager = LabelManager.readObjectFromStream(archiveID, labMapDirPath);
    } catch (Exception e) {
        Util.print_exception("Exception in reading label manager from archive, assigning a new label manager", e, log);
        labelManager = new LabelManager(archiveID);
    }
    // Now fill in the system labels which are absent in labelManager object (read from the file).
    labelManager.syncWithSystemLabels();
    return labelManager;
}
Also used : LabelManager(edu.stanford.muse.LabelManager.LabelManager) ParseException(org.apache.lucene.queryparser.classic.ParseException) LockObtainFailedException(org.apache.lucene.store.LockObtainFailedException) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Aggregations

LabelManager (edu.stanford.muse.LabelManager.LabelManager)6 ParseException (org.apache.lucene.queryparser.classic.ParseException)5 CorrespondentAuthorityMapper (edu.stanford.muse.AddressBookManager.CorrespondentAuthorityMapper)4 AnnotationManager (edu.stanford.muse.AnnotationManager.AnnotationManager)4 AddressBook (edu.stanford.muse.AddressBookManager.AddressBook)3 Label (edu.stanford.muse.LabelManager.Label)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 CorruptIndexException (org.apache.lucene.index.CorruptIndexException)3 LockObtainFailedException (org.apache.lucene.store.LockObtainFailedException)3 LinkedHashMultimap (com.google.common.collect.LinkedHashMultimap)2 Multimap (com.google.common.collect.Multimap)2 Gson (com.google.gson.Gson)2 Config (edu.stanford.muse.Config)2 Blob (edu.stanford.muse.datacache.Blob)2 BlobStore (edu.stanford.muse.datacache.BlobStore)2 edu.stanford.muse.email (edu.stanford.muse.email)2 NameInfo (edu.stanford.muse.ie.NameInfo)2 EntityBook (edu.stanford.muse.ie.variants.EntityBook)2 EntityBookManager (edu.stanford.muse.ie.variants.EntityBookManager)2 NER (edu.stanford.muse.ner.NER)2