66import java .util .logging .Logger ;
77import java .util .logging .SimpleFormatter ;
88
9- import org .um .dsi .gavea .orcid .model .common .ExternalId ;
10- import org .um .dsi .gavea .orcid .model .common .ExternalIds ;
119import org .um .dsi .gavea .orcid .model .common .FuzzyDate ;
1210import org .um .dsi .gavea .orcid .model .common .FuzzyDate .Year ;
1311import org .um .dsi .gavea .orcid .model .common .RelationshipType ;
12+ import org .um .dsi .gavea .orcid .model .work .ExternalIdentifier ;
13+ import org .um .dsi .gavea .orcid .model .work .ExternalIdentifierType ;
1414import org .um .dsi .gavea .orcid .model .work .Work ;
15+ import org .um .dsi .gavea .orcid .model .work .WorkExternalIdentifiers ;
1516import org .um .dsi .gavea .orcid .model .work .WorkTitle ;
1617import org .um .dsi .gavea .orcid .model .work .WorkType ;
1718
@@ -25,8 +26,8 @@ public class TestHelper {
2526 public static Work work (BigInteger key , String meta ) {
2627 Work work = new Work ();
2728
28- ExternalIds uids = new ExternalIds ();
29- work .setExternalIds (uids );
29+ WorkExternalIdentifiers uids = new WorkExternalIdentifiers ();
30+ work .setExternalIdentifiers (uids );
3031
3132 work .setPutCode (key );
3233
@@ -50,114 +51,89 @@ public static Work work(BigInteger key, String meta) {
5051 public static Work workDOI (BigInteger key , String meta , String doi ) {
5152 Work work = work (key , meta );
5253
53- ExternalId e1 = new ExternalId ();
54- e1 .setExternalIdRelationship (RelationshipType .SELF );
55- e1 .setExternalIdValue (doi );
56- e1 .setExternalIdType ( "doi" );
54+ ExternalIdentifier e1 = new ExternalIdentifier ();
55+ e1 .setRelationship (RelationshipType .SELF );
56+ e1 .setExternalIdentifierId (doi );
57+ e1 .setExternalIdentifierType ( ExternalIdentifierType . DOI );
5758
58- work .getExternalIds ().getExternalId ().add (e1 );
59+ work .getExternalIdentifiers ().getWorkExternalIdentifier ().add (e1 );
5960
6061 return work ;
6162 }
6263
63- public static Work workUnk (BigInteger key , String meta , String doi ) {
64- Work work = work (key , meta );
65-
66- ExternalId e1 = new ExternalId ();
67- e1 .setExternalIdRelationship (RelationshipType .SELF );
68- e1 .setExternalIdValue (doi );
69- e1 .setExternalIdType ("ukn" );
70-
71- work .getExternalIds ().getExternalId ().add (e1 );
72-
73- return work ;
74- }
75-
76- public static Work workDOIUnk (BigInteger key , String meta , String doi , String eid ) {
77- Work work = workDOI (key , meta , doi );
78-
79- ExternalId e = new ExternalId ();
80- e .setExternalIdRelationship (RelationshipType .SELF );
81- e .setExternalIdValue (eid );
82- e .setExternalIdType ("wosuid-" );
83-
84- work .getExternalIds ().getExternalId ().add (e );
85- return work ;
86- }
87-
8864 public static Work workHANDLE (BigInteger key , String meta , String handle ) {
8965 Work work = work (key , meta );
9066
91- ExternalId e1 = new ExternalId ();
92- e1 .setExternalIdRelationship (RelationshipType .SELF );
93- e1 .setExternalIdValue (handle );
94- e1 .setExternalIdType ( "handle" );
67+ ExternalIdentifier e1 = new ExternalIdentifier ();
68+ e1 .setRelationship (RelationshipType .SELF );
69+ e1 .setExternalIdentifierId (handle );
70+ e1 .setExternalIdentifierType ( ExternalIdentifierType . HANDLE );
9571
96- work .getExternalIds ().getExternalId ().add (e1 );
72+ work .getExternalIdentifiers ().getWorkExternalIdentifier ().add (e1 );
9773
9874 return work ;
9975 }
10076
10177 public static Work workDOIEID (BigInteger key , String meta , String doi , String eid ) {
10278 Work work = workDOI (key , meta , doi );
10379
104- ExternalId e = new ExternalId ();
105- e .setExternalIdRelationship (RelationshipType .SELF );
106- e .setExternalIdValue (eid );
107- e .setExternalIdType ( "eid" );
80+ ExternalIdentifier e = new ExternalIdentifier ();
81+ e .setRelationship (RelationshipType .SELF );
82+ e .setExternalIdentifierId (eid );
83+ e .setExternalIdentifierType ( ExternalIdentifierType . EID );
10884
109- work .getExternalIds ().getExternalId ().add (e );
85+ work .getExternalIdentifiers ().getWorkExternalIdentifier ().add (e );
11086 return work ;
11187 }
11288
11389 public static Work workDOIHANDLE (BigInteger key , String meta , String doi , String handle ) {
11490 Work work = workDOI (key , meta , doi );
11591
116- ExternalId e = new ExternalId ();
117- e .setExternalIdRelationship (RelationshipType .SELF );
118- e .setExternalIdValue (handle );
119- e .setExternalIdType ( "handle" );
92+ ExternalIdentifier e = new ExternalIdentifier ();
93+ e .setRelationship (RelationshipType .SELF );
94+ e .setExternalIdentifierId (handle );
95+ e .setExternalIdentifierType ( ExternalIdentifierType . HANDLE );
12096
121- work .getExternalIds ().getExternalId ().add (e );
97+ work .getExternalIdentifiers ().getWorkExternalIdentifier ().add (e );
12298
12399 return work ;
124100 }
125101
126102 public static Work workEIDHANDLE (BigInteger key , String meta , String eid , String handle ) {
127103 Work work = workHANDLE (key , meta , handle );
128104
129- ExternalId e = new ExternalId ();
130- e .setExternalIdRelationship (RelationshipType .SELF );
131- e .setExternalIdValue (eid );
132- e .setExternalIdType ( "eid" );
105+ ExternalIdentifier e = new ExternalIdentifier ();
106+ e .setRelationship (RelationshipType .SELF );
107+ e .setExternalIdentifierId (eid );
108+ e .setExternalIdentifierType ( ExternalIdentifierType . EID );
133109
134- work .getExternalIds ().getExternalId ().add (e );
110+ work .getExternalIdentifiers ().getWorkExternalIdentifier ().add (e );
135111
136112 return work ;
137113 }
138114
139115 public static Work workDOIEIDHANDLE (BigInteger key , String meta , String doi , String eid , String handle ) {
140116 Work work = workDOIEID (key , meta , doi , eid );
141117
142- ExternalId e2 = new ExternalId ();
143- e2 .setExternalIdRelationship (RelationshipType .SELF );
144- e2 .setExternalIdValue (handle );
145- e2 .setExternalIdType ( "handle" );
118+ ExternalIdentifier e2 = new ExternalIdentifier ();
119+ e2 .setRelationship (RelationshipType .SELF );
120+ e2 .setExternalIdentifierId (handle );
121+ e2 .setExternalIdentifierType ( ExternalIdentifierType . HANDLE );
146122
147- work .getExternalIds ().getExternalId ().add (e2 );
123+ work .getExternalIdentifiers ().getWorkExternalIdentifier ().add (e2 );
148124
149125 return work ;
150126 }
151127
152128 public static Work workDOIDOIEIDHANDLE (BigInteger key , String meta , String doi1 , String doi2 , String eid , String handle ) {
153129 Work work = workDOIEIDHANDLE (key , meta , doi1 , eid , handle );
154130
155- ExternalId e1 = new ExternalId ();
156- e1 .setExternalIdRelationship (RelationshipType .SELF );
157- e1 .setExternalIdValue (doi2 );
158- e1 .setExternalIdType ( "doi" );
131+ ExternalIdentifier e1 = new ExternalIdentifier ();
132+ e1 .setRelationship (RelationshipType .SELF );
133+ e1 .setExternalIdentifierId (doi2 );
134+ e1 .setExternalIdentifierType ( ExternalIdentifierType . DOI );
159135
160- work .getExternalIds ().getExternalId ().add (e1 );
136+ work .getExternalIdentifiers ().getWorkExternalIdentifier ().add (e1 );
161137
162138 return work ;
163139 }
0 commit comments