15
15
import java .util .stream .Stream ;
16
16
import java .util .zip .ZipOutputStream ;
17
17
18
- import javax .faces .context .ExternalContext ;
19
- import javax .faces .context .FacesContext ;
20
-
21
- import io .goobi .vocabulary .exchange .FieldDefinition ;
22
- import io .goobi .vocabulary .exchange .VocabularySchema ;
23
- import io .goobi .workflow .api .vocabulary .APIException ;
24
- import io .goobi .workflow .api .vocabulary .VocabularyAPIManager ;
25
- import io .goobi .workflow .api .vocabulary .VocabularyRecordAPI ;
26
- import io .goobi .workflow .api .vocabulary .helper .ExtendedVocabulary ;
27
- import io .goobi .workflow .api .vocabulary .helper .ExtendedVocabularyRecord ;
28
18
import org .apache .commons .configuration .HierarchicalConfiguration ;
29
19
import org .apache .commons .configuration .XMLConfiguration ;
30
20
import org .apache .commons .configuration .tree .xpath .XPathExpressionEngine ;
54
44
import de .sub .goobi .persistence .managers .MySQLHelper ;
55
45
import de .sub .goobi .persistence .managers .ProcessManager ;
56
46
import de .sub .goobi .persistence .managers .ProjectManager ;
47
+ import io .goobi .vocabulary .exchange .FieldDefinition ;
48
+ import io .goobi .vocabulary .exchange .VocabularySchema ;
49
+ import io .goobi .workflow .api .vocabulary .APIException ;
50
+ import io .goobi .workflow .api .vocabulary .VocabularyAPIManager ;
51
+ import io .goobi .workflow .api .vocabulary .VocabularyRecordAPI ;
52
+ import io .goobi .workflow .api .vocabulary .helper .ExtendedVocabulary ;
53
+ import io .goobi .workflow .api .vocabulary .helper .ExtendedVocabularyRecord ;
54
+ import jakarta .faces .context .ExternalContext ;
55
+ import jakarta .faces .context .FacesContext ;
57
56
import lombok .Getter ;
58
57
import lombok .Setter ;
59
58
import lombok .extern .log4j .Log4j2 ;
@@ -480,18 +479,22 @@ public void prepareExport() {
480
479
}
481
480
482
481
if (searchAgain ) {
483
- ExtendedVocabulary publishersVocabulary = VocabularyAPIManager .getInstance ().vocabularies ().findByName ("Publishers" );
484
- VocabularySchema schema = VocabularyAPIManager .getInstance ().vocabularySchemas ().get (publishersVocabulary .getSchemaId ());
485
- Optional <Long > correctedValueDefinitionId = schema .getDefinitions ().stream ()
486
- .filter (d -> d .getName ().equals ("Corrected value" ))
482
+ ExtendedVocabulary publishersVocabulary =
483
+ VocabularyAPIManager .getInstance ().vocabularies ().findByName ("Publishers" );
484
+ VocabularySchema schema =
485
+ VocabularyAPIManager .getInstance ().vocabularySchemas ().get (publishersVocabulary .getSchemaId ());
486
+ Optional <Long > correctedValueDefinitionId = schema .getDefinitions ()
487
+ .stream ()
488
+ .filter (d -> "Corrected value" .equals (d .getName ()))
487
489
.map (FieldDefinition ::getId )
488
490
.findFirst ();
489
491
490
492
if (correctedValueDefinitionId .isEmpty ()) {
491
493
log .error ("Unable to find definition id for field \" Corrected value\" " );
492
494
continue ;
493
495
} else {
494
- List <ExtendedVocabularyRecord > hits = VocabularyAPIManager .getInstance ().vocabularyRecords ()
496
+ List <ExtendedVocabularyRecord > hits = VocabularyAPIManager .getInstance ()
497
+ .vocabularyRecords ()
495
498
.list (publishersVocabulary .getId ())
496
499
.search (correctedValueDefinitionId .get () + ":" + publisherLat )
497
500
.all ()
@@ -501,7 +504,8 @@ public void prepareExport() {
501
504
if (hits .size () == 1 ) {
502
505
rec = hits .get (0 );
503
506
} else {
504
- log .error ("Search result for publisher \" {}\" not existing or not unique, skipping" , publisherLat );
507
+ log .error ("Search result for publisher \" {}\" not existing or not unique, skipping" ,
508
+ publisherLat );
505
509
continue ;
506
510
}
507
511
}
0 commit comments